/* =====================================================================
   Presensi Lab BCP — gaya antarmuka
   Bahasa rupa diambil dari dunia siaran (broadcast): rak peralatan,
   lampu tally ON AIR, dan pelabelan teknis.
   ===================================================================== */

:root {
  --ink: #16181D;
  --paper: #F4F5F7;
  --surface: #FFFFFF;
  --line: #E3E6EA;
  --line-kuat: #CBD1D8;
  --muted: #6B7280;
  --rack: #171A2B;          /* biru-kehitaman (nuansa logo BCP) */
  --rack-teks: #A6ACC4;

  --tally: #D62828;         /* merah ON AIR — status siaran/langsung */
  --signal: #263A94;        /* BIRU BCP — aksi utama & aksen merek */
  --signal-gelap: #1B2B72;
  --signal-muda: #EAEDF8;   /* biru sangat muda untuk latar lembut */
  --amber: #B26B00;
  --hijau: #15803D;

  /* Palet grafik kehadiran H / I / S / A / D */
  --c-h: #15803D;
  --c-i: #2F6FB0;
  --c-s: #B26B00;
  --c-a: #D62828;
  --c-d: #8A93A6;

  --radius: 6px;
  --sidebar-w: 232px;
  --font-label: "Barlow Condensed", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--signal); }

/* ---------- Rak samping (sidebar) ---------- */
.rak {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--rack);
  color: var(--rack-teks);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 60;

  /* Batang gulir disembunyikan, tetapi tetap bisa digulir. */
  scrollbar-width: none;              /* Firefox */
  -ms-overflow-style: none;           /* Edge lama */
}
.rak::-webkit-scrollbar { width: 0; height: 0; display: none; }  /* Chrome, Safari */

.rak-kop {
  padding: 16px 12px 15px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.rak-merek {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}
.rak-merek img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  background: #fff;
  border-radius: 9px;
  padding: 3px;
  flex-shrink: 0;
}
.rak-merek-teks { text-align: center; min-width: 0; }

.rak-kop .nama {
  font-family: var(--font-label);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.1;
}

.rak-kop .sub {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--rack-teks);
  margin-top: 3px;
}

.rak-grup {
  font-family: var(--font-label);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #5D646E;
  padding: 18px 18px 6px;
}

.rak a.menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 18px;
  color: var(--rack-teks);
  text-decoration: none;
  font-size: 14.5px;
  border-left: 3px solid transparent;
}

.rak a.menu:hover { background: rgba(255,255,255,.05); color: #fff; }

.rak a.menu.aktif {
  background: rgba(255,255,255,.07);
  color: #fff;
  border-left-color: var(--signal);
  font-weight: 500;
}

.rak-kaki {
  margin-top: auto;
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 13px;
}

.rak-kaki .siapa { color: #fff; font-weight: 500; }
.rak-kaki .peran {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #6E7681;
}
.rak-kaki a { color: #9AA1AB; font-size: 13px; }

/* ---------- Area utama ----------
   Catatan: kelas "utama" dipakai juga oleh sel judul kartu di tabel
   (td.utama). Semua aturan wadah utama di bawah ini dibatasi ke
   `body > .utama` agar TIDAK bocor ke sel tabel. */
body > .utama {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Strip tally (penanda siaran) ---------- */
.tally {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 26px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.tally-lampu {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 3px;
  border: 1px solid var(--line-kuat);
  color: var(--muted);
}

.tally-lampu .titik {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--line-kuat);
}

.tally-lampu.hidup {
  background: var(--tally);
  border-color: var(--tally);
  color: #fff;
}
.tally-lampu.hidup .titik { background: #fff; animation: denyut 1.6s ease-in-out infinite; }

@keyframes denyut { 0%,100% { opacity: 1 } 50% { opacity: .35 } }
@media (prefers-reduced-motion: reduce) {
  .tally-lampu.hidup .titik { animation: none; }
}

.tally-info { font-size: 13.5px; color: var(--muted); }
.tally-info strong { color: var(--ink); font-weight: 500; }
.tally-kanan { margin-left: auto; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

/* ---------- Isi halaman ---------- */
.isi { padding: 26px; flex: 1; }

.judul-hal {
  font-family: var(--font-label);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: .01em;
  margin: 0 0 2px;
}

.sub-hal { color: var(--muted); font-size: 14px; margin: 0 0 22px; }

/* ---------- Kartu ---------- */
.kartu {
  background: linear-gradient(180deg, #FFFFFF 0%, #F7F9FC 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 22px;
  box-shadow: 0 1px 2px rgba(23,26,43,.05), 0 6px 18px rgba(23,26,43,.05);
}

.kartu-kop {
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-label);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.kartu-isi { padding: 18px; }

/* ---------- Statistik ringkas ---------- */
.stat-baris {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px 16px;
  overflow: hidden;
}

/* Lencana ikon di pojok kanan atas kartu statistik */
.stat-lencana {
  position: absolute;
  top: 13px; right: 13px;
  width: 38px; height: 38px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: var(--signal-muda);
  color: var(--signal);
}
.stat-lencana svg { width: 20px; height: 20px; }

/* Varian warna — latar lembut + ikon & angka sewarna */
.stat.warna-biru  { background: linear-gradient(160deg,#EEF1FB,#FFFFFF 70%); border-color:#D5DBF3; }
.stat.warna-biru  .stat-lencana { background:#DCE2F6; color:#263A94; }
.stat.warna-biru  .angka { color:#263A94; }

.stat.warna-hijau { background: linear-gradient(160deg,#E9F6EF,#FFFFFF 70%); border-color:#C5E6D3; }
.stat.warna-hijau .stat-lencana { background:#D3EEDF; color:#15803D; }
.stat.warna-hijau .angka { color:#146c35; }

.stat.warna-amber { background: linear-gradient(160deg,#FBF2DF,#FFFFFF 70%); border-color:#EBD9AE; }
.stat.warna-amber .stat-lencana { background:#F3E3BE; color:#946000; }
.stat.warna-amber .angka { color:#946000; }

.stat.warna-ungu  { background: linear-gradient(160deg,#F1ECFB,#FFFFFF 70%); border-color:#DBCEF2; }
.stat.warna-ungu  .stat-lencana { background:#E4D9F6; color:#6B3FB0; }
.stat.warna-ungu  .angka { color:#6B3FB0; }

.stat .label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-right: 42px;   /* beri ruang untuk lencana */
}

.stat .angka {
  font-family: var(--font-label);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.2;
  margin-top: 2px;
}

/* ---------- Tabel data ---------- */
.tabel-bungkus { overflow-x: auto; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}

table.data th {
  text-align: left;
  font-family: var(--font-label);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table.data td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #FAFBFC; }

td.mono, .mono { font-family: var(--font-mono); font-size: 13px; }
td.aksi { text-align: right; white-space: nowrap; }

.kosong {
  padding: 30px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- Lencana status ---------- */
.lencana {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid var(--line-kuat);
  color: var(--muted);
  background: #F7F8F9;
}
.lencana.hijau { color: var(--hijau); border-color: #BBE5C8; background: #EFFAF3; }
.lencana.merah { color: var(--tally); border-color: #F3C6C6; background: #FDF0F0; }
.lencana.amber { color: var(--amber); border-color: #EFD9AE; background: #FDF6E9; }
.lencana.teal  { color: var(--signal); border-color: #B7DDE0; background: #EDF7F8; }

/* ---------- Formulir ---------- */
.form-baris {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.bidang label {
  display: block;
  font-family: var(--font-label);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
}

input[type=text], input[type=password], input[type=date],
input[type=number], select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line-kuat);
  border-radius: 8px;
  background: linear-gradient(180deg, #FFFFFF 0%, #F6F8FB 100%);
  box-shadow: inset 0 1px 2px rgba(23,26,43,.04);
  font-family: var(--font-body);
  font-size: 14.5px;
  color: var(--ink);
}
input[type=text]:focus, input[type=password]:focus, input[type=date]:focus,
input[type=number]:focus, select:focus, textarea:focus {
  border-color: var(--signal);
  background: #fff;
  box-shadow: 0 0 0 3px var(--signal-muda);
  outline: none;
}

input:focus-visible, select:focus-visible, textarea:focus-visible,
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 1px;
}

.petunjuk { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* ---------- Tombol ---------- */
.tombol {
  display: inline-block;
  padding: 8px 15px;
  border: 1px solid var(--signal);
  border-radius: var(--radius);
  background: var(--signal);
  color: #fff;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.tombol:hover { background: var(--signal-gelap); border-color: var(--signal-gelap); }

.tombol.garis {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-kuat);
}
.tombol.garis:hover { background: #F2F4F6; }

.tombol.bahaya { background: transparent; color: var(--tally); border-color: #F0C4C4; }
.tombol.bahaya:hover { background: #FDF0F0; }

.tombol.kecil { padding: 4px 10px; font-size: 13px; }

/* ---------- Pesan ---------- */
.pesan {
  padding: 11px 15px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  font-size: 14.5px;
  border: 1px solid;
}
.pesan.sukses { background: #EFFAF3; border-color: #BBE5C8; color: #14532D; }
.pesan.error  { background: #FDF0F0; border-color: #F3C6C6; color: #7F1D1D; }
.pesan.info   { background: #EDF7F8; border-color: #B7DDE0; color: #114E56; }

/* ---------- Halaman masuk ---------- */
.masuk-layar {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--rack);
  padding: 20px;
}

.masuk-kotak {
  width: 100%;
  max-width: 540px;
  background: var(--surface);
  border-radius: 14px;
  padding: 46px 52px 42px;
  box-shadow: 0 18px 50px rgba(0,0,0,.28);
}

.masuk-merek {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 8px;
}
.masuk-merek img { width: 68px; height: 68px; object-fit: contain; flex-shrink: 0; }
.masuk-merek .merek {
  font-family: var(--font-label);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  line-height: 1.06;
  text-align: center;
}

.masuk-kotak .merek {
  font-family: var(--font-label);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1.15;
}

.masuk-kotak .merek-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  margin: 0 0 28px;
}
.masuk-kotak input { padding: 13px 15px; font-size: 15.5px; }
.masuk-kotak .tombol { padding: 14px; font-size: 16px; letter-spacing: .02em; }

/* ---------- Tombol kembali ---------- */
.tombol-kembali {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 5px 12px 5px 9px;
  border: 1px solid var(--line-kuat);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
  text-decoration: none;
}
.tombol-kembali:hover { background: #F2F4F6; }

/* ---------- Hamburger (hanya layar kecil) ---------- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 36px;
  height: 34px;
  padding: 0 7px;
  border: 1px solid var(--line-kuat);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}
.hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink);
  border-radius: 2px;
}

/* Tirai gelap di belakang laci */
.tirai {
  position: fixed;
  inset: 0;
  background: rgba(22, 24, 29, .45);
  z-index: 55;
}

/* Tombol tutup di dalam laci */
.rak-tutup {
  display: none;
  position: absolute;
  top: 14px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 4px;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
}
.rak-kop { position: relative; }

/* =====================================================================
   BAGIAN MOBILE-FIRST
   Ditulis khusus untuk ponsel — bukan sekadar mengecilkan desktop.
   Tiga tingkat:
     ≤ 980px  → sidebar jadi laci (tablet & ponsel)
     ≤ 768px  → tata letak ponsel penuh: navbar 1 baris, kartu tabel,
                tombol ikon, dasbor rapat, tanpa geser mendatar
   ===================================================================== */

/* ---------- Bawaan: elemen khusus ponsel disembunyikan di layar lebar ---------- */
.topbar-merek    { display: none; }
.status-ringkas  { display: none; }

/* Ringkasan rekap hanya untuk ponsel — sembunyi di desktop & cetak */
.rekap-mobile { display: none; }

/* Tombol rincian kartu hanya muncul di ponsel */
.baris-detail { display: none; }
.baris-detail-sel { display: none; }

@media (prefers-reduced-motion: reduce) {
  .rak { transition: none; }
  .baris-detail .bd-panah { transition: none; }
}

/* =====================================================================
   IKON TOMBOL (mask SVG — mewarisi warna tombol)
   ===================================================================== */
.tombol.i-cetak   { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9V2h12v7'/><path d='M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2'/><rect x='6' y='14' width='12' height='8'/></svg>"); }
.tombol.i-lihat   { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7Z'/><circle cx='12' cy='12' r='3'/></svg>"); }
.tombol.i-ubah    { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 20h9'/><path d='M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z'/></svg>"); }
.tombol.i-hapus   { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 6h18'/><path d='M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2'/><path d='M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6'/><path d='M10 11v6M14 11v6'/></svg>"); }
.tombol.i-kunci   { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='11' width='18' height='11' rx='2'/><path d='M7 11V7a5 5 0 0 1 10 0v4'/></svg>"); }
.tombol.i-buka-kunci { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='11' width='18' height='11' rx='2'/><path d='M7 11V7a5 5 0 0 1 9.9-1'/></svg>"); }
.tombol.i-tambah  { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 5v14M5 12h14'/></svg>"); }
.tombol.i-refresh { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 12a9 9 0 1 1-3-6.7L21 8'/><path d='M21 3v5h-5'/></svg>"); }
.tombol.i-cocok   { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M20 6 9 17l-5-5'/></svg>"); }
.tombol.i-tidak   { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M18 6 6 18M6 6l12 12'/></svg>"); }
.tombol.i-daftar  { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='2' y='4' width='20' height='16' rx='2'/><path d='M7 8h4M7 12h4M7 16h6'/><circle cx='16.5' cy='9' r='1.6'/></svg>"); }
.tombol.i-buang   { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 6h18'/><path d='M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6'/><path d='M10 11v6M14 11v6'/></svg>"); }
.tombol.i-aktifkan{ --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 2v10'/><path d='M18.4 6.6a9 9 0 1 1-12.8 0'/></svg>"); }
.tombol.i-simpan  { --ic: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2Z'/><path d='M17 21v-8H7v8M7 3v5h8'/></svg>"); }

/* Tombol ikon berukuran pas juga di layar sedang bila diinginkan */
.tombol.ico { align-items: center; justify-content: center; }

/* ---------- Cetak ---------- */
@media print {
  .rak, .tally, .aksi, .tombol { display: none !important; }
  body > .utama { margin-left: 0; }
  .kartu { border: 0; }
}

/* =====================================================================
   TAMBAHAN: lonceng notifikasi, pesan hilang sendiri, riwayat per hari
   ===================================================================== */

/* ---------- Pesan yang hilang sendiri ---------- */
.pesan.auto-hilang {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition: opacity .3s ease, transform .3s ease;
}

.pesan.auto-hilang.memudar {
  opacity: 0;
  transform: translateY(-4px);
}

.pesan-tutup {
  margin-left: auto;
  background: none;
  border: 0;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  opacity: .55;
  padding: 0 2px;
}
.pesan-tutup:hover { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .pesan.auto-hilang { transition: none; }
}

/* ---------- Lonceng notifikasi ---------- */
.lonceng-bungkus { position: relative; margin-left: 14px; }

.lonceng {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-kuat);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.lonceng:hover { background: #F2F4F6; }

/* Tombol keluar di topbar (di samping lonceng) */
.topbar-keluar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-left: 8px;
  border: 1px solid var(--line-kuat);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
}
.topbar-keluar:hover { background: #FDF0F0; border-color: var(--tally); color: var(--tally); }

.lonceng-titik {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--tally);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 17px;
  text-align: center;
}

/* Panel notifikasi — desain menyatu dengan tema biru BCP. */
.lonceng-panel {
  position: absolute;
  top: 46px;
  right: 0;
  width: 340px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(23, 26, 43, .22);
  z-index: 50;
  overflow: hidden;
}
/* Segitiga kecil penunjuk ke lonceng */
.lonceng-panel::before {
  content: "";
  position: absolute;
  top: -7px; right: 16px;
  width: 13px; height: 13px;
  background: var(--signal);
  transform: rotate(45deg);
  border-radius: 3px 0 0 0;
}

.lonceng-kop {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 15px;
  background: var(--signal);
  color: #fff;
  font-family: var(--font-label);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.lonceng-kop::before {
  content: "";
  width: 15px; height: 15px; flex-shrink: 0;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9'/><path d='M13.7 21a2 2 0 0 1-3.4 0'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9'/><path d='M13.7 21a2 2 0 0 1-3.4 0'/></svg>") center/contain no-repeat;
}

.lonceng-kosong {
  padding: 26px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}

.lonceng-item {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  position: relative;
  transition: background .12s ease;
}
.lonceng-item:last-child { border-bottom: 0; }
.lonceng-item:hover { background: var(--signal-muda); }

/* Titik status jadi lencana bulat berwarna */
.lonceng-tanda {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  margin: 1px 0 0;
  flex-shrink: 0;
  background: var(--signal-muda);
  position: relative;
}
.lonceng-tanda::after {
  content: "";
  position: absolute; inset: 0;
  background-color: var(--signal);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><path d='M12 8v4M12 16h.01'/></svg>") center/16px no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><path d='M12 8v4M12 16h.01'/></svg>") center/16px no-repeat;
}
.lonceng-tanda.merah { background: #FBE3E3; }
.lonceng-tanda.merah::after { background-color: var(--tally); }
.lonceng-tanda.amber { background: #F6EBD6; }
.lonceng-tanda.amber::after { background-color: var(--amber); }
.lonceng-tanda.teal  { background: var(--signal-muda); }
.lonceng-tanda.teal::after  { background-color: var(--signal); }

.lonceng-isi { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lonceng-judul { font-size: 14px; font-weight: 600; }
.lonceng-teks  { font-size: 12.5px; color: var(--muted); line-height: 1.45; }

/* ---------- Riwayat dikelompokkan per hari ---------- */
details.hari {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

details.hari > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
details.hari > summary::-webkit-details-marker { display: none; }
details.hari > summary:hover { background: #FAFBFC; }

.hari-panah {
  color: var(--muted);
  font-size: 12px;
  transition: transform .15s ease;
}
details.hari[open] > summary .hari-panah { transform: rotate(90deg); }

.hari-label {
  font-family: var(--font-label);
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.hari-tgl { color: var(--muted); font-size: 12.5px; }

.hari-jml {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line-kuat);
  background: #F7F8F9;
  border-radius: 3px;
  padding: 2px 7px;
}

details.hari > .tabel-bungkus { border-top: 1px solid var(--line); }

@media (prefers-reduced-motion: reduce) {
  .hari-panah { transition: none; }
}

/* =====================================================================
   TAMBAHAN: tabel rekap & aturan cetak
   ===================================================================== */

table.data td.tengah, table.data th.tengah { text-align: center; }

table.rekap th, table.rekap td { padding: 7px 8px; font-size: 13.5px; }
table.rekap th.tegak { text-align: center; font-size: 11.5px; white-space: nowrap; }

table.rekap td.st-H { color: var(--hijau); font-weight: 600; }
table.rekap td.st-A { color: var(--tally); font-weight: 600; }
table.rekap td.st-I { color: var(--signal); }
table.rekap td.st-S { color: var(--amber); }
table.rekap td.st-D { color: var(--signal); }

table.rekap td.kurang { color: var(--tally); background: #FDF0F0; }

/* Mode RINGKAS: sedikit kolom (No, NIS, Nama, H/I/S/A/D, %Hadir). Lebar
   kolom dibagi proporsional & simetris -- tidak menyisakan ruang kosong
   di kanan, dan kolom H/I/S/A/D sama lebar semua. */
table.rekap.ringkas { table-layout: fixed; width: 100%; }
table.rekap.ringkas th:nth-child(1), table.rekap.ringkas td:nth-child(1) { width: 5%; }
table.rekap.ringkas th:nth-child(2), table.rekap.ringkas td:nth-child(2) { width: 13%; }
table.rekap.ringkas th:nth-child(3), table.rekap.ringkas td:nth-child(3) { width: 33%; text-align: left; }
table.rekap.ringkas th:nth-child(n+4):nth-child(-n+8),
table.rekap.ringkas td:nth-child(n+4):nth-child(-n+8) { width: 7%; text-align: center; }
table.rekap.ringkas th:nth-child(9), table.rekap.ringkas td:nth-child(9) { width: 14%; text-align: center; }

/* Mode MATRIKS (per-tanggal): kunci lebar kolom tanggal supaya sempit &
   seragam, dan jaga kolom Nama tetap punya ruang minimum walau kolom
   tanggal banyak -- mencegah nama terpaksa mengecil/terpotong. */
table.rekap.matriks { table-layout: fixed; width: 100%; }
table.rekap.matriks td:nth-child(3), table.rekap.matriks th:nth-child(3) {
  min-width: 140px; width: 18%; text-align: left; white-space: normal;
}
table.rekap.matriks th.tegak, table.rekap.matriks td.mono.tengah { width: 34px; }

.rekap-catatan { margin: 10px 2px 0; font-size: 12.5px; color: var(--muted); }

/* =====================================================================
   KOP RESMI UNTUK CETAK (rekap.php) -- meniru gaya Lembar Presensi:
   nama sekolah besar-tengah, garis ganda, tabel info, tanda tangan.
   Semua di bawah ini HANYA tampak saat dicetak (lihat .hanya-cetak).
   ===================================================================== */
.kop-formal {
  text-align: center;
  border-bottom: 3px double #000;
  padding-bottom: 8px;
  margin-bottom: 14px;
}
.kop-formal .sekolah { font-size: 16pt; font-weight: bold; text-transform: uppercase; }
.kop-formal .judul   { font-size: 13pt; font-weight: bold; margin-top: 4px; text-transform: uppercase; }
.kop-formal .lab     { font-size: 11pt; }

table.info-formal { width: 100%; margin-bottom: 12px; font-size: 11pt; }
table.info-formal td { padding: 2px 0; vertical-align: top; }
table.info-formal td.label { width: 130px; }
table.info-formal td.titik { width: 12px; }

table.ttd-formal { margin-top: 34px; width: 100%; }
table.ttd-formal td { vertical-align: top; font-size: 11pt; }
table.ttd-formal .ruang { height: 62px; }

.footer-cetak-bawah { font-size: 9pt; color: #444; }

/* Judul ringkas dipakai di LAYAR saja; saat cetak digantikan .kop-formal
   di atas supaya tidak ada dua judul sekaligus. */
@media print { .kop-cetak-ringkas { display: none; } }

/* ---------- Rekap versi ponsel (kartu per siswa) ---------- */
.rekap-kartu {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px;
  margin: 10px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(22,24,29,.04);
}
.rk-atas { display: flex; align-items: flex-start; gap: 12px; }
.rk-ident { min-width: 0; flex: 1; }
.rk-nama {
  font-family: var(--font-label);
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.25;
}
.rk-nis { font-size: 12px; color: var(--muted); margin-top: 2px; }
.rk-persen {
  font-family: var(--font-label);
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
  flex-shrink: 0;
  text-align: right;
}
.rk-persen span { font-size: 14px; }
.rk-persen.cukup { color: var(--hijau); }
.rk-persen.kurang { color: var(--tally); }

.rk-hitung { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.rk-hitung .rh {
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 4px;
  background: #F4F5F7;
  border: 1px solid var(--line);
  color: var(--muted);
}
.rk-hitung .rh b { color: var(--ink); font-weight: 600; }
.rk-hitung .rh.st-H b { color: var(--hijau); }
.rk-hitung .rh.st-A b { color: var(--tally); }
.rk-hitung .rh.st-I b { color: var(--signal); }
.rk-hitung .rh.st-S b { color: var(--amber); }
.rk-hitung .rh.st-D b { color: var(--signal); }

.rk-rinci { margin-top: 11px; }
.rk-rinci > summary {
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  color: var(--signal);
  font-weight: 500;
  padding: 4px 0;
}
.rk-rinci > summary::-webkit-details-marker { display: none; }
.rk-rinci > summary::before { content: "▾ "; }
.rk-rinci[open] > summary::before { content: "▴ "; }
.rk-rinci ul { list-style: none; margin: 8px 0 0; padding: 0; }
.rk-rinci li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.rr-tgl { flex-shrink: 0; color: var(--muted); font-size: 12px; }
.rr-mapel { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rr-st {
  flex-shrink: 0;
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12.5px;
  background: #F4F5F7;
  border: 1px solid var(--line);
}
.rr-st.st-H { color: var(--hijau); background: #EFFAF3; border-color: #BBE5C8; }
.rr-st.st-A { color: var(--tally); background: #FDF0F0; border-color: #F3C6C6; }
.rr-st.st-I { color: var(--signal); background: #EDF7F8; border-color: #B7DDE0; }
.rr-st.st-S { color: var(--amber); background: #FDF6E9; border-color: #EFD9AE; }
.rr-st.st-D { color: var(--signal); background: #EDF7F8; border-color: #B7DDE0; }

.hanya-cetak { display: none; }

@media print {
  /* Kertas tanpa margin bawaan browser: kop tanggal/URL/nomor halaman
     otomatis dari browser butuh ruang margin untuk digambar -- dengan
     margin 0 di sini, ruang itu tak ada sehingga umumnya tidak muncul.
     Inset visual digantikan padding body di bawah. */
  @page { size: A4; margin: 0; }

  /* Sembunyikan seluruh perabot antarmuka */
  .rak, .tally, .tanpa-cetak, .aksi, .tombol, .sub-hal, .pesan { display: none !important; }

  body > .utama { margin-left: 0; }
  .isi   { padding: 0; }

  body { background: #fff; font-size: 11pt; padding: 16mm 14mm; }

  .kartu { border: 0; margin: 0; }

  .judul-hal { font-size: 16pt; margin-bottom: 4px; }

  table.data { font-size: 10pt; }
  table.data th, table.data td { border: 1px solid #999; padding: 4px 6px; }
  table.data th { background: #EFEFEF !important; -webkit-print-color-adjust: exact; }

  table.rekap td.kurang { background: #F2F2F2 !important; -webkit-print-color-adjust: exact; }

  .hanya-cetak { display: block; }
  table.hanya-cetak { display: table; }   /* jangan "block" -- tabel butuh struktur baris/kolom */
  .kaki-cetak { margin-top: 14px; font-size: 9pt; color: #444; }

  /* Catatan cetak (footer-cetak-bawah) dipatri di TEPI BAWAH kertas,
     menggantikan posisi nomor halaman/URL bawaan browser. */
  .footer-cetak-bawah {
    position: fixed;
    bottom: 6mm;
    left: 14mm;
    right: 14mm;
    text-align: center;
  }

  details.hari { border: 0; }
  details.hari > summary { display: none; }
}

/* =====================================================================
   MEREK & INFOGRAFIS (dashboard, rekap)
   ===================================================================== */

/* Pita merek di dasbor: logo — teks — logo, center */
.merek-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 16px 18px;
  margin-bottom: 16px;
  background: linear-gradient(180deg, var(--signal) 0%, var(--signal-gelap) 100%);
  border-radius: 12px;
  color: #fff;
}
.merek-strip img {
  width: 52px; height: 52px; object-fit: contain;
  background: #fff; border-radius: 10px; padding: 4px; flex-shrink: 0;
}
.merek-strip .ms-teks { text-align: center; }
.merek-strip .ms-judul {
  font-family: var(--font-label);
  font-size: 21px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; line-height: 1.05;
}
.merek-strip .ms-sub {
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: rgba(255,255,255,.72); margin-top: 3px;
}

/* Baris kartu grafik */
.grafik-baris {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.grafik-kartu {
  background: linear-gradient(180deg, #FFFFFF 0%, #F7F9FC 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(23,26,43,.05), 0 6px 18px rgba(23,26,43,.05);
}
.donat-tengah { justify-content: center; gap: 30px; }

/* Dua kartu grafik berdampingan, LEBAR & TINGGI SAMA */
.grafik-baris.dua { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
.grafik-baris.dua .grafik-kartu { display: flex; flex-direction: column; }
.grafik-isi-tengah {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 268px;
}

/* --- Diagram lingkaran (lebih besar & tebal agar jelas dibaca) --- */
.donat-panel { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; }
.donat-utama { display: flex; align-items: center; justify-content: center; gap: 26px; }
/* --- Diagram lingkaran per sesi (jumlahnya mengikuti sesi hari itu) --- */
.donat-grid {
  display: flex; flex-wrap: wrap;
  align-items: flex-start; justify-content: center;
  gap: 18px 22px; width: 100%;
}
.donat-item { display: flex; flex-direction: column; align-items: center; text-align: center; }
.di-grafik { line-height: 0; }
.di-jam {
  font-family: var(--font-label); font-size: 15px; font-weight: 600;
  margin-top: 9px; letter-spacing: .02em;
}
.di-sub {
  font-size: 12px; color: var(--muted); margin-top: 1px;
  max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.di-hadir { font-family: var(--font-mono); font-size: 11.5px; color: var(--signal); margin-top: 3px; }

/* Kaki: persentase gabungan sehari */
.donat-kaki {
  display: flex; align-items: baseline; justify-content: center; gap: 8px;
  width: 100%; margin-top: 14px; padding-top: 13px;
  border-top: 1px solid var(--line);
}
.dk-persen { font-family: var(--font-label); font-size: 26px; font-weight: 600; color: var(--signal); line-height: 1; }
.dk-teks { font-size: 12.5px; color: var(--muted); }

/* Keadaan kosong: hari ini belum ada sesi */
.kosong-grafik { text-align: center; padding: 24px 12px; color: var(--muted); }
.kosong-grafik svg { width: 44px; height: 44px; color: var(--line-kuat); margin-bottom: 12px; }
.kg-judul { font-family: var(--font-label); font-size: 17px; font-weight: 600; color: var(--ink); letter-spacing: .02em; }
.kg-teks { font-size: 13px; line-height: 1.5; margin-top: 6px; max-width: 290px; margin-inline: auto; }

/* Teks di tengah donat tidak boleh menghalangi hover ke segmen cincin. */
.donat-utama svg text, .di-grafik svg text { pointer-events: none; }
.donat-seg { transition: opacity .12s ease; cursor: default; }
.donat-item:hover .donat-seg { opacity: .4; }
.donat-item .donat-seg:hover { opacity: 1; }

.donat-legenda.lebar {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 7px 16px; width: 100%; flex: none;
}
.donat-legenda.lebar .legenda-item {
  padding: 4px 6px; border-radius: 7px; cursor: default;
  font-size: 14px;
}
.donat-legenda.lebar .legenda-item:hover { background: var(--signal-muda); }
.legenda-titik { width: 13px; height: 13px; }

/* --- Diagram batang (tebal, mudah dilihat guru) --- */
.batang-grafik {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 10px; width: 100%; height: 216px; padding: 4px 2px 0;
}
.bg-kolom {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  height: 100%; cursor: default;
}
.bg-nilai {
  font-family: var(--font-label); font-size: 16px; font-weight: 600;
  color: var(--ink); line-height: 1;
}
.bg-tabung {
  flex: 1; width: 100%;
  display: flex; align-items: flex-end; justify-content: center;
  background: linear-gradient(180deg, rgba(38,58,148,.05), rgba(38,58,148,.02));
  border-radius: 9px;
}
.bg-batang {
  width: 100%; max-width: 46px;
  border-radius: 9px;
  background: linear-gradient(180deg, #3B54B8 0%, var(--signal) 60%, var(--signal-gelap) 100%);
  transition: filter .12s ease, transform .12s ease;
  min-height: 6px;
}
.bg-batang.nol { background: #E1E5EC; min-height: 5px; }
.bg-kolom:hover .bg-batang { filter: brightness(1.14); transform: scaleY(1.02); transform-origin: bottom; }
.bg-label {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em;
  color: var(--muted); text-transform: uppercase;
}

/* --- Tooltip realtime (mengikuti kursor) --- */
.tip-kotak {
  position: fixed; z-index: 400;
  padding: 7px 11px;
  background: var(--rack); color: #fff;
  font-size: 12.5px; line-height: 1.35;
  border-radius: 8px; pointer-events: none;
  box-shadow: 0 8px 22px rgba(0,0,0,.28);
  opacity: 0; transform: translateY(3px);
  transition: opacity .12s ease, transform .12s ease;
  white-space: nowrap;
}
.tip-kotak.tampil { opacity: 1; transform: none; }

/* =====================================================================
   FOTO PRESENSI — thumbnail di daftar hadir + tampilan besar (lightbox)
   ===================================================================== */
.foto-kecil {
  display: inline-block;
  width: 46px; height: 46px;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid var(--line-kuat);
  background: var(--paper);
  cursor: zoom-in;
  flex-shrink: 0;
}
.foto-kecil img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto-kecil:hover { border-color: var(--signal); }
.foto-kosong { color: var(--muted); font-family: var(--font-mono); font-size: 13px; }

.foto-tirai {
  position: fixed; inset: 0; z-index: 350;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px; padding: 20px;
  background: rgba(18, 21, 32, .72);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .18s ease;
}
.foto-tirai.tampil { opacity: 1; }
.foto-tirai[hidden] { display: none; }
.foto-tirai img {
  max-width: min(92vw, 640px);
  max-height: 76vh;
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
  background: #fff;
}
.foto-judul {
  color: #fff; font-size: 14px; text-align: center;
  background: rgba(0,0,0,.35); padding: 7px 14px; border-radius: 999px;
}
.foto-tutup {
  position: absolute; top: 16px; right: 16px;
  width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.16); color: #fff;
  font-size: 22px; line-height: 1; cursor: pointer;
}
.foto-tutup:hover { background: rgba(255,255,255,.28); }

/* Kunci API di halaman Alat & Koneksi — disembunyikan sampai diklik */
.kunci-api > summary {
  cursor: pointer;
  font-size: 12.5px;
  color: var(--signal);
  list-style: none;
  user-select: none;
}
.kunci-api > summary::-webkit-details-marker { display: none; }
.kunci-api > summary::before { content: "▸ "; }
.kunci-api[open] > summary::before { content: "▾ "; }
.kunci-isi {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 7px;
}
.kunci-isi code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: var(--signal-muda);
  color: var(--ink);
  padding: 5px 8px;
  border-radius: 6px;
  word-break: break-all;
}

/* Daftar mata pelajaran diampu (form akun guru) -- bisa dibuka/tutup
   supaya form tidak memanjang saat mata pelajaran makin banyak. */
details.mapel-pilih {
  border: 1px solid var(--line-kuat);
  border-radius: 8px;
  margin-top: 6px;
}
details.mapel-pilih > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
  padding: 10px 12px;
  font-size: 14.5px;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
details.mapel-pilih > summary::-webkit-details-marker { display: none; }
details.mapel-pilih > summary:hover { background: #FAFBFC; }
details.mapel-pilih .mapel-panah { color: var(--muted); transition: transform .15s; flex-shrink: 0; }
details.mapel-pilih[open] .mapel-panah { transform: rotate(180deg); }

/* Dasar TANPA JavaScript: ikuti atribut [open] bawaan <details>, langsung
   snap terbuka/tertutup. Ini fallback saja -- kondisi normal memakai mode
   animasi di bawah (kelas jd-siap ditambahkan otomatis oleh footer.php). */
details.mapel-pilih > .mapel-daftar { display: none; }
details.mapel-pilih[open] > .mapel-daftar {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
}

/* Mode animasi halus (JS aktif): tampilan diatur murni lewat kelas
   jd-buka, BUKAN atribut [open] lagi -- supaya tinggi & transparansi bisa
   berubah bertahap, bukan langsung snap. Atribut [open] tetap disentuh
   oleh JS hanya demi aksesibilitas/print, tidak lagi memengaruhi tampilan. */
details.mapel-pilih.jd-siap > .mapel-daftar {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding: 0 12px;
  border-top: 1px solid var(--line);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height .28s ease, opacity .22s ease, padding .28s ease;
}
details.mapel-pilih.jd-siap.jd-buka > .mapel-daftar {
  padding: 10px 12px 12px;
  opacity: 1;
}

/* Sub-metrik kecil di kartu statistik (pola dari template referensi) */
.stat-sub {
  margin-top: 6px;
  padding-top: 7px;
  border-top: 1px solid rgba(23,26,43,.07);
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--muted);
}

/* Angka utama persentase di samping donat */
.ringkas-persen { text-align: center; padding-left: 4px; }
.rp-angka {
  font-family: var(--font-label);
  font-size: 40px; font-weight: 600; line-height: 1;
  color: var(--signal);
}
.rp-angka small { font-size: 20px; font-weight: 500; }
.rp-label {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  margin-top: 5px;
}

/* Kaki kartu: metrik + sparkline (menggantikan kotak "Sesi per Hari") */
.kartu-kaki {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--line);
}
.kk-label {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.kk-angka { font-family: var(--font-label); font-size: 22px; font-weight: 600; line-height: 1.15; margin-top: 3px; }
.kk-angka small { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kk-grafik { flex-shrink: 0; }
.kk-grafik .sparkline { display: block; }
.kk-sumbu {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 10px; color: var(--muted); margin-top: 2px;
}
.grafik-kop {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-label);
  font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink);
}
.grafik-isi { padding: 16px; }

/* Donut + legenda berdampingan */
.donat-bungkus { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donat-bungkus svg { flex-shrink: 0; }
.donat-legenda { display: flex; flex-direction: column; gap: 7px; min-width: 0; flex: 1; }
.legenda-item { display: flex; align-items: center; gap: 9px; font-size: 13.5px; }
.legenda-titik { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.legenda-nama { color: var(--muted); }
.legenda-nilai { margin-left: auto; font-family: var(--font-mono); font-weight: 500; color: var(--ink); }

/* Bar chart mendatar */
.bar-list { display: flex; flex-direction: column; gap: 11px; }
.bar-baris { display: grid; grid-template-columns: 82px 1fr auto; align-items: center; gap: 10px; }
.bar-nama { font-size: 12.5px; color: var(--muted); font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 20px; background: var(--paper); border-radius: 5px; overflow: hidden; }
.bar-isi { height: 100%; background: var(--signal); border-radius: 5px; min-width: 2px; transition: width .3s ease; }
.bar-nilai { font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; color: var(--ink); min-width: 20px; text-align: right; }

/* Warna kelas kehadiran untuk titik/segmen */
.warna-h { background: var(--c-h); } .warna-i { background: var(--c-i); }
.warna-s { background: var(--c-s); } .warna-a { background: var(--c-a); } .warna-d { background: var(--c-d); }

/* Label tanggal kecil di kepala kartu grafik */
.grafik-tgl {
  float: right;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  font-weight: 400;
}

/* Kehadiran per sesi — batang bertumpuk (tiap mapel/jam terpisah) */
.sesi-grafik { display: flex; flex-direction: column; gap: 15px; }
.sg-kop { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; align-items: baseline; }
.sg-judul { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-meta { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.sbar { display: flex; height: 22px; border-radius: 6px; overflow: hidden; background: var(--paper); }
.sbar > span { display: block; height: 100%; }
.sbar .seg-h { background: var(--c-h); } .sbar .seg-i { background: var(--c-i); }
.sbar .seg-s { background: var(--c-s); } .sbar .seg-a { background: var(--c-a); }
.sbar .seg-d { background: var(--c-d); } .sbar .seg-kosong { background: #E7E9EE; }
.sbar-legenda {
  display: flex; flex-wrap: wrap; gap: 6px 16px;
  margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
}
.sbar-legenda span { display: inline-flex; align-items: center; gap: 6px; }

/* Widget "Sesi" beranda — tab pengelompokan (dipusatkan) + daftar kartu */
.sesi-kop {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}
.sesi-kop > span:first-child { justify-self: start; }
.sesi-tgl-hari {
  justify-self: end;
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
}
.sesi-tabs { display: inline-flex; gap: 4px; background: var(--paper); padding: 3px; border-radius: 9px; justify-self: center; }
.sesi-tab {
  border: 0; background: none; cursor: pointer;
  font-family: var(--font-body); font-size: 12.5px; font-weight: 500;
  color: var(--muted); padding: 6px 12px; border-radius: 7px;
  letter-spacing: 0; text-transform: none;
}
.sesi-tab:hover { color: var(--ink); }
.sesi-tab.aktif { background: var(--surface); color: var(--signal); box-shadow: 0 1px 2px rgba(22,24,29,.12); }

.sesi-isi { padding: 0; }
.sesi-kelompok { padding: 10px 16px 16px; }
.grup-sesi {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
}
.grup-sesi + .grup-sesi { margin-top: 10px; }
.grup-kop {
  grid-column: 1 / -1;
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 10px 2px 2px;
  font-family: var(--font-label); font-size: 14px; font-weight: 600;
  letter-spacing: .02em; color: var(--ink);
}
.grup-sesi:first-child .grup-kop { padding-top: 2px; }
.grup-jml { font-family: var(--font-mono); font-size: 11px; font-weight: 400; color: var(--muted); }

.sesi-row {
  display: flex; flex-direction: column; gap: 9px;
  padding: 13px 14px;
  text-decoration: none; color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.sesi-row:hover {
  border-color: var(--signal);
  box-shadow: 0 2px 10px rgba(22,24,29,.08);
  transform: translateY(-1px);
  background: var(--surface);
}
.sr-atas { display: flex; align-items: center; gap: 12px; }
.sr-info { min-width: 0; flex: 1; }
.sr-utama { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-meta { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-kanan { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.sr-hadir { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }

/* Mini batang kehadiran di tiap baris sesi (gabungan dari widget lama) */
.sr-bar {
  display: flex; height: 8px;
  border-radius: 5px; overflow: hidden;
  background: var(--paper);
  box-shadow: inset 0 1px 2px rgba(23,26,43,.06);
}
.sr-bar > span { display: block; height: 100%; transition: filter .12s ease; cursor: default; }
.sr-bar > span:hover { filter: brightness(1.18) saturate(1.1); }
.seg-h { background: var(--c-h); } .seg-i { background: var(--c-i); }
.seg-s { background: var(--c-s); } .seg-a { background: var(--c-a); }
.seg-d { background: var(--c-d); } .seg-kosong { background: #E7E9EE; }

/* =====================================================================
   MODAL KONFIRMASI (pengganti confirm()/prompt() bawaan) — tengah + blur
   ===================================================================== */
.modal-tirai {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(18, 21, 32, .5);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .18s ease;
}
.modal-tirai.tampil { opacity: 1; }
.modal-tirai[hidden] { display: none; }

.modal-kotak {
  width: 100%;
  max-width: 430px;
  background: var(--surface);
  border-radius: 16px;
  padding: 26px 26px 22px;
  box-shadow: 0 24px 64px rgba(0,0,0,.35);
  transform: translateY(10px) scale(.97);
  transition: transform .18s ease;
}
.modal-tirai.tampil .modal-kotak { transform: none; }

.modal-ikon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  background: var(--signal-muda);
  color: var(--signal);
}
.modal-kotak.bahaya .modal-ikon { background: #FBE3E3; color: var(--tally); }
.modal-ikon svg { width: 24px; height: 24px; }

.modal-judul {
  font-family: var(--font-label);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.2;
  margin-bottom: 8px;
}
.modal-pesan { color: var(--muted); font-size: 14px; line-height: 1.55; }
.modal-pesan .baris-kosong { height: 9px; }

.modal-input-bungkus { margin-top: 14px; }
.modal-input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line-kuat);
  border-radius: 9px;
  font-family: var(--font-body);
  font-size: 15px;
}
.modal-input:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-muda); }

.modal-aksi { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }
.modal-aksi .tombol { min-width: 104px; justify-content: center; }

/* =====================================================================
   SPLASH / LOADING — hanya muncul bila perpindahan halaman terasa lambat
   ===================================================================== */
.splash-tirai {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(244, 245, 247, .78);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .2s ease;
}
.splash-tirai.tampil { opacity: 1; }
.splash-tirai[hidden] { display: none; }

.splash-isi { text-align: center; }
.splash-putar {
  width: 48px; height: 48px;
  margin: 0 auto 16px;
  border: 4px solid var(--signal-muda);
  border-top-color: var(--signal);
  border-radius: 50%;
  animation: putar .8s linear infinite;
}
@keyframes putar { to { transform: rotate(360deg); } }
.splash-merek {
  font-family: var(--font-label);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--signal);
}
.splash-lambat { display: none; margin-top: 10px; font-size: 13px; color: var(--muted); }
.splash-tirai.lambat .splash-lambat { display: block; }

@media (prefers-reduced-motion: reduce) {
  .splash-putar { animation-duration: 2s; }
  .modal-tirai, .modal-kotak, .splash-tirai { transition: none; }
}

/* =====================================================================
   BLOK RESPONSIF (DILETAKKAN DI AKHIR FILE DENGAN SENGAJA)
   Semua aturan dasar berada di ATAS blok ini, sehingga override
   mode-ponsel di sini selalu menang. Jangan dipindah ke atas.
   ===================================================================== */

/* ---------- ≤ 980px: sidebar menjadi laci ---------- */
@media (max-width: 980px) {

  .hamburger  { display: flex; }
  .rak-tutup  { display: block; }

  .rak {
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: 0 0 26px rgba(0,0,0,.28);
  }
  .rak.buka { transform: translateX(0); }

  body > .utama { margin-left: 0; }
}

/* ---------- ≤ 768px: MODE PONSEL PENUH (redesign, bukan desktop diperkecil) ---------- */
@media (max-width: 768px) {

  /* Tak ada satu pun elemen boleh memaksa halaman menggeser ke samping. */
  html, body { overflow-x: hidden; }

  /* Sidebar SELALU laci di ponsel; area utama memakai lebar penuh. */
  body > .utama { margin-left: 0; width: 100%; }
  .rak   { width: min(84vw, 300px); }

  /* ===== Header ringkas: satu baris, tinggi kecil ===== */
  .tally {
    padding: 6px 10px;
    gap: 8px;
    flex-wrap: nowrap;
    min-height: 46px;
  }
  .hanya-lebar { display: none !important; }

  .hamburger { width: 38px; height: 34px; }

  .topbar-merek {
    display: block;
    font-family: var(--font-label);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .lonceng-bungkus { margin-left: auto; margin-right: 0; }
  .lonceng { width: 36px; height: 36px; }
  .topbar-keluar { width: 36px; height: 36px; margin-left: 8px; }

  /* ===== Strip status ringkas: satu baris, tidak boros ruang ===== */
  .status-ringkas {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    overflow: hidden;
  }
  .sr-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding: 4px 10px;
    border: 1px solid var(--line-kuat);
    border-radius: 999px;
    background: #F6F7F9;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 500;
    text-decoration: none;
  }
  .sr-chip:first-child { flex: 1 1 auto; }        /* chip sesi boleh menyusut */
  .sr-chip:last-child  { flex: 0 0 auto; }        /* chip alat tetap utuh */
  .sr-teks { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sr-titik { width: 8px; height: 8px; border-radius: 50%; background: var(--line-kuat); flex-shrink: 0; }
  .sr-chip.nyala  { background: #FDF0F0; border-color: var(--tally); color: var(--tally); }
  .sr-chip.nyala  .sr-titik { background: var(--tally); animation: denyut 1.6s ease-in-out infinite; }
  .sr-chip.ok     { background: #EFFAF3; border-color: #BBE5C8; color: var(--hijau); }
  .sr-chip.ok     .sr-titik { background: var(--hijau); }
  .sr-chip.bahaya { background: #FDF0F0; border-color: #F3C6C6; color: var(--tally); }
  .sr-chip.bahaya .sr-titik { background: var(--tally); }

  /* ===== Konten memakai hampir seluruh lebar layar ===== */
  .isi { padding: 12px 10px; }
  .judul-hal { font-size: 22px; margin-bottom: 2px; }
  .sub-hal { font-size: 13px; margin-bottom: 13px; }

  .kartu {
    margin-bottom: 12px;
    border-radius: 12px;
    border-color: var(--line);
    box-shadow: 0 1px 2px rgba(22,24,29,.04);
  }
  .kartu-kop { padding: 11px 13px; font-size: 13px; letter-spacing: .05em; }
  .kartu-isi { padding: 13px; }

  /* ===== Dasbor: kartu statistik rapat, 2 kolom, teks tetap nyaman ===== */
  .stat-baris { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
  .stat { padding: 12px 13px; border-radius: 12px; }
  .stat .angka { font-size: 27px; }
  .stat .label { font-size: 10.5px; }

  /* ===== Form filter: field ditumpuk, tombol ringkas ===== */
  .form-baris { grid-template-columns: 1fr; gap: 11px; }
  input[type=text], input[type=password], input[type=date],
  input[type=number], select, textarea { font-size: 16px; padding: 10px 12px; }  /* 16px cegah zoom iOS */

  /* Tombol submit utama melebar penuh; baris tombol filter dibuat rapat & rata */
  .kartu-isi > form > button.tombol:not(.ico),
  .kartu-isi > form > .tombol:not(.ico):not(.garis) { width: 100%; text-align: center; padding: 11px 15px; }
  .form-baris .bidang[style*="flex-end"] { flex-direction: row; align-items: stretch; gap: 8px; }
  .form-baris .bidang[style*="flex-end"] .tombol {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 44px;
    padding-top: 0;
    padding-bottom: 0;
  }

  /* Panel notifikasi: dipatok ke layar (fixed) di bawah header, lebar hampir penuh,
     agar tidak pernah terpotong / keluar layar di ponsel. */
  .lonceng-panel {
    position: fixed;
    top: 50px;
    left: 10px;
    right: 10px;
    width: auto;
    max-width: none;
    max-height: calc(100vh - 66px);
    overflow-y: auto;
  }

  /* Tombol kembali → ikon panah saja */
  .tombol-kembali .tk-teks { display: none; }
  .tombol-kembali { padding: 8px 11px; }

  /* =====================================================================
     TABEL → DAFTAR KARTU
     Ini BUKAN tabel yang dikecilkan: kepala tabel dibuang, tiap baris jadi
     kartu mandiri dengan judul menonjol, isi ringkas, dan aksi berupa ikon.
     ===================================================================== */
  .tabel-bungkus { overflow-x: visible; }

  table.data { font-size: 14.5px; display: block; width: 100%; }
  table.data thead { display: none; }
  table.data tbody { display: block; width: 100%; }

  table.data tr {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 12px 13px;
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(22,24,29,.04);
  }
  table.data tbody tr:hover { background: var(--surface); }

  /* Sel biasa = baris "label · nilai" yang ringkas (tanpa garis antar sel) */
  table.data td {
    display: flex;
    gap: 14px;
    align-items: baseline;
    justify-content: space-between;
    padding: 2px 0;
    border: 0;
    white-space: normal;
    text-align: right;
    order: 2;
    line-height: 1.4;
  }
  table.data td[data-label]::before {
    content: attr(data-label);
    flex: 0 0 auto;
    text-align: left;
    font-family: var(--font-label);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
    align-self: center;
  }

  /* Judul kartu: menonjol, tanpa garis pemisah (bukan "header tabel").
     Catatan: PHP memakai kelas .sel-utama (nama unik) agar TIDAK bentrok
     dengan wadah utama .utama. */
  table.data td.sel-utama {
    order: 0;
    justify-content: flex-start;
    text-align: left;
    font-family: var(--font-label);
    font-size: 17px;
    font-weight: 600;
    letter-spacing: .01em;
    line-height: 1.2;
    padding: 0 0 6px;
    margin: 0;
  }
  table.data td.sel-utama::before { display: none; }
  table.data td.sel-utama.mono { font-family: var(--font-mono); font-size: 15.5px; }

  /* Nilai panjang: label di baris atas, nilai dipotong elipsis di bawahnya
     (blok lebih andal untuk teks mentah daripada elipsis di dalam flex) */
  table.data td.potong {
    display: block;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }
  table.data td.potong::before { display: block; margin-bottom: 1px; }

  /* Sel sekunder: muncul hanya setelah "Rincian" ditekan */
  table.data td.sekunder { display: none; }
  table.data tr.buka td.sekunder { display: flex; }
  table.data tr.buka td.sekunder.potong { display: block; }

  /* Tombol "Rincian" (disisipkan JS) */
  .baris-detail-sel { display: block; padding: 0; border: 0; order: 8; }
  .baris-detail {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    padding: 7px 0 0;
    border: 0; border-top: 1px dashed var(--line);
    background: none;
    color: var(--signal);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
  }
  .baris-detail .bd-panah { transition: transform .15s ease; }
  tr.buka .baris-detail .bd-panah { transform: rotate(180deg); }

  /* Baris aksi: deret ikon rapat di dasar kartu, tanpa ruang kosong */
  table.data td.aksi {
    order: 10;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 10px;
    margin-top: 8px;
    border-top: 1px solid var(--line);
  }
  table.data td.aksi::before { display: none; }
  table.data td.aksi form { display: inline-flex; margin: 0; }
  table.data td.aksi > .mono { align-self: center; font-size: 12px; color: var(--muted); }

  /* ===== Tombol aksi → IKON (teks tetap terbaca pembaca layar) ===== */
  .tombol.ico {
    position: relative;
    width: 38px;
    height: 38px;
    padding: 0;
    font-size: 0;              /* sembunyikan teks — andal di dalam flex (text-indent tidak) */
    line-height: 0;
    letter-spacing: 0;
    overflow: hidden;
    white-space: nowrap;
    display: inline-flex;
    flex: 0 0 auto;
  }
  .tombol.ico.kecil { width: 36px; height: 36px; }
  .tombol.ico::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: currentColor;
    -webkit-mask: var(--ic) center / 19px 19px no-repeat;
            mask: var(--ic) center / 19px 19px no-repeat;
  }

  /* ===== Rekap: matriks lebar disembunyikan, ganti kartu per siswa ===== */
  .rekap-lebar { display: none; }
  .rekap-mobile { display: block; }

  /* ===== Merek & infografis di ponsel ===== */
  .merek-strip { gap: 12px; padding: 13px 14px; }
  .merek-strip img { width: 42px; height: 42px; }
  .merek-strip .ms-judul { font-size: 18px; }
  /* Dua kartu grafik ditumpuk di ponsel. Selektor .dua ikut ditulis di sini
     karena specificity-nya lebih tinggi daripada .grafik-baris saja. */
  .grafik-baris, .grafik-baris.dua { grid-template-columns: 1fr; gap: 12px; }
  .donat-bungkus { justify-content: center; }

  .grafik-isi-tengah { min-height: 0; }
  .donat-grid { gap: 14px 16px; }
  .di-sub { max-width: 104px; }
  .dk-persen { font-size: 22px; }
  .donat-legenda.lebar { grid-template-columns: repeat(2, 1fr); gap: 6px 10px; }
  .batang-grafik { height: 176px; gap: 6px; }
  .bg-batang { max-width: 34px; }
  .bg-nilai { font-size: 14px; }
  .bg-label { font-size: 11px; }
  .stat-sub { font-size: 11px; }
  .bar-baris { grid-template-columns: 74px 1fr auto; }

  /* Widget sesi: di ponsel jadi satu kolom, tab melebar & bisa digeser */
  .sesi-kop { grid-template-columns: 1fr; justify-items: stretch; gap: 8px; }
  .sesi-tgl-hari { display: none; }   /* tanggal sudah cukup terwakili oleh label di sebelahnya */
  .sesi-tabs { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; justify-self: stretch; }
  .sesi-tab { flex: 1 0 auto; white-space: nowrap; }
  .grup-sesi { grid-template-columns: 1fr; }

  /* Lockup login: logo mengecil agar muat & simetris */
  .masuk-kotak { padding: 26px 20px 24px; }
  .masuk-merek { gap: 11px; }
  .masuk-merek img { width: 44px; height: 44px; }
  .masuk-merek .merek { font-size: 21px; }
}
