/* SLMS GMIST ke-26 — gaya aplikasi. Warna mengikuti logo: emas, biru laut, hitam, ungu umbul-umbul. */
:root {
  --bg: #f6f4ef; --surface: #ffffff; --surface-2: #f0ede4; --ink: #15202d; --ink-2: #4b5766; --line: #e1dccd;
  --navy: #123b63; --navy-2: #0e2a47; --sea: #1f6fb2; --gold: #b98a14; --gold-2: #e6c25a; --purple: #5b3a8c;
  --ok: #1f7a4c; --ok-bg: #e3f3ea; --warn: #8a5a00; --warn-bg: #fdf0d2; --bad: #b3261e; --bad-bg: #fbe5e3; --info-bg: #e4eefa;
  --radius: 14px; --shadow: 0 1px 2px rgba(20,32,45,.06), 0 6px 18px rgba(20,32,45,.06);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --side: 248px; --top: 60px; --tab: 62px;
}
:root { color-scheme: light dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1622; --surface: #14212f; --surface-2: #1b2b3d; --ink: #e8edf3; --ink-2: #a8b4c2; --line: #263548;
    --navy: #8fc0ee; --navy-2: #0a1624; --sea: #6db3ee; --gold: #e0b341; --gold-2: #e6c25a; --purple: #b79af0;
    --ok: #62d09a; --ok-bg: #12301f; --warn: #f0c36a; --warn-bg: #3a2d0c; --bad: #ff8f86; --bad-bg: #3b1714; --info-bg: #122a44;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); min-height: 100vh; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .5rem; color: var(--ink); letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 4.5vw, 2.3rem); } h2 { font-size: 1.35rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 .8rem; } a { color: var(--sea); } small, .muted { color: var(--ink-2); }
.skip { position: absolute; left: -999px; top: 0; background: var(--navy-2); color: #fff; padding: .6rem 1rem; z-index: 99; }
.skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
img, svg { max-width: 100%; }

/* ---- kerangka ---- */
#topbar { position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 16px; padding-top: env(safe-area-inset-top); background: var(--navy-2); color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; min-width: 0; }
.brand img { flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { font-family: var(--serif); font-size: 1.05rem; white-space: nowrap; }
.brand-text small { color: #bcd0e4; font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#userchip { display: flex; align-items: center; gap: 8px; }
.userbtn { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); color: #fff;
  border-radius: 999px; padding: 6px 12px 6px 6px; font: inherit; font-size: .85rem; cursor: pointer; max-width: 200px; }
.userbtn .av { width: 28px; height: 28px; border-radius: 50%; background: var(--gold); color: #1b1300; display: grid; place-items: center; font-weight: 700; font-size: .8rem; flex: none; }
.userbtn span.n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#shell { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--top) 1fr; min-height: 100vh; }
#sidenav { display: none; }
main { min-width: 0; padding: 18px 16px calc(var(--tab) + 28px + env(safe-area-inset-bottom)); max-width: 1100px; width: 100%; margin: 0 auto; outline: none; }
#tabbar { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 14px rgba(0,0,0,.06); }
#tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--tab); padding: 6px 2px; color: var(--ink-2);
  text-decoration: none; font-size: .68rem; font-weight: 600; }
#tabbar a svg { width: 22px; height: 22px; }
#tabbar a[aria-current="page"] { color: var(--navy); } #tabbar a[aria-current="page"] svg { color: var(--gold); }
@media (prefers-color-scheme: dark) { #tabbar a[aria-current="page"] { color: var(--gold-2); } }
@media (min-width: 900px) {
  #shell { grid-template-columns: var(--side) minmax(0, 1fr); grid-template-rows: var(--top) 1fr; }
  #topbar { grid-column: 1 / -1; }
  #sidenav { display: block; position: sticky; top: var(--top); align-self: start; height: calc(100vh - var(--top)); overflow: auto; padding: 14px 10px; border-right: 1px solid var(--line); background: var(--surface); }
  #sidenav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; }
  #sidenav a svg { width: 20px; height: 20px; color: var(--ink-2); }
  #sidenav a:hover { background: var(--surface-2); }
  #sidenav a[aria-current="page"] { background: var(--info-bg); color: var(--navy); } #sidenav a[aria-current="page"] svg { color: var(--gold); }
  #sidenav .sep { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); padding: 14px 12px 4px; }
  #tabbar { display: none; }
  main { padding: 28px 32px 60px; }
}

/* ---- komponen ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card + .card, .stack > * + * { margin-top: 14px; }
.stack { display: block; }
.grid { display: grid; gap: 14px; } .g2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } .g3 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .row.between { justify-content: space-between; } .grow { flex: 1; min-width: 0; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.pagehead p { margin: 0; color: var(--ink-2); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--navy); background: var(--navy);
  color: #fff; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
@media (prefers-color-scheme: dark) { .btn { color: #07121e; } }
.btn:hover { filter: brightness(1.08); } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.gold { background: var(--gold-2); border-color: var(--gold); color: #1b1300; }
.btn.ghost { background: transparent; color: var(--navy); border-color: var(--line); } @media (prefers-color-scheme: dark) { .btn.ghost { color: var(--ink); } }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: .85rem; border-radius: 9px; } .btn.block { width: 100%; }
.btn svg { width: 18px; height: 18px; }
.btn.big { min-height: 64px; font-size: 1.15rem; border-radius: 16px; }
label.f { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 12px; } label.f small { font-weight: 400; display: block; }
input, select, textarea { width: 100%; min-height: 44px; padding: 9px 12px; margin-top: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; }
textarea { min-height: 90px; resize: vertical; } input[type=checkbox] { width: auto; min-height: 0; margin: 0 8px 0 0; }
input[type=file] { padding: 8px; }
.chip, .badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 10px; font-size: .76rem; font-weight: 700; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.warn { background: var(--warn-bg); color: var(--warn); } .badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--navy); } .badge.gold { background: #f6e8b9; color: #6b4b00; } .badge.purple { background: #ece3fa; color: var(--purple); }
button.chip { border: 1px solid var(--line); cursor: pointer; font: inherit; font-size: .85rem; padding: 6px 14px; min-height: 36px; background: var(--surface); color: var(--ink); }
button.chip[aria-pressed="true"], button.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); } @media (prefers-color-scheme: dark) { button.chip[aria-pressed="true"], button.chip.on { color: #07121e; } }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; } .chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 -16px 16px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
.tabs button { flex: none; background: none; border: none; border-bottom: 3px solid transparent; padding: 10px 14px; font: inherit; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--navy); border-color: var(--gold); } @media (prefers-color-scheme: dark) { .tabs button[aria-selected="true"] { color: var(--gold-2); } }
.notice { padding: 12px 14px; border-radius: 12px; background: var(--info-bg); border: 1px solid transparent; margin-bottom: 14px; display: flex; gap: 10px; }
.notice.warn { background: var(--warn-bg); color: var(--warn); } .notice.bad { background: var(--bad-bg); color: var(--bad); } .notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.empty { text-align: center; padding: 32px 12px; color: var(--ink-2); }
.loading { padding: 40px; text-align: center; color: var(--ink-2); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; } th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); background: var(--surface-2); position: sticky; top: 0; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .92rem; } .kv dt { color: var(--ink-2); } .kv dd { margin: 0; font-weight: 600; }
.stat { text-align: left; } .stat .v { font-family: var(--serif); font-size: 2rem; line-height: 1; font-weight: 700; } .stat .l { color: var(--ink-2); font-size: .85rem; margin-top: 4px; }
.bar { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; } .bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--sea), var(--gold)); border-radius: 99px; }
.list { list-style: none; margin: 0; padding: 0; } .list > li { padding: 12px 0; border-bottom: 1px solid var(--line); } .list > li:last-child { border: 0; }
.ico { width: 20px; height: 20px; flex: none; vertical-align: -4px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; color: var(--navy); flex: none; }

/* ---- hero & jadwal ---- */
.hero { position: relative; overflow: hidden; border-radius: 20px; padding: 28px 22px; color: #fff; background:
  radial-gradient(1200px 300px at 80% -20%, rgba(230,194,90,.35), transparent 60%), linear-gradient(135deg, #0e2a47, #174c7e 60%, #1f6fb2); box-shadow: var(--shadow); }
.hero h1 { color: #fff; margin-bottom: .3rem; } .hero p { color: #dbe8f5; max-width: 60ch; } .hero .eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; color: var(--gold-2); font-weight: 700; }
.hero::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 220px; height: 220px; border-radius: 50%; border: 18px solid rgba(230,194,90,.22); }
.countdown { display: flex; gap: 10px; margin: 16px 0; flex-wrap: wrap; } .countdown div { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); border-radius: 12px; padding: 8px 14px; min-width: 64px; text-align: center; }
.countdown b { display: block; font-family: var(--serif); font-size: 1.6rem; line-height: 1.1; } .countdown span { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #cfe0f1; }
.timeline { position: relative; margin: 0; padding: 0; list-style: none; }
.timeline li { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.timeline .t { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--navy); font-size: .9rem; } @media (prefers-color-scheme: dark) { .timeline .t { color: var(--gold-2); } }
.timeline .w { color: var(--ink-2); font-size: .82rem; }
.timeline li.now { background: linear-gradient(90deg, #fff6d8, transparent); margin: 0 -10px; padding: 10px; border-radius: 10px; border-left: 4px solid var(--gold); }
@media (prefers-color-scheme: dark) { .timeline li.now { background: linear-gradient(90deg, #3a2d0c, transparent); } }
.pill-now { background: var(--gold); color: #1b1300; border-radius: 99px; padding: 1px 8px; font-size: .68rem; font-weight: 800; margin-left: 6px; }

/* ---- liturgi ---- */
.liturgi { font-family: var(--serif); font-size: 1.05rem; max-width: 70ch; }
.liturgi p { margin: 0 0 .6rem; } .liturgi .hd { font-family: var(--sans); font-weight: 800; letter-spacing: .06em; font-size: .8rem; color: var(--gold); margin-top: 1.2rem; text-transform: uppercase; }
.liturgi .lb { font-family: var(--sans); font-weight: 800; color: var(--navy); } @media (prefers-color-scheme: dark) { .liturgi .lb { color: var(--gold-2); } }
.verse { border-left: 4px solid var(--gold); padding: 6px 14px; background: var(--surface-2); border-radius: 0 10px 10px 0; margin: 10px 0; }

/* ---- peta ---- */
#map, .minimap { height: 62vh; min-height: 380px; border-radius: var(--radius); border: 1px solid var(--line); z-index: 1; } .minimap { height: 300px; min-height: 0; }
.schema { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.schema svg { display: block; width: 100%; min-width: 760px; height: auto; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: .8rem; color: var(--ink-2); margin-top: 8px; } .legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
svg .poi { cursor: pointer; } svg .poi:hover rect, svg .poi:focus rect { stroke-width: 3; } svg text { font-family: var(--sans); }

/* ---- kartu ID ---- */
.idcard { width: min(100%, 380px); margin: 0 auto; border-radius: 20px; overflow: hidden; background: #fff; color: #15202d; box-shadow: 0 10px 40px rgba(14,42,71,.25); border: 1px solid #e1dccd; }
.idcard .top { background: linear-gradient(135deg, #0e2a47, #1f6fb2); color: #fff; padding: 16px 18px; display: flex; gap: 12px; align-items: center; }
.idcard .top small { color: #cfe0f1; display: block; line-height: 1.2; } .idcard .top strong { font-family: var(--serif); font-size: 1.1rem; line-height: 1.15; display: block; }
.idcard .gold-bar { height: 6px; background: linear-gradient(90deg, #b98a14, #e6c25a, #b98a14); }
.idcard .body { padding: 18px; text-align: center; } .idcard .nm { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; line-height: 1.2; margin-top: 10px; }
.idcard .jb { color: #4b5766; font-size: .9rem; margin: 2px 0 10px; } .idcard .qr { background: #fff; padding: 10px; display: inline-block; border: 1px solid #e1dccd; border-radius: 12px; }
.idcard .qr svg, .idcard .qr img { width: 190px; height: 190px; display: block; } .idcard .kd { font: 700 1.1rem/1 ui-monospace, Menlo, monospace; letter-spacing: .12em; margin-top: 8px; }
.idcard .meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; text-align: left; margin-top: 14px; font-size: .8rem; } .idcard .meta div { background: #f6f4ef; border-radius: 10px; padding: 8px 10px; }
.idcard .meta b { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #4b5766; }
.idcard .foot { background: #0e2a47; color: #cfe0f1; font-size: .7rem; text-align: center; padding: 8px; }

/* ---- modal & toast ---- */
#modal-root:empty { display: none; }
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(8,16,26,.55); display: grid; place-items: end center; padding: 0; }
.sheet { background: var(--surface); width: min(640px, 100%); max-height: 92vh; overflow: auto; border-radius: 22px 22px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0,0,0,.3); }
.sheet .sh { display: flex; justify-content: space-between; align-items: start; gap: 10px; margin-bottom: 10px; } .sheet .x { background: var(--surface-2); border: 0; border-radius: 50%; width: 36px; height: 36px; font-size: 1.2rem; cursor: pointer; color: var(--ink); }
@media (min-width: 700px) { .scrim { place-items: center; padding: 20px; } .sheet { border-radius: 20px; } }
#toasts { position: fixed; z-index: 80; left: 12px; right: 12px; bottom: calc(var(--tab) + 14px + env(safe-area-inset-bottom)); display: grid; gap: 8px; pointer-events: none; justify-items: center; }
@media (min-width: 900px) { #toasts { bottom: 20px; } }
.toast { background: var(--navy-2); color: #fff; padding: 12px 16px; border-radius: 12px; max-width: 560px; box-shadow: 0 8px 30px rgba(0,0,0,.3); pointer-events: auto; font-size: .92rem; }
.toast.ok { background: #14643c; } .toast.bad { background: #9c1f18; }
.scanbox { position: relative; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 4/3; max-width: 480px; } .scanbox video { width: 100%; height: 100%; object-fit: cover; }
.scanbox::after { content: ""; position: absolute; inset: 18%; border: 3px solid var(--gold-2); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.pulse { animation: pulse 1.6s infinite; } @keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(230,194,90,.6); } 50% { box-shadow: 0 0 0 14px rgba(230,194,90,0); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; scroll-behavior: auto !important; } }

/* ---- cetak ---- */
@media print {
  #topbar, #sidenav, #tabbar, .noprint, #toasts { display: none !important; } body { background: #fff; } main { padding: 0; max-width: none; }
  .idcard { box-shadow: none; break-inside: avoid; } #shell { display: block; }
}

/* ---- penanda peta ---- */
.mk-wrap { background: none; border: 0; }
.mk { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 3px solid #fff; color: #fff; font: 700 12px/1 var(--sans); box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.leaflet-container { font-family: var(--sans); }

/* ---- ponsel ---- */
@media (max-width: 560px) {
  .userbtn { padding: 4px; } .userbtn span.n { display: none; }
  .brand-text small { display: none; } .brand-text strong { font-size: 1rem; }
  .timeline li { grid-template-columns: 74px 1fr; }
  .hero { padding: 22px 18px; }
  .countdown div { min-width: 0; flex: 1; padding: 8px 6px; }
  .sheet { padding-left: 14px; padding-right: 14px; }
}
