/* PDP Group Fleet Command - dark / light dashboard */
:root, [data-theme="dark"] {
  --bg: #070b14; --bg-2: #0b1120; --panel: #0f1626; --panel-2: #131c2f; --raise: #17223a;
  --line: rgba(148,163,184,.12); --line-2: rgba(148,163,184,.2);
  --text: #e6ecf5; --text-2: #b4c0d3; --muted: #7c8aa3;
  --accent: #f5a524; --accent-2: #ffcf6b; --cyan: #22d3ee; --accent-ink: #1a1200;
  --moving: #22c55e; --idle: #f59e0b; --stopped: #ef4444; --offline: #64748b;
  --glass: rgba(13,20,35,.78); --shadow: 0 10px 40px rgba(0,0,0,.45);
  --input: #0b1220; --hover: rgba(148,163,184,.07); --sel: rgba(245,165,36,.1);
  --map-bg: #0b111d; --label-bg: #0f1626; --label-fg: #e6ecf5;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #eef2f8; --bg-2: #e6ebf3; --panel: #ffffff; --panel-2: #f6f8fc; --raise: #ffffff;
  --line: rgba(15,23,42,.08); --line-2: rgba(15,23,42,.14);
  --text: #0f172a; --text-2: #334155; --muted: #64748b;
  --accent: #e08e0b; --accent-2: #f5a524; --cyan: #0891b2; --accent-ink: #fff;
  --glass: rgba(255,255,255,.88); --shadow: 0 10px 30px rgba(15,23,42,.12);
  --input: #ffffff; --hover: rgba(15,23,42,.04); --sel: rgba(224,142,11,.1);
  --map-bg: #e5e9f0; --label-bg: #ffffff; --label-fg: #0f172a;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
code { font-family: "JetBrains Mono", monospace; background: var(--panel-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; font-size: 12px; word-break: break-all; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }

/* ---------- controls ---------- */
.btn { border: 1px solid transparent; border-radius: 10px; padding: 9px 16px; cursor: pointer; font-weight: 600; background: var(--panel-2); transition: all .15s; white-space: nowrap; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: var(--accent-ink); box-shadow: 0 4px 18px rgba(245,165,36,.25); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.07); transform: translateY(-1px); }
.btn.ghost { background: transparent; border-color: var(--line-2); }
.btn.ghost:hover:not(:disabled) { background: var(--hover); }
.btn.danger { background: transparent; border-color: rgba(239,68,68,.4); color: #f87171; }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.wide { width: 100%; padding: 13px; font-size: 15px; }
.chip { border: 1px solid var(--line-2); background: transparent; border-radius: 20px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text-2); }
.chip:hover { border-color: var(--accent); color: var(--text); }
.icon-btn { background: transparent; border: 0; cursor: pointer; padding: 8px; border-radius: 10px; color: var(--text-2); display: grid; place-items: center; }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.ring { border: 1px solid var(--line-2); }
.icon-btn.spin svg { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
input, select, textarea { border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 11px; background: var(--input); outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245,165,36,.15); }
input[type="date"] { color-scheme: inherit; }
label { display: block; font-weight: 600; font-size: 12.5px; color: var(--text-2); letter-spacing: .01em; }
label input, label select, label textarea { display: block; width: 100%; margin-top: 6px; font-weight: 400; color: var(--text); }
.form-msg { color: #f87171; font-size: 13px; min-height: 1em; margin: 8px 0 0; }
.form-msg.ok { color: var(--moving); }
.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { width: 100%; padding-left: 34px; }

/* ---------- login ---------- */
.auth { min-height: 100%; display: grid; grid-template-columns: 1.15fr 1fr; background: var(--bg); }
.auth-hero { position: relative; overflow: hidden; background: radial-gradient(900px 500px at 15% 10%, rgba(245,165,36,.18), transparent 60%), radial-gradient(700px 500px at 90% 90%, rgba(34,211,238,.14), transparent 60%), #060a12; color: #e6ecf5; display: flex; align-items: center; padding: 60px; }
.hero-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(148,163,184,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(148,163,184,.07) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%); }
.hero-content { position: relative; max-width: 520px; }
.hero-content h1 { font-size: 44px; line-height: 1.1; letter-spacing: -.02em; margin: 46px 0 16px; font-weight: 800; }
.hero-content h1 em { font-style: normal; background: linear-gradient(90deg, #ffcf6b, #f5a524 40%, #22d3ee); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-content p { color: #9fb0c8; font-size: 16px; max-width: 440px; }
.hero-stats { display: flex; gap: 30px; margin-top: 36px; }
.hero-stats b { display: block; font-size: 22px; }
.hero-stats span { color: #7c8aa3; font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; }
.brand-lg { display: flex; align-items: center; gap: 12px; }
.brand-lg img { width: 46px; height: 46px; border-radius: 12px; }
.brand-lg b { display: block; font-size: 18px; }
.brand-lg span { color: #7c8aa3; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.auth-side { display: grid; place-items: center; padding: 30px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { margin: 0 0 4px; font-size: 26px; letter-spacing: -.01em; }
.auth-card .muted { margin: 0 0 24px; }
.auth-card label { margin-bottom: 15px; }
.auth-card input { padding: 12px 13px; }

/* ---------- shell ---------- */
.app { height: 100%; display: flex; }
.rail { width: 84px; flex: none; background: var(--bg-2); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; padding: 14px 0; gap: 6px; z-index: 900; }
.rail-logo img { width: 40px; height: 40px; border-radius: 11px; display: block; margin-bottom: 18px; box-shadow: 0 6px 18px rgba(245,165,36,.25); }
.rail button { width: 68px; border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 12px; padding: 9px 0 7px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; position: relative; transition: all .15s; }
.rail button svg { width: 21px; height: 21px; }
.rail button:hover { color: var(--text); background: var(--hover); }
.rail button.active { color: var(--accent); background: var(--sel); }
.rail button.active::before { content: ""; position: absolute; left: -8px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--accent); }
.rail-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { height: 70px; flex: none; display: flex; align-items: center; gap: 16px; padding: 0 22px; border-bottom: 1px solid var(--line); background: var(--bg); }
.eyebrow { font-size: 10.5px; letter-spacing: .18em; color: var(--muted); font-weight: 700; }
.title-block h1 { margin: 2px 0 0; font-size: 21px; letter-spacing: -.01em; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.live-chip { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); background: var(--panel); border: 1px solid var(--line); padding: 7px 12px; border-radius: 20px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--moving); box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: pulse 2s infinite; }
.pulse.warn { background: var(--idle); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.55); } 70% { box-shadow: 0 0 0 9px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
.clock { font-family: "JetBrains Mono", monospace; font-size: 13px; color: var(--text-2); }
.user-chip { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 13px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--cyan), #6366f1); color: #fff; font-weight: 700; }
.view { flex: 1; min-height: 0; }

/* ---------- KPIs ---------- */
.view-map { display: flex; flex-direction: column; padding: 16px 18px 18px; gap: 14px; }
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; flex: none; }
.kpi { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px 12px; cursor: pointer; overflow: hidden; transition: border-color .15s, transform .15s; }
.kpi:hover { transform: translateY(-1px); border-color: var(--line-2); }
.kpi.on { border-color: var(--c, var(--accent)); box-shadow: inset 0 0 0 1px var(--c, var(--accent)), 0 8px 30px -12px var(--c, var(--accent)); }
.kpi::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, var(--c, var(--accent)) 0%, transparent 70%); opacity: .14; }
.kpi .k-top { display: flex; align-items: center; justify-content: space-between; }
.kpi .k-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.kpi .k-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--c, var(--accent)) 16%, transparent); color: var(--c, var(--accent)); }
.kpi .k-ico svg { width: 17px; height: 17px; }
.kpi .k-val { font-size: 32px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi .k-bar { height: 4px; border-radius: 4px; background: var(--line); margin-top: 10px; overflow: hidden; }
.kpi .k-bar i { display: block; height: 100%; border-radius: 4px; background: var(--c, var(--accent)); transition: width .5s; }
.kpi.all { --c: var(--accent); } .kpi.moving { --c: var(--moving); } .kpi.idle { --c: var(--idle); } .kpi.stopped { --c: var(--stopped); } .kpi.offline { --c: var(--offline); }

/* ---------- map area ---------- */
.map-area { flex: 1; min-height: 0; display: flex; gap: 14px; }
.side { width: 360px; flex: none; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; z-index: 800; }
.side-head { padding: 14px 14px 10px; }
.filter-row { display: flex; gap: 6px; margin-top: 8px; }
.filter-row select { flex: 1; min-width: 0; padding: 7px 8px; font-size: 12.5px; }
.list-meta { display: flex; justify-content: space-between; align-items: center; padding: 6px 16px 8px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); }
.brands { display: flex; gap: 8px; text-transform: none; letter-spacing: 0; font-weight: 600; }
.brands span { display: inline-flex; align-items: center; gap: 4px; }
.brands i { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }
.vlist { overflow-y: auto; flex: 1; padding: 6px; }
.vlist::-webkit-scrollbar, .detail::-webkit-scrollbar, .page::-webkit-scrollbar { width: 8px; }
.vlist::-webkit-scrollbar-thumb, .detail::-webkit-scrollbar-thumb, .page::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; }
.vitem { display: flex; gap: 11px; padding: 10px; border-radius: 12px; cursor: pointer; align-items: center; border: 1px solid transparent; transition: background .12s; }
.vitem + .vitem { margin-top: 2px; }
.vitem:hover { background: var(--hover); }
.vitem.sel { background: var(--sel); border-color: rgba(245,165,36,.35); }
.vitem .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); position: relative; }
.vitem .ico svg { width: 21px; height: 21px; fill: currentColor; stroke: none; }
.vitem .ico::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border-radius: 50%; background: var(--c); border: 2px solid var(--panel); }
.vitem.st-moving .ico::after { animation: pulse 2s infinite; }
.vitem .main { flex: 1; min-width: 0; }
.vitem .reg { font-family: "JetBrains Mono", monospace; font-weight: 700; font-size: 13.5px; letter-spacing: .02em; }
.vitem .sub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.vitem .right { text-align: right; font-size: 12px; white-space: nowrap; }
.vitem .spd { font-weight: 700; font-size: 13px; color: var(--c); }
.vitem .ago { color: var(--muted); margin-top: 2px; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 1px 7px 1px 6px; border-radius: 6px; white-space: nowrap; color: var(--b); background: color-mix(in srgb, var(--b) 16%, transparent); border: 1px solid color-mix(in srgb, var(--b) 35%, transparent); }
[data-theme="dark"] .badge { color: color-mix(in srgb, var(--b) 55%, #fff); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 20px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.st-moving { --c: var(--moving); } .st-idle { --c: var(--idle); } .st-stopped { --c: var(--stopped); } .st-offline { --c: var(--offline); }
.empty { padding: 34px 16px; text-align: center; color: var(--muted); }

.map-wrap { position: relative; flex: 1; min-width: 0; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); }
#map { position: absolute; inset: 0; background: var(--map-bg); }
.leaflet-container { font-family: inherit; }
.leaflet-control-zoom a, .leaflet-control-layers { background: var(--glass) !important; color: var(--text) !important; border-color: var(--line) !important; backdrop-filter: blur(10px); }
.leaflet-bar { border: 1px solid var(--line-2) !important; border-radius: 10px !important; overflow: hidden; box-shadow: var(--shadow) !important; }
.leaflet-control-layers { border-radius: 10px !important; box-shadow: var(--shadow) !important; }
.leaflet-control-layers-toggle { filter: var(--layers-filter, none); }
[data-theme="dark"] .leaflet-control-layers-toggle { --layers-filter: invert(1) hue-rotate(180deg); }
.leaflet-control-attribution { background: var(--glass) !important; color: var(--muted) !important; font-size: 10px; }
.leaflet-control-attribution a { color: var(--text-2) !important; }
.leaflet-control-scale-line { background: var(--glass); color: var(--text-2); border-color: var(--muted); }
.leaflet-tooltip { background: var(--panel); color: var(--text); border: 1px solid var(--line-2); box-shadow: var(--shadow); border-radius: 8px; }
.map-opt { position: absolute; left: 60px; top: 10px; z-index: 600; background: var(--glass); backdrop-filter: blur(10px); padding: 6px 11px; border-radius: 10px; border: 1px solid var(--line-2); font-weight: 600; display: flex; gap: 7px; align-items: center; color: var(--text); box-shadow: var(--shadow); }
.map-opt input { width: auto; margin: 0; display: inline; accent-color: var(--accent); }
.legend { position: absolute; left: 12px; bottom: 26px; z-index: 600; display: flex; gap: 12px; background: var(--glass); backdrop-filter: blur(10px); border: 1px solid var(--line-2); border-radius: 10px; padding: 6px 12px; font-size: 12px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .dot { width: 7px; height: 7px; }

/* markers */
.mk { position: relative; }
.mk .pin { width: 32px; height: 32px; border-radius: 50%; background: var(--c); border: 2px solid rgba(255,255,255,.9); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 30%, transparent), 0 4px 12px rgba(0,0,0,.45); display: grid; place-items: center; color: #fff; }
.mk .pin svg { width: 17px; height: 17px; fill: currentColor; stroke: none; }
.mk.st-moving .pin { animation: halo 2s infinite; }
@keyframes halo { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 60%, transparent), 0 4px 12px rgba(0,0,0,.45); } 70% { box-shadow: 0 0 0 14px transparent, 0 4px 12px rgba(0,0,0,.45); } 100% { box-shadow: 0 0 0 0 transparent, 0 4px 12px rgba(0,0,0,.45); } }
.mk .lbl { position: absolute; left: 36px; top: 6px; background: var(--label-bg); color: var(--label-fg); border: 1px solid var(--line-2); border-left: 3px solid var(--c); border-radius: 6px; padding: 1px 7px; font: 700 11px/1.6 "JetBrains Mono", monospace; white-space: nowrap; box-shadow: 0 3px 10px rgba(0,0,0,.3); }
.nolabels .mk .lbl { display: none; }
.mk.sel .pin { transform: scale(1.22); border-color: var(--accent); }

/* detail card */
.detail { position: absolute; right: 12px; top: 12px; width: 340px; max-height: calc(100% - 24px); overflow-y: auto; z-index: 700; background: var(--glass); backdrop-filter: blur(16px); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow); }
.detail .head { padding: 16px 18px 14px; position: relative; }
.detail .head h2 { margin: 0; font: 800 21px/1.2 "JetBrains Mono", monospace; letter-spacing: .01em; }
.detail .head .muted { margin-top: 3px; font-size: 13px; }
.detail .close { position: absolute; right: 10px; top: 10px; width: 30px; height: 30px; border-radius: 8px; border: 0; background: var(--hover); font-size: 18px; cursor: pointer; color: var(--muted); }
.detail .close:hover { color: var(--text); }
.speedo { display: flex; align-items: center; gap: 16px; padding: 4px 18px 14px; }
.gauge { position: relative; width: 104px; height: 60px; flex: none; }
.gauge svg { width: 104px; height: 60px; stroke-width: 9; }
.gauge .g-val { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font-weight: 800; font-size: 22px; line-height: 1; }
.gauge .g-val small { display: block; font-size: 10px; color: var(--muted); font-weight: 600; letter-spacing: .08em; margin-top: 2px; }
.speedo .facts { display: grid; gap: 7px; font-size: 13px; flex: 1; }
.speedo .facts div { display: flex; justify-content: space-between; gap: 8px; }
.speedo .facts span { color: var(--muted); }
.speedo .facts b { font-variant-numeric: tabular-nums; }
.detail .sec { padding: 13px 18px; border-top: 1px solid var(--line); }
.sec-t { font-size: 10.5px; letter-spacing: .14em; font-weight: 700; color: var(--muted); }
.detail .addr { font-size: 13px; margin-top: 5px; }
.detail .addr a { color: var(--cyan); }
.detail .row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.detail .row input[type=date] { flex: 1; min-width: 0; padding: 7px 9px; }
.trip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; text-align: center; }
.trip div { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 4px; }
.trip b { display: block; font-size: 16px; }
.trip small { color: var(--muted); font-size: 11px; }
.playback { position: absolute; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 700; background: var(--glass); backdrop-filter: blur(16px); border: 1px solid var(--line-2); border-radius: 14px; padding: 9px 12px; box-shadow: var(--shadow); display: flex; gap: 12px; align-items: center; width: min(660px, calc(100% - 24px)); }
.playback input[type=range] { flex: 1; padding: 0; border: 0; box-shadow: none; background: transparent; accent-color: var(--accent); }
.playback #pbInfo { font: 500 12px "JetBrains Mono", monospace; white-space: nowrap; min-width: 170px; color: var(--text-2); }

/* ---------- pages ---------- */
.page { overflow-y: auto; padding: 22px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 0 auto 16px; max-width: 1280px; }
.page-head p { margin: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px; max-width: 1280px; margin: 0 auto 16px; }
.card h3 { margin: 0 0 14px; font-size: 15px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 1280px; margin: 0 auto; }
.grid2 .card { margin: 0; }
.table-search { width: 300px; max-width: 100%; margin-bottom: 14px; }
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th.sortable { cursor: pointer; }
.tbl th.sortable:hover { color: var(--text); }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl td b { font-family: "JetBrains Mono", monospace; }
.tbl tbody tr:hover td { background: var(--hover); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.inactive td { opacity: .5; }
.tbl tfoot td { font-weight: 700; border-bottom: 0; color: var(--accent); }
.kmbar { display: inline-block; width: 70px; height: 5px; border-radius: 4px; background: var(--line); vertical-align: middle; margin-right: 8px; overflow: hidden; }
.kmbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--cyan)); }
.report-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.report-bar label input { width: auto; }
.report-bar .spacer { flex: 1; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; padding-bottom: 2px; }
.report-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.report-kpis div { background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.report-kpis b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.01em; }
.report-kpis span { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.prov { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--line); }
.prov:last-of-type { border-bottom: 0; margin-bottom: 12px; }
.prov .err { color: #f87171; font-size: 12.5px; }
.stack label { margin-bottom: 12px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.inline-form input, .inline-form select { flex: 1 1 140px; }
.ulist .u { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); gap: 8px; }
#integration p { line-height: 1.7; }

/* ---------- modal & toast ---------- */
.modal { position: fixed; inset: 0; z-index: 2000; background: rgba(3,6,12,.6); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; }
.modal-card { background: var(--panel); border: 1px solid var(--line-2); border-radius: 18px; width: 100%; max-width: 470px; padding: 24px; box-shadow: var(--shadow); max-height: 92vh; overflow-y: auto; }
.modal-card h2 { margin: 0 0 16px; font-size: 19px; }
.modal-card label { margin-bottom: 13px; }
.modal-card .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.modal-card .actions .left { margin-right: auto; }
.check { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.check input { width: auto; margin: 0; display: inline; accent-color: var(--accent); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--raise); color: var(--text); border: 1px solid var(--line-2); border-left: 4px solid var(--moving); padding: 11px 18px; border-radius: 10px; z-index: 3000; box-shadow: var(--shadow); font-weight: 600; }
.toast.err { border-left-color: var(--stopped); }

/* ---------- responsive ---------- */
.only-mobile { display: none; }
@media (max-width: 1250px) { .clock { display: none; } .kpi .k-val { font-size: 26px; } }
@media (max-width: 1000px) { .auth { grid-template-columns: 1fr; } .auth-hero { display: none; } .user-chip #who { display: none; } .live-chip { max-width: 190px; overflow: hidden; } .report-kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) {
  .app { flex-direction: column-reverse; }
  .rail { width: 100%; height: 64px; flex-direction: row; justify-content: space-around; padding: 0 6px; border-right: 0; border-top: 1px solid var(--line); }
  .rail-logo { display: none; }
  .rail button { width: auto; flex: 1; font-size: 10px; }
  .rail button.active::before { left: 25%; right: 25%; top: -1px; bottom: auto; width: auto; height: 3px; }
  .rail-bottom { margin: 0; flex-direction: row; flex: 1.6; }
  .rail-bottom .logout-btn { display: none; }
  .main { min-height: 0; flex: 1; }
  .only-mobile { display: grid; }
  .top { height: 58px; padding: 0 10px; gap: 8px; }
  .eyebrow { display: none; }
  .title-block h1 { font-size: 17px; }
  .view-map { padding: 10px; gap: 10px; }
  .kpis { grid-template-columns: repeat(5, minmax(86px, 1fr)); overflow-x: auto; gap: 8px; }
  .kpi { padding: 10px 11px; border-radius: 12px; }
  .kpi .k-ico { display: none; }
  .kpi .k-val { font-size: 22px; }
  .kpi .k-label { font-size: 10px; }
  .kpi .k-sub { display: none; }
  .map-area { position: relative; }
  .side { position: absolute; top: 0; bottom: 0; left: 0; width: min(360px, 90vw); transform: translateX(-110%); transition: transform .2s; box-shadow: var(--shadow); z-index: 950; }
  .side.open { transform: none; }
  .detail { left: 8px; right: 8px; width: auto; top: auto; bottom: 8px; max-height: 62%; }
  .legend { display: none; }
  .grid2 { grid-template-columns: 1fr; }
  .page { padding: 12px; }
  .playback #pbInfo { min-width: 0; }
}
@media (max-width: 520px) { .live-chip { display: none; } }

/* refinements */
.list-meta { flex-wrap: wrap; gap: 6px 10px; }
.brands { flex-wrap: wrap; gap: 4px 10px; }
.brands span { white-space: nowrap; }
.speedo { gap: 12px; }
.gauge { width: 96px; }
.gauge svg { width: 96px; }
.speedo .facts { font-size: 12.5px; }
.speedo .facts b { white-space: nowrap; }
.map-wrap:has(.playback:not(.hidden)) .legend { display: none; }
/* map styles from OpenStreetMap tiles (no key needed) */
.tiles-dark { filter: invert(1) hue-rotate(185deg) brightness(.92) contrast(.88) saturate(.35); }
.tiles-light { filter: saturate(.55) brightness(1.03); }

/* compact header + KPI strip (more room for map and vehicle list) */
.top { height: 54px; padding: 0 18px; }
.eyebrow { display: none; }
.title-block h1 { font-size: 18px; margin: 0; }
.live-chip { padding: 5px 11px; }
.avatar { width: 30px; height: 30px; font-size: 13px; }
.view-map { padding: 10px 14px 14px; gap: 10px; }
.kpis { gap: 10px; }
.kpi { display: flex; align-items: center; gap: 10px; padding: 9px 12px 11px; border-radius: 12px; }
.kpi::after { width: 70px; height: 70px; right: -24px; top: -24px; }
.kpi .k-ico { width: 32px; height: 32px; flex: none; }
.kpi .k-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.kpi .k-label { font-size: 11px; letter-spacing: .08em; white-space: nowrap; }
.kpi .k-sub { font-size: 11.5px; margin: 1px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .k-val { font-size: 26px; margin: 0; flex: none; }
.kpi .k-bar { position: absolute; left: 12px; right: 12px; bottom: 5px; height: 3px; margin: 0; }
.map-area { gap: 10px; }
.side, .map-wrap { border-radius: 14px; }
@media (max-width: 1250px) { .kpi .k-sub { display: none; } .kpi .k-val { font-size: 22px; } }
@media (max-width: 860px) {
  .kpi { padding: 7px 9px 9px; gap: 6px; }
  .kpi .k-ico { display: none; }
  .kpi .k-label { font-size: 9.5px; }
  .kpi .k-val { font-size: 19px; }
}
@media (max-width: 860px) {
  .kpi { flex-direction: column; align-items: flex-start; gap: 0; }
  .kpi .k-txt { width: 100%; }
  .kpi .k-label { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
}

/* notifications */
.rail button .nbadge { position: absolute; top: 4px; right: 12px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--stopped); color: #fff; font: 700 10px/17px Inter, sans-serif; font-style: normal; text-align: center; }
.n-kpis { max-width: 1280px; margin: 0 auto 16px; }
.n-kpis div { background: var(--panel); border-radius: 16px; position: relative; overflow: hidden; }
.n-kpis div::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c, var(--accent)); }
.n-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.n-head h3 { margin: 0; }
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--raise); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.etype { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12.5px; color: var(--c); }
.etype i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.et-overspeed { --c: var(--stopped); } .et-harsh_brake, .et-harsh_accel { --c: var(--idle); } .et-offline { --c: var(--offline); }
.nform textarea { resize: vertical; }
.nrow { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 14px; }
.ngrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 12px 0; }
.mailbox { margin: 6px 0 12px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.mailbox summary { cursor: pointer; font-weight: 600; color: var(--text-2); }
.nactions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.preview-frame { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.modal-card.wide { max-width: 820px; }
.fuel { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--cyan); font-weight: 600; }
.fields { font-size: 12px; color: var(--muted); margin-top: 4px; }
.fields b { color: var(--text-2); }
@media (max-width: 1000px) { .ngrid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) { .rail button .nbadge { right: 22%; } .ngrid { grid-template-columns: 1fr; } }
.chip.on { border-color: var(--accent); color: var(--text); background: var(--sel); }

/* live movement */
.mk .dir { position: absolute; left: -14px; top: -14px; width: 60px; height: 60px; pointer-events: none; }
.mk .dir i { position: absolute; left: 50%; top: 0; transform: translateX(-50%); width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 11px solid var(--c); filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.mk.follow .pin { border-color: var(--accent); }
.mk.follow .lbl { border-left-color: var(--accent); }
.follow-chip { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 650; display: flex; align-items: center; gap: 10px; background: var(--glass); backdrop-filter: blur(14px); border: 1px solid rgba(245,165,36,.5); border-radius: 30px; padding: 6px 8px 6px 14px; box-shadow: var(--shadow); font-size: 13px; white-space: nowrap; }
.follow-chip b { color: var(--accent); letter-spacing: .08em; font-size: 11.5px; }
.follow-chip .rec { width: 9px; height: 9px; border-radius: 50%; background: #ef4444; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.wide-btn { width: 100%; }
.map-wrap:has(.detail:not(.hidden)) .follow-chip { left: calc(50% - 176px); }
@media (max-width: 860px) { .follow-chip { bottom: 12px; font-size: 12px; } .follow-chip .muted { display: none; } }

.map-wrap:has(.follow-chip:not(.hidden)) .legend { display: none; }
