/* =========================================================================
   EV Charging – Admin website
   Design tokens mirror the customer mobile app (emerald brand).
   ========================================================================= */

@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 400; font-style: normal; font-display: swap; src: url('/admin/fonts/PlusJakartaSans_400Regular.ttf') format('truetype'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 500; font-style: normal; font-display: swap; src: url('/admin/fonts/PlusJakartaSans_500Medium.ttf') format('truetype'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 600; font-style: normal; font-display: swap; src: url('/admin/fonts/PlusJakartaSans_600SemiBold.ttf') format('truetype'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 700; font-style: normal; font-display: swap; src: url('/admin/fonts/PlusJakartaSans_700Bold.ttf') format('truetype'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-weight: 800; font-style: normal; font-display: swap; src: url('/admin/fonts/PlusJakartaSans_800ExtraBold.ttf') format('truetype'); }

:root {
  --bg: #F3F5F8;
  --surface: #FFFFFF;
  --inset: #F1F4F7;
  --border: #E4E8EE;
  --border-strong: #D3D9E2;
  --text: #0B1220;
  --dim: #5B6576;
  --faint: #8A93A3;
  --brand: #0E9F6E;
  --brand-hover: #0B8A5F;
  --brand-soft: #E3F6EE;
  --brand-ink: #FFFFFF;
  --hero-a: #0F4A39;
  --hero-b: #08201A;
  --ok: #0E9F6E;    --ok-soft: #E3F6EE;
  --info: #2563EB;  --info-soft: #E8EFFD;
  --warn: #B45309;  --warn-soft: #FDF1E3;
  --bad: #D92D20;   --bad-soft: #FDECEA;
  --muted: #5B6576; --muted-soft: #EEF1F4;
  --shadow: 0 1px 2px rgba(11, 18, 32, .05), 0 6px 20px rgba(11, 18, 32, .06);
  --shadow-lg: 0 10px 40px rgba(11, 18, 32, .16), 0 2px 6px rgba(11, 18, 32, .06);
  --overlay: rgba(11, 18, 32, .42);
  --chart-grid: #E9EDF2;
  --focus: 0 0 0 3px rgba(14, 159, 110, .25);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --sidebar-w: 240px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'Cascadia Code', 'SFMono-Regular', Consolas, monospace;
  color-scheme: light;
}

/* Dark tokens – used for the System setting when the OS is dark, and for the explicit Dark setting. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #080C11; --surface: #111820; --inset: #18212B; --border: #1F2A36; --border-strong: #2A3746;
    --text: #E8EEF4; --dim: #8B98A8; --faint: #66727F;
    --brand: #34D399; --brand-hover: #4ADEA8; --brand-soft: #0F2E24; --brand-ink: #04140E;
    --hero-a: #134D3C; --hero-b: #0A1E19;
    --ok: #34D399; --ok-soft: #0F2E24; --info: #60A5FA; --info-soft: #132540;
    --warn: #FBBF24; --warn-soft: #2E2410; --bad: #F87171; --bad-soft: #341616;
    --muted: #8B98A8; --muted-soft: #1A232D;
    --shadow: none; --shadow-lg: 0 16px 48px rgba(0, 0, 0, .5);
    --overlay: rgba(0, 0, 0, .6); --chart-grid: #1C2631; --focus: 0 0 0 3px rgba(52, 211, 153, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #080C11; --surface: #111820; --inset: #18212B; --border: #1F2A36; --border-strong: #2A3746;
  --text: #E8EEF4; --dim: #8B98A8; --faint: #66727F;
  --brand: #34D399; --brand-hover: #4ADEA8; --brand-soft: #0F2E24; --brand-ink: #04140E;
  --hero-a: #134D3C; --hero-b: #0A1E19;
  --ok: #34D399; --ok-soft: #0F2E24; --info: #60A5FA; --info-soft: #132540;
  --warn: #FBBF24; --warn-soft: #2E2410; --bad: #F87171; --bad-soft: #341616;
  --muted: #8B98A8; --muted-soft: #1A232D;
  --shadow: none; --shadow-lg: 0 16px 48px rgba(0, 0, 0, .5);
  --overlay: rgba(0, 0, 0, .6); --chart-grid: #1C2631; --focus: 0 0 0 3px rgba(52, 211, 153, .25);
  color-scheme: dark;
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
button, input, select, textarea { font: inherit; color: inherit; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.lg { width: 22px; height: 22px; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.dim { color: var(--dim); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::selection { background: var(--brand-soft); }

.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--brand); animation: spin .8s linear infinite; }
.spinner.sm { width: 16px; height: 16px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- shell */
.shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40;
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 12px 12px 14px;
}
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 0 13px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 6px; color: var(--text); min-width: 0; }
.side-menu { flex: none; color: var(--dim); width: 36px; height: 36px; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: linear-gradient(145deg, #12B981, #0E9F6E 55%, #0B7A55); color: #fff;
  box-shadow: 0 4px 12px rgba(14, 159, 110, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.brand-mark svg.i { width: 18px; height: 18px; fill: #fff; stroke: #fff; stroke-width: 1.2; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 800; font-size: 15px; letter-spacing: -.02em; }
.brand-sub { font-size: 11px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .08em; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-label { font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; padding: 6px 10px; }
.nav a {
  display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 10px; border-radius: 10px;
  color: var(--dim); font-weight: 600; font-size: 14px; transition: background .12s, color .12s;
  border: 1px solid transparent;
}
/* Focus ring only for keyboard users, so a clicked item doesn't look selected next to the real one. */
.nav a:focus { outline: none; }
.nav a:focus-visible { border-color: var(--brand); }
.nav a:hover { background: var(--inset); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--brand-soft); color: var(--brand); }
.nav a .badge-dot { margin-left: auto; }

.sidebar-foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.me { display: flex; align-items: center; gap: 12px; padding: 2px 6px; min-width: 0; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: 13px;
}
.me-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.me-name { font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-email { font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { margin-left: var(--sidebar-w); min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 12px 32px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-title { min-width: 0; display: flex; flex-direction: column; }
.crumbs { font-size: 12px; color: var(--dim); font-weight: 600; display: flex; gap: 6px; align-items: center; white-space: nowrap; overflow: hidden; }
.crumbs a { color: var(--dim); }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { color: var(--faint); }
.topbar h1 { font-size: 20px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; flex: none; }
.topbar .hamburger { display: none; flex: none; }
@media (max-width: 900px) { .topbar .hamburger { display: inline-flex; } }

.live { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--dim); font-weight: 600; white-space: nowrap; }
.live-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.live-dot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--ok); animation: pulse 2s ease-out infinite; }
.live.paused .live-dot, .live.paused .live-dot::after { background: var(--faint); animation: none; }
.live.error .live-dot, .live.error .live-dot::after { background: var(--bad); }
@keyframes pulse { 0% { transform: scale(1); opacity: .6; } 80%, 100% { transform: scale(2.8); opacity: 0; } }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--inset); border: 1px solid var(--border); border-radius: 10px; }
.seg button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: transparent; cursor: pointer;
  padding: 5px 10px; border-radius: 7px; color: var(--dim); font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(11, 18, 32, .08); }
.seg.icon-only button { padding: 5px 7px; }

.content { padding: 28px 32px 48px; width: 100%; max-width: 1360px; display: flex; flex-direction: column; gap: 20px; }
.backdrop { display: none; }

/* ---------------------------------------------------------------- cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-pad { padding: 20px 22px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h2, .card-head h3 { font-size: 15px; font-weight: 700; }
.card-head .sub { font-size: 12.5px; color: var(--dim); }
.card-head .spacer { flex: 1; }
.card-body { padding: 18px 22px; }
.card-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.section-title { font-size: 13px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.cols-main { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }

/* KPI */
.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; }
.kpi-top { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 13px; font-weight: 600; }
.kpi-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.kpi-icon.info { background: var(--info-soft); color: var(--info); }
.kpi-icon.warn { background: var(--warn-soft); color: var(--warn); }
.kpi-value { font-size: 28px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value small { font-size: 15px; font-weight: 700; color: var(--dim); margin-left: 3px; }
.kpi-sub { font-size: 12.5px; color: var(--dim); font-variant-numeric: tabular-nums; }
.kpi-sub b { color: var(--text); font-weight: 700; }
.kpi.hero { background: linear-gradient(150deg, var(--hero-a), var(--hero-b)); border-color: transparent; color: #E9FFF6; }
.kpi.hero .kpi-top, .kpi.hero .kpi-sub { color: rgba(233, 255, 246, .72); }
.kpi.hero .kpi-sub b { color: #fff; }
.kpi.hero .kpi-icon { background: rgba(255, 255, 255, .12); color: #6EF2BE; }
.kpi.hero .kpi-value small { color: rgba(233, 255, 246, .7); }

/* ---------------------------------------------------------------- pills & badges */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap; line-height: 1.5;
  background: var(--muted-soft); color: var(--muted);
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.pill.nodot::before { display: none; }
.pill.nodot { padding-left: 10px; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.brand { background: var(--brand-soft); color: var(--brand); }
.pill.pulse::before { animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .3; } }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; background: var(--inset); border: 1px solid var(--border); font-size: 11.5px; font-weight: 600; color: var(--dim); white-space: nowrap; }
.tag.brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.badge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  padding: 8px 14px; min-height: 36px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-weight: 650; font-size: 13.5px; white-space: nowrap;
  transition: background .12s, border-color .12s, box-shadow .12s, opacity .12s;
}
.btn:hover { background: var(--inset); text-decoration: none; }
.btn:focus-visible, .input:focus, .select:focus, .textarea:focus, .seg button:focus-visible, .nav a:focus-visible { outline: none; box-shadow: var(--focus); border-color: var(--brand); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover:not(:disabled) { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger:hover:not(:disabled) { filter: brightness(1.06); }
.btn.danger-ghost { color: var(--bad); }
.btn.danger-ghost:hover:not(:disabled) { background: var(--bad-soft); border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--dim); }
.btn.ghost:hover:not(:disabled) { background: var(--inset); color: var(--text); }
.btn.sm { padding: 5px 10px; min-height: 30px; font-size: 12.5px; border-radius: 8px; gap: 6px; }
.btn.icon { padding: 0; width: 36px; }
.btn.icon.sm { width: 30px; }
.btn.block { width: 100%; }
.btn .spinner { width: 14px; height: 14px; border-width: 2px; border-color: currentColor; border-top-color: transparent; }

/* ---------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 700; color: var(--text); }
.hint { font-size: 12px; color: var(--dim); }
.input, .select, .textarea {
  width: 100%; min-height: 38px; padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  transition: border-color .12s, box-shadow .12s;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input.sm, .select.sm { min-height: 32px; padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.input.num { font-variant-numeric: tabular-nums; }
.input.invalid { border-color: var(--bad); }
.select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%); background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.textarea { min-height: 120px; resize: vertical; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; }
.input-group { display: flex; align-items: stretch; }
.input-group .addon { display: grid; place-items: center; padding: 0 11px; border: 1px solid var(--border-strong); background: var(--inset); color: var(--dim); font-weight: 600; font-size: 13px; white-space: nowrap; }
.input-group .addon:first-child { border-radius: 10px 0 0 10px; border-right: 0; }
.input-group .addon:last-child { border-radius: 0 10px 10px 0; border-left: 0; }
.input-group .input { border-radius: 0; }
.input-group .input:first-child { border-radius: 10px 0 0 10px; }
.input-group .input:last-child { border-radius: 0 10px 10px 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px 18px; }
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.search { position: relative; min-width: 0; }
.search svg.i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search .input { padding-left: 36px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.toolbar .search { flex: 1 1 220px; max-width: 360px; }
.toolbar .select { width: auto; min-width: 140px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; font-size: 13px; user-select: none; }
.check input { accent-color: var(--brand); width: 16px; height: 16px; }

/* ---------------------------------------------------------------- banners */
.banner { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500; border: 1px solid transparent; }
.banner svg.i { margin-top: 1px; }
.banner .grow { flex: 1; min-width: 0; }
.banner b { font-weight: 700; }
.banner.bad { background: var(--bad-soft); color: var(--bad); }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.info { background: var(--info-soft); color: var(--info); }
.banner.ok { background: var(--ok-soft); color: var(--ok); }
.banner a { color: inherit; font-weight: 700; text-decoration: underline; white-space: nowrap; }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-size: 11.5px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .05em;
  padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--inset); white-space: nowrap;
}
.table th:first-child, .table td:first-child { padding-left: 22px; }
.table th:last-child, .table td:last-child { padding-right: 22px; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; font-variant-numeric: tabular-nums; }
.table td.wrap { white-space: normal; }
.table tbody tr.click { cursor: pointer; transition: background .1s; }
.table tbody tr.click:hover { background: var(--inset); }
.table .primary-cell { font-weight: 700; color: var(--text); }
.table .sub { font-size: 12px; color: var(--dim); }
.table.compact td { padding: 8px 14px; }
.cell-stack { display: flex; flex-direction: column; line-height: 1.3; }

/* ---------------------------------------------------------------- empty / skeleton */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 44px 24px; color: var(--dim); }
.empty-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--inset); color: var(--faint); margin-bottom: 4px; }
.empty-icon svg.i { width: 22px; height: 22px; }
.empty h3 { color: var(--text); font-size: 15px; }
.empty p { max-width: 380px; font-size: 13px; }
.empty .btn { margin-top: 8px; }

.skel { background: linear-gradient(90deg, var(--inset) 0%, var(--border) 50%, var(--inset) 100%); background-size: 200% 100%; animation: shimmer 1.3s ease-in-out infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.skel.line { height: 12px; }
.skel.title { height: 22px; width: 40%; }
.skel.block { height: 120px; border-radius: 14px; }
.skel.kpi { height: 118px; border-radius: var(--radius); }
.skel.w60 { width: 60%; } .skel.w80 { width: 80%; } .skel.w40 { width: 40%; } .skel.w30 { width: 30%; }
.skel-stack { display: flex; flex-direction: column; gap: 12px; padding: 22px; }

/* ---------------------------------------------------------------- chart */
.chart-wrap { position: relative; padding: 8px 16px 16px; }
.chart-wrap svg { display: block; width: 100%; overflow: visible; }
.chart-wrap .grid-line { stroke: var(--chart-grid); stroke-width: 1; }
.chart-wrap .base-line { stroke: var(--border-strong); stroke-width: 1; }
.chart-wrap .axis-text { fill: var(--faint); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart-wrap .bar { fill: var(--brand); transition: opacity .12s; }
.chart-wrap .bar.today { fill: var(--brand); }
.chart-wrap .bar.zero { fill: var(--border-strong); }
.chart-wrap .hit { fill: transparent; cursor: default; }
.chart-wrap.hovering .bar:not(.hl) { opacity: .45; }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 5; transform: translate(-50%, -100%);
  background: var(--text); color: var(--bg); border-radius: 10px; padding: 8px 11px; font-size: 12px; line-height: 1.35;
  box-shadow: var(--shadow-lg); white-space: nowrap; opacity: 0; transition: opacity .1s;
}
.chart-tip.show { opacity: 1; }
.chart-tip b { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; display: block; }
.chart-tip span { opacity: .7; }
.chart-summary { display: flex; gap: 24px; padding: 0 22px 4px; flex-wrap: wrap; }
.chart-summary .stat { display: flex; flex-direction: column; }
.chart-summary .stat b { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.chart-summary .stat span { font-size: 12px; color: var(--dim); }

/* ---------------------------------------------------------------- charger cards */
.charger-card { display: flex; flex-direction: column; color: var(--text); transition: border-color .12s, transform .12s; }
a.charger-card:hover { text-decoration: none; border-color: var(--border-strong); }
.charger-card .cc-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px 12px; }
.cc-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--inset); color: var(--dim); flex: none; }
.cc-icon.online { background: var(--brand-soft); color: var(--brand); }
.cc-title { min-width: 0; flex: 1; }
.cc-title h3 { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-title .sub { font-size: 12px; color: var(--dim); font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-connectors { display: flex; flex-direction: column; gap: 8px; padding: 0 18px 14px; }
.conn-row { background: var(--inset); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.conn-line { display: flex; align-items: center; gap: 8px; justify-content: space-between; flex-wrap: wrap; }
.conn-id { font-size: 12px; font-weight: 700; color: var(--dim); }
.conn-metrics { display: flex; gap: 14px; font-size: 12.5px; color: var(--dim); font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.conn-metrics b { color: var(--text); font-weight: 700; }
.cc-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--dim); }
.cc-foot b { color: var(--text); font-variant-numeric: tabular-nums; }

.meter { height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; }
.meter > span { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--brand); transition: width .4s ease; }
.meter.info > span { background: var(--info); }
.meter.lg { height: 10px; }

/* ---------------------------------------------------------------- detail pages */
.detail-head { display: flex; gap: 18px; align-items: flex-start; padding: 22px; flex-wrap: wrap; }
.detail-head .big-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--inset); color: var(--dim); flex: none; }
.detail-head .big-icon.online { background: var(--brand-soft); color: var(--brand); }
.detail-head .big-icon svg.i { width: 24px; height: 24px; }
.detail-title { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 6px; }
.detail-title h2 { font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; word-break: break-word; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.name-edit { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.name-edit .input { max-width: 320px; font-size: 16px; font-weight: 700; }
.edit-btn { opacity: .6; }
.edit-btn:hover { opacity: 1; }

.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0; }
.kv > div { padding: 12px 22px; border-top: 1px solid var(--border); min-width: 0; }
.kv dt, .kv .k { font-size: 11.5px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.kv dd, .kv .v { margin: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kv-list { display: flex; flex-direction: column; }
.kv-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.kv-list > div:last-child { border-bottom: 0; }
.kv-list .k { color: var(--dim); }
.kv-list .v { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.kv-list .total { font-weight: 800; font-size: 15px; border-top: 1px solid var(--border); border-bottom: 0; padding-top: 12px; margin-top: 4px; }
.kv-list .total .k { color: var(--text); }

.tabs { display: flex; gap: 2px; padding: 0 14px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  border: 0; background: none; cursor: pointer; padding: 14px 10px 12px; margin-bottom: -1px; font-weight: 650; font-size: 13.5px;
  color: var(--dim); border-bottom: 2px solid transparent; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }

.metric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.metric { background: var(--inset); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.metric .k { font-size: 12px; color: var(--dim); font-weight: 600; }
.metric .v { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric .v small { font-size: 12px; color: var(--dim); font-weight: 700; margin-left: 2px; }

.conn-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.conn-card .head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.conn-card h4 { font-size: 14px; }

/* OCPP log */
.log-dir { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 7px; }
.log-dir.in { background: var(--info-soft); color: var(--info); }
.log-dir.out { background: var(--brand-soft); color: var(--brand); }
.log-dir.err { background: var(--bad-soft); color: var(--bad); }
.payload-preview { font-family: var(--mono); font-size: 12px; color: var(--dim); max-width: 520px; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: middle; }
.json {
  margin: 0; font-family: var(--mono); font-size: 12px; line-height: 1.55; background: var(--inset); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; overflow: auto; max-height: 420px; white-space: pre; tab-size: 2;
}
.json .k { color: var(--info); }
.json .s { color: var(--ok); }
.json .n { color: var(--warn); }
.json .b { color: var(--bad); }
tr.expanded-row td { background: var(--inset); white-space: normal; padding-top: 4px; }
tr.expanded-row .json { background: var(--surface); max-width: 100%; }
.chev { transition: transform .15s; }
.open > td .chev, .chev.open { transform: rotate(90deg); }

/* Setup report */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.steps li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.steps li:last-child { border-bottom: 0; }
.step-icon { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; margin-top: 1px; }
.step-icon svg.i { width: 13px; height: 13px; stroke-width: 2.6; }
.step-icon.ok { background: var(--ok-soft); color: var(--ok); }
.step-icon.bad { background: var(--bad-soft); color: var(--bad); }
.steps .name { font-weight: 650; overflow-wrap: anywhere; }
.steps .detail { font-size: 12.5px; color: var(--dim); overflow-wrap: anywhere; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 18px 28px; }
.timeline li::before { content: ''; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline .dot { position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--brand-soft); border: 3px solid var(--surface); box-shadow: 0 0 0 1.5px var(--brand); }
.timeline .dot.bad { background: var(--bad-soft); box-shadow: 0 0 0 1.5px var(--bad); }
.timeline .t-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.timeline .t-title { font-weight: 700; }
.timeline .t-time { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.timeline details { margin-top: 6px; }
.timeline summary { cursor: pointer; font-size: 12.5px; color: var(--dim); font-weight: 600; }

/* Receipt */
.receipt { display: flex; flex-direction: column; gap: 0; }
.receipt .line { display: flex; justify-content: space-between; padding: 10px 0; font-variant-numeric: tabular-nums; gap: 12px; }
.receipt .line .v { font-weight: 700; }
.receipt .line.minus .v { color: var(--dim); }
.receipt .line.result { border-top: 2px dashed var(--border); margin-top: 4px; padding-top: 14px; font-size: 16px; font-weight: 800; }
.receipt .line.result .v { color: var(--brand); font-weight: 800; }

/* Session hero */
.session-hero {
  border-radius: var(--radius); padding: 22px; color: #E9FFF6;
  background: radial-gradient(120% 140% at 100% 0%, rgba(52, 211, 153, .18), transparent 55%), linear-gradient(150deg, var(--hero-a), var(--hero-b));
  display: flex; flex-direction: column; gap: 18px;
}
.session-hero .top { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.session-hero h2 { font-size: 20px; font-weight: 800; }
.session-hero .sub { color: rgba(233, 255, 246, .72); font-size: 13px; overflow-wrap: anywhere; }
.session-hero .sub a { color: #8FF5CB; }
.session-hero .stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
.session-hero .stat .k { font-size: 12px; color: rgba(233, 255, 246, .65); font-weight: 600; }
.session-hero .stat .v { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; }
.session-hero .stat .v small { font-size: 13px; color: rgba(233, 255, 246, .7); margin-left: 2px; }
.session-hero .pill { background: rgba(255, 255, 255, .12); color: #fff; }
.session-hero .pill.ok, .session-hero .pill.info { color: #6EF2BE; }
.session-hero .pill.bad { color: #FCA5A5; }
.session-hero .pill.warn { color: #FCD34D; }
.session-hero .btn { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .16); color: #fff; }
.session-hero .btn:hover:not(:disabled) { background: rgba(255, 255, 255, .18); }
.session-hero .btn.danger { background: #F04438; border-color: #F04438; }
.session-hero .meter { background: rgba(255, 255, 255, .14); }
.session-hero .meter > span { background: #6EF2BE; }

/* Pricing editor */
.tou-row { display: grid; grid-template-columns: minmax(120px, 1.2fr) auto minmax(190px, 1fr) minmax(120px, .8fr) auto; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.tou-row:last-child { border-bottom: 0; }
.tou-head { padding: 0 0 6px; border-bottom: 1px solid var(--border); font-size: 11.5px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; }
.days { display: inline-flex; gap: 3px; }
.days button {
  width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--dim);
  font-size: 11.5px; font-weight: 700; cursor: pointer; padding: 0;
}
.days button.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.time-range { display: flex; align-items: center; gap: 6px; }
.time-range .input { min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 12px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.chip button { border: 0; background: transparent; color: inherit; cursor: pointer; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; padding: 0; }
.chip button:hover { background: rgba(14, 159, 110, .15); }
.chip-add { display: inline-flex; gap: 6px; }
.chip-add .input { width: 110px; }
.preview-card { position: sticky; top: 84px; }
.preview-hero { padding: 20px 22px; border-radius: var(--radius) var(--radius) 0 0; background: linear-gradient(150deg, var(--hero-a), var(--hero-b)); color: #E9FFF6; }
.preview-hero .k { font-size: 12.5px; color: rgba(233, 255, 246, .7); font-weight: 600; }
.preview-hero .v { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.preview-hero .v small { font-size: 15px; color: rgba(233, 255, 246, .7); }
.dirty-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.err-list { margin: 4px 0 0; padding-left: 18px; }

/* Connect */
.url-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--inset); border: 1px solid var(--border); border-radius: 12px; min-width: 0; }
.url-row code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.url-row code .ph { color: var(--brand); font-weight: 700; }
.steps-num { counter-reset: s; list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.steps-num li { counter-increment: s; display: flex; gap: 12px; }
.steps-num li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: 13px; display: grid; place-items: center; flex: none; }
.steps-num b { font-weight: 700; }

/* ---------------------------------------------------------------- auth pages */
.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(14, 159, 110, .18), transparent 60%),
    radial-gradient(700px 500px at 110% 110%, rgba(14, 159, 110, .14), transparent 60%),
    var(--bg);
}
.auth-card { width: 100%; max-width: 420px; padding: 32px 30px 28px; box-shadow: var(--shadow-lg); }
.auth-card .brand { justify-content: center; padding: 0 0 22px; }
.auth-card h1 { font-size: 22px; font-weight: 800; text-align: center; }
.auth-card .lead { text-align: center; color: var(--dim); margin: 6px 0 22px; font-size: 13.5px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.auth-card .btn.primary { min-height: 42px; font-size: 14.5px; margin-top: 4px; }
.auth-foot { margin-top: 18px; display: flex; justify-content: center; }

/* ---------------------------------------------------------------- toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; max-width: calc(100vw - 32px); }
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; min-width: 260px; max-width: 420px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px;
  box-shadow: var(--shadow-lg); font-size: 13.5px; font-weight: 600; animation: toast-in .2s ease-out;
}
.toast .ti { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.toast .ti svg.i { width: 14px; height: 14px; stroke-width: 2.6; }
.toast.ok .ti { background: var(--ok-soft); color: var(--ok); }
.toast.bad .ti { background: var(--bad-soft); color: var(--bad); }
.toast.info .ti { background: var(--info-soft); color: var(--info); }
.toast .msg { flex: 1; min-width: 0; overflow-wrap: anywhere; padding-top: 2px; }
.toast .close { border: 0; background: none; cursor: pointer; color: var(--faint); padding: 2px; display: grid; }
.toast.out { animation: toast-out .18s ease-in forwards; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
@keyframes toast-out { to { transform: translateY(8px); opacity: 0; } }

/* ---------------------------------------------------------------- modal */
.modal-overlay { position: fixed; inset: 0; z-index: 90; background: var(--overlay); display: grid; place-items: center; padding: 16px; animation: fade .15s ease-out; }
.modal { width: 100%; max-width: 460px; max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; }
.modal.wide { max-width: 560px; }
.modal-head { display: flex; gap: 14px; align-items: flex-start; padding: 22px 22px 6px; }
.modal-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand); }
.modal-icon.danger { background: var(--bad-soft); color: var(--bad); }
.modal-icon.warn { background: var(--warn-soft); color: var(--warn); }
.modal-head h3 { font-size: 17px; font-weight: 800; }
.modal-head p { color: var(--dim); font-size: 13.5px; margin-top: 4px; }
.modal-body { padding: 14px 22px 4px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 22px 20px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(6px) scale(.98); opacity: 0; } }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-main { grid-template-columns: minmax(0, 1fr); }
  .preview-card { position: static; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: none; }
  .shell.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .shell.nav-open .backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: var(--overlay); }
  .main { margin-left: 0; }
  .topbar { padding: 10px 16px; gap: 10px; }
  .content { padding: 18px 16px 40px; gap: 16px; }
  .grid-3, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .tou-row { grid-template-columns: 1fr 1fr; }
  .tou-row .tou-name { grid-column: 1 / -1; }
  .tou-row .days { grid-column: 1 / -1; }
  .tou-head { display: none; }
}
@media (max-width: 640px) {
  .grid-4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 22px; }
  .kpi-top { font-size: 12px; }
  .kpi-icon { width: 28px; height: 28px; }
  .live .live-text { display: none; }
  .topbar h1 { font-size: 17px; }
  .seg.theme button span { display: none; }
  .seg.theme button { padding: 5px 7px; }
  .card-head, .card-body, .card-foot { padding-left: 16px; padding-right: 16px; }
  .table th:first-child, .table td:first-child { padding-left: 16px; }
  .table th:last-child, .table td:last-child { padding-right: 16px; }
  .kv > div { padding: 10px 16px; }
  .detail-head { padding: 16px; }
  .toolbar { padding: 12px 14px; }
  .toolbar .search { max-width: none; flex-basis: 100%; }
  .toolbar .select { flex: 1 1 0; min-width: 0; }
  .grid-auto { grid-template-columns: minmax(0, 1fr); }
  .chart-summary { padding: 0 16px 4px; gap: 18px; }
  .chart-wrap { padding: 8px 8px 12px; }
  .toasts { left: 16px; right: 16px; bottom: 16px; align-items: stretch; }
  .toast { max-width: none; min-width: 0; }
  .auth-card { padding: 26px 20px 22px; }
  .tou-row { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------------------------------------------------------------- utilities */
.spacer { flex: 1 1 auto; }
.grow { flex: 1 1 auto; min-width: 0; }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
details > summary { cursor: pointer; }
details > summary.label { padding: 4px 0; }

.grid-fit { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.log-scroll { max-height: 640px; overflow: auto; }
.log-scroll .table th { position: sticky; top: 0; z-index: 1; }
.card-head > div:first-child { flex: 1 1 240px; min-width: 0; }
@media (max-width: 640px) { .grid-fit { grid-template-columns: minmax(0, 1fr); } }
.savebar {
  position: sticky; bottom: 16px; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px 10px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); animation: toast-in .2s ease-out;
}

/* ---------------------------------------------------------------- stations, drivers, inbox */
.stack-sm { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hint svg.i, .section-title svg.i { vertical-align: -3px; }
.chips.tight { gap: 6px; }
.kv-list .v .chips { justify-content: flex-end; }
.textarea.prose { font-family: var(--font); font-size: 13.5px; line-height: 1.5; min-height: 64px; }
.card-body.divided { border-top: 1px solid var(--border); }
.avatar.muted { background: var(--inset); color: var(--faint); }
.big-initials { font-size: 18px; font-weight: 800; }

/* Charger checklist (station form) */
.check-list { display: flex; flex-direction: column; gap: 8px; }
.check-item {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius-sm); transition: background .12s, border-color .12s;
}
.check-item:hover { background: var(--inset); }
.check-item.on { border-color: var(--brand); background: var(--brand-soft); }
.check-item input { accent-color: var(--brand); width: 16px; height: 16px; flex: none; margin: 0; }
.check-item .primary-cell { font-weight: 700; }
.check-item .sub { font-size: 12px; color: var(--dim); }
.check-hint { margin: -4px 0 4px 24px; }

/* Charge point IDs (QR stickers) */
.code-list { display: flex; flex-direction: column; gap: 8px; }
.code-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 12px 10px 14px; background: var(--inset); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.code-row .conn-id { min-width: 86px; }
.cp-code { flex: 1 1 160px; min-width: 0; font-family: var(--mono); font-size: 17px; font-weight: 700; letter-spacing: .03em; color: var(--text); overflow-wrap: anywhere; user-select: all; }
.cp-code.sm { font-size: 12.5px; flex: none; }

/* Vehicles & plates */
.plate-text { font-weight: 700; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.vehicle-card { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; background: var(--inset); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.vehicle-card.current { border-color: var(--brand); }
.plate {
  display: inline-block; padding: 2px 10px; border: 2px solid var(--border-strong); border-radius: 7px; background: var(--surface);
  font-weight: 800; font-size: 15px; letter-spacing: .08em; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.vehicle-name { display: flex; align-items: center; gap: 6px; font-weight: 650; color: var(--dim); }

/* Inbox announcements */
.announce-list { list-style: none; margin: 0; padding: 0; }
.announce { display: flex; gap: 14px; align-items: flex-start; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.announce:last-child { border-bottom: 0; }
.announce-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--muted-soft); color: var(--muted); }
.announce-icon.info { background: var(--info-soft); color: var(--info); }
.announce-icon.ok { background: var(--ok-soft); color: var(--ok); }
.announce-title { font-size: 15px; overflow-wrap: anywhere; }
.announce-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; color: var(--text); }
.announce-link { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; font-size: 12.5px; font-weight: 600; }
.announce-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
@media (max-width: 640px) {
  .announce { padding: 14px 16px; gap: 10px; }
  .announce-icon { display: none; }
}

/* Other networks (external stations) */
.import-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.import-src { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; background: var(--inset); border: 1px solid var(--border); border-radius: var(--radius-sm); min-width: 0; }
.import-src .row { flex-wrap: nowrap; }
.import-src .primary-cell { font-weight: 700; }
.import-src .primary-cell a { color: var(--text); }
.import-src .sub { font-size: 12.5px; color: var(--dim); }
.import-src .btn .spinner { margin-right: 2px; }
.import-src code, .hint code { font-size: 11.5px; padding: 1px 5px; border-radius: 5px; background: var(--surface); border: 1px solid var(--border); overflow-wrap: anywhere; }
.announce-icon.brand { background: var(--brand-soft); color: var(--brand); }
.row-actions { display: inline-flex; align-items: center; gap: 2px; }
.table tr.row-hidden .primary-cell, .table tr.row-hidden .sub { color: var(--faint); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.check-grid .check-item { padding: 9px 12px; gap: 10px; }
.banner-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .import-src .row { flex-wrap: wrap; }
  .import-src .announce-icon { display: none; }
}

/* ---------------------------------------------------------------- maps (Google Maps) & address search */
.map-box { position: relative; z-index: 0; isolation: isolate; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--inset); }
.map-canvas { position: absolute; inset: 0; }
.map-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--dim); font-size: 13px; font-weight: 600; padding: 16px; text-align: center; }
.loc-picker { display: flex; flex-direction: column; gap: 10px; }
.loc-map { height: 340px; }
.loc-foot { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.loc-foot .hint { flex: 1 1 260px; overflow-wrap: anywhere; }
.loc-foot .hint .spinner { display: inline-block; vertical-align: -3px; margin-right: 4px; }
.loc-actions { gap: 6px; }
.map-card { overflow: hidden; }
.map-page { height: calc(100vh - 250px); min-height: 460px; border: 0; border-radius: 0; }
.map-foot { padding: 10px 22px; border-top: 1px solid var(--border); }
.layer-toggle { padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 12.5px; }
.layer-toggle .faint { font-weight: 600; }
.map-legend { display: inline-flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--dim); font-weight: 600; }
.map-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; background: #8A93A3; }
.legend-dot.ok { background: #0E9F6E; }
.legend-dot.warn { background: #D97706; }
.legend-dot.ext { background: #8A7FD0; }

/* Google Maps, themed */
.map-loading.map-error { color: var(--warn); background: var(--inset); z-index: 2; }
.map-loading.map-error > div { max-width: 420px; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.map-loading.map-error .hint { color: var(--dim); font-weight: 500; }
.map-box .gm-style { font-family: var(--font); }
.map-box .gm-style .gm-style-iw-c { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 12px 14px !important; }
.map-box .gm-style .gm-style-iw-d { overflow: auto !important; color: var(--text); }
.map-box .gm-style .gm-style-iw-tc::after { background: var(--surface); }
.map-box .gm-style .gm-style-iw-chr { position: absolute; top: 0; right: 0; }
.map-box .gm-style .gm-style-iw-ch { padding-top: 0; }
.map-box .gm-style .gm-ui-hover-effect > span { background-color: var(--dim) !important; }
.map-pop { display: flex; flex-direction: column; gap: 6px; min-width: 200px; font-size: 13px; line-height: 1.45; padding-right: 28px; }
.map-pop .mp-title { font-weight: 800; font-size: 14px; overflow-wrap: anywhere; }
.map-pop .mp-sub { color: var(--dim); font-size: 12.5px; overflow-wrap: anywhere; }
.map-pop .mp-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.map-pop .mp-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.map-pop .mp-actions.col { flex-direction: column; align-items: stretch; }
.map-pop a.btn { color: var(--text); }
.map-pop a.btn.primary { color: var(--brand-ink); }
.map-pop a.btn:hover { text-decoration: none; }

/* Address autocomplete – a plain one-line list (like Google's) */
.geo-wrap { position: relative; min-width: 0; }
.geo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 25; max-height: 300px; overflow-y: auto; padding: 4px 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); text-align: left;
}
.geo-list .geo-item {
  appearance: none; -webkit-appearance: none; display: block; width: 100%; margin: 0; padding: 8px 12px; border: 0; border-radius: 0;
  background: transparent; box-shadow: none; color: var(--dim); font: inherit; font-size: 13.5px; line-height: 1.4; text-align: left; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 0;
}
.geo-list .geo-item:hover, .geo-list .geo-item.active { background: var(--inset); }
.geo-list .geo-item:focus-visible { outline: none; background: var(--inset); }
.geo-list .geo-main { color: var(--text); font-weight: 500; }
.geo-list .geo-rest { color: var(--dim); }
.geo-list .geo-state { display: flex; align-items: center; gap: 8px; padding: 8px 12px; color: var(--dim); font-size: 13px; text-align: left; }
.geo-list .geo-state svg.i { position: static; transform: none; flex: none; }
.search .geo-wrap { width: 100%; }

/* Partners */
.link-row { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.link-row a { display: inline-flex; align-items: center; gap: 3px; }

@media (max-width: 900px) {
  .map-page { height: 60vh; min-height: 320px; }
}
@media (max-width: 640px) {
  .loc-map { height: 60vh; max-height: 420px; min-height: 260px; }
  .map-foot { padding: 10px 16px; }
  .map-legend { width: 100%; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------------------------------------------------------------- header back / help buttons */
.title-row { display: flex; align-items: center; gap: 4px; min-width: 0; }
.title-row h1 { min-width: 0; }
.help-btn { flex: none; color: var(--faint); }
.help-btn:hover:not(:disabled) { color: var(--brand); }
.back-btn { flex: none; padding: 6px 10px 6px 8px; gap: 6px; }
.back-btn svg.i { width: 18px; height: 18px; }
.help-body { display: flex; flex-direction: column; gap: 10px; color: var(--dim); font-size: 13.5px; line-height: 1.55; }
.help-body b { color: var(--text); }
.single-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
@media (max-width: 1200px) {
  .back-btn span { display: none; }
  .back-btn { width: 36px; padding: 0; }
}

/* ---------------------------------------------------------------- collapsible sidebar (desktop) */
.sidebar { transition: width .2s ease, padding .2s ease; overflow-x: hidden; }
.main { transition: margin-left .2s ease; }
.sidebar .signout-btn span { white-space: nowrap; }
@media (min-width: 901px) {
  .shell.collapsed { --sidebar-w: 68px; }
  .shell.collapsed .sidebar { padding-left: 10px; padding-right: 10px; }
  .shell.collapsed .brand { display: none; }
  .shell.collapsed .brand-row { justify-content: center; }
  .shell.collapsed .brand-text,
  .shell.collapsed .nav a span,
  .shell.collapsed .me-text,
  .shell.collapsed .signout-btn span { display: none; }
  .shell.collapsed .nav a { justify-content: center; padding: 0; }
  .shell.collapsed .brand-row { min-height: 50px; }
  .shell.collapsed .me { justify-content: center; padding: 4px 0; }
  .shell.collapsed .sidebar-foot .btn { padding-left: 0; padding-right: 0; justify-content: center; }
}


/* ---------------------------------------------------------------- simpler sidebar + section tabs */
.me-row { display: flex; align-items: center; gap: 4px; min-width: 0; }
.me-row .me { flex: 1; min-width: 0; }
.me-row .signout-btn { flex: none; color: var(--dim); width: 36px; height: 36px; }
.me-text { min-width: 0; }
.me-name, .me-email { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 901px) {
  .shell.collapsed .me-row { flex-direction: column; gap: 6px; }
}
.section-tabs {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  padding: 0 32px; border-bottom: 1px solid var(--border); background: var(--bg);
}
.section-tabs::-webkit-scrollbar { display: none; }
.section-tabs.hidden { display: none; }
.section-tab {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 12px 14px; color: var(--dim); font-weight: 600; font-size: 14px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.section-tab:hover { color: var(--text); text-decoration: none; }
.section-tab.active { color: var(--text); border-bottom-color: var(--brand); }
.section-tab.active svg.i { color: var(--brand); }
@media (max-width: 900px) {
  .section-tabs { padding: 0 12px; }
  .section-tab { padding: 11px 10px; font-size: 13.5px; }
}

/* Operator logo slots on the station form: preview on the background it will be shown on in the app. */
.logo-slot { display: flex; flex-direction: column; gap: 10px; }
.logo-preview {
  height: 96px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; padding: 12px; background: #FFFFFF;
}
.logo-slot.dark .logo-preview { background: #0E141B; border-color: #2A3746; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-slot label.btn.disabled { opacity: .5; pointer-events: none; }
