:root {
  --bg: #f5f7f6;
  --surface: #ffffff;
  --text: #1b1f1d;
  --muted: #5b6660;
  --primary: #0f5132;
  --primary-text: #ffffff;
  --border: #d5ddd8;
  --danger: #b42318;
  --ok: #067647;
  --focus: #f59e0b;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111513; --surface: #1a201d; --text: #e7ece9; --muted: #a3afa8;
    --primary: #3fae7a; --primary-text: #0b1210; --border: #2d3631; --danger: #f97066; --ok: #47cd89;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--primary); }
code { background: var(--border); padding: 0 4px; border-radius: 4px; }
.wrap { max-width: 960px; margin: 0 auto; padding: 16px; }
.narrow { max-width: 480px; }
.brand { text-align: center; margin: 24px 0; }
.brand h1 { margin: 0; font-size: 2.25rem; letter-spacing: .08em; color: var(--primary); }
.brand p { margin: 4px 0 0; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin: 12px 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }
label { font-weight: 600; font-size: .95rem; }
input, select { font: inherit; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); width: 100%; min-height: 44px; }
button, .button { font: inherit; font-weight: 600; min-height: 44px; padding: 10px 16px; border-radius: 8px; border: 1px solid var(--primary); background: var(--primary); color: var(--primary-text); cursor: pointer; text-align: center; text-decoration: none; display: inline-block; }
button.secondary, .button.secondary { background: transparent; color: var(--primary); }
button:disabled { opacity: .6; cursor: progress; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.msg { min-height: 1.5em; margin: 0; }
.msg.error { color: var(--danger); }
.msg.ok { color: var(--ok); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 8px 16px; background: var(--primary); color: var(--primary-text); }
.topbar-title { display: flex; flex-direction: column; line-height: 1.2; }
.topbar-title span { font-size: .85rem; opacity: .9; }
.menu-toggle { background: transparent; border-color: transparent; color: var(--primary-text); font-size: 1.4rem; padding: 4px 10px; }
.nav { display: none; background: var(--surface); border-bottom: 1px solid var(--border); }
.nav.open { display: block; }
.nav ul { list-style: none; margin: 0; padding: 8px; }
.nav li button { width: 100%; text-align: left; background: transparent; color: var(--text); border-color: transparent; }
.nav li button[aria-current="page"] { background: var(--bg); color: var(--primary); }
.nav .sep { border-top: 1px solid var(--border); margin: 6px 8px; padding-top: 6px; font-size: .75rem; font-weight: 700; color: var(--muted); letter-spacing: .06em; }
.tabs { display: flex; gap: 8px; }
.tabs button { flex: 1; background: transparent; color: var(--primary); }
.tabs button[aria-selected="true"] { background: var(--primary); color: var(--primary-text); }
@media (min-width: 900px) {
  .menu-toggle { display: none; }
  body[data-page="sekolah"] { display: grid; grid-template-columns: 240px 1fr; grid-template-rows: auto 1fr; }
  body[data-page="sekolah"] .topbar { grid-column: 1 / -1; }
  body[data-page="sekolah"] .nav { display: block; border-bottom: 0; border-right: 1px solid var(--border); min-height: calc(100vh - 56px); }
  body[data-page="sekolah"] main { margin: 0; max-width: 960px; }
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.link { background: none; border: 0; color: var(--primary); text-decoration: underline; min-height: 44px; padding: 0 8px; font-weight: 600; }
.notice { border-color: var(--primary); border-width: 2px; }
.list { list-style: none; margin: 0 0 12px; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.list li .meta { display: flex; flex-direction: column; }
.list li .meta small { color: var(--muted); }
.list li button { min-height: 40px; padding: 6px 12px; }
