/* Data Siswa LPK — dashboard admin padat, palet PUTIH + HIJAU MUDA */
:root {
  /* Palet "putih + hijau muda" (permintaan pemilik LPK, 24 Nov 2026): permukaan
     putih dengan SENTUHAN hijau muda (mint) di mana-mana, dan satu hijau yang
     cukup tua untuk tombol/tautan/menu aktif supaya teks tetap terbaca.
     Catatan kontras (dihitung, bukan dikira):
       hijau aksen #15703a  → 6,2:1 di atas putih  ✔ (juga aman untuk label putih)
       hijau muda  #22c55e  → 2,3:1 di atas putih  ✘ HANYA untuk hiasan
                                          (bilah, titik, garis, ikon besar)
       teks netral #14231a  → 16,3:1 · sekunder #34473b → 9,9:1 · redup #5b6f62 → 5,4:1
     `color-scheme: only light` WAJIB: tanpa ini mode gelap peramban ponsel
     (Chrome "Auto dark theme") menginversi halaman sehingga teks menjadi gelap
     di atas latar gelap — aplikasi terlihat rusak/tidak terbaca. Dengan
     pernyataan ini tampilan tetap putih + hijau & seluruh teks tetap terbaca
     walaupun ponsel sedang mode gelap. */
  color-scheme: only light;
  --bg: #fbfdfb;
  --surface: #ffffff;
  --surface-2: #f5fbf7;
  --surface-3: #edf7f0;
  --border: #e2efe6;
  --border-2: #c9dece;
  --text: #14231a;
  --text-2: #34473b;
  --muted: #5b6f62;
  --muted-2: #9aab9f;
  --accent: #15703a;
  --accent-h: #116932;
  --accent-soft: #e8f7ee;
  --accent-2: #22c55e;
  --accent-2-h: #0f5c2e;
  --accent-2-soft: #dcfce7;
  --sidebar: #ffffff;
  --sidebar-2: #f2fbf5;
  --side-ink: #34473b;
  --side-ink-dim: #7c8f83;
  --side-ink-strong: #14231a;
  --side-line: #e2efe6;
  --ok: #0d6b52;   --ok-bg: #e2f3ee;   --ok-bd: #b9dfd2;
  --warn: #a15f00; --warn-bg: #fff4d9; --warn-bd: #f2dda8;
  --err: #b3261e;  --err-bg: #fdecea;  --err-bd: #f6cec9;
  --info: #1c5aa8; --info-bg: #e8f1fb; --info-bd: #c6dcf5;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(20, 35, 26, .06), 0 1px 3px rgba(20, 35, 26, .04);
}

/* Sidebar PUTIH: butuh garis pemisah tipis (dulu blok gelap).
   Di ponsel sidebar melayang di atas isi → garisnya dimatikan. */
.sidebar { border-right: 1px solid var(--side-line); }
@media (max-width: 900px) { .sidebar { border-right: 0; } }

/* Jaring pengaman mode gelap: walau peramban memaksa skema gelap, permukaan &
   teks tetap terang/gelap seperti desainnya. */
html { background: #ffffff; color-scheme: only light; }
input, select, textarea, button { color-scheme: only light; }
input::placeholder, textarea::placeholder { color: var(--muted-2); opacity: 1; }


* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }

/* ------------------------------------------------------------- layout ----- */
body.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px;
  flex: 0 0 236px;
  background: var(--sidebar);
  color: var(--side-ink);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  /* 100vh ditimpa 100dvh (tinggi viewport yang benar-benar terlihat — di ponsel
     bilah alamat membuat 100vh lebih tinggi dari layar). */
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  /* WAJIB: daftar menu digulung di dalam sidebar. Tanpa ini, pada layar pendek
     (mis. 600px) menu terbawah terdorong keluar layar dan TIDAK bisa dijangkau
     karena sidebar sendiri tidak bisa digulung — kejadian nyata 20 Okt 2026.
     `overflow-y: auto` (bukan hidden) dipakai sebagai jaring pengaman: kalau ada
     yang meluber, sidebar tetap bisa digulung, bukan memotong menu. */
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  z-index: 40;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 14px; border-bottom: 1px solid var(--side-line); flex: 0 0 auto; }
.brand-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: 8px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2-h));
  color: #fff; font-size: 11.5px; font-weight: 800; letter-spacing: .04em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { color: var(--side-ink-strong); font-size: 13.5px; }
.brand-text small { color: var(--side-ink-dim); font-size: 11px; }

/* Menu menggulung sendiri (min-height:0 wajib — tanpa itu item flex menolak
   mengecil dan daftar menu malah meluber ke luar sidebar). */
.nav {
  padding: 10px 8px; display: flex; flex-direction: column; gap: 2px;
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: rgba(150,175,160,.55) transparent;
}
.nav::-webkit-scrollbar { width: 8px; }
.nav::-webkit-scrollbar-track { background: transparent; }
.nav::-webkit-scrollbar-thumb { background: rgba(150,175,160,.45); border-radius: 999px; }
.nav::-webkit-scrollbar-thumb:hover { background: rgba(150,175,160,.75); }
.nav-link { flex: 0 0 auto; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 7px;
  color: var(--side-ink); font-size: 13.5px; font-weight: 500;
}
.nav-link:hover { background: var(--sidebar-2); color: var(--side-ink-strong); text-decoration: none; }
.nav-link.is-active { background: var(--accent); color: #fff; }
.nav-link .ico { opacity: .9; }
.nav-link span:first-of-type { flex: 1; min-width: 0; }
.nav-badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--warn); color: #fff; font-size: 11px; font-weight: 700;
}
.nav-link.is-active .nav-badge { background: #fff; color: var(--accent-h); }

.sidebar-foot { padding: 12px; border-top: 1px solid var(--side-line); display: flex; flex-direction: column; gap: 10px; flex: 0 0 auto; }
.side-user { display: flex; flex-direction: column; line-height: 1.35; }
.side-user strong { color: var(--side-ink-strong); font-size: 13px; }
.side-user small { color: var(--side-ink-dim); font-size: 11px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 22px;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 17px; }
.topbar-title p { font-size: 12px; color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.content { padding: 22px 22px 8px; flex: 1; }
.foot { padding: 16px 22px 22px; font-size: 11.5px; color: var(--muted-2); }

/* ------------------------------------------------------------ spacing ----- */
.section + .section, .grid + .grid, .card + .card, .grid + .card, .card + .grid, .section { margin-top: 20px; }
.grid { display: grid; gap: 16px; }
/* Grid item default-nya min-width:auto, sehingga tabel lebar di dalam kartu
   bisa memaksa kolom melebar melewati layar. min-width:0 + table-wrap
   (overflow-x:auto) membuat tabelnya menggulung sendiri, bukan merusak layout. */
.grid > * { min-width: 0; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 16px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; justify-content: space-between; }

/* -------------------------------------------------------------- card ------ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 14px; border-bottom: 1px solid var(--border);
}
.card-head h3 { font-size: 13.5px; }
.card-head .hint { font-size: 11.5px; color: var(--muted); }
.card-body { padding: 14px; }
.card-body.tight { padding: 0; }
.card-body.scroll { max-height: 420px; overflow: auto; }

.stat { padding: 13px 14px; }
.stat .label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.stat .value { font-size: 24px; font-weight: 700; margin-top: 4px; letter-spacing: -.02em; }
.stat .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* Kartu rekap dasbor yang bisa diklik → daftar siswa (permintaan pemilik LPK,
   13 Nov 2026). Seluruh kartu menjadi tautan; tampilannya tetap sama, hanya
   bertambah tanda hover supaya jelas bisa diklik. */
a.card.stat, .stat-link {
  display: block; color: inherit; text-decoration: none;
  transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
a.card.stat:hover, .stat-link:hover {
  border-color: var(--accent); box-shadow: 0 6px 18px rgba(20,35,26,.10);
  transform: translateY(-1px); text-decoration: none;
}
a.card.stat:focus-visible, .stat-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a.card.stat .label { display: flex; align-items: center; gap: 5px; }
a.card.stat .label::after { content: "↗"; font-size: 10px; opacity: 0; transition: opacity .12s ease; }
a.card.stat:hover .label::after, a.card.stat:focus-visible .label::after { opacity: .65; }

/* Petunjuk kecil di atas kartu rekap dasbor. */
.stat-hint {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--muted); margin: 0 0 10px;
}
.stat-hint .ico { flex: 0 0 auto; opacity: .8; }

/* Tautan pada sel matriks / daftar rekap angka: tetap gelap, tanpa garis bawah. */
a.num-link { color: inherit; text-decoration: none; border-bottom: 1px dotted rgba(21,112,58,.45); }
a.num-link:hover { color: var(--accent-h); border-bottom-color: var(--accent-h); }

/* ---------------------------------------- kartu rekap buka/tutup ---------- */
/* Permintaan pemilik LPK (17 Nov 2026): isi rekap di menu Laporan TIDAK tampil
   lebih dulu; daftar/tabel muncul setelah tombol pada judul kartu diklik, dan di
   dalamnya ada tombol "Tutup". Isinya hanya DISEMBUNYIKAN (bukan dihapus), jadi
   kalau JavaScript mati seluruh isi tetap terbaca. */
.kartu-lipat[data-terbuka="0"] > .card-body { display: none; }
.kartu-lipat[data-terbuka="0"] > .lipat-kaki { display: none; }
.kartu-lipat > .card-head { flex-wrap: wrap; }
.lipat-kaki {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 10px 14px; border-top: 1px solid var(--border);
}
.btn-lipat .tutup { display: none; }
.btn-lipat .buka::before { content: "▸ "; }
.kartu-lipat[data-terbuka="1"] .btn-lipat .buka { display: none; }
.kartu-lipat[data-terbuka="1"] .btn-lipat .tutup { display: inline; }
.kartu-lipat[data-terbuka="1"] .btn-lipat .tutup::before { content: "▾ "; }

/* Saat dicetak/disimpan sebagai PDF, semua isi rekap ikut tercetak. */
@media print {
  .kartu-lipat[data-terbuka="0"] > .card-body { display: block !important; }
  .kartu-lipat[data-terbuka="0"] > .lipat-kaki { display: none !important; }
  .btn-lipat { display: none !important; }
}

/* Tombol "← Kembali" di topbar (semua halaman). */
.btn-kembali { white-space: nowrap; color: var(--muted); }
.btn-kembali:hover { color: var(--text); }
.btn-kembali .ico { opacity: .8; }
@media (max-width: 560px) {
  /* Tombol Kembali tetap memakai teks (bukan hanya ikon) supaya jelas di layar
     ponsel; hanya jarak dalamnya yang dirapatkan. */
  .topbar-actions .btn-kembali { padding: 5px 8px; }
  .topbar-actions .btn-kembali .ico { width: 12px; height: 12px; }
}

/* ------------------------------------------------------------- table ------ */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 12.8px; }
table.data th {
  text-align: left; padding: 9px 12px; background: var(--surface-2);
  color: #3f5246; font-weight: 650; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data td { padding: 9px 12px; border-bottom: 1px solid var(--surface-3); vertical-align: middle; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.nowrap, table.data th.nowrap { white-space: nowrap; }
table.data .cell-strong { font-weight: 600; color: var(--text); }
table.data .cell-sub { font-size: 11.5px; color: var(--muted); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

table.kv { width: 100%; border-collapse: collapse; font-size: 13px; }
table.kv th, table.kv td { padding: 7px 0; vertical-align: top; text-align: left; border-bottom: 1px dashed var(--surface-3); }
table.kv th { width: 42%; color: var(--muted); font-weight: 500; }
table.kv tr:last-child th, table.kv tr:last-child td { border-bottom: 0; }

/* ------------------------------------------------------------ badges ------ */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 650; line-height: 1.6; white-space: nowrap;
}
.badge-ok   { background: var(--ok-bg);   color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-err  { background: var(--err-bg);  color: var(--err); }
.badge-sp1  { background: #fff4d9; color: #7a4400; }
.badge-sp2  { background: #ffe4cb; color: #7a3a06; }
.badge-sp3  { background: #b3261e; color: #fff; }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-mute { background: var(--surface-3); color: var(--muted); }
.badge-accent { background: var(--accent-soft); color: var(--accent-h); }

/* Baris tabel "yang terjadi otomatis" di kartu Hasil Akhir Siswa (form siswa):
   baris sesuai pilihan yang sedang dipilih diberi latar lembut. */
table.data tr.ha-pilih td { background: var(--accent-soft); }

/* matrix kelas × gakkou */
table.data.matrix th.m, table.data.matrix td.m { text-align: center; font-variant-numeric: tabular-nums; width: 120px; }
table.data.matrix td.zero { color: var(--muted-2); }
table.data.matrix tfoot td { border-top: 1px solid var(--border-2); background: var(--surface-2); }

/* ------------------------------------------- kolom "dibekukan" (freeze) ---- */
/* Dipakai daftar siswa hasil klik angka matriks Kelas & Gakkou: saat tabel
   digeser ke samping (form aksinya lebar), kolom Siswa tetap terlihat. */
table.data.freeze-kolom th.kol-fix,
table.data.freeze-kolom td.kol-fix {
  position: sticky; left: 0; z-index: 2;
  background: var(--surface);
  box-shadow: 1px 0 0 var(--border-2);
}
table.data.freeze-kolom th.kol-fix { background: var(--surface-2); z-index: 3; }
table.data.freeze-kolom tbody tr:hover td.kol-fix { background: var(--surface-2); }

/* ----------------------------------- form aksi cepat kelas & gakkou ------ */
/* "Kembalikan / pindah ke kelas" di dalam satu sel tabel: kolomnya sempit,
   jadi tiap isian diberi lebar dasar sendiri dan boleh membungkus. */
.aksi-kelas { gap: 8px; align-items: flex-end; }
.aksi-kelas .field > label { font-size: 10.5px; }
.aksi-kelas .field select, .aksi-kelas .field input { padding: 5px 8px; font-size: 12px; }
.aksi-kelas .field.aksi-kelas-kelas   { flex: 0 1 128px; }
.aksi-kelas .field.aksi-kelas-gakkou  { flex: 0 1 150px; }
.aksi-kelas .field.aksi-kelas-tanggal { flex: 0 1 132px; }
.aksi-kelas .field.aksi-kelas-catatan { flex: 1 1 190px; min-width: 150px; }
.aksi-kelas .acts { flex: 0 0 auto; }
.aksi-kelas .acts .btn[disabled] { opacity: .55; cursor: not-allowed; }
.aksi-kelas-kaki { flex: 1 1 100%; margin-top: 2px; }
/* "Batalkan penempatan terakhir" (Administrator) — pelengkap di bawah isian cepat,
   bukan bagian dari form pindah/mulai. */
form.aksi-kelas-batal { margin-top: 8px; display: flex; }
form.aksi-kelas-batal .btn { padding: 3px 8px; font-size: 11px; }

/* Daftar centang siswa untuk "masukkan ke kelas serentak" (menu Kelas JFT/JLPT):
   kotaknya digulung sendiri supaya ratusan siswa tidak memanjangkan halaman. */
.pilih-list {
  max-height: 300px; overflow: auto; border: 1px solid var(--border-2); border-radius: var(--radius);
  background: var(--surface); padding: 8px 10px; display: grid; gap: 5px;
}
.pilih-list .check { align-items: flex-start; font-size: 12.5px; }
.pilih-list .check > span { min-width: 0; }
.pilih-siswa-sub { color: var(--muted); font-size: 11.5px; }

/* Form "Masukkan siswa ke kelas JFT / JLPT": dua kolom supaya ruang tidak
   terbuang — daftar centang di kiri (digulung sendiri), isian di kanan. */
.masuk-grid { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.masuk-daftar { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.masuk-daftar > label { font-size: 11.5px; font-weight: 650; color: var(--text-2); text-transform: uppercase; letter-spacing: .03em; }
.masuk-daftar .pilih-list { max-height: 186px; padding: 6px 9px; }
.masuk-cari { display: flex; align-items: center; gap: 10px; }
.masuk-cari input { flex: 1 1 auto; min-width: 0; }
.masuk-cari .cell-sub { white-space: nowrap; }
.masuk-pilihsemua { margin-top: 2px; font-size: 12.5px; }
.masuk-isian { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.form-grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 12px; }
/* Kotak kecil "periode + catatan penempatan" di kartu siswa bagian JFT/JLPT. */
.note-kelas {
  margin-top: 12px; padding: 9px 12px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px;
}
.note-kelas .help { font-size: 12.5px; color: var(--text-2); }
@media (max-width: 900px) {
  .masuk-grid { grid-template-columns: 1fr; gap: 14px; }
  .masuk-daftar .pilih-list { max-height: 168px; }
}

.bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; min-width: 70px; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 999px; }

/* ----------------------------------------------------------- buttons ------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 13px; border-radius: 7px; border: 1px solid transparent;
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  background: var(--surface); color: var(--text-2); border-color: var(--border-2);
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-h); border-color: var(--accent-h); }
.btn-danger { background: #fff; border-color: #f6cec9; color: var(--err); }
.btn-danger:hover { background: var(--err-bg); }
.btn-ghost { background: transparent; border-color: rgba(170,196,180,.45); color: inherit; }
.btn-sm { padding: 5px 9px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; }
.only-mobile { display: none; }

/* ------------------------------------------------------------- forms ------ */
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.span-2 { grid-column: 1 / -1; }
.field > label { font-size: 11.5px; font-weight: 650; color: var(--text-2); text-transform: uppercase; letter-spacing: .03em; }
.field .help { font-size: 11.5px; color: var(--muted); }

input[type=text], input[type=date], input[type=password], input[type=email], input[type=tel], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 8px 10px; font: inherit; font-size: 13px;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border-2); border-radius: 7px;
}
textarea { resize: vertical; min-height: 68px; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(21,112,58,.32); outline-offset: 0; border-color: var(--accent); }
select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237c7167' stroke-width='2.4'><polyline points='6 9 12 15 18 9'/></svg>"); background-repeat: no-repeat; background-position: right 9px center; padding-right: 26px; }
input[type=file] { font-size: 12.5px; }

/* Tombol unggah foto per baris di daftar Data Siswa: file input disembunyikan di
   dalam <label class="btn">, jadi satu klik pada tombol langsung membuka pemilih file
   dan berkasnya terkirim otomatis (onchange → submit). */
.foto-form { display: inline-block; }
.foto-form label.btn { cursor: pointer; }
.foto-form input[type=file] { display: none; }

.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.filters .field { min-width: 150px; flex: 1 1 150px; }
.filters .field.wide { flex: 1 1 240px; }
.filters .acts { display: flex; gap: 8px; align-items: center; padding-bottom: 1px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }

.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); }
/* Daftar centang bergrid (mis. penetapan kelas akun sensei). */
.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 8px 14px; }
.check input { width: auto; }

/* ------------------------------------------------------------ alerts ------ */
.alert { padding: 10px 13px; border-radius: 7px; font-size: 13px; margin-bottom: 14px; border: 1px solid transparent; }
.alert-ok   { background: var(--ok-bg);   color: #0b5a45; border-color: #b9dfd2; }
.alert-err  { background: var(--err-bg);  color: #8c1d18; border-color: #f6cec9; }
.alert-warn { background: var(--warn-bg); color: #7a4400; border-color: #f2dda8; }
.alert-info { background: var(--info-bg); color: #14498a; border-color: #c6dcf5; }
.empty { padding: 26px 14px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------------------------------------------------------- stepper ------- */
.stepper { display: flex; flex-wrap: wrap; gap: 10px; }
.step {
  flex: 1 1 120px; min-width: 120px;
  border: 1px solid var(--border); border-radius: 7px; padding: 9px 10px;
  background: var(--surface-2);
}
.step .step-name { font-size: 12px; font-weight: 650; margin-top: 5px; }
.step .step-date { font-size: 11px; color: var(--muted); }
.step.is-selesai { background: #e9f7f2; border-color: #b9dfd2; }
.step.is-proses  { background: #fff7ed; border-color: #f2dda8; }
.step.is-gagal   { background: #fdf1ef; border-color: #f6cec9; }

.dot { width: 9px; height: 9px; border-radius: 999px; display: inline-block; }
.dot-belum   { background: var(--muted-2); }
.dot-proses  { background: #e8830c; }
.dot-selesai { background: #22a05a; }
.dot-gagal   { background: #cf3b2f; }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.timeline li { display: flex; gap: 10px; font-size: 12.5px; }
.timeline .t-dot { margin-top: 5px; }
.timeline .t-body strong { display: block; font-weight: 600; }
.timeline .t-body span { color: var(--muted); font-size: 11.5px; }

.avatar {
  width: 76px; height: 76px; border-radius: 10px; object-fit: cover;
  border: 1px solid var(--border); background: var(--surface-3);
}
.avatar-fallback {
  width: 76px; height: 76px; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-h); font-size: 22px; font-weight: 700; border: 1px solid var(--border);
}
.detail-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.detail-head .dh-main { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.detail-head h2 { font-size: 19px; }
.meta-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }

/* --------------------------------------------------------- pagination ----- */
.pager { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 12px 14px; }
.pager a, .pager span {
  padding: 5px 10px; border-radius: 6px; border: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-2); background: var(--surface);
}
.pager a:hover { background: var(--surface-2); text-decoration: none; }
.pager .is-current { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 650; }
.pager .info { margin-left: auto; border: 0; background: transparent; color: var(--muted); font-size: 12px; padding-right: 0; }

.stage-row { display: grid; grid-template-columns: 1.3fr 130px 140px 1fr; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--surface-3); }
.stage-row:last-of-type { border-bottom: 0; }
.stage-row .stage-title { font-size: 13px; font-weight: 600; }
.stage-row .stage-desc { font-size: 11.5px; color: var(--muted); }
.stage-head { font-size: 11.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }

/* ------------------------------------------------------------- peta ------- */
.map-frame { position: relative; width: 100%; padding-top: 56.25%; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface-3); }
.map-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ----------------------------------------------------------- login -------- */
body.login-page {
  display: grid; place-items: center; min-height: 100vh; padding: 24px;
  background:
    radial-gradient(circle at 18% 12%, rgba(21,112,58,.14), transparent 42%),
    radial-gradient(circle at 82% 88%, rgba(34,197,94,.16), transparent 45%),
    var(--bg);
}
.login-card { width: 100%; max-width: 380px; padding: 26px 24px; border-radius: 12px; }
.login-card h1 { font-size: 19px; }
.login-card .sub { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.login-card .form-grid { margin-top: 20px; grid-template-columns: 1fr; }
.login-card .form-actions { flex-direction: column; align-items: stretch; }
.login-foot { margin-top: 16px; font-size: 11.5px; color: var(--muted); text-align: center; }

/* ----------------------------------------------------- panduan/manual ----- */
.toc-list { margin: 0; padding-left: 20px; font-size: 13px; line-height: 1.9; }
.toc-list a { color: var(--text-2); }
.toc-list a:hover { color: var(--accent); }
.manual-list { margin: 0; padding-left: 20px; font-size: 13px; line-height: 1.8; color: var(--text-2); }
.manual-list > li { margin-bottom: 6px; }
.manual-list code, p.help code, table.data code {
  background: var(--surface-3); border: 1px solid var(--border); border-radius: 4px;
  padding: 1px 5px; font-size: 12px;
}
[id^="alur"], [id^="masuk"], [id^="data-siswa"], [id^="tahapan"], [id^="mcu"], [id^="kelas"],
[id^="nilai"], [id^="test"], [id^="poin"], [id^="dokumen"], [id^="keluarga"], [id^="jepang"],
[id^="laporan"], [id^="staf"], [id^="pengaturan"], [id^="sop"], [id^="tanya"] { scroll-margin-top: 80px; }
.card h4 { font-size: 13.5px; color: var(--text); }

/* --------------------------------------------------------- responsive ----- */
/* ----------------------------------------------------------- cetak -------- */
@media print {
  body.app { display: block; background: #fff; font-size: 11.5px; }
  .sidebar, .topbar, .foot, .no-print, .alert { display: none !important; }
  .main { display: block; }
  .content { padding: 0; }
  .card { border: 1px solid #c9dece; box-shadow: none; break-inside: avoid; page-break-inside: avoid; }
  .card + .card, .card + .grid, .grid + .card, .section { margin-top: 12px; }
  .card-head { background: #edf7f0; }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr 1fr; }
  table.data { font-size: 10.5px; }
  table.data th { background: #edf7f0; }
  a { color: inherit; text-decoration: none; }
  .badge { border: 1px solid #9aab9f; background: #fff !important; color: #14231a !important; }
  .toc-list { columns: 2; }
}

/* Layar pendek: menu dirapatkan supaya lebih banyak yang terlihat sekaligus
   (sisanya tetap bisa digulung di dalam sidebar). */
@media (max-height: 700px) {
  .brand { padding: 12px 14px 10px; }
  .nav { padding: 8px 6px; }
  .nav-link { padding: 7px 10px; font-size: 13px; }
  .sidebar-foot { padding: 10px; gap: 8px; }
}

@media (max-width: 900px) {
  .only-mobile { display: inline-grid; }
  .sidebar {
    position: fixed; left: 0; top: 0; height: 100vh; height: 100dvh; max-height: 100dvh;
    transform: translateX(-100%); transition: transform .18s ease;
    box-shadow: 0 10px 30px rgba(20,35,26,.25);
  }
  .sidebar.is-open { transform: translateX(0); }
  .content { padding: 16px 14px 8px; }
  .topbar { padding: 10px 14px; }
  .foot { padding: 14px; }
  .stage-row { grid-template-columns: 1fr 1fr; }
  .stage-row .stage-desc { grid-column: 1 / -1; }
  table.data th, table.data td { padding: 8px 10px; }
}

/* ------------------------------------------------- tandai massal (isian) --- */
/* Tabel pemilihan isian: checkbox + badge keadaan isian di dalam satu sel. */
.cek-sel { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.cek-sel input[type=checkbox], table.data th.sel input[type=checkbox] { width: auto; margin: 0; }
table.data th.sel { text-align: left; vertical-align: bottom; }
table.data th.sel > label { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; }
table.data tr.is-pilih td { background: #e8f7ee; }
.massal-kaki {
  position: sticky; bottom: 0; z-index: 4;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 12px 14px; background: var(--surface); border-top: 1px solid var(--border);
}
.massal-kaki .help { flex: 1 1 200px; }
