/* ==========================================================================
   MUTABAAH MA'HAD — Sistem Desain (DESIGN.md: Amanah · Tenang · Modern Executive)
   Hijau zamrud + aksen emas, kanvas slate lembut, kartu putih bersudut 24px,
   pil penuh, bayangan ambient. Mobile-first, mode terang/gelap, cetak A4.
   ========================================================================== */
:root {
  --primary: #006948; --primary-600: #00855d; --primary-700: #005137; --primary-50: #ecfdf5; --primary-100: #d1fae5;
  --on-primary: #fff;
  --gold: #b8892b; --gold-50: #fbf5e6; --gold-200: #ecd9a6;
  --ink: #0f172a; --body: #334155; --muted: #64748b; --faint: #94a3b8;
  --canvas: #f8fafc; --surface: #fff; --surface-2: #f1f5f9; --surface-3: #eff4ff;
  --border: #e2e8f0; --border-soft: #f1f5f9;
  --lime: #84cc16; --lime-soft: #ecfccb; --sky: #0369a1; --sky-soft: #e0f2fe; --amber: #b45309; --amber-soft: #fef3c7;
  --rose: #dc2626; --rose-soft: #fee2e2; --slate-soft: #f1f5f9; --violet: #6d28d9; --violet-soft: #ede9fe;
  --r-xl: 24px; --r-lg: 16px; --r-md: 12px; --r-sm: 8px; --r-full: 999px;
  --sh-1: 0 4px 20px -2px rgba(15, 23, 42, .04), 0 2px 6px -1px rgba(15, 23, 42, .02);
  --sh-2: 0 12px 30px -4px rgba(15, 23, 42, .08), 0 4px 10px -2px rgba(15, 23, 42, .03);
  --sh-3: 0 24px 48px -12px rgba(15, 23, 42, .16);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-ar: 'Amiri', 'Scheherazade New', 'Traditional Arabic', serif;
  --sidebar-w: 256px; --topbar-h: 64px; --bottom-h: 68px;
  --ornament: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.10' stroke-width='1'%3E%3Cpath d='M32 6l7.6 18.4L58 32l-18.4 7.6L32 58l-7.6-18.4L6 32l18.4-7.6z'/%3E%3Cpath d='M13.6 13.6h36.8v36.8H13.6z' transform='rotate(45 32 32)'/%3E%3Ccircle cx='32' cy='32' r='6'/%3E%3C/g%3E%3C/svg%3E");
  --ornament-ink: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23006948' stroke-opacity='.06' stroke-width='1'%3E%3Cpath d='M32 6l7.6 18.4L58 32l-18.4 7.6L32 58l-7.6-18.4L6 32l18.4-7.6z'/%3E%3Cpath d='M13.6 13.6h36.8v36.8H13.6z' transform='rotate(45 32 32)'/%3E%3C/g%3E%3C/svg%3E");
  color-scheme: light;
}
[data-theme="dark"] {
  --primary: #34d399; --primary-600: #10b981; --primary-700: #6ee7b7; --primary-50: rgba(16, 185, 129, .12); --primary-100: rgba(16, 185, 129, .22);
  --on-primary: #022c22;
  --gold: #e3c06a; --gold-50: rgba(227, 192, 106, .12); --gold-200: rgba(227, 192, 106, .35);
  --ink: #f1f5f9; --body: #cbd5e1; --muted: #94a3b8; --faint: #64748b;
  --canvas: #0b1220; --surface: #111a2c; --surface-2: #17223a; --surface-3: #1b2943;
  --border: #23314d; --border-soft: #1b263d;
  --lime-soft: rgba(132, 204, 22, .16); --sky: #7dd3fc; --sky-soft: rgba(56, 189, 248, .14); --amber: #fbbf24; --amber-soft: rgba(245, 158, 11, .15);
  --rose: #f87171; --rose-soft: rgba(239, 68, 68, .15); --slate-soft: #1b263d; --violet: #c4b5fd; --violet-soft: rgba(139, 92, 246, .16);
  --sh-1: 0 1px 0 rgba(255, 255, 255, .02), 0 8px 24px -8px rgba(0, 0, 0, .5);
  --sh-2: 0 16px 40px -8px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ---------- Dasar ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--body); background: var(--canvas); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { color: var(--ink); margin: 0; line-height: 1.25; letter-spacing: -.015em; }
h1 { font-size: 26px; font-weight: 700; } h2 { font-size: 19px; font-weight: 700; } h3 { font-size: 16px; font-weight: 700; } h4 { font-size: 14px; font-weight: 700; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 8px; }
img { max-width: 100%; display: block; }
svg.ic { width: 18px; height: 18px; flex: 0 0 auto; stroke-width: 2; }
.ar { font-family: var(--font-ar); direction: rtl; unicode-bidi: isolate; font-size: 1.25em; line-height: 1.9; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .ink { color: var(--ink); }
.small { font-size: 13px; } .xs { font-size: 12px; } .lbl { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.b { font-weight: 700; } .sb { font-weight: 600; } .right { text-align: right; } .center { text-align: center; }
.nowrap { white-space: nowrap; } .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; } .row.top { align-items: flex-start; } .row.between { justify-content: space-between; } .row.end { justify-content: flex-end; }
.grow { flex: 1 1 auto; min-width: 0; } .stack { display: flex; flex-direction: column; gap: 12px; } .stack.s8 { gap: 8px; } .stack.s16 { gap: 16px; } .stack.s20 { gap: 20px; }
.grid { display: grid; gap: 16px; } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.split { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
.mt4 { margin-top: 4px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt20 { margin-top: 20px; } .mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; }
@media (max-width: 1023px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 599px) { .g2, .g3 { grid-template-columns: minmax(0, 1fr); } .g6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } h1 { font-size: 22px; } .g4 .tile .t-val, .g6 .tile .t-val { font-size: clamp(18px, 5.2vw, 26px); letter-spacing: -.03em; } }

/* ---------- Kerangka aplikasi ---------- */
.app { min-height: 100dvh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--border-soft); display: flex; flex-direction: column; z-index: 40; }
.brand { display: flex; align-items: center; gap: 12px; padding: 18px 20px 14px; }
.brand-logo { width: 44px; height: 44px; border-radius: 14px; background: var(--primary); color: #fff; display: grid; place-items: center; overflow: hidden; flex: 0 0 auto; background-image: var(--ornament); background-size: 32px; }
.brand-logo img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.brand-logo svg.ic { width: 24px; height: 24px; color: #fff; }
.brand-name { font-weight: 800; color: var(--ink); font-size: 16px; line-height: 1.15; }
.brand-sub { font-size: 11.5px; color: var(--muted); }
.nav { flex: 1; overflow-y: auto; padding: 4px 12px 16px; scrollbar-width: thin; }
.nav-grup { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 16px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin: 2px 0; border-radius: var(--r-md); color: var(--body); font-weight: 500; font-size: 14px; text-decoration: none; position: relative; min-height: 40px; }
.nav a:hover { background: var(--surface-2); }
.nav a.aktif { background: var(--primary); color: var(--on-primary); font-weight: 600; box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--primary) 60%, transparent); }
.nav a .badge-n { margin-left: auto; }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--border-soft); }
.main { margin-left: var(--sidebar-w); min-height: 100dvh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: 10px; padding: 0 24px; background: color-mix(in srgb, var(--canvas) 86%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border-soft); }
.crumb { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; min-width: 0; }
.crumb b { color: var(--ink); font-weight: 600; }
.top-search { position: relative; flex: 0 1 280px; }
.top-search input { width: 100%; height: 40px; padding: 0 14px 0 38px; border-radius: var(--r-full); border: 1px solid var(--border); background: var(--surface); }
.top-search > svg { position: absolute; left: 13px; top: 11px; color: var(--muted); }
.search-hasil { position: absolute; top: 46px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-2); max-height: 360px; overflow: auto; padding: 6px; z-index: 50; min-width: 300px; }
.search-hasil button { width: 100%; text-align: left; display: flex; gap: 10px; align-items: center; border: 0; background: none; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.search-hasil button:hover, .search-hasil button:focus { background: var(--surface-2); }
.status-pill { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--r-full); background: var(--surface); border: 1px solid var(--border); font-size: 12.5px; font-weight: 600; color: var(--body); white-space: nowrap; cursor: pointer; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary-600); display: inline-block; flex: 0 0 auto; }
.dot.off { background: var(--rose); } .dot.warn { background: #f59e0b; } .dot.idle { background: var(--faint); }
.user-cap { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: var(--r-full); background: var(--surface); border: 1px solid var(--border); cursor: pointer; min-width: 0; text-decoration: none !important; }
.user-cap .nm { font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1.1; }
.user-cap .rl { display: flex; gap: 4px; margin-top: 3px; flex-wrap: nowrap; overflow: hidden; max-width: 190px; }
.content { padding: 20px 24px 40px; width: 100%; max-width: 1440px; margin: 0 auto; flex: 1; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 4px; max-width: 720px; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); margin-bottom: 4px; }
#banner-area { display: flex; flex-direction: column; gap: 10px; margin-bottom: 0; }
#banner-area:not(:empty) { margin-bottom: 16px; }
.bottom-nav { display: none; }
.sheet-menu { display: none; }
@media (max-width: 1023px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding-bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom)); }
  .topbar { padding: 0 14px; height: 58px; }
  .top-search, .hide-m, .user-cap .rl, .user-cap .nmwrap { display: none !important; }
  .crumb { font-size: 15px; } .crumb b { font-size: 15px; }
  .content { padding: 14px 14px 28px; }
  .bottom-nav { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; height: calc(var(--bottom-h) + env(safe-area-inset-bottom)); padding: 6px 6px env(safe-area-inset-bottom); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--border); }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; border: 0; background: none; border-radius: 14px; min-height: 52px; position: relative; padding: 0 2px; }
  .bottom-nav .aktif { color: var(--primary); }
  .bottom-nav .aktif svg.ic { background: var(--primary-50); border-radius: 999px; padding: 4px 14px; width: 48px; height: 28px; box-sizing: border-box; }
  .bottom-nav svg.ic { width: 22px; height: 22px; }
  .bottom-nav .badge-n { position: absolute; top: 4px; right: calc(50% - 22px); }
  .sheet-menu { display: block; position: fixed; inset: 0; z-index: 60; background: rgba(15, 23, 42, .45); }
  .sheet-menu[hidden] { display: none; }
  .sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 82dvh; overflow: auto; background: var(--surface); border-radius: 24px 24px 0 0; padding: 10px 14px calc(18px + env(safe-area-inset-bottom)); box-shadow: var(--sh-3); animation: naik .22s ease-out; }
  .sheet-panel .nav { padding: 0; }
  .sheet-grip { width: 44px; height: 5px; border-radius: 9px; background: var(--border); margin: 4px auto 8px; }
}
@keyframes naik { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }

/* ---------- Kartu & ubin ---------- */
.card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-xl); box-shadow: var(--sh-1); padding: 20px; min-width: 0; }
.card.pad0 { padding: 0; overflow: hidden; } .card.flat { box-shadow: none; } .card.tint { background: var(--surface-3); border-color: transparent; box-shadow: none; }
.card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-h .ttl { display: flex; align-items: center; gap: 10px; min-width: 0; }
.card-h .ico { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); flex: 0 0 auto; }
.card-h .desc { font-size: 13px; color: var(--muted); margin-top: 2px; }
.inner { background: var(--surface-3); border-radius: var(--r-lg); padding: 14px; }
.inner.white { background: var(--surface); border: 1px solid var(--border); }
.tile { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-xl); box-shadow: var(--sh-1); padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; position: relative; }
.tile .t-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.tile .t-ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); color: var(--body); flex: 0 0 auto; }
.tile .t-val { font-size: 28px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; word-break: break-word; }
.tile .t-val small { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.tile .badge { max-width: 100%; white-space: normal; line-height: 1.25; height: auto; min-height: 22px; padding-top: 3px; padding-bottom: 3px; }
.tile .t-sub { font-size: 12.5px; color: var(--muted); }
.tile.hero { background: var(--primary); color: var(--on-primary); border-color: transparent; background-image: var(--ornament); background-size: 56px; }
.tile.hero .t-val, .tile.hero .lbl, .tile.hero .t-sub { color: var(--on-primary); } .tile.hero .t-ico { background: rgba(255, 255, 255, .16); color: var(--on-primary); }
.tile.dark { background: #0f172a; border-color: transparent; } .tile.dark .t-val, .tile.dark .lbl, .tile.dark .t-sub { color: #fff; }
.tile.lime { background: var(--lime-soft); border-color: transparent; }
.tone-ok .t-ico { background: var(--primary-50); color: var(--primary); } .tone-warn .t-ico { background: var(--amber-soft); color: var(--amber); } .tone-bad .t-ico { background: var(--rose-soft); color: var(--rose); } .tone-sky .t-ico { background: var(--sky-soft); color: var(--sky); }

/* ---------- Tombol, pil, lencana ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: var(--r-full); border: 1px solid transparent; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: background .15s, transform .08s, box-shadow .15s, opacity .15s; user-select: none; }
.btn:active { transform: scale(.98); }
.btn[disabled], .btn.loading { opacity: .55; pointer-events: none; }
.btn.primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--primary) 80%, transparent); }
.btn.primary:hover { background: var(--primary-700); }
[data-theme="dark"] .btn.primary:hover { background: var(--primary-600); }
.btn.dark { background: #0f172a; color: #fff; } [data-theme="dark"] .btn.dark { background: #e2e8f0; color: #0f172a; }
.btn.ghost { background: var(--surface); border-color: var(--border); color: var(--ink); } .btn.ghost:hover { background: var(--surface-2); }
.btn.soft { background: var(--surface-3); color: var(--ink); } .btn.soft:hover { background: var(--surface-2); }
.btn.danger { background: var(--rose-soft); color: var(--rose); } .btn.danger.solid { background: #dc2626; color: #fff; }
.btn.gold { background: var(--gold-50); color: var(--gold); border-color: var(--gold-200); }
.btn.sm { height: 34px; padding: 0 14px; font-size: 13px; } .btn.xs { height: 28px; padding: 0 10px; font-size: 12px; gap: 6px; }
.btn.icon { width: 40px; padding: 0; } .btn.icon.sm { width: 34px; }
.btn.block { width: 100%; }
.btn .spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: putar .7s linear infinite; }
@keyframes putar { to { transform: rotate(360deg); } }
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px; border-radius: var(--r-full); font-size: 11.5px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; background: var(--slate-soft); color: #475569; }
[data-theme="dark"] .badge { color: var(--body); }
.badge.ok { background: var(--primary-50); color: var(--primary-700); } [data-theme="dark"] .badge.ok { color: var(--primary); }
.badge.warn { background: var(--amber-soft); color: var(--amber); } .badge.bad { background: var(--rose-soft); color: var(--rose); } .badge.sky { background: var(--sky-soft); color: var(--sky); }
.badge.lime { background: var(--lime-soft); color: #3f6212; } [data-theme="dark"] .badge.lime { color: #bef264; }
.badge.gold { background: var(--gold-50); color: var(--gold); } .badge.violet { background: var(--violet-soft); color: var(--violet); }
.badge.dark { background: #0f172a; color: #fff; } .badge.solid { background: var(--primary); color: var(--on-primary); }
.badge-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #dc2626; color: #fff; font-size: 11px; font-weight: 800; display: inline-grid; place-items: center; }
.role-chip { font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.role-chip.k { background: var(--sky-soft); color: var(--sky); } .role-chip.a { background: var(--lime-soft); color: #3f6212; } .role-chip.b { background: var(--primary-50); color: var(--primary-700); } .role-chip.m { background: var(--gold-50); color: var(--gold); } .role-chip.ad { background: #0f172a; color: #fff; }
[data-theme="dark"] .role-chip.a { color: #bef264; } [data-theme="dark"] .role-chip.b { color: var(--primary); } [data-theme="dark"] .role-chip.ad { background: #e2e8f0; color: #0f172a; }
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: var(--r-full); background: var(--surface-2); flex-wrap: wrap; }
.seg button { border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: 13px; height: 34px; padding: 0 14px; border-radius: var(--r-full); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.seg.dark button.on { background: #0f172a; color: #fff; } .seg.green button.on { background: var(--primary); color: var(--on-primary); }
[data-theme="dark"] .seg.dark button.on { background: #e2e8f0; color: #0f172a; }
.seg .cnt { font-size: 11px; background: var(--surface-2); border-radius: 999px; padding: 0 7px; } .seg button.on .cnt { background: var(--primary-50); color: var(--primary); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 34px; padding: 0 14px; border-radius: var(--r-full); border: 1px solid var(--border); background: var(--surface); font-weight: 600; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--body); }
.chip.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.chip.on.bad { background: #dc2626; border-color: #dc2626; color: #fff; }
.chip.sm { height: 28px; font-size: 12px; padding: 0 10px; }

/* Status kehadiran H/S/I/A */
.hsia { display: inline-flex; gap: 6px; }
.hsia button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-weight: 800; font-size: 13px; cursor: pointer; }
.hsia button.on[data-s="H"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.hsia button.on[data-s="S"] { background: #475569; border-color: #475569; color: #fff; }
.hsia button.on[data-s="I"] { background: #65a30d; border-color: #65a30d; color: #fff; }
.hsia button.on[data-s="A"] { background: #dc2626; border-color: #dc2626; color: #fff; }
.hsia[aria-disabled="true"] button { pointer-events: none; opacity: .65; }

/* ---------- Formulir ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .lb { font-size: 13px; font-weight: 600; color: var(--ink); display: flex; justify-content: space-between; gap: 8px; }
.field .help { font-size: 12px; color: var(--muted); }
.field .err { font-size: 12px; color: var(--rose); font-weight: 600; }
.inp, .field input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), .field select, .field textarea, select.inp {
  width: 100%; height: 44px; padding: 0 14px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); color: var(--ink); transition: border .15s, box-shadow .15s; min-width: 0; }
.field textarea, textarea.inp { height: auto; min-height: 84px; padding: 10px 14px; resize: vertical; line-height: 1.5; }
.inp:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.inp.invalid, .field .invalid { border-color: var(--rose) !important; background: var(--rose-soft); }
.inp-pill { height: 40px !important; border-radius: var(--r-full) !important; }
.inp-icon { position: relative; } .inp-icon > svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; } .inp-icon input { padding-left: 40px !important; }
.inp-icon .after { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 599px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.switch { position: relative; width: 44px; height: 26px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--border); transition: .2s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.switch input:checked + span { background: var(--primary-600); } .switch input:checked + span::after { transform: translateX(18px); }
.stepper { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-full); padding: 4px; }
.stepper input { width: 64px; text-align: center; border: 0 !important; height: 34px !important; font-size: 20px; font-weight: 800; background: transparent !important; box-shadow: none !important; padding: 0 !important; }
.stepper button { width: 38px; height: 34px; border-radius: 999px; border: 0; background: var(--surface-2); font-weight: 800; cursor: pointer; color: var(--ink); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; } .tags button { border: 1px dashed var(--border); background: var(--surface); border-radius: 999px; font-size: 12px; padding: 3px 10px; cursor: pointer; color: var(--body); }

/* ---------- Banner, kosong, kerangka ---------- */
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--sh-1); animation: turun .2s ease-out; }
.banner .b-ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; background: var(--surface-2); }
.banner .b-t { font-weight: 700; color: var(--ink); font-size: 14px; } .banner .b-m { font-size: 13px; color: var(--body); margin-top: 2px; }
.banner.success { background: var(--primary-50); border-color: color-mix(in srgb, var(--primary) 20%, transparent); } .banner.success .b-ico { background: var(--primary); color: var(--on-primary); }
.banner.warn { background: var(--amber-soft); border-color: color-mix(in srgb, #f59e0b 30%, transparent); } .banner.warn .b-ico { background: #f59e0b; color: #fff; }
.banner.error { background: var(--rose-soft); border-color: color-mix(in srgb, #dc2626 25%, transparent); } .banner.error .b-ico { background: #dc2626; color: #fff; }
.banner.info { background: var(--sky-soft); border-color: color-mix(in srgb, #0284c7 20%, transparent); } .banner.info .b-ico { background: #0284c7; color: #fff; }
.banner .x { margin-left: auto; border: 0; background: none; cursor: pointer; color: var(--muted); padding: 4px; border-radius: 8px; }
@keyframes turun { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.empty { text-align: center; padding: 30px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); }
.empty .e-ico { width: 54px; height: 54px; border-radius: 18px; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.empty .e-ico svg.ic { width: 26px; height: 26px; }
.empty .e-t { font-weight: 700; color: var(--ink); }
.empty .e-d { font-size: 13px; max-width: 360px; }
.sk { background: linear-gradient(90deg, var(--surface-2) 0, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: kilau 1.3s ease-in-out infinite; border-radius: 10px; height: 14px; }
.sk.h40 { height: 40px; } .sk.h80 { height: 80px; } .sk.h120 { height: 120px; } .sk.w50 { width: 50%; } .sk.w70 { width: 70%; } .sk.round { border-radius: 50%; }
@keyframes kilau { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.offline-strip { display: none; }
body.offline .offline-strip { display: flex; }

/* ---------- Daftar, tabel, avatar, progres ---------- */
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-3); color: var(--primary); display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: 0 0 auto; overflow: hidden; letter-spacing: .02em; }
.avatar.sm { width: 32px; height: 32px; font-size: 11.5px; } .avatar.lg { width: 64px; height: 64px; font-size: 20px; border-radius: 20px; } .avatar.sq { border-radius: 12px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.c1 { background: #e0f2fe; color: #0369a1; } .avatar.c2 { background: #ecfccb; color: #3f6212; } .avatar.c3 { background: #fef3c7; color: #b45309; } .avatar.c4 { background: #ede9fe; color: #6d28d9; } .avatar.c5 { background: #ecfdf5; color: #047857; } .avatar.c6 { background: #fee2e2; color: #b91c1c; }
[data-theme="dark"] .avatar[class*=" c"] { filter: saturate(.85) brightness(.9); }
.list { display: flex; flex-direction: column; gap: 8px; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-lg); background: var(--surface-3); border: 1px solid transparent; cursor: pointer; text-align: left; width: 100%; color: inherit; transition: background .12s, border .12s; min-height: 56px; flex-shrink: 0; }
.li:hover { border-color: var(--border); background: var(--surface-2); }
.li.on { background: var(--primary); color: var(--on-primary); box-shadow: 0 10px 22px -12px color-mix(in srgb, var(--primary) 85%, transparent); outline: 3px solid color-mix(in srgb, var(--primary) 25%, transparent); outline-offset: 2px; }
.li.on .muted, .li.on .faint, .li.on .ink { color: color-mix(in srgb, var(--on-primary) 80%, transparent); } .li.on .nm { color: var(--on-primary); }
.li .nm { font-weight: 700; color: var(--ink); font-size: 14px; }
.li.plain { cursor: default; background: var(--surface); border-color: var(--border-soft); }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 12px 14px; background: var(--surface-3); white-space: nowrap; position: sticky; top: 0; }
.tbl th:first-child { border-top-left-radius: 14px; } .tbl th:last-child { border-top-right-radius: 14px; }
.tbl th.sortable { cursor: pointer; } .tbl th.sortable:hover { color: var(--ink); }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; color: var(--body); }
.tbl tr:last-child td { border-bottom: 0; } .tbl tr.hl td { background: var(--rose-soft); } .tbl tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pg { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 4px 0; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; position: relative; }
.progress > i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--primary-600); transition: width .4s; }
.progress.lg { height: 12px; } .progress.warn > i { background: #f59e0b; } .progress.bad > i { background: #dc2626; } .progress.lime > i { background: var(--lime); } .progress.dark > i { background: #475569; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13.5px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; color: var(--ink); font-weight: 600; }
.steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.step { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: var(--r-lg); background: var(--surface-3); font-size: 13px; }
.step .n { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); font-weight: 800; color: var(--muted); flex: 0 0 auto; }
.step.done .n { background: var(--primary); color: var(--on-primary); } .step.on { background: var(--primary); color: var(--on-primary); outline: 3px solid color-mix(in srgb, var(--primary) 25%, transparent); outline-offset: 2px; } .step.on .n { background: #fff; color: var(--primary); }
.step .lbl { color: inherit; opacity: .8; }
@media (max-width: 899px) { .steps { grid-template-columns: repeat(5, 46px); overflow: auto; } .step .tx { display: none; } .step { justify-content: center; padding: 8px; } }

/* ---------- Bagan SVG ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .lbl-v { fill: var(--ink); font-weight: 700; }
.chart .grid-l { stroke: var(--border); stroke-dasharray: 3 4; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); } .legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: -1px; }

/* ---------- Kalender ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.cal .hd { background: var(--rose-soft); color: var(--rose); font-size: 11px; font-weight: 700; text-align: center; padding: 8px 2px; text-transform: uppercase; letter-spacing: .04em; }
.cal .hd.ws { background: var(--surface-3); color: var(--muted); }
.cal .d { min-height: 92px; border-top: 1px solid var(--border); border-left: 1px solid var(--border); padding: 6px; font-size: 12px; background: var(--surface); position: relative; display: flex; flex-direction: column; gap: 3px; }
.cal .d:nth-child(7n+1) { border-left: 0; }
.cal .d .tg { font-weight: 700; color: var(--ink); align-self: flex-end; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal .d.fri .tg, .cal .d.sun .tg { color: var(--rose); }
.cal .d.today .tg { background: var(--primary); color: var(--on-primary); }
.cal .d.out { background: var(--surface-3); color: var(--faint); } .cal .d.out .tg { color: var(--faint); }
.cal .ev { font-size: 10.5px; font-weight: 700; border-radius: 6px; padding: 2px 6px; color: #fff; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; border: 0; text-align: left; }
.cal .dots { display: flex; gap: 3px; flex-wrap: wrap; }
@media (max-width: 599px) { .cal .d { min-height: 58px; padding: 4px; } .cal .ev { font-size: 0; height: 6px; padding: 0; } }
.k-awal { background: #047857; } .k-akhir { background: #0f766e; } .k-ujian { background: #15803d; } .k-libur { background: #d97706; } .k-rapor { background: #475569; } .k-kegiatan { background: #7c3aed; } .k-lain { background: #64748b; }

/* ---------- Login ---------- */
.auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); background: var(--canvas); }
.auth-hero { background: linear-gradient(155deg, #00553a 0%, #006948 45%, #0b3d2e 100%); color: #e8fff5; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-hero::before { content: ''; position: absolute; inset: 0; background-image: var(--ornament); background-size: 72px; opacity: .9; }
.auth-hero > * { position: relative; }
.auth-hero h1 { color: #fff; font-size: 36px; letter-spacing: -.02em; max-width: 520px; }
.auth-hero .fitur { display: flex; gap: 12px; align-items: flex-start; } .auth-hero .fitur .fi { width: 30px; height: 30px; border-radius: 10px; background: rgba(255, 255, 255, .14); display: grid; place-items: center; flex: 0 0 auto; }
.auth-hero .gold-line { width: 64px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, #e3c06a, #b8892b); }
.auth-side { display: flex; align-items: center; justify-content: center; padding: 28px 20px; }
.auth-card { width: 100%; max-width: 420px; }
@media (max-width: 899px) { .auth { grid-template-columns: 1fr; } .auth-hero { padding: 28px 22px; min-height: auto; } .auth-hero h1 { font-size: 26px; } .auth-hero .hide-m { display: none; } }

/* ---------- Kertas A4 (rapor, berita acara, kaldik) ---------- */
.a4-wrap { background: var(--surface-2); border-radius: var(--r-xl); padding: 18px; overflow: auto; }
.a4 { width: 210mm; min-height: 297mm; margin: 0 auto; background: #fff; color: #1f2937; padding: 12mm 15mm 9mm; box-shadow: 0 10px 40px -12px rgba(15, 23, 42, .25); position: relative; font-size: 10pt; line-height: 1.45; font-family: var(--font); display: flex; flex-direction: column; }
.a4 + .a4 { margin-top: 18px; }
.a4 h1, .a4 h2, .a4 h3, .a4 h4 { color: #0f172a; }
.a4 .kop { display: grid; grid-template-columns: 22mm 1fr 22mm; align-items: center; gap: 4mm; padding-bottom: 3mm; border-bottom: 3px double #0f172a; }
.a4 .kop .logo { width: 20mm; height: 20mm; border-radius: 4mm; overflow: hidden; display: grid; place-items: center; background: #006948; color: #fff; }
.a4 .kop .logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.a4 .kop .tx { text-align: center; } .a4 .kop .lembaga { font-size: 8.5pt; letter-spacing: .12em; color: #006948; font-weight: 700; text-transform: uppercase; }
.a4 .kop .nama { font-size: 15pt; font-weight: 800; color: #0f172a; text-transform: uppercase; line-height: 1.2; } .a4 .kop .alamat { font-size: 8pt; color: #475569; }
.a4 .judul { text-align: center; margin: 5mm 0 1mm; font-size: 12.5pt; font-weight: 800; letter-spacing: .02em; color: #0f172a; }
.a4 .periode { text-align: center; } .a4 .periode span { display: inline-block; background: #ecfdf5; color: #006948; font-weight: 700; font-size: 8.5pt; padding: 1mm 4mm; border-radius: 99px; }
.a4 .ident { display: grid; grid-template-columns: 26mm 1fr 1fr; gap: 4mm; margin: 5mm 0; padding: 4mm; background: #f8fafc; border-radius: 3mm; border: 1px solid #e2e8f0; }
.a4 .foto { width: 26mm; height: 33mm; border-radius: 2mm; overflow: hidden; background: #e2e8f0; display: grid; place-items: center; color: #64748b; font-size: 7pt; }
.a4 .foto img { width: 100%; height: 100%; object-fit: cover; }
.a4 .ident .k { font-size: 7pt; color: #64748b; text-transform: uppercase; letter-spacing: .06em; } .a4 .ident .v { font-weight: 700; color: #0f172a; font-size: 10pt; margin-bottom: 2mm; }
.a4 table { width: 100%; border-collapse: collapse; font-size: 8.5pt; }
.a4 th { background: #f1f5f9; color: #334155; font-size: 7.5pt; text-transform: uppercase; letter-spacing: .04em; padding: 2mm; text-align: left; border-bottom: 1px solid #cbd5e1; }
.a4 td { padding: 1.6mm 2mm; border-bottom: 1px solid #e2e8f0; vertical-align: top; }
.a4 .seksi { font-size: 8.5pt; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #0f172a; margin: 4mm 0 2mm; display: flex; justify-content: space-between; }
.a4 .bx { border: 1px solid #e2e8f0; border-radius: 3mm; padding: 3mm; }
.a4 .ttd { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4mm; text-align: center; margin-top: 7mm; font-size: 9pt; page-break-inside: avoid; }
.a4 .ttd .sp { height: 18mm; } .a4 .ttd .nm { font-weight: 700; text-decoration: underline; }
.a4 .foot { margin-top: 4mm; display: flex; gap: 3mm; align-items: center; font-size: 7pt; color: #64748b; border-top: 1px solid #e2e8f0; padding-top: 2mm; page-break-inside: avoid; }
.a4 .spacer-foot { flex: 1 0 0; }
.a4 .qr svg { width: 18mm; height: 18mm; display: block; }
.a4 .watermark { position: absolute; z-index: 0; inset: 0; display: grid; place-items: center; pointer-events: none; font-size: 80pt; font-weight: 900; color: rgba(220, 38, 38, .07); transform: rotate(-30deg); letter-spacing: .1em; }
.a4 .pb { display: inline-block; padding: .3mm 2mm; border-radius: 99px; font-size: 7pt; font-weight: 700; background: #ecfdf5; color: #047857; }
.a4 .pb.mj { background: #fef3c7; color: #b45309; } .a4 .pb.zy { background: #e0f2fe; color: #0369a1; } .a4 .pb.kt { background: #ecfccb; color: #3f6212; }
.a4 .ar { font-size: 13pt; color: #0f172a; text-align: center; display: block; margin-bottom: 1mm; }
.a4-scale { transform-origin: top left; }
@media print {
  @page { size: A4 portrait; margin: 0; }
  html, body { background: #fff !important; }
  body * { visibility: hidden; }
  .area-cetak, .area-cetak * { visibility: visible; }
  .area-cetak { position: absolute; left: 0; top: 0; width: 210mm; }
  .area-cetak .a4 { box-shadow: none !important; margin: 0 !important; page-break-after: always; min-height: 296mm; transform: none !important; }
  .a4-wrap { padding: 0 !important; background: none !important; overflow: visible !important; }
  .a4-scale { transform: none !important; width: auto !important; height: auto !important; }
  .no-print { display: none !important; }
}

/* ---------- Lain-lain ---------- */
.kbd { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.divider { height: 1px; background: var(--border-soft); margin: 14px 0; }
.amount { font-weight: 800; font-variant-numeric: tabular-nums; } .plus { color: #15803d; } .minus { color: var(--rose); } [data-theme="dark"] .plus { color: #4ade80; }
.ornate { background-image: var(--ornament-ink); background-size: 64px; }
.secret { font-family: ui-monospace, Menlo, monospace; font-size: 22px; letter-spacing: .18em; font-weight: 800; color: var(--ink); background: var(--gold-50); border: 1px dashed var(--gold-200); padding: 10px 16px; border-radius: 14px; text-align: center; }
.sticky-act { padding-top: 12px; padding-bottom: 4px; pointer-events: none; }
@media (max-width: 1099px) { .sticky-act { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--surface) 30%); z-index: 2; } }
.sticky-act > * { pointer-events: auto; }
@media (max-width: 599px) { .sticky-act { flex-wrap: nowrap; gap: 6px; } .sticky-act .btn { padding: 0 12px; } .hide-s { display: none !important; } }
@media (max-width: 1099px) { .layout-2 > .flat-m { display: contents; } .layout-2 > .flat-m > .akhir-m { order: 5; } }
@media (max-width: 1023px) { .sticky-act { bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom) - 4px); } }
.layout-2 { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .layout-2 { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); } .layout-2.rev { grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); } .layout-2.wide { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); } }
.scroll-y { max-height: 560px; overflow-y: auto; padding-right: 2px; }
.fade-in { animation: fade .18s ease-out; } @keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }
