/* ============================================================
   SantriKu 2 — LMS Pesantren (app-like Android)
   Palet: hijau zamrud + emas, kartu putih, sudut membulat.
   ============================================================ */
:root {
  --green-950: #05271b;
  --green-900: #073324;
  --green-800: #0d4f37;
  --green-700: #116b4b;
  --green-600: #15805a;
  --green-500: #1c9a6d;
  --green-100: #dcefe4;
  --green-50: #eef7f1;
  --gold: #c9a227;
  --gold-600: #a9861d;
  --gold-100: #f7edcd;
  --ink: #10201a;
  --muted: #5f7268;
  --muted-2: #84968c;
  --line: rgba(16, 32, 26, 0.09);
  --bg: #f4f6f2;
  --white: #fff;
  --danger: #b42318;
  --danger-50: #fdecea;
  --warn: #b54708;
  --warn-50: #fef3e2;
  --ok: #0f7b52;
  --ok-50: #e6f6ee;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow-sm: 0 1px 2px rgba(11, 46, 33, 0.05), 0 8px 20px -16px rgba(11, 46, 33, 0.4);
  --shadow: 0 2px 6px rgba(11, 46, 33, 0.05), 0 22px 40px -28px rgba(11, 46, 33, 0.5);
  --shadow-lg: 0 30px 60px -30px rgba(11, 46, 33, 0.45);
  --font: 'Plus Jakarta Sans', 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --appbar-h: 62px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 520px at 6% -6%, #dff0e6 0%, rgba(223, 240, 230, 0) 62%),
    radial-gradient(760px 460px at 104% 4%, #f8efd6 0%, rgba(248, 239, 214, 0) 58%),
    radial-gradient(700px 500px at 50% 108%, #e6f0ea 0%, rgba(230, 240, 234, 0) 60%),
    var(--bg);
  background-attachment: fixed;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--green-700); text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -0.02em; line-height: 1.25; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 0.7em; }
p:last-child { margin-bottom: 0; }
.ico { width: 20px; height: 20px; flex: none; }
.ico-sm { width: 16px; height: 16px; }
.ico-lg { width: 26px; height: 26px; }
.muted { color: var(--muted); }
.tiny { font-size: 0.72rem; }
.small { font-size: 0.82rem; }
.strong { font-weight: 700; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; }
.row-top { display: flex; align-items: flex-start; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.grid { display: grid; gap: 16px; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 820px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }

/* ---------------- shell ---------------- */
.app { display: block; min-height: 100vh; }
.rail { display: none; }
.main { min-height: 100vh; }
.appbar {
  position: sticky; top: 0; z-index: 40;
  background: linear-gradient(135deg, var(--green-800), var(--green-700) 58%, #147a55);
  color: #fff;
  padding: calc(10px + var(--safe-t)) 16px 12px;
  border-radius: 0 0 22px 22px;
  box-shadow: 0 14px 28px -22px rgba(10, 59, 41, 0.9);
  overflow: hidden;
}
.appbar::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(circle at 12% 120%, rgba(255,255,255,.16) 0 2px, transparent 3px),
    radial-gradient(circle at 78% -20%, rgba(255,255,255,.1) 0 2px, transparent 3px);
  background-size: 26px 26px, 34px 34px;
  opacity: .5;
}
.appbar-inner { position: relative; display: flex; align-items: center; gap: 12px; max-width: 1080px; margin: 0 auto; }
.appbar h1 { font-size: 1.02rem; font-weight: 800; }
.appbar .sub { font-size: 0.7rem; color: rgba(255,255,255,.8); }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none;
  border-radius: 13px; background: rgba(255,255,255,.16); color: #fff; overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.brand-mark.has-logo { background: #fff; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border-radius: 12px; border: 0; background: rgba(255,255,255,.14); color: inherit; cursor: pointer;
  transition: background .18s ease, transform .18s ease; flex: none;
}
.icon-btn:hover { background: rgba(255,255,255,.24); }
.icon-btn:active { transform: scale(.95); }
.appbar .icon-btn { color: #fff; }
.bell-dot { position: relative; display: inline-flex; }
.bell-dot::after {
  content: ''; position: absolute; top: 5px; right: 6px; width: 8px; height: 8px; border-radius: 50%;
  background: #f7c948; box-shadow: 0 0 0 2px rgba(13, 79, 55, .95);
}
.content { padding: 18px 16px calc(104px + var(--safe-b)); max-width: 1080px; margin: 0 auto; }
.page-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.page-head h2 { font-size: 1.34rem; }
.page-head .sub { color: var(--muted); font-size: .84rem; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 24px 0 12px; }
.section-head h2, .section-head h3 { font-size: 1rem; }
.section-head a { font-size: .8rem; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.section-head:first-child { margin-top: 0; }

/* bottom navigation */
.bottomnav {
  position: fixed; left: 12px; right: 12px; bottom: calc(10px + var(--safe-b)); z-index: 45;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px;
  padding: 8px 6px; border-radius: 22px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: 0 18px 40px -20px rgba(10, 59, 41, .55);
  max-width: 560px; margin: 0 auto;
}
.bn-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 2px; border-radius: 15px; color: var(--muted); font-size: .64rem; font-weight: 700;
  transition: color .2s ease, background .2s ease;
}
.bn-item .ico { width: 21px; height: 21px; }
.bn-item.active { color: var(--green-800); background: linear-gradient(160deg, var(--green-50), #e3f2e9); }
.bn-item.active .ico { stroke-width: 2.1; }

/* sidebar desktop */
@media (min-width: 1000px) {
  .app { display: flex; align-items: stretch; }
  .rail {
    display: flex; flex-direction: column; width: 254px; flex: none; position: sticky; top: 0; height: 100vh;
    padding: 20px 14px; background: linear-gradient(180deg, #0b3f2c, #0d4f37 60%, #0a4631);
    color: #fff; gap: 14px; overflow: hidden;
  }
  .rail-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 6px; }
  .rail-brand .brand-mark { background: rgba(255,255,255,.16); width: 42px; height: 42px; }
  .rail-brand .brand-mark.has-logo { background: #fff; }
  .brand-name { font-weight: 800; font-size: 1rem; line-height: 1.2; }
  .brand-sub { font-size: .7rem; color: rgba(255,255,255,.66); }
  .rail-nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; padding-right: 2px; }
  .rail-group { font-size: .64rem; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.45); padding: 12px 10px 5px; }
  .rail-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 11px; border-radius: 12px; color: rgba(255,255,255,.84);
    font-size: .86rem; font-weight: 600; transition: background .18s ease, color .18s ease;
  }
  .rail-item .ico { width: 19px; height: 19px; opacity: .9; }
  .rail-item:hover { background: rgba(255,255,255,.09); color: #fff; }
  .rail-item.active { background: linear-gradient(120deg, rgba(255,255,255,.18), rgba(255,255,255,.08)); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
  .rail-item.active .ico { color: #f7d774; }
  .rail-foot { border-top: 1px solid rgba(255,255,255,.12); padding-top: 10px; }
  .rail-foot .list-row { color: #fff; }
  .rail-foot .list-meta { color: rgba(255,255,255,.6); }
  .rail-foot .btn-ghost { color: #fff; border-color: rgba(255,255,255,.2); }
  .rail-foot .btn-ghost:hover { background: rgba(255,255,255,.1); }
  .appbar { border-radius: 0 0 18px 18px; }
  .bottomnav { display: none; }
  .content { padding: 24px 28px 40px; }
  .main { flex: 1; min-width: 0; }
}
@media (min-width: 1000px) and (max-width: 1180px) { .rail { width: 226px; } }

/* ---------------- kartu & panel ---------------- */
.panel {
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(255,255,255,.8);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.panel-tight { padding: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.panel-head h2, .panel-head h3 { font-size: .98rem; }
.panel-head .ico { color: var(--green-700); }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow-sm); transition: transform .16s ease, box-shadow .16s ease;
}
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.side { background: linear-gradient(160deg, #fff, #fbfdfb); }
.soft { background: var(--green-50); border: 1px solid #d7e9df; border-radius: var(--radius-sm); padding: 12px; }
.soft-gold { background: linear-gradient(140deg, #fdf7e3, #fbf1d3); border: 1px solid #f0dfad; border-radius: var(--radius-sm); padding: 12px; }
.divide > * + * { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }

/* hero (dasbor) */
.hero {
  position: relative; overflow: hidden; color: #fff; border-radius: 22px; padding: 18px;
  background:
    radial-gradient(420px 220px at 110% -20%, rgba(247,215,116,.5), transparent 60%),
    linear-gradient(135deg, #0d4f37, #116b4b 60%, #1c9a6d);
  box-shadow: 0 22px 44px -30px rgba(10, 59, 41, .9);
}
.hero::after {
  content: ''; position: absolute; right: -30px; bottom: -40px; width: 180px; height: 180px; border-radius: 50%;
  border: 22px solid rgba(255,255,255,.08);
}
.hero h2 { font-size: 1.3rem; }
.hero .sub { color: rgba(255,255,255,.82); font-size: .84rem; }
.hero-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px;
  background: rgba(255,255,255,.16); color: #fff; font-size: .72rem; font-weight: 700;
  border: 1px solid rgba(255,255,255,.22);
}
.hero-stats { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-top: 16px; }
.hero-stat { background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.16); border-radius: 14px; padding: 9px 10px; }
.hero-stat b { display: block; font-size: 1.15rem; line-height: 1.15; }
.hero-stat span { font-size: .66rem; color: rgba(255,255,255,.78); }

/* stat tiles */
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
@media (min-width: 720px) { .stat-grid { grid-template-columns: repeat(4, minmax(0,1fr)); } }
.stat { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.stat .ico-wrap { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--green-50); color: var(--green-800); flex: none; }
.stat b { display: block; font-size: 1.25rem; line-height: 1.1; }
.stat span { font-size: .7rem; color: var(--muted); }

/* course card */
.course-card { display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; }
.course-card .cc-top { display: flex; align-items: flex-start; gap: 10px; }
.cc-ico {
  width: 46px; height: 46px; border-radius: 14px; flex: none; display: grid; place-items: center;
  background: linear-gradient(150deg, var(--green-700), var(--green-500)); color: #fff;
  box-shadow: 0 10px 20px -14px rgba(10,59,41,.9);
}
.cc-ico.gold { background: linear-gradient(150deg, #b8901f, #e0bb47); }
.cc-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: .7rem; color: var(--muted); }
.cc-title { font-size: .98rem; font-weight: 800; line-height: 1.3; }
.progress { height: 7px; border-radius: 999px; background: #e7eee9; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green-600), var(--green-500)); }
.progress.gold > span { background: linear-gradient(90deg, #c9a227, #e2c15a); }
.progress-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .7rem; color: var(--muted); margin-bottom: 5px; }

/* list rows */
.list-row {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); color: inherit;
}
.list-row.plain { background: transparent; border: 0; box-shadow: none; padding: 8px; }
a.list-row:hover { background: #fbfdfb; }
.list-title { font-weight: 700; font-size: .9rem; }
.list-meta { font-size: .73rem; color: var(--muted); }
.avatar {
  width: 40px; height: 40px; border-radius: 13px; flex: none; display: grid; place-items: center;
  background: linear-gradient(150deg, #dcefe4, #bfe3d1); color: var(--green-800); font-weight: 800; font-size: .85rem;
}
.avatar.sm { width: 34px; height: 34px; border-radius: 11px; font-size: .75rem; }
.avatar.lg { width: 56px; height: 56px; border-radius: 18px; font-size: 1.05rem; }
.avatar.gold { background: linear-gradient(150deg, #f7edcd, #eddcab); color: #7a5c0b; }

/* chips, badges */
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  font-size: .7rem; font-weight: 700; background: var(--green-50); color: var(--green-800);
  border: 1px solid #d9ebe1; white-space: nowrap;
}
.chip .ico { width: 13px; height: 13px; }
.chip.gold { background: var(--gold-100); color: #7a5c0b; border-color: #efdfac; }
.chip.muted { background: #f1f3f1; color: var(--muted); border-color: #e6eae7; }
.chip.danger { background: var(--danger-50); color: var(--danger); border-color: #f7d2ce; }
.chip.warn { background: var(--warn-50); color: var(--warn); border-color: #f6e0c2; }
.chip.ok { background: var(--ok-50); color: var(--ok); border-color: #c9e8d8; }
.chip.sm { font-size: .64rem; padding: 2px 7px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; }
.status-dot.off { background: #b8c2bc; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 44px; padding: 0 16px; border-radius: 13px; border: 1px solid transparent;
  font-size: .86rem; font-weight: 700; cursor: pointer; text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
  background: #fff; color: var(--ink); white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--green-700), var(--green-600)); color: #fff; box-shadow: 0 12px 24px -16px rgba(13,79,55,.9); }
.btn-primary:hover { background: linear-gradient(135deg, var(--green-800), var(--green-700)); }
.btn-gold { background: linear-gradient(135deg, #b8901f, #d8b241); color: #221a02; }
.btn-outline { border-color: #cfdcd4; color: var(--green-800); background: #fff; }
.btn-outline:hover { background: var(--green-50); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--green-800); }
.btn-ghost:hover { background: var(--green-50); }
.btn-danger { background: var(--danger-50); color: var(--danger); border-color: #f3cbc7; }
.btn-danger:hover { background: #fbdcd8; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: .78rem; border-radius: 11px; }
.btn-xs { min-height: 30px; padding: 0 9px; font-size: .72rem; border-radius: 9px; }
.btn-lg { min-height: 52px; font-size: .95rem; border-radius: 15px; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field > label, .label { font-size: .78rem; font-weight: 700; color: #33473e; }
.input, input[type='text'], input[type='email'], input[type='password'], input[type='number'],
input[type='tel'], input[type='date'], input[type='datetime-local'], input[type='search'], input[type='url'], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 12px; border: 1px solid #d7e0da;
  background: #fff; font-family: inherit; font-size: 15px; color: var(--ink); outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus, input:focus, select:focus, textarea:focus { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(28,154,109,.14); }
.hint { font-size: .72rem; color: var(--muted); line-height: 1.45; }
.invalid { border-color: var(--danger) !important; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: .84rem; color: #33473e; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--green-600); flex: none; }
.form-row { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0,1fr)); }
@media (max-width: 560px) { .form-row { grid-template-columns: minmax(0,1fr); } }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.alert { border-radius: 13px; padding: 11px 13px; font-size: .83rem; border: 1px solid transparent; display: flex; gap: 9px; align-items: flex-start; }
.alert-ok { background: var(--ok-50); color: #0b5c3e; border-color: #c5e8d7; }
.alert-err { background: var(--danger-50); color: var(--danger); border-color: #f7d2ce; }
.alert-warn { background: var(--warn-50); color: var(--warn); border-color: #f6e0c2; }
.alert-info { background: #eef4ff; color: #1e40af; border-color: #d5e2ff; }

/* chips filter & tabs */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 9px 14px; border-radius: 999px; font-size: .8rem; font-weight: 700; color: var(--muted);
  background: #fff; border: 1px solid var(--line); white-space: nowrap;
}
.tab.active { background: var(--green-800); color: #fff; border-color: transparent; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: #eef2ee; gap: 2px; }
.seg a { padding: 7px 12px; border-radius: 999px; font-size: .76rem; font-weight: 700; color: var(--muted); }
.seg a.active { background: #fff; color: var(--green-800); box-shadow: var(--shadow-sm); }

/* tables */
.table-wrap { overflow-x: auto; border-radius: 16px; border: 1px solid var(--line); background: #fff; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
table.tbl { width: 100%; border-collapse: collapse; min-width: 560px; }
table.tbl th, table.tbl td { padding: 11px 12px; text-align: left; font-size: .82rem; vertical-align: middle; }
table.tbl thead th { background: #f7faf7; color: #33473e; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 800; white-space: nowrap; }
table.tbl tbody tr + tr td { border-top: 1px solid var(--line); }
table.tbl tbody tr:hover { background: #fbfdfb; }
.tbl-aksi { display: flex; gap: 5px; justify-content: flex-end; flex-wrap: wrap; }
.tbl-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; font-size: .75rem; color: var(--muted); background: #fbfdfb; border-top: 1px solid var(--line); }
.pager { display: flex; gap: 5px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 32px; height: 32px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; border: 1px solid var(--line); font-weight: 700; font-size: .76rem; background: #fff; color: var(--ink); }
.pager a.active { background: var(--green-800); border-color: transparent; color: #fff; }
@media (max-width: 700px) {
  .hide-m { display: none !important; }
  table.tbl { min-width: 0; }
}

/* empty state */
.empty { text-align: center; padding: 30px 16px; color: var(--muted); }
.empty .ico-soft { width: 56px; height: 56px; border-radius: 18px; background: var(--green-50); color: var(--green-700); display: grid; place-items: center; margin: 0 auto 12px; }
.empty h3 { color: var(--ink); margin-bottom: 5px; font-size: .96rem; }
.empty p { font-size: .82rem; max-width: 380px; margin: 0 auto 12px; }

/* notifikasi */
.notif { display: flex; gap: 11px; padding: 12px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.notif.unread { background: linear-gradient(140deg, #f0f8f3, #fff); border-color: #d5ebdf; }
.notif .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green-500); margin-top: 6px; flex: none; }
.notif.read .dot { background: #d4dcd6; }

/* ---------------- pembaca PDF (PDF.js) ---------------- */
.pdf-reader { background: #e6ebe5; border-radius: 18px; border: 1px solid rgba(16,32,26,.1); isolation: isolate; }
.pdf-bar {
  position: sticky; top: calc(var(--appbar-h) + var(--safe-t)); z-index: 9;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px;
  background: rgba(255,255,255,.97); backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--line); border-radius: 18px 18px 0 0;
  box-shadow: 0 6px 16px -14px rgba(10,59,41,.5);
}
.pdf-pageno, .pdf-tools { display: flex; align-items: center; gap: 4px; }
.pdf-count { font-size: .78rem; font-weight: 800; color: #33473e; min-width: 54px; text-align: center; font-variant-numeric: tabular-nums; }
.pdf-btn {
  display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 8px;
  border-radius: 9px; border: 1px solid var(--line); background: #fff; color: #33473e; font-size: .78rem; font-weight: 700;
  cursor: pointer; font-family: inherit; text-decoration: none;
}
.pdf-btn:hover { background: var(--green-50); color: var(--green-800); }
.pdf-btn.active { background: var(--green-800); color: #fff; border-color: transparent; }
.pdf-status { padding: 20px; text-align: center; font-size: .8rem; color: var(--muted); }
.pdf-pages { border-radius: 0 0 18px 18px; padding: 12px 12px 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; overflow-x: auto; overflow-y: hidden; min-height: 180px; scrollbar-width: thin; }
.pdf-page { position: relative; flex: none; background: #fff; border-radius: 6px; box-shadow: 0 10px 26px -18px rgba(10,59,41,.6); }
.pdf-page canvas { display: block; border-radius: 6px; background: #fff; }
.pdf-page::before { content: ''; position: absolute; inset: 0; border-radius: 6px; background: linear-gradient(100deg, #fbfdfb 30%, #eef3ee 50%, #fbfdfb 70%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.pdf-page.is-ready::before { display: none; }
.pdf-page-no { position: absolute; right: 7px; bottom: 5px; font-size: .6rem; color: #a3b1a9; }
.pdf-fallback { padding: 26px 16px; text-align: center; }
.pdf-hint { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--ok-50); border: 1px solid #c5e8d7; color: #0b5c3e; font-size: .8rem; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------------- pemutar video/YouTube ---------------- */
.video-shell { position: relative; border-radius: 16px; overflow: hidden; background: #000; }
.video-shell video { width: 100%; max-height: 70vh; display: block; background: #000; }
.yt-frame { position: relative; padding-top: 56.25%; border-radius: 16px; overflow: hidden; background: #000; }
.yt-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-shell { position: relative; border-radius: 16px; overflow: hidden; background: #000; }
.yt-guard { position: absolute; top: 0; left: 0; right: 0; height: 56px; z-index: 3; }
.yt-foot { position: absolute; bottom: 0; left: 0; right: 0; height: 30px; z-index: 3; }
.yt-note { display: flex; gap: 8px; align-items: center; font-size: .72rem; color: var(--muted); margin-top: 8px; }

/* audio player */
.audio-card { background: linear-gradient(150deg, #0d4f37, #147a55); color: #fff; border-radius: 18px; padding: 16px; }
.audio-card .audio-top { display: flex; align-items: center; gap: 12px; }
.audio-card .audio-ico { width: 52px; height: 52px; border-radius: 16px; background: rgba(255,255,255,.15); display: grid; place-items: center; }
.audio-card audio { width: 100%; margin-top: 12px; filter: brightness(1.05); }
.audio-speed { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.audio-speed button { border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.1); color: #fff; border-radius: 9px; padding: 5px 9px; font-size: .72rem; font-weight: 700; cursor: pointer; }
.audio-speed button.active { background: #f7d774; color: #3d2f00; border-color: transparent; }

/* ---------------- ujian (exam mode) ---------------- */
.exam-mode .appbar { background: linear-gradient(135deg, #082e20, #0d4f37); }
.exam-bar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; background: rgba(255,255,255,.96); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.exam-timer { display: inline-flex; align-items: center; gap: 7px; font-variant-numeric: tabular-nums; font-weight: 800; color: var(--green-800); background: var(--green-50); border: 1px solid #d7e9df; border-radius: 999px; padding: 6px 12px; font-size: .86rem; }
.exam-timer.warn { color: var(--danger); background: var(--danger-50); border-color: #f7d2ce; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .65; } }
.q-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: var(--shadow-sm); }
.q-num { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; border-radius: 10px; background: var(--green-800); color: #fff; font-weight: 800; font-size: .78rem; }
.q-text { font-weight: 700; font-size: .96rem; line-height: 1.5; margin: 10px 0 4px; }
.opt {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border-radius: 13px; border: 1px solid #dfe7e2;
  background: #fff; cursor: pointer; margin-top: 8px; transition: border-color .14s ease, background .14s ease;
}
.opt:hover { border-color: #b7d6c5; background: #fbfdfb; }
.opt input { margin-top: 2px; accent-color: var(--green-700); width: 18px; height: 18px; flex: none; }
.opt.selected { border-color: var(--green-600); background: var(--green-50); box-shadow: 0 0 0 2px rgba(21,128,90,.12); }
.opt .huruf { font-weight: 800; color: var(--green-800); width: 18px; flex: none; }
.opt.benar { border-color: #7fc9a8; background: #eefaf3; }
.opt.salah { border-color: #f0b4ae; background: #fdf1f0; }
.q-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.q-nav button { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-weight: 800; font-size: .78rem; cursor: pointer; color: var(--muted); }
.q-nav button.terisi { background: var(--green-100); color: var(--green-800); border-color: #bfe0cd; }
.q-nav button.aktif { background: var(--green-800); color: #fff; border-color: transparent; }
.exam-footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; padding: 10px 14px calc(10px + var(--safe-b));
  background: rgba(255,255,255,.97); backdrop-filter: blur(16px); border-top: 1px solid var(--line);
  display: flex; gap: 8px; align-items: center; justify-content: space-between;
}
.exam-footer .btn { flex: 1; }
.exam-wrap { padding-bottom: 90px; }

/* ---------------- sertifikat ---------------- */
.cert-mode { background: #eef2ee; }
.cert-lembar {
  background: linear-gradient(150deg, #fffdf6, #fff); border: 10px double #c9a227; border-radius: 8px;
  padding: 26px 20px; text-align: center; position: relative; max-width: 760px; margin: 0 auto;
}
.cert-lembar::before { content: ''; position: absolute; inset: 8px; border: 1px solid rgba(201,162,39,.35); border-radius: 4px; pointer-events: none; }
.cert-kop { font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--green-800); font-weight: 800; }
.cert-title { font-size: clamp(1.35rem, 5vw, 2rem); color: var(--green-900); margin: 8px 0 2px; letter-spacing: .04em; }
.cert-sub { font-size: .8rem; color: var(--muted); }
.cert-nama { font-size: clamp(1.35rem, 5.5vw, 2.1rem); font-weight: 800; color: #0a3b29; margin: 16px 0 4px; border-bottom: 2px solid rgba(201,162,39,.55); display: inline-block; padding: 0 14px 4px; }
.cert-teks { font-size: .86rem; color: #33473e; max-width: 520px; margin: 10px auto 0; }
.cert-nilai { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 7px 14px; border-radius: 999px; background: var(--green-50); color: var(--green-800); font-weight: 800; font-size: .82rem; }
.cert-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.cert-ttd { font-size: .74rem; color: var(--muted); }
.cert-ttd b { display: block; color: var(--ink); font-size: .86rem; margin-top: 26px; }
.cert-kode { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .68rem; color: var(--muted); letter-spacing: .06em; }

/* ---------------- auth (login / setup) ---------------- */
.auth-body {
  min-height: 100vh; display: grid; place-items: center; padding: 22px 16px;
  background:
    radial-gradient(560px 320px at 8% -10%, #d4ead9 0%, rgba(212,234,217,0) 70%),
    radial-gradient(520px 300px at 100% 0%, #f8efcf 0%, rgba(248,239,207,0) 70%),
    linear-gradient(180deg, #f6f8f3, #eef4ef);
}
.auth-wrap { width: 100%; max-width: 430px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; margin-bottom: 18px; }
.auth-logo {
  width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(150deg, var(--green-800), var(--green-600)); color: #fff;
  box-shadow: 0 18px 34px -22px rgba(10,59,41,.9), 0 0 0 6px rgba(201,162,39,.18);
  overflow: hidden;
}
.auth-logo.has-logo { background: #fff; box-shadow: 0 18px 34px -22px rgba(10,59,41,.9), 0 0 0 6px rgba(201,162,39,.35); }
.auth-logo img { width: 100%; height: 100%; object-fit: cover; }
.auth-brand h1 { font-size: 1.42rem; color: var(--green-900); }
.auth-brand h1 em { font-style: normal; color: var(--gold-600); }
.auth-brand p { font-size: .8rem; color: var(--muted); margin: 0; }
.auth-card { background: #fff; border-radius: 22px; padding: 20px; box-shadow: var(--shadow-lg); border: 1px solid rgba(255,255,255,.9); }
.auth-card h2 { font-size: 1.06rem; margin-bottom: 3px; }
.auth-card .auth-sub { font-size: .8rem; color: var(--muted); margin-bottom: 16px; }
.auth-foot { text-align: center; font-size: .72rem; color: var(--muted); margin-top: 14px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 46px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 9px; display: grid; place-items: center; }
.pw-toggle:hover { background: var(--green-50); color: var(--green-800); }
.auth-hint { background: var(--green-50); border: 1px solid #d7e9df; border-radius: 12px; padding: 10px 12px; font-size: .76rem; color: #2c5342; margin-top: 12px; }

/* toast */
#toastWrap { position: fixed; left: 12px; right: 12px; bottom: calc(84px + var(--safe-b)); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  pointer-events: auto; max-width: 480px; width: 100%; display: flex; align-items: center; gap: 10px;
  background: rgba(16,32,26,.95); color: #fff; border-radius: 14px; padding: 11px 14px; font-size: .82rem;
  box-shadow: var(--shadow-lg); animation: toastIn .25s ease;
}
.toast .grow { flex: 1; }
.toast button { background: rgba(255,255,255,.16); color: #fff; border: 0; border-radius: 8px; padding: 5px 9px; font-size: .74rem; font-weight: 700; cursor: pointer; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* misc */
.badge-num { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--gold); color: #2c2200; font-size: .68rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.kv { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: .82rem; padding: 6px 0; }
.kv span { color: var(--muted); }
.kv b { text-align: right; }
.thumb { width: 64px; height: 48px; border-radius: 10px; background: #eef2ee; overflow: hidden; flex: none; display: grid; place-items: center; color: var(--green-700); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.dashed { border: 1.5px dashed #cfdcd4; border-radius: 14px; padding: 14px; background: #fbfdfb; }
.no-print { }
@media print {
  .appbar, .rail, .bottomnav, .no-print, #toastWrap { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; max-width: none; }
  .cert-mode .content { padding: 0; }
  .cert-lembar { box-shadow: none; border-width: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* utilitas tampilan perangkat (deteksi memakai User-Agent, bukan lebar layar) */
.show-m { display: inline-flex; }
@media (min-width: 1000px) {
  .show-m { display: none !important; }
}
@media print {
  .show-m { display: none !important; }
}

/* mode ujian: navigasi bawah disembunyikan agar tidak menutupi tombol ujian */
.exam-mode .bottomnav { display: none !important; }
.exam-mode .content { padding-bottom: 24px; }
