/* Ujian Online - gaya dasar (ringkas, bersih, mobile-first) */
:root {
  --ink: #1b2437;
  --ink-soft: #2b3650;
  --paper: #f3f5f9;
  --card: #ffffff;
  --primary: #3045a8;
  --primary-dark: #243687;
  --primary-soft: #e9edfb;
  --signal: #f0a81c;
  --ok: #1b7a4b;
  --bad: #b3261e;
  --line: #e1e6ef;
  --line-strong: #c7cedc;
  --muted: #647089;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 2px rgba(20, 30, 60, .05), 0 1px 3px rgba(20, 30, 60, .04);
  --ctl-h: 40px;
  --font: "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 14.5px/1.5 var(--font); -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
p { margin: 0 0 .6rem; }
ol, ul { margin: .3rem 0 .6rem; padding-left: 1.2rem; }
code { background: #eef1f8; padding: .05rem .35rem; border-radius: 4px; font-size: .9em; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Kerangka ---------- */
.app { min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .6rem;
  background: var(--ink); color: #fff; padding: .45rem .8rem;
}
.topbar .brand { font-weight: 700; flex: 1; letter-spacing: .01em; }
.topbar .who { font-size: .8rem; opacity: .7; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-btn { background: none; border: 0; padding: .4rem; cursor: pointer; display: grid; gap: 4px; }
.menu-btn span { display: block; width: 20px; height: 2px; background: #fff; border-radius: 2px; }

.sidebar { display: none; background: var(--ink); color: #fff; padding: .4rem .8rem .8rem; }
.sidebar.open { display: block; }
.side-head { display: none; }
.sidebar nav { display: grid; gap: 1px; }
.sidebar a {
  color: #c9d2ea; text-decoration: none; padding: .5rem .7rem; border-radius: 6px; display: block; font-size: .92rem;
}
.sidebar nav a.active { background: var(--primary); color: #fff; font-weight: 600; }
.sidebar nav a:hover:not(.active) { background: var(--ink-soft); color: #fff; }
.side-foot { border-top: 1px solid var(--ink-soft); margin-top: .6rem; padding-top: .5rem; }
.side-foot .me { padding: .3rem .7rem; display: grid; font-size: .9rem; }
.side-foot .me span { font-size: .78rem; opacity: .65; }
.side-foot a { font-size: .86rem; padding: .4rem .7rem; }

.main { padding: .8rem; max-width: 1080px; }
.page-title { font-size: 1.2rem; font-weight: 700; margin-bottom: .8rem; }

@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 216px 1fr; }
  .topbar, .menu-btn { display: none; }
  .sidebar {
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 1rem .7rem; overflow-y: auto;
  }
  .side-head { display: block; padding: 0 .7rem 1rem; border-bottom: 1px solid var(--ink-soft); margin-bottom: .7rem; }
  .side-head .brand { font-size: 1.05rem; font-weight: 700; }
  .side-head .school { font-size: .78rem; opacity: .6; margin-top: .1rem; line-height: 1.3; }
  .side-foot { margin-top: auto; }
  .main { padding: 1.4rem 1.8rem; }
  .page-title { font-size: 1.35rem; margin-bottom: 1rem; }
}

/* ---------- Komponen ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: .9rem 1rem; margin-bottom: .9rem; box-shadow: var(--shadow);
}
.card > :last-child { margin-bottom: 0; }
.card.narrow { max-width: 460px; }
.card h2 { font-size: 1.02rem; font-weight: 700; }
.muted { color: var(--muted); font-size: .86rem; }

.stats {
  display: grid; grid-template-columns: repeat(2, 1fr); background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius-lg); margin-bottom: .9rem; box-shadow: var(--shadow); overflow: hidden;
}
.stat { padding: .75rem 1rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat:nth-child(2n) { border-right: 0; }
.stat:nth-last-child(-n+2) { border-bottom: 0; }
.stat b { display: block; font-size: 1.6rem; line-height: 1.1; font-weight: 700; color: var(--primary-dark); }
.stat span { color: var(--muted); font-size: .82rem; }
@media (min-width: 700px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .stat, .stat:nth-child(2n) { border-right: 1px solid var(--line); border-bottom: 0; }
  .stat:last-child { border-right: 0; }
}

label { display: block; font-weight: 600; margin: .65rem 0 .2rem; font-size: .86rem; color: var(--ink-soft); }
input[type=text], input[type=password], input[type=search], input[type=file], select,
input[type=number], input[type=datetime-local], textarea {
  width: 100%; padding: .45rem .65rem; border: 1px solid var(--line-strong); border-radius: var(--radius);
  font: inherit; background: #fff; color: var(--ink); min-height: var(--ctl-h);
}
input[type=file] { padding: .3rem .5rem; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: 0; box-shadow: 0 0 0 3px rgba(48, 69, 168, .15); }
input::placeholder, textarea::placeholder { color: #98a1b5; }
input:disabled, select:disabled, button:disabled { opacity: .55; cursor: not-allowed; }
select:disabled { background: #eef1f8; }
.form-row { display: grid; gap: 0 .8rem; }
@media (min-width: 700px) { .form-row.cols-2 { grid-template-columns: 1fr 1fr; } .form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; } }
.checkline { display: flex; align-items: center; gap: .5rem; margin-top: .65rem; font-weight: 400; font-size: .92rem; color: var(--ink); }
.checkline input { width: 18px; height: 18px; margin: 0; }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); }

.btn {
  display: inline-block; border: 1px solid transparent; border-radius: var(--radius); padding: .4rem .9rem; min-height: var(--ctl-h);
  font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; text-decoration: none; text-align: center; line-height: 1.5;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: #fff; color: var(--primary); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--primary-soft); border-color: #b4c0ec; }
.btn-danger { background: #fff; color: var(--bad); border-color: #e3bcb8; }
.btn-danger:hover { background: #fbeceb; }
.btn-sm { min-height: 30px; padding: .15rem .6rem; font-size: .84rem; }
.btn-block { display: block; width: 100%; margin-top: 1rem; }
.actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.actions form { margin: 0; }
.actions .ml-auto { margin-left: auto; }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .8rem; align-items: end; }
.toolbar > * { flex: 1 1 150px; }
.toolbar label { margin-top: 0; }
.toolbar .btn { flex: 0 0 auto; }

.alert { padding: .55rem .8rem; border-radius: var(--radius); margin-bottom: .8rem; border: 1px solid; font-size: .92rem; }
.alert-ok { background: #e7f4ec; border-color: #b3dcc4; color: #14563a; }
.alert-error { background: #fbeceb; border-color: #e8bcb8; color: #8a1c15; }
.alert-info { background: var(--primary-soft); border-color: #c1cbf0; color: var(--primary-dark); }

.table-wrap {
  overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  margin-bottom: .9rem; box-shadow: var(--shadow);
}
table { border-collapse: collapse; width: 100%; min-width: 480px; }
th, td { text-align: left; padding: .45rem .75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th {
  background: #f7f9fc; font-size: .74rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  white-space: nowrap;
}
tbody tr:hover td { background: #fafbfe; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
.empty { padding: 1.1rem; text-align: center; color: var(--muted); }

.badge { display: inline-block; padding: .05rem .5rem; border-radius: 99px; font-size: .74rem; font-weight: 700; line-height: 1.6; }
.badge-ok { background: #e1f3e8; color: var(--ok); }
.badge-off { background: #eceff5; color: var(--muted); }
.badge-err { background: #fbeceb; color: var(--bad); }
.badge-warn { background: #fdf0d3; color: #7a5200; }

.pagination { display: flex; flex-wrap: wrap; gap: .25rem; margin: .8rem 0; font-size: .88rem; }
.pagination a, .pagination span { padding: .25rem .65rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; text-decoration: none; }
.pagination a.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .disabled { color: #9aa3b5; }

pre.code { background: #f7f9fc; border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem; overflow-x: auto; font-size: .82rem; }

/* ---------- Halaman masuk ---------- */
.login-page { background: linear-gradient(160deg, var(--ink) 0%, #26346b 100%); min-height: 100vh; }
.login { min-height: 100vh; display: grid; align-content: center; max-width: 880px; margin: 0 auto; padding: 1rem; gap: 1rem; }
.login-intro { color: #fff; padding: 1rem .4rem 0; }
.login-intro h1 { font-size: 1.6rem; margin: .9rem 0 .15rem; font-weight: 700; }
.login-intro p { margin: 0; opacity: .7; font-size: .92rem; }
.bubbles { display: flex; gap: .45rem; }
.bubbles span {
  width: 34px; height: 34px; border-radius: 50%; border: 2px solid #8fa0d6; display: grid; place-items: center;
  font-weight: 600; font-size: .85rem; color: #b9c4ea;
}
.bubbles span.fill { background: #fff; border-color: #fff; color: var(--ink); }
.login-form { background: var(--card); padding: 1.3rem; border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.login-form h2 { font-size: 1.25rem; margin-bottom: .2rem; }
.login-form .hint { color: var(--muted); font-size: .86rem; margin: 0 0 .6rem; }
@media (min-width: 800px) {
  .login { grid-template-columns: 1fr 1fr; align-items: center; gap: 2rem; }
  .login-intro { padding: 1rem; }
  .login-intro h1 { font-size: 2rem; }
  .login-form { padding: 1.8rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn { transition: background-color .15s, border-color .15s; }
}

/* ---------- Bank soal ---------- */
textarea { resize: vertical; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chips label {
  margin: 0; display: flex; align-items: center; gap: .4rem; min-height: 36px; padding: .25rem .8rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--ink);
}
.chips input { width: 18px; height: 18px; margin: 0; }
.chips label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); }

.soal-teks { font-size: 1rem; line-height: 1.6; margin-bottom: .7rem; }
.soal-gambar[hidden] { display: none; }
.soal-gambar { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); margin: .5rem 0 .8rem; }
.opsi-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.opsi-item { display: flex; gap: .6rem; align-items: flex-start; padding: .45rem .7rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.opsi-item .huruf {
  flex: 0 0 28px; height: 28px; border-radius: 50%; border: 2px solid #9aa9dd; color: var(--primary);
  display: grid; place-items: center; font-weight: 700; font-size: .85rem;
}
.opsi-item.kunci { border-color: var(--ok); background: #e7f4ec; }
.opsi-item.kunci .huruf { background: var(--ok); border-color: var(--ok); color: #fff; }

/* ---------- Pengaturan ujian ---------- */
.token { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; letter-spacing: .12em; background: #eef1f8; border: 1px solid var(--line); border-radius: 6px; padding: .1rem .45rem; }
.token-row { display: flex; gap: .4rem; align-items: stretch; }
.token-row input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .12em; font-family: ui-monospace, Menlo, Consolas, monospace; }
.nowrap { white-space: nowrap; }
.sub-title { font-size: 1.05rem; font-weight: 700; margin: 1.1rem 0 .4rem; }

/* ---------- Pantau ujian ---------- */
.pt-head { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: space-between; align-items: flex-start; }
.pt-head p { margin: 0; }
.pt-token { display: grid; gap: .2rem; text-align: right; }
.pt-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); margin-bottom: .9rem; box-shadow: var(--shadow); overflow: hidden;
}
.pt-stat { padding: .6rem .9rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pt-stat:nth-child(3n) { border-right: 0; }
.pt-stat:nth-last-child(-n+3) { border-bottom: 0; }
.pt-stat b { display: block; font-size: 1.35rem; line-height: 1.1; }
.pt-stat span { color: var(--muted); font-size: .78rem; }
.pt-stat-err b { color: var(--bad); }
@media (min-width: 700px) {
  .pt-stats { grid-template-columns: repeat(6, 1fr); }
  .pt-stat, .pt-stat:nth-child(3n), .pt-stat:nth-last-child(-n+3) { border-right: 1px solid var(--line); border-bottom: 0; }
  .pt-stat:last-child { border-right: 0; }
}
.pt-update { align-self: center; margin-left: auto; }
.pt-table td { vertical-align: top; }
.pt-table tr.pt-kunci td { background: #fdf3f2; }
.pt-online { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; margin-top: .15rem; }
.pt-online.on { color: var(--ok); }
.pt-online.off { color: var(--muted); }
.pt-dot { width: .55rem; height: .55rem; border-radius: 50%; background: currentColor; display: inline-block; }
.pt-online.off .pt-dot { background: transparent; border: 2px solid currentColor; }
.pt-bar { width: 80px; height: 5px; background: var(--line); border-radius: 3px; margin-top: .25rem; overflow: hidden; }
.pt-bar-isi { height: 100%; background: var(--primary); }
.pt-plg { color: var(--bad); font-weight: 600; }
.pt-sisa { font-variant-numeric: tabular-nums; font-weight: 600; }
dialog.ex-dlg { border: 0; border-radius: var(--radius-lg); padding: 1.1rem; max-width: 420px; width: calc(100% - 2rem); box-shadow: 0 20px 50px rgba(0, 0, 0, .3); }
dialog.ex-dlg::backdrop { background: rgba(23, 32, 51, .55); }
dialog.ex-dlg .actions { justify-content: flex-end; margin-top: .9rem; }

/* ---------- Nilai dan laporan ---------- */
.print-only { display: none; }
.kop { text-align: center; margin-bottom: 1rem; border-bottom: 2px solid #000; padding-bottom: .6rem; }
.kop strong { font-size: 1.2rem; }
.kop-judul { font-weight: 700; font-size: 1.05rem; margin-top: .2rem; }
.lp-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin-bottom: .9rem; }
.lp-stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .55rem .8rem; box-shadow: var(--shadow); }
.lp-stat b { display: block; font-size: 1.3rem; line-height: 1.1; }
.lp-stat span { color: var(--muted); font-size: .8rem; }
@media (min-width: 700px) { .lp-stats { grid-template-columns: repeat(4, 1fr); } }
.lp-ok { color: var(--ok); font-weight: 600; }
.lp-bad { color: var(--bad); font-weight: 600; }
.lp-kunci { background: #e7f4ec; font-weight: 700; }
.lp-salah { color: var(--bad); }
.lp-table td, .lp-table th { font-size: .86rem; }
@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .sidebar, .topbar, .no-print, .pagination { display: none !important; }
  .app { display: block; }
  .main { padding: 0; max-width: none; }
  .page-title { display: none; }
  .print-only { display: block; }
  .card, .table-wrap, .lp-stat { border: 1px solid #999; box-shadow: none; }
  .table-wrap { overflow: visible; }
  table { page-break-inside: auto; }
  tr { page-break-inside: avoid; }
  thead { display: table-header-group; }
  th { text-transform: none; letter-spacing: 0; font-size: 10pt; color: #000; }
  .lp-kunci { background: #ddd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: #000; text-decoration: none; }
  .ttd { margin-top: 2rem; display: flex; justify-content: flex-end; }
}
.ttd { display: none; }
@media print { .ttd { display: flex; } }
.ttd div { text-align: center; min-width: 220px; }
.ttd .garis { margin-top: 3.5rem; border-top: 1px solid #000; padding-top: .2rem; }

/* ---------- Kartu peserta dan daftar hadir ---------- */
.kartu-grid { display: grid; grid-template-columns: 1fr; gap: .7rem; }
@media (min-width: 700px) { .kartu-grid { grid-template-columns: 1fr 1fr; } }
.kartu { background: #fff; border: 1.5px dashed #888; border-radius: 6px; padding: .6rem .8rem; break-inside: avoid; page-break-inside: avoid; }
.kartu-head { display: flex; justify-content: space-between; gap: .5rem; border-bottom: 1px solid var(--line); padding-bottom: .3rem; margin-bottom: .4rem; font-size: .9rem; }
.kartu-baris { font-size: .85rem; color: var(--muted); }
.kartu dl { display: grid; grid-template-columns: 7.5rem 1fr; gap: .15rem .5rem; margin: .4rem 0; }
.kartu dt { color: var(--muted); font-size: .85rem; }
.kartu dd { margin: 0; font-weight: 600; }
.kartu .mono { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .06em; }
.kartu .kecil { font-weight: 400; font-size: .8rem; letter-spacing: 0; font-family: var(--font); }
.kartu-foot { font-size: .72rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: .3rem; }
.hadir-kelas { margin-bottom: 1.4rem; }
.hadir-table td, .hadir-table th { font-size: .88rem; }
.hadir-table .ttd-kol { min-width: 150px; }
.hadir-table .ket-kol { min-width: 90px; }
.hadir-sum { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-top: .6rem; }
@media print {
  .kartu-grid { grid-template-columns: 1fr 1fr; gap: 6mm; }
  .kartu { color: #000; }
  .hadir-kelas { page-break-after: always; }
  .hadir-kelas:last-child { page-break-after: auto; }
  .hadir-table td { height: 1.9rem; }
}

/* ---------- Penyesuaian kecil pengganti inline style ---------- */
input[type=number][style*="max-width"] { width: auto; }
.ujian-card { display: block; }
.ujian-card h2 { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.ujian-card .btn { margin-top: .2rem; }
@media (min-width: 900px) {
  .ujian-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; align-items: start; }
}

/* Papan peringkat pantau (animasi naik-turun posisi) */
.pb-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: .8rem; }
.pb-tab { border: 1px solid var(--line-strong); background: var(--card); color: var(--ink); border-radius: 99px; padding: .3rem .9rem; font: inherit; font-weight: 600; cursor: pointer; }
.pb-tab.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pb-list { display: grid; gap: .5rem; }
.pb-list[hidden], .table-wrap[hidden] { display: none; }
.pb-row {
  display: grid; grid-template-columns: 2.6rem 2.4rem 1fr auto auto; align-items: center; gap: .6rem;
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--line-strong);
  border-radius: var(--radius-lg); padding: .55rem .7rem; box-shadow: var(--shadow); position: relative;
}
.pb-row.st-mengerjakan { border-left-color: var(--primary); }
.pb-row.st-selesai { border-left-color: var(--ok); }
.pb-row.st-terkunci { border-left-color: var(--bad); background: #fdf3f2; }
.pb-row.st-belum { opacity: .7; }
.pb-row.r1 { background: linear-gradient(90deg, #fff4cc, var(--card) 70%); border-left-color: #e8b100; }
.pb-row.r2 { background: linear-gradient(90deg, #eceff5, var(--card) 70%); border-left-color: #9aa3b5; }
.pb-row.r3 { background: linear-gradient(90deg, #fbe6d4, var(--card) 70%); border-left-color: #c47a3c; }
.pb-rank { text-align: center; font-weight: 800; font-size: 1.1rem; position: relative; }
.pb-row.r1 .pb-rank, .pb-row.r2 .pb-rank, .pb-row.r3 .pb-rank { font-size: 1.5rem; }
.pb-rank[data-gerak]::after { content: attr(data-gerak); position: absolute; left: 0; right: 0; top: 100%; font-size: .68rem; font-weight: 700; }
.pb-row.naik .pb-rank::after { color: var(--ok); }
.pb-row.turun .pb-rank::after { color: var(--bad); }
.pb-av { width: 2.4rem; height: 2.4rem; border-radius: 50%; color: #fff; display: grid; place-items: center; font-weight: 700; }
.pb-mid { min-width: 0; }
.pb-nama { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-sub { font-size: .78rem; }
.pb-bar { height: 6px; background: var(--line); border-radius: 3px; margin-top: .3rem; overflow: hidden; }
.pb-bar-isi { height: 100%; background: linear-gradient(90deg, var(--primary), #5b7bff); transition: width .8s ease; }
.pb-row.st-selesai .pb-bar-isi { background: var(--ok); }
.pb-skor { text-align: right; min-width: 3.6rem; position: relative; }
.pb-skor b { font-size: 1.35rem; font-variant-numeric: tabular-nums; color: var(--primary-dark); }
.pb-chip { position: absolute; right: 0; top: -.9rem; font-size: .78rem; font-weight: 800; color: var(--ok); opacity: 0; pointer-events: none; }
.pb-chip.pop { animation: pb-pop 1.6s ease-out; }
.pb-kanan { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }
.pb-panel { grid-column: 1 / -1; border-top: 1px dashed var(--line-strong); padding-top: .5rem; }
.pb-panel[hidden] { display: none; }
.pb-list .empty { text-align: center; padding: 1.5rem; color: var(--muted); }
@media (max-width: 640px) {
  .pb-row { grid-template-columns: 2.2rem 2rem 1fr auto; }
  .pb-av { width: 2rem; height: 2rem; font-size: .85rem; }
  .pb-kanan { grid-column: 1 / -1; justify-content: flex-start; }
}
@keyframes pb-pop { 0% { opacity: 0; transform: translateY(8px) scale(.8); } 15% { opacity: 1; transform: translateY(0) scale(1.25); } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
@keyframes pb-naik { 0% { box-shadow: 0 0 0 0 rgba(27,122,75,.6); } 100% { box-shadow: 0 0 0 14px rgba(27,122,75,0); } }
@keyframes pb-masuk { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .pb-row.naik { animation: pb-naik 1.4s ease-out 2; z-index: 2; }
  .pb-row.naik .pb-rank { animation: pb-pop-rank .6s ease-out; }
  .pb-row.masuk { animation: pb-masuk .5s ease-out; }
  .pb-row.r1 .pb-rank { animation: pb-goyang 2.4s ease-in-out infinite; }
}
@keyframes pb-pop-rank { 50% { transform: scale(1.5); } }
@keyframes pb-goyang { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-9deg) scale(1.1); } }

.pb-musik { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.pb-vol { accent-color: var(--primary); }

/* Pilihan musik + layar penuh papan peringkat */
.pb-pilih { border: 1px solid var(--line-strong); background: var(--card); color: var(--ink); border-radius: 99px; padding: .3rem .7rem; font: inherit; font-weight: 600; }
.pb-fhead { display: none; }
body.pb-kunci { overflow: hidden; }
.pb-layar.pb-full {
  position: fixed; inset: 0; z-index: 1000; overflow: hidden; color: #fff;
  background: radial-gradient(ellipse at top, #24348f 0%, #0e1430 65%);
  padding: 1rem 2.5vw 1rem; display: flex; flex-direction: column;
  --cel: .6rem;
}
.pb-full .pb-fhead { display: flex; flex: 0 0 auto; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: .8rem; }
.pb-full .pb-fhead h1 { margin: 0; font-size: clamp(1.3rem, 2.5vw, 2.2rem); }
.pb-full .pb-fhead p { margin: .1rem 0 0; color: #b9c3e6; font-size: clamp(.85rem, 1.3vw, 1.15rem); }
.pb-full .pb-fjam { text-align: right; }
.pb-full .pb-fjam b { display: block; font-size: clamp(1.3rem, 2.4vw, 2.1rem); font-variant-numeric: tabular-nums; }
.pb-full .pb-fjam span { color: #b9c3e6; font-size: clamp(.8rem, 1.1vw, 1rem); }
.pb-full .pb-tabs {
  position: fixed; right: 1rem; bottom: 1rem; margin: 0; z-index: 1010; max-width: calc(100vw - 2rem);
  background: rgba(10, 14, 36, .88); border-radius: 1.4rem; padding: .5rem .7rem; transition: opacity .4s;
}
.pb-full .pb-tabs #tabPapan, .pb-full .pb-tabs #tabTabel { display: none; }
.pb-full .pb-musik { margin-left: 0; }
.pb-full .pb-tab, .pb-full .pb-pilih { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.3); }
.pb-full .pb-tab.on { background: var(--primary); border-color: #8fa2ff; }
.pb-full .pb-pilih option { color: #1b2437; }
/* Menu pengaturan ringkas (satu tombol ⚙): musik, efek, volume, dan tata letak layar penuh */
.pb-set { position: relative; }
.pb-set > summary { list-style: none; cursor: pointer; user-select: none; }
.pb-set > summary::-webkit-details-marker { display: none; }
.pb-set[open] > summary { background: var(--primary); border-color: var(--primary); color: #fff; }
.pb-set-isi {
  position: absolute; z-index: 40; right: 0; top: calc(100% + 6px); width: 280px; max-width: calc(100vw - 2rem);
  background: var(--card); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(20, 30, 60, .18); padding: .35rem .8rem;
}
.pb-set-baris { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .5rem 0; font-size: .9rem; font-weight: 600; }
.pb-set-baris + .pb-set-baris { border-top: 1px solid var(--line); }
.pb-set-baris .pb-pilih { padding: .2rem .6rem; font-size: .85rem; max-width: 150px; }
.pb-set-ganda { display: inline-flex; gap: .35rem; }
.pb-set-ganda .pb-pilih { max-width: 100px; }
.pb-set-baris .pb-vol { width: 130px; }
.pb-sakelar { min-width: 4.2rem; border: 1px solid var(--line-strong); background: var(--card); color: var(--ink); border-radius: 99px; padding: .2rem .8rem; font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; }
.pb-sakelar.on { background: var(--primary); border-color: var(--primary); color: #fff; }
/* Pengaturan tata letak hanya berlaku di layar penuh */
.pb-set-baris.pb-tata { display: none; }
.pb-full .pb-set-baris.pb-tata { display: flex; }
.pb-full .pb-set-isi { top: auto; bottom: calc(100% + 8px); background: rgba(10, 14, 36, .96); color: #fff; border-color: rgba(255,255,255,.25); }
.pb-full .pb-set-baris + .pb-set-baris { border-top-color: rgba(255,255,255,.15); }
.pb-full .pb-sakelar { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.3); }
.pb-full .pb-sakelar.on { background: var(--primary); border-color: #8fa2ff; }
.pb-full .pb-set[open] > summary { border-color: #8fa2ff; }
.pb-layar.pb-full.sepi { cursor: none; }
.pb-layar.pb-full.sepi .pb-tabs { opacity: 0; pointer-events: none; }
/* Daftar: grid kolom-demi-kolom. Tiap kolom berisi --baris baris dengan tinggi sama; sisanya jadi halaman berikutnya (geser otomatis). */
.pb-full .pb-list {
  flex: 1 1 0; min-height: 0; width: 100%; margin: 0 auto; display: grid; overflow: hidden; scroll-behavior: smooth;
  grid-auto-flow: column; gap: var(--cel);
  grid-template-rows: repeat(var(--baris, 8), minmax(0, 1fr));
  grid-auto-columns: calc((100% - (var(--kol, 1) - 1) * var(--cel)) / var(--kol, 1));
}
.pb-full .pb-list[data-kol="1"] { max-width: 1400px; }
@media (prefers-reduced-motion: reduce) { .pb-full .pb-list { scroll-behavior: auto; } }
/* Semua ukuran isi baris memakai em dari --fs (dihitung JS dari tinggi baris dan lebar kolom), jadi muat berapa pun baris/kolomnya */
.pb-full .pb-row {
  font-size: var(--fs, 24px); min-height: 0; grid-template-columns: 1.9em 2.1em minmax(0, 1fr) auto; gap: .5em; padding: .25em .6em;
  background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.12); box-shadow: none;
}
.pb-full .pb-row.r1 { background: linear-gradient(90deg, rgba(232,177,0,.38), rgba(255,255,255,.08) 70%); }
.pb-full .pb-row.r2 { background: linear-gradient(90deg, rgba(154,163,181,.32), rgba(255,255,255,.08) 70%); }
.pb-full .pb-row.r3 { background: linear-gradient(90deg, rgba(196,122,60,.34), rgba(255,255,255,.08) 70%); }
.pb-full .pb-row.st-terkunci { background: rgba(179,38,30,.3); }
.pb-full .pb-rank { font-size: 1.1em; }
.pb-full .pb-row.r1 .pb-rank, .pb-full .pb-row.r2 .pb-rank, .pb-full .pb-row.r3 .pb-rank { font-size: 1.45em; }
.pb-full .pb-rank[data-gerak]::after { top: auto; bottom: -.3em; font-size: .4em; }
.pb-full .pb-av { width: 2.1em; height: 2.1em; font-size: 1em; }
.pb-full .pb-nama { font-size: 1em; line-height: 1.15; }
.pb-full .pb-sub, .pb-full .pb-sub.muted { color: #b9c3e6; font-size: max(.55em, 11px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-full .pb-bar { height: max(.16em, 4px); margin-top: .2em; background: rgba(255,255,255,.15); }
.pb-full .pb-skor { min-width: 2.6em; }
.pb-full .pb-skor b { font-size: 1.25em; color: #ffd54a; }
.pb-full .pb-chip { font-size: .5em; top: -.9em; color: #6fe3a1; }
.pb-full .pb-kanan, .pb-full .pb-panel { display: none; }
.pb-full .pb-list .empty { grid-row: 1; grid-column: 1 / -1; color: #b9c3e6; font-size: 1.3rem; }
@media (max-width: 640px) {
  .pb-full .pb-fhead { flex-direction: column; align-items: flex-start; }
  .pb-full .pb-fjam { text-align: left; }
}

/* ---------- Urut kolom dan menu ekspor ---------- */
.th-urut { color: inherit; text-decoration: none; display: inline-block; }
.th-urut:hover { color: var(--primary); text-decoration: underline; }
th[aria-sort] { color: var(--primary); }
.menu-ekspor { position: relative; display: inline-block; }
.menu-ekspor > summary { list-style: none; cursor: pointer; }
.menu-ekspor > summary::-webkit-details-marker { display: none; }
.menu-ekspor > summary::after { content: " \25BE"; }
.menu-ekspor-isi {
  position: absolute; z-index: 30; left: 0; top: calc(100% + 4px); min-width: 180px; background: var(--card);
  border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 6px 18px rgba(20, 30, 60, .15); padding: .25rem;
}
.menu-ekspor-isi a { display: block; padding: .45rem .7rem; color: var(--ink); text-decoration: none; border-radius: 6px; font-size: .9rem; }
.menu-ekspor-isi a:hover { background: var(--primary-soft); }
.menu-aksi { display: inline-block; }
.menu-aksi > summary { list-style: none; cursor: pointer; user-select: none; width: 2rem; height: 2rem; line-height: 2rem; text-align: center; border-radius: 99px; font-size: 1.25rem; font-weight: 700; color: var(--ink); }
.menu-aksi > summary::-webkit-details-marker { display: none; }
.menu-aksi > summary:hover, .menu-aksi[open] > summary { background: var(--primary-soft); color: var(--primary); }
.menu-aksi-isi {
  position: fixed; z-index: 60; min-width: 150px; background: var(--card); border: 1px solid var(--line-strong);
  border-radius: var(--radius); box-shadow: 0 6px 18px rgba(20, 30, 60, .18); padding: .25rem; text-align: left;
}
.menu-aksi-isi a { display: block; padding: .45rem .7rem; color: var(--ink); text-decoration: none; border-radius: 6px; font-size: .9rem; white-space: nowrap; }
.menu-aksi-isi a:hover { background: var(--primary-soft); }
.menu-aksi-isi form { margin: 0; }
.menu-aksi-isi button { display: block; width: 100%; text-align: left; padding: .45rem .7rem; border: 0; background: none; font: inherit; font-size: .9rem; color: var(--ink); border-radius: 6px; cursor: pointer; white-space: nowrap; }
.menu-aksi-isi button:hover { background: var(--primary-soft); }
.menu-aksi-isi button.bahaya { color: #b42318; }
.menu-aksi-isi button.bahaya:hover { background: #fdecea; }
@media print { .th-urut { color: #000; } }

/* ---------- Logo dan pengaturan ---------- */
.brand-logo { width: 24px; height: 24px; border-radius: 6px; vertical-align: middle; margin-right: .5rem; }
.side-head .brand-logo { width: 28px; height: 28px; }
.login-logo { display: block; width: 72px; height: 72px; border-radius: 18px; margin-bottom: .9rem; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.pasang-box { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.pasang-box img { width: 64px; height: 64px; border-radius: 16px; }
.langkah { margin: .3rem 0 .8rem 1.2rem; padding: 0; }

/* ---- Pengaturan admin, pengumuman, tab ---- */
.tabs { display: flex; flex-wrap: wrap; gap: .3rem; margin: 0 0 1rem; border-bottom: 1px solid var(--line); padding-bottom: .5rem; }
.tabs a { padding: .35rem .8rem; border-radius: 999px; color: var(--ink); text-decoration: none; font-size: .9rem; border: 1px solid transparent; }
.tabs a:hover { background: var(--primary-soft); }
.tabs a.active { background: var(--primary-soft); color: var(--primary-dark); border-color: #c1cbf0; font-weight: 600; }
.pengumuman { margin-bottom: 1rem; }
.tes-sistem td:nth-child(2) { white-space: nowrap; }
.pre-log { margin: .3rem 0 .8rem; padding: .6rem .8rem; background: #f4f5f9; border: 1px solid var(--line); border-radius: 6px; font-size: .78rem; line-height: 1.4; white-space: pre-wrap; word-break: break-all; max-height: 11rem; overflow: auto; }
.lp-lemah { background: #fdf6e3; }
.lp-persen { display: block; font-size: .72rem; color: var(--muted); }
.badge-sim { background: #e7ecff; color: var(--primary-dark); }
.ex-offline { margin: 0; padding: .55rem 1rem; background: #fdf0d3; color: #7a5200; font-size: .88rem; text-align: center; border-bottom: 1px solid #ecd493; }
.ex-offline.pulih { background: #e1f3e8; color: var(--ok); border-color: #b3dcc4; }

/* Teks bantuan kolom token diperkecil agar muat di layar HP; huruf yang diketik tetap besar */
.token-row input::placeholder { font-size: .72rem; letter-spacing: .02em; text-overflow: ellipsis; }
@media (max-width: 380px) { .token-row input::placeholder { font-size: .64rem; } }
.ujian-card .pengumuman { margin: .5rem 0; font-size: .92rem; }
