/* ═══════════════════════════════════════════
   main.css — Psikotes Online v2
   Semua warna pakai CSS variable --t-* dari tema
═══════════════════════════════════════════ */

/* ── RESET ──────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--t-bg);
  color: #1a1a2e;
  min-height: 100vh;
  line-height: 1.6;
}
a { color: var(--t-aksen-gelap); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }
input, select, button, textarea { font-family: inherit; font-size: 1rem; }

/* ── NAVBAR (halaman siswa) ─────────────── */
.navbar {
  background: #fff;
  border-bottom: 0.5px solid var(--t-border);
  padding: 0 24px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.navbar-brand { font-size: 1.1rem; font-weight: 600; color: var(--t-aksen-gelap); }
.navbar-right  { display: flex; align-items: center; gap: 16px; }
.navbar-user   { font-size: .9rem; color: #6b7280; }
.nav-link {
  font-size: .88rem; font-weight: 500; color: var(--t-aksen-gelap);
  padding: 6px 12px; border-radius: 8px; transition: background .15s;
}
.nav-link:hover { background: var(--t-aksen-muda); text-decoration: none; }
.nav-logout { color: #ef4444; }
.nav-logout:hover { background: #fee2e2; }

/* ── CONTAINER ──────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 32px 24px; }

/* ── PAGE HEADER ────────────────────────── */
.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 1.6rem; font-weight: 600; color: var(--t-aksen-text); }
.page-header p { color: #6b7280; margin-top: 4px; }

/* ── CARD ───────────────────────────────── */
.card {
  background: #fff;
  border: 0.5px solid var(--t-border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.mt-24 { margin-top: 24px; }

/* ── CARD HEADER ────────────────────────── */
.card-header {
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 0.5px solid var(--t-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h3 { font-size: .95rem; font-weight: 600; color: var(--t-aksen-text); }

/* ── STAT GRID ──────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: #fff;
  border: 0.5px solid var(--t-border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.stat-card.stat-warning { border-color: #fcd34d; background: #fffbeb; }
.stat-card.stat-success { border-color: var(--t-border); background: var(--t-aksen-muda); }
.stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: var(--t-aksen-muda);
  border-radius: 10px;
  flex-shrink: 0;
}
.stat-value { font-size: 1.8rem; font-weight: 600; color: var(--t-aksen-gelap); }
.stat-label { font-size: .78rem; color: #6b7280; margin-top: 3px; }
.stat-action { display: block; margin-top: 6px; font-size: .78rem; color: var(--t-aksen); font-weight: 600; }

/* ── ALERT ──────────────────────────────── */
.alert {
  padding: 11px 16px;
  border-radius: 8px;
  font-size: .88rem;
  margin-bottom: 16px;
}
.alert-info    { background: #dbeafe; color: #1e40af; border: 0.5px solid #93c5fd; }
.alert-error   { background: #fee2e2; color: #dc2626; border: 0.5px solid #fca5a5; }
.alert-success { background: var(--t-aksen-muda); color: var(--t-aksen-gelap); border: 0.5px solid var(--t-border); }
.alert-warning { background: #fffbeb; color: #92400e; border: 0.5px solid #fcd34d; font-size: .88rem; padding: 10px 16px; border-radius: 8px; }
.alert-warning a { color: #92400e; font-weight: 600; }

/* ── FORM ───────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; }
.form-group label { font-size: .82rem; font-weight: 600; color: #374151; }
.form-group input,
.form-group select,
.form-group textarea {
  padding: 9px 13px;
  border: 0.5px solid var(--t-border);
  border-radius: 8px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  width: 100%;
  font-size: .9rem;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--t-aksen);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--t-aksen) 15%, transparent);
}

/* Override untuk checkbox & radio — biar tidak ikut style input text */
input[type="checkbox"],
input[type="radio"],
.form-group input[type="checkbox"],
.form-group input[type="radio"] {
  width: 16px;
  height: 16px;
  padding: 0;
  border-radius: 0;
  margin: 0;
  cursor: pointer;
  accent-color: var(--t-aksen);
  flex-shrink: 0;
  vertical-align: middle;
}

/* Pola check-list yang reusable: container + item dengan hover */
.check-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 0.5px solid var(--t-border);
  border-radius: 8px;
  padding: 6px;
  background: #fff;
  max-height: 240px;
  overflow-y: auto;
}
.check-list.scroll-sm { max-height: 160px; }
.check-list.flat     { border: none; padding: 0; background: transparent; }

.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .12s;
  font-size: .82rem;
  user-select: none;
}
.check-item:hover { background: var(--t-aksen-muda); }
.check-item input[type="checkbox"] { margin: 0; }
.check-item .check-label { flex: 1; }
.check-item .check-meta  { font-size: .72rem; color: #6b7280; }
.check-item.disabled { color: #9ca3af; cursor: not-allowed; }
.check-item.disabled:hover { background: transparent; }

/* Pola check-pill: chip-style untuk hari (horizontal toggle) */
.check-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--t-border);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: .78rem;
  transition: all .12s;
  user-select: none;
}
.check-pill:hover { border-color: var(--t-aksen); }
.check-pill input[type="checkbox"] { margin: 0; }
.check-pill:has(input:checked) {
  background: var(--t-aksen-muda);
  border-color: var(--t-aksen);
  color: var(--t-aksen-text);
  font-weight: 600;
}

/* ── TOMBOL ─────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity .15s, box-shadow .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { opacity: .88; text-decoration: none; }
.btn-primary { background: var(--t-aksen-gelap); color: #fff; }
.btn-danger  { background: #dc2626; color: #fff; }
.btn-outline { background: #fff; color: var(--t-aksen-gelap); border: 0.5px solid var(--t-border); }
.btn-outline:hover { background: var(--t-aksen-muda); }
.btn-full    { width: 100%; justify-content: center; }
.btn-sm      { padding: 5px 12px; font-size: .8rem; }

/* ── TABLE ──────────────────────────────── */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .86rem; }
.tbl th {
  background: #fafafa;
  padding: 9px 14px;
  text-align: left;
  font-weight: 600;
  font-size: .76rem;
  color: #6b7280;
  border-bottom: 0.5px solid var(--t-border);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.tbl td { padding: 9px 14px; border-bottom: 0.5px solid #f5f5f5; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: color-mix(in srgb, var(--t-bg) 60%, #fff); }
.tbl .num { width: 48px; text-align: center; }

/* ── BADGE ──────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .74rem;
  font-weight: 600;
}
.badge-default { background: var(--t-aksen-muda); color: var(--t-aksen-gelap); }
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #dc2626; }

/* ── ACTION ROW ─────────────────────────── */
.action-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ── FILTER ROW ─────────────────────────── */
.filter-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filter-row input[type=text] {
  flex: 1; min-width: 200px;
  padding: 8px 12px;
  border: 0.5px solid var(--t-border);
  border-radius: 8px;
  font-size: .88rem;
}
.filter-row select {
  padding: 8px 12px;
  border: 0.5px solid var(--t-border);
  border-radius: 8px;
  background: #fff;
  font-size: .88rem;
}

/* ── TEKS HELPER ────────────────────────── */
.muted { color: #6b7280; }
.small { font-size: .82rem; }

/* ── AUTH PAGES ─────────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, var(--t-aksen-muda) 0%, var(--t-bg) 100%);
}
.auth-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
  border: 0.5px solid var(--t-border);
}
.auth-logo  {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}
.auth-title { font-size: 1.4rem; font-weight: 700; text-align: center; color: var(--t-aksen-gelap); margin-bottom: 4px; }
.auth-sub   { text-align: center; color: #6b7280; font-size: .88rem; margin-bottom: 24px; }
.auth-form  { margin-top: 8px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: .84rem; color: #6b7280; }
.auth-note  { text-align: center; margin-top: 12px; font-size: .8rem; color: #92400e; background: #fffbeb; padding: 8px 12px; border-radius: 8px; }

/* ════════════════════════════════════════════════
   ADMIN LAYOUT
════════════════════════════════════════════════ */
.admin-layout { display: flex; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────── */
.sidebar {
  width: 220px;
  min-width: 220px;
  /* Glass — transparansi (--glass-solid) & blur (--glass-blur) diatur admin.
     Baris pertama = fallback solid untuk browser tanpa color-mix. */
  background: linear-gradient(175deg, var(--t-sidebar-dari) 0%, var(--t-sidebar-ke) 100%);
  background: linear-gradient(175deg,
    color-mix(in srgb, var(--t-sidebar-dari) var(--glass-solid, 64%), transparent) 0%,
    color-mix(in srgb, var(--t-sidebar-ke)   var(--glass-solid, 64%), transparent) 100%);
  -webkit-backdrop-filter: blur(var(--glass-blur, 12px)) saturate(1.5);
          backdrop-filter: blur(var(--glass-blur, 12px)) saturate(1.5);
  border-right: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25),
              4px 0 28px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
/* Fallback: browser tanpa backdrop-filter -> pekatkan sidebar agar tetap solid */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .sidebar {
    background: linear-gradient(175deg, var(--t-sidebar-dari) 0%, var(--t-sidebar-ke) 100%);
  }
}
.sidebar-brand {
  padding: 18px 16px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 0.5px solid rgba(255,255,255,.15);
}
.sidebar-brand-logo {
  width: 30px; height: 30px;
  background: rgba(255,255,255,.2);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.sidebar-brand-name { font-size: .95rem; font-weight: 600; color: #fff; }
.sidebar-nav { display: flex; flex-direction: column; padding: 10px 0; flex: 1; }
.sidebar-link {
  padding: 9px 18px;
  font-size: .82rem;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  transition: background .15s, color .15s;
  border-left: 3px solid transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1;
}
.sidebar-link svg {
  flex-shrink: 0;
  opacity: .85;
  transition: opacity .15s;
}
.sidebar-link:hover svg,
.sidebar-link.active svg {
  opacity: 1;
}
.sidebar-link:hover,
.sidebar-link.active {
  background: rgba(255,255,255,.15);
  color: #fff;
  border-left-color: rgba(255,255,255,.8);
  text-decoration: none;
}
.sidebar-soon { opacity: .4; pointer-events: none; font-style: italic; }
.sidebar-logout { color: rgba(255,180,180,.75); margin-top: auto; }
.sidebar-logout:hover { background: rgba(239,68,68,.18); color: #fca5a5; border-left-color: #fca5a5; }
.sidebar-divider {
  padding: 10px 18px 3px;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: rgba(255,255,255,.38);
}
.sidebar-divider-line { height: 0.5px; background: rgba(255,255,255,.12); margin: 4px 18px; }

/* ── Main Content ────────────────────────── */
/* Default: sedikit tembus pandang supaya aurora terlihat di dashboard.
   Kartu/konten tetap solid (punya bg sendiri) jadi keterbacaan aman.
   Admin bisa matikan via body.dash-au-off (Pengaturan Tema). */
.admin-main { flex: 1; overflow-x: hidden; background: color-mix(in srgb, var(--t-bg) 75%, transparent); }
body.dash-au-off .admin-main { background: var(--t-bg); }
.admin-topbar {
  background: #fff;
  border-bottom: 0.5px solid var(--t-border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}
.admin-topbar h2 { font-size: 1.1rem; font-weight: 600; color: var(--t-aksen-text); }
.topbar-user { font-size: .84rem; color: #6b7280; display: flex; align-items: center; gap: 8px; }
.topbar-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--t-sidebar-dari), var(--t-sidebar-ke));
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 600; color: #fff;
}
.admin-content { padding: 24px 28px; }

/* ── Quick Grid ─────────────────────────── */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.quick-card {
  background: #fff;
  border: 0.5px solid var(--t-border);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  text-decoration: none;
  transition: box-shadow .15s, transform .15s;
}
.quick-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); transform: translateY(-2px); text-decoration: none; }
.quick-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: var(--t-aksen-muda);
  border-radius: 14px;
  margin: 0 auto 10px;
}
.quick-label { font-size: .82rem; font-weight: 600; color: #374151; }

/* ── Detail Grid ─────────────────────────── */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.detail-label { font-size: .72rem; color: #6b7280; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px; }
.detail-value { font-size: .92rem; font-weight: 500; }

/* ── Settings Form ───────────────────────── */
.settings-form { max-width: 540px; }
.settings-form .form-group { margin-bottom: 18px; }
.radio-row { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.radio-label { display: flex; align-items: center; gap: 10px; font-size: .88rem; cursor: pointer; }
.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline-form input { flex: 1; }

/* ── Monitor Siswa ──────────────────────── */
.mon-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px;
  border-bottom: 0.5px solid #f5f5f5;
}
.mon-item:last-child { border-bottom: none; }
.mon-ava {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; flex-shrink: 0;
  background: var(--t-aksen-muda); color: var(--t-aksen-gelap);
}
.mon-info { flex: 1; min-width: 0; }
.mon-name { font-size: .84rem; font-weight: 600; color: var(--t-aksen-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mon-sub  { font-size: .74rem; color: #6b7280; margin-bottom: 4px; }
.progress-bar  { width: 100%; height: 4px; background: var(--t-aksen-muda); border-radius: 2px; }
.progress-fill { height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--t-aksen-gelap), var(--t-aksen)); }
.mon-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.mon-pct  { font-size: .76rem; font-weight: 600; color: var(--t-aksen); }
.dot      { width: 7px; height: 7px; border-radius: 50%; }
.dot-on   { background: #10b981; box-shadow: 0 0 0 2px rgba(16,185,129,.2); animation: dotpulse 1.5s infinite; }
.dot-idle { background: #f59e0b; box-shadow: 0 0 0 2px rgba(245,158,11,.2); }
.dot-done { background: #d1d5db; }
@keyframes dotpulse { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ── Badge live ─────────────────────────── */
.badge-live { background: #fee2e2; color: #dc2626; font-size: .72rem; font-weight: 600; padding: 3px 9px; border-radius: 20px; animation: dotpulse 1.5s infinite; }
.badge-tema { background: var(--t-aksen-muda); color: var(--t-aksen-gelap); font-size: .74rem; font-weight: 600; padding: 3px 10px; border-radius: 20px; display: inline-block; }

/* ── Pengumuman ──────────────────────────── */
.pengumuman-list { display: flex; flex-direction: column; }
.pengumuman-item { padding: 14px 20px; border-bottom: 0.5px solid #f5f5f5; }
.pengumuman-item:last-child { border-bottom: none; }
.pengumuman-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; gap: 12px; }
.pengumuman-header h4 { font-size: .9rem; font-weight: 600; }
.pengumuman-isi { font-size: .84rem; color: #444; margin-bottom: 5px; white-space: pre-wrap; }
.pengumuman-siswa { padding: 10px 0; border-bottom: 0.5px solid var(--t-border); }
.pengumuman-siswa:last-child { border-bottom: none; }

/* ── Nama link ───────────────────────────── */
.nama-link { color: var(--t-aksen-text); font-weight: 600; }
.nama-link:hover { color: var(--t-aksen); text-decoration: none; }

/* ── Tes Cards (siswa) ───────────────────── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.tes-card {
  background: #fff;
  border: 0.5px solid var(--t-border);
  border-radius: 12px;
  padding: 22px 18px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.tes-aktif   { border-color: var(--t-aksen); }
.tes-nonaktif { opacity: .65; }
.tes-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: var(--t-aksen-muda);
  border-radius: 14px;
  margin-bottom: 12px;
}
.tes-label   { font-size: .88rem; font-weight: 600; color: var(--t-aksen-text); }

/* ── Tema picker ─────────────────────────── */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.preset-card {
  border: 2px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .15s, border-color .15s;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.preset-card:hover { transform: translateY(-2px); }
.preset-card.aktif { border-color: var(--t-aksen); }
.preset-swatch {
  height: 52px;
  display: flex;
}
.preset-swatch-sb { width: 30%; }
.preset-swatch-main { flex: 1; background: #f8f8f8; }
.preset-info {
  background: #fff;
  padding: 8px 10px;
  font-size: .78rem;
  font-weight: 600;
  color: #374151;
}
.color-input-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.color-field { display: flex; flex-direction: column; gap: 5px; }
.color-field label { font-size: .78rem; font-weight: 600; color: #374151; }
.color-field-inner { display: flex; align-items: center; gap: 8px; }
.color-field input[type=color] {
  width: 38px; height: 34px;
  border: 0.5px solid var(--t-border);
  border-radius: 6px;
  padding: 2px;
  cursor: pointer;
  background: #fff;
}
.color-field input[type=text] {
  flex: 1;
  padding: 7px 10px;
  border: 0.5px solid var(--t-border);
  border-radius: 6px;
  font-size: .84rem;
  font-family: monospace;
}

/* ── Checklist ───────────────────────────── */
.checklist { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.checklist li { font-size: .9rem; color: #6b7280; }
.checklist li.done { color: var(--t-aksen-gelap); font-weight: 500; }

/* ════════════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE — Phone & tablet
   Optimized untuk iOS Safari 15+ & Android Chrome
   ──────────────────────────────────────────────────────────────────────── */

/* Hamburger button & backdrop — hidden by default (desktop) */
.sidebar-hamburger { display: none; }
.sidebar-backdrop  { display: none; }

/* Tablet & smaller (≤900px) — sidebar jadi drawer */
@media (max-width: 900px) {
  /* iOS optimization */
  html {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
  }
  body {
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: contain;
  }

  /* Cegah iOS auto-zoom saat focus input — wajib font-size 16px+ */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  input[type="date"],
  input[type="search"],
  input[type="url"],
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Touch optimization */
  button, .btn, a.sidebar-link, a.sidebar-sublink, label.check-pill {
    touch-action: manipulation;
    -webkit-touch-callout: none;
  }

  /* ── Hamburger button (visible) ── */
  .sidebar-hamburger {
    display: inline-flex;
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 10px);
    left: 12px;
    z-index: 1100;
    width: 42px;
    height: 42px;
    padding: 0;
    background: var(--t-aksen-gelap);
    color: #fff;
    border: none;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,.18);
    cursor: pointer;
  }
  .sidebar-hamburger:active { transform: scale(.94); }

  /* ── Sidebar jadi drawer slide-in ── */
  .sidebar {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(280px, 80vw);
    height: 100vh;
    height: 100dvh;
    z-index: 1200;
    transform: translateX(-100%);
    transition: transform .25s ease-out;
    box-shadow: 4px 0 24px rgba(0,0,0,.25);
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
    -webkit-overflow-scrolling: touch;
  }
  .sidebar.open { transform: translateX(0); }

  /* ── Backdrop overlay ── */
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1150;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
  }
  .sidebar-backdrop.open {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  /* ── Topbar adjust (kasih space untuk hamburger) ── */
  .admin-topbar {
    padding: 12px 14px 12px 64px !important;
    padding-top: calc(12px + env(safe-area-inset-top, 0px)) !important;
    position: sticky;
    top: 0;
    z-index: 90;
  }
  .admin-topbar h2 { font-size: .98rem; }
  .topbar-user { font-size: .76rem; }

  .admin-main { margin-left: 0 !important; }
  .admin-content {
    padding: 16px 14px !important;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* ── Tabel — horizontal scroll yang smooth ── */
  .table-wrap, .tbl-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -14px;
    padding: 0 14px 4px;
  }
  .tbl { font-size: 12.5px; }
  .tbl th, .tbl td { padding: 8px 10px; white-space: nowrap; }
  .tbl td.small, .tbl th { font-size: 11.5px; }

  /* ── Form/filter row stacking ── */
  .filter-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .filter-row > input,
  .filter-row > select,
  .filter-row > .btn,
  .filter-row > a.btn {
    width: 100%;
  }

  /* ── Action row buttons → wrap, tidak overflow ── */
  .action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }
  .action-row > .btn,
  .action-row form,
  .action-row > a.btn {
    flex: 0 0 auto;
  }
  .btn-sm {
    padding: 7px 11px !important;
    font-size: 12px !important;
    min-height: 36px;
  }

  /* ── Card padding lebih kompak ── */
  .card { padding: 14px; }
  .card-header { padding-bottom: 10px; margin-bottom: 12px; }
  .card-header h3 { font-size: .9rem; }

  /* ── Container & auth ── */
  .container { padding: 20px 14px; }
  .auth-card { padding: 26px 18px; }

  /* ── Grid layout — collapse ke 1 col di phone ── */
  .stat-grid, .card-grid, .quick-grid {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  /* Grid arbitrary 2/3/4 col → 1 col */
  div[style*="grid-template-columns:1fr 1fr 1fr"],
  div[style*="grid-template-columns:1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* ── Modal jadi nyaris full-screen di phone ── */
  div[style*="position:fixed"][style*="inset:0"] > div,
  .modal-content {
    width: 94vw !important;
    max-width: 94vw !important;
    max-height: 90vh !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 22px 20px !important;
    border-radius: 14px !important;
  }

  /* ── Navbar siswa ── */
  .navbar { padding: 0 14px; height: 54px; }
  .navbar-brand { font-size: 1rem; }
  .navbar-right { gap: 10px; }
  .nav-link { font-size: .82rem; padding: 5px 10px; }

  /* ── Page header ── */
  .page-header h1 { font-size: 1.25rem; }
  .page-header { margin-bottom: 18px; }

  /* ── Form group spacing tighter ── */
  .form-group { margin-bottom: 12px; }
}

/* Phone (≤600px) — collapse SEMUA inline grid jadi 1 kolom */
/* Selector ini catch-all untuk inline style yang pakai grid-template-columns,
   KECUALI yang sudah pakai auto-fill/auto-fit (which are already responsive) */
@media (max-width: 600px) {
  div[style*="grid-template-columns"]:not([style*="repeat(auto"]) {
    grid-template-columns: 1fr !important;
  }
}

/* Phone kecil (≤480px) — adjust extra ringkas */
@media (max-width: 480px) {
  .admin-content { padding: 12px 12px !important; }
  .admin-topbar h2 { font-size: .92rem; }
  .topbar-user { display: none; } /* sembunyikan nama user di phone kecil */
  .topbar-avatar { display: flex; }

  .tbl { font-size: 12px; }
  .card { padding: 12px; }
  .card-header h3 { font-size: .85rem; }

  /* Badge stay readable */
  .badge, .badge-tema { font-size: 10px; padding: 2px 7px; }

  /* Auth card */
  .auth-card { padding: 22px 16px; }
}

/* ── Tap targets — minimum 44×44 (Apple guideline) ── */
@media (max-width: 900px) and (pointer: coarse) {
  .btn, button, a.sidebar-link, a.sidebar-sublink {
    min-height: 40px;
  }
  .sidebar-link { padding: 11px 18px; }
  .sidebar-sublink { padding: 9px 18px 9px 40px; }

  /* Checkbox dan radio lebih besar */
  input[type="checkbox"],
  input[type="radio"] {
    width: 18px;
    height: 18px;
  }
}

/* ── Sidebar Submenu ─────────────────────── */
.sidebar-group { display: flex; flex-direction: column; }

.sidebar-group-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  font-size: .82rem;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  transition: background .15s, color .15s;
  border-left: 3px solid transparent;
  background: none;
  border-top: none;
  border-right: none;
  border-bottom: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.sidebar-group-toggle:hover,
.sidebar-group-toggle.active {
  background: rgba(255,255,255,.15);
  color: #fff;
  border-left-color: rgba(255,255,255,.8);
}
.sidebar-chevron {
  margin-left: auto;
  transition: transform .2s;
  flex-shrink: 0;
  opacity: .6;
}
.sidebar-chevron.open { transform: rotate(180deg); }

.sidebar-submenu {
  display: none;
  flex-direction: column;
  background: rgba(0,0,0,.15);
  padding: 4px 0;
}
.sidebar-submenu.open { display: flex; }

/* ── Submenu FLYOUT (desktop) — panel muncul di samping kanan sidebar ── */
#sb-flyout-layer .sidebar-submenu {
  position: fixed;
  display: none;
  min-width: 226px;
  max-width: 272px;
  max-height: 84vh;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--t-sidebar-dari), var(--t-sidebar-ke));
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.32);
  padding: 6px 0;
  z-index: 1300;
}
#sb-flyout-layer .sidebar-submenu.open    { display: none; }
#sb-flyout-layer .sidebar-submenu.fly-open { display: flex; flex-direction: column; }
#sb-flyout-layer .sidebar-sublink { padding-left: 18px; }

@media (min-width: 901px) {
  .sidebar-chevron, .sidebar-chevron.open { transform: rotate(-90deg); }
}
@media (max-width: 900px) {
  #sb-flyout-layer { display: none; }
}

.sidebar-sublink {
  padding: 7px 18px 7px 40px;
  font-size: .78rem;
  color: rgba(255,255,255,.55);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s;
  display: block;
}
.sidebar-sublink:hover,
.sidebar-sublink.active {
  background: rgba(255,255,255,.1);
  color: #fff;
  border-left-color: rgba(255,255,255,.6);
  text-decoration: none;
}

/* ── Tombol copy beranimasi (ikon copy -> centang + ripple) ─────── */
.copy-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; flex-shrink: 0;
  border: 0.5px solid var(--t-border); border-radius: 8px; background: #fff;
  color: #475569; cursor: pointer; overflow: hidden;
  transition: background .15s ease, border-color .15s ease;
  vertical-align: middle;
}
.copy-btn:hover { background: #f1f5f9; }
.copy-btn .ic-copy, .copy-btn .ic-check {
  position: absolute; width: 16px; height: 16px;
  transition: opacity .25s cubic-bezier(.4,0,.2,1), transform .25s cubic-bezier(.4,0,.2,1);
}
.copy-btn .ic-copy  { opacity: 1; transform: scale(1) rotate(0); }
.copy-btn .ic-check { opacity: 0; transform: scale(.4) rotate(-45deg); color: #16a34a; }
.copy-btn.copied .ic-copy  { opacity: 0; transform: scale(.4) rotate(45deg); }
.copy-btn.copied .ic-check { opacity: 1; transform: scale(1) rotate(0); }
.copy-btn.copied { border-color: #16a34a; }
.copy-btn.copied::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: rgba(22,163,74,.28); pointer-events: none;
  animation: cb-ripple .55s ease-out forwards;
}
@keyframes cb-ripple { from { opacity: .6; transform: scale(.5); } to { opacity: 0; transform: scale(1.9); } }
/* Feedback untuk tombol teks biasa (non-ikon) yang pakai flashCopied() */
.copied:not(.copy-btn) { position: relative; }
.copied:not(.copy-btn)::after {
  content: "\2713 Tersalin"; position: absolute; inset: 0; border-radius: inherit;
  display: flex; align-items: center; justify-content: center;
  background: #16a34a; color: #fff; font-size: 12px; font-weight: 600;
  animation: cb-fadein .18s ease;
}
@keyframes cb-fadein { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .copy-btn .ic-copy, .copy-btn .ic-check { transition: opacity .15s ease; }
  .copy-btn.copied::after { animation: none; }
}

/* ── Toast notification (gaya glass, terinspirasi Lightswind) ────── */
#toast-wrap {
  position: fixed; top: 18px; right: 18px; z-index: 4000;
  display: flex; flex-direction: column; gap: 12px; width: 340px; max-width: calc(100vw - 36px);
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: flex-start; gap: 11px;
  background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
          backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, .55);
  border-left: 4px solid var(--t-aksen);
  border-radius: 14px;
  padding: 13px 14px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, .18);
  font-size: 13px; color: #0f172a;
  opacity: 0; transform: translateY(14px) scale(.96); filter: blur(3px);
  transition: opacity .4s cubic-bezier(.4,0,.2,1), transform .4s cubic-bezier(.4,0,.2,1), filter .4s ease;
}
.toast.in  { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
.toast.out { opacity: 0; transform: translateY(-14px) scale(.96); filter: blur(3px); }
.toast.in:hover { transform: translateY(-1px) scale(1.015); }
.toast-ic {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 700; line-height: 1; background: var(--t-aksen);
}
.toast-msg { flex: 1; line-height: 1.45; padding-top: 2px; }
.toast-x   { background: none; border: 0; font-size: 18px; line-height: 1; color: #94a3b8; cursor: pointer; padding: 0 2px; }
.toast-x:hover { color: #475569; }
.toast-success { border-left-color: #16a34a; } .toast-success .toast-ic { background: #16a34a; }
.toast-error   { border-left-color: #dc2626; } .toast-error   .toast-ic { background: #dc2626; }
.toast-info    { border-left-color: var(--t-aksen); } .toast-info .toast-ic { background: var(--t-aksen); }
@media (max-width: 600px) { #toast-wrap { left: 12px; right: 12px; top: 12px; width: auto; } }
@media (prefers-reduced-motion: reduce) { .toast { transition: opacity .2s ease; transform: none; filter: none; } .toast.out { transform: none; } }

/* ════════════════════════════════════════════════════════════════
   UI FX — efek hover tipis & ringan (glow tepi ikut kursor, sheen,
   angkat). Hanya transform/opacity (GPU) + 1 listener pointer
   (public/js/ui-fx.js). Tidak ada animasi berjalan terus.
   ════════════════════════════════════════════════════════════════ */
.card, .stat-card {
  position: relative;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover, .stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(15, 23, 42, .12);
}
/* Glow tepi mengikuti kursor — ring tipis di border */
.card::before, .stat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.3px;
  background: radial-gradient(var(--glow-size, 160px) circle at var(--mx, 50%) var(--my, 50%),
    var(--glow-color, var(--t-aksen)), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
  z-index: 3;
}
.card:hover::before, .stat-card:hover::before { opacity: var(--glow-strength, .75); }

/* Sheen menyapu — pada kartu statistik (aman diklip) */
.stat-card { overflow: hidden; }
.stat-card::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 55%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: translateX(-160%) skewX(-16deg);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}
.stat-card:hover::after { animation: fx-sheen .85s ease; }
@keyframes fx-sheen {
  0%   { transform: translateX(-160%) skewX(-16deg); opacity: .75; }
  100% { transform: translateX(230%)  skewX(-16deg); opacity: 0; }
}

/* Grafik bar kelulusan — menyala halus saat hover */
.dash-pgbar { transition: filter .18s ease; }
.dash-pgbar:hover { filter: brightness(1.06) saturate(1.08); }

/* Flyout menu — tidak polos: muncul beranimasi + item menggeser saat hover */
#sb-flyout-layer .sidebar-submenu.fly-open {
  animation: fx-fly-in .16s ease;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .18);
}
@keyframes fx-fly-in {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}
#sb-flyout-layer .sidebar-sublink { transition: background .15s, color .15s, padding-left .15s; }
#sb-flyout-layer .sidebar-sublink:hover { padding-left: 24px; }

/* Kilau flyout berkala — hanya kalau admin mengaktifkan (body.fx-flyout-shimmer) */
body.fx-flyout-shimmer #sb-flyout-layer .sidebar-submenu.fly-open::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, .16) 50%, transparent 68%);
  transform: translateX(-120%);
  animation: fx-fly-shimmer 3.4s ease-in-out infinite;
}
@keyframes fx-fly-shimmer {
  0%, 55% { transform: translateX(-120%); }
  82%, 100% { transform: translateX(120%); }
}
@media (prefers-reduced-motion: reduce) {
  body.fx-flyout-shimmer #sb-flyout-layer .sidebar-submenu.fly-open::after { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .stat-card, .dash-pgbar { transition: none; }
  .card:hover, .stat-card:hover { transform: none; }
  .stat-card::after, #sb-flyout-layer .sidebar-submenu.fly-open { animation: none; }
}
