:root {
  --brand: #0d5c3f;
  --brand-dark: #094630;
  --brand-light: #e8f3ee;
  --brand-accent: #f0b429;
}

body { font-family: "Segoe UI", system-ui, -apple-system, sans-serif; }

/* ---------- Navbar & Sidebar ---------- */
.app-navbar {
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.app-navbar .navbar-brand, .app-navbar a { color: #fff; }

.app-sidebar {
  width: 250px;
  min-height: calc(100vh - 56px);
  background: #fff;
  border-right: 1px solid #e5e7eb;
  position: sticky;
  top: 56px;
  align-self: flex-start;
  max-height: calc(100vh - 56px);
  overflow-y: auto;
}
.app-menu .menu-label {
  font-size: .7rem;
  letter-spacing: .08em;
  color: #9aa2ac;
  padding: 1rem 1.25rem .35rem;
  font-weight: 700;
}
.app-menu .nav-link {
  color: #3f4a55;
  padding: .6rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .7rem;
  border-left: 3px solid transparent;
  font-size: .94rem;
}
.app-menu .nav-link i { width: 18px; text-align: center; font-size: 1.05rem; }
.app-menu .nav-link:hover { background: var(--brand-light); color: var(--brand); }
.app-menu .nav-link.active {
  background: var(--brand-light);
  color: var(--brand);
  border-left-color: var(--brand);
  font-weight: 600;
}
.app-content { min-height: calc(100vh - 56px); max-width: 100%; }

/* ---------- Kartu statistik ---------- */
.stat-card { border: 0; border-radius: .8rem; box-shadow: 0 1px 3px rgba(16,24,40,.08); }
.stat-card .stat-icon {
  width: 48px; height: 48px; border-radius: .7rem;
  display: flex; align-items: center; justify-content: center; font-size: 1.35rem;
}
.stat-value { font-size: 1.7rem; font-weight: 700; line-height: 1; }

.card { border-radius: .75rem; }
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.text-brand { color: var(--brand) !important; }
.bg-brand { background: var(--brand) !important; }

/* ---------- Halaman login ---------- */
.login-wrap {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 60%, #05271b 100%);
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
}
.login-card {
  max-width: 420px; width: 100%; border: 0; border-radius: 1rem;
  box-shadow: 0 18px 45px rgba(0,0,0,.28);
}
.login-logo {
  width: 74px; height: 74px; border-radius: 50%;
  background: var(--brand-light); color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-size: 2.1rem;
  margin: 0 auto .75rem;
}
/* Logo utama pada halaman login */
.login-mark {
  filter: drop-shadow(0 6px 14px rgba(8, 59, 40, .28));
  border-radius: 18px;
}
/* Logo pada navbar */
.app-navbar .navbar-brand img { border-radius: 8px; background: rgba(255,255,255,.12); }

/* ---------- Halaman ujian siswa ---------- */
.exam-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1.15rem;
  background: rgba(255,255,255,.15);
  padding: .3rem .8rem;
  border-radius: .5rem;
}
.exam-timer.warn { background: #dc3545; animation: blink 1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }

.nomor-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; }
.nomor-btn {
  aspect-ratio: 1/1; border: 1px solid #d0d5dd; background: #fff; border-radius: .45rem;
  font-size: .85rem; font-weight: 600; color: #475467; transition: .12s;
}
.nomor-btn:hover { border-color: var(--brand); }
.nomor-btn.terjawab { background: var(--brand); border-color: var(--brand); color: #fff; }
.nomor-btn.ragu { background: var(--brand-accent); border-color: var(--brand-accent); color: #333; }
.nomor-btn.aktif { outline: 3px solid rgba(13,92,63,.35); }

.opsi-item {
  border: 1px solid #d0d5dd; border-radius: .6rem; padding: .75rem 1rem; margin-bottom: .6rem;
  cursor: pointer; display: flex; gap: .75rem; align-items: flex-start; transition: .12s;
}
.opsi-item:hover { border-color: var(--brand); background: var(--brand-light); }
.opsi-item.selected { border-color: var(--brand); background: var(--brand-light); box-shadow: 0 0 0 1px var(--brand) inset; }
.opsi-label {
  flex: 0 0 28px; height: 28px; border-radius: 50%; background: #eef1f4;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem;
}
.opsi-item.selected .opsi-label { background: var(--brand); color: #fff; }
.opsi-item input { display: none; }

.soal-teks { font-size: 1.02rem; line-height: 1.7; }
.soal-teks img { max-width: 100%; height: auto; }

body.mode-ujian { user-select: none; -webkit-user-select: none; }
body.mode-ujian .soal-teks, body.mode-ujian .opsi-item { user-select: none; }

@media print {
  .app-sidebar, .app-navbar, .no-print, footer { display: none !important; }
  .app-content { padding: 0 !important; }
}
