/* TERRAPLUG5 operator dashboard: tokens match the design canvas */
:root {
  --brand: #004838; --brand-strong: #00382B; --brand-tint: #E5EFEC; --brand-soft: #A7CBBF;
  --ink: #111827; --ink-2: #374151; --muted: #4B5563; --subtle: #6B7280;
  --bg: #F6F7F9; --card: #FFFFFF; --line: #E5E7EB; --line-2: #F1F2F4; --input: #D1D5DB;
  --blue: #1D4ED8; --blue-tint: #EAF0FE; --amber: #92400E; --amber-dot: #D97706; --amber-tint: #FEF3C7;
  --red: #B42318; --red-tint: #FEE4E2; --grey-dot: #9CA3AF; --grey-tint: #EEF0F3;
  --radius: 14px;
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-strong); }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .6; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; }

.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { flex: 1 1 252px; max-width: 100%; background: var(--card); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 20px; }
.side img.wordmark { width: 196px; height: auto; display: block; margin: 6px 8px 2px; }
.nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav span { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 10px; border-radius: 8px; font-size: 14px; color: var(--ink-2); }
.nav a.on { background: var(--brand-tint); color: var(--brand-strong); font-weight: 600; }
.nav a:hover:not(.on) { background: var(--bg); color: var(--ink); }
.nav span.soon { color: var(--subtle); white-space: nowrap; }
.nav span.soon em { margin-left: auto; font-style: normal; font-size: 11px; background: var(--grey-tint); color: var(--muted); border-radius: 999px; padding: 1px 7px; }
.side .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px; border-top: 1px solid var(--line); }
.avatar { width: 32px; height: 32px; border-radius: 16px; background: var(--brand-tint); color: var(--brand); font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.main { flex: 999 1 560px; min-width: 0; padding: 24px 32px 40px; }
.wrap { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }

.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.head h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.head p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.crumbs { font-size: 13px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; min-width: 0; }
.card h2 { margin: 0; font-size: 16px; font-weight: 600; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head span { font-size: 13px; color: var(--muted); }
.card.flush { padding: 18px 0 6px; }
.card.flush .card-head { padding: 0 20px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.kpi .l { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi .v { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi .d { font-size: 12px; font-weight: 500; color: var(--muted); }
.kpi .d.bad { color: var(--red); } .kpi .d.good { color: var(--brand); }

.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.span-2 { grid-column: span 2; }
@media (max-width: 760px) { .span-2 { grid-column: auto; } .main { padding: 16px; } }

.bars { height: 200px; display: flex; align-items: flex-end; gap: 14px; border-bottom: 1px solid var(--line); padding: 0 4px; }
.bar { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.bar span { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bar div { width: 100%; max-width: 56px; border-radius: 6px 6px 0 0; background: var(--brand-soft); min-height: 2px; }
.bar.today div { background: var(--brand); }
.bar-labels { display: flex; gap: 14px; padding: 8px 4px 0; }
.bar-labels span { flex: 1 1 0; text-align: center; font-size: 12px; color: var(--subtle); }

.stack { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; margin-bottom: 16px; background: var(--line-2); }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.legend li { display: flex; align-items: center; justify-content: space-between; font-size: 14px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 10px; }

.table-box { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
th:first-child, td:first-child { padding-left: 20px; } th:last-child, td:last-child { padding-right: 20px; }
td.r, th.r { text-align: right; }
td .sub { font-size: 12px; color: var(--subtle); }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--bg); }

.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.green { background: var(--brand-tint); color: var(--brand-strong); }
.pill.blue { background: var(--blue-tint); color: var(--blue); }
.pill.amber { background: var(--amber-tint); color: var(--amber); }
.pill.red { background: var(--red-tint); color: var(--red); }
.pill.grey { background: var(--grey-tint); color: var(--ink-2); }

.alerts { list-style: none; margin: 0; padding: 0; }
.alerts li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.alerts .dot { flex: 0 0 8px; height: 8px; margin-top: 6px; border-radius: 4px; }
.alerts b { font-size: 14px; display: block; } .alerts small { font-size: 13px; color: var(--muted); }
.empty { color: var(--muted); font-size: 14px; padding: 12px 0; }

.btn { height: 40px; padding: 0 16px; border-radius: 10px; font-size: 14px; font-weight: 600; border: 1px solid var(--input); background: var(--card); color: var(--ink); }
.btn.primary { border: 0; background: var(--brand); color: #fff; }
.btn.danger { border-color: #FDA29B; color: var(--red); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; }
.seg { display: flex; background: var(--card); border: 1px solid var(--input); border-radius: 10px; padding: 3px; }
.seg button { height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); font-size: 13px; }
.seg button.on { background: var(--ink); color: #fff; font-weight: 600; }
.search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; background: var(--card); border: 1px solid var(--input); border-radius: 10px; color: var(--subtle); }
.search input { border: 0; outline: none; font: inherit; font-size: 14px; width: 220px; background: transparent; color: var(--ink); }

.facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 28px; font-size: 13px; }
.facts dt { color: var(--subtle); } .facts dd { margin: 2px 0 0; font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; }
.tile { background: var(--bg); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.tile span { font-size: 12px; color: var(--muted); } .tile b { font-size: 18px; font-variant-numeric: tabular-nums; }
.fault { background: #FEF3F2; border: 1px solid #FECDCA; border-radius: 10px; padding: 12px 14px; }
.fault b { color: #912018; font-size: 14px; } .fault p { margin: 4px 0 0; color: #7A271A; font-size: 13px; }
.spark { height: 72px; display: flex; align-items: flex-end; gap: 3px; border-bottom: 1px solid var(--line); }
.spark div { flex: 1 1 0; background: #93B4F5; border-radius: 2px 2px 0 0; }

.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login form { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.login img { width: 220px; margin: 0 auto 8px; display: block; }
.login label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.login input { height: 46px; padding: 0 14px; border: 1px solid var(--input); border-radius: 12px; font: inherit; font-size: 15px; }
.err { background: var(--red-tint); color: var(--red); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.note { font-size: 12px; color: var(--muted); text-align: center; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 4px; background: var(--brand); margin-right: 6px; }
.live-dot.off { background: var(--grey-dot); }

/* Phones: compact top bar with a scrolling menu instead of a full-height sidebar */
@media (max-width: 760px) {
  .side { flex-basis: 100%; padding: 12px 12px 8px; gap: 10px; border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; flex-wrap: wrap; align-items: center; }
  .side img.wordmark { width: 150px; margin: 0; }
  .side .me { margin: 0 0 0 auto; padding: 0; border: 0; }
  .side .me > div { display: none !important; }
  .nav { flex-direction: row; overflow-x: auto; flex-basis: 100%; gap: 6px; padding-bottom: 4px; }
  .nav li:has(.soon) { display: none; }
  .nav a { white-space: nowrap; min-height: 40px; }
  .search input { width: 100%; }
  .search { flex: 1 1 100%; }
}

/* ─────────────── v1.2: status tokens, dark theme, shell, forms, modals, palette, charts ─────────────── */
:root { --st-available: #004838; --st-charging: #1D4ED8; --st-preparing: #D97706; --st-faulted: #B42318; --st-offline: #9CA3AF; --st-unavailable: #6B7280;
  --heat-0: #F1F5F3; --heat-1: #CFE3DB; --heat-2: #9CC7B7; --heat-3: #5E9E87; --heat-4: #2C7259; --heat-5: #004838; --shadow: 0 12px 40px rgba(16,24,40,.18); color-scheme: light; }
[data-theme='dark'] {
  color-scheme: dark;
  --brand: #4FB394; --brand-strong: #7FD0B5; --brand-tint: #12332A; --brand-soft: #2E6B58;
  --ink: #E8ECEA; --ink-2: #C9D1CE; --muted: #9BA8A3; --subtle: #85928D;
  --bg: #0E1412; --card: #151D1A; --line: #26302C; --line-2: #1D2622; --input: #34403B;
  --blue: #8AB4FF; --blue-tint: #172540; --amber: #F5C26B; --amber-tint: #3A2A10; --red: #FF8A80; --red-tint: #3A1714; --grey-tint: #222B28;
  --st-available: #4FB394; --st-charging: #6F9BFF; --st-preparing: #E6A23C; --st-faulted: #F06A5E; --st-offline: #5D6A65; --st-unavailable: #7C8984;
  --heat-0: #18211E; --heat-1: #173A30; --heat-2: #1F5544; --heat-3: #2F7A61; --heat-4: #4AA283; --heat-5: #7FD0B5; --shadow: 0 12px 40px rgba(0,0,0,.5);
}
[data-theme='dark'] .btn.primary { color: #06120E; }
[data-theme='dark'] .seg button.on { background: var(--brand); color: #06120E; }
[data-theme='dark'] .side img.wordmark, [data-theme='dark'] .login img { filter: brightness(0) invert(1) opacity(.92); }
[data-theme='dark'] .fault { background: var(--red-tint); border-color: #5A2520; } [data-theme='dark'] .fault b, [data-theme='dark'] .fault p { color: var(--red); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--card); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
.main:focus { outline: none; }

.side { position: sticky; top: 0; height: 100vh; overflow: hidden; flex: 0 0 252px; gap: 12px; }
.side-top { display: flex; align-items: center; justify-content: space-between; }
.icon-btn.menu-btn { display: none; }
.org { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 10px; background: var(--bg); }
.org b { font-size: 13px; } .org span { font-size: 12px; color: var(--muted); }
.side-search { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border: 1px solid var(--input); background: var(--card); color: var(--subtle); border-radius: 9px; font-size: 13px; }
.side-search kbd, .palette kbd { margin-left: auto; font: 11px Inter, sans-serif; border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; color: var(--muted); }
.nav-scroll { overflow-y: auto; flex: 1; margin: 0 -6px; padding: 0 6px; display: flex; flex-direction: column; gap: 10px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--subtle); font-weight: 600; padding: 4px 10px 4px; }
.nav a { min-height: 36px; font-size: 13.5px; }
.me { gap: 6px; } .me-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; } .me-txt span { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .me-txt small { font-size: 11.5px; color: var(--subtle); }
.icon-btn { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--ink-2); flex: 0 0 auto; }
.icon-btn:hover { background: var(--bg); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 6px; }
.btn svg { flex: 0 0 auto; }
a.btn { color: var(--ink); } a.btn.primary { color: #fff; } [data-theme='dark'] a.btn.primary { color: #06120E; }
.th-sort { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; }
.th-sort span { color: var(--subtle); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 0 20px 14px; }
.toolbar select, .toolbar input[type=date], .form select, .form input, .form textarea, label.field input { height: 40px; padding: 0 12px; border: 1px solid var(--input); border-radius: 10px; background: var(--card); color: var(--ink); font: inherit; font-size: 14px; }
.form textarea { height: auto; padding: 10px 12px; resize: vertical; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 14px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
.badge { display: inline-flex; align-items: center; border-radius: 6px; padding: 1px 6px; font-size: 11px; font-weight: 700; letter-spacing: .03em; background: var(--blue-tint); color: var(--blue); }
.kpi .d .good { color: var(--brand); } .kpi .d .bad { color: var(--red); }
.split { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.split:last-child { border-bottom: 0; } .split b { font-variant-numeric: tabular-nums; }
.split.total { font-size: 16px; } .split.total b { color: var(--brand); font-size: 20px; }
.neg { color: var(--red); } .pos { color: var(--brand-strong); } .warn-text { color: #B45309; font-weight: 600; }
.lb-bar { height: 10px; border-radius: 6px; background: var(--grey-tint); overflow: hidden; display: flex; }
.lb-bar > i { display: block; height: 100%; }
.chip.bad { background: #FEE2E2; color: #991B1B; } .chip.good { background: var(--brand-tint); color: var(--brand-strong); }
.callout { background: var(--brand-tint); color: var(--brand-strong); border-radius: 10px; padding: 10px 14px; font-size: 13px; }
.callout.warn { background: #FEF3C7; color: #92400E; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--grey-tint); border-radius: 999px; padding: 2px 9px; font-size: 12px; margin: 2px 4px 2px 0; }
.code { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; word-break: break-all; max-height: 240px; overflow: auto; }

.overlay { position: fixed; inset: 0; background: rgba(10,16,14,.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 40; }
.overlay.top { align-items: flex-start; padding-top: 12vh; }
.modal { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; padding: 20px 22px; border: 1px solid var(--line); }
.modal.wide { max-width: 820px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; } .modal-head h2 { margin: 0; font-size: 18px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.form label small { font-weight: 400; color: var(--subtle); }
.form .grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.form fieldset.plain { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.form fieldset.plain legend { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.form .checks { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.form label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; } .form label.check small { margin-left: 4px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.form-intro { font-size: 13px; color: var(--muted); }
.affix { display: flex; align-items: center; border: 1px solid var(--input); border-radius: 10px; overflow: hidden; background: var(--card); }
.affix em { font-style: normal; padding: 0 10px; color: var(--muted); border-right: 1px solid var(--line); height: 40px; display: flex; align-items: center; }
.affix input { border: 0 !important; flex: 1; }
.days { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; } .days legend { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.days label { flex-direction: row !important; align-items: center; padding: 6px 10px; border: 1px solid var(--input); border-radius: 8px; font-weight: 500 !important; cursor: pointer; }
.days label.on { background: var(--brand-tint); border-color: var(--brand-soft); color: var(--brand-strong); }
.days input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.palette { width: 100%; max-width: 620px; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); border: 1px solid var(--line); overflow: hidden; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 54px; border-bottom: 1px solid var(--line); color: var(--subtle); }
.palette-input input { flex: 1; border: 0; outline: none; background: transparent; font: inherit; font-size: 16px; color: var(--ink); }
.palette-list { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow: auto; }
.palette-list li { display: flex; gap: 10px; align-items: baseline; padding: 10px 12px; border-radius: 9px; cursor: pointer; font-size: 14px; }
.palette-list li.on { background: var(--brand-tint); } .palette-list li small { color: var(--muted); margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.palette-list .tag { font-size: 11px; font-weight: 600; color: var(--muted); min-width: 64px; }
.toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--ink); color: var(--card); padding: 10px 14px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow); max-width: 380px; }
.toast.bad { background: var(--red); color: #fff; }

/* Charts */
.heat { display: grid; grid-template-columns: 34px repeat(24, minmax(10px, 1fr)); gap: 2px; font-size: 11px; color: var(--subtle); }
.heat .c { aspect-ratio: 1.25; border-radius: 3px; min-height: 12px; position: relative; }
.heat .c:hover { outline: 2px solid var(--ink); outline-offset: 0; z-index: 2; }
.heat .h { text-align: center; } .heat .dlab { display: flex; align-items: center; }
.heat-legend { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--subtle); margin-top: 10px; justify-content: flex-end; }
.heat-legend i { width: 14px; height: 12px; border-radius: 3px; display: inline-block; }
.donut-wrap { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 180px) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.hbar .track { height: 12px; border-radius: 0 4px 4px 0; background: var(--line-2); overflow: hidden; }
.hbar .fill { height: 100%; background: var(--brand); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar b { font-variant-numeric: tabular-nums; font-weight: 600; } .hbar span.n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map { position: relative; width: 100%; aspect-ratio: 1 / 1.05; max-height: 420px; background: var(--bg); border-radius: 12px; overflow: hidden; }
.map svg { width: 100%; height: 100%; }
.trend { display: flex; align-items: flex-end; gap: 2px; height: 120px; border-bottom: 1px solid var(--line); }
.trend div { flex: 1 1 0; background: var(--brand-soft); border-radius: 3px 3px 0 0; min-height: 1px; position: relative; }
.trend div:hover { background: var(--brand); }
.tip { position: fixed; pointer-events: none; background: var(--ink); color: var(--card); padding: 6px 9px; border-radius: 8px; font-size: 12px; z-index: 70; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); }
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 460px; overflow-y: auto; padding: 4px 2px; }
.chat .m { max-width: 80%; padding: 8px 12px; border-radius: 12px; font-size: 13.5px; white-space: pre-wrap; }
.chat .m.in { background: var(--grey-tint); align-self: flex-start; border-top-left-radius: 4px; }
.chat .m.out { background: var(--brand-tint); color: var(--brand-strong); align-self: flex-end; border-top-right-radius: 4px; }
.chat .m small { display: block; font-size: 11px; color: var(--subtle); margin-top: 4px; }
.timeline { list-style: none; margin: 0; padding: 0; } .timeline li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; } .timeline time { color: var(--subtle); min-width: 130px; font-size: 12.5px; }

@media (max-width: 760px) {
  .side { position: static; height: auto; flex: 1 1 100%; }
  .side-top { flex: 1 1 100%; } .icon-btn.menu-btn { display: inline-flex; }
  .org, .side-search, .nav-scroll, .me { display: none; }
  .menu-open .org, .menu-open .side-search, .menu-open .me { display: flex; flex: 1 1 100%; }
  .menu-open .nav-scroll { display: flex; flex: 1 1 100%; }
  .nav { flex-direction: column; overflow: visible; }
  .side .me > div { display: flex !important; }
  .hbar { grid-template-columns: 96px 1fr auto; }
}
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); min-width: 240px; padding: 6px; z-index: 30; display: flex; flex-direction: column; }
.menu a { padding: 8px 10px; border-radius: 7px; font-size: 14px; color: var(--ink); } .menu a:hover { background: var(--bg); }
details summary { cursor: pointer; color: var(--muted); }
.toolbar select { min-width: 140px; }
.btn { white-space: nowrap; } .nowrap { white-space: nowrap; }
td.num, td.r { white-space: nowrap; }

/* Live monitor */
.mon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; align-content: start; }
.mon-st { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; transition: box-shadow .4s; }
.mon-st header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mon-st header a { color: inherit; text-decoration: none; }
.mon-st.off { opacity: .72; }
.mon-conns { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.mon-conn { min-width: 0; border: 1px solid var(--line); border-left-width: 4px; border-radius: 10px; padding: 8px 10px; background: var(--bg); display: flex; flex-direction: column; gap: 3px; font-size: 13px; transition: background .6s; }
.mon-status { font-weight: 700; font-size: 13px; display: flex; align-items: center; }
.mon-conn-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.mon-conn-head span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.mon-conn-type { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mon-error { font-size: 12px; font-weight: 600; color: var(--red); line-height: 1.3; overflow-wrap: break-word; }
.mon-live { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ink-2); text-decoration: none; }
.flash, tr.flash td { background: var(--brand-tint) !important; }
.mon-st.flash { box-shadow: 0 0 0 2px var(--brand); background: var(--card) !important; }
.mon-feed { max-height: 640px; display: flex; flex-direction: column; }
.mon-feed ul { list-style: none; margin: 0; padding: 0 0 8px; overflow-y: auto; }
.mon-feed li { display: flex; gap: 8px; align-items: baseline; padding: 7px 16px; border-top: 1px solid var(--line); font-size: 13px; }
.mon-feed li a { color: inherit; }
.dot { width: 8px; height: 8px; border-radius: 4px; flex: none; align-self: center; background: var(--grey-dot); }
.dot.green { background: var(--st-available); } .dot.blue { background: var(--st-charging); } .dot.amber { background: var(--st-preparing); } .dot.red { background: var(--st-faulted); }
.live-dot.pulse { animation: tp5pulse 1.6s ease-in-out infinite; }
@keyframes tp5pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .live-dot.pulse { animation: none; } .mon-conn, .mon-st { transition: none; } }
.mon-conn .split > span { white-space: nowrap; } .mon-conn .split > b { overflow-wrap: anywhere; }

/* Live test (streamed OCPP / OCPI messages) */
.live-dot { width: 10px; height: 10px; border-radius: 5px; background: #12B76A; box-shadow: 0 0 0 0 rgba(18,183,106,.6); animation: livepulse 1.6s infinite; flex: 0 0 10px; }
.live-dot.wait { background: var(--amber-dot); animation: none; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(18,183,106,.55); } 70% { box-shadow: 0 0 0 8px rgba(18,183,106,0); } 100% { box-shadow: 0 0 0 0 rgba(18,183,106,0); } }
tr.fresh td { animation: freshrow 2.4s ease-out; }
@keyframes freshrow { from { background: var(--brand-tint); } to { background: transparent; } }
.live-banner { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--brand-tint); color: var(--brand-strong); font-size: 13px; border-bottom: 1px solid var(--line); }
@media (prefers-reduced-motion: reduce) { .live-dot, tr.fresh td { animation: none; } }

/* Message tables: who sent it, and faults */
.msg-flow { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.msg-arrow { color: var(--subtle); font-size: 12px; }
.msg-ico { display: inline-block; vertical-align: -4px; }
.msg-ico.charger { color: var(--blue); }
.msg-ico.app { color: var(--brand); }
.msg-ico.partner { color: var(--amber-dot); }
tr.msg-fault td { background: var(--red-tint); }
tr.msg-fault td:first-child { box-shadow: inset 3px 0 0 var(--red); }
tr.msg-fault .msg-why { color: var(--red); font-weight: 600; }
tr.msg-warn td:first-child { box-shadow: inset 3px 0 0 var(--amber-dot); }
tr.msg-warn .msg-why { color: var(--amber); font-weight: 600; }
.msg-why { margin-left: 8px; font-size: 12px; }
.msg-legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 6px 14px; border-bottom: 1px solid var(--line); color: var(--muted); }
.msg-legend span { display: inline-flex; align-items: center; gap: 5px; }
.msg-legend .sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.msg-legend .sw.fault { background: var(--red-tint); box-shadow: inset 3px 0 0 var(--red); }
.msg-legend .sw.warn { background: var(--card); box-shadow: inset 3px 0 0 var(--amber-dot); border: 1px solid var(--line); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* In use at a glance: blinking dot while a car is charging, steady while paused */
.use-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--st-charging); margin-right: 6px; flex: 0 0 8px; vertical-align: 1px; }
.use-dot.blink { animation: useblink 1.2s ease-in-out infinite; box-shadow: 0 0 0 0 color-mix(in srgb, var(--st-charging) 60%, transparent); }
@keyframes useblink {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 color-mix(in srgb, var(--st-charging) 55%, transparent); }
  50% { opacity: .25; box-shadow: 0 0 0 5px color-mix(in srgb, var(--st-charging) 0%, transparent); }
}
.pill.charging { font-weight: 700; }
.in-use-tag { display: inline-flex; align-items: center; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--blue-tint); color: var(--blue); font-size: 11px; font-weight: 700; vertical-align: 1px; }
.mon-conn.charging { animation: connglow 2.4s ease-in-out infinite; }
@keyframes connglow { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 50% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--st-charging) 28%, transparent); } }
@media (prefers-reduced-motion: reduce) { .use-dot.blink, .mon-conn.charging { animation: none; } .use-dot.blink { box-shadow: 0 0 0 3px color-mix(in srgb, var(--st-charging) 30%, transparent); } }
.msg-from { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 12px; font-weight: 600; }
.msg-from.charger { color: var(--blue); }
.msg-from.app { color: var(--brand); }
.msg-from.partner { color: var(--amber); }
.msg-from-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }

/* Message logs: filters, times, reply times, request/reply pairs, details */
.log-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.log-filters select, .log-filters input[type=search], .log-filters input[type=datetime-local] { height: 34px; padding: 0 10px; border: 1px solid var(--input); border-radius: 8px; background: var(--card); color: var(--ink); font: inherit; font-size: 13px; }
.log-filters .log-search { flex: 1 1 200px; min-width: 160px; }
.log-filters .chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.log-range { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.msg-time { white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 12px; }
.msg-time .d { color: var(--muted); } .msg-time .d.today { color: var(--subtle); }
.msg-time b { font-weight: 600; } .msg-time .ms { color: var(--subtle); font-weight: 400; }
.reply-ms { margin-left: 4px; color: var(--muted); font-variant-numeric: tabular-nums; }
.reply-ms.slow { color: var(--amber); font-weight: 600; } .reply-ms.bad { color: var(--red); font-weight: 700; }
.msg-sum { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 520px; }
tr.pair td { background: color-mix(in srgb, var(--blue-tint) 70%, transparent); }
tr.pair td:first-child { box-shadow: inset 3px 0 0 var(--blue); }
tr.msg-ok td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.msg-ico.event { color: var(--muted); }
.msg-from.event { color: var(--muted); }
.msg-details { padding: 4px 2px 8px; }
.kv { display: grid; grid-template-columns: minmax(140px, max-content) 1fr; gap: 2px 14px; margin: 0; font-size: 12px; }
.kv > div { display: contents; } .kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-all; }
.kv-table { width: auto; border-collapse: collapse; font-size: 12px; margin-bottom: 10px; }
.kv-table th, .kv-table td { padding: 4px 12px 4px 0; text-align: left; border-bottom: 1px solid var(--line-2); }
.log-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
tr.msg-fault .msg-sum { color: var(--red); font-weight: 600; }
tr.msg-warn .msg-sum { color: var(--amber); }

/* Fixed-height panels with their own scroll (Overview: Live sessions, Needs attention) */
.panel-fixed { display: flex; flex-direction: column; height: 560px; min-height: 0; }
.panel-fixed > .card-head { padding: 16px 16px 0; margin-bottom: 10px; flex: 0 0 auto; }
.panel-fixed > .panel-scroll, .panel-fixed > .alerts-panel { flex: 1 1 auto; min-height: 0; }
.panel-scroll { overflow: auto; }
.panel-scroll thead th { position: sticky; top: 0; background: var(--card); z-index: 1; box-shadow: 0 1px 0 var(--line); }
.panel-scroll, .alerts-scroll { scrollbar-width: thin; scrollbar-color: var(--input) transparent; }
.panel-scroll::-webkit-scrollbar, .alerts-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.panel-scroll::-webkit-scrollbar-thumb, .alerts-scroll::-webkit-scrollbar-thumb { background: var(--input); border-radius: 8px; }
.panel-scroll:focus-visible, .alerts-scroll:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
@media (max-width: 900px) { .panel-fixed { height: 460px; } }

/* Alerts panel */
.alerts-panel { display: flex; flex-direction: column; min-height: 0; }
.alerts-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 0 16px 10px; border-bottom: 1px solid var(--line); }
.alerts-panel:not(.compact) .alerts-tools { padding-top: 14px; }
.alerts-tools select, .alerts-tools input[type=search], .alerts-tools input[type=datetime-local] { height: 34px; padding: 0 10px; border: 1px solid var(--input); border-radius: 8px; background: var(--card); color: var(--ink); font: inherit; font-size: 13px; }
.alerts-tools input[type=search] { flex: 1 1 200px; min-width: 160px; }
.alerts-tools > .btn { margin-left: auto; }
.fchips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--input); background: var(--card); color: var(--ink-2); font-size: 12.5px; }
.fchip i { width: 8px; height: 8px; border-radius: 4px; display: inline-block; }
.fchip b { font-variant-numeric: tabular-nums; color: var(--ink); }
.fchip.on { background: var(--ink); border-color: var(--ink); color: #fff; } .fchip.on b { color: #fff; }
[data-theme='dark'] .fchip.on { background: var(--brand); border-color: var(--brand); color: #06120E; } [data-theme='dark'] .fchip.on b { color: #06120E; }
.alerts-scroll { overflow: auto; flex: 1 1 auto; min-height: 0; padding: 0 16px; }
.alerts-panel:not(.compact) .alerts-scroll { max-height: calc(100vh - 260px); }
.alerts-panel .alerts li { flex-wrap: wrap; align-items: flex-start; }
.alerts-panel .alerts li.acked { opacity: .6; }
.alert-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left; background: none; border: 0; padding: 0; color: inherit; }
.alert-title { font-size: 14px; font-weight: 600; display: flex; gap: 6px; align-items: baseline; min-width: 0; }
.alert-title .times { flex: 0 0 auto; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--grey-tint); color: var(--ink-2); }
.alert-body { font-size: 13px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; word-break: break-word; }
.alerts li.open .alert-body { -webkit-line-clamp: unset; display: block; }
.alert-when { font-size: 12px; color: var(--subtle); }
.alert-extra { flex-basis: 100%; padding-left: 20px; }

/* Mapbox station maps */
.mb-wrap { position: relative; width: 100%; border-radius: 12px; overflow: hidden; background: var(--grey-tint); }
.mb-map { width: 100%; height: 100%; }
.mb-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.mb-pin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); cursor: pointer; padding: 0; }
.mb-pin:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.mb-legend { position: absolute; left: 10px; top: 10px; display: flex; gap: 12px; flex-wrap: wrap; background: var(--card); color: var(--ink-2); border-radius: 8px; padding: 5px 10px; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.mb-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 5px; margin-right: 5px; }
.mb-pop { display: flex; flex-direction: column; gap: 3px; font: 13px/1.4 Inter, system-ui, sans-serif; color: #111827; }
.mb-pop b { font-size: 14px; } .mb-pop em { color: #B42318; font-style: normal; font-weight: 600; }
.mb-pop .btn { align-self: flex-start; }
.mb-pop-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.mb-cluster { min-width: 30px; height: 30px; padding: 0 6px; border-radius: 15px; border: 3px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.4); color: #fff; font: 700 13px/24px Inter, system-ui, sans-serif; cursor: pointer; }
.mb-cluster:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.mb-home { display: flex !important; align-items: center; justify-content: center; color: #333; }
.mb-tip { margin: 6px 2px 0; }

/* Walk-in UPI QR panel on a connector card */
.qr-panel { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.qr-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.qr-events { margin: 6px 0 0; padding-left: 16px; display: flex; flex-direction: column; gap: 2px; }

/* Notification grid, field labels outside forms */
.grid-table th.center, .grid-table td.center { text-align: center; width: 92px; }
.grid-table td { vertical-align: middle; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
label.field input { font-weight: 400; }

/* Leads & referrals */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.board-col { background: var(--line-2); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.board-col h3 { margin: 2px 4px 4px; font-size: 13px; font-weight: 700; display: flex; justify-content: space-between; color: var(--ink-2, #374151); }
.board-col h3 span { color: var(--muted); font-weight: 600; }
.lead-card { text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; font: inherit; color: inherit; }
.lead-card:hover { border-color: var(--brand); } .lead-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.lead-detail { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, 1fr); gap: 22px; align-items: start; }
@media (max-width: 900px) { .lead-detail { grid-template-columns: 1fr; } }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; } .thumbs img { width: 120px; height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.warn-box { background: #FEF3C7; color: #92400E; border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.btn.sm { padding: 4px 8px; font-size: 12px; min-height: 0; }

/* App home screen preview */
.phone-preview { max-width: 360px; margin: 0 auto; background: var(--bg); border: 1px solid var(--line); border-radius: 22px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.pv-banner { border-radius: 14px; overflow: hidden; background: #E5EFEC; }
.pv-banner img { display: block; width: 100%; aspect-ratio: 1.6; object-fit: contain; }
.pv-text { background: #004838; color: #fff; padding: 12px; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.pv-text b { font-size: 15px; } .pv-text em { font-style: normal; font-weight: 700; color: #CFE3DC; }
.pv-tiles { display: flex; gap: 8px; } .pv-tiles div { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; text-align: center; }
.pv-tiles i { font-style: normal; width: 34px; height: 34px; border-radius: 50%; background: #E5EFEC; color: #004838; display: flex; align-items: center; justify-content: center; font-weight: 800; }

/* Page controls under tables */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--line-2); }
.pager-btns { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pager .btn.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager select { font: inherit; padding: 4px 6px; border: 1px solid var(--input); border-radius: 8px; background: var(--card); color: inherit; }
/* Maintenance mode switch and banner */
.switch-row { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.switch { position: relative; width: 40px; height: 22px; border-radius: 999px; border: 0; background: var(--line); cursor: pointer; padding: 0; transition: background .15s; }
.switch span { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s; }
.switch.on { background: #B45309; }
.switch.on span { left: 21px; }
.switch.on.good { background: var(--brand); }
.switch:disabled { opacity: .5; cursor: not-allowed; }
.switch:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.maint-banner { border-color: #B45309; background: #FFF7ED; }
[data-theme='dark'] .maint-banner { background: #2A1A08; }
.form .form-section { margin: 6px 0 -4px; font-size: 14px; font-weight: 700; color: var(--ink); border-top: 1px solid var(--line); padding-top: 12px; }
.form .form-section:first-child { border-top: 0; padding-top: 0; }

/* Reports */
.reports-grid { display: grid; grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .reports-grid { grid-template-columns: 1fr; } }
.chips-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--input); background: var(--card); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.chip-btn.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.chip-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pick { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.pick input[type=search] { height: 36px; }
.pick-list { max-height: 220px; overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.pick-list label.check small { margin-left: 6px; }
.linkish { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; font-size: 12.5px; cursor: pointer; text-decoration: underline; align-self: flex-start; }
.reports-grid input[type=checkbox] { height: auto; width: auto; margin: 0; }
.reports-grid .form label.check { gap: 8px; }
.pick-list { gap: 2px; } .pick-list label.check { padding: 4px 0; }
.rep-actions { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 200px; }
.rep-actions .btn { justify-content: center; }

/* Network cards (Analytics): our usual white cards with a brand-green icon tile; colour only where it carries meaning
   (connector and charger states). */
.ncards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 4px; }
.ncard { position: relative; border-radius: var(--radius); padding: 16px 18px; background: var(--card); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px; min-height: 108px; overflow: hidden; }
.ncard::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand); opacity: .85; }
.ncard.wide { grid-column: span 2; }
@media (max-width: 760px) { .ncard.wide { grid-column: auto; } }
.ncard .l { font-size: 13px; font-weight: 600; color: var(--ink-2); padding-right: 44px; }
.ncard .v { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--ink); }
.ncard .v small { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.ncard .d { font-size: 12px; color: var(--muted); font-weight: 500; }
.ncard .badge { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  color: var(--brand); background: var(--brand-tint, #E5EFEC); }
.ncard .split2 { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ncard .split2 > span + span { border-left: 1px solid var(--line); padding-left: 10px; }
.cstates { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
.cstates b { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; } .cstates span { font-size: 11.5px; font-weight: 600; margin-left: 3px; }

/* OCPI: waiting on us */
.pend { list-style: none; margin: 0; padding: 0; }
.pend li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line-2); }
.pend li:first-child { border-top: 0; }
.pend .n { min-width: 34px; height: 26px; padding: 0 8px; border-radius: 999px; display: grid; place-items: center; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.pend .n.red { background: var(--red-tint, #FEE4E2); color: var(--red); } .pend .n.amber { background: #FEF3C7; color: #92400E; } .pend .n.grey { background: var(--line-2); color: var(--ink-2); }
.pend .t { flex: 1; min-width: 0; } .pend .t b { display: block; font-size: 14px; } .pend .t span { font-size: 12.5px; color: var(--muted); }

/* A save is on its way (see api.ts): a thin moving bar along the top, and a busy cursor. */
body.tp5-saving { cursor: progress; }
body.tp5-saving::before {
  content: ''; position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 9999;
  background: linear-gradient(90deg, transparent 0%, var(--brand, #004838) 40%, var(--brand, #004838) 60%, transparent 100%);
  background-size: 50% 100%; background-repeat: no-repeat; animation: tp5-saving 1.1s linear infinite;
}
@keyframes tp5-saving { from { background-position: -50% 0; } to { background-position: 150% 0; } }
@media (prefers-reduced-motion: reduce) { body.tp5-saving::before { animation: none; background: var(--brand, #004838); opacity: .5; } }
