:root {
  --utama: #1b2b63;
  --utama-tua: #131f4a;
  --utama-muda: #e4e9f8;
  --utama-pilih: #f2f5fc;
  --hijau: #047a12;
  --hijau-tua: #035e0e;
  --hijau-muda: #e6f4ea;
  --hijau-teks: #0b6b1a;
  --hijau-pilih: #f3fbf4;
  --bg: #f1f5f9;
  --kartu: #ffffff;
  --teks: #1f2933;
  --muted: #5f6b76;
  --garis: #e5e7eb;
  --garis-input: #d5d9de;
  --abu-bg: #f1f2f4;
  --abu: #4b5563;
  --oranye-bg: #fff1e0;
  --oranye: #9a4a00;
  --oranye-garis: #f6d3a8;
  --ungu-bg: #f3e8ff;
  --ungu: #6d28d9;
  --merah-bg: #fde8e8;
  --merah: #b42318;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: #e4e7ea;
  font-family: var(--font);
  color: var(--teks);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--utama); }
h1, h2, h3 { margin: 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#app {
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
}
#view { flex: 1; display: flex; flex-direction: column; padding-bottom: 8px; }
#view.polos { padding-bottom: 0; }
.memuat { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 5; }
.memuat.kecil { position: static; inset: auto; padding: 24px 16px; z-index: auto; }
/* Logo berkedip di tengah layar, tetap di tempat yang sama di setiap halaman. Muncul setelah 150 ms agar halaman cepat tidak berkedip. */
.muat-logo { opacity: 0; animation: muat-muncul .2s ease .15s forwards; }
.muat-logo img { display: block; width: 64px; height: 64px; border-radius: 22%; animation: muat-kedip 1.2s ease-in-out infinite; }
.memuat.kecil .muat-logo img { width: 40px; height: 40px; }
@keyframes muat-muncul { to { opacity: 1; } }
@keyframes muat-kedip { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .muat-logo img { animation: none; } }

/* ---------- Header ---------- */
.hdr {
  position: relative;
  overflow: hidden;
  background: var(--utama);
  color: #fff;
  padding: 20px 20px 64px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
/* Latar header biru navy dengan pola stupa (sama dengan layar masuk). */
.hdr::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 xmlns:xlink=%22http://www.w3.org/1999/xlink%22 width=%22120%22 height=%22108%22 viewBox=%220 0 120 108%22%3E%3Cdefs%3E%3Cg fill=%22none%22 stroke=%22%23fff%22 stroke-opacity=%220.14%22 stroke-width=%221.5%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 id=%22s%22%3E%3Cpath d=%22M-27 78H27V70H-27Z%22/%3E%3Cpath d=%22M-22 70H22V62H-22Z%22/%3E%3Cpath d=%22M-18 62C-18 42 -10 33 0 33C10 33 18 42 18 62%22/%3E%3Cpath d=%22M-4.5 62V55A4.5 4.5 0 0 1 4.5 55V62%22/%3E%3Cpath d=%22M-7 33V26H7V33%22/%3E%3Cpath d=%22M-5.5 26L-2.2 10M5.5 26L2.2 10%22/%3E%3Cpath d=%22M-5 22H5M-4 18H4M-3.2 14H3.2%22/%3E%3Cpath d=%22M0 10V3%22/%3E%3Ccircle cx=%220%22 cy=%221.6%22 r=%221.3%22/%3E%3C/g%3E%3C/defs%3E%3Cuse xlink:href=%22%23s%22 transform=%22translate(30 14) scale(0.9)%22/%3E%3Cuse xlink:href=%22%23s%22 transform=%22translate(90 68) scale(0.9)%22/%3E%3Cuse xlink:href=%22%23s%22 transform=%22translate(90 -40) scale(0.9)%22/%3E%3C/svg%3E"); background-size: 120px 108px; background-position: -6px -10px;
}
.hdr > * { position: relative; }
.hdr-atas { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.merek { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 17px; }
.merek-logo { height: 31px; width: auto; flex: 0 0 auto; }
.merek .lencana { font-size: 11px; font-weight: 700; background: rgba(255, 255, 255, 0.18); padding: 3px 8px; border-radius: 999px; }
.hdr h1 { font-size: 22px; font-weight: 800; }
.hdr .sub { font-size: 13px; opacity: 0.92; }
.btn-ikon-terang {
  width: 44px; height: 44px; border: none; border-radius: 22px;
  background: rgba(255, 255, 255, 0.16); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none;
}
.sapaan { display: flex; align-items: center; gap: 14px; }
.avatar {
  width: 52px; height: 52px; border-radius: 26px; background: #fff; color: var(--utama);
  font-weight: 800; font-size: 18px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.avatar.kecil { width: 40px; height: 40px; font-size: 14px; background: var(--utama-muda); }

.hdr-putih {
  background: #fff;
  border-bottom: 1px solid var(--garis);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 5;
}
.hdr-putih .baris { display: flex; align-items: center; gap: 6px; min-height: 44px; }
.hdr-putih h1 { font-size: 18px; font-weight: 800; padding-left: 8px; }
.hdr-putih .baris h1:not(:first-child) { padding-left: 0; }
.btn-kembali {
  width: 44px; height: 44px; border-radius: 22px; border: none; background: transparent;
  display: inline-flex; align-items: center; justify-content: center; color: var(--teks); cursor: pointer; text-decoration: none;
}

/* ---------- Layout isi ---------- */
.isi { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.angkat { margin: -48px 16px 0; position: relative; }
.kartu {
  background: var(--kartu);
  border: 1px solid var(--garis);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.kartu.bayang { border: none; box-shadow: 0 4px 16px rgba(17, 24, 39, 0.08); position: relative; z-index: 1; }
/* Kartu QR Petugas saat QR belum tampil: menunggu jam scan, sudah ditutup, atau kelas belum dipilih. */
.qr-info { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 24px 12px 20px; width: 100%; }
.qr-info-ikon { width: 56px; height: 56px; border-radius: 50%; background: var(--utama-muda, #e4e9f6); color: var(--utama); display: grid; place-items: center; margin-bottom: 6px; }
.qr-info-ikon.qr-info-abu { background: #eceef1; color: var(--muted); }
.qr-info-judul { font-size: 15px; font-weight: 600; color: var(--muted); }
.qr-info-jam { font-size: 44px; line-height: 1.1; font-weight: 800; color: var(--utama); letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.qr-info-jam.qr-info-abu { color: var(--muted); }
.qr-info-teks { font-size: 14px; line-height: 1.55; color: var(--muted); max-width: 280px; }
.kartu.rapat { padding: 12px 14px; gap: 8px; }
.judul-seksi { font-size: 16px; font-weight: 800; margin-top: 4px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.judul-seksi a { font-size: 13px; font-weight: 700; text-decoration: none; }
.label-kecil { font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: 0.5px; text-transform: uppercase; }
.muted { color: var(--muted); }
.kecil { font-size: 12px; }
.sedang { font-size: 13px; }
.tebal { font-weight: 700; }
.baris-antara { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tumpuk { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pemisah { border-top: 1px solid #f0f1f3; }

.slot-label { font-size: 12px; font-weight: 700; letter-spacing: 0.4px; color: var(--utama); text-transform: uppercase; }
.slot-label.abu { color: var(--muted); }
.nama-kelas { font-size: 18px; font-weight: 800; }

/* ---------- Chip status ---------- */
.chip { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; white-space: nowrap; display: inline-block; }
.chip-hadir { background: var(--hijau-muda); color: var(--hijau-teks); }
.chip-terlambat, .chip-kuning { background: var(--oranye-bg); color: var(--oranye); }
.chip-izin { background: var(--ungu-bg); color: var(--ungu); }
.chip-alpa { background: var(--merah-bg); color: var(--merah); }
.chip-abu { background: var(--abu-bg); color: var(--abu); }

/* ---------- Kotak info ---------- */
.info {
  display: flex; gap: 8px; align-items: flex-start; font-size: 12px; line-height: 1.5;
  border-radius: 10px; padding: 10px 12px;
}
.info svg { flex: 0 0 auto; margin-top: 1px; }
.info-abu { background: #f7f8f9; color: var(--muted); }
.info-hijau { background: var(--hijau-muda); color: var(--hijau-teks); }
.info-utama { background: var(--utama-muda); color: var(--utama-tua); }
.info-ungu { background: var(--ungu-bg); color: var(--ungu); }
.info-oranye { background: var(--oranye-bg); color: var(--oranye); }
.info-merah { background: var(--merah-bg); color: var(--merah); }

/* ---------- Tombol ---------- */
.btn {
  min-height: 48px; border-radius: 12px; font-weight: 700; font-size: 15px; padding: 0 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: none; cursor: pointer;
  text-decoration: none; width: 100%; text-align: center;
}
.btn:disabled { cursor: not-allowed; opacity: 0.6; }
.btn-utama { background: var(--utama); color: #fff; }
.btn-utama:hover:not(:disabled) { background: var(--utama-tua); }
.btn-garis { background: #fff; color: var(--utama); border: 1px solid var(--utama); }
.btn-netral { background: #fff; color: var(--abu); border: 1px solid var(--garis-input); }
.btn-bahaya { background: #fff; color: var(--merah); border: 1px solid #f1b5ae; }
.btn-abu { background: #f7f8f9; color: var(--muted); border: 1px dashed #c9ced4; }
.btn-kecil { min-height: 40px; font-size: 13px; border-radius: 10px; }
.btn-teks { background: none; border: none; color: var(--utama); font-weight: 700; cursor: pointer; padding: 8px; min-height: 44px; }
.dua-tombol { display: flex; gap: 8px; }
.dua-tombol > * { flex: 1; }

/* ---------- Form ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .label { font-size: 13px; font-weight: 700; }
.input {
  height: 46px; border: 1px solid var(--garis-input); border-radius: 12px; padding: 0 14px;
  font-size: 15px; background: #fff; width: 100%;
}
textarea.input { height: auto; padding: 12px 14px; resize: vertical; min-height: 84px; }
select.input { padding-right: 8px; min-width: 0; max-width: 100%; text-overflow: ellipsis; }
/* Di layar HP, pasangan kolom tanggal/slot/kelas dijadikan satu kolom agar tidak saling menimpa (terutama iPhone). */
@media (max-width: 560px) { .grid2.kolom-hp { grid-template-columns: minmax(0, 1fr); } }
/* iOS Safari: kolom tanggal/jam punya lebar bawaan sendiri sehingga bisa keluar dari kartu. Paksa mengikuti lebar kolom. */
.field, .kartu { min-width: 0; }
input.input[type="date"], input.input[type="month"], input.input[type="time"], input.input[type="datetime-local"] {
  -webkit-appearance: none; appearance: none;
  display: flex; align-items: center; width: 100%; min-width: 0; max-width: 100%;
  height: 46px; min-height: 46px; line-height: 46px; text-align: left; text-align-last: left;
  -webkit-text-fill-color: var(--teks, #1d2433); color: var(--teks, #1d2433);
  margin: 0; overflow: hidden;
}
/* iOS Safari menaruh teks tanggal di tengah dan menambah jarak sendiri: ratakan kiri, samakan dengan kolom teks lain. */
input.input[type="date"]::-webkit-date-and-time-value,
input.input[type="month"]::-webkit-date-and-time-value,
input.input[type="time"]::-webkit-date-and-time-value,
input.input[type="datetime-local"]::-webkit-date-and-time-value { text-align: left; min-height: 1.2em; margin: 0; padding: 0; }
input.input[type="date"]::-webkit-datetime-edit,
input.input[type="month"]::-webkit-datetime-edit,
input.input[type="time"]::-webkit-datetime-edit,
input.input[type="datetime-local"]::-webkit-datetime-edit { padding: 0; text-align: left; display: inline-block; line-height: normal; }
input.input[type="date"]::-webkit-datetime-edit-fields-wrapper,
input.input[type="month"]::-webkit-datetime-edit-fields-wrapper,
input.input[type="time"]::-webkit-datetime-edit-fields-wrapper { padding: 0; }
input.input[type="date"]::-webkit-calendar-picker-indicator,
input.input[type="month"]::-webkit-calendar-picker-indicator,
input.input[type="time"]::-webkit-calendar-picker-indicator { margin: 0 0 0 4px; padding: 0; flex: 0 0 auto; }
/* Kolom tanggal/jam yang masih kosong di iOS tidak menampilkan apa-apa: beri teks petunjuk samar agar tidak terlihat hilang. */
input.input[type="date"]:not(:focus):invalid::-webkit-datetime-edit,
input.input[type="date"]:not(:focus):placeholder-shown::-webkit-datetime-edit { color: var(--muted); }
.input:focus, .btn:focus-visible, .opsi:focus-visible, .seg button:focus-visible {
  outline: 3px solid rgba(27, 43, 99, 0.35); outline-offset: 1px; border-color: var(--utama);
}
.pin-input { letter-spacing: 8px; font-size: 22px; font-weight: 700; text-align: center; }
.cek { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.cek input { width: 22px; height: 22px; accent-color: var(--utama); margin: 0; flex: 0 0 auto; }
.kotak-cek { border: 1px solid var(--garis-input); border-radius: 12px; padding: 12px 14px; }
.galat { background: var(--merah-bg); color: var(--merah); font-size: 13px; font-weight: 600; padding: 10px 12px; border-radius: 10px; }
.galat:empty { display: none; }

/* Segmented / opsi bisa dipilih */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.seg button {
  min-height: 44px; border-radius: 12px; font-size: 14px; font-weight: 700; cursor: pointer;
  border: 1px solid var(--garis-input); background: #fff; color: var(--abu); padding: 4px 8px;
}
.seg button[aria-pressed='true'], .seg button[aria-selected='true'] {
  background: var(--utama-muda); color: var(--utama); border: 1.5px solid var(--utama);
}
.tab-slot { background: #fff; border-radius: 16px; padding: 6px; gap: 6px; box-shadow: 0 4px 16px rgba(17, 24, 39, 0.08); }
.tab-slot button { border: none; min-height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.tab-slot button small { font-size: 11px; font-weight: 600; }
.tab-slot button[aria-selected='true'] { background: var(--utama); color: #fff; border: none; }
.tab-abu { background: var(--abu-bg); border-radius: 12px; padding: 4px; gap: 4px; }
.tab-abu button { border: none; background: transparent; min-height: 40px; }
.tab-abu button[aria-selected='true'] { background: #fff; color: var(--utama); border: none; box-shadow: 0 1px 3px rgba(17, 24, 39, 0.12); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.chips button {
  flex: 0 0 auto; min-height: 36px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 700;
  cursor: pointer; border: 1px solid var(--garis-input); background: #fff; color: var(--abu);
}
.chips button[aria-pressed='true'] { background: var(--utama); border-color: var(--utama); color: #fff; }

.opsi {
  text-align: left; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px;
  cursor: pointer; background: #fff; border: 1px solid var(--garis); width: 100%; color: var(--teks);
}
.opsi[aria-pressed='true'] { background: var(--utama-pilih); border: 1.5px solid var(--utama); }
.radio { width: 22px; height: 22px; flex: 0 0 auto; border-radius: 11px; border: 2px solid #c9ced4; background: #fff; }
.opsi[aria-pressed='true'] .radio { border: 7px solid var(--utama); }
.opsi .tumpuk { flex: 1; }
.opsi .nama { font-size: 15px; font-weight: 700; }
.opsi.mati { background: #f7f8f9; color: var(--muted); cursor: default; }

/* ---------- Daftar ---------- */
.baris-orang { display: flex; align-items: center; gap: 10px; padding-top: 8px; border-top: 1px solid #f0f1f3; }
.baris-orang .tumpuk { flex: 1; }
.baris-orang .nama { font-size: 14px; font-weight: 600; }
.item-link {
  background: #fff; border: 1px solid var(--garis); border-radius: 14px; padding: 12px 14px;
  display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--teks);
}
.item-link .tumpuk { flex: 1; }
.menu-grup { background: #fff; border: 1px solid var(--garis); border-radius: 16px; overflow: hidden; }
.menu-grup a { display: flex; align-items: center; gap: 14px; padding: 14px 16px; text-decoration: none; color: var(--teks); border-bottom: 1px solid #f0f1f3; }
.menu-grup a:last-child { border-bottom: none; }
.menu-grup .tumpuk { flex: 1; }
.ikon-kotak { width: 42px; height: 42px; flex: 0 0 auto; border-radius: 12px; background: var(--utama-muda); color: var(--utama); display: flex; align-items: center; justify-content: center; }
.tanggal-kotak { width: 48px; flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; border-radius: 10px; background: var(--bg); padding: 6px 0; }
.tanggal-kotak b { font-size: 18px; line-height: 1.1; }
.tanggal-kotak span { font-size: 11px; color: var(--muted); font-weight: 600; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.stat { background: #fff; border: 1px solid var(--garis); border-radius: 14px; padding: 10px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.stat-grid.tiga { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-grid.dua { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat small { font-size: 11px; }
.stat b { font-size: 22px; }
.detail-murid { border-top: 1px solid var(--garis); padding-top: 8px; }
.detail-murid summary { display: flex; justify-content: space-between; gap: 8px; cursor: pointer; font-weight: 700; font-size: 14px; min-height: 32px; align-items: center; }
.grup-murid { display: flex; flex-direction: column; gap: 2px; padding: 6px 0; font-size: 14px; }
.stat span { font-size: 11px; font-weight: 700; }
.stat-polos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; text-align: center; }
.stat-polos b { font-size: 18px; display: block; }
.stat-polos span { font-size: 12px; }
.batang { height: 8px; border-radius: 4px; background: var(--garis); overflow: hidden; }
.batang > div { height: 100%; background: var(--utama); transition: width 0.3s; }

.kosong { text-align: center; padding: 32px 16px; color: var(--muted); font-size: 14px; line-height: 1.6; }

/* ---------- Navigasi bawah ---------- */
.tim { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tim-grup { background: var(--abu-bg); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tim-judul { font-size: 11px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.tim-nama { font-size: 14px; font-weight: 600; overflow-wrap: break-word; display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.tim-nama .nm { min-width: 0; overflow-wrap: anywhere; }
.tim-nama .lencana-izin { flex: none; white-space: nowrap; margin-left: 0; }
.tim-nama em, .tim-nama small { flex: none; white-space: nowrap; }
.tim-nama.saya { font-weight: 800; color: var(--utama); }
.tim-nama em { font-style: normal; font-size: 10.5px; font-weight: 800; background: var(--utama); color: #fff; padding: 1px 7px; border-radius: 999px; vertical-align: 1px; }
.tim-nama small { font-size: 12px; font-weight: 600; color: var(--muted); }
.tim-nama.kosong { font-weight: 500; color: var(--muted); }
.nav-bawah {
  position: sticky; bottom: 0; z-index: 10; background: #fff; border-top: 1px solid var(--garis);
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-bawah a {
  min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 600;
  white-space: nowrap; padding: 0 2px; min-width: 0;
}
.nav-bawah a[aria-current='page'] { color: var(--utama); font-weight: 700; }

.bar-bawah { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--garis); padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); z-index: 6; }

.fab {
  position: fixed; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 11;
  right: max(16px, calc(50vw - 240px + 16px));
  min-height: 52px; padding: 0 20px; border-radius: 26px; background: var(--utama); color: #fff;
  font-weight: 700; font-size: 15px; text-decoration: none; display: flex; align-items: center; gap: 8px;
  box-shadow: 0 6px 16px rgba(27, 43, 99, 0.35);
}

.demo-bar {
  background: #fef3c7; color: #78350f; font-size: 12px; font-weight: 600; padding: 6px 16px;
  display: flex; justify-content: space-between; gap: 8px; align-items: center;
}
.demo-bar a { color: #78350f; }

#toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: #1f2933; color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 600;
  max-width: min(440px, calc(100vw - 32px)); opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 50;
}
#toast.tampil { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.galat { background: var(--merah); }

/* ---------- Login ---------- */
/* Layar masuk, selamat datang, dan aktivasi: latar biru navy dengan pola stupa dan lengkung putih */
.auth { --navy: #1b2b63; flex: 1; display: flex; flex-direction: column; background: #fff; }
.auth-hero { position: relative; background: var(--navy); color: #fff; overflow: hidden; flex: 0 0 auto; }
.auth-hero.besar { height: clamp(360px, 58dvh, 500px); display: flex; align-items: center; justify-content: center; padding-bottom: 56px; }
.auth-hero.kecil { padding: 48px 32px 112px; }
.auth-pola { position: absolute; inset: 0; width: 100%; height: 100%; }
.auth-gelombang { position: absolute; left: 0; bottom: -1px; width: 100%; height: 88px; display: block; }
.auth-logo-besar { position: relative; width: 160px; height: auto; }
.auth-merek { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.auth-logo-kecil { width: 64px; height: auto; }
.auth-nama { font-size: 22px; font-weight: 800; letter-spacing: 0.2px; }
.auth-sub { font-size: 14px; color: rgba(255, 255, 255, 0.85); }
.auth-isi { flex: 1; display: flex; flex-direction: column; padding: 0 32px; gap: 18px; }
.auth-isi form { display: flex; flex-direction: column; gap: 18px; }
.auth-isi form.auth-aktivasi { gap: 14px; padding-bottom: 24px; }
.auth-judul { font-size: 32px; line-height: 1.15; font-weight: 800; color: #2b2f3a; }
.auth-teks { margin: 0; font-size: 15px; line-height: 1.55; color: var(--muted); }
.auth-selamat { gap: 12px; padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
.auth-lanjut {
  margin-top: auto; align-self: flex-end; display: inline-flex; align-items: center; gap: 12px; min-height: 56px;
  background: none; border: none; cursor: pointer; font-size: 15px; font-weight: 600; color: var(--muted); padding: 0;
}
.auth-panah { width: 56px; height: 56px; border-radius: 28px; background: var(--navy); display: flex; align-items: center; justify-content: center; }
.auth-judul-baris { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.auth-garis { width: 52px; height: 3px; border-radius: 2px; background: var(--navy); }
.u-field { display: flex; flex-direction: column; gap: 2px; }
.u-field > label { font-size: 14px; font-weight: 600; color: #2b2f3a; }
.u-baris { display: flex; align-items: center; gap: 10px; min-height: 48px; border-bottom: 2px solid #d5d9e3; color: var(--muted); }
.u-baris:focus-within { border-bottom-color: var(--navy); color: var(--navy); }
.u-baris input { flex: 1; min-width: 0; height: 44px; border: 0; background: transparent; font-size: 16px; color: #2b2f3a; }
.u-baris input:focus { outline: none; }
.u-baris input::placeholder { color: var(--muted); }
.u-baris input[type="password"] { letter-spacing: 4px; }
.u-mata { width: 44px; height: 44px; margin-right: -10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.u-mata:focus-visible, .u-lupa:focus-visible, .auth-tombol:focus-visible, .auth-lanjut:focus-visible, .u-cek input:focus-visible { outline: 3px solid rgba(27, 43, 99, 0.35); outline-offset: 2px; border-radius: 8px; }
.u-sela { display: flex; align-items: center; justify-content: space-between; margin-top: -6px; }
.u-cek { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 13px; font-weight: 600; color: #2b2f3a; cursor: pointer; }
.u-cek input { width: 18px; height: 18px; margin: 0; accent-color: var(--navy); }
.u-lupa { min-height: 44px; padding: 0; border: 0; background: none; font-size: 13px; font-weight: 800; color: var(--navy); cursor: pointer; }
.auth-tombol { min-height: 56px; border: 0; border-radius: 10px; background: var(--navy); color: #fff; font-size: 17px; font-weight: 800; cursor: pointer; }
.auth-tombol:hover:not(:disabled) { background: #14224f; }
.auth-tombol:disabled { cursor: not-allowed; opacity: 0.6; }
.auth-kaki { margin: 0; padding-bottom: calc(24px + env(safe-area-inset-bottom)); text-align: center; font-size: 13px; line-height: 1.5; color: var(--muted); }
.auth .input:focus { outline-color: rgba(27, 43, 99, 0.35); border-color: var(--navy); }

/* ---------- Scan ---------- */
.layar-gelap { background: #0f1512; color: #fff; flex: 1; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.layar-gelap .btn-kembali { color: #fff; background: rgba(255, 255, 255, 0.12); }
.kamera {
  position: relative; width: min(280px, 72vw); aspect-ratio: 1; border-radius: 24px; overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
}
.kamera video { width: 100%; height: 100%; object-fit: cover; display: block; }
.kamera .sudut { position: absolute; width: 48px; height: 48px; border: 5px solid #38bdf8; }
.kamera .s1 { left: 0; top: 0; border-right: none; border-bottom: none; border-top-left-radius: 24px; }
.kamera .s2 { right: 0; top: 0; border-left: none; border-bottom: none; border-top-right-radius: 24px; }
.kamera .s3 { left: 0; bottom: 0; border-right: none; border-top: none; border-bottom-left-radius: 24px; }
.kamera .s4 { right: 0; bottom: 0; border-left: none; border-top: none; border-bottom-right-radius: 24px; }
.kamera .garis-scan { position: absolute; left: 24px; right: 24px; height: 3px; border-radius: 2px; background: #38bdf8; box-shadow: 0 0 16px #38bdf8; animation: pindai 2.4s ease-in-out infinite; }
@keyframes pindai { 0%, 100% { top: 12%; } 50% { top: 86%; } }
@media (prefers-reduced-motion: reduce) { .kamera .garis-scan { animation: none; top: 50%; } }
.info-gelap { background: rgba(255, 255, 255, 0.08); border-radius: 14px; padding: 12px 14px; }
.muted-gelap { color: #b8c4bd; }

.lingkar-sukses { width: 112px; height: 112px; border-radius: 56px; background: var(--hijau-muda); display: flex; align-items: center; justify-content: center; }
.lingkar-sukses > div { width: 80px; height: 80px; border-radius: 40px; background: var(--hijau); display: flex; align-items: center; justify-content: center; }
.lingkar-sukses.gagal { background: var(--merah-bg); }
.lingkar-sukses.gagal > div { background: var(--merah); }
.tabel-detail { background: #fff; border: 1px solid var(--garis); border-radius: 16px; padding: 4px 16px; }
.tabel-detail > div { display: flex; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid #eef0f2; font-size: 14px; }
.tabel-detail > div:last-child { border-bottom: none; }
.tabel-detail span:first-child { color: var(--muted); }
.tabel-detail span:last-child { font-weight: 700; text-align: right; }

/* ---------- Petugas QR ---------- */
.qr-wadah { padding: 12px; border: 1px solid var(--garis); border-radius: 16px; background: #fff; width: min(300px, 78vw); aspect-ratio: 1; }
.qr-wadah svg { width: 100%; height: 100%; display: block; }
.rute-kelas .mark { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 17px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; background: var(--abu-bg); color: var(--abu); }
.rute-kelas[aria-pressed='true'] .mark { background: var(--utama); color: #fff; }
.rute-kelas .mark.lengkap { background: var(--hijau-muda); color: var(--hijau-teks); }

/* ---------- Surat permohonan (cetak A4) ---------- */
#app.lebar { max-width: none; background: #e4e7ea; }
.alat-cetak {
  position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; gap: 8px;
  padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--garis);
}
.surat {
  width: 210mm; max-width: calc(100vw - 16px); min-height: 297mm; margin: 16px auto; padding: 18mm 18mm 16mm;
  background: #fff; color: #111; font-family: 'Times New Roman', Times, serif; font-size: 12pt; line-height: 1.5;
  box-shadow: 0 2px 12px rgba(17, 24, 39, 0.12);
}
.surat p { margin: 0 0 10pt; }
.surat .kanan { text-align: right; }
.kop { display: flex; align-items: center; gap: 16px; padding-bottom: 8pt; border-bottom: 3px double #111; margin-bottom: 14pt; }
.kop svg, .kop-logo { flex: 0 0 auto; }
.kop-logo { height: 84px; width: auto; object-fit: contain; }
.kop-teks { flex: 1; text-align: center; font-size: 10.5pt; line-height: 1.35; }
.kop-nama { font-size: 16pt; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #1b2b63; }
.kop-vihara { font-size: 12.5pt; font-weight: 700; }
.surat table.meta { border-collapse: collapse; margin-bottom: 12pt; }
.surat table.meta td { padding: 0 6px 0 0; vertical-align: top; }
.surat table.rincian { width: 100%; border-collapse: collapse; font-size: 10pt; margin: 4pt 0 12pt; }
.surat .rincian th, .surat .rincian td { border: 1px solid #333; padding: 4px 6px; vertical-align: top; }
.surat .rincian th { background: #e4e9f8; font-weight: 700; text-align: center; }
.surat .rincian .angka { text-align: right; white-space: nowrap; }
.surat .rincian .tengah { text-align: center; }
.ttd { width: 62mm; margin: 20pt 0 0 auto; text-align: center; }
.ttd-ruang { height: 64pt; }
.ttd-nama { font-weight: 700; text-decoration: underline; }
.catatan { margin-top: 24pt; padding-top: 6pt; border-top: 1px solid #999; font-size: 8.5pt; line-height: 1.4; color: #333; }

/* Rekap absensi: A4 mendatar */
.surat.lanskap { width: 297mm; min-height: 210mm; padding: 12mm 12mm 10mm; font-size: 10pt; page: lanskap; }
.rekap .kop { margin-bottom: 8pt; }
.judul-rekap { font-size: 14pt; text-align: center; text-transform: uppercase; letter-spacing: 0.5px; margin: 4pt 0 0; }
.sub-rekap { text-align: center; margin: 0 0 10pt !important; }
.judul-bagian { font-size: 11.5pt; margin: 16pt 0 4pt; break-after: avoid; }
.matriks { width: 100%; border-collapse: collapse; font-size: 9pt; }
.matriks th, .matriks td { border: 1px solid #555; padding: 3px 4px; }
.matriks th { background: #e4e9f8; font-weight: 700; text-align: center; }
.matriks th.slot { font-weight: 600; font-size: 8pt; }
.matriks td.nama { white-space: nowrap; }
.matriks th.nama { min-width: 34mm; }
.matriks .sel { text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.matriks .sel small { font-size: 7pt; font-weight: 700; margin-left: 2px; }
.matriks tr { break-inside: avoid; }
.kelas-rekap { margin-top: 10px; }
.kelas-rekap .judul-bagian .sub-judul { font-size: 9pt; font-weight: 500; color: #555; margin-left: 6px; }
.judul-kecil { font-size: 10pt; margin: 10px 0 4px; }
@media print { .halaman-baru { break-before: page; } }
.s-hadir { background: #e6f4ea; color: #0b6b1a; }
.s-terlambat { background: #fff1e0; color: #9a4a00; }
.s-izin { background: #f3e8ff; color: #6d28d9; }
.s-alpa { background: #fde8e8; color: #b42318; font-weight: 700; }
.kosong-sel { color: #9aa3ac; }
.legenda { display: flex; flex-wrap: wrap; gap: 4pt 14pt; font-size: 8.5pt; margin: 6pt 0 0 !important; color: #333; }
.legenda .kotak { display: inline-block; width: 10px; height: 10px; border: 1px solid #999; margin-right: 4px; vertical-align: -1px; }
.rincian.detail { font-size: 9pt; }
.rincian.detail td { padding: 3px 5px; }
.st-terlambat { color: #9a4a00; font-weight: 700; }
.st-izin { color: #6d28d9; }
.st-alpa { color: #b42318; font-weight: 700; }
.kaki-rekap { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-top: 18pt; break-inside: avoid; }
.kecil-cetak { font-size: 8.5pt; color: #444; line-height: 1.4; }
.surat, .surat * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

@page lanskap { size: A4 landscape; margin: 0; }

@media print {
  @page { size: A4; margin: 0; }
  .surat.lanskap { width: auto; min-height: 0; }
  .rincian thead, .matriks thead { display: table-header-group; }
  body, #app.lebar { background: #fff; }
  .no-print { display: none !important; }
  .surat { width: auto; max-width: none; min-height: 0; margin: 0; box-shadow: none; }
  .surat .rincian tr { break-inside: avoid; }
  .demo-bar, #toast { display: none !important; }
}

.tautan-undangan { word-break: break-all; font-size: 13px; background: #f7f8f9; border: 1px dashed var(--garis-input); border-radius: 10px; padding: 10px 12px; }

/* Popup konfirmasi scan (Petugas QR) */
.modal-latar { position: fixed; inset: 0; z-index: 50; background: rgba(17,24,39,.55); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: #fff; border-radius: 20px; padding: 24px 20px 20px; width: min(340px, 100%); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; box-shadow: 0 20px 50px rgba(17,24,39,.35); }
.modal .btn { align-self: stretch; margin-top: 14px; }
.modal-centang { width: 56px; height: 56px; border-radius: 28px; background: var(--hijau-muda); color: var(--hijau-teks); font-size: 30px; font-weight: 800; display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.modal-nama { font-size: 22px; font-weight: 800; color: var(--utama); line-height: 1.25; }

/* Tim kelas pada Atur Tugas */
.tim-kelas { gap: 2px; }
.tim-kelas .orang { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid #f0f1f3; }
.tim-kelas .orang .tumpuk { flex: 1; min-width: 0; }
.tim-kelas .orang .nama { font-size: 15px; font-weight: 700; }
.tim-kelas .orang.diganti { background: var(--ungu-bg); border-radius: 12px; padding: 10px 12px; margin: 4px -6px; border-top-color: transparent; }
.tim-kelas .asisten-ringkas { display: flex; flex-direction: column; gap: 3px; padding-top: 10px; border-top: 1px solid #f0f1f3; margin-top: 2px; }

/* Gabung kelas */
.bagian-kelas { font-size: 12px; font-weight: 800; letter-spacing: .4px; color: var(--utama); text-transform: uppercase; padding-top: 8px; border-top: 2px solid var(--utama-muda); display: flex; align-items: center; gap: 8px; }
.bagian-kelas:first-child { border-top: 0; padding-top: 0; }
.lencana-kecil { font-size: 11px; font-weight: 800; background: var(--utama-muda); color: var(--utama); padding: 2px 9px; border-radius: 999px; text-transform: none; letter-spacing: 0; }
.pilih-kelas { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--garis-input); border-radius: 12px; background: #fff; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.pilih-kelas .tumpuk { flex: 1; }
.pilih-kelas .nama { font-size: 15px; font-weight: 700; }
.pilih-kelas .kotak { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--garis-input); flex: none; display: grid; place-items: center; }
.pilih-kelas[aria-pressed='true'] { border-color: var(--utama); background: var(--utama-pilih); }
.pilih-kelas[aria-pressed='true'] .kotak { background: var(--utama); border-color: var(--utama); }
.pilih-kelas[aria-pressed='true'] .kotak::after { content: '✓'; color: #fff; font-size: 13px; line-height: 1; }

/* Absensi siswa: pencarian dan penanda yang belum diabsen */
.cari-murid .input { width: 100%; }
.baris-murid { padding: 8px 10px; margin: 0 -10px; border-radius: 12px; border-left: 4px solid transparent; }
.baris-murid[hidden] { display: none; }
.baris-murid.belum { background: var(--oranye-bg); border-left-color: var(--oranye); }
.belum-tag { display: none; margin-left: auto; font-size: 11px; font-weight: 800; color: var(--oranye); }
.baris-murid.belum .belum-tag { display: inline; }

/* Dashboard Kepala/Wakil: pilih tanggal */
.bar-tanggal { display: flex; align-items: stretch; gap: 8px; }
.bar-tanggal .geser { width: 48px; flex: none; border: 1px solid var(--garis-input); background: #fff; border-radius: 14px; display: grid; place-items: center; color: var(--utama); cursor: pointer; }
.bar-tanggal .geser[disabled] { opacity: .35; cursor: default; }
.pilih-tanggal { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 14px; background: #fff; border: 1px solid var(--garis-input); border-radius: 14px; cursor: pointer; }
.pilih-tanggal .tumpuk { gap: 0; min-width: 0; }
.pilih-tanggal .tebal { font-size: 15px; }
.pilih-tanggal .ikon-kal { color: var(--utama); display: grid; place-items: center; flex: none; }
.pilih-tanggal input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.kembali-hari-ini { align-self: flex-start; width: auto; }

/* Badge izin / sakit di daftar tim kelas */
.lencana-izin { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; vertical-align: middle; background: var(--ungu-bg, #f1e8ff); color: var(--ungu, #6b3fb5); }
.lencana-izin.sakit { background: var(--merah-bg, #fde8e8); color: var(--merah, #b42318); }

/* Menu akun di pojok kanan atas */
.menu-akun { position: fixed; right: max(12px, env(safe-area-inset-right)); width: min(250px, calc(100vw - 24px)); z-index: 60; background: #fff; border: 1px solid var(--garis); border-radius: 14px; padding: 6px; box-shadow: 0 8px 24px rgba(17,24,39,.18); }
.menu-akun-id { padding: 10px 12px; border-bottom: 1px solid var(--garis); margin-bottom: 4px; display: flex; flex-direction: column; gap: 2px; }
.menu-akun-id b { font-size: 15px; font-weight: 800; color: var(--teks, #1c2333); overflow-wrap: anywhere; }
.menu-akun-id small { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.menu-akun-keluar { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; border: 0; background: transparent; color: var(--merah, #b42318); font: inherit; font-weight: 700; padding: 0 12px; border-radius: 10px; cursor: pointer; }
.menu-akun-keluar:hover { background: var(--merah-bg, #fde8e8); }
.btn-ikon-terang.akun-gelap { background: var(--utama-muda); color: var(--utama); }

/* Riwayat sesi */
.rw-k { gap: 12px; }
.rw-hd { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.rw-slot { align-self: flex-start; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--utama); background: var(--utama-muda); padding: 3px 9px; border-radius: 999px; }
.rw-slot.sg { color: var(--oranye); background: var(--oranye-bg); }
.rw-kn { font-size: 18px; font-weight: 800; margin-top: 6px; line-height: 1.2; overflow-wrap: anywhere; }
.rw-ring { width: 56px; height: 56px; border-radius: 50%; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--hijau-muda); color: var(--hijau-teks); }
.rw-ring b { font-size: 15px; font-weight: 800; line-height: 1; }
.rw-ring i { font-style: normal; font-size: 10px; font-weight: 600; margin-top: 2px; }
.rw-o { display: flex; align-items: center; gap: 10px; }
.rw-av { width: 32px; height: 32px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; background: var(--utama-muda); color: var(--utama); }
.rw-av.as { background: var(--abu-bg); color: var(--abu); }
.rw-n { font-size: 14px; font-weight: 700; line-height: 1.2; }
.rw-r { font-size: 11px; color: var(--muted); }
.rw-mat { background: var(--bg); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.rw-l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.rw-v { font-size: 14px; line-height: 1.4; font-weight: 600; overflow-wrap: anywhere; }
.rw-v.muted { font-weight: 500; }
.rw-btn { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; border: 1px solid var(--garis-input); border-radius: 12px; background: #fff; padding: 0 12px; font-size: 14px; font-weight: 700; color: var(--utama); cursor: pointer; }
.rw-btn svg { transition: transform .15s; }
.rw-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.rw-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rw-chips[hidden] { display: none; }
.rw-chips span { font-size: 12px; font-weight: 600; background: var(--hijau-muda); color: var(--hijau-teks); padding: 5px 10px; border-radius: 999px; }

/* Lonceng notifikasi */
.grup-ikon { display: flex; align-items: center; gap: 8px; }
[data-lonceng] { position: relative; }
.lencana-notif { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 4px; background: #d92d20; color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid var(--utama); }
.lencana-notif[hidden] { display: none; }
.btn-ikon-terang.akun-gelap .lencana-notif { border-color: #fff; }
.notif-n { position: relative; display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 1px solid var(--garis); border-radius: 14px; padding: 11px 12px; cursor: default; }
.notif-n.baru { background: var(--utama-pilih); border-color: #c9d3f0; cursor: pointer; }
.notif-titik { position: absolute; top: 12px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--utama); }
.notif-ic { width: 36px; height: 36px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; }
.notif-ic.i-oranye { background: var(--oranye-bg); color: var(--oranye); }
.notif-ic.i-merah { background: var(--merah-bg); color: var(--merah); }
.notif-ic.i-hijau { background: var(--hijau-muda); color: var(--hijau-teks); }
.notif-ic.i-biru { background: var(--utama-muda); color: var(--utama); }

/* Rincian notifikasi (popup) */
.notif-n { align-items: center; cursor: pointer; }
.notif-n > svg { flex: none; margin-left: auto; color: var(--muted); }
.modal-notif { background: #fff; border-radius: 20px; padding: 22px 20px 18px; width: min(380px, 100%); max-height: min(560px, 85vh); display: flex; flex-direction: column; gap: 6px; box-shadow: 0 20px 50px rgba(17,24,39,.35); }
.mn-judul { font-size: 19px; font-weight: 800; color: var(--utama); line-height: 1.25; overflow-wrap: anywhere; }
.mn-waktu { font-size: 12px; color: var(--muted); }
.mn-isi { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--garis); font-size: 15px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; overflow-y: auto; min-height: 0; flex: 1 1 auto; }
.modal-notif .btn { margin-top: 14px; flex: none; }

/* Daftar siswa hadir di Riwayat: berurutan, rapi satu kolom. */
.rw-daftar { list-style: none; margin: 0; padding: 0; border: 1px solid var(--garis); border-radius: 12px; overflow: hidden; background: #fff; }
.rw-daftar li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; font-size: 14px; border-top: 1px solid var(--garis); }
.rw-daftar li:first-child { border-top: 0; }
.rw-no { width: 22px; flex: none; text-align: right; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.rw-nm { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.rw-jk { flex: none; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
.rw-jk.l { background: #e4effb; color: #185fa5; }
.rw-jk.p { background: #fbeaf0; color: #993556; }
.rw-sub { margin: 12px 0 6px; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.rw-st { flex: none; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: #eef0f2; color: #4a5560; }
.rw-st.izin { background: #fdf1d9; color: #8a5a00; }
.rw-st.sakit { background: #e4effb; color: #185fa5; }
.rw-st.alpa { background: #fbe4e4; color: #a32d2d; }

/* Label sesi: nama dan jam dipisah jarak, bukan titik. */
.rw-slot, .slot-label { display: inline-flex; align-items: baseline; gap: 8px; }
.rw-slot .jam, .slot-label .jam { font-weight: 700; opacity: .75; letter-spacing: 0; }
/* Status kehadiran sendiri di Riwayat: judul besar dan rapi. */
.rw-status { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 12px; border-radius: 14px; text-align: center; background: var(--bg); color: var(--muted); }
.rw-status-t { font-size: 15px; line-height: 1.3; font-weight: 800; }
.rw-status-k { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 16px; font-size: 12px; font-weight: 600; }
.rw-status.hadir { background: var(--hijau-muda); color: var(--hijau-teks); }
.rw-status.terlambat { background: var(--oranye-bg); color: var(--oranye); }
.rw-status.izin { background: var(--oranye-bg); color: var(--oranye); }
.rw-status.sakit { background: var(--utama-muda); color: var(--utama); }
.rw-status.alpa { background: var(--merah-bg); color: var(--merah); }
