:root {
  color-scheme: dark;
  --bg: #0b0f14;
  --panel: #131922;
  --panel-2: #19212c;
  --line: #283342;
  --text: #edf3f8;
  --muted: #8e9bab;
  --accent: #33d17a;
  --accent-dark: #153d2a;
  --danger: #ff6677;
  --warning: #ffbd4a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at 80% -10%, #183327 0, transparent 34%), var(--bg); color: var(--text); min-height: 100vh; }
button, input, select { font: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.topbar { min-height: 68px; padding: 12px clamp(18px, 4vw, 54px); display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); background: rgba(11,15,20,.88); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 11px; letter-spacing: .04em; }
.brand span:last-child { display: grid; }
.brand small { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-weight: 900; color: #07110b; background: var(--accent); box-shadow: 0 0 28px #33d17a44; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.status-pill { border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; color: var(--muted); font-size: 12px; }
.status-pill.online { color: var(--accent); border-color: #2d6b4a; background: #10291d; }
main { width: min(1500px, 100%); margin: 0 auto; padding: clamp(18px, 4vw, 48px); }
.login-shell { min-height: calc(100vh - 165px); display: grid; place-items: center; }
.panel { background: linear-gradient(160deg, #151c25, #10161e); border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 18px 60px #0006; }
.login-card { width: min(430px, 100%); padding: clamp(24px, 5vw, 42px); }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(28px, 4vw, 42px); letter-spacing: -.035em; margin-bottom: 10px; }
h2 { font-size: 18px; }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; margin-bottom: 8px; }
label { display: grid; gap: 7px; color: #c7d0da; font-size: 13px; margin: 16px 0; }
input, select { width: 100%; color: var(--text); background: #0c1118; border: 1px solid #344152; border-radius: 8px; padding: 10px 11px; outline: none; }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #33d17a20; }
.check { display: flex; align-items: center; gap: 9px; }
.check input { width: auto; }
.button { border: 1px solid var(--line); border-radius: 8px; padding: 9px 13px; color: var(--text); background: var(--panel-2); cursor: pointer; font-weight: 700; font-size: 13px; }
.button:hover { filter: brightness(1.15); }
.button.primary { background: var(--accent); color: #06120b; border-color: var(--accent); }
.button.ghost { background: transparent; }
.button.danger { color: var(--danger); }
.button.wide { width: 100%; padding: 12px; }
.button.small { padding: 6px 8px; font-size: 11px; }
.form-error { min-height: 18px; color: var(--danger); font-size: 13px; }
.tabs { display: flex; gap: 5px; border-bottom: 1px solid var(--line); margin-bottom: 34px; overflow-x: auto; }
.tab { border: 0; border-bottom: 2px solid transparent; padding: 11px 15px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 700; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.view { display: none; }
.view.active { display: block; }
.section-heading { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin-bottom: 22px; }
.section-heading h1 { margin-bottom: 0; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.vehicle-card { padding: 20px; border-radius: 13px; border: 1px solid var(--line); background: linear-gradient(145deg, var(--panel-2), #111821); }
.vehicle-card .car-id { color: var(--accent); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.vehicle-card .button { margin-top: 8px; }
.live-select label { margin: 0; min-width: 230px; }
.live-status-row { display: flex; align-items: center; gap: 13px; flex-wrap: wrap; margin-bottom: 16px; }
.status-pill.delayed { color: var(--warning); border-color: #7c622d; background: #2a2111; }
.status-pill.offline { color: var(--danger); border-color: #75313c; background: #2c151a; }
.telemetry-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 11px; }
.telemetry-tile { min-height: 112px; padding: 15px; border-radius: 12px; border: 1px solid var(--line); background: linear-gradient(145deg, #18212c, #111821); }
.telemetry-tile .tile-label { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.telemetry-tile .tile-value { display: block; margin-top: 9px; font-size: clamp(25px, 3vw, 36px); font-weight: 850; letter-spacing: -.035em; }
.telemetry-tile .tile-unit { color: var(--muted); font-size: 12px; font-weight: 500; margin-left: 4px; }
.live-lower { margin-top: 18px; grid-template-columns: minmax(320px, .8fr) minmax(320px, 1.2fr); }
.button-row { display: flex; gap: 8px; flex-wrap: wrap; }
.location-panel { padding: 20px; min-height: 250px; background: radial-gradient(circle at 70% 30%, #17412e 0, transparent 34%), linear-gradient(160deg, #131b24, #0e141b); }
.coordinate-readout { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 25px 0; }
.coordinate-readout span { display: grid; gap: 7px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .09em; }
.coordinate-readout strong { color: var(--text); font-size: 20px; letter-spacing: 0; text-transform: none; }
.two-column { display: grid; grid-template-columns: minmax(270px, 370px) minmax(0, 1fr); gap: 18px; align-items: start; }
.stack { display: grid; gap: 18px; }
.form-panel, .table-panel { padding: 20px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; text-align: left; }
th, td { padding: 11px 9px; border-bottom: 1px solid var(--line); vertical-align: top; }
.badge { display: inline-flex; padding: 4px 7px; border-radius: 999px; background: #243040; color: #c5d0db; font-size: 11px; }
.badge.good { color: var(--accent); background: var(--accent-dark); }
.key-reveal { margin-top: 18px; padding: 14px; border: 1px solid #8f6b22; background: #2a2110; border-radius: 10px; }
.key-reveal code { display: block; margin-top: 10px; color: #ffe1a0; overflow-wrap: anywhere; user-select: all; }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: 420px; padding: 13px 16px; border-radius: 10px; color: var(--text); background: #1a2c22; border: 1px solid #316b4b; box-shadow: 0 15px 40px #0009; z-index: 10; }
.toast.error { background: #34171d; border-color: #843342; }
@media (max-width: 850px) { .two-column, .live-lower { grid-template-columns: 1fr; } .topbar { align-items: flex-start; } .topbar-actions { flex-wrap: wrap; justify-content: flex-end; } }
@media (max-width: 560px) { main { padding: 18px 12px; } .topbar { padding: 10px 12px; } #current-user, #api-status { display: none; } .section-heading { align-items: flex-start; } }
