/* ==========================================================================
   Guru Wali SMPN 167 — sistem desain
   Tema: navy (resmi, tepercaya) + emas (aksen pendampingan). Mendukung mode gelap.
   ========================================================================== */

:root {
  --bg: #f3f5fa;
  --surface: #ffffff;
  --surface-2: #f5f7fb;
  --surface-3: #eef2f8;
  --line: #e2e8f1;
  --line-strong: #cfd8e6;
  --text: #0f1b33;
  --text-2: #334360;
  --muted: #66748c;

  --primary: #1f3f8f;
  --primary-hover: #183477;
  --primary-ink: #ffffff;
  --primary-soft: #e9eefa;
  --primary-line: #c9d5f2;

  --accent: #d4981c;
  --accent-soft: #fdf4de;

  --ok: #157347;      --ok-soft: #e3f4ea;
  --warn: #b25e09;    --warn-soft: #fdf0dc;
  --bad: #c0281f;     --bad-soft: #fde7e5;
  --info: #1e5bc6;    --info-soft: #e5eefc;
  --violet: #6b3fc0;  --violet-soft: #efe8fb;
  --idle: #6f7c91;    --idle-soft: #edf0f5;

  --nav-1: #0c1835;
  --nav-2: #132a5e;
  --nav-text: #b9c5df;
  --nav-text-strong: #ffffff;
  --nav-muted: #7d8db0;
  --nav-hover: rgba(255, 255, 255, .06);
  --nav-active: rgba(255, 255, 255, .11);

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(15, 27, 51, .05);
  --shadow: 0 1px 2px rgba(15, 27, 51, .04), 0 4px 14px rgba(15, 27, 51, .05);
  --shadow-lg: 0 10px 40px rgba(12, 24, 53, .14);
  --sidebar-w: 268px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --surface: #121b2d;
    --surface-2: #172238;
    --surface-3: #1c2942;
    --line: #24324d;
    --line-strong: #31415f;
    --text: #e8edf6;
    --text-2: #c3cde0;
    --muted: #8d9bb5;
    --primary: #7d9ff0;
    --primary-hover: #93b0f5;
    --primary-ink: #0b1530;
    --primary-soft: #1a2747;
    --primary-line: #2c3f6c;
    --accent: #f0b84a;
    --accent-soft: #3a2d10;
    --ok: #5cd193;      --ok-soft: #12301f;
    --warn: #f2b45c;    --warn-soft: #36270f;
    --bad: #ff8b82;     --bad-soft: #3a1715;
    --info: #79a8ff;    --info-soft: #172a4b;
    --violet: #c3a6ff;  --violet-soft: #2a2142;
    --idle: #95a2b8;    --idle-soft: #1f2a3e;
    --nav-1: #070d1b;
    --nav-2: #0d1a38;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
  }
}

/* ---------- Dasar ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14.5px/1.55 var(--font); -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; color: var(--text); }
h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
h2 { font-size: 15.5px; font-weight: 700; margin: 0 0 12px; letter-spacing: -.005em; }
p { margin: 0 0 10px; }
code { font-size: 12.5px; background: var(--surface-3); padding: 1px 5px; border-radius: 5px; }
small, .small { font-size: 12.5px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.right { text-align: right; }
.center { text-align: center; }
.kosong { color: var(--muted); font-style: italic; margin: 4px 0; }
.inline, .inline-form { display: inline; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

/* ---------- Kerangka: menu samping + konten ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40;
  display: flex; flex-direction: column;
  background: linear-gradient(185deg, var(--nav-1) 0%, var(--nav-2) 100%);
  color: var(--nav-text);
  border-right: 1px solid rgba(255, 255, 255, .04);
}
.sidebar::after { /* kilau halus di pojok */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(420px 260px at 0% 0%, rgba(212, 152, 28, .12), transparent 70%);
}
.sb-brand {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 12px;
  padding: 20px 20px 18px; color: var(--nav-text-strong); text-decoration: none !important;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.sb-brand .sb-logo {
  width: 44px; height: 44px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}
.sb-brand .sb-logo img { width: 34px; height: 34px; object-fit: contain; }
.sb-brand b { display: block; font-size: 16.5px; font-weight: 800; letter-spacing: -.01em; }
.sb-brand small { display: block; font-size: 11.5px; color: var(--nav-muted); line-height: 1.35; }
.sb-periode {
  position: relative; z-index: 1; margin: 14px 16px 2px; padding: 8px 12px; border-radius: 10px;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .07);
  font-size: 12px; color: var(--nav-text); display: flex; align-items: center; gap: 8px;
}
.sb-periode::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(212, 152, 28, .2); }
.sb-nav { position: relative; z-index: 1; flex: 1; overflow-y: auto; padding: 8px 12px 16px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.sb-grup { padding: 16px 10px 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--nav-muted); }
.sb-nav a {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; margin: 1px 0; border-radius: 10px;
  color: var(--nav-text); font-weight: 600; font-size: 14px; text-decoration: none !important;
  transition: background .15s, color .15s;
}
.sb-nav a svg { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.sb-nav a:hover { background: var(--nav-hover); color: var(--nav-text-strong); }
.sb-nav a.aktif { background: var(--nav-active); color: var(--nav-text-strong); }
.sb-nav a.aktif::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); }
.sb-nav a.aktif svg { opacity: 1; color: var(--accent); }
.sb-user {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 10px;
  margin: 0 12px 14px; padding: 12px; border-radius: 12px;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .07);
}
.sb-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #b8780a); color: #1b1300; font-weight: 800; font-size: 15px;
}
.sb-nama { flex: 1; min-width: 0; }
.sb-nama b { display: block; color: var(--nav-text-strong); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-nama small { display: block; color: var(--nav-muted); font-size: 11px; line-height: 1.35; }
.sb-keluar {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid rgba(255,255,255,.12); background: transparent;
  color: var(--nav-text); display: grid; place-items: center; cursor: pointer; flex: none;
}
.sb-keluar:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.sb-keluar svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.sb-tirai { position: fixed; inset: 0; background: rgba(8, 15, 32, .5); backdrop-filter: blur(2px); z-index: 35; }

.konten { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 12px 28px; min-height: 62px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .jejak { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .jejak b { color: var(--text); font-weight: 700; }
.topbar .jejak span { margin: 0 6px; opacity: .6; }
.topbar .tgl { font-size: 12.5px; color: var(--muted); padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); white-space: nowrap; }
.btn-menu {
  display: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); place-items: center; cursor: pointer; flex: none;
}
.btn-menu svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.topbar .brand-hp { display: none; align-items: center; gap: 8px; font-weight: 800; color: var(--text); }
.topbar .brand-hp img { width: 28px; height: 28px; }
main#isi { width: 100%; max-width: 1320px; padding: 26px 28px 48px; }
.demo-pita { background: var(--accent-soft); color: var(--warn); font-size: 12.5px; font-weight: 600; text-align: center; padding: 7px 16px; border-bottom: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }

@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  body.menu-terbuka .sidebar { transform: none; }
  .konten { margin-left: 0; }
  .btn-menu { display: grid; }
  .topbar { padding: 10px 16px; }
  .topbar .brand-hp { display: flex; }
  .topbar .jejak, .topbar .tgl { display: none; }
  main#isi { padding: 18px 16px 40px; }
}

/* ---------- Judul halaman ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head > div:first-child { min-width: 0; }
.page-head .muted { margin-top: 4px; }
.page-head .aksi { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Kartu & grid ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0;
}
.grid > .card { margin-bottom: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.card-head .aksi { display: flex; gap: 6px; }
a.card, a.card:hover { text-decoration: none; color: inherit; }
a.card { transition: border-color .15s, transform .15s, box-shadow .15s; }
a.card:hover { border-color: var(--primary-line); transform: translateY(-1px); box-shadow: var(--shadow), 0 6px 18px rgba(15, 27, 51, .07); }
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.g2 { grid-template-columns: 1fr; }
.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Kartu statistik */
.stat-lengkap { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 16px 18px 16px 20px; overflow: hidden; }
.stat-lengkap::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--idle); }
.stat-lengkap b { font-size: 28px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-lengkap span { font-weight: 700; font-size: 13.5px; color: var(--text-2); }
.stat-lengkap small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.stat-lengkap.ok::before { background: var(--ok); }
.stat-lengkap.warn::before { background: var(--warn); }
.stat-lengkap.bad::before { background: var(--bad); }
.stat-lengkap.info::before { background: var(--primary); }
.stat-lengkap.violet::before { background: var(--violet); }
.stat-lengkap.ok b { color: var(--ok); }
.stat-lengkap.warn b { color: var(--warn); }
.stat-lengkap.bad b { color: var(--bad); }
@media (max-width: 520px) { .stat-lengkap b { font-size: 23px; } .stat-lengkap { padding: 13px 14px 13px 17px; } }

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); font: 600 13.5px/1.2 var(--font);
  cursor: pointer; text-decoration: none !important; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--surface-2); border-color: var(--primary-line); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.utama { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); box-shadow: 0 1px 2px rgba(31, 63, 143, .3), 0 4px 12px rgba(31, 63, 143, .18); }
.btn.utama:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.bahaya { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.btn.polos { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn.polos:hover { background: var(--surface-3); color: var(--text); }
.btn.kecil { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn.besar { padding: 12px 20px; font-size: 14.5px; }
.baris-aksi { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Formulir ---------- */
input, select, textarea { font: inherit; color: var(--text); }
.filters {
  display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin-bottom: 16px;
  padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.filters input, .filters select, .field input, .field select, .field textarea, .demo-lain select, input[type=search] {
  padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); min-height: 40px; transition: border-color .15s, box-shadow .15s;
}
.filters input:focus, .filters select:focus, .field input:focus, .field select:focus, .field textarea:focus, input[type=search]:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
}
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; }
.field > span { font-weight: 700; color: var(--text-2); }
.field textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.cek-grup { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.cek-grup label { display: inline-flex; gap: 7px; align-items: center; font-size: 14px; cursor: pointer; }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); width: 16px; height: 16px; }
.pilih-murid {
  max-height: 330px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px;
  background: var(--surface-2); display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 2px 8px;
}
.pilih-murid label { display: flex; gap: 9px; align-items: center; padding: 7px 8px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.pilih-murid label:hover { background: var(--surface); }
.pilih-murid label:has(input:checked) { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.pilih-murid small { color: var(--muted); font-weight: 500; }
details.edit summary { cursor: pointer; color: var(--primary); font-weight: 700; font-size: 13px; list-style: none; }
details.edit summary::-webkit-details-marker { display: none; }
details.edit[open] { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }

/* ---------- Pemberitahuan ---------- */
.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; border: 1px solid transparent; }
.alert::before { flex: none; font-weight: 800; }
.alert.ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 22%, transparent); }
.alert.ok::before { content: "✓"; }
.alert.bad { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 22%, transparent); }
.alert.bad::before { content: "!"; }
.alert.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 22%, transparent); }
.alert.info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 22%, transparent); }
.alert a { color: inherit; text-decoration: underline; }
.sumber-mati { font-size: 13px; color: var(--warn); background: var(--warn-soft); padding: 8px 12px; border-radius: 8px; }

/* ---------- Tabel ---------- */
.tabel-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.tabel { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tabel th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap;
}
.tabel th:first-child { border-top-left-radius: 8px; }
.tabel th:last-child { border-top-right-radius: 8px; }
.tabel td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tabel tbody tr:hover td { background: var(--surface-2); }
.tabel tr:last-child td { border-bottom: 0; }
.tabel .num, .tabel td.num, .tabel th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tabel .baris-mati td { color: var(--muted); }
.mini-tabel td, .mini-tabel th { padding: 8px 10px; font-size: 13px; }
.tabel tr.kini td { background: var(--primary-soft); }
.bawah-kkm { color: var(--bad) !important; font-weight: 700; }

/* ---------- Lencana & chip ---------- */
.lampu { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; line-height: 1.2; }
.lampu::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.lampu-hijau { color: var(--ok); background: var(--ok-soft); }
.lampu-kuning { color: var(--warn); background: var(--warn-soft); }
.lampu-merah { color: var(--bad); background: var(--bad-soft); }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); margin: 3px 4px 3px 0; border: 1px solid var(--line); }
.rah-umum { color: var(--muted); }
.rah-terbatas { color: var(--warn); }
.rah-rahasia { color: var(--bad); }

/* ---------- Kartu murid (dashboard) ---------- */
.murid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.mk {
  position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 15px 16px 13px 19px; color: inherit; text-decoration: none !important;
  box-shadow: var(--shadow); transition: border-color .15s, transform .15s, box-shadow .15s; overflow: hidden;
}
.mk::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--ok); }
.mk.kuning::before { background: var(--warn); }
.mk.merah::before { background: var(--bad); }
.mk:hover { border-color: var(--primary-line); transform: translateY(-2px); box-shadow: var(--shadow), 0 8px 22px rgba(15, 27, 51, .08); }
.mk .atas { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.mk .nm { font-weight: 700; line-height: 1.3; color: var(--text); }
.mk .sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.mk .alasan { list-style: none; margin: 10px 0 0; padding: 9px 0 0; border-top: 1px dashed var(--line); font-size: 13px; }
.mk .alasan li { margin: 3px 0; color: var(--text-2); }
.mk .alasan .t2 { color: var(--bad); font-weight: 600; }
.mk .alasan .t1 { color: var(--warn); }
.mk .kaki { display: flex; gap: 6px 14px; flex-wrap: wrap; margin-top: auto; padding-top: 10px; font-size: 11.5px; color: var(--muted); }

/* ---------- Profil murid ---------- */
.profil-kartu { padding: 0; overflow: hidden; }
.profil-sampul { height: 74px; background: linear-gradient(120deg, var(--nav-1), var(--nav-2) 55%, #2a4fa8); position: relative; }
.profil-sampul::after { content: ""; position: absolute; inset: 0; background: radial-gradient(300px 120px at 90% 0%, rgba(212, 152, 28, .35), transparent 70%); }
.profil-head { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; padding: 0 22px 18px; position: relative; }
.profil-head .av { margin-top: -34px; }
.profil-head .identitas { padding-top: 14px; }
.profil-head .baris-aksi { padding-top: 16px; margin-left: auto; }
.profil-head .av {
  width: 76px; height: 76px; border-radius: 20px; flex: none; display: grid; place-items: center;
  background: var(--surface); color: var(--primary); font-weight: 800; font-size: 30px;
  border: 4px solid var(--surface); box-shadow: var(--shadow-lg);
  background-image: linear-gradient(135deg, var(--primary-soft), var(--surface));
}
.profil-head .identitas { flex: 1; min-width: 220px; }
.profil-head h1 { font-size: 22px; }
.tabbar { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 6px 0 18px; scrollbar-width: none; }
.tabbar::-webkit-scrollbar { display: none; }
.tabbar a { padding: 11px 14px; color: var(--muted); text-decoration: none; font-weight: 700; font-size: 13.5px; border-bottom: 2.5px solid transparent; white-space: nowrap; margin-bottom: -1px; }
.tabbar a:hover { color: var(--text); text-decoration: none; }
.tabbar a.aktif { color: var(--primary); border-bottom-color: var(--primary); }
.dl { display: grid; grid-template-columns: minmax(120px, 36%) 1fr; gap: 8px 14px; margin: 0; font-size: 14px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; color: var(--text); }

.kal { display: flex; flex-wrap: wrap; gap: 4px; }
.kal span { width: 24px; height: 24px; border-radius: 6px; font-size: 10.5px; display: grid; place-items: center; font-weight: 700; background: var(--idle-soft); color: var(--muted); }
.kal .k-h { background: var(--ok-soft); color: var(--ok); }
.kal .k-t { background: var(--warn-soft); color: var(--warn); }
.kal .k-a { background: var(--bad); color: #fff; }
.kal .k-s, .kal .k-i { background: var(--info-soft); color: var(--info); }
.kal .k-d { background: var(--violet-soft); color: var(--violet); }

.batang { display: flex; align-items: flex-end; gap: 6px; height: 110px; padding-top: 18px; border-bottom: 1px solid var(--line); }
.batang div { flex: 1; background: linear-gradient(180deg, var(--primary), color-mix(in srgb, var(--primary) 55%, var(--surface))); border-radius: 6px 6px 0 0; position: relative; min-width: 10px; max-width: 46px; }
.batang div.rendah { background: linear-gradient(180deg, var(--warn), color-mix(in srgb, var(--warn) 45%, var(--surface))); }
.batang div span { position: absolute; top: -17px; left: -4px; right: -4px; text-align: center; font-size: 10.5px; font-weight: 600; color: var(--muted); }

.lini { list-style: none; margin: 0; padding: 0; }
.lini li { display: grid; grid-template-columns: 100px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.lini li:last-child { border-bottom: 0; }
.lini .tg { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.lini .src { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .03em; padding: 2px 7px; border-radius: 5px; margin-right: 7px; background: var(--surface-3); color: var(--muted); }
.lini .j-bad .src { background: var(--bad-soft); color: var(--bad); }
.lini .j-warn .src { background: var(--warn-soft); color: var(--warn); }
.lini .j-info .src { background: var(--info-soft); color: var(--info); }
.lini .j-ok .src { background: var(--ok-soft); color: var(--ok); }
.lini .j-violet .src { background: var(--violet-soft); color: var(--violet); }
.lini .rinci { color: var(--muted); font-size: 13px; margin-top: 2px; }
@media (max-width: 520px) { .lini li { grid-template-columns: 1fr; gap: 2px; } }

.cat { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px; background: var(--surface); box-shadow: var(--shadow); }
.cat .kepala { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cat .kepala b { font-size: 15px; }
.cat .isi { white-space: pre-line; margin-top: 8px; font-size: 14px; color: var(--text-2); }
.cat .tl { margin-top: 10px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; }

/* ---------- Halaman masuk ---------- */
.hal-masuk { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); background: var(--surface); }
.masuk-hero {
  position: relative; overflow: hidden; color: #fff; display: flex; flex-direction: column; justify-content: space-between;
  padding: 44px 56px; background: linear-gradient(150deg, #0b1734 0%, #13295c 52%, #1d3f8f 100%);
}
.masuk-hero::before { /* pola titik */
  content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: radial-gradient(rgba(255, 255, 255, .12) 1px, transparent 1px); background-size: 22px 22px;
  mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
}
.masuk-hero::after { content: ""; position: absolute; width: 520px; height: 520px; right: -170px; top: -150px; border-radius: 50%; background: radial-gradient(circle, rgba(212, 152, 28, .35), transparent 65%); }
.masuk-hero > * { position: relative; z-index: 1; }
.mh-brand { display: flex; align-items: center; gap: 12px; }
.mh-brand .sb-logo { width: 48px; height: 48px; border-radius: 14px; background: #fff; display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.mh-brand .sb-logo img { width: 36px; height: 36px; }
.mh-brand b { display: block; font-size: 17px; font-weight: 800; }
.mh-brand small { display: block; font-size: 12.5px; color: #aebbd9; }
.mh-isi { max-width: 520px; margin: 48px 0; }
.mh-label { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #f3d38a; background: rgba(212, 152, 28, .14); border: 1px solid rgba(212, 152, 28, .35); padding: 6px 12px; border-radius: 999px; }
.mh-isi h1 { color: #fff; font-size: clamp(30px, 3.4vw, 44px); line-height: 1.12; letter-spacing: -.03em; margin: 18px 0 14px; }
.mh-isi h1 em { font-style: normal; color: #f3c25a; }
.mh-isi p { color: #c4cfe7; font-size: 15.5px; line-height: 1.65; margin: 0; }
.mh-fitur { list-style: none; padding: 0; margin: 30px 0 0; display: grid; gap: 14px; }
.mh-fitur li { display: flex; gap: 14px; align-items: flex-start; }
.mh-fitur .ik { width: 40px; height: 40px; border-radius: 11px; flex: none; display: grid; place-items: center; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); }
.mh-fitur .ik svg { width: 20px; height: 20px; fill: none; stroke: #f3c25a; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mh-fitur b { display: block; font-size: 14.5px; color: #fff; }
.mh-fitur span { display: block; font-size: 13px; color: #aebbd9; line-height: 1.5; }
.mh-kaki { font-size: 12px; color: #8191b5; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mh-kaki a { color: #c4cfe7; }

.masuk-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg); }
.masuk-kartu { width: 100%; max-width: 420px; }
.masuk-kartu .logo-hp { display: none; width: 64px; height: 64px; margin: 0 auto 14px; }
.masuk-kartu h2 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px; }
.masuk-kartu .sub { color: var(--muted); margin: 0 0 26px; font-size: 14.5px; }
.masuk-kotak { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 26px; box-shadow: var(--shadow-lg); }
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%;
  padding: 13px 16px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--text); font: 700 14.5px var(--font); text-decoration: none !important; cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s; box-shadow: var(--shadow-sm);
}
.btn-google:hover { border-color: var(--primary-line); box-shadow: 0 4px 14px rgba(15, 27, 51, .1); transform: translateY(-1px); }
.btn-google svg { width: 20px; height: 20px; }
.masuk-catatan { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.masuk-catatan svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--primary); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-top: 1px; }
.pemisah { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 20px 0 14px; }
.pemisah::before, .pemisah::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.demo-lain { display: flex; gap: 8px; }
.demo-lain select { flex: 1; min-width: 0; width: 100%; text-overflow: ellipsis; }
.masuk-panel, .masuk-kartu, .masuk-kotak { min-width: 0; }
.masuk-bawah { text-align: center; margin-top: 20px; font-size: 13px; color: var(--muted); }

@media (max-width: 960px) {
  .hal-masuk { grid-template-columns: minmax(0, 1fr); }
  .masuk-hero { padding: 26px 22px 30px; }
  .mh-isi { margin: 26px 0 0; }
  .mh-isi h1 { font-size: 28px; }
  .mh-fitur, .mh-kaki { display: none; }
  .masuk-panel { padding: 26px 16px 40px; align-items: flex-start; }
}

/* Ikon garis kecil */
.ik { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; flex: none; }
.ik-bad { color: var(--bad); }
.mk .alasan li { display: flex; gap: 7px; align-items: flex-start; }
.mk .alasan li .ik { margin-top: 2px; }
.mk .kaki span { display: inline-flex; align-items: center; gap: 5px; }
.mk .kaki .ik { width: 13px; height: 13px; vertical-align: 0; }

/* Tabel nilai: semua kolom nilai harian */
.tabel-nilai th.grup-nh { text-align: center; border-bottom: 1px solid var(--line); background: var(--primary-soft); color: var(--primary); }
.tabel-nilai th.sel-nh, .tabel-nilai td.sel-nh { min-width: 44px; padding-left: 6px; padding-right: 6px; }
.tabel-nilai td.sel-nh { color: var(--text-2); }
.tabel-nilai td.kosong-sel { background: repeating-linear-gradient(135deg, transparent 0 5px, var(--surface-3) 5px 6px); }
.tabel-nilai td.rata-nh { background: var(--surface-2); border-left: 1px solid var(--line); }
.tabel-nilai thead tr:first-child th[rowspan] { vertical-align: bottom; }
.tabel-nilai td:first-child { min-width: 150px; }
