:root {
  --bg: #f5f7fa; --surface: #fff; --ink: #1a1d24; --ink-2: #4b5262; --muted: #5f6676;
  --line: #e4e8ef; --line-2: #eef1f5; --accent: #0519b0; --accent-soft: #eef0fd;
  --ok: #157a4a; --ok-soft: #e6f5ec; --warn: #a15c00; --warn-soft: #fff3df; --bad: #b42318; --bad-soft: #fdecea;
  --r: 8px; --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: "Plus Jakarta Sans", var(--font);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.sm { font-size: 12px; }
.err { color: var(--bad); margin: 0; font-size: 13px; }

/* Buttons & inputs */
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 8px 14px; cursor: pointer; font-weight: 500; }
.btn:hover { border-color: #cdd3de; background: #fafbfc; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #04138a; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: default; }
.inp { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 6px 10px; height: 34px; min-width: 0; }
.inp:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
select.inp { max-width: 230px; }
.grow { flex: 1 1 220px; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 28px; display: grid; gap: 12px; }
.login-card h1 { font: 700 20px/1.2 var(--display); margin: 4px 0 0; }
.login-card p { margin: 0; }
.login-card label { display: grid; gap: 4px; font-weight: 500; font-size: 13px; color: var(--ink-2); }
.login-card input { border: 1px solid var(--line); border-radius: var(--r); padding: 9px 11px; width: 100%; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 44px; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; cursor: pointer; font-size: 17px; }

/* Topbar */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 18px; padding: 0 16px; height: 52px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font: 700 15px var(--display); white-space: nowrap; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
.sync { font-size: 12px; color: var(--muted); white-space: nowrap; }
.sync.bad { color: var(--bad); }
.who { font-size: 13px; color: var(--ink-2); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Views */
.view { padding: 14px 16px 24px; max-width: 1480px; margin: 0 auto; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.date-f { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.note { font-size: 12px; margin-left: auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font: 700 20px/1.25 var(--display); margin-top: 2px; }
.stat .v small { font: 500 12px var(--font); color: var(--muted); margin-left: 4px; }

/* Table */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: auto; max-height: calc(100vh - 220px); }
table.grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.grid th { position: sticky; top: 0; z-index: 1; background: #f8f9fb; text-align: left; font-weight: 600; color: var(--ink-2); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; cursor: default; }
.grid td { padding: 7px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.grid tbody tr { cursor: pointer; }
.grid tbody tr:hover td { background: #f7f8fe; }
.grid td.name { font-weight: 500; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.grid td.hub { max-width: 240px; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.grid td.code { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.grid.num td:not(:first-child), .grid.num th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.grid.num th { cursor: pointer; }
.grid.num th.sorted::after { content: " ↓"; color: var(--accent); }
.grid.num tbody tr { cursor: default; }
.grid tr.total td { font-weight: 600; background: #fafbff; }
.empty { padding: 28px; text-align: center; color: var(--muted); margin: 0; }
.bar { display: inline-block; height: 6px; border-radius: 3px; background: var(--accent); opacity: .75; vertical-align: middle; margin-left: 8px; }

/* Progress steps */
.steps { display: inline-flex; gap: 4px; }
.step { font-size: 11px; padding: 2px 7px; border-radius: 999px; background: var(--line-2); color: var(--muted); font-weight: 500; }
.step.on { background: var(--ok-soft); color: var(--ok); }
.step.paid.on { background: var(--ok-soft); color: var(--ok); }
.tag { font-size: 11px; padding: 1px 6px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); margin-left: 6px; font-weight: 500; }

.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding-top: 10px; font-size: 13px; color: var(--ink-2); }

/* Drawer */
.scrim { position: fixed; inset: 0; background: rgba(20, 24, 33, .28); z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); z-index: 21; display: flex; flex-direction: column; border-left: 1px solid var(--line); box-shadow: -12px 0 32px rgba(20, 24, 33, .08); }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font: 700 18px/1.3 var(--display); margin: 2px 0 0; }
.drawer-body { overflow: auto; padding: 6px 18px 24px; }
.sec { padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.sec:last-child { border-bottom: 0; }
.sec h3 { font: 600 13px var(--font); color: var(--ink-2); margin: 0 0 8px; }
.sec.sensitive h3::after { content: "Data sensitif"; font-size: 11px; font-weight: 500; color: var(--bad); background: var(--bad-soft); padding: 1px 7px; border-radius: 999px; margin-left: 8px; }
dl.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; margin: 0; font-size: 13px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; word-break: break-word; white-space: pre-wrap; }
.links { display: grid; gap: 6px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 9px 16px; border-radius: var(--r); font-size: 13px; z-index: 30; }

/* ---------- SMM Ekskul ---------- */
.mirror-note { background: var(--accent-soft); color: #22307e; font-size: 12.5px; padding: 6px 16px; border-bottom: 1px solid #dfe3fb; }
.view h2.vt { font: 700 17px/1.3 var(--display); margin: 2px 0 10px; }
.stat .v.ok { color: var(--ok); } .stat .v.bad { color: var(--bad); }
.stat .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.pbar { display: inline-flex; align-items: center; gap: 8px; min-width: 130px; justify-content: flex-end; }
.pbar i { display: block; width: 64px; height: 6px; border-radius: 3px; background: var(--line-2); position: relative; overflow: hidden; }
.pbar i b { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 3px; }
.pbar.ok i b { background: var(--ok); } .pbar.low i b { background: var(--warn); }
.chip.b { background: var(--accent-soft); color: var(--accent); }
.grid td.wrap { white-space: normal; min-width: 220px; max-width: 360px; }
.grid th.sortable { cursor: pointer; user-select: none; }
.grid th.sortable.sorted::after { content: " ↓"; color: var(--accent); }
.grid th.sortable.sorted.asc::after { content: " ↑"; }
.grid tbody tr.static { cursor: default; }
.grid td.r, .grid th.r { text-align: right; font-variant-numeric: tabular-nums; }
.grid td.c, .grid th.c { text-align: center; }
.sub-tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.sub-tabs button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: 13px; color: var(--ink-2); }
.sub-tabs button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.mini-bars { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 6px; align-items: end; height: 110px; margin: 8px 0 4px; }
.mini-bars div { display: grid; align-content: end; gap: 3px; text-align: center; font-size: 11px; color: var(--ink-2); height: 100%; }
.mini-bars span { display: block; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; }
.mini-bars em { font-style: normal; color: var(--muted); }
.list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.list li { border: 1px solid var(--line-2); border-radius: var(--r); padding: 8px 10px; font-size: 13px; display: flex; justify-content: space-between; gap: 10px; }
.hint { background: #f8f9fb; border-radius: var(--r); padding: 8px 10px; font-size: 12.5px; color: var(--ink-2); margin: 0 0 8px; }
.st { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; display: inline-block; }
.st.done { background: var(--ok-soft); color: var(--ok); } .st.go { background: var(--accent-soft); color: var(--accent); } .st.plan { background: var(--warn-soft); color: var(--warn); } .st.none { background: var(--line-2); color: var(--muted); } .st.bad { background: var(--bad-soft); color: var(--bad); }
.task-month { font: 600 13px var(--font); color: var(--ink-2); margin: 14px 0 6px; }
.task { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 9px 12px; margin-bottom: 6px; }
.task .meta { font-size: 12px; color: var(--muted); }
.loading { padding: 40px; text-align: center; color: var(--muted); }
@media (max-width: 860px) {
  .mirror-note { padding: 6px 16px; }
  .view { padding: 12px 16px 24px; }
  .pbar i { width: 44px; }
}
@media (max-width: 860px) {
  .topbar { gap: 8px; padding: 0 12px; }
  .sync, .who { display: none; }
  .note { margin-left: 0; }
  select.inp { max-width: none; flex: 1 1 45%; }
  .table-wrap { max-height: none; }
  dl.kv { grid-template-columns: 1fr; gap: 0; }
  dl.kv dt { margin-top: 6px; }
}
/* Fase 1: form rombel */
.draft-banner { background: var(--warn-soft); color: #6b3d00; border: 1px solid #f3dcb3; border-radius: var(--r); padding: 8px 12px; margin-bottom: 12px; font-size: 13px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.draft-banner .btn { margin-left: auto; }
.rform { display: grid; gap: 10px; padding: 12px 0; }
.rform label, .rform .fld { display: grid; gap: 4px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.rform .inp, .rform select.inp { width: 100%; max-width: none; }
.rform textarea.inp { height: auto; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.days { display: flex; flex-wrap: wrap; gap: 4px 12px; font-weight: 400; color: var(--ink); }
.days label { display: flex; align-items: center; gap: 5px; font-weight: 400; }
.days input { accent-color: var(--accent); width: 16px; height: 16px; }
.trxhint { font-size: 12.5px; color: var(--ink-2); display: grid; gap: 6px; }
.trxhint:empty { display: none; }
.trxhint .chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.trxhint .chip { border: 0; cursor: pointer; font: inherit; font-size: 12px; }
.pusat { border: 1px dashed var(--line); border-radius: var(--r); padding: 10px; display: grid; gap: 8px; font-size: 13px; }
.form-act { display: flex; gap: 8px; justify-content: space-between; padding-top: 4px; }
a.btn { text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; }
.req { font-size: 11px; color: var(--bad); font-weight: 600; }
.btn.danger { color: var(--bad); }
@media (max-width: 600px) { .row2 { grid-template-columns: 1fr; } }

/* Murid (desentralisasi) */
pre.msg{white-space:pre-wrap;font:13px/1.5 var(--font,Inter,sans-serif);background:#f5f7fa;border:1px solid #e3e7ee;border-radius:8px;padding:10px;margin:0 0 8px;max-height:260px;overflow:auto}
.rform label:has(> input[type=checkbox]){display:flex;align-items:flex-start;gap:8px;grid-column:1/-1}
.rform label input[type=checkbox]{width:auto;margin:3px 0 0;flex:none}
/* Halaman hub & rekap kelas */
.hub-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.hub-head h2 { margin: 2px 0 0; font: 700 20px/1.25 'Plus Jakarta Sans', Inter, sans-serif; }
.hub-head select { min-width: 220px; }
.sub-tabs.sm button { padding: 4px 10px; font-size: 12px; }
.wide .grid td, .wide .grid th { white-space: nowrap; }
.wide .grid td.wrap { white-space: normal; min-width: 200px; }
.top-right { flex: none; }
.top-right .btn, .who { white-space: nowrap; }

/* Sidebar (pola MUV: bisa disembunyikan, status diingat) */
.side-toggle { display: grid; place-items: center; width: 32px; height: 32px; border: 0; background: none; border-radius: 6px; cursor: pointer; color: var(--ink-2); flex: none; margin-right: -8px; }
.side-toggle:hover { background: var(--bg); color: var(--ink); }
.ms { font-family: 'Material Symbols Rounded'; font-weight: normal; font-style: normal; font-size: 20px; line-height: 1; letter-spacing: normal; text-transform: none; white-space: nowrap; direction: ltr; -webkit-font-smoothing: antialiased; font-feature-settings: 'liga'; width: 20px; overflow: hidden; display: inline-block; flex: none; }
.shell { display: flex; align-items: flex-start; }
.side { width: 224px; flex: none; position: sticky; top: 52px; height: calc(100vh - 52px); overflow: hidden auto; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; transition: width .2s ease; }
body.side-closed .side { width: 0; border-right: 0; }
.side-nav { display: flex; flex-direction: column; gap: 2px; padding: 10px 10px 8px; min-width: 224px; }
.side-grp { padding: 12px 10px 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.side-grp:first-child { padding-top: 4px; }
.tab { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: none; cursor: pointer; text-align: left; color: var(--ink-2); font-weight: 500; white-space: nowrap; text-decoration: none; }
.tab:hover { background: var(--bg); color: var(--ink); }
.tab.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side-foot { margin-top: auto; padding: 8px 10px 12px; min-width: 224px; border-top: 1px solid var(--line-2); }
.main { flex: 1; min-width: 0; }
.side-scrim { position: fixed; inset: 0; background: rgba(17, 24, 39, .32); z-index: 29; }
@media (max-width: 860px) {
  .side { position: fixed; top: 0; left: 0; z-index: 30; height: 100vh; height: 100dvh; width: 264px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 8px 24px rgba(17, 24, 39, .16); padding-top: env(safe-area-inset-top); }
  body.side-closed .side { width: 264px; border-right: 1px solid var(--line); }
  body.side-open .side { transform: none; }
}
/* Kelola data */
.klists { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 12px; }
.klists label { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.klists textarea.inp { height: auto; width: 100%; max-width: none; resize: vertical; font-size: 13px; line-height: 1.5; }
.kchecks { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-weight: 400; }
.kchecks label { display: flex !important; align-items: center; gap: 6px; font-weight: 400 !important; }
.inp.sm, select.inp.sm { height: 30px; font-size: 12.5px; padding: 0 8px; }
.task-st { min-width: 128px; }

/* Paket kelas */
.pk-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pk-back { margin-bottom: 4px; }
.pk-it { cursor: pointer; align-items: center; }
.pk-it:hover { border-color: var(--accent); background: var(--accent-soft); }
.pk-mapf { margin-top: 10px; padding: 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: #f8f9fb; }
.drawer .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bad-n { color: var(--warn); font-weight: 600; }
.drawer .chip { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); }
.grid td.pk-nm { min-width: 260px; font-weight: 500; }
.lk { display: inline-flex; align-items: center; gap: 4px; margin: 1px 8px 1px 0; white-space: nowrap; }
.lk a { color: var(--accent); text-decoration: none; font-weight: 500; }
.lk a:hover { text-decoration: underline; }
.lk .cp { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; font: 500 11px var(--font); padding: 1px 6px; color: var(--ink-2); cursor: pointer; }
.lk .cp:hover { border-color: var(--accent); color: var(--accent); }
.grid td.pk-nm { max-width: 460px; }
.pk-lks { margin-top: 4px; font-weight: 400; font-size: 13px; }
.pk-lks .lk .cp { font-size: 10.5px; padding: 0 5px; }
.kv dd .lk { white-space: normal; word-break: break-all; }
