/* ============================================================
   Mini EV Charging Station — Owner Console
   Design language: premium icy-blue commercial dashboard.
   Light sky background, white glass panels, electric-blue
   accents, navy text. Branded by Mondal Electrax.
   Includes authentication screen.
   ============================================================ */

:root {
  /* Color */
  --bg: #eaf7ff;
  --bg-2: #e3f3ff;
  --panel: #ffffff;
  --panel-glass: rgba(255, 255, 255, 0.9);
  --panel-alt: #eef7fd;
  --border: #d3e6f5;
  --border-soft: #e0eef9;

  --text-primary: #0b1f3a;
  --text-secondary: #46607d;
  --text-muted: #7f95ad;

  --accent: #0b74d1;
  --accent-strong: #0858a8;
  --accent-cyan: #06b6d4;
  --accent-soft: rgba(11, 116, 209, 0.09);
  --accent-green: #059669;
  --accent-green-strong: #047857;
  --accent-green-soft: rgba(5, 150, 105, 0.12);
  --accent-amber: #b45309;
  --accent-amber-soft: rgba(217, 119, 6, 0.12);
  --accent-red: #dc2626;
  --accent-red-soft: rgba(220, 38, 38, 0.1);
  --accent-blue: #0b74d1;
  --accent-blue-soft: rgba(11, 116, 209, 0.1);

  /* Type */
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Layout */
  --radius-panel: 16px;
  --radius-control: 10px;
  --radius-chip: 999px;
  --shadow-panel: 0 1px 2px rgba(10, 60, 120, 0.05), 0 10px 30px rgba(14, 100, 180, 0.09);
  --container-max: 1180px;

  /* Watermark: EV charging line art, embedded so it can never fail to load */
  --watermark: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201000%20500'%20fill='none'%20stroke='%230b74d1'%20stroke-width='5'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M20%20442H980'%20stroke-width='3'/%3E%3Cpath%20d='M70%20392V372C70%20346%2088%20336%20124%20330L246%20312C286%20266%20346%20236%20418%20236H508C560%20236%20600%20262%20640%20304L690%20316C722%20323%20734%20338%20734%20364V392H660A60%2060%200%200%200%20540%20392H260A60%2060%200%200%200%20140%20392H70Z'/%3E%3Ccircle%20cx='200'%20cy='392'%20r='46'/%3E%3Ccircle%20cx='200'%20cy='392'%20r='20'/%3E%3Ccircle%20cx='600'%20cy='392'%20r='46'/%3E%3Ccircle%20cx='600'%20cy='392'%20r='20'/%3E%3Cpath%20d='M300%20302C330%20268%20372%20252%20420%20252H500C540%20252%20572%20272%20604%20304Z'/%3E%3Cpath%20d='M462%20252V304'/%3E%3Cpath%20d='M420%20326h30'/%3E%3Cpath%20d='M708%20336h20'/%3E%3Crect%20x='706'%20y='344'%20width='26'%20height='20'%20rx='4'/%3E%3Cpath%20d='M721%20347l-8%208h5l-2%207%208-9h-5z'/%3E%3Crect%20x='868'%20y='236'%20width='84'%20height='206'%20rx='16'/%3E%3Crect%20x='884'%20y='256'%20width='52'%20height='56'%20rx='8'/%3E%3Cpath%20d='M916%20266l-20%2024h14l-6%2018%2020-26h-14z'/%3E%3Ccircle%20cx='910'%20cy='360'%20r='10'/%3E%3Cpath%20d='M856%20442h108'/%3E%3Cpath%20d='M868%20340C820%20340%20800%20362%20740%20354'%20stroke-width='7'/%3E%3Cpath%20d='M880%20210a50%2050%200%200%201%2070%200'/%3E%3Cpath%20d='M866%20190a74%2074%200%200%201%2098%200'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root { color-scheme: light; }
}

*, *::before, *::after { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1000px 520px at 90% -8%, rgba(6, 182, 212, 0.14), transparent 62%),
    radial-gradient(900px 520px at -8% 4%, rgba(11, 116, 209, 0.09), transparent 58%),
    linear-gradient(180deg, #eef9ff 0%, var(--bg) 50%, var(--bg-2) 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* EV charging watermark — decorative, never intercepts clicks */
body::before {
  content: "";
  position: fixed;
  right: -2vw;
  bottom: 0;
  width: min(92vw, 1100px);
  aspect-ratio: 2 / 1;
  background: var(--watermark) no-repeat right bottom / contain;
  opacity: 0.085;
  pointer-events: none;
  z-index: 0;
}

h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: -0.01em; }

.mono { font-family: var(--font-mono); }

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------------- Buttons ---------------- */

.btn {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-control);
  padding: 10px 18px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color 120ms ease, border-color 120ms ease, opacity 120ms ease, box-shadow 120ms ease;
}

.btn--primary {
  background: linear-gradient(180deg, #1186ee, var(--accent) 55%, var(--accent-strong));
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(11, 116, 209, 0.28);
}
.btn--primary:hover { background: linear-gradient(180deg, #0f7ddd, var(--accent-strong)); box-shadow: 0 8px 20px rgba(11, 116, 209, 0.34); }
.btn--primary:disabled { opacity: 0.6; cursor: not-allowed; box-shadow: none; }

.btn--block {
  width: 100%;
}

.btn__spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- Forms (shared) ---------------- */

.field { display: flex; flex-direction: column; gap: 6px; }
.field[hidden] { display: none; }

.field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.field__hint { color: var(--text-muted); font-weight: 400; }

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"] {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-control);
  padding: 10px 12px;
  font-size: 14px;
  font-family: var(--font-mono);
  width: 100%;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

input[type="email"] { font-family: var(--font-body); }
input[type="password"] { font-family: var(--font-body); letter-spacing: 0.05em; }

input[type="text"]::placeholder,
input[type="number"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder { color: var(--text-muted); }

input[type="text"]:hover,
input[type="number"]:hover,
input[type="email"]:hover,
input[type="password"]:hover { border-color: #b6d3ea; }

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(11, 116, 209, 0.15);
}

.input-prefix {
  display: flex;
  align-items: stretch;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  overflow: hidden;
}
.input-prefix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(11, 116, 209, 0.15); }

.input-prefix__symbol {
  display: grid;
  place-items: center;
  padding: 0 12px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  border-right: 1px solid var(--border);
  background: rgba(11, 116, 209, 0.05);
}

.input-prefix input {
  border: none;
  background: transparent;
  border-radius: 0;
}
.input-prefix input:focus { outline: none; border: none; box-shadow: none; }

input[type="number"]::-webkit-inner-spin-button { opacity: 0.5; }

.form-message {
  font-size: 13px;
  font-weight: 500;
}
.form-message[data-state="success"] { color: var(--accent-green-strong); }
.form-message[data-state="error"] { color: var(--accent-red); }
.form-message[data-state="loading"] { color: var(--text-secondary); }

/* ---------------- Link button ---------------- */

.link-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link-btn:hover { color: var(--accent-strong); }

/* ============================================================
   AUTH SCREEN
   ============================================================ */

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(900px 500px at 90% -10%, rgba(6, 182, 212, 0.12), transparent 60%),
    radial-gradient(800px 480px at -5% 5%, rgba(11, 116, 209, 0.08), transparent 55%),
    linear-gradient(180deg, #f4fbff 0%, #eaf7ff 100%);
  padding: 24px;
  overflow-y: auto;
}

.auth-screen::before {
  content: "";
  position: fixed;
  right: 2vw;
  bottom: 3vh;
  width: min(56vw, 820px);
  aspect-ratio: 2 / 1;
  background: var(--watermark) no-repeat right bottom / contain;
  opacity: 0.16;
  pointer-events: none;
}

.customer-checkout {
  width: min(100%, 980px);
  padding: 0 24px;
  color: var(--text-primary);
}

.customer-checkout summary {
  width: fit-content;
  margin: 0 auto;
  padding: 8px 12px;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.customer-checkout__content {
  max-width: 480px;
  margin: 8px auto 0;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-panel);
}

.customer-checkout__content .auth-form__sub {
  margin: 8px 0 18px;
}

.customer-checkout-form {
  display: grid;
  gap: 14px;
}

.checkout-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.checkout-mode legend {
  margin-bottom: 7px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.checkout-mode label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--panel-alt);
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
}

.checkout-mode input {
  accent-color: var(--accent);
}

.customer-checkout-form .form-message {
  min-height: 20px;
  margin: 0;
}

.customer-checkout-form .form-message[data-state="error"] {
  color: var(--accent-red);
}

@media (max-width: 640px) {
  .customer-checkout {
    padding: 0;
  }

  .customer-checkout__content {
    padding: 18px;
  }
}

.auth-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  max-width: 1120px;
  width: 100%;
  background: var(--panel);
  border-radius: 24px;
  box-shadow: 0 24px 64px rgba(8, 50, 100, 0.15), 0 4px 12px rgba(8, 50, 100, 0.05);
  overflow: hidden;
  min-height: 560px;
}

/* ---------------- Auth aside ---------------- */

.auth-aside {
  position: relative;
  background: linear-gradient(160deg, #0b3a75 0%, #0b74d1 70%, #06b6d4 120%);
  color: #ffffff;
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow: hidden;
}

.auth-aside::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--watermark) no-repeat right bottom / 80% auto;
  opacity: 0.08;
  pointer-events: none;
}

.auth-aside__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.auth-aside__brand .mx-logo {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.auth-aside__brand .mx-brand__name {
  color: #ffffff;
  font-size: 15px;
}

.auth-aside__title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
  position: relative;
  z-index: 1;
  letter-spacing: -0.02em;
}

.auth-aside__text {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  position: relative;
  z-index: 1;
}

.auth-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.auth-features li {
  font-size: 14px;
  padding-left: 26px;
  position: relative;
  color: rgba(255, 255, 255, 0.92);
}

.auth-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235FE0FF' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") no-repeat center / contain;
}

.auth-brand-seal {
  align-self: center;
  display: grid;
  justify-items: center;
  gap: 7px;
  width: 188px;
  padding: 18px 16px 15px;
  margin: auto 0 0;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 18px 38px rgba(3, 28, 68, 0.18);
  backdrop-filter: blur(8px);
  position: relative;
  z-index: 1;
}

.auth-brand-seal__monogram {
  display: grid;
  place-items: center;
  position: relative;
  width: 78px;
  height: 78px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 23px;
  background: linear-gradient(145deg, #f8fdff, #bceaff);
  color: #0b3a75;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.08em;
  box-shadow: 0 8px 22px rgba(2, 33, 76, 0.24);
}

.auth-brand-seal__monogram span {
  position: absolute;
  right: 9px;
  bottom: 8px;
  color: #0b74d1;
  font-size: 16px;
  filter: drop-shadow(0 1px 1px rgba(255, 255, 255, 0.8));
}

.auth-brand-seal__name {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.auth-brand-seal__caption {
  color: rgba(255, 255, 255, 0.72);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.auth-aside__foot {
  margin-top: auto;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  position: relative;
  z-index: 1;
}

/* ---------------- Auth card ---------------- */

.auth-card {
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--panel);
}

.auth-card__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.brand-mark--sm {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(150deg, var(--accent-cyan), var(--accent) 60%, var(--accent-strong));
  box-shadow: 0 4px 12px rgba(11, 116, 209, 0.3);
  flex-shrink: 0;
}

.auth-card__brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.auth-card__brand-text strong {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}
.auth-card__brand-text span {
  font-size: 12px;
  color: var(--text-secondary);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-form[hidden] { display: none; }

.auth-form__title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.auth-form__sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin: -8px 0 0 0;
}

.auth-switch {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  margin: 4px 0 0 0;
}

/* ============================================================
   OWNER CONSOLE / APP
   ============================================================ */

.app {
  display: none; /* shown by JS after authentication */
  position: relative;
  z-index: 1;
  min-height: 100vh;
  flex-direction: column;
}

/* ---------------- Topbar ---------------- */

.topbar {
  border-bottom: 1px solid rgba(11, 116, 209, 0.14);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  box-shadow: 0 6px 24px rgba(14, 100, 180, 0.07);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(150deg, var(--accent-cyan), var(--accent) 60%, var(--accent-strong));
  box-shadow: 0 6px 16px rgba(11, 116, 209, 0.32);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.brand-text__title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}
.brand-text__sub {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Mondal Electrax lockup (header) */
.mx-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 6px;
  padding-left: 18px;
  border-left: 1px solid rgba(11, 116, 209, 0.2);
  flex-shrink: 0;
}

.mx-logo {
  width: 30px;
  height: 30px;
  display: block;
  flex-shrink: 0;
  filter: drop-shadow(0 3px 6px rgba(11, 58, 117, 0.25));
}
.mx-logo--sm { width: 22px; height: 22px; }

.mx-brand__name {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #0b3a75;
  white-space: nowrap;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.topbar__status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 7px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-chip);
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.9);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}
.status-dot[data-state="online"] { background: var(--accent-green); box-shadow: 0 0 0 3px var(--accent-green-soft); }
.status-dot[data-state="offline"] { background: var(--accent-red); box-shadow: 0 0 0 3px var(--accent-red-soft); }
.status-dot[data-state="unknown"] { background: var(--text-muted); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
  padding: 0;
}
.icon-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: 0 4px 12px rgba(11, 116, 209, 0.15);
}
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { display: block; width: 20px; height: 20px; }

.icon-btn--danger:hover {
  border-color: var(--accent-red);
  background: var(--accent-red-soft);
  color: var(--accent-red);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15);
}

/* ---------------- Layout ---------------- */

.layout {
  position: relative;
  z-index: 1;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 28px 24px 48px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  width: 100%;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.page-head__title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.02em;
}

.page-head__sub {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--text-secondary);
}

/* ---------------- Panel base ---------------- */

.panel {
  background: var(--panel-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-panel);
  padding: 22px 22px 24px;
}

.panel__header { margin-bottom: 18px; }

.panel__header--row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.panel__header h2 { font-size: 16px; font-weight: 600; color: var(--text-primary); }

.panel__subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

/* ---------------- Stats ---------------- */

.stats__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 700px) {
  .stats__grid { grid-template-columns: 1fr; }
}

.stat-card {
  background: var(--panel-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-panel);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
}

.stat-card__icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 16px;
  flex-shrink: 0;
}
.stat-card__icon--income { background: linear-gradient(150deg, rgba(6, 182, 212, 0.18), rgba(11, 116, 209, 0.12)); color: var(--accent-strong); }
.stat-card__icon--energy { background: linear-gradient(150deg, rgba(11, 116, 209, 0.16), rgba(6, 182, 212, 0.1)); color: var(--accent); }
.stat-card__icon--sessions { background: linear-gradient(150deg, rgba(8, 88, 168, 0.14), rgba(11, 116, 209, 0.1)); color: #0b3a75; }

.stat-card__label {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.stat-card__value {
  margin: 4px 0 0;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
}
.stat-card__value .unit { font-size: 13px; color: var(--text-secondary); font-weight: 500; }

/* ---------------- Current session (focal point) ---------------- */

.panel--session {
  position: relative;
  overflow: hidden;
  padding: 28px 28px 30px;
  background: linear-gradient(180deg, #ffffff 0%, #f5fbff 100%);
  border-color: rgba(11, 116, 209, 0.28);
  box-shadow:
    0 0 0 4px rgba(6, 182, 212, 0.07),
    0 2px 4px rgba(10, 60, 120, 0.05),
    0 22px 56px rgba(11, 116, 209, 0.18);
}

.panel--session::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent) 55%, var(--accent-strong));
}

.panel--session .panel__header h2 { font-size: 20px; }
.panel--session .panel__header { margin-bottom: 22px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-chip);
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge--sm { padding: 3px 10px; font-size: 12px; }
.panel--session .panel__header .badge { padding: 7px 16px; font-size: 13.5px; }

.badge[data-state="idle"] { background: #eef4fa; color: var(--text-secondary); border-color: #dbe7f2; }
.badge[data-state="charging"] { background: var(--accent-green-soft); color: var(--accent-green-strong); border-color: rgba(5, 150, 105, 0.22); }
.badge[data-state="paid"],
.badge[data-state="success"] { background: var(--accent-green-soft); color: var(--accent-green-strong); border-color: rgba(5, 150, 105, 0.22); }
.badge[data-state="pending"] { background: var(--accent-amber-soft); color: var(--accent-amber); border-color: rgba(217, 119, 6, 0.2); }
.badge[data-state="failed"] { background: var(--accent-red-soft); color: #b91c1c; border-color: rgba(220, 38, 38, 0.2); }
.badge[data-state="completed"] { background: var(--accent-blue-soft); color: var(--accent-strong); border-color: rgba(11, 116, 209, 0.22); }
.badge[data-state="expired"] { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.badge[data-state="waiting"] { background: var(--accent-amber-soft); color: var(--accent-amber); border-color: rgba(217, 119, 6, 0.2); }
.badge[data-state="cancelled"] { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }

/* Live indicator on active charging badges */
.badge[data-state="charging"]::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  animation: live-pulse 1.8s ease-out infinite;
}

@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.5); }
  100% { box-shadow: 0 0 0 7px rgba(5, 150, 105, 0); }
}

.session-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 700px) {
  .session-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 460px) {
  .session-grid { grid-template-columns: 1fr; }
}

.session-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 13px 15px;
  background: rgba(234, 247, 255, 0.7);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  min-width: 0;
}

.session-field__label {
  font-size: 12px;
  color: var(--text-secondary);
}

.session-field__value {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.session-progress {
  margin-top: 26px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.session-progress__track {
  flex: 1;
  height: 14px;
  background: #dcecf8;
  border: 1px solid #c3dcee;
  border-radius: var(--radius-chip);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(10, 60, 120, 0.08);
}

.session-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent));
  border-radius: var(--radius-chip);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.55);
  transition: width 300ms ease;
}

.session-progress__label {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--accent-strong);
  min-width: 48px;
  text-align: right;
}

/* While charging: moving energy stripes on the bar (progressive enhancement) */
.panel--session:has(#charging-status-badge[data-state="charging"]) .session-progress__fill {
  background:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.28) 0 10px, rgba(255, 255, 255, 0) 10px 20px),
    linear-gradient(90deg, var(--accent-cyan), var(--accent));
  background-size: 28px 100%, 100% 100%;
  animation: charge-flow 1.2s linear infinite;
}

@keyframes charge-flow {
  to { background-position: 28px 0, 0 0; }
}

/* ---------------- History table ---------------- */

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  -webkit-overflow-scrolling: touch;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
  font-size: 13.5px;
}

.history-table thead th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: #2f4a68;
  background: linear-gradient(180deg, #eaf5fd, #e1f0fb);
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.history-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-primary);
  white-space: nowrap;
}

.history-table tbody tr:last-child td { border-bottom: none; }
.history-table tbody tr:hover { background: #f0f9ff; }

.history-table td.mono { font-family: var(--font-mono); }

.table-empty {
  padding: 32px 14px;
  text-align: center;
  color: var(--text-secondary);
}

/* ---------------- Modal ---------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 40, 80, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 20px;
  animation: overlay-in 180ms ease;
}

@keyframes overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-overlay[hidden] { display: none; }

.modal {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid rgba(11, 116, 209, 0.2);
  border-radius: var(--radius-panel);
  box-shadow: 0 24px 64px rgba(8, 50, 100, 0.25), 0 4px 12px rgba(8, 50, 100, 0.08);
  max-width: 460px;
  width: 100%;
  padding: 0;
  animation: modal-in 200ms ease;
}

.modal::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent));
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 16px 24px;
  border-bottom: 1px solid var(--border-soft);
}

.modal__header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.modal__subtitle {
  margin: 4px 0 0 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.modal__close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, transform 120ms ease;
  padding: 0;
  flex-shrink: 0;
}

.modal__close:hover { background: var(--panel-alt); color: var(--text-primary); }
.modal__close:active { transform: scale(0.92); }
.modal__close svg { display: block; width: 20px; height: 20px; }

.modal__body { padding: 20px 24px 28px 24px; }

.modal .settings-form { margin: 0; }
.modal .settings-form__actions { margin-top: 8px; }

.settings-form { display: flex; flex-direction: column; gap: 16px; }

.settings-form__actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
  flex-wrap: wrap;
}

/* ---------------- Toasts ---------------- */

.toast-stack {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-muted);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13.5px;
  color: var(--text-primary);
  box-shadow: 0 10px 28px rgba(14, 100, 180, 0.16);
  animation: toast-in 160ms ease;
}
.toast[data-type="success"] { border-left-color: var(--accent-green); }
.toast[data-type="error"] { border-left-color: var(--accent-red); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------- Footer ---------------- */

.footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 22px 20px 28px;
  color: var(--text-secondary);
  font-size: 12.5px;
  border-top: 1px solid rgba(11, 116, 209, 0.12);
}

.footer p { margin: 0; }

.mx-powered {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 8px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius-chip);
  box-shadow: 0 4px 14px rgba(14, 100, 180, 0.08);
}

.mx-powered__text {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #0b3a75;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
  .mx-brand__name { display: none; }
  .mx-brand { padding-left: 14px; }

  .auth-shell {
    grid-template-columns: 1fr;
    max-width: 480px;
    min-height: auto;
  }

  .auth-aside {
    padding: 28px 24px;
    gap: 16px;
  }

  .auth-aside__title { font-size: 22px; }
  .auth-aside__text { font-size: 14px; }
  .auth-features { display: none; }
  .auth-aside__foot { display: none; }

  .auth-card { padding: 32px 24px; }
}

@media (max-width: 700px) {
  body::before { width: 150vw; right: -34vw; opacity: 0.07; }
  .layout { padding: 22px 16px 40px; }
  .panel--session { padding: 24px 18px 26px; }

  .page-head__title { font-size: 22px; }
  .page-head__sub { font-size: 13px; }
}

@media (max-width: 560px) {
  .mx-brand { display: none; }

  .topbar__inner {
    flex-wrap: wrap;
    padding: 12px 16px;
  }

  .brand-text__title { font-size: 15px; }
  .brand-text__sub { font-size: 11px; }
  .topbar__actions { gap: 8px; }
  .icon-btn { width: 36px; height: 36px; }
  .topbar__status { font-size: 11px; padding: 5px 10px; }
  .topbar__status .status-label { display: none; }

  .modal { max-width: 100%; margin: 10px; }
  .modal__header { padding: 18px 18px 12px 18px; }
  .modal__body { padding: 16px 18px 22px 18px; }
  .modal__header h2 { font-size: 16px; }

  .auth-screen { padding: 16px; }
  .auth-card { padding: 28px 20px; }
  .auth-form__title { font-size: 20px; }
}

@media (max-width: 400px) {
  .auth-card__brand { margin-bottom: 20px; }
  .auth-form { gap: 14px; }
  .auth-form__title { font-size: 18px; }
}
