/* Sistem OC Lampu Jalan — MBSP navy + crest gold. Light, dark and "Mod luar" (high contrast for sunlight). */

@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/IBMPlexSans-var.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/IBMPlexMono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/IBMPlexMono-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --bg: #eef1f6; --surface: #ffffff; --surface-2: #f4f6fa; --line: #d6dde8; --line-strong: #b5c1d2;
  --fg: #111c2e; --muted: #53627a; --brand: #0d2650; --brand-2: #183a6e; --brand-fg: #ffffff;
  --rail: #091c3d; --rail-fg: #e8eef8; --gold: #e3b10b; --gold-ink: #3a2c00; --gold-soft: #fdf3cf;
  --accent: #1a4a8f; --accent-strong: #123a73; --accent-soft: #e2ebf8; --accent-fg: #ffffff;
  --ok: #16803c; --ok-soft: #ddf3e4; --bad: #c0352b; --bad-soft: #fbe4e1; --warn: #a35f05; --warn-soft: #fdf0d5;
  --info: #2457a6; --info-soft: #e1ebfa; --mute-soft: #e7ebf2;
  --shadow: 0 1px 2px rgba(13, 38, 80, .06), 0 4px 14px rgba(13, 38, 80, .07);
  --f-ui: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --r: 10px; --fs: 15px; --bw: 1px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #08111f; --surface: #0f1b2e; --surface-2: #14233a; --line: #22344f; --line-strong: #35507a;
  --fg: #e4ebf5; --muted: #97a6bd; --brand: #071530; --brand-2: #10264a; --brand-fg: #eef3fb;
  --rail: #050f22; --rail-fg: #dfe7f5; --gold: #f2c230; --gold-ink: #2b2000; --gold-soft: #3a2f0a;
  --accent: #6f9fe6; --accent-strong: #8db4ee; --accent-soft: #16294a; --accent-fg: #06142b;
  --ok: #4cc277; --ok-soft: #123222; --bad: #f07b70; --bad-soft: #3a1714; --warn: #e7a948; --warn-soft: #3a2a0d;
  --info: #7ea8ef; --info-soft: #152844; --mute-soft: #1b2a40;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25); color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #08111f; --surface: #0f1b2e; --surface-2: #14233a; --line: #22344f; --line-strong: #35507a;
  --fg: #e4ebf5; --muted: #97a6bd; --brand: #071530; --brand-2: #10264a; --brand-fg: #eef3fb;
  --rail: #050f22; --rail-fg: #dfe7f5; --gold: #f2c230; --gold-ink: #2b2000; --gold-soft: #3a2f0a;
  --accent: #6f9fe6; --accent-strong: #8db4ee; --accent-soft: #16294a; --accent-fg: #06142b;
  --ok: #4cc277; --ok-soft: #123222; --bad: #f07b70; --bad-soft: #3a1714; --warn: #e7a948; --warn-soft: #3a2a0d;
  --info: #7ea8ef; --info-soft: #152844; --mute-soft: #1b2a40;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25); color-scheme: dark; }
:root[data-outdoor][data-outdoor]:not(#x) {
  --bg: #ffffff; --surface: #ffffff; --surface-2: #f1f3f7; --line: #7d8aa0; --line-strong: #3c4a63;
  --fg: #000000; --muted: #24324a; --brand: #0a1f45; --brand-2: #163866; --brand-fg: #ffffff;
  --rail: #061633; --rail-fg: #ffffff; --gold: #e3b10b; --gold-ink: #000000; --gold-soft: #fff0b3;
  --accent: #0d3a80; --accent-strong: #082a5f; --accent-soft: #d6e3f7; --accent-fg: #ffffff;
  --ok: #0b6b2c; --ok-soft: #cdeed7; --bad: #a3170c; --bad-soft: #f9d3cf; --warn: #7a4500; --warn-soft: #fde3b0;
  --info: #0d3a80; --info-soft: #d6e3f7; --mute-soft: #e2e6ee;
  --fs: 17px; --bw: 2px; --shadow: none; color-scheme: light; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--f-ui); font-size: var(--fs); line-height: 1.5; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; line-height: 1.25; }
p { margin: 0 0 12px; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .87em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- header ---------- */
.topbar { background: var(--brand); color: var(--brand-fg); border-bottom: 3px solid var(--gold); padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.topbar .brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; min-width: 0; }
.topbar .brand img { width: 42px; height: 42px; object-fit: contain; flex: none; }
.topbar .brand b { display: block; font-size: 17px; letter-spacing: .07em; text-transform: uppercase; }
.topbar .brand small { display: block; font-size: 12px; opacity: .78; }
.topbar .right { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.who { display: flex; align-items: center; gap: 8px; background: var(--brand-2); border-radius: 99px; padding: 4px 12px 4px 4px; font-size: 13px; }
.who .av { width: 28px; height: 28px; border-radius: 50%; background: var(--gold); color: var(--gold-ink); display: grid; place-items: center; font: 700 11px var(--f-mono); }
.who small { display: block; font-size: 11px; opacity: .75; line-height: 1.1; }
.themesw { display: inline-flex; border: 1px solid rgba(255, 255, 255, .3); border-radius: 99px; overflow: hidden; }
.themesw button { border: 0; background: transparent; color: inherit; font-size: 12.5px; padding: 5px 10px; cursor: pointer; }
.themesw button[aria-pressed="true"] { background: var(--gold); color: var(--gold-ink); font-weight: 700; }
.toggle { display: flex; align-items: center; gap: 8px; font-size: 12.5px; cursor: pointer; border: 1px solid rgba(255, 255, 255, .3); border-radius: 99px; padding: 5px 12px; background: transparent; color: inherit; }
.toggle .sw { width: 28px; height: 16px; border-radius: 99px; background: rgba(255, 255, 255, .3); position: relative; }
.toggle .sw::after { content: ""; position: absolute; left: 2px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: left .15s; }
.toggle[aria-pressed="true"] .sw { background: var(--gold); }
.toggle[aria-pressed="true"] .sw::after { left: 14px; }
.linkbtn { background: none; border: 1px solid rgba(255, 255, 255, .3); color: inherit; border-radius: 99px; padding: 5px 12px; font-size: 12.5px; cursor: pointer; }
.rail { background: var(--rail); padding-block: 8px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: flex; gap: 8px; overflow-x: auto; }
.rail a { color: var(--rail-fg); text-decoration: none; border-radius: 99px; padding: 7px 14px; font-size: 13.5px; font-weight: 600; white-space: nowrap; background: rgba(255, 255, 255, .1); display: inline-flex; gap: 8px; align-items: center; }
.rail a[aria-current="page"] { background: var(--gold); color: var(--gold-ink); }
.rail .count { background: var(--bad); color: #fff; border-radius: 99px; font: 700 11px var(--f-mono); padding: 1px 7px; }

/* ---------- page ---------- */
main.page { max-width: 1280px; margin: 0 auto; padding-block: 22px 60px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.page-head { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.page-head h1 { font-size: 24px; letter-spacing: -.01em; }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 75ch; }
.crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.crumb a { color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spread { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 18px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
@media (max-width: 960px) { .split { grid-template-columns: 1fr; } }

.card { background: var(--surface); border: var(--bw) solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-h h2, .card-h h3 { font-size: 16px; }
.card-b { padding: 16px 18px; }
.card.narrow { max-width: 520px; }
.card-f { padding: 12px 18px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r) var(--r); }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 22px; margin: 0; }
.kv div { min-width: 0; }
.kv dt { font-size: 12.5px; color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: var(--bw) solid var(--line-strong); background: var(--surface); color: var(--fg); border-radius: 8px; padding: 8px 16px; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.primary:hover { background: var(--accent-strong); }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.block { width: 100%; padding: 11px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label, .label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea { border: var(--bw) solid var(--line-strong); background: var(--surface); border-radius: 8px; padding: 9px 12px; width: 100%; }
.field input[type="file"] { padding: 7px 10px; }
.field .hint { font-size: 12.5px; color: var(--muted); }
.field .err { font-size: 12.5px; color: var(--bad); font-weight: 600; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--bad); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { margin-top: 4px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-weight: 700; margin-bottom: 10px; padding: 0; }

.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; padding: 3px 10px; font-size: 12.5px; font-weight: 600; line-height: 1.35; white-space: nowrap; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.info { background: var(--info-soft); color: var(--info); }
.chip.mute { background: var(--mute-soft); color: var(--muted); }
.tag { display: inline-block; font: 600 10.5px var(--f-mono); letter-spacing: .05em; text-transform: uppercase; border-radius: 4px; padding: 1px 6px; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }

.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.alert p { margin: 2px 0 0; color: var(--fg); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert.info { background: var(--info-soft); color: var(--info); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: 10px 14px; font-weight: 600; font-size: 14px; color: var(--muted); border-bottom: 3px solid transparent; text-decoration: none; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--gold); }
.tabs a .n { font: 600 12px var(--f-mono); color: var(--muted); margin-left: 4px; }

.scroll-x { overflow-x: auto; }
table.tbl { border-collapse: collapse; width: 100%; }
.tbl th, .tbl td { border-bottom: 1px solid var(--line); padding: 10px 14px; text-align: left; vertical-align: middle; }
.tbl th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .sub { display: block; font-size: 12.5px; color: var(--muted); }
.empty { padding: 32px 18px; text-align: center; color: var(--muted); }

.secret { font: 600 18px var(--f-mono); letter-spacing: .04em; background: var(--gold-soft); color: var(--fg); border: 1px dashed var(--gold); border-radius: 8px; padding: 10px 14px; display: inline-block; user-select: all; }
.pager { display: flex; gap: 6px; justify-content: flex-end; padding: 12px 18px; flex-wrap: wrap; }

/* ---------- guest (login / register) ---------- */
.guest { min-height: 100vh; display: flex; flex-direction: column; }
.guest .topbar { justify-content: space-between; }
.guest main { flex: 1; display: flex; justify-content: center; align-items: flex-start; padding-block: 40px 60px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.guest .card { width: 100%; max-width: 440px; }
.guest .card.wide { max-width: 760px; }
.guest h1 { font-size: 22px; }
.foot-note { text-align: center; color: var(--muted); font-size: 12.5px; padding: 16px; }

[data-outdoor] .card, [data-outdoor] .btn, [data-outdoor] .field input, [data-outdoor] .field select, [data-outdoor] .field textarea { border-width: var(--bw); }
[data-outdoor] .chip, [data-outdoor] .tag { font-weight: 700; }

@media (max-width: 640px) {
  .topbar .brand small { display: none; }
  .who small { display: none; }
  .page-head h1 { font-size: 21px; }
}
.stat { font-size: 32px; font-weight: 600; letter-spacing: -.02em; margin: 2px 0; }
a.card { color: inherit; text-decoration: none; display: block; }
a.card:hover { border-color: var(--accent); }
/* Checkbox rows inside a .field: keep the box its natural size and the text readable. */
.field .check { font-size: 14px; font-weight: 400; color: var(--fg); }
.field .check input { width: auto; flex: none; padding: 0; }
a.linkbtn { text-decoration: none; display: inline-block; }
