/* Absensi Abu Dhabi — stylesheet (dipisah dari Index.html).
   Sumber tunggal; Index.html memuatnya via <link rel="stylesheet" href="styles.css">. */
/* Inter di-self-host (variable, subset latin) — tanpa CDN, jalan offline. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('fonts/inter-var-latin.woff2') format('woff2');
}
:root {
  --bg: #f5f7fc; --card: #ffffff; --line: #e9edf5; --line2: #dbe1ee;
  --text: #131a26; --muted: #5f6b80; --faint: #97a1b4;
  --primary: #3b6ef5; --primary-dark: #2c56c9; --primary-soft: #eaf0ff;
  --grad: linear-gradient(135deg, #3b6ef5 0%, #6a4df5 100%);
  --hadir: #1f9d55; --telat: #d9a406; --absen: #d64545; --izin: #2f74e0;
  --radius: 14px; --radius-lg: 18px; --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.05);
  --shadow: 0 1px 3px rgba(16,24,40,.05), 0 6px 16px -6px rgba(16,24,40,.10);
  --shadow-md: 0 6px 20px -6px rgba(16,24,40,.16), 0 2px 6px -2px rgba(16,24,40,.06);
  --shadow-lg: 0 28px 56px -16px rgba(16,24,40,.32);
  --ring: 0 0 0 4px rgba(59,110,245,.16);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility; letter-spacing: -.011em; line-height: 1.5;
  padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
::selection { background: rgba(59,110,245,.22); }
.btn:focus-visible, .tab:focus-visible, .icon-btn:focus-visible, a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
header { position: relative; overflow: hidden; color: #fff; padding: 20px 18px 18px;
  background: linear-gradient(135deg, #3b6ef5 0%, #5654f3 55%, #6a4df5 100%);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  box-shadow: 0 8px 28px -10px rgba(59,110,245,.55); }
header::after { content: ""; position: absolute; top: -60%; right: -8%; width: 340px; height: 340px;
  background: radial-gradient(circle, rgba(255,255,255,.22), transparent 62%); pointer-events: none; }
header h1 { margin: 0; font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; }
header p { margin: 3px 0 0; font-size: .8rem; opacity: .88; font-weight: 500; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; position: relative; z-index: 1; }
.flag { display: block; border-radius: 3px; box-shadow: 0 0 0 1px rgba(255,255,255,.5); flex: 0 0 auto; }
.theme-btn { background: rgba(255,255,255,.16); border: none; color: #fff; width: 40px; height: 40px;
  border-radius: 50%; font-size: 1.05rem; cursor: pointer; flex: 0 0 auto; line-height: 1;
  backdrop-filter: blur(8px); transition: background .2s, transform .2s; }
.theme-btn:hover { background: rgba(255,255,255,.3); transform: translateY(-1px); }
.hdr-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; position: relative; z-index: 1; }
.auth-btn { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25); color: #fff; padding: 0 16px; height: 40px;
  border-radius: 22px; font-size: .82rem; font-weight: 700; cursor: pointer; white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis;
  backdrop-filter: blur(8px); transition: background .2s, transform .2s; }
.auth-btn:hover { background: rgba(255,255,255,.3); transform: translateY(-1px); }
.tabs { display: flex; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10; overflow-x: auto; box-shadow: 0 4px 14px -10px rgba(16,24,40,.35); }
.tab { flex: 1 0 auto; padding: 14px 16px; text-align: center; font-size: .84rem; font-weight: 600;
  color: var(--muted); border: none; background: none; cursor: pointer; border-bottom: 3px solid transparent;
  white-space: nowrap; transition: color .18s, background .18s, border-color .18s; }
.tab:hover { color: var(--text); background: var(--primary-soft); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
/* Bottom nav (gaya aplikasi mobile) */
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex;
  background: var(--card); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px -10px rgba(16,24,40,.35); padding-bottom: env(safe-area-inset-bottom, 0px); }
.bn-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 8px 4px 7px; border: none; background: none; cursor: pointer; color: var(--muted);
  font-size: .66rem; font-weight: 700; font-family: inherit; transition: color .15s; }
.bn-item .bn-ico { font-size: 1.3rem; line-height: 1; }
.bn-ico svg { width: 22px; height: 22px; display: block; }
.di-ico svg { width: 26px; height: 26px; display: block; }
.bn-item.active { color: var(--primary); }
.bn-item:hover { color: var(--text); }
.drawer-overlay { position: fixed; inset: 0; z-index: 45; background: rgba(15,23,42,.5); backdrop-filter: blur(4px); display: none; }
.drawer-overlay.show { display: block; }
.drawer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 46; background: var(--card);
  border-radius: 18px 18px 0 0; box-shadow: var(--shadow-lg);
  padding: 14px 16px calc(18px + env(safe-area-inset-bottom, 0px)); animation: drawerIn .22s ease; }
@keyframes drawerIn { from { transform: translateY(100%); } to { transform: none; } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 1rem; }
.drawer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.drawer-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 8px;
  background: var(--primary-soft); border: 1px solid var(--line); border-radius: 12px; cursor: pointer;
  color: var(--text); font-size: .82rem; font-weight: 600; font-family: inherit; transition: border-color .15s; text-decoration: none; }
.drawer-item .di-ico { font-size: 1.5rem; line-height: 1; }
.drawer-item.active { border-color: var(--primary); color: var(--primary-dark); }
.drawer-item:hover { border-color: var(--primary); }
/* Daftar menu/panduan gaya list (ikon · judul + deskripsi · panah) */
.menu-list { display: flex; flex-direction: column; }
.menu-item { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 14px 2px; background: none; border: none; border-bottom: 1px solid var(--line); cursor: pointer;
  color: var(--text); font-family: inherit; text-decoration: none; transition: background .15s; border-radius: 8px; }
.menu-item:last-child { border-bottom: none; }
.menu-item:hover { background: var(--primary-soft); }
.mi-ico { flex: 0 0 auto; color: var(--primary); display: flex; align-items: center; justify-content: center; }
.mi-ico svg { width: 26px; height: 26px; display: block; }
.mi-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mi-title { font-weight: 700; font-size: .96rem; }
.mi-desc { font-size: .78rem; color: var(--muted); }
.mi-arrow { flex: 0 0 auto; color: var(--faint); font-size: 1.4rem; line-height: 1; padding-right: 4px; }
.menu-item.sub { padding-left: 24px; }
.menu-item.sub .mi-ico { color: var(--muted); }
.menu-item.sub .mi-ico svg { width: 20px; height: 20px; }
.menu-item.sub .mi-title { font-weight: 600; font-size: .9rem; }
main { padding: 22px 16px; max-width: 860px; margin: 0 auto; }
.view { display: none; } .view.active { display: block; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; transition: box-shadow .22s, border-color .22s; }
.card:hover { box-shadow: var(--shadow-md); }
.card h2 { margin: 0 0 14px; font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em; }
label { display: block; font-size: .78rem; font-weight: 600; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea { width: 100%; padding: 11px 13px; border: 1px solid var(--line2); border-radius: var(--radius-sm);
  font-size: .92rem; font-family: inherit; background: #fff; color: var(--text); transition: border-color .18s, box-shadow .18s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
/* iOS Safari: input date/time punya rendering bawaan sendiri — samakan ukurannya
   dengan input lain, cegah kolaps saat kosong & meluber melebihi kontainer. */
input[type="date"], input[type="time"] {
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; min-width: 0; max-width: 100%;
  min-height: 42px; text-align: left;
}
input[type="date"]::-webkit-date-and-time-value,
input[type="time"]::-webkit-date-and-time-value {
  text-align: left; min-height: 1.3em; margin: 0;
}
textarea { resize: vertical; min-height: 54px; }
input[readonly] { background: #f3f5f9; color: var(--muted); }
.btn { margin-top: 14px; width: 100%; background: var(--grad); color: #fff; border: none;
  padding: 13px; border-radius: var(--radius-sm); font-size: .92rem; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 16px -6px rgba(59,110,245,.6); transition: transform .18s, box-shadow .18s, filter .18s; }
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 10px 22px -8px rgba(59,110,245,.7); }
.btn:active { transform: translateY(0); }
.btn.secondary { background: #eef1f7; color: var(--text); box-shadow: none; }
.btn.secondary:hover { filter: none; transform: none; box-shadow: none; background: var(--primary-soft); color: var(--primary-dark); }
.btn.ghost { background: none; border: 1px solid var(--line2); color: var(--text); box-shadow: none; }
.btn.ghost:hover { filter: none; transform: none; box-shadow: none; background: var(--primary-soft); border-color: var(--primary); }
.btn.sm { width: auto; margin: 0; padding: 9px 16px; font-size: .84rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none !important; transform: none !important; box-shadow: none !important; }
.btn.join { background: linear-gradient(135deg, #1f9d55, #14b8a6); box-shadow: 0 6px 16px -6px rgba(31,157,85,.55);
  text-align: center; text-decoration: none; display: block; }
.ci-status { padding: 10px 13px; border-radius: var(--radius-sm); font-size: .85rem; font-weight: 600; margin-bottom: 12px; }
.ci-status.open { background: #e3f5ea; color: var(--hadir); border: 1px solid rgba(31,157,85,.2); }
.ci-status.wait { background: #fbf2d6; color: #a97e05; border: 1px solid rgba(217,164,6,.22); }
.ci-status.closed { background: var(--primary-soft); color: var(--muted); border: 1px solid var(--line); }
.ci-btns { display: flex; gap: 6px; flex-shrink: 0; }
.muted { color: var(--muted); font-size: .82rem; }
.empty { text-align: center; color: var(--muted); padding: 32px 12px; font-size: .9rem; line-height: 1.6; }
.row { display: flex; gap: 10px; } .row > * { flex: 1; }

/* Absensi */
.att-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 0;
  border-bottom: 1px solid var(--line); gap: 10px; }
.att-item:last-child { border-bottom: none; }
.att-name { font-weight: 600; font-size: .92rem; }
.att-sub { font-size: .74rem; color: var(--muted); }
.seg { display: flex; gap: 4px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.seg button { border: 1px solid var(--line2); background: var(--card); color: var(--muted);
  padding: 7px 11px; border-radius: 9px; font-size: .72rem; font-weight: 700; cursor: pointer; transition: all .14s; }
.seg button.on.h { background: var(--hadir); border-color: var(--hadir); color: #fff; }
.seg button.on.t { background: var(--telat); border-color: var(--telat); color: #3a2c00; } /* teks gelap di kuning agar terbaca (kontras tinggi) */
.seg button.on.a { background: var(--absen); border-color: var(--absen); color: #fff; }
.seg button.on.i { background: var(--izin); border-color: var(--izin); color: #fff; }

.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-top: 10px; }
.fsel { padding: 8px 10px; font-size: .82rem; }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.stat { flex: 1; text-align: center; padding: 14px 6px; border-radius: var(--radius-sm); border: 1px solid transparent; }
.stat b { display: block; font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.stat.h { background: #e3f5ea; color: var(--hadir); border-color: rgba(31,157,85,.18); }
.stat.t { background: #fbf2d6; color: #a97e05; border-color: rgba(217,164,6,.22); }
.stat.a { background: #fbe3e3; color: var(--absen); border-color: rgba(214,69,69,.18); }
.stat.i { background: #e7effc; color: var(--izin); border-color: rgba(47,116,224,.2); }

/* Peserta list */
.p-item { padding: 13px 12px; border-bottom: 1px solid var(--line); border-radius: 10px; transition: background .15s; }
.p-item:hover { background: rgba(127,140,170,.06); }
.p-item:last-child { border-bottom: none; }
.p-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.p-name { font-weight: 700; font-size: .96rem; }
.p-uid { font-family: ui-monospace, Consolas, monospace; font-size: .72rem; color: var(--faint); }
.p-meta { font-size: .8rem; color: var(--muted); margin-top: 3px; }
.p-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; align-items: stretch; }
.p-btnrow { display: flex; gap: 6px; }
/* HP: cluster tombol turun ke bawah info (hindari geser samping) */
@media (max-width: 560px) {
  .p-top { flex-direction: column; align-items: stretch; }
  .p-actions { align-self: stretch; }
  .p-btnrow { justify-content: flex-start; }
}
.icon-btn { border: 1px solid var(--line2); background: var(--card); border-radius: 9px; padding: 7px 11px;
  font-size: .76rem; font-weight: 600; cursor: pointer; color: var(--text); transition: border-color .16s, background .16s, color .16s; }
.icon-btn.danger { color: var(--absen); border-color: #f0c4c4; }
.icon-btn:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); }
.badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.badge { font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; background: #eef1f7; color: var(--muted); }
.badge.green { background: #e3f5ea; color: var(--hadir); }
.badge.amber { background: #fbf2d6; color: #a97e05; }
.badge.red { background: #fbe3e3; color: var(--absen); }
.badge.blue { background: var(--primary-soft); color: var(--primary-dark); }
.status-sel { -webkit-appearance: none; appearance: none; border: none; border-radius: 9px; width: 100%; box-sizing: border-box;
  padding: 7px 26px 7px 12px; font-size: .76rem; font-weight: 700; cursor: pointer; font-family: inherit; text-align: center; text-align-last: center;
  background-repeat: no-repeat; background-position: right 9px center; background-size: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
.status-sel.green { background-color: #e3f5ea; color: var(--hadir); }
.status-sel.amber { background-color: #fbf2d6; color: #a97e05; }
.status-sel.red { background-color: #fbe3e3; color: var(--absen); }
.status-sel:disabled { opacity: .6; cursor: wait; }
.rel-tag { font-size: .74rem; color: var(--muted); display: block; margin-top: 5px; }

/* Modal */
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,.55); backdrop-filter: blur(4px); display: none;
  align-items: flex-start; justify-content: center; z-index: 50; padding: 20px 12px; overflow-y: auto; }
.overlay.show { display: flex; }
.modal { background: var(--card); border-radius: 16px; width: 100%; max-width: 640px;
  box-shadow: var(--shadow-lg); margin: auto; animation: modalIn .22s ease; }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); border-radius: 16px 16px 0 0; }
.modal-head h2 { margin: 0; font-size: 1.05rem; }
.modal-close { border: none; background: none; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--muted); }
.modal-body { padding: 6px 18px 18px; }
.modal-foot { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line);
  position: sticky; bottom: 0; background: var(--card); border-radius: 0 0 16px 16px; }
.modal-foot .btn { margin-top: 0; }

.fsec { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--primary); margin: 18px 0 2px; padding-top: 12px; border-top: 1px dashed var(--line2); }
.fsec:first-child { border-top: none; padding-top: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }

/* Switch (toggle) */
.switch-wrap { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: #cbd3e0; border-radius: 20px; transition: .2s; }
.switch .track::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::before { transform: translateX(20px); }
.switch-val { font-size: .84rem; font-weight: 600; color: var(--muted); }

/* Relasi rows */
.rel-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.rel-row select { flex: 1; }
.rel-row .del { flex: 0 0 auto; border: 1px solid #f0c4c4; color: var(--absen); background: #fff;
  border-radius: 8px; padding: 8px 10px; cursor: pointer; font-weight: 700; }
.rel-fixed { font-size: .82rem; color: var(--muted); align-self: center; white-space: nowrap; }
.rel-in { font-size: .78rem; color: var(--muted); background: #f3f5f9; border-radius: 8px; padding: 8px 10px; margin-top: 8px; }

/* Dapukan */
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip { display: inline-flex; align-items: center; gap: 8px; background: var(--primary-soft);
  color: var(--primary-dark); border: 1px solid rgba(59,110,245,.16); border-radius: 20px; padding: 6px 6px 6px 12px; font-size: .84rem; font-weight: 600; }
.chip button { border: none; background: rgba(0,0,0,.08); color: inherit; width: 20px; height: 20px;
  border-radius: 50%; cursor: pointer; font-size: .8rem; line-height: 1; }
.mgr-head { font-weight: 700; font-size: .96rem; }
/* In-app guide reader */
.guide-body { color: var(--text); line-height: 1.65; font-size: .95rem; }
.guide-body h2 { font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; margin: 1.5em 0 .45em; }
.guide-body h2:first-child { margin-top: .2em; }
.guide-body h3 { font-size: 1.03rem; font-weight: 700; margin: 1.2em 0 .35em; }
.guide-body p { margin: .65em 0; }
.guide-body ul, .guide-body ol { margin: .55em 0; padding-left: 1.4em; }
.guide-body li { margin: .35em 0; }
.guide-body li > ul, .guide-body li > ol { margin: .25em 0; }
.guide-body hr { border: none; border-top: 1px solid var(--line); margin: 1.5em 0; }
.guide-body code { background: var(--code-bg, var(--primary-soft)); padding: 2px 7px; border-radius: 6px;
  font-size: .88em; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }
.guide-body strong { font-weight: 700; }
.guide-body a { color: var(--primary); }
.guide-body blockquote { background: var(--primary-soft); border-left: 4px solid var(--primary);
  margin: 1em 0; padding: .75em 1.05em; border-radius: 10px; color: var(--text); }
.icon-btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.icon-btn.primary:hover { background: var(--primary-dark); color: #fff; }
.mgr-inp { border: 1px solid var(--line2); background: var(--bg); color: var(--text); border-radius: 9px;
  padding: 7px 10px; font-size: .9rem; font-weight: 600; font-family: inherit; min-width: 0; }
.mgr-inp.kode { width: 68px; text-transform: uppercase; font-family: ui-monospace, Consolas, monospace; text-align: center; }
.mgr-code { font-family: ui-monospace, Consolas, monospace; background: var(--primary-soft); color: var(--primary-dark);
  border-radius: 6px; padding: 1px 7px; font-size: .82rem; margin-right: 7px; }

/* Dashboard */
.dash-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 18px 16px; position: relative; overflow: hidden; transition: transform .22s, box-shadow .22s; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--grad); }
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.kpi .k-num { font-size: 2rem; font-weight: 800; line-height: 1; letter-spacing: -.03em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.kpi .k-lbl { font-size: .7rem; color: var(--muted); margin-top: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.kpi .k-ico { position: absolute; right: 12px; top: 12px; font-size: 1.15rem; opacity: .9;
  background: var(--primary-soft); width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.up-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.up-item:last-child { border-bottom: none; }
.up-date { flex: 0 0 auto; text-align: center; background: var(--primary-soft); color: var(--primary-dark);
  border: 1px solid rgba(59,110,245,.16); border-radius: 12px; padding: 8px; min-width: 52px; }
.up-date .d { font-size: 1.15rem; font-weight: 800; line-height: 1; }
.up-date .m { font-size: .6rem; text-transform: uppercase; font-weight: 700; letter-spacing: .04em; }
.up-info { flex: 1; min-width: 0; }
.up-info .n { font-weight: 700; font-size: .92rem; }
.up-info .s { font-size: .76rem; color: var(--muted); }
.up-when { font-weight: 700; color: var(--hadir); font-size: .72rem; }
.up-badge { font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  background: var(--hadir); color: #fff; padding: 2px 8px; border-radius: 20px; }
.up-actions { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; align-items: stretch; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table.census { border-collapse: collapse; width: 100%; font-size: .82rem; min-width: 440px; }
table.census th, table.census td { border-bottom: 1px solid var(--line); padding: 9px 11px; text-align: center; }
table.census thead th { background: var(--primary-soft); color: var(--primary-dark); font-weight: 700;
  font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; }
table.census tbody tr:nth-child(even) td { background: rgba(127,140,170,.05); }
table.census td.cat { text-align: left; font-weight: 700; white-space: nowrap; }
table.census td.tot, table.census th.tot { font-weight: 800; color: var(--primary-dark); }
table.census tbody tr td.tot { background: var(--primary-soft); }
table.census tr.total-row td { font-weight: 800; background: var(--primary-soft); color: var(--primary-dark); }
table.detail { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.detail td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.detail td.dl { color: var(--muted); width: 42%; font-weight: 600; }
.dash-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; align-items: start; }
.dash-col { display: flex; flex-direction: column; gap: 30px; }
.dash-cols h3 { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 8px; }
.rc-seg { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.rc-seg:first-child { margin-top: 6px; padding-top: 0; border-top: none; }
.rc-seg-h { font-size: 1rem; font-weight: 700; margin: 0 0 10px; }
.rc-seg-h .muted { font-weight: 500; font-size: .8rem; }
.mini { display: flex; justify-content: space-between; align-items: baseline; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: .85rem; }
.mini:last-child { border-bottom: none; }
.mini b { font-weight: 800; font-size: .95rem; }
.mini .sub { font-size: .72rem; color: var(--faint); }
.bar-row { margin: 9px 0; }
.bar-top { display: flex; justify-content: space-between; font-size: .85rem; margin-bottom: 4px; }
.bar-top b { font-weight: 800; font-size: .95rem; }
.bar-track { height: 8px; background: #eef1f7; border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; }
.vis-chip { display: inline-block; background: #fbf2d6; color: #a97e05; border-radius: 20px; padding: 4px 11px; font-size: .78rem; font-weight: 600; margin: 3px 5px 0 0; }
.trend { display: flex; align-items: flex-end; gap: 8px; padding-top: 6px; overflow-x: auto; }
.tbar { flex: 1 0 34px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.tval { font-size: .72rem; font-weight: 800; margin-bottom: 4px; }
.tfill { width: 70%; max-width: 34px; background: linear-gradient(180deg, var(--primary), #6a4df5); border-radius: 6px 6px 0 0; min-height: 2px; }
.tlbl { font-size: .66rem; color: var(--muted); margin-top: 6px; white-space: nowrap; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: rgba(19,26,38,.92); backdrop-filter: blur(10px); color: #fff; padding: 12px 20px; border-radius: 24px; font-size: .85rem;
  font-weight: 500; opacity: 0; transition: .28s cubic-bezier(.2,.8,.2,1); pointer-events: none; z-index: 100; max-width: 90%;
  box-shadow: 0 12px 32px -8px rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.08); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#loader { padding: 22px 16px; color: var(--muted); }
.sk-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.skeleton { background: linear-gradient(90deg, var(--line) 25%, var(--line2) 40%, var(--line) 60%);
  background-size: 300% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--radius); }
@keyframes shimmer { 0% { background-position: 130% 0; } 100% { background-position: -130% 0; } }

/* Dark theme */
:root[data-theme="dark"] {
  --bg: #0b0f18; --card: #151c29; --line: #253044; --line2: #33415a;
  --text: #e8ecf5; --muted: #9aa6bd; --faint: #6d798f;
  --primary-soft: #1b2540; --primary-dark: #6b8bff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 2px 4px rgba(0,0,0,.3), 0 8px 20px -8px rgba(0,0,0,.55);
  --shadow-md: 0 8px 26px -8px rgba(0,0,0,.65);
  --shadow-lg: 0 28px 56px -16px rgba(0,0,0,.75);
  --ring: 0 0 0 4px rgba(107,139,255,.22);
}
:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea { background: #111722; color: var(--text); border-color: var(--line2); }
:root[data-theme="dark"] input[readonly] { background: #0b0f17; color: var(--muted); }
:root[data-theme="dark"] .status-sel.green { background-color: rgba(31,157,85,.22); color: #6ee7a8; }
:root[data-theme="dark"] .status-sel.amber { background-color: rgba(217,164,6,.22); color: #f0cf5e; }
:root[data-theme="dark"] .status-sel.red { background-color: rgba(214,69,69,.24); color: #f2a3a3; }
:root[data-theme="dark"] .btn.secondary { background: #26303f; color: var(--text); }
:root[data-theme="dark"] .seg button:not(.on) { background: #111722; color: var(--muted); border-color: var(--line2); }
:root[data-theme="dark"] .icon-btn { background: #111722; color: var(--text); }
:root[data-theme="dark"] .rel-row .del { background: #111722; }
:root[data-theme="dark"] .rel-in { background: #0b0f17; }
:root[data-theme="dark"] .switch .track { background: #3a4658; }
:root[data-theme="dark"] table.census thead th { background: #1b2331; }
:root[data-theme="dark"] .bar-track { background: rgba(255,255,255,.09); }
/* Badge agar terbaca di dark (default & varian warna tak lagi memakai bg terang hardcoded) */
:root[data-theme="dark"] .badge { background: #26303f; color: var(--muted); }
:root[data-theme="dark"] .badge.green { background: rgba(31,157,85,.22); color: #6ee7a8; }
:root[data-theme="dark"] .badge.amber { background: rgba(217,164,6,.22); color: #f0cf5e; }
:root[data-theme="dark"] .badge.red { background: rgba(214,69,69,.24); color: #f2a3a3; }
/* Nav aktif lebih kontras di dark */
:root[data-theme="dark"] .tab.active { color: #8aa5ff; border-bottom-color: #8aa5ff; }
:root[data-theme="dark"] .bn-item.active { color: #8aa5ff; }
/* Hormati preferensi kurangi animasi */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
/* Banner offline */
#offbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: none;
  background: #b8860b; color: #fff; text-align: center; font-size: .82rem; font-weight: 600; padding: 8px 12px; }
#offbar.show { display: block; }
