/* Simpul — ISP billing & RADIUS. Single stylesheet, no build step. */
:root {
  --paper: #F3F5F7;
  --surface: #FFFFFF;
  --sunken: #EBEEF2;
  --ink: #141B24;
  --ink-2: #3A4552;
  --muted: #66707C;
  --line: #E1E5EA;
  --line-strong: #CBD2DA;
  --accent: #2446C7;
  --accent-ink: #FFFFFF;
  --accent-soft: #E8EDFC;
  --beam: #E8B422;
  --beam-glow: rgba(232, 180, 34, .45);
  --ok: #1E8E5A;   --ok-soft: #E3F4EB;
  --warn: #B87A06; --warn-soft: #FBF0D9;
  --bad: #C8382E;  --bad-soft: #FBE6E4;
  --idle: #7A8490; --idle-soft: #ECEFF2;
  --r-panel: 14px;
  --r-ctl: 9px;
  --r-pill: 999px;
  --shadow-pop: 0 12px 32px rgba(20, 27, 36, .14), 0 2px 6px rgba(20, 27, 36, .06);
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --side-w: 236px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0F141A; --surface: #161C24; --sunken: #1C232D; --ink: #E8ECF1; --ink-2: #C3CBD5; --muted: #8A95A3;
    --line: #252E39; --line-strong: #344050; --accent: #7C9BFF; --accent-ink: #0F141A; --accent-soft: #1D2742;
    --ok: #4CC38A; --ok-soft: #13291F; --warn: #E3AE43; --warn-soft: #2E2410; --bad: #F07067; --bad-soft: #321716;
    --idle: #8A95A3; --idle-soft: #1E252E; --shadow-pop: 0 12px 32px rgba(0,0,0,.5); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0F141A; --surface: #161C24; --sunken: #1C232D; --ink: #E8ECF1; --ink-2: #C3CBD5; --muted: #8A95A3;
  --line: #252E39; --line-strong: #344050; --accent: #7C9BFF; --accent-ink: #0F141A; --accent-soft: #1D2742;
  --ok: #4CC38A; --ok-soft: #13291F; --warn: #E3AE43; --warn-soft: #2E2410; --bad: #F07067; --bad-soft: #321716;
  --idle: #8A95A3; --idle-soft: #1E252E; --shadow-pop: 0 12px 32px rgba(0,0,0,.5); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font);
  font-size: 14.5px; line-height: 1.55; font-feature-settings: "tnum" 1, "cv11" 1;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.05rem; font-weight: 650; }
h3 { font-size: .95rem; font-weight: 650; }
p { margin: 0 0 .75em; }
small, .muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Admin shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 22px 14px 18px;
  display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--line); background: var(--paper);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 10px 18px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-name { font-weight: 700; font-size: 1.02rem; letter-spacing: -0.01em; line-height: 1.15; }
.brand-name small { display: block; font-weight: 500; font-size: .74rem; color: var(--muted); letter-spacing: 0; }
.nav-group { margin-top: 14px; padding: 0 10px 4px; font-size: .74rem; color: var(--muted); font-weight: 600; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--r-ctl);
  color: var(--ink-2); font-weight: 520;
}
.nav a:hover { background: var(--sunken); text-decoration: none; color: var(--ink); }
.nav a.on { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.nav a.on svg { color: var(--accent); }
.nav a .count { margin-left: auto; font-size: .74rem; background: var(--bad-soft); color: var(--bad); padding: 0 7px; border-radius: var(--r-pill); font-weight: 650; }
.side-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: .82rem; flex: none; }
.side-foot .who { line-height: 1.2; min-width: 0; }
.side-foot .who b { display: block; font-size: .86rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who span { font-size: .76rem; color: var(--muted); }
.side-foot form { margin-left: auto; }

.main { min-width: 0; padding: 26px 34px 60px; max-width: 1320px; width: 100%; }
.mobilebar { display: none; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .lede { color: var(--muted); margin: 4px 0 0; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { font-size: .82rem; color: var(--muted); margin-bottom: 6px; display: inline-flex; gap: 6px; align-items: center; }
.crumb a { color: var(--muted); }

/* ---------- Surfaces ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); }
.panel + .panel, .panel + .grid, .grid + .panel, .grid + .grid { margin-top: 18px; }
.grid > .panel, .grid > * { margin-top: 0; }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head .sub { color: var(--muted); font-size: .84rem; }
.panel-head .end { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.panel-body { padding: 18px 20px; }
.panel-foot { padding: 12px 20px; border-top: 1px solid var(--line); }
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.g-side { grid-template-columns: minmax(0, 1fr) 340px; }
.stack > * + * { margin-top: 18px; }

/* Stat strip: one surface, divided cells */
.strip { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); }
.strip > div { padding: 18px 20px; min-width: 0; }
.strip > div + div { border-left: 1px solid var(--line); }
.strip .label { font-size: .82rem; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.strip .value { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; line-height: 1.2; }
.strip .value small { font-size: .85rem; font-weight: 500; letter-spacing: 0; }
.strip .hint { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--idle); flex: none; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); } .dot.accent { background: var(--accent); }
.dot.live { box-shadow: 0 0 0 0 rgba(30,142,90,.5); animation: live 2.4s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 7px rgba(30,142,90,0); } 100% { box-shadow: 0 0 0 0 rgba(30,142,90,0); } }

/* ---------- Tables ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 600; font-size: .8rem; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: color-mix(in srgb, var(--sunken) 55%, transparent); }
.tbl th:first-child, .tbl td:first-child { padding-left: 20px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 20px; }
.tbl .r { text-align: right; }
.tbl .who b { display: block; font-weight: 600; color: var(--ink); }
.tbl .who span { font-size: .8rem; color: var(--muted); }
.tbl a.row-link { color: inherit; }
.tbl a.row-link:hover b { color: var(--accent); }

/* ---------- Pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--r-pill); font-size: .78rem; font-weight: 600; white-space: nowrap; background: var(--idle-soft); color: var(--idle); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.plain::before { display: none; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--sunken); color: var(--ink-2); font-size: .78rem; font-weight: 550; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 15px;
  border-radius: var(--r-ctl); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 600; font-size: .88rem; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--sunken); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--sunken); }
.btn.sm { height: 31px; padding: 0 11px; font-size: .82rem; }
.btn.block { width: 100%; }
.btn.icon { width: 38px; padding: 0; }
.btn.sm.icon { width: 31px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn svg.i { width: 16px; height: 16px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-section + .form-section { border-top: 1px solid var(--line); }
.form-section { padding: 20px; display: grid; grid-template-columns: 220px 1fr; gap: 24px; }
.form-section > header h3 { margin-bottom: 4px; }
.form-section > header p { color: var(--muted); font-size: .85rem; margin: 0; }
.field label, .label-text { display: block; font-size: .84rem; font-weight: 600; margin-bottom: 6px; color: var(--ink-2); }
.field .help { font-size: .78rem; color: var(--muted); margin-top: 5px; }
.field .err { font-size: .8rem; color: var(--bad); margin-top: 5px; }
.input, select.input, textarea.input {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-ctl);
  background: var(--surface); color: var(--ink); font: inherit; font-size: .92rem; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select.input { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2366707C' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.is-invalid { border-color: var(--bad); }
.input-group { display: flex; }
.input-group .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; height: 40px; }
.input-affix { position: relative; }
.input-affix > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .9rem; pointer-events: none; }
.input-affix .input { padding-left: 38px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: .9rem; }
.check input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.check small { display: block; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.toolbar .input { height: 36px; width: auto; }
.toolbar .search { flex: 1 1 240px; max-width: 360px; }
.toolbar .btn { height: 36px; }
.seg { display: inline-flex; background: var(--sunken); border-radius: var(--r-ctl); padding: 3px; gap: 2px; }
.seg a { padding: 5px 12px; border-radius: 7px; color: var(--ink-2); font-size: .84rem; font-weight: 560; white-space: nowrap; }
.seg a:hover { text-decoration: none; color: var(--ink); }
.seg a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(20,27,36,.08); }
.seg a .n { color: var(--muted); margin-left: 4px; font-weight: 500; }

/* ---------- Key/value ---------- */
.kv { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; margin: 0; }
.kv dt, .kv dd { padding: 9px 0; border-bottom: 1px solid var(--line); margin: 0; }
.kv dt { color: var(--muted); font-size: .86rem; }
.kv dd { font-weight: 550; min-width: 0; overflow-wrap: anywhere; }
.kv > :nth-last-child(-n+2) { border-bottom: 0; }
.mono { font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace; font-size: .86em; font-weight: 450; letter-spacing: 0; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 12px; overflow-x: auto; }
.tabs a { padding: 13px 10px; color: var(--muted); font-weight: 580; font-size: .9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------- Flash / empty ---------- */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r-ctl); margin-bottom: 18px; font-weight: 520; border: 1px solid; }
.flash.ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.flash.bad { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.flash.info { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.flash ul { margin: 0; padding-left: 18px; }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.empty .btn { margin-top: 12px; }

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .grow b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .grow span { font-size: .8rem; color: var(--muted); }

/* ---------- Charts (server-rendered SVG) ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .bar { fill: var(--accent); }
.chart .bar.alt { fill: color-mix(in srgb, var(--accent) 35%, var(--surface)); }
.chart .bar.neg { fill: color-mix(in srgb, var(--bad) 70%, var(--surface)); }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.chart .area { fill: var(--accent-soft); }
.chart .zone-good { fill: var(--ok-soft); } .chart .zone-warn { fill: var(--warn-soft); } .chart .zone-bad { fill: var(--bad-soft); }
.legend { display: flex; gap: 16px; font-size: .8rem; color: var(--muted); margin-top: 8px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); }
.legend i.alt { background: color-mix(in srgb, var(--accent) 35%, var(--surface)); }

/* ---------- Light meter (signature) ---------- */
.lm { --pos: 50%; }
.lm-read { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.lm-value { font-size: 2.6rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.lm-value small { font-size: 1rem; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.lm-track { position: relative; height: 10px; border-radius: var(--r-pill); margin: 26px 0 8px; display: flex; overflow: visible; }
.lm-track > i { display: block; height: 100%; }
.lm-track > i:first-child { border-radius: var(--r-pill) 0 0 var(--r-pill); }
.lm-track > i:last-of-type { border-radius: 0 var(--r-pill) var(--r-pill) 0; }
.lm-track .z-bad { background: color-mix(in srgb, var(--bad) 30%, var(--surface)); }
.lm-track .z-warn { background: color-mix(in srgb, var(--warn) 32%, var(--surface)); }
.lm-track .z-good { background: color-mix(in srgb, var(--ok) 30%, var(--surface)); }
.lm-track .z-high { background: color-mix(in srgb, var(--warn) 32%, var(--surface)); }
.lm-beam {
  position: absolute; top: 50%; left: var(--pos); width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%;
  background: var(--beam); border: 3px solid var(--surface); box-shadow: 0 0 0 1px rgba(0,0,0,.08), 0 0 18px 6px var(--beam-glow);
}
.lm-beam::after { content: ""; position: absolute; left: 50%; bottom: 100%; width: 2px; height: 14px; margin-left: -1px; background: linear-gradient(var(--beam), transparent); transform: rotate(180deg); }
.lm.unknown .lm-beam { display: none; }
.lm-scale { display: flex; justify-content: space-between; font-size: .74rem; color: var(--muted); }
.lm-note { font-size: .85rem; color: var(--muted); margin-top: 12px; }
@media (prefers-reduced-motion: no-preference) {
  .lm-beam { animation: beam-in .9s cubic-bezier(.2,.8,.2,1) both; }
  @keyframes beam-in { from { left: 0; opacity: 0; } to { left: var(--pos); opacity: 1; } }
}
.signal { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.signal.good { color: var(--ok); } .signal.warn { color: var(--warn); } .signal.bad { color: var(--bad); } .signal.high { color: var(--warn); } .signal.unknown { color: var(--muted); font-weight: 500; }

/* ---------- Usage meter ---------- */
.qbar { height: 8px; border-radius: var(--r-pill); background: var(--sunken); overflow: hidden; margin: 10px 0 6px; }
.qbar > i { display: block; height: 100%; background: var(--accent); border-radius: var(--r-pill); }
.qbar.over > i { background: var(--warn); }

/* ---------- Dialog ---------- */
dialog.modal { border: 0; padding: 0; border-radius: 16px; width: min(520px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop); }
dialog.modal::backdrop { background: rgba(15, 20, 26, .45); }
dialog.modal header { padding: 18px 20px 0; display: flex; align-items: center; }
dialog.modal header .btn { margin-left: auto; }
dialog.modal .body { padding: 16px 20px; }
dialog.modal footer { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
@media (prefers-reduced-motion: no-preference) {
  dialog.modal[open] { animation: pop .18s ease-out; }
  @keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
}

/* ---------- Menu ---------- */
details.menu { position: relative; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu .menu-list { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 6px; z-index: 30; }
.menu-list a, .menu-list button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; color: var(--ink); background: none; border: 0; font: inherit; font-size: .88rem; text-align: left; cursor: pointer; }
.menu-list a:hover, .menu-list button:hover { background: var(--sunken); text-decoration: none; }
.menu-list .danger { color: var(--bad); }
.menu-list hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

/* ---------- Pagination ---------- */
.pager { display: flex; gap: 6px; align-items: center; justify-content: space-between; padding: 12px 20px; border-top: 1px solid var(--line); font-size: .84rem; color: var(--muted); }
.pager .btn-row { gap: 4px; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: #121A33; color: #E6EBFF; padding: 44px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.auth-side .brand { color: #fff; padding: 0; }
.auth-side .brand-name small { color: #9FB0E6; }
.auth-side h2 { font-size: 2rem; font-weight: 700; letter-spacing: -0.025em; max-width: 14ch; margin-top: auto; line-height: 1.15; color: #fff; }
.auth-side p { color: #A9B6DF; max-width: 40ch; margin-top: 14px; }
.auth-side svg.fiber { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .9; }
.auth-side > *:not(svg) { position: relative; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.auth-card { width: 100%; max-width: 360px; }
.auth-card h1 { font-size: 1.5rem; margin-bottom: 6px; }
.auth-card .lede { color: var(--muted); margin-bottom: 26px; }
.auth-card .field + .field { margin-top: 14px; }

/* ---------- Portal ---------- */
.portal { min-height: 100vh; }
.p-top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.p-top-in { max-width: 980px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 22px; }
.p-top .brand { padding: 0; }
.p-nav { display: flex; gap: 4px; }
.p-nav a { padding: 7px 12px; border-radius: var(--r-ctl); color: var(--ink-2); font-weight: 560; font-size: .9rem; display: inline-flex; gap: 8px; align-items: center; }
.p-nav a:hover { background: var(--sunken); text-decoration: none; }
.p-nav a.on { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.p-top .end { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.p-main { max-width: 980px; margin: 0 auto; padding: 26px 20px 100px; }
.p-hello { margin-bottom: 22px; }
.p-hello h1 { font-size: 1.75rem; }
.p-hello p { color: var(--muted); margin: 6px 0 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bill { padding: 22px; display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; }
.bill .amount { font-size: 2.3rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; margin: 4px 0 6px; }
.bill.clear .amount { font-size: 1.5rem; }
.bill .meta { color: var(--muted); font-size: .88rem; }
.payinfo { background: var(--sunken); border-radius: 12px; padding: 14px 16px; font-size: .88rem; white-space: pre-line; }
.p-bottom { display: none; }

/* ---------- Map ---------- */
#map { height: calc(100vh - 170px); min-height: 460px; border-radius: var(--r-panel); border: 1px solid var(--line); z-index: 1; }
.map-pin { width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.map-odp { width: 18px; height: 18px; border-radius: 5px; background: var(--ink); border: 2.5px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); }

/* ---------- Print ---------- */
.invoice-doc { max-width: 760px; margin: 0 auto; background: #fff; color: #141B24; padding: 44px; border-radius: var(--r-panel); border: 1px solid var(--line); }
.invoice-doc table { width: 100%; border-collapse: collapse; margin: 24px 0; }
.invoice-doc th, .invoice-doc td { padding: 10px 0; border-bottom: 1px solid #E1E5EA; text-align: left; }
.invoice-doc .r { text-align: right; }
@media print {
  body { background: #fff; }
  .no-print, .side, .p-top, .p-bottom, .mobilebar { display: none !important; }
  .shell { display: block; } .main, .p-main { padding: 0; max-width: none; }
  .invoice-doc { border: 0; padding: 0; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .g-main, .g-side { grid-template-columns: 1fr; }
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip > div:nth-child(3) { border-left: 0; }
  .strip > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 860px) {
  .shell { display: block; }
  .side { position: fixed; z-index: 50; left: 0; top: 0; width: 270px; transform: translateX(-100%); transition: transform .2s; background: var(--paper); box-shadow: var(--shadow-pop); }
  body.nav-open .side { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(15,20,26,.4); z-index: 40; }
  .mobilebar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 30; }
  .main { padding: 20px 16px 60px; }
  .g-2, .g-3, .form-grid { grid-template-columns: 1fr; }
  .form-section { grid-template-columns: 1fr; gap: 14px; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .page-head .actions { margin-left: 0; }
  h1 { font-size: 1.4rem; }
  .p-nav { display: none; }
  .p-bottom { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .p-bottom a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; font-size: .7rem; font-weight: 600; color: var(--muted); border-radius: 10px; }
  .p-bottom a.on { color: var(--accent); }
  .p-bottom a:hover { text-decoration: none; }
  .p-main { padding: 20px 16px 96px; }
  .bill { grid-template-columns: 1fr; }
  .lm-value { font-size: 2.2rem; }
}
@media (max-width: 520px) {
  .strip { grid-template-columns: 1fr 1fr; }
  .strip .value { font-size: 1.3rem; }
  .strip > div { padding: 14px 16px; }
  .tbl .hide-sm { display: none; }
}
