:root {
  color-scheme: light;
  --juice-green: #3edc8a;
  --deep-emerald: #1b5e20;
  --billing-green: #a5d6a7;
  --blush-peach: #ffc4c4;
  --soft-clay: #f9fafb;
  --matte-charcoal: #101010;
  --muted: #5d6b63;
  --line: rgba(16, 16, 16, 0.08);
  --panel: rgba(255, 255, 255, 0.82);
  --danger: #f06f78;
  --warning: #f7b267;
  --shadow: 0 18px 44px rgba(20, 70, 38, 0.1);
  --green-shadow: 0 14px 30px rgba(27, 94, 32, 0.2);
  --mint: #9cf2c3;
  --navy: #123329;
  --surface: #f4f8f5;
  --clay-shadow:
    inset 4px 4px 9px rgba(255, 255, 255, 0.72),
    inset -5px -5px 10px rgba(16, 16, 16, 0.1),
    0 12px 22px rgba(27, 94, 32, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  background:
    linear-gradient(90deg, #f7faf8 0 196px, #e9edf0 196px 197px, transparent 197px),
    radial-gradient(circle at 92% 8%, rgba(62, 220, 138, 0.18), transparent 28%),
    linear-gradient(135deg, #f5f7f6 0%, #eef2ef 48%, #f8f5f2 100%);
  color: var(--matte-charcoal);
}

button,
input,
select,
textarea {
  font: inherit;
}

.search-field {
  display: grid;
  gap: 0.4rem;
  margin: 0.8rem 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.search-field input {
  width: 100%;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 0.76rem 1.1rem;
  background: var(--juice-green);
  color: var(--matte-charcoal);
  cursor: pointer;
  font-family: "Fredoka", "Inter", sans-serif;
  font-weight: 650;
  box-shadow: 0 3px 10px rgba(27, 94, 32, 0.14);
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.1s ease;
}

button:hover {
  filter: saturate(1.06) brightness(1.02);
}

button:active {
  transform: scale(0.96);
  box-shadow: 0 1px 4px rgba(27, 94, 32, 0.12);
}

/* Premium operations theme -------------------------------------------------
   Deliberately layered after the original theme so the redesign is easy to
   review and revert without disturbing domain-specific component rules. */
:root {
  --juice-green: #22c55e;
  --deep-emerald: #0f766e;
  --matte-charcoal: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --panel: #ffffff;
  --surface: #f1f5f9;
  --navy: #0f172a;
  --danger: #dc2626;
  --warning: #d97706;
  --shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
  --clay-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

body {
  background: #f1f5f9;
  color: #0f172a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

button {
  min-height: 40px;
  border-radius: 9px;
  padding: 0.62rem 0.95rem;
  background: #16a34a;
  color: #fff;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.2);
}

button:hover { filter: brightness(0.97); }
button:active { transform: translateY(1px); }

button.secondary,
.text-link,
.secondary-link {
  background: #fff;
  color: #334155;
  border: 1px solid #cbd5e1;
  box-shadow: none;
}

button.secondary:hover,
.text-link:hover { background: #f8fafc; }

input, select, textarea {
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  padding: 0.7rem 0.78rem;
  background: #fff;
  color: #0f172a;
  box-shadow: none;
}

input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(37, 99, 235, 0.14);
  border-color: #2563eb;
}

.app {
  grid-template-columns: 228px minmax(0, 1fr);
  gap: 0 26px;
  padding: 0 28px 40px 0;
}

.tabs {
  width: 228px;
  padding: 22px 14px;
  background: #0b172a;
  box-shadow: 14px 0 30px rgba(15, 23, 42, 0.12);
}

.tabs button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 9px 12px;
  background: transparent;
  color: #94a3b8;
  font-size: 0.82rem;
  box-shadow: none;
}

.tabs button:hover { background: rgba(148, 163, 184, 0.1); color: #f8fafc; }

.tabs button.active {
  border-color: rgba(134, 239, 172, 0.3);
  background: #163b32;
  color: #f0fdf4;
  box-shadow: inset 3px 0 0 #4ade80;
}

.tabs button em {
  background: #22c55e;
  color: #052e16;
  font-weight: 850;
}

.nav-group {
  margin: 20px 10px 7px;
  color: #64748b;
  font-size: 0.64rem;
  letter-spacing: 0.14em;
}

.nav-group.quick { margin-top: 28px; }

.tabs button.quick-action {
  border: 1px dashed #334155;
  color: #cbd5e1;
  margin-top: 3px;
}

.tabs button.quick-action:hover { border-color: #4ade80; color: #f0fdf4; }

.topbar {
  margin: 22px 0 18px;
  padding: 22px 26px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.eyebrow { color: #64748b; font-size: 0.65rem; letter-spacing: 0.14em; }
.topbar h1 { color: #0f172a; font-size: clamp(1.65rem, 2.2vw, 2.25rem); letter-spacing: -0.06em; }
.topbar p { color: #64748b; }

.live-status {
  min-width: 190px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.live-status strong { color: #0f172a; }
.live-status.online .status-dot { background: #22c55e; box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.12); }

.metrics { gap: 14px; }
.metrics article, .panel {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.metrics article.metric-primary {
  min-height: 92px;
  padding: 17px;
  background: #fff;
}

.metrics span { color: #64748b; font-size: 0.72rem; letter-spacing: 0.01em; text-transform: uppercase; }
.metrics strong { margin-top: 7px; color: #0f766e; font-family: inherit; font-size: 1.48rem; font-weight: 800; }
.metrics small { color: #94a3b8; }

.panel { padding: 22px; margin-bottom: 18px; }
.panel h2 { color: #0f172a; font-size: 1.05rem; font-weight: 800; letter-spacing: -0.025em; }
.panel p, .hint { color: #64748b; }
.panel-head { gap: 16px; }

.ocpp-panel { border-left: 4px solid #2563eb; background: #f8fbff; }
.ocpp-panel code { border: 1px solid #bfdbfe; border-radius: 8px; background: #eff6ff; color: #1d4ed8; }
.action-panel { border-left: 4px solid #f59e0b; }
.alert-row { border-radius: 9px; }

.row {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  padding: 13px 14px;
}

.row strong { color: #1e293b; }
.row small { color: #64748b; }
.status-chip, .profile-chip { border-radius: 999px; font-weight: 750; }
.charger-mini { padding: 12px 0; border-bottom: 1px solid #eef2f7; }
.charger-map-panel { overflow: hidden; }
.charger-map { border-radius: 10px; }

.creator-mark {
  right: 22px;
  bottom: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: #94a3b8;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

@media (max-width: 900px) {
  .app { padding: 10px; }
  .topbar { margin-top: 0; }
  .tabs {
    width: 100%;
    background: #0b172a;
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
  }
  .tabs button { color: #cbd5e1; }
  .tabs button.active { color: #f0fdf4; }
}

@media (max-width: 620px) {
  .topbar { padding: 18px; border-radius: 12px; }
  .topbar h1 { font-size: 1.85rem; }
  .metrics article.metric-primary { min-height: 78px; padding: 14px; }
  .panel { padding: 16px; border-radius: 12px; }
  .creator-mark { right: 8px; bottom: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

button.secondary {
  background: rgba(255, 255, 255, 0.9);
  color: var(--deep-emerald);
  border: 1px solid rgba(27, 94, 32, 0.18);
  box-shadow: none;
}

button.secondary:hover {
  background: rgba(225, 248, 235, 0.9);
}

button.danger {
  background: var(--blush-peach);
  color: #6f1218;
  box-shadow:
    inset 4px 4px 8px rgba(255, 255, 255, 0.64),
    inset -4px -4px 8px rgba(111, 18, 24, 0.16),
    0 8px 16px rgba(255, 196, 196, 0.34);
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.78rem 0.9rem;
  background: rgba(255, 255, 255, 0.88);
  color: var(--matte-charcoal);
  box-shadow:
    inset 3px 3px 7px rgba(27, 94, 32, 0.07),
    inset -3px -3px 7px rgba(255, 255, 255, 0.8);
}

input:focus,
select:focus {
  outline: 3px solid rgba(62, 220, 138, 0.25);
  border-color: rgba(62, 220, 138, 0.68);
}

.password-field {
  position: relative;
  display: block;
  margin-top: 0.35rem;
}

.password-field input {
  margin-top: 0;
  padding-right: 3.15rem;
}

button.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.55rem;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0.52rem;
  border-radius: 50%;
  transform: translateY(-50%);
  background: transparent;
  color: var(--deep-emerald);
  box-shadow: none;
}

button.password-toggle:active {
  transform: translateY(-50%) scale(0.94);
  box-shadow: none;
}

.password-toggle svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-toggle.is-visible::after {
  content: "";
  position: absolute;
  left: 0.45rem;
  right: 0.45rem;
  top: 50%;
  height: 2px;
  background: currentColor;
  transform: rotate(-42deg);
}

.shell {
  max-width: none;
  margin: 0;
  padding: 0;
}

.app {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  gap: 0 18px;
  min-height: 100vh;
  padding: 0 16px 28px 0;
}

.hidden {
  display: none !important;
}

.connection-banner {
  margin: -8px 0 18px;
  padding: 12px 16px;
  border: 1px solid rgba(240, 111, 120, 0.45);
  border-radius: 18px;
  background: #fff3f3;
  color: #7a161d;
  font-weight: 700;
}

.toast-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1000;
  display: grid;
  gap: 10px;
  max-width: min(360px, calc(100vw - 36px));
}

.toast {
  padding: 12px 14px;
  border-radius: 16px;
  background: #f0fff6;
  border: 1px solid rgba(62, 220, 138, 0.4);
  color: var(--navy);
  box-shadow: var(--shadow);
  font-weight: 700;
}

.toast.error {
  background: #fff3f3;
  border-color: rgba(240, 111, 120, 0.45);
  color: #7a161d;
}

.login-panel {
  max-width: 430px;
  margin: 12vh auto 0;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  padding: 30px;
  box-shadow: var(--clay-shadow);
  backdrop-filter: blur(10px);
}

.login-panel h1,
.topbar h1,
.panel h2 {
  font-family: "Fredoka", "Inter", sans-serif;
  color: var(--deep-emerald);
}

.login-panel h1,
.topbar h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 4vw, 3.1rem);
  letter-spacing: 0;
}

.login-panel form,
.form {
  display: grid;
  gap: 12px;
}

.secondary-link {
  border: 0;
  background: transparent;
  color: var(--deep-emerald);
  font-weight: 800;
  text-decoration: underline;
  box-shadow: none;
  padding: 12px 0 0;
}

label {
  color: var(--muted);
  font-weight: 650;
  font-size: 0.9rem;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(243, 250, 246, 0.9);
}

.checkbox-field input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  accent-color: var(--juice-green);
}

.hint,
.topbar p {
  color: var(--muted);
}

.error-text {
  color: var(--danger) !important;
  font-weight: 700;
}

.readiness-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.readiness-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.readiness-item > span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex: 0 0 26px;
  font-weight: 900;
}

.readiness-item div {
  display: grid;
  gap: 3px;
}

.readiness-item small {
  color: var(--muted);
}

.readiness-item.ready > span {
  color: #067647;
  background: #d1fadf;
}

.readiness-item.warning > span {
  color: #93370d;
  background: #fef0c7;
}

.readiness-item.blocked > span {
  color: #b42318;
  background: #fee4e2;
}

.tariff-preview {
  display: block;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(8, 122, 62, 0.22);
  border-radius: 16px;
  background: rgba(225, 248, 235, 0.75);
  color: var(--deep-emerald);
  font-weight: 750;
  line-height: 1.45;
}

.tariff-modal-preview {
  position: sticky;
  bottom: 72px;
  z-index: 2;
  border-width: 2px;
  background: #e1f8eb;
  box-shadow: 0 9px 24px rgba(8, 122, 62, 0.16);
  font-size: 1rem;
}

.form :disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.topbar {
  grid-column: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin: 14px 0 14px;
  padding: 18px 22px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 84% 10%, rgba(62, 220, 138, 0.2), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(222, 241, 226, 0.9));
  box-shadow: var(--shadow);
}

.connection-banner,
.metrics,
.tab-panel {
  grid-column: 2;
}

.brand-block {
  display: grid;
  gap: 2px;
}

.eyebrow {
  color: #34815a;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.topbar-actions,
.live-status {
  display: flex;
  align-items: center;
  gap: 12px;
}

.live-status {
  min-width: 230px;
  padding: 10px 14px;
  border: 1px solid rgba(16, 16, 16, 0.07);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
}

.live-status div {
  display: grid;
  gap: 2px;
}

.live-status strong {
  color: var(--navy);
  font-size: 0.84rem;
}

.live-status small {
  color: var(--muted);
  font-size: 0.72rem;
}

.status-dot {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 0 5px rgba(247, 178, 103, 0.14);
}

.live-status.online .status-dot {
  background: var(--juice-green);
  box-shadow: 0 0 0 5px rgba(62, 220, 138, 0.14);
}

.live-status.warning .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(240, 111, 120, 0.14);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric-wall {
  margin-bottom: 16px;
}

/* Network KPIs are useful on Overview, but distract from the work on detail
   pages. The tab controller keeps this state in sync for keyboard and click
   navigation alike. */
.app[data-tab]:not([data-tab="dashboard"]) .metric-wall {
  display: none;
}

.metric-wall > .metrics,
.secondary-metrics .metrics {
  margin-bottom: 0;
}

.secondary-metrics {
  margin-top: 10px;
}

.secondary-metrics summary {
  width: max-content;
  cursor: pointer;
  color: var(--deep-emerald);
  font-weight: 800;
  padding: 8px 12px;
}

.secondary-metrics[open] summary {
  margin-bottom: 10px;
}

.inline-controls .compact-field {
  display: inline-grid;
  gap: 3px;
  min-width: 145px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.inline-controls .compact-field input {
  min-height: 38px;
}

.pagination-controls {
  justify-content: flex-end;
  margin-top: 12px;
}

.pagination-controls span {
  min-width: 110px;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}

.metrics article,
.panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(20, 70, 38, 0.07);
}

.metrics article {
  padding: 12px 14px;
  min-height: 72px;
}

.metrics article.metric-primary {
  min-height: 82px;
  grid-column: span 1;
  padding: 15px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.96), rgba(229, 244, 233, 0.86));
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 700;
}

.metrics strong {
  display: block;
  margin-top: 8px;
  font-family: "Fredoka", "Inter", sans-serif;
  font-size: 1.48rem;
  color: var(--deep-emerald);
}

.metrics small {
  display: block;
  margin-top: 7px;
  color: #718078;
  font-size: 0.72rem;
}

.tabs {
  grid-column: 1;
  grid-row: 1 / span 20;
  align-self: start;
  display: grid;
  gap: 3px;
  margin: 0;
  position: sticky;
  top: 0;
  z-index: 25;
  height: 100vh;
  overflow-y: auto;
  padding: 16px 7px;
  border: 0;
  border-radius: 0;
  background: rgba(250, 251, 250, 0.96);
  box-shadow: 10px 0 30px rgba(16, 16, 16, 0.05);
  backdrop-filter: blur(14px);
}

.tabs button {
  width: 100%;
  min-height: 38px;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 8px;
  text-align: left;
  border: 1px solid rgba(16, 16, 16, 0.18);
  border-radius: 7px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--matte-charcoal);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-weight: 700;
  box-shadow:
    inset 1px 1px 2px rgba(255, 255, 255, 0.8),
    0 1px 2px rgba(16, 16, 16, 0.04);
}

.tabs button.active {
  border-color: rgba(27, 94, 32, 0.45);
  background: linear-gradient(90deg, rgba(62, 220, 138, 0.18), rgba(255, 255, 255, 0.96));
  color: #0d3f22;
  box-shadow: inset 4px 0 0 var(--juice-green), 0 2px 6px rgba(27, 94, 32, 0.08);
}

.tabs button em {
  min-width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 99px;
  background: #1ba45a;
  color: #fff;
  font-size: 0.68rem;
  font-style: normal;
}

.tabs button.quick-action {
  grid-template-columns: 24px 1fr;
  border-style: dashed;
  color: #272a2f;
}

.nav-group {
  margin: 16px 7px 5px;
  color: #9aa2ad;
  font-size: 0.69rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-group:first-child {
  margin-top: 0;
}

.nav-group.quick {
  margin-top: 24px;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.two {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.panel {
  padding: 21px;
  margin-bottom: 18px;
}

.dashboard-split {
  grid-template-columns: minmax(360px, 1fr) minmax(360px, 1fr);
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 1.22rem;
  letter-spacing: 0;
}

.panel p {
  margin: 0;
  color: var(--muted);
}

.panel-head,
.inline-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inline-controls {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.inline-controls select {
  max-width: 360px;
}

.period-control {
  display: grid;
  min-width: 180px;
  gap: 5px;
}

.ocpp-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 1.2fr);
  align-items: center;
  gap: 18px;
  background: rgba(255, 255, 255, 0.92);
}

.action-panel {
  background: rgba(255, 255, 255, 0.92);
}

.action-panel .panel-head small {
  color: var(--muted);
}

.action-list {
  gap: 8px;
}

.alert-row {
  width: 100%;
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  text-align: left;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  box-shadow: none;
}

.alert-row strong {
  color: #20302a;
  font-size: 0.87rem;
}

.alert-row em {
  color: #0b4aa2;
  font-size: 0.8rem;
  font-style: normal;
  text-decoration: underline;
}

.alert-row.critical {
  border: 1px solid rgba(240, 111, 120, 0.48);
  background: #fff4f4;
}

.alert-row.critical span {
  color: #e12632;
}

.alert-row.warning {
  border: 1px solid rgba(247, 178, 103, 0.62);
  background: #fff9eb;
}

.alert-row.warning span {
  color: #d48400;
}

.alert-row.info {
  border: 1px solid rgba(69, 146, 255, 0.35);
  background: #eef6ff;
}

.alert-row.info span {
  color: #1f6fd3;
}

.text-link {
  padding: 0;
  background: transparent;
  box-shadow: none;
  color: #0b7a35;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 0.82rem;
}

.charger-mini {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(16, 16, 16, 0.07);
}

.charger-mini:last-child {
  border-bottom: 0;
}

.charger-mini strong {
  font-size: 0.9rem;
  color: #12231b;
}

.charger-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #20ad5b;
  box-shadow: 0 0 0 4px rgba(32, 173, 91, 0.12);
}

.charger-mini.offline .charger-dot {
  background: #df2d36;
  box-shadow: 0 0 0 4px rgba(223, 45, 54, 0.12);
}

.status-chip {
  display: inline-flex;
  margin-left: 5px;
  padding: 4px 8px;
  border-radius: 99px;
  background: #e7f8ee;
  color: #087736;
  font-size: 0.72rem;
  font-weight: 700;
}

.status-chip.charging {
  background: #e8f0ff;
  color: #1557c0;
}

.status-chip.faulted,
.status-chip.unavailable,
.status-chip.offline {
  background: #ffe7e7;
  color: #b1121d;
}

.status-chip.finishing,
.status-chip.suspendedev,
.status-chip.suspendedevse {
  background: #fff2d8;
  color: #9a5b00;
}

.status-chip.unknown {
  background: #eef0f2;
  color: #6b7280;
}

.ocpp-panel code,
.panel code {
  display: block;
  overflow-wrap: anywhere;
  border: 1px solid rgba(27, 94, 32, 0.1);
  border-radius: 18px;
  padding: 13px;
  background: rgba(249, 250, 251, 0.86);
  color: var(--deep-emerald);
  font-size: 0.96rem;
  box-shadow:
    inset 3px 3px 8px rgba(27, 94, 32, 0.08),
    inset -3px -3px 8px rgba(255, 255, 255, 0.9);
}

.list {
  display: grid;
  gap: 11px;
}

.charger-directory-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.charger-directory-head h2 {
  margin-bottom: 5px;
}

.map-key {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.map-key span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.map-key-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.map-key-dot.online { background: var(--juice-green); }
.map-key-dot.offline { background: var(--danger); }

.charger-map-panel {
  padding: 0;
  overflow: hidden;
}

.charger-map {
  width: 100%;
  min-height: 430px;
  background: #eaf2ed;
}

.charger-map-marker {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 4px solid #fff;
  border-radius: 50%;
  box-shadow: 0 5px 16px rgba(5, 38, 22, 0.3);
  cursor: pointer;
}

.charger-map-marker.online { background: var(--juice-green); }
.charger-map-marker.offline { background: var(--danger); }

.charger-map-popup {
  display: grid;
  gap: 4px;
  min-width: 150px;
  color: var(--deep-emerald);
}

.charger-map-popup strong { font-size: 1rem; }
.charger-map-popup small { color: var(--muted); }
.online-text { color: var(--juice-green); font-weight: 800; }
.offline-text { color: var(--danger); font-weight: 800; }

.map-empty {
  min-height: 210px;
  display: grid;
  place-content: center;
  gap: 7px;
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.map-empty strong {
  color: var(--deep-emerald);
  font-size: 1.1rem;
}

.charger-directory-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(16, 16, 16, 0.07);
  border-left: 6px solid var(--juice-green);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(10, 55, 31, 0.06);
}

.charger-directory-card.offline { border-left-color: var(--danger); }

body.customer-view #chargersTab .grid.two {
  grid-template-columns: 1fr;
}

.charger-directory-card header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
}

.charger-directory-card h3,
.charger-directory-card p { margin: 0; }

.charger-directory-card h3 { color: var(--deep-emerald); }
.charger-directory-card p { color: var(--muted); }

.charger-directory-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  background: #e6f8ed;
  color: var(--juice-green);
  font-size: 1.35rem;
}

.directory-status {
  padding: 6px 9px;
  border-radius: 999px;
  background: #ddf8e8;
  color: var(--juice-green);
  font-size: 0.74rem;
  font-weight: 900;
}

.charger-directory-card.offline .directory-status {
  background: #fee7e7;
  color: var(--danger);
}

.charger-capacity {
  display: grid;
  gap: 2px;
  padding: 13px 15px;
  border-radius: 14px;
  background: #f1f8f4;
}

.charger-capacity small { color: var(--muted); }
.charger-capacity strong { color: var(--deep-emerald); font-size: 1.25rem; }

.directory-connectors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.directory-connector {
  display: grid;
  gap: 2px;
  min-width: 130px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.directory-connector small { color: var(--muted); }

.row {
  border: 1px solid rgba(16, 16, 16, 0.06);
  border-radius: 10px;
  padding: 13px;
  display: grid;
  gap: 6px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 12px rgba(16, 16, 16, 0.035);
}

.row strong {
  font-family: "Fredoka", "Inter", sans-serif;
  font-size: 1rem;
  color: var(--deep-emerald);
}

.row small {
  color: var(--muted);
  line-height: 1.4;
}

.row.pending {
  border-color: rgba(247, 178, 103, 0.5);
  background: #fff8ed;
}

.row.error {
  border-color: rgba(255, 196, 196, 0.84);
  background: #fff3f3;
}

.row.success {
  border-color: rgba(62, 220, 138, 0.42);
  background: #f0fff6;
}

.row button {
  justify-self: start;
  margin-top: 7px;
  padding: 0.56rem 0.86rem;
}

.driver-command {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background:
    radial-gradient(circle at 90% 10%, rgba(62, 220, 138, 0.16), transparent 28%),
    rgba(255, 255, 255, 0.92);
}

.driver-row {
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.driver-row:hover {
  transform: translateY(-1px);
  border-color: rgba(62, 220, 138, 0.45);
}

.modal-card.driver-detail {
  width: min(920px, calc(100vw - 36px));
  max-width: 920px;
  overflow-x: hidden;
}

.driver-detail h3 {
  margin: 18px 0 8px;
  color: var(--navy);
  font-size: 0.95rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.detail-grid section,
.detail-line {
  min-width: 0;
  border: 1px solid rgba(16, 16, 16, 0.07);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.78);
}

.detail-list {
  display: grid;
  gap: 8px;
}

.detail-line {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.detail-line strong,
.detail-line span,
.detail-line small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.detail-line strong {
  color: var(--deep-emerald);
}

.detail-line span {
  color: var(--muted);
  font-size: 0.86rem;
}

.detail-line small {
  grid-column: 1 / -1;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.detail-actions button {
  margin-top: 0;
}

.vehicle-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vehicle-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  border-radius: 16px;
  padding: 8px 9px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(249, 250, 251, 0.82);
}

.vehicle-pill.inactive {
  background: #fff3f3;
}

.vehicle-pill button {
  margin: 0;
  padding: 0.38rem 0.58rem;
  border-radius: 14px;
  font-size: 0.78rem;
}

.bars {
  display: grid;
  gap: 10px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
}

body.customer-view #dashboardTab {
  display: flex;
  flex-direction: column;
}

body.customer-view .app {
  grid-template-columns: minmax(0, 1fr);
  padding-left: 16px;
}

/* Desktop customer/impersonation mode uses a compact horizontal navigator.
   The admin sidebar normally spans the full viewport; leaving that geometry
   active after collapsing to one column stretches the two customer tabs into
   full-screen blocks. */
@media (min-width: 901px) {
  body.customer-view .app {
    display: grid;
    width: min(100%, 1440px);
    margin: 0 auto;
    padding: 0 18px 32px;
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: max-content;
    gap: 0;
  }

  body.customer-view .topbar {
    margin: 14px 0 10px;
  }

  body.customer-view .tabs {
    grid-column: 1;
    grid-row: auto;
    display: flex;
    width: 100%;
    height: auto;
    max-height: none;
    align-self: stretch;
    align-items: center;
    gap: 8px;
    position: sticky;
    top: 0;
    overflow-x: auto;
    overflow-y: hidden;
    margin: 0 0 14px;
    padding: 10px;
    border: 1px solid rgba(27, 94, 32, 0.1);
    border-radius: 16px;
    box-shadow: 0 8px 22px rgba(16, 16, 16, 0.07);
  }

  body.customer-view .tabs button {
    flex: 0 0 auto;
    width: auto;
    min-width: max-content;
    min-height: 42px;
    grid-template-columns: 22px auto auto;
  }
}

.alert-row {
  grid-template-columns: 1fr auto;
  padding: 0;
  overflow: hidden;
}

.alert-main {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  box-shadow: none;
}

.alert-ack {
  min-height: 32px;
  margin-right: 9px;
  padding: .4rem .65rem;
  font-size: .72rem;
  white-space: nowrap;
}

/* Final cascade for the premium theme. */
body { background: #f1f5f9; color: #0f172a; font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
button { min-height: 40px; border-radius: 9px; padding: .62rem .95rem; background: #16a34a; color: #fff; font-family: inherit; font-size: .82rem; font-weight: 750; box-shadow: 0 4px 12px rgba(22,163,74,.2); }
button.secondary, .text-link, .secondary-link { background: #fff; color: #334155; border: 1px solid #cbd5e1; box-shadow: none; }
input, select, textarea { border: 1px solid #cbd5e1; border-radius: 9px; padding: .7rem .78rem; background: #fff; color: #0f172a; box-shadow: none; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(37,99,235,.14); border-color: #2563eb; }
.app { grid-template-columns: 228px minmax(0, 1fr); gap: 0 26px; padding: 0 28px 40px 0; }
.tabs { width: 228px; padding: 22px 14px; background: #0b172a; box-shadow: 14px 0 30px rgba(15,23,42,.12); }
.tabs button { min-height: 42px; border: 1px solid transparent; border-radius: 9px; padding: 9px 12px; background: transparent; color: #94a3b8; font-family: inherit; font-size: .82rem; box-shadow: none; }
.tabs button:hover { background: rgba(148,163,184,.1); color: #f8fafc; }
.tabs button.active { border-color: rgba(134,239,172,.3); background: #163b32; color: #f0fdf4; box-shadow: inset 3px 0 0 #4ade80; }
.tabs button em { background: #22c55e; color: #052e16; font-weight: 850; }
.nav-group { margin: 20px 10px 7px; color: #64748b; font-size: .64rem; letter-spacing: .14em; }
.tabs button.quick-action { border: 1px dashed #334155; color: #cbd5e1; margin-top: 3px; }
.topbar { margin: 22px 0 18px; padding: 22px 26px; border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; box-shadow: 0 14px 34px rgba(15,23,42,.07); }
.eyebrow { color: #64748b; font-size: .65rem; letter-spacing: .14em; }
.topbar h1 { color: #0f172a; font-size: clamp(1.65rem,2.2vw,2.25rem); letter-spacing: -.06em; }
.topbar p { color: #64748b; }
.live-status { min-width: 190px; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; }
.metrics article, .panel { border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; box-shadow: 0 14px 34px rgba(15,23,42,.07); }
.metrics article.metric-primary { min-height: 92px; padding: 17px; background: #fff; }
.metrics span { color: #64748b; font-size: .72rem; text-transform: uppercase; }
.metrics strong { color: #0f766e; font-family: inherit; font-size: 1.48rem; font-weight: 800; }
.metrics small { color: #94a3b8; }
.panel { padding: 22px; margin-bottom: 18px; }
.panel h2 { color: #0f172a; font-size: 1.05rem; font-weight: 800; letter-spacing: -.025em; }
.panel p, .hint { color: #64748b; }
.ocpp-panel { border-left: 4px solid #2563eb; background: #f8fbff; }
.ocpp-panel code { border: 1px solid #bfdbfe; border-radius: 8px; background: #eff6ff; color: #1d4ed8; }
.action-panel { border-left: 4px solid #f59e0b; }
.row { border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; padding: 13px 14px; }
.row strong { color: #1e293b; }
.row small { color: #64748b; }
.charger-mini { padding: 12px 0; border-bottom: 1px solid #eef2f7; }
.creator-mark { right: 22px; bottom: 14px; border: 1px solid #e2e8f0; border-radius: 8px; background: rgba(255,255,255,.92); color: #94a3b8; box-shadow: 0 4px 12px rgba(15,23,42,.08); }

@media (max-width: 900px) {
  .app { padding: 10px; }
  .topbar { margin-top: 0; }
  .tabs { width: 100%; background: #0b172a; border-radius: 12px; box-shadow: 0 8px 18px rgba(15,23,42,.12); }
  .tabs button { color: #cbd5e1; }
}

@media (max-width: 620px) {
  .topbar { padding: 18px; border-radius: 12px; }
  .topbar h1 { font-size: 1.85rem; }
  .metrics article.metric-primary { min-height: 78px; padding: 14px; }
  .panel { padding: 16px; border-radius: 12px; }
  .creator-mark { right: 8px; bottom: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

body.customer-view .topbar,
body.customer-view .connection-banner,
body.customer-view .metrics,
body.customer-view .tab-panel {
  grid-column: 1;
}

body.customer-view #userStatsPanel {
  order: -2;
}

body.customer-view #paymentPanel {
  order: -1;
}

body.customer-view #userStatsPanel > h2 {
  margin-bottom: 8px;
}

.dashboard-disclosure {
  margin: 0 0 16px;
  border: 1px solid #dbe4ef;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.045);
  overflow: hidden;
}

.dashboard-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
  color: #0f172a;
}

.dashboard-disclosure > summary::-webkit-details-marker { display: none; }

.dashboard-disclosure > summary::after {
  content: "⌄";
  color: #64748b;
  font-size: 1.25rem;
  line-height: 1;
  transition: transform 0.18s ease;
}

.dashboard-disclosure[open] > summary::after { transform: rotate(180deg); }

.dashboard-disclosure > summary > span {
  display: grid;
  gap: 3px;
}

.dashboard-disclosure > summary strong {
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.dashboard-disclosure > summary small {
  color: #64748b;
  font-size: 0.76rem;
}

.dashboard-disclosure > summary em {
  display: grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 800;
}

.dashboard-disclosure[open] > summary {
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.dashboard-disclosure[open] > summary em {
  background: #dcfce7;
  color: #166534;
}

.dashboard-disclosure .disclosure-panel {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #f8fafc;
}

@media (max-width: 620px) {
  .dashboard-disclosure > summary { min-height: 62px; padding: 13px 14px; }
  .dashboard-disclosure > summary small { max-width: 245px; }
}

.stat-card {
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 20px;
  padding: 13px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow:
    inset 3px 3px 7px rgba(255, 255, 255, 0.72),
    inset -3px -3px 7px rgba(27, 94, 32, 0.08);
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.stat-card strong {
  display: block;
  margin-top: 6px;
  font-family: "Fredoka", "Inter", sans-serif;
  font-size: 1.28rem;
  color: var(--deep-emerald);
}

.wallet-hero-card {
  grid-column: span 2;
  display: flex;
  min-width: 0;
  min-height: 142px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 24px;
  padding: 20px 22px;
  background:
    radial-gradient(circle at 88% 10%, rgba(255, 255, 255, 0.24), transparent 30%),
    linear-gradient(135deg, #087736, #14964d);
  color: #fff;
  box-shadow: 0 16px 30px rgba(8, 119, 54, 0.22);
}

.wallet-hero-card > div:first-child {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.wallet-hero-card span {
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  opacity: 0.88;
}

.wallet-hero-card strong {
  margin: 1px 0 3px;
  font-family: "Fredoka", "Inter", sans-serif;
  font-size: clamp(2rem, 4vw, 3.15rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.wallet-hero-card small {
  line-height: 1.35;
  opacity: 0.86;
}

.wallet-hero-icon {
  display: grid;
  flex: 0 0 auto;
  width: 66px;
  height: 66px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.16);
  font-family: "Fredoka", "Inter", sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  box-shadow: inset 3px 3px 7px rgba(255, 255, 255, 0.15);
}

.wallet-tariff-price {
  width: fit-content;
  margin-top: 7px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 0.86rem !important;
  font-weight: 850 !important;
  opacity: 1 !important;
}

.user-profile-section {
  grid-column: 1 / -1;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(27, 94, 32, 0.1);
  border-radius: 22px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow:
    inset 3px 3px 8px rgba(255, 255, 255, 0.72),
    0 10px 24px rgba(27, 94, 32, 0.07);
}

.user-profile-half {
  grid-column: span 2;
}

.user-profile-invoices {
  background:
    radial-gradient(circle at 90% 10%, rgba(62, 220, 138, 0.2), transparent 28%),
    linear-gradient(135deg, rgba(236, 251, 242, 0.96), rgba(255, 255, 255, 0.92));
}

.user-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.user-section-heading.compact {
  align-items: center;
  margin-bottom: 12px;
}

.user-section-heading h3 {
  margin: 3px 0 0;
  color: var(--deep-emerald);
  font-size: 1.08rem;
}

.user-section-heading p {
  max-width: 720px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.section-kicker {
  color: #087736;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.section-count,
.invoice-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 99px;
  background: #e7f8ee;
  color: #087736;
  font-size: 0.72rem;
  font-weight: 800;
}

.invoice-badge {
  min-width: 54px;
  min-height: 54px;
  border: 1px solid rgba(27, 94, 32, 0.12);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--green-shadow);
  font-size: 0.82rem;
}

.user-invoice-controls {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(150px, 220px) max-content;
  align-items: end;
  gap: 12px;
}

.user-invoice-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.user-invoice-controls button {
  min-height: 46px;
}

.user-asset-list,
.user-session-list,
.user-ledger-list {
  display: grid;
  gap: 9px;
}

.user-asset-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 11px;
  border: 1px solid rgba(16, 16, 16, 0.07);
  border-radius: 16px;
  background: rgba(249, 250, 251, 0.88);
}

.user-asset-card > div:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.user-asset-card strong,
.user-asset-card small {
  overflow-wrap: anywhere;
}

.user-asset-card strong {
  color: var(--deep-emerald);
}

.user-asset-card small {
  color: var(--muted);
  line-height: 1.35;
}

.user-asset-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 13px;
  background: #e7f8ee;
  color: #087736;
  font-size: 0.7rem;
  font-weight: 900;
}

.profile-chip,
.initiation-chip {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 4px 8px;
  border-radius: 99px;
  background: #eef0f2;
  color: #5d6670;
  font-size: 0.7rem;
  font-weight: 750;
}

.profile-chip.active {
  background: #e7f8ee;
  color: #087736;
}

.profile-chip.inactive {
  background: #ffe7e7;
  color: #b1121d;
}

.initiation-chip {
  margin-top: 7px;
  background: #f0eafa;
  color: #67428c;
}

.user-session-card {
  display: grid;
  grid-template-columns: minmax(230px, 1.25fr) minmax(110px, 0.45fr) minmax(220px, 0.7fr) auto;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid rgba(16, 16, 16, 0.07);
  border-radius: 16px;
  background: rgba(249, 250, 251, 0.88);
}

.user-session-main,
.user-session-measure,
.user-session-cost {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.user-session-main strong,
.user-session-measure strong,
.user-session-cost strong {
  color: var(--deep-emerald);
  overflow-wrap: anywhere;
}

.user-session-main small,
.user-session-measure small,
.user-session-cost small {
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.user-session-card .status-chip {
  margin-left: 0;
  white-space: nowrap;
}

.user-ledger-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.8fr) auto;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(16, 16, 16, 0.07);
}

.user-ledger-row:last-child {
  border-bottom: 0;
}

.user-ledger-row > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.user-ledger-row strong,
.user-ledger-row span,
.user-ledger-row small {
  overflow-wrap: anywhere;
}

.user-ledger-row > div > strong {
  color: var(--deep-emerald);
}

.user-ledger-row small,
.ledger-card-ref {
  color: var(--muted);
}

.ledger-amount {
  justify-self: end;
  white-space: nowrap;
}

.ledger-amount.positive {
  color: #087736;
}

.ledger-amount.negative {
  color: #b1121d;
}

.profile-empty {
  padding: 16px;
  border: 1px dashed rgba(27, 94, 32, 0.18);
  border-radius: 15px;
  color: var(--muted);
  text-align: center;
}

.bar {
  display: grid;
  grid-template-columns: 160px 1fr 80px;
  gap: 10px;
  align-items: center;
}

.bar progress {
  appearance: none;
  border: 0;
  width: 100%;
  height: 13px;
  border-radius: 99px;
  overflow: hidden;
}

.bar progress::-webkit-progress-bar {
  background: var(--soft);
}

.bar progress::-webkit-progress-value,
.bar progress::-moz-progress-bar {
  background: linear-gradient(90deg, var(--deep-emerald), var(--juice-green), var(--billing-green));
  border-radius: 99px;
  box-shadow:
    inset 2px 2px 4px rgba(255, 255, 255, 0.5),
    0 6px 12px rgba(62, 220, 138, 0.24);
}

.creator-mark {
  position: fixed;
  right: 14px;
  bottom: 10px;
  z-index: 20;
  padding: 7px 11px;
  border-radius: 16px;
  background: rgba(249, 250, 251, 0.78);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  box-shadow:
    inset 2px 2px 5px rgba(255, 255, 255, 0.8),
    inset -2px -2px 5px rgba(27, 94, 32, 0.08),
    0 8px 18px rgba(16, 16, 16, 0.08);
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(16, 16, 16, 0.38);
  backdrop-filter: blur(8px);
}

.modal-card {
  width: min(520px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 24px;
  padding: 22px;
  background: var(--panel);
  box-shadow: var(--clay-shadow);
}

.modal-card h2 {
  margin: 0 0 8px;
  font-family: "Fredoka", "Inter", sans-serif;
  color: var(--deep-emerald);
  letter-spacing: 0;
}

.modal-card p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.45;
  white-space: pre-line;
}

.modal-form {
  display: grid;
  gap: 12px;
}

.form-section {
  display: grid;
  gap: 3px;
  padding-top: 10px;
  border-top: 1px solid rgba(20, 51, 37, 0.12);
  color: var(--ink);
}

.form-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.form-section small {
  color: var(--muted);
  font-weight: 400;
  line-height: 1.35;
}

.scan-status {
  display: grid;
  gap: 5px;
  margin: 14px 0;
  padding: 20px;
  border-radius: 18px;
  color: #fff;
  box-shadow: 0 10px 28px rgba(20, 51, 37, 0.14);
}

.scan-status strong {
  font-size: clamp(1.9rem, 7vw, 2.8rem);
  line-height: 1;
  letter-spacing: 0.06em;
}

.scan-status span {
  font-weight: 650;
  line-height: 1.4;
}

.scan-status--online {
  background: linear-gradient(135deg, #087a3e, #12a760);
}

.scan-status--offline {
  background: linear-gradient(135deg, #b91c1c, #ef4444);
  border: 3px solid #7f1d1d;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.modal-actions button.secondary {
  background: rgba(255, 255, 255, 0.78);
  color: var(--matte-charcoal);
}

.qr-modal {
  max-width: 560px;
}

.qr-modal video {
  width: 100%;
  min-height: 260px;
  border-radius: 20px;
  background: #0b1f14;
  object-fit: cover;
  box-shadow: inset 0 0 0 2px rgba(18, 201, 120, 0.35);
}

.qr-image {
  width: min(320px, 80vw);
  height: auto;
  display: block;
  margin: 12px auto;
  padding: 14px;
  border-radius: 18px;
  background: white;
  box-shadow: var(--clay-shadow);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--juice-green), var(--mint));
  color: #03170b;
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--green-shadow);
}

@media (max-width: 900px) {
  body {
    background: linear-gradient(135deg, #f5f7f6 0%, #eef2ef 48%, #f8f5f2 100%);
  }

  .app {
    display: flex;
    flex-direction: column;
    padding: 12px;
  }

  .topbar {
    order: 0;
  }

  .connection-banner {
    order: 1;
  }

  .tabs {
    order: 2;
    display: flex;
    width: 100%;
    max-width: 100%;
    align-self: stretch;
    align-items: center;
    gap: 8px;
    height: auto;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    position: sticky;
    top: 0;
    margin-bottom: 12px;
    padding: 10px;
    border-radius: 16px;
    scrollbar-width: thin;
  }

  .nav-group {
    display: none;
  }

  .tabs button {
    flex: 0 0 auto;
    width: auto;
    min-width: max-content;
    grid-template-columns: 22px auto auto;
  }

  .metrics,
  .grid.two,
  .dashboard-split,
  .ocpp-panel,
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .metrics {
    order: 3;
  }

  .tab-panel {
    order: 4;
  }

  .metrics article.metric-primary {
    grid-column: span 1;
  }

  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .detail-grid,
  .detail-line {
    grid-template-columns: 1fr;
  }

  .detail-actions {
    justify-content: flex-start;
  }

  .user-profile-half {
    grid-column: span 1;
  }

  .user-session-card {
    grid-template-columns: minmax(210px, 1fr) minmax(100px, auto) minmax(190px, auto);
  }

  .user-session-card .status-chip {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .shell {
    padding: 0;
  }

  .metrics,
  .grid.two,
  .dashboard-split,
  .ocpp-panel,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .live-status {
    min-width: 0;
  }

  .tabs {
    border-radius: 14px;
  }

  body.customer-view .app {
    padding: 8px;
  }

  body.customer-view .topbar {
    padding: 18px;
  }

  body.customer-view .topbar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .charger-directory-head,
  .charger-directory-card header {
    align-items: flex-start;
  }

  .charger-directory-head {
    flex-direction: column;
  }

  .charger-map {
    min-height: 330px;
  }

  .charger-directory-card header {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .directory-status {
    grid-column: 1 / -1;
    justify-self: start;
  }

  body.customer-view #exitPreviewBtn,
  body.customer-view #scanQrBtn {
    grid-column: 1 / -1;
  }

  .modal-backdrop {
    place-items: start center;
    padding: 8px;
    overflow-y: auto;
  }

  .modal-card,
  .modal-card.driver-detail {
    width: 100%;
    max-width: 100%;
    max-height: none;
    border-radius: 18px;
    padding: 16px;
  }

  .driver-detail .panel-head {
    align-items: flex-start;
  }

  .driver-detail .panel-head h2 {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .detail-actions button {
    flex: 1 1 110px;
  }

  .user-profile-half {
    grid-column: 1 / -1;
  }

  .wallet-hero-card {
    grid-column: 1 / -1;
    min-height: 132px;
    padding: 18px;
  }

  .wallet-hero-icon {
    width: 52px;
    height: 52px;
    border-radius: 18px;
  }

  .user-profile-section {
    padding: 14px;
    border-radius: 18px;
  }

  .user-section-heading {
    gap: 10px;
  }

  .invoice-badge {
    min-width: 44px;
    min-height: 44px;
  }

  .user-invoice-controls,
  .user-session-card,
  .user-ledger-row {
    grid-template-columns: 1fr;
  }

  .user-invoice-controls button {
    width: 100%;
  }

  .user-session-card {
    align-items: start;
    gap: 11px;
  }

  .user-session-card .status-chip {
    grid-column: auto;
  }

  .user-session-measure,
  .user-session-cost {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
  }

  .ledger-card-ref {
    display: none !important;
  }

  .ledger-amount {
    justify-self: start;
  }

  .bar {
    grid-template-columns: 1fr;
  }

  .creator-mark {
    right: 8px;
    bottom: 7px;
    max-width: calc(100vw - 16px);
    font-size: 0.68rem;
  }
}
