/* RTTM: same layout system as the Rona Water admin, with its own night-sky palette. */
:root {
  --bg: #f4f5fb; --surface: #ffffff; --fg: #141a33; --muted: #5b6382; --line: #dfe2f0;
  --brand: #3b4bc8; --brand-soft: #e7e9fb; --gold: #b7860b; --ok: #0f7a52; --bad: #c2410c; --bad-soft: #fde7dc;
  --shadow: 0 8px 24px rgba(20, 26, 51, .08); --on-brand: #fff;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1024; --surface: #131a36; --fg: #e8ebfa; --muted: #9aa3c7; --line: #25305a;
    --brand: #8f9bff; --brand-soft: #1d2650; --gold: #f4c95d; --ok: #6fdcaa; --bad: #f59a7a; --bad-soft: #3b1e15;
    --shadow: none; --on-brand: #0b1024; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1024; --surface: #131a36; --fg: #e8ebfa; --muted: #9aa3c7; --line: #25305a;
  --brand: #8f9bff; --brand-soft: #1d2650; --gold: #f4c95d; --ok: #6fdcaa; --bad: #f59a7a; --bad-soft: #3b1e15;
  --shadow: none; --on-brand: #0b1024; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 14px/1.5 "Plus Jakarta Sans", system-ui, sans-serif; -webkit-text-size-adjust: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.boot { padding: 40px; text-align: center; color: var(--muted); }

.brandrow { display: flex; align-items: center; gap: 10px; }
.logo { width: 36px; height: 36px; border-radius: 10px; flex: none; }
.brandrow b { display: block; font-size: 14px; }
.brandrow span { font-size: 11.5px; color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 0 16px; height: 42px; font-weight: 700; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn:focus-visible, .iconbtn:focus-visible, .nav button:focus-visible, .tabs button:focus-visible, input:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
input { height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: var(--bg); font-size: 15px; color: var(--fg); width: 100%; }
.err { color: var(--bad); font-size: 13px; margin: 0; }
.err:empty, .ok:empty { display: none; }

.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.authcard { width: min(380px, 100%); padding: 24px; display: grid; gap: 14px; }
.authcard h1 { font-size: 20px; margin: 6px 0 0; }

.app { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px; position: sticky; top: 0; height: 100vh; }
.side .brandrow { padding: 0 6px 16px; }
.nav { display: grid; gap: 2px; }
.nav button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 10px; font-weight: 600; color: var(--muted); }
.nav button svg, .tabs button svg, .iconbtn svg { width: 20px; height: 20px; flex: none; }
.nav button[aria-current="page"] { background: var(--brand-soft); color: var(--brand); }
.mainwrap { min-width: 0; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 0; }
.top h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; }
.top p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.topbtns { display: flex; gap: 8px; }
.iconbtn { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; color: var(--muted); }
main { padding: 16px 24px 40px; }
.tabs { display: none; }

.soon { padding: 28px 20px; text-align: center; display: grid; gap: 6px; justify-items: center; }
.soon svg { width: 40px; height: 40px; color: var(--gold); }
.soon b { font-size: 16px; }
.soon p { margin: 0; color: var(--muted); max-width: 36ch; }
.soon small { color: var(--muted); font-size: 12px; }
.acct { padding: 20px; display: grid; gap: 14px; max-width: 420px; }
.acct h2 { margin: 0; font-size: 16px; }
.ok { color: var(--ok); font-size: 13px; margin: 0; }

@media (max-width: 767px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .top { padding: 16px 16px 0; }
  .top h1 { font-size: 20px; }
  main { padding: 12px 16px calc(84px + env(safe-area-inset-bottom)); }
  .tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 10; }
  .tabs button { border: 0; background: none; display: grid; justify-items: center; gap: 2px; padding: 6px 0; font-size: 11px; font-weight: 600; color: var(--muted); border-radius: 10px; min-width: 0; }
  .tabs button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tabs button[aria-current="page"] { color: var(--brand); background: var(--brand-soft); }
}
