:root {
  --bg: #07111f;
  --panel: #0d1a2b;
  --panel-2: #112239;
  --line: rgba(255,255,255,.09);
  --text: #edf5ff;
  --muted: #88a0ba;
  --accent: #2d8cff;
  --good: #22c98b;
  --warn: #ffb020;
  --bad: #ff5a6f;
  --shadow: 0 18px 50px rgba(0,0,0,.3);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; overflow: hidden; }
button, input, select { font: inherit; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; background: linear-gradient(90deg,#0c1a2d,#0a1524); border-bottom: 1px solid var(--line); }
.eyebrow { font-size: 10px; letter-spacing: .16em; color: #6fa9e9; font-weight: 800; }
h1 { font-size: 23px; margin: 4px 0 0; letter-spacing: -.03em; }
h1 span { color: var(--accent); font-size: 12px; vertical-align: top; margin-left: 4px; }
.topbar-right { display: flex; align-items: center; gap: 22px; }
.connection { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; }
.connection i { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 12px currentColor; }
.connection.online i { background: var(--good); }
.connection.offline i { background: var(--bad); }
.clock { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 20px; letter-spacing: .04em; }
.layout { display: grid; grid-template-columns: 390px 1fr; height: calc(100vh - 76px); }
.sidebar { padding: 14px; overflow: hidden; display: flex; flex-direction: column; gap: 12px; border-right: 1px solid var(--line); background: #081523; }
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.kpi { min-height: 87px; background: linear-gradient(145deg,var(--panel-2),var(--panel)); border: 1px solid var(--line); border-radius: 13px; padding: 12px; position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; width: 60px; height: 60px; right: -24px; top: -24px; background: var(--accent); opacity: .12; border-radius: 50%; }
.kpi-good::after { background: var(--good); }.kpi-warn::after { background: var(--warn); }.kpi-bad::after { background: var(--bad); }
.kpi span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.kpi strong { display: block; font-size: 28px; line-height: 1.15; margin-top: 2px; }
.kpi small { color: #6f879f; font-size: 10px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); }
.panel-title { min-height: 43px; padding: 0 13px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); text-transform: uppercase; font-size: 11px; letter-spacing: .08em; font-weight: 800; }
.panel-title b { background: rgba(45,140,255,.14); color: #7cb8ff; padding: 3px 8px; border-radius: 99px; }
.filters { padding-bottom: 11px; }
.filters .control { margin: 10px 11px 0; width: calc(100% - 22px); }
.filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 11px; }
.filter-row .control { margin-left: 0; margin-right: 0; width: 100%; }
.control { color: var(--text); background: #091523; border: 1px solid rgba(255,255,255,.12); border-radius: 9px; padding: 10px 11px; outline: none; font-size: 12px; }
.control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(45,140,255,.12); }
.control option { background: #0c1929; }
.text-button { border: 0; background: none; color: #6fa9e9; cursor: pointer; font-size: 10px; }
.vehicle-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.vehicle-list { overflow-y: auto; padding: 7px; }
.vehicle-row { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 9px; border: 1px solid transparent; border-radius: 10px; padding: 10px 9px; cursor: pointer; transition: .18s ease; }
.vehicle-row:hover { background: rgba(255,255,255,.035); border-color: var(--line); }
.vehicle-row.active { background: rgba(45,140,255,.11); border-color: rgba(45,140,255,.45); }
.health-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 8px currentColor; }
.health-dot.healthy { color: var(--good); background: var(--good); }.health-dot.warning { color: var(--warn); background: var(--warn); }.health-dot.critical { color: var(--bad); background: var(--bad); }
.vehicle-main strong { display: block; font-size: 13px; }.vehicle-main small { color: var(--muted); font-size: 10px; }
.vehicle-meta { text-align: right; }.vehicle-meta b { display: block; color: #bcd3ea; font-size: 11px; }.vehicle-meta small { color: #668097; font-size: 9px; }
.workspace { position: relative; min-width: 0; }
#map { height: 100%; width: 100%; background: #0a1624; }
.leaflet-control-attribution { background: rgba(8,21,35,.8)!important; color: #87a0b8!important; }.leaflet-control-attribution a { color: #7cb8ff!important; }
.map-toolbar { position: absolute; z-index: 500; left: 16px; top: 16px; display: flex; gap: 8px; align-items: center; background: rgba(9,21,35,.92); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 7px; border-radius: 11px; backdrop-filter: blur(10px); }
.map-toolbar button, .map-toolbar label { color: #cde0f4; background: #102239; border: 1px solid rgba(255,255,255,.1); border-radius: 8px; padding: 7px 9px; font-size: 10px; cursor: pointer; }
.map-toolbar label { display: flex; gap: 6px; align-items: center; }
.detail-card { position: absolute; z-index: 500; top: 16px; right: 16px; width: 340px; max-height: calc(100% - 190px); overflow-y: auto; background: rgba(9,21,35,.96); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.detail-empty { text-align: center; padding: 34px 25px; color: var(--muted); }.detail-empty h3 { color: var(--text); margin: 10px 0 5px; }.detail-empty p { font-size: 12px; line-height: 1.5; }.radar-icon { font-size: 34px; color: var(--accent); }
.detail-head { padding: 15px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.detail-head h2 { margin: 0; font-size: 20px; }.detail-head p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.badge { display: inline-flex; padding: 5px 8px; border-radius: 99px; text-transform: uppercase; font-size: 9px; font-weight: 900; letter-spacing: .05em; }
.badge.healthy { background: rgba(34,201,139,.13); color: #54e7b2; }.badge.warning { background: rgba(255,176,32,.13); color: #ffc55d; }.badge.critical { background: rgba(255,90,111,.13); color: #ff8797; }
.detail-body { padding: 13px; }
.source-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.source-card { border: 1px solid var(--line); border-radius: 11px; padding: 10px; background: rgba(255,255,255,.025); }
.source-card.active { border-color: rgba(45,140,255,.55); background: rgba(45,140,255,.08); }
.source-card span { color: var(--muted); font-size: 9px; text-transform: uppercase; }.source-card strong { display: block; margin-top: 4px; font-size: 13px; }.source-card small { color: #718aa2; font-size: 9px; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 7px; margin-top: 9px; }
.metric { background: #0d1e32; border-radius: 9px; padding: 9px; }.metric span { color: var(--muted); font-size: 8px; text-transform: uppercase; }.metric b { display: block; font-size: 13px; margin-top: 3px; }
.health-message { margin-top: 10px; padding: 10px; border-left: 3px solid var(--warn); background: rgba(255,176,32,.08); font-size: 11px; line-height: 1.45; border-radius: 6px; }
.health-message.healthy { border-color: var(--good); background: rgba(34,201,139,.07); }.health-message.critical { border-color: var(--bad); background: rgba(255,90,111,.07); }
.detail-actions { display: flex; gap: 7px; margin-top: 10px; }.detail-actions button { flex: 1; border: 1px solid var(--line); color: #cfe2f5; background: #10243b; padding: 8px; border-radius: 8px; cursor: pointer; font-size: 10px; }
.alert-drawer { position: absolute; z-index: 520; left: 16px; right: 16px; bottom: 16px; max-height: 150px; background: rgba(9,21,35,.96); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); transition: transform .2s ease; overflow: hidden; }
.alert-drawer.closed { transform: translateY(calc(100% - 42px)); }
.drawer-head { height: 42px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); font-size: 11px; }
.drawer-head button { background: none; border: 0; color: #70a9e8; cursor: pointer; font-size: 10px; }.live-pulse { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 0 rgba(255,90,111,.6); animation: pulse 1.7s infinite; }
.alert-list { display: flex; overflow-x: auto; padding: 9px; gap: 8px; min-height: 90px; }
.alert-item { min-width: 260px; max-width: 330px; border: 1px solid var(--line); border-left: 3px solid var(--warn); background: rgba(255,255,255,.025); border-radius: 9px; padding: 9px; cursor: pointer; }.alert-item.critical { border-left-color: var(--bad); }.alert-item strong { font-size: 11px; }.alert-item p { margin: 4px 0; color: #9ab0c5; font-size: 10px; line-height: 1.35; }.alert-item small { color: #647d95; font-size: 9px; }
.empty-state { color: var(--muted); font-size: 11px; text-align: center; padding: 22px; }
.bus-marker { width: 32px; height: 32px; border-radius: 11px 11px 11px 2px; transform: rotate(-45deg); border: 2px solid rgba(255,255,255,.9); box-shadow: 0 5px 18px rgba(0,0,0,.45); display: grid; place-items: center; }
.bus-marker span { transform: rotate(45deg); font-size: 13px; font-weight: 900; color: white; }
.source-point { width: 14px; height: 14px; border-radius: 50%; border: 3px solid white; box-shadow: 0 2px 8px rgba(0,0,0,.5); }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(255,90,111,0); } 100% { box-shadow: 0 0 0 0 rgba(255,90,111,0); } }
@media (max-width: 1000px) { .layout { grid-template-columns: 320px 1fr; }.detail-card { width: 300px; }.sidebar { padding: 9px; } }
@media (max-width: 760px) { body { overflow: auto; }.topbar { height: auto; padding: 14px; }.topbar-right { display: none; }.layout { display: block; height: auto; }.sidebar { height: 540px; }.workspace { height: 720px; }.detail-card { left: 12px; right: 12px; top: 65px; width: auto; max-height: 330px; }.map-toolbar { left: 12px; right: 12px; flex-wrap: wrap; }.alert-drawer { left: 12px; right: 12px; } }
.passenger-note { margin-top: 7px; color: #6f879f; font-size: 8px; line-height: 1.4; }
