@charset "UTF-8";

/* =====================================================================
   EVSOL-CUSTOM — EV Solutions skin (whole file is custom)
   SteVe - Modern responsive theme
   Re-skin of the SteVe management UI (sidebar + topbar + cards layout).
   All legacy class names are preserved so existing JSP views keep working.
   Built for SteVe 3.13.0. See /CUSTOMIZATIONS.md before upgrading.
   ===================================================================== */

:root {
    --sidebar-w: 256px;

    --bg: #f5f5f5;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    --text: #1e293b;
    --text-muted: #64748b;
    --text-soft: #94a3b8;

    --brand: #18974d;
    --brand-strong: #1cc467;
    --brand-soft: #ebf5ed;

    --green: #4f911f;;
    --green-strong: #15803d;
    --amber: #d97706;
    --red: #dc2626;
    --red-strong: #b91c1c;

    --sidebar-bg: #232425;
    --sidebar-text: #cbd5e1;
    --sidebar-text-dim: #6ec72e;
    --sidebar-active: linear-gradient(135deg, #2a782d 0%, #288411 100%);

    --radius: 14px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .05);
    --shadow: 0 4px 16px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, .12);
}

/* ============================ Dark mode ============================ */
[data-theme="dark"] {
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-2: #172033;
    --border: #334155;
    --border-strong: #475569;

    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --text-soft: #64748b;

    --brand-soft: rgba(59, 130, 246, .16);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 4px 16px rgba(0, 0, 0, .45);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, .55);
}
[data-theme="dark"] a:link, [data-theme="dark"] a:visited { color: #60a5fa; }
[data-theme="dark"] a:hover, [data-theme="dark"] a:active { color: #93c5fd; }
[data-theme="dark"] .topbar { background: rgba(30, 41, 59, .85); border-bottom-color: var(--border); }
[data-theme="dark"] .stat-ico.ico-blue   { background: rgba(37, 99, 235, .18);  color: #60a5fa; }
[data-theme="dark"] .stat-ico.ico-green  { background: rgba(22, 163, 74, .18);  color: #4ade80; }
[data-theme="dark"] .stat-ico.ico-purple { background: rgba(124, 58, 237, .18); color: #a78bfa; }
[data-theme="dark"] .stat-ico.ico-amber  { background: rgba(217, 119, 6, .18);  color: #fbbf24; }
[data-theme="dark"] .stat-ico.ico-pink   { background: rgba(219, 39, 119, .18); color: #f472b6; }
[data-theme="dark"] .stat-ico.ico-cyan   { background: rgba(8, 145, 178, .18);  color: #22d3ee; }
[data-theme="dark"] span.formatNumber { color: #60a5fa; }
[data-theme="dark"] .info    { color: #bfdbfe; background: rgba(37, 99, 235, .14); border-color: rgba(59, 130, 246, .4); }
[data-theme="dark"] .warning { color: #fde68a; background: rgba(217, 119, 6, .14); border-color: rgba(245, 158, 11, .4); }
[data-theme="dark"] .error   { color: #fecaca; background: rgba(220, 38, 38, .14); border-color: rgba(248, 113, 113, .4); }
[data-theme="dark"] a.tooltip:hover span { color: #bfdbfe; background: var(--surface); border-color: var(--border); box-shadow: var(--shadow); }
[data-theme="dark"] input:disabled { background-color: #0f172a; color: var(--text-soft); }
[data-theme="dark"] .left-menu li a.highlight { color: #fff; }

/* ---- Theme toggle button (topbar) ---- */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-muted);
    border-radius: 10px;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.theme-toggle:hover { color: var(--text); background: var(--surface); }
.theme-toggle svg { width: 18px; height: 18px; stroke: currentColor; fill: none; }
.theme-toggle .ico-sun { display: none; }
.theme-toggle .ico-moon { display: block; }
[data-theme="dark"] .theme-toggle .ico-sun { display: block; }
[data-theme="dark"] .theme-toggle .ico-moon { display: none; }

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

a:link, a:visited { color: var(--brand); text-decoration: none; }
a:hover, a:active { color: var(--brand-strong); text-decoration: underline; }

h1, h2, h3, h4 { color: var(--text); margin: 0 0 .5em; font-weight: 700; }

/* ============================ App shell ============================= */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ----------------------------- Sidebar ----------------------------- */
.sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow-y: auto;
    transition: transform .25s ease;
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 8px; }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 22px 22px 18px;
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    letter-spacing: .3px;
}
.sidebar-brand .brand-mark {
    width: 34px; height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #0f1b3d;
    font-size: 18px;
}
.sidebar-brand a, .sidebar-brand a:link, .sidebar-brand a:visited {
    color: #fff; text-decoration: none;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%;
}
.sidebar-brand .brand-logo {
    width: 100%;
    max-width: 180px;
    height: auto;
    display: block;
}

.sidebar-nav { padding: 6px 12px 16px; flex: 1; }

.sidebar-footer {
    padding: 14px 22px 20px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
}
.sidebar-footer a,
.sidebar-footer a:link,
.sidebar-footer a:visited {
    color: var(--sidebar-text-dim);
    text-decoration: none;
    transition: color .15s ease;
}
.sidebar-footer a strong { color: var(--sidebar-text); font-weight: 700; }
.sidebar-footer a:hover { color: #fff; text-decoration: none; }
.sidebar-footer a:hover strong { color: #fff; }

.nav-group-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: var(--sidebar-text-dim);
    padding: 18px 12px 6px;
}

.sidebar-nav a,
.sidebar-nav a:link,
.sidebar-nav a:visited {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin: 2px 0;
    border-radius: 10px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background .15s ease, color .15s ease;
    white-space: nowrap;
}
.sidebar-nav a .nav-ico {
    width: 20px;
    flex: 0 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    opacity: .85;
}
.sidebar-nav a .nav-ico svg {
    width: 18px;
    height: 18px;
    display: block;
    stroke: currentColor;
}
.sidebar-nav a:hover {
    background: rgba(255,255,255,.07);
    color: #fff;
    text-decoration: none;
}
.sidebar-nav a.active {
    background: var(--sidebar-active);
    color: #fff;
    box-shadow: 0 6px 16px rgb(23 201 27 / 35%);
}
.sidebar-nav a.active .nav-ico { opacity: 1; }

/* ----------------------------- Main ----------------------------- */
.app-main {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 500;
    height: 64px;
    background: rgba(255,255,255,.85);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
}
.topbar .hamburger {
    display: none;
    background: none;
    border: 0;
    font-size: 22px;
    color: var(--text);
    cursor: pointer;
    padding: 6px;
    line-height: 1;
    border-radius: 8px;
}
.topbar .hamburger:hover { background: var(--surface-2); }
.topbar-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}
.topbar-spacer { flex: 1; }
.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-weight: 600;
    color: var(--text);
}
.topbar-user .avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), #fdfdfd);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}
.topbar-user a, .topbar-user a:link, .topbar-user a:visited { color: var(--text); text-decoration: none; }

.main-wrapper {
    flex: 1;
    padding: 24px;
    max-width: 1500px;
    width: 100%;
}

/* sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    z-index: 900;
}
.sidebar-overlay.show { display: block; }

/* ============================ Content cards ============================ */
.content {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: 0 0 20px;
    padding: 22px 24px;
}

/* section header inside cards */
section {
    margin: 34px 0 16px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
section:first-child { margin-top: 6px; }
section span {
    color: var(--text);
    background: transparent;
    padding: 0;
    font-family: inherit;
    font-size: 24px;
    font-weight: 700;
}

ul hr { color: var(--border); background: var(--border); height: 1px; border: 0; }

/* ============================ Page header ============================ */
.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: 26px; margin: 0 0 4px; }
.page-head p { margin: 0; color: var(--text-muted); }

/* ============================ Dashboard ============================ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text);
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease;
}
.stat-card:link, .stat-card:visited { color: var(--text); text-decoration: none; }
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
}
.stat-card .stat-ico {
    width: 42px; height: 42px;
    flex: 0 0 42px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ecfdf5;
    color: #16a34a;
}
.stat-card .stat-ico svg { width: 22px; height: 22px; stroke: currentColor; fill: none; display: block; }
.stat-card .stat-label {
    flex: 1;
    min-width: 0;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
}
.stat-card .stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
    white-space: nowrap;
}
[data-theme="dark"] .stat-card .stat-ico { background: rgba(22, 163, 74, .18); color: #4ade80; }

.panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
}
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 22px;
}
.panel h3 {
    font-size: 16px;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.kv-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.kv-row:last-child { border-bottom: 0; }
.kv-row .kv-key { color: var(--text-muted); }
.kv-row .kv-val { font-weight: 700; color: var(--text); font-size: 16px; }

/* donut chart (connector status) built with conic-gradient */
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut {
    width: 150px; height: 150px;
    border-radius: 50%;
    flex: 0 0 150px;
    position: relative;
}
.donut::after {
    content: "";
    position: absolute;
    inset: 26px;
    background: var(--surface);
    border-radius: 50%;
}
.donut-legend { flex: 1; min-width: 160px; }
.donut-legend .kv-row .kv-key { display: flex; align-items: center; gap: 8px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* ============================ Charging Stations panel ============================ */
.stations-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.stations-head h3 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.stations-summary { font-size: 13px; color: var(--text-muted); }
.stations-summary .sum-on { color: var(--green); font-weight: 700; }
.stations-summary .sum-off { color: var(--text-soft); font-weight: 700; }

.stations-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.station-search {
    border: 1px solid var(--border-strong); border-radius: 999px;
    padding: 8px 14px; font-size: 13px; background: var(--surface); color: var(--text);
    min-width: 220px; width: auto; margin: 0;
}
.station-search:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.15); outline: none; }
.station-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-btn {
    border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted);
    border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.filter-btn:hover { color: var(--text); border-color: var(--text-soft); }
.filter-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.filter-btn .st-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: middle; }
.status-filters { display: contents; }

.stationsTable .st-rowlink { cursor: pointer; }
.stationsTable .st-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.stationsTable .st-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.st-chip {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
}
.st-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.st-total {
    display: inline-block; margin-left: 8px; font-size: 12px; color: var(--text-soft);
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px;
}
.ocpp-badge {
    font-size: 12px; font-weight: 600; color: var(--brand);
    background: var(--brand-soft); border-radius: 6px; padding: 2px 8px; white-space: nowrap;
}
.st-badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
}
.st-badge i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.st-badge.on { background: #ecfdf5; color: var(--green); }
.st-badge.off { background: var(--surface-2); color: var(--text-soft); }
.stationsTable .hb { font-size: 11px; color: var(--text-soft); margin-top: 3px; }

/* ============================ Daily consumption chart ============================ */
.cons-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cons-head h3 { margin: 0; font-size: 18px; font-weight: 700; color: var(--text-muted); }
.cons-sub { color: var(--text-soft); font-size: 13px; margin-top: 2px; }
.cons-total { font-size: 24px; font-weight: 800; color: var(--text); white-space: nowrap; }
.cons-caption { color: var(--text-muted); font-size: 13px; margin: 12px 0 18px; }
.cons-chart {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    padding-top: 6px;
}
.cons-col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.cons-val { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; white-space: nowrap; }
/* Fixed-height track so the bar's percentage height resolves reliably across browsers. */
.cons-bar-wrap {
    height: 200px;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.cons-bar {
    width: 62%;
    max-width: 52px;
    min-height: 3px;
    border-radius: 5px 5px 0 0;
    background: linear-gradient(180deg, var(--brand-strong), var(--brand));
    transition: height .3s ease;
}
.cons-day { font-size: 12px; color: var(--text-muted); margin-top: 8px; white-space: nowrap; }

@media (max-width: 560px) {
    .cons-bar-wrap { height: 140px; }
    .cons-chart { gap: 6px; }
    .cons-val, .cons-day { font-size: 10px; }
    .cons-total { font-size: 20px; }
}

/* ============================ Station event feed badges ============================ */
.evt-src, .evt-cat {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 6px;
    color: #fff;
    white-space: nowrap;
}
.evt-status    { background: #2563eb; }  /* status job (central system) */
.evt-security  { background: #dc2626; }  /* security event */
.evt-connector { background: #16a34a; }  /* connector status change (station) */
.evt-session   { background: #0891b2; }  /* charging session */
.cat-INFO      { background: #6b7280; }
.cat-WARNING   { background: #f59e0b; }

.events-toolbar { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 12px; }
.events-empty { color: var(--text-muted); padding: 12px 2px; }
.events-pager { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.events-pager .pg-info { font-size: 13px; color: var(--text-muted); }
.pg-btn {
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
.pg-btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--text-soft); }
.pg-btn:disabled { opacity: .5; cursor: not-allowed; }

.events-pagesize { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 400; color: var(--text-muted); }
.events-pagesize select { width: auto; min-width: 64px; margin: 0; padding: 6px 8px; }

/* Connector status badge (coloured by JS per status) */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: #64748b;
    white-space: nowrap;
}

/* ============================ Transaction chart ============================ */
.txchart-cap { color: var(--text-muted); font-size: 13px; margin-bottom: 10px; }
.txchart-legend { display: flex; flex-wrap: wrap; gap: 16px; margin: 4px 0 14px; }
.txchart-legend label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.txchart-legend .mk { width: 14px; height: 14px; border-radius: 3px; display: inline-block; flex: 0 0 14px; }
.txchart-svg-wrap { width: 100%; overflow-x: auto; }
.txchart-svg { width: 100%; height: auto; display: block; min-width: 520px; }
.txchart-svg circle { transition: r .1s ease; }
.txchart-svg circle:hover { r: 5.5; }
.txchart-empty { color: var(--text-muted); padding: 10px 0; }
.txchart-tip {
    position: fixed;
    z-index: 2000;
    pointer-events: none;
    background: #0f172a;
    color: #fff;
    font-size: 12px;
    line-height: 1.45;
    padding: 6px 9px;
    border-radius: 6px;
    box-shadow: var(--shadow-lg);
    white-space: nowrap;
}
.txchart-tip b { font-weight: 700; }

/* ============================ Compact key/value form layout ============================ */
/* Lays out "label : value" pairs in two columns to save vertical space. */
table.kvtable { display: block; width: 100%; margin-bottom: 14px; }
table.kvtable > thead,
table.kvtable > thead > tr { display: block; }
table.kvtable > thead th {
    display: block;
    text-align: left;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    padding: 4px 0 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
}
table.kvtable > thead th:empty { display: none; }
table.kvtable > thead th:first-child { text-align: left; }
table.kvtable > tbody {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr 1.5fr;
    gap: 4px 22px;
    align-items: center;
}
table.kvtable > tbody > tr { display: contents; }
table.kvtable > tbody > tr > td {
    display: block;
    width: auto;
    padding: 5px 0;
    border: 0;
}
table.kvtable > tbody > tr > td:nth-child(1) {
    width: auto;
    text-align: right;
    color: var(--text-muted);
    font-weight: 600;
    white-space: normal;
}
table.kvtable input[type="text"],
table.kvtable input[type="password"],
table.kvtable input[type="number"],
table.kvtable select { width: 100%; margin: 0; }

@media (max-width: 900px) {
    table.kvtable > tbody { grid-template-columns: minmax(120px, 0.9fr) 1.5fr; }
}

/* ============================ Tiles (legacy home) ============================ */
.tileWrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    text-align: left;
}
.tileRow1 { width: auto; }
.tileWrapper a:link, .tileWrapper a:visited {
    margin: 0;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: block;
    box-shadow: var(--shadow);
    font-size: 14px;
    font-weight: 700;
    vertical-align: top;
    text-decoration: none;
    background-color: var(--surface);
    color: var(--text);
    transition: transform .15s ease, box-shadow .15s ease;
}
.tileWrapper a:hover, .tileWrapper a:active {
    background-color: var(--surface);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
span.baseTable { display: table; text-align: left; width: 100%; margin-top: 10px; }
span.baseRow { display: table-row; font-weight: normal; line-height: 28px; }
span.baseCell { display: table-cell; color: var(--text-muted); }
span.baseCell:first-child { width: 62%; text-align: left; }
span.baseCell:nth-child(2) { padding-left: 5px; text-align: right; }
span.base { margin-top: 10px; margin-bottom: 6px; display: block; font-weight: normal; }
span.formatNumber {
    font-size: 22px;
    color: var(--brand);
    font-weight: 800;
}
span.baseCell.formatNumber { font-size: 15px; color: var(--text); }

/* ============================ Tables ============================ */
table { width: 100%; border-collapse: collapse; }

table.res {
    border-collapse: collapse;
    table-layout: fixed;
    border-radius: var(--radius-sm);
    overflow: hidden;
}
table.res th {
    text-align: left;
    padding: 12px 14px;
    background: var(--surface-2);
    border-bottom: 2px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
}
table.res th[data-sort] { cursor: pointer; }
table.res th[data-sort]:hover { color: var(--brand); }
table.res tr { border-bottom: 1px solid var(--border); }
table.res td {
    padding: 11px 14px;
    text-align: left;
    width: auto;
    word-wrap: break-word;
    color: var(--text);
}
table.res tr:nth-child(odd) { background: var(--surface); }
table.res tr:nth-child(even) { background: var(--surface-2); }
table.res tr:nth-child(even):hover,
table.res tr:nth-child(odd):hover { background: var(--brand-soft); }

table.res.deviceModel tr.evseOdd { background: var(--surface); }
table.res.deviceModel tr.evseEven { background: var(--surface-2); }
table.res.deviceModel tr.evseOdd:hover,
table.res.deviceModel tr.evseEven:hover { background: var(--brand-soft); }
table.res.deviceModel tr.evseConnectorsRow { background: #f1f5f9; }

table.action td:last-child,
table.action th:last-child { border-left: 1px solid var(--border); }

table.res th.sorting-asc, table.res th.sorting-desc {
    background: var(--brand-soft);
    color: var(--brand);
}

table.sll { padding-bottom: 40px; }

/* user input forms */
table.userInput th:first-child { text-align: right; }
table.userInput td:first-child {
    text-align: right;
    width: 45%;
    padding: 8px 10px;
    color: var(--text-muted);
    font-weight: 600;
}
table.userInput td { padding: 6px 4px; }
table.userInputFullPage td:first-child {
    width: 50%; text-align: right; padding: 8px 10px;
    color: var(--text-muted); font-weight: 600;
}

/* charge point details table */
table.cpd {
    border-collapse: collapse;
    width: 100%;
    border-radius: var(--radius-sm);
    overflow: hidden;
}
table.cpd th {
    text-align: left; padding: 11px 14px;
    background: var(--surface-2);
    border-bottom: 2px solid var(--border);
    color: var(--text-muted); text-transform: uppercase; font-size: 12px; letter-spacing: .4px;
}
table.cpd tr { border-bottom: 1px solid var(--border); }
table.cpd td { padding: 11px 14px; text-align: left; }
table.cpd td:first-child {
    text-align: left;
    width: 220px;
    padding-left: 14px;
    background: var(--surface-2);
    font-weight: 600;
    color: var(--text-muted);
}

.deviceModel .connectorPanel {
    margin: 10px 0 16px;
    max-width: 100%;
    overflow-x: auto;
}
.deviceModel table.evseConnectors { table-layout: auto; width: 100%; }
.deviceModel table.evseConnectors select { width: auto; max-width: 100%; }
.deviceModel table.evseConnectors input[type="number"] { width: 110px; max-width: 100%; }

/* ============================ Forms ============================ */
select {
    width: 70%;
    max-width: 100%;
    font-size: 14px;
    margin: 3px 0;
    padding: 9px 10px;
    outline: none;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease;
}
select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
select option { font-size: 14px; }

input[type="text"], input[type="number"], input[type="password"],
input[type="email"], input[type="text"].dateTimePicker, textarea {
    appearance: none;
    -webkit-appearance: none;
    margin: 3px 6px 3px 0;
    padding: 9px 11px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    width: 70%;
    max-width: 100%;
    font-size: 14px;
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
}
input[type="text"]:focus, input[type="number"]:focus, input[type="password"]:focus,
input[type="email"]:focus, textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
    outline: none;
}
textarea { height: 6em; resize: vertical; }

input, select, textarea { box-sizing: border-box; }

/* secondary / neutral button */
input[type="button"] {
    margin: 0 0 5px 5px;
    min-width: 100px;
    font-size: 14px;
    height: 38px;
    padding: 0 16px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    color: var(--text);
    cursor: pointer;
    font-weight: 600;
    transition: background .15s ease, border-color .15s ease;
}
input[type="button"]:hover { background: var(--surface-2); border-color: var(--text-soft); }
input[type="button"]:active, input[type="submit"]:active { transform: translateY(1px); }

/* primary button (green = "go"/confirm in SteVe) */
input[type="submit"] {
    font-size: 14px;
    background: var(--green);
    color: #fff;
    cursor: pointer;
    height: 38px;
    padding: 0 18px;
    border: 0;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: background .15s ease, box-shadow .15s ease;
}
input[type="submit"]:hover { background: var(--green-strong); box-shadow: 0 4px 12px rgba(22,163,74,.3); }
input[type="submit"].blueSubmit { background: var(--brand); }
input[type="submit"].blueSubmit:hover { background: var(--brand-strong); box-shadow: 0 4px 12px rgba(37,99,235,.3); }
input[type="submit"].redSubmit { background: var(--red); }
input[type="submit"].redSubmit:hover { background: var(--red-strong); box-shadow: 0 4px 12px rgba(220,38,38,.3); }

input:disabled { background-color: #e2e8f0; color: var(--text-soft); }
input[type="submit"]:disabled,
input[type="submit"]:hover:disabled,
input[type="submit"]:active:disabled {
    cursor: not-allowed;
    background: #94a3b8;
    box-shadow: none;
    transform: none;
}

.submit-button { margin-top: 20px; }
#add_space { padding-top: 20px; }
.add-margin-bottom { margin-bottom: 20px; }
#diffElements input, #diffElements select { width: 130px; }

/* ============================ In-page side menu (operations) ============================ */
.left-menu {
    float: left;
    width: 220px;
    margin: 0 16px 0 0;
    padding: 0;
    list-style-type: none;
}
.left-menu ul { list-style: none; margin: 0; padding: 0; }
.left-menu li { margin: 0; }
.left-menu li a,
.left-menu li a:link {
    color: var(--text);
    display: block;
    text-decoration: none;
    outline: none;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    margin-bottom: 6px;
    font-weight: 500;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.left-menu li a:hover {
    color: var(--brand);
    background: var(--brand-soft);
    border-color: var(--brand);
    text-decoration: none;
}
.left-menu li a.highlight {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
}

.op-content { min-height: 350px; margin: 0 0 0 236px; padding: 0 0 0 16px; border-left: 1px solid var(--border); }
.op15-content { min-height: 470px; margin: 0 0 0 236px; padding: 0 0 0 16px; border-left: 1px solid var(--border); }
.op16-content { min-height: 800px; margin: 0 0 0 236px; padding: 0 0 0 16px; border-left: 1px solid var(--border); }
.right-content { margin: 0 0 0 236px; border-left: 1px solid var(--border); padding-left: 16px; }
.right-content div { display: none; }
.right-content div:first-child { display: block; }

/* ============================ Alerts ============================ */
.info, .warning, .error {
    text-align: left;
    border: 1px solid;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    padding: 14px 18px;
}
.info { color: #1e40af; background-color: #eff6ff; border-color: #bfdbfe; }
.warning { color: #92400e; background-color: #fffbeb; border-color: #fde68a; }
.error {
    color: var(--red-strong);
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    margin: 0 0 16px;
    padding: 14px 18px;
}

/* ============================ Tooltip ============================ */
a.tooltip { color: var(--brand); position: relative; text-decoration: none; }
a.tooltip span { display: none; }
a.tooltip:hover { cursor: help; }
a.tooltip:hover span {
    font-family: inherit;
    position: absolute;
    z-index: 1001;
    display: block;
    width: 250px;
    top: 1.6em;
    left: 1em;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    background-color: #eff6ff;
    box-shadow: var(--shadow);
    font-size: 13px;
    border-radius: var(--radius-sm);
    padding: 10px 12px;
}

.inline { display: inline-block; }

/* ============================ Sign in ============================ */
.signin-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sidebar-bg);
    padding: 24px;
}
.signin-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    padding: 36px 32px;
}
.signin-card .signin-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--text);
}
.signin-card .signin-brand .brand-mark {
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 11px;
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #0f1b3d; font-size: 20px;
}
.signin-card .signin-brand .brand-logo {
    width: 100%;
    max-width: 240px;
    height: auto;
    display: block;
}
.signin-card .signin-sub { text-align: right; font-size: 18px; color: var(--text-muted);}
.signin-card .field { margin-bottom: 16px; }
.signin-card label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.signin-card input[type="text"],
.signin-card input[type="password"] { width: 100%; margin: 0; }
.signin-card input[type="submit"] { width: 100%; margin-top: 8px; height: 42px; }

/* ============================ Responsive ============================ */
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .app-main { margin-left: 0; }
    .topbar .hamburger { display: inline-flex; align-items: center; }
}

@media (max-width: 768px) {
    .main-wrapper { padding: 16px; }
    .content { padding: 18px 16px; }
    .op-content, .op15-content, .op16-content, .right-content {
        margin-left: 0;
        padding-left: 0;
        border-left: 0;
    }
    .left-menu {
        float: none;
        width: 100%;
        margin: 0 0 16px;
    }
    .left-menu ul { display: flex; flex-wrap: wrap; gap: 6px; }
    .left-menu li a { margin-bottom: 0; }
    table.userInput td:first-child,
    table.userInputFullPage td:first-child { width: 38%; }
    select, input[type="text"], input[type="number"],
    input[type="password"], input[type="email"], textarea { width: 100%; }
    .topbar-title { font-size: 16px; }
    table.cpd td:first-child { width: 140px; }
}

@media (max-width: 560px) {
    .stat-grid { grid-template-columns: 1fr; gap: 10px; }
    .stat-card { padding: 14px 16px; }
    .stat-card .stat-value { font-size: 22px; }
    .topbar-user .uname { display: none; }
}

/* On phones and tablets (incl. iPad), turn wide list tables (.res) into stacked
   "label: value" cards so they stay readable. Column labels are injected by JS (data-label).
   The 1024px breakpoint matches where the sidebar collapses. Excluded: the connector
   editor tables, which keep their own layout. */
@media (max-width: 1024px) {
    table.res:not(.deviceModel):not(.evseConnectors),
    table.res:not(.deviceModel):not(.evseConnectors) tbody,
    table.res:not(.deviceModel):not(.evseConnectors) tr,
    table.res:not(.deviceModel):not(.evseConnectors) td {
        display: block;
        width: 100%;
    }
    table.res:not(.deviceModel):not(.evseConnectors) { table-layout: auto; }
    table.res:not(.deviceModel):not(.evseConnectors) thead { display: none; }

    table.res:not(.deviceModel):not(.evseConnectors) tr {
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        background: var(--surface);
        box-shadow: var(--shadow-sm);
        margin-bottom: 12px;
        overflow: hidden;
    }
    table.res:not(.deviceModel):not(.evseConnectors) tr:nth-child(odd),
    table.res:not(.deviceModel):not(.evseConnectors) tr:nth-child(even),
    table.res:not(.deviceModel):not(.evseConnectors) tr:hover {
        background: var(--surface);
    }

    table.res:not(.deviceModel):not(.evseConnectors) td {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 14px;
        text-align: right;
        padding: 9px 12px;
        border: 0;
        border-bottom: 1px solid var(--border);
        white-space: normal;
        word-break: break-word;
    }
    table.res:not(.deviceModel):not(.evseConnectors) td:last-child { border-bottom: 0; }
    table.res:not(.deviceModel):not(.evseConnectors) td::before {
        content: attr(data-label);
        flex: 0 0 42%;
        text-align: left;
        font-weight: 600;
        color: var(--text-muted);
    }
    /* cells without a header label (e.g. the action column): no label, hide if empty */
    table.res:not(.deviceModel):not(.evseConnectors) td[data-label=""]::before { content: none; }
    table.res:not(.deviceModel):not(.evseConnectors) td[data-label=""] { justify-content: flex-end; }
}
