/* ==========================================================================
   PAGES — Home, Kisi-Kisi, Quiz Arena, Nilai Rapor & Admin Studio
   ========================================================================== */

/* ==========================================================================
   1. BERANDA (index.html) — Kartu Peserta & Wizard Pilih Kelas/Akun
   ========================================================================== */
.pass-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  max-width: 680px;
  margin: 0 auto;
}

.pass-top {
  background: linear-gradient(125deg, var(--navy-950), var(--navy-800));
  color: #fff;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.pass-ava {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--gold-400), var(--gold-500));
  color: var(--navy-950);
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pass-meta h2 {
  font-size: 1.3rem;
  font-weight: 800;
}

.pass-meta p {
  font-size: 0.84rem;
  color: var(--gold-200);
  margin-top: 2px;
}

.pass-body {
  padding: 22px 24px;
}

.pass-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.pass-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-soft);
  background: var(--bg-subtle);
  text-decoration: none;
  color: var(--ink-900);
  font-weight: 700;
  font-size: 0.88rem;
  transition: all 0.15s;
}

.pass-tile:hover {
  border-color: var(--gold-500);
  background: var(--gold-100);
  transform: translateY(-2px);
}

.pass-tile i {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--navy-900);
  color: var(--gold-400);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pass-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-strong);
  font-size: 0.8rem;
  color: var(--ink-500);
}

/* Wizard Steps */
.step-bar {
  display: inline-flex;
  flex-wrap: wrap;
  max-width: 100%;
  align-items: center;
  gap: 8px 10px;
  margin-bottom: 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  padding: 6px 14px;
  border-radius: var(--r-pill);
  font-size: 0.8rem;
  font-weight: 700;
}

.step-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-400);
}

.step-dot.active {
  color: var(--navy-950);
}

.step-dot span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.step-dot.active span {
  background: var(--gold-400);
  color: var(--navy-950);
  font-weight: 800;
}

.class-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 215px), 1fr));
  gap: 12px;
}

.cls-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  text-align: left;
  transition: all 0.16s ease;
  box-shadow: var(--shadow-xs);
}

.cls-card:hover {
  border-color: var(--gold-500);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.cls-major {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--navy-900);
  color: var(--gold-400);
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.84rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cls-info {
  flex: 1;
  min-width: 0;
}

.cls-info strong {
  display: block;
  font-size: 1rem;
  color: var(--navy-950);
}

.cls-info small {
  font-size: 0.76rem;
  color: var(--ink-500);
}

.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: 8px;
  margin-top: 14px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

.roster-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  cursor: pointer;
  text-align: left;
  transition: all 0.14s;
}

.roster-btn:hover {
  border-color: var(--gold-500);
  background: var(--gold-100);
}

.roster-ava {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--navy-tint);
  color: var(--navy-900);
  font-weight: 800;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.roster-name {
  flex: 1;
  min-width: 0;
}

.roster-name b {
  display: block;
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roster-name small {
  display: block;
  font-size: 0.72rem;
  color: var(--ink-500);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   2. KISI-KISI & JADWAL — Card Hub & Halaman Baca Detail
   ========================================================================== */
.kisi-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

.kisi-workspace > * {
  min-width: 0;
}

@media (min-width: 960px) {
  .kisi-workspace {
    grid-template-columns: 320px minmax(0, 1fr);
    align-items: start;
  }
  .schedule-rail {
    position: sticky;
    top: 86px;
  }
}

.sched-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 12px;
  box-shadow: var(--shadow-xs);
}

.sched-card.is-focus {
  border-color: var(--gold-500);
  box-shadow: 0 6px 20px rgba(207, 150, 21, 0.16);
}

.sched-head {
  padding: 11px 15px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  font-size: 0.86rem;
  color: var(--navy-950);
}

.sched-card.is-focus .sched-head {
  background: linear-gradient(90deg, var(--gold-100), #fff9e6);
}

.sched-items {
  list-style: none;
}

.sched-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.86rem;
}

.sched-row:last-child {
  border-bottom: none;
}

.sched-time {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--navy-800);
  background: var(--navy-tint);
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.sched-subj {
  flex: 1;
  font-weight: 700;
  color: var(--ink-900);
  text-decoration: none;
}

a.sched-subj:hover {
  color: var(--ok-700);
  text-decoration: underline;
}

.sched-subj.muted {
  color: var(--ink-400);
  font-weight: 500;
}

.kisi-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
  min-width: 0;
}

/* Grid Kartu Mata Pelajaran Kisi-Kisi (Hub) */
.kisi-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 235px), 1fr));
  gap: 12px;
}

.kisi-hub-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--ink-900);
  box-shadow: var(--shadow-xs);
  min-width: 0;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.kisi-hub-card:hover {
  border-color: var(--gold-500);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kisi-hub-card:active {
  transform: scale(0.985);
}

.kisi-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.kisi-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--navy-900);
  color: var(--gold-400);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.08rem;
  flex-shrink: 0;
}

.kisi-card-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.kisi-card-body {
  min-width: 0;
}

.kisi-card-body h3 {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--navy-950);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.kisi-card-sub {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--ink-500);
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kisi-card-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px dashed var(--border-soft);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--navy-900);
}

.kisi-card-cta i {
  color: var(--gold-600);
  transition: transform 0.16s ease;
}

.kisi-hub-card:hover .kisi-card-cta i {
  transform: translateX(3px);
}

/* Tampilan Baca Detail Kisi-Kisi (Reader View) */
.kisi-reader-wrap {
  max-width: 820px;
  margin: 0 auto;
}

.kisi-reader-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.study-sheet.reader-mode {
  border: 1.5px solid var(--border-strong);
  border-top: 4px solid var(--gold-500);
  border-radius: var(--r-lg);
  padding: 22px 18px;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
  .study-sheet.reader-mode {
    padding: 30px 32px;
  }
}

.reader-title {
  font-size: clamp(1.35rem, 2.6vw, 1.8rem);
  font-weight: 800;
  color: var(--navy-950);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.kisi-pager {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 10px;
  margin-top: 16px;
}

.pager-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 13px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--ink-900);
  min-width: 0;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.pager-card:hover {
  border-color: var(--gold-500);
  background: var(--gold-100);
}

.pager-card small {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-500);
}

.pager-card strong {
  font-size: 0.9rem;
  color: var(--navy-950);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-section {
  margin-bottom: 26px;
}

.day-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.day-divider h2 {
  font-size: 0.92rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--navy-950);
}

.day-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-strong);
}

.study-sheet {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-xs);
  scroll-margin-top: 96px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.study-sheet:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.sheet-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.sheet-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--navy-950);
  letter-spacing: -0.015em;
}

.sheet-content {
  margin-top: 10px;
  font-size: 0.94rem;
  color: var(--ink-700);
  line-height: 1.72;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.sheet-content h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--navy-950);
  margin: 12px 0 4px;
}

.sheet-content h4 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ink-900);
  margin: 10px 0 4px;
}

.sheet-content ul,
.sheet-content ol {
  margin: 6px 0 6px 20px;
}

.sheet-content blockquote {
  border-left: 3px solid var(--gold-500);
  background: var(--bg-subtle);
  padding: 8px 12px;
  border-radius: 0 8px 8px 0;
  margin: 8px 0;
}

.study-sheet.clamped .sheet-content {
  max-height: 270px;
  overflow: hidden;
  position: relative;
}

.study-sheet.clamped .sheet-content::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 68px;
  background: linear-gradient(transparent, var(--bg-surface));
  pointer-events: none;
}

.study-sheet.expanded .sheet-content {
  max-height: none;
}

.study-sheet.expanded .sheet-content::after {
  display: none;
}

.media-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.thumb-btn {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  background: var(--bg-subtle);
  cursor: zoom-in;
}

.thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}

.thumb-btn:hover img {
  transform: scale(1.05);
}

.doc-attachments {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 12px;
}

.doc-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: var(--bg-subtle);
  color: var(--ink-900);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition: all 0.14s;
}

.doc-row:hover {
  border-color: var(--gold-500);
  background: var(--gold-100);
}

.doc-row i:first-child {
  color: var(--err-700);
  font-size: 1.1rem;
}

.doc-row span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
}

/* ==========================================================================
   3. ARENA QUIZ (quiz.html)
   ========================================================================== */
.strip-scroller {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 22px;
  scrollbar-width: none;
}

.strip-scroller::-webkit-scrollbar {
  display: none;
}

.mini-day-card {
  flex: 0 0 170px;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  padding: 12px;
}

.mini-day-card.today {
  border-color: var(--gold-500);
  background: linear-gradient(180deg, var(--gold-100), var(--bg-surface));
}

.mini-day-card strong {
  display: block;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--navy-900);
  margin-bottom: 6px;
}

.mini-day-card li {
  list-style: none;
  font-size: 0.79rem;
  color: var(--ink-700);
  padding: 3px 0;
  border-top: 1px dashed var(--border-soft);
}

.subj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
  gap: 12px;
}

.subj-tile {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: 18px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.16s ease;
  box-shadow: var(--shadow-xs);
}

.subj-tile:hover {
  border-color: var(--gold-500);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.subj-tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.subj-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--navy-900);
  color: var(--gold-400);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

.subj-tile h3 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--navy-950);
}

/* Runner Layout */
.exam-runner-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: 14px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
}

.runner-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 0.82rem;
  font-weight: 700;
}

.progress-track {
  height: 8px;
  background: var(--bg-subtle);
  border-radius: var(--r-pill);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--navy-900), var(--gold-500));
  border-radius: var(--r-pill);
  transition: width 0.3s ease;
}

.runner-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.runner-grid > * {
  min-width: 0;
}

@media (min-width: 840px) {
  .runner-grid {
    grid-template-columns: minmax(0, 1fr) 240px;
    align-items: start;
  }
  .palette-card {
    position: sticky;
    top: 86px;
  }
}

.question-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: 24px 22px;
  box-shadow: var(--shadow-sm);
}

.question-stem {
  font-size: 1.06rem;
  font-weight: 600;
  color: var(--ink-900);
  line-height: 1.68;
  white-space: pre-line;
  margin-bottom: 20px;
}

.choices-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.choice-btn {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 13px 15px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border-soft);
  background: var(--bg-elevated);
  text-align: left;
  cursor: pointer;
  font-size: 0.93rem;
  transition: all 0.14s ease;
}

.choice-btn:hover:not(:disabled) {
  border-color: var(--navy-800);
  background: var(--bg-subtle);
}

.choice-key {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  color: var(--navy-950);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.choice-btn.is-correct {
  background: var(--ok-100);
  border-color: var(--ok-500);
  font-weight: 700;
}

.choice-btn.is-correct .choice-key {
  background: var(--ok-500);
  border-color: var(--ok-500);
  color: #fff;
}

.choice-btn.is-wrong {
  background: var(--err-100);
  border-color: var(--err-500);
}

.choice-btn.is-wrong .choice-key {
  background: var(--err-500);
  border-color: var(--err-500);
  color: #fff;
}

.choice-btn.is-dim {
  opacity: 0.55;
}

.explain-callout {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--r-sm);
  background: var(--gold-100);
  border-left: 4px solid var(--gold-500);
  font-size: 0.88rem;
  line-height: 1.65;
  white-space: pre-line;
}

.runner-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.pal-num {
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--border-soft);
  background: var(--bg-elevated);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.pal-num.current {
  background: var(--navy-900);
  color: #fff;
  border-color: var(--navy-900);
}

.pal-num.ok {
  background: var(--ok-100);
  border-color: var(--ok-500);
  color: var(--ok-700);
}

.pal-num.bad {
  background: var(--err-100);
  border-color: var(--err-500);
  color: var(--err-700);
}

/* Result Certificate */
.result-banner {
  background: var(--bg-surface);
  border: 2px solid var(--gold-500);
  border-radius: var(--r-lg);
  padding: 30px 24px;
  text-align: center;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
}

.result-score-big {
  font-family: var(--font-mono);
  font-size: 4rem;
  font-weight: 800;
  color: var(--navy-950);
  line-height: 1;
  margin: 8px 0;
}

.review-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-left: 4px solid var(--border-strong);
  border-radius: var(--r-sm);
  margin-bottom: 10px;
  overflow: hidden;
}

.review-item.ok {
  border-left-color: var(--ok-500);
}

.review-item.bad {
  border-left-color: var(--err-500);
}

.review-item summary {
  padding: 13px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.review-body {
  padding: 0 16px 14px;
  font-size: 0.86rem;
  color: var(--ink-700);
  border-top: 1px dashed var(--border-soft);
  padding-top: 10px;
}

/* ==========================================================================
   4. RAPOR NILAI & LEADERBOARD (nilai.html)
   ========================================================================== */
.nilai-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.nilai-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

.nilai-grid > * {
  min-width: 0;
}

@media (min-width: 980px) {
  .nilai-grid {
    grid-template-columns: 400px minmax(0, 1fr);
    align-items: start;
  }
  .rapor-sticky {
    position: sticky;
    top: 86px;
  }
}

.rapor-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.rapor-head {
  background: linear-gradient(130deg, var(--navy-950), var(--navy-800));
  color: #fff;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rapor-student {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.rapor-ava {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--gold-400);
  color: var(--navy-950);
  font-weight: 800;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rapor-student h2 {
  font-size: 1.05rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rapor-student p {
  font-size: 0.76rem;
  color: var(--gold-200);
}

.rapor-avg-box {
  text-align: right;
  flex-shrink: 0;
}

.rapor-avg-num {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  color: var(--gold-400);
}

.rapor-avg-box small {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.75);
}

.privacy-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  position: absolute;
  inset: 0;
  background: #cdc4b1;
  border-radius: var(--r-pill);
  transition: background 0.2s;
}

.toggle-track::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.toggle-switch input:checked + .toggle-track {
  background: var(--navy-900);
}

.toggle-switch input:checked + .toggle-track::before {
  transform: translateX(18px);
}

/* Data Tables */
.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.data-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-500);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}

.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr.clickable {
  cursor: pointer;
}

.data-table tr.clickable:hover td {
  background: #faf6eb;
}

.data-table tr.is-me td {
  background: var(--gold-100);
}

/* Metrics & Podium */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.kpi-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: 13px 8px;
  text-align: center;
  box-shadow: var(--shadow-xs);
  min-width: 0;
}

.kpi-val {
  font-family: var(--font-mono);
  font-size: clamp(1.2rem, 4.8vw, 1.65rem);
  font-weight: 800;
  color: var(--navy-950);
  line-height: 1.1;
}

.kpi-lbl {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-500);
  margin-top: 4px;
  line-height: 1.25;
}

.podium-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr) minmax(0, 1fr);
  gap: 8px;
  align-items: end;
  margin-bottom: 12px;
}

.podium-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
  min-width: 0;
  transition: transform 0.15s, border-color 0.15s;
  box-shadow: var(--shadow-xs);
}

.podium-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold-500);
}

.podium-card.rank-1 {
  border-color: var(--gold-500);
  background: linear-gradient(180deg, var(--gold-100), var(--bg-surface));
  padding-top: 22px;
  box-shadow: var(--shadow-sm);
}

.podium-medal {
  font-size: 1.75rem;
}

.podium-student {
  font-weight: 800;
  font-size: 0.85rem;
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-avg {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--gold-600);
  margin-top: 2px;
}

.rank-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 8px;
}

.rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.14s;
}

.rank-row:hover {
  border-color: var(--gold-500);
}

.rank-num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-400);
  width: 26px;
}

.rank-name {
  flex: 1;
  font-size: 0.86rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   5. ADMIN STUDIO (admin.html)
   ========================================================================== */
.vault-card {
  max-width: 410px;
  margin: 42px auto;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-top: 4px solid var(--gold-500);
  border-radius: var(--r-lg);
  padding: 30px 26px;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.vault-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: var(--navy-900);
  color: var(--gold-400);
  font-size: 1.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.studio-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 600px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

.check-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-soft);
  background: var(--bg-subtle);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.check-pill:has(input:checked) {
  background: var(--gold-100);
  border-color: var(--gold-500);
  color: var(--navy-950);
}

.check-pill input {
  accent-color: var(--navy-900);
}

.slot-row,
.choice-edit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.slot-row .slot-time {
  flex: 0 0 145px;
}

.record-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  margin-bottom: 8px;
  font-size: 0.86rem;
}

.record-item strong {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Rich Editor & Dropzone */
.editor-shell {
  border: 1.5px solid var(--border-soft);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--bg-elevated);
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 8px 10px;
  background: var(--navy-950);
}

.ed-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 9px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.ed-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.editor-area {
  min-height: 160px;
  padding: 14px 16px;
  outline: none;
  line-height: 1.68;
}

.editor-area:empty::before {
  content: attr(data-placeholder);
  color: var(--ink-400);
}

.upload-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--bg-subtle);
  padding: 20px 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}

.upload-zone:hover,
.upload-zone.dragging {
  border-color: var(--gold-500);
  background: var(--gold-100);
}

.upload-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: center;
  margin-top: 10px;
}

.upload-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-surface);
  border: 1px solid var(--gold-500);
  padding: 5px 10px;
  border-radius: var(--r-pill);
  font-size: 0.76rem;
  font-weight: 700;
}

.upload-chip button {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: var(--err-500);
  color: #fff;
  font-size: 0.65rem;
  cursor: pointer;
}
