/* Tata Dashboard — styles. Colours are tokens; dark is the default, light via [data-theme="light"].
   Red (--crit) is used only for danger: critical alerts and the AI detection box. */
:root {
  --bg: #08101e; --bg-2: #0c1628; --panel: #0f1a2d; --panel-2: #14223a; --panel-3: #1a2b47;
  --line: #1f3150; --line-strong: #3a5277; --text: #e8eef8; --muted: #8fa2bf; --faint: #5c7090;
  --accent: #3b9cff; --accent-2: #22d3ee; --tata: #1467b3; --ok: #22c55e;
  --low: #14b8a6; --med: #eab308; --high: #f97316; --crit: #ef4444;
  --iso-ground-a: #142540; --iso-ground-b: #1b3152; --iso-side-a: #0d1a2e; --iso-side-b: #09131f;
  --iso-road: #2b3a52; --geo-fill: rgba(59,156,255,.13);
  --shadow: 0 10px 30px rgba(0,0,0,.35); --glow: 0 0 0 1px rgba(59,156,255,.15), 0 8px 26px rgba(0,0,0,.35);
  --r: 12px; color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #e9f0f8; --bg-2: #f3f7fc; --panel: #ffffff; --panel-2: #f4f8fd; --panel-3: #e8f0fa;
  --line: #d8e2ee; --line-strong: #9fb3cc; --text: #0e1b2e; --muted: #50637e; --faint: #8394ab;
  --accent: #1467b3; --accent-2: #0891b2; --tata: #1467b3; --ok: #16a34a;
  --low: #0d9488; --med: #ca8a04; --high: #ea580c; --crit: #dc2626;
  --iso-ground-a: #dce8f6; --iso-ground-b: #c9daee; --iso-side-a: #a9bdd6; --iso-side-b: #8ea6c4;
  --iso-road: #7c8ca3; --geo-fill: rgba(20,103,179,.12);
  --shadow: 0 8px 24px rgba(15,40,80,.12); --glow: 0 0 0 1px rgba(20,103,179,.08), 0 6px 18px rgba(15,40,80,.08);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 13px/1.35 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text);
  background: radial-gradient(1200px 600px at 75% -10%, rgba(59,156,255,.14), transparent 60%),
              radial-gradient(900px 500px at -10% 110%, rgba(34,211,238,.08), transparent 60%), var(--bg);
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
.ic { flex: none; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, Menlo, monospace; }
.hidden { display: none !important; }

/* ---------- login ---------- */
.login { position: fixed; inset: 0; display: grid; grid-template-columns: 1.25fr 1fr; }
.login-hero { position: relative; overflow: hidden; border-right: 1px solid var(--line); }
.login-hero .twin { position: absolute; inset: 0; }
.login-hero .hero-copy { position: absolute; left: 32px; top: 28px; right: 32px; pointer-events: none; }
.login-hero .hero-copy .logo-chip, .login-card .logo-chip { display: inline-flex; }
.login-hero .twin { top: 150px; }
.login-hero h1 { font-size: 30px; margin: 10px 0 6px; letter-spacing: -.02em; }
.login-hero p { color: var(--muted); max-width: 520px; margin: 0; font-size: 14px; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.hero-chips span { padding: 4px 10px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.login-card { align-self: center; justify-self: center; width: 360px; padding: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.login-card h2 { margin: 14px 0 4px; font-size: 20px; }
.login-card label { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 4px; }
.login-card input { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); }
.login-card .btn.primary { width: 100%; margin-top: 16px; padding: 11px; justify-content: center; font-size: 14px; }
.demo-row { display: flex; gap: 6px; margin-top: 14px; }
.demo-row button { flex: 1; font-size: 11.5px; padding: 7px 4px; border-radius: 8px; border: 1px dashed var(--line-strong); background: transparent; color: var(--muted); }
.demo-row button:hover { color: var(--text); border-color: var(--accent); }
.login-err { color: var(--crit); font-size: 12px; min-height: 16px; margin-top: 8px; }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; }
.logo-chip { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 9px; padding: 5px 10px; box-shadow: 0 1px 0 rgba(0,0,0,.05); }
.logo-chip img.tata { height: 15px; }
.logo-chip img.lcs { height: 24px; }
.logo-chip i { width: 1px; height: 20px; background: #d6dde8; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 64px 1fr; grid-template-rows: 52px 1fr; height: 100vh; }
.top { grid-column: 1 / 3; display: flex; align-items: center; gap: 14px; padding: 0 14px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 82%, transparent); backdrop-filter: blur(8px); z-index: 5; }
.top .title { font-weight: 700; font-size: 15px; letter-spacing: -.01em; white-space: nowrap; }
.top .title small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); }
.top .spacer { flex: 1; }
.seg { display: flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 7px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.seg button.on { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(59,156,255,.35); }
.live-pill { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 5px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel-2); white-space: nowrap; }
.live-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: pulse 1.6s infinite; }
.live-pill.off i { background: var(--faint); animation: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); }
.icon-btn:hover { color: var(--text); border-color: var(--accent); }
.who { display: flex; align-items: center; gap: 8px; font-size: 12px; white-space: nowrap; }
.who .av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--tata), var(--accent-2)); }
.who small { display: block; color: var(--muted); font-size: 11px; }

.nav { grid-row: 2; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 70%, transparent); }
.nav a { width: 50px; padding: 7px 0 5px; border-radius: 11px; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); text-decoration: none; font-size: 9.5px; text-align: center; line-height: 1.1; }
.nav a:hover { color: var(--text); background: var(--panel-2); }
.nav a.on { color: #fff; background: linear-gradient(160deg, var(--tata), var(--accent)); box-shadow: 0 4px 14px rgba(20,103,179,.4); }
.nav .sep { width: 30px; height: 1px; background: var(--line); margin: 4px 0; }
.main { grid-row: 2; overflow: hidden; padding: 8px; min-width: 0; min-height: 0; }
.main.scroll { overflow: auto; }

/* ---------- panels ---------- */
.panel { background: linear-gradient(180deg, var(--panel), color-mix(in srgb, var(--panel) 92%, var(--bg))); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--glow); display: flex; flex-direction: column; min-height: 0; min-width: 0; position: relative; overflow: hidden; }
.ph { display: flex; align-items: center; gap: 8px; padding: 8px 12px 4px; }
.ph h3 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .01em; display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.ph h3 .ic { color: var(--accent); }
.ph .hint { margin-left: auto; font-size: 11px; color: var(--faint); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb { flex: 1; min-height: 0; position: relative; padding: 2px 10px 8px; }

/* ---------- dashboard grid ---------- */
.dash { display: grid; height: 100%; gap: 8px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 300px;
  grid-template-rows: 82px minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "kpi kpi tix" "gps cam tix" "twin km tix"; }
.kpis { grid-area: kpi; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
.kpi.sos-on { border-color: var(--crit); animation: sosglow 1.2s ease-in-out infinite; }
@keyframes sosglow { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--crit) 35%, transparent); } }
.kpi { border: 1px solid var(--line); border-radius: var(--r); background: linear-gradient(160deg, var(--panel-2), var(--panel)); padding: 9px 11px; text-align: left; position: relative; overflow: hidden; box-shadow: var(--glow); transition: transform .15s, border-color .15s; }
.kpi:hover { transform: translateY(-2px); border-color: var(--accent); }
.kpi .k-l { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.kpi .k-l .ic { color: var(--accent); }
.kpi .k-v { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; line-height: 1; }
.kpi .k-s { font-size: 11px; color: var(--faint); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.crit .k-v { color: var(--crit); }
.kpi .k-cube { position: absolute; right: -8px; bottom: -10px; opacity: .14; color: var(--accent); }
.a-gps { grid-area: gps; } .a-cam { grid-area: cam; } .a-twin { grid-area: twin; } .a-km { grid-area: km; } .a-tix { grid-area: tix; }

/* schematics */
.schem { width: 100%; height: 100%; display: block; }
.schem .iso-grid { stroke: var(--line); stroke-width: .6; opacity: .6; }
.schem .road-dash { stroke: #e9eef5; stroke-width: 1.4; stroke-dasharray: 6 6; opacity: .8; }
.schem .route-glow { stroke: var(--accent-2); stroke-width: 4; opacity: .22; }
.schem .detour { fill: none; stroke: var(--high); stroke-width: 2.4; stroke-dasharray: 5 4; animation: dash 1.2s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -18; } }
.schem .gps-ping { fill: none; stroke: var(--accent-2); stroke-width: 1.5; animation: ping 1.6s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes ping { from { transform: scale(.6); opacity: 1; } to { transform: scale(3.4); opacity: 0; } }
.schem .geofence { stroke: var(--accent); stroke-width: 1.4; stroke-dasharray: 4 4; animation: dash 2s linear infinite; }
.schem .gate-arrow { stroke: var(--accent); stroke-width: 2.4; }
.schem .gate-arrow.out { stroke: var(--accent-2); }
.schem .iso-label { font-size: 8px; font-weight: 700; fill: var(--muted); letter-spacing: .08em; }
.schem .lead { fill: none; stroke: var(--line-strong); stroke-width: 1.2; }
.schem .hot { fill: var(--accent); }
.schem .hot-ring { fill: none; stroke: var(--accent); stroke-width: 1.4; animation: ping 2s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.schem .co-box { fill: var(--panel-2); stroke: var(--line-strong); stroke-width: 1; transition: fill .15s, stroke .15s; }
.schem .co-box.tone-high { stroke: var(--high); }
.schem .co-box.tone-crit { stroke: var(--crit); stroke-width: 1.6; }
.schem .callout { cursor: pointer; outline: none; }
.schem .callout:hover .co-box, .schem .callout:focus .co-box { fill: var(--panel-3); stroke: var(--accent); }
.schem .co-ic { color: var(--accent); width: 22px; height: 22px; }
.schem .co-t { font-size: 11px; fill: var(--muted); font-weight: 600; }
.schem .co-n { font-size: 20px; fill: var(--text); font-weight: 800; }
.schem .co-s { font-size: 10px; fill: var(--faint); font-weight: 600; }
.schem .tone-crit ~ .co-s { fill: var(--crit); }
.schem .tone-high ~ .co-s { fill: var(--high); }
.schem .belt { stroke: var(--high); stroke-width: 5; stroke-dasharray: 6 5; fill: none; opacity: .9; }
.schem .scan { animation: scan 2.6s ease-in-out infinite alternate; }
@keyframes scan { from { transform: translateX(0); } to { transform: translateX(166px); } }
.schem .ai-box { fill: none; stroke: var(--crit); stroke-width: 1.6; stroke-dasharray: 10 4; animation: dash 1.5s linear infinite; }
.schem .ai-tag { font-size: 8px; font-weight: 800; fill: var(--crit); letter-spacing: .06em; }
.schem .rec { fill: var(--crit); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.schem .smoke-w { animation: rise 2.4s ease-in-out infinite; }
@keyframes rise { from { transform: translateY(4px); opacity: .9; } to { transform: translateY(-6px); opacity: .1; } }
.schem .eye-lid { animation: lid 4s infinite; transform-box: fill-box; transform-origin: center; }
@keyframes lid { 0%, 60%, 100% { transform: scaleY(1); } 70%, 90% { transform: scaleY(-1); } }

/* 3D twin */
.twin { position: absolute; inset: 0; }
.twin canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.twin canvas:active { cursor: grabbing; }
.twin-labels { position: absolute; inset: 0; pointer-events: none; }
.twin-label { position: absolute; left: 0; top: 0; pointer-events: auto; border: 1px solid var(--line-strong); background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: blur(4px); border-radius: 9px; padding: 4px 8px; text-align: left; font-size: 11px; line-height: 1.25; white-space: nowrap; box-shadow: var(--shadow); }
.twin-label b { display: block; font-size: 12px; }
.twin-label span { color: var(--muted); display: block; }
.twin-label em { font-style: normal; font-size: 10.5px; color: var(--faint); }
.twin-label em.crit { color: var(--crit); font-weight: 700; }
.twin-label.active, .twin-label:hover { border-color: var(--accent); }
.twin-legend { position: absolute; left: 10px; bottom: 8px; font-size: 10.5px; color: var(--faint); display: flex; gap: 10px; pointer-events: none; }
.twin-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }

/* km + risk panel */
.kmrisk { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 10px; position: absolute; inset: 8px 10px; }
.kmrisk > div { min-height: 0; }
.big-num { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1; cursor: pointer; }
.big-num small { font-size: 13px; color: var(--muted); font-weight: 600; margin-left: 4px; }
.big-num:hover { color: var(--accent); }
.site-bars { display: flex; flex-direction: column; gap: 5px; margin: 8px 0 6px; }
.site-bar { display: grid; grid-template-columns: 82px 1fr 64px; align-items: center; gap: 6px; font-size: 11.5px; cursor: pointer; border-radius: 6px; padding: 1px 2px; }
.site-bar:hover { background: var(--panel-2); }
.site-bar .tr { height: 10px; border-radius: 6px; background: var(--panel-3); overflow: hidden; }
.site-bar .tr i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--tata), var(--accent-2)); }
.site-bar b { text-align: right; }
.chart-box { position: relative; min-height: 0; min-width: 0; width: 100%; }
.chart-box canvas, .pb canvas { max-width: 100%; }
.gauge-wrap { display: flex; flex-direction: column; align-items: center; min-height: 0; }
.levels { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; width: 100%; margin-top: 2px; }
.lv { display: flex; align-items: center; gap: 6px; font-size: 11.5px; padding: 3px 6px; border-radius: 7px; cursor: pointer; border: 1px solid transparent; background: transparent; text-align: left; }
.lv:hover { border-color: var(--line-strong); background: var(--panel-2); }
.lv i { width: 9px; height: 9px; border-radius: 3px; }
.lv b { margin-left: auto; font-size: 13px; }

/* risk chips */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 99px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; border: 1px solid; }
.chip.low { color: var(--low); border-color: color-mix(in srgb, var(--low) 45%, transparent); background: color-mix(in srgb, var(--low) 12%, transparent); }
.chip.medium { color: var(--med); border-color: color-mix(in srgb, var(--med) 45%, transparent); background: color-mix(in srgb, var(--med) 12%, transparent); }
.chip.high { color: var(--high); border-color: color-mix(in srgb, var(--high) 45%, transparent); background: color-mix(in srgb, var(--high) 12%, transparent); }
.chip.critical { color: #fff; border-color: var(--crit); background: var(--crit); }
.st { font-size: 10.5px; padding: 2px 7px; border-radius: 6px; background: var(--panel-3); color: var(--muted); white-space: nowrap; text-transform: capitalize; }
.st.open { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); font-weight: 700; }
.st.closed { opacity: .7; }

/* tickets rail */
.tix-filters { display: flex; gap: 4px; padding: 0 10px 6px; flex-wrap: wrap; }
.tix-filters button { font-size: 11px; padding: 3px 8px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); }
.tix-filters button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tix-list { flex: 1; overflow: auto; padding: 0 8px 8px; display: flex; flex-direction: column; gap: 5px; }
.tix { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: center; padding: 7px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; text-align: left; transition: border-color .15s, transform .15s; }
.tix:hover { border-color: var(--accent); transform: translateX(-2px); }
.tix .ti { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--panel-3); color: var(--accent); }
.tix.lv-critical .ti { background: color-mix(in srgb, var(--crit) 18%, transparent); color: var(--crit); }
.tix.lv-high .ti { color: var(--high); }
.tix .tt { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tix .ts { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tix .tr2 { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.tix .ago { font-size: 10.5px; color: var(--faint); }
.tix.new { animation: newin 1.8s ease-out; }
@keyframes newin { 0% { transform: translateX(30px); background: color-mix(in srgb, var(--accent) 35%, var(--panel-2)); } 20% { transform: none; opacity: 1; } 100% { background: var(--panel-2); } }
.tix-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 0 10px 6px; }
.tix-sum button { border: 1px solid var(--line); background: var(--panel-2); border-radius: 8px; padding: 4px 2px; text-align: center; }
.tix-sum b { display: block; font-size: 17px; }
.tix-sum span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.tix-sum button:hover { border-color: var(--accent); }

/* ---------- buttons, forms ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel-2); padding: 7px 12px; border-radius: 9px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: linear-gradient(160deg, var(--tata), var(--accent)); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 4px 9px; font-size: 11.5px; }
.btn.danger-out { color: var(--crit); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--muted); }
.field input, .field select, .field textarea, .inp { padding: 7px 9px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font-size: 12.5px; min-width: 0; }
.field input:focus, .field select:focus, .inp:focus { outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); border-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 10px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }

/* ---------- tables ---------- */
.tbl-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); min-height: 0; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th { position: sticky; top: 0; background: var(--panel-3); text-align: left; font-weight: 700; font-size: 11px; color: var(--muted); padding: 7px 8px; white-space: nowrap; z-index: 1; text-transform: uppercase; letter-spacing: .04em; }
.tbl td { padding: 6px 8px; border-top: 1px solid var(--line); white-space: nowrap; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--panel-2); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.dev-pos { color: var(--high); font-weight: 700; }

/* ---------- page layouts ---------- */
.page { display: grid; gap: 8px; height: 100%; min-height: 0; }
.page-head { display: flex; align-items: center; gap: 10px; }
.page-head h2 { margin: 0; font-size: 17px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.page-head h2 .ic { color: var(--accent); }
.page-head p { margin: 0; color: var(--muted); font-size: 12px; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; min-height: 0; }
.map { position: absolute; inset: 0; border-radius: 0 0 var(--r) var(--r); }
.leaflet-container { background: var(--bg-2); font: inherit; }
.panel.scrolly { overflow: auto; }
.panel.scrolly .pb { flex: none; }
.bus-dot { width: 14px; height: 14px; border-radius: 4px; background: var(--tata); border: 2px solid #fff; box-shadow: 0 0 0 3px rgba(20,103,179,.35); }
.bus-dot.alert { background: var(--crit); box-shadow: 0 0 0 4px rgba(239,68,68,.35); animation: pulse 1.2s infinite; }
.site-dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--tata); border: 3px solid var(--tata); font-weight: 800; font-size: 10px; }
.leaflet-popup-content { font-size: 12px; }
.map-sites { position: absolute; top: 10px; right: 10px; z-index: 500; }

/* rules page */
.rule-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.rule { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--panel); }
.rule.off { opacity: .55; }
.rule-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.rule-h .ic { color: var(--accent); }
.rule-h b { font-size: 13px; }
.rule-h .tag { font-size: 10px; padding: 1px 6px; border-radius: 5px; background: var(--panel-3); color: var(--muted); text-transform: uppercase; }
.rule .row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; }
.band-bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; margin: 6px 0 2px; }
.band-bar i:nth-child(1) { background: var(--ok); } .band-bar i:nth-child(2) { background: var(--low); } .band-bar i:nth-child(3) { background: var(--med); } .band-bar i:nth-child(4) { background: var(--high); } .band-bar i:nth-child(5) { background: var(--crit); }
.band-scale { display: flex; justify-content: space-between; font-size: 10px; color: var(--faint); }
.switch { position: relative; width: 34px; height: 19px; margin-left: auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--panel-3); border: 1px solid var(--line); transition: .2s; }
.switch span::after { content: ""; position: absolute; width: 13px; height: 13px; left: 2px; top: 2px; border-radius: 50%; background: var(--muted); transition: .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(15px); background: #fff; }

/* api page */
pre.code { margin: 0; padding: 10px; border-radius: 10px; background: #07101d; color: #cfe3ff; font-size: 11px; line-height: 1.45; overflow: auto; border: 1px solid var(--line); }
.flow { width: 100%; height: 100%; }
.flow .node rect { fill: var(--panel-2); stroke: var(--line-strong); }
.flow .node text { fill: var(--text); font-size: 11px; font-weight: 700; }
.flow .node .sub { fill: var(--muted); font-size: 9.5px; font-weight: 500; }
.flow .wire { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 6 5; animation: dash 1s linear infinite; }
.log { font-family: ui-monospace, Menlo, monospace; font-size: 11px; display: flex; flex-direction: column; gap: 3px; }
.log div { padding: 4px 6px; border-radius: 6px; background: var(--panel-2); }
.log .code-ok { color: var(--ok); } .log .code-bad { color: var(--high); }

/* ---------- modal stack ---------- */
.overlay { position: fixed; inset: 0; background: rgba(3,8,18,.62); backdrop-filter: blur(3px); z-index: 50; display: grid; place-items: center; padding: 18px; }
.modal { width: min(1320px, 100%); height: min(640px, 100%); background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,.5); display: flex; flex-direction: column; overflow: hidden; animation: pop .18s ease-out; }
.modal.small { width: min(560px, 100%); height: auto; max-height: 100%; }
.modal.medium { width: min(860px, 100%); height: auto; max-height: 100%; }
@keyframes pop { from { transform: scale(.97); } }
.mh { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--panel); }
.mh h3 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.mh .crumbs { font-size: 11.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.mh .crumbs a { cursor: pointer; text-decoration: none; }
.mh .spacer { flex: 1; }
.mb { flex: 1; min-height: 0; padding: 10px; overflow: auto; }
.mb.fit { overflow: hidden; }

/* analysis */
.ana { display: grid; height: 100%; gap: 8px; grid-template-columns: 290px 1fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
.ana .side { grid-row: 1 / 3; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-content: start; overflow: auto; }
.ana .side > .muted, .ana .side > .std-schem { grid-column: 1 / -1; }
.ana .side .stat-card { padding: 8px 10px; }
.stat-card { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--panel); }
.stat-card .l { font-size: 11px; color: var(--muted); }
.stat-card .v { font-size: 24px; font-weight: 800; }
.ana .wide { grid-column: span 2; }
.ana .panel .pb { padding: 4px 10px 8px; }
.std-schem .schem { height: auto; }

/* detail */
.detail { display: grid; height: 100%; gap: 8px; grid-template-columns: 1fr 1fr 1.05fr 1.1fr; grid-template-rows: auto minmax(0, 1fr); }
.detail .hd { grid-column: 1 / -1; display: flex; gap: 8px; }
.detail .hd .stat-card { flex: 1; padding: 8px 10px; }
.detail .hd .stat-card .v { font-size: 18px; }
.clip { position: relative; background: #000; border-radius: 10px; overflow: hidden; }
.clip canvas, .clip video { display: block; width: 100%; height: auto; aspect-ratio: 16/9; }
.clip-ctl { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.clip-ctl input[type=range] { flex: 1; accent-color: var(--accent); }
.calib { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.calib div { display: flex; justify-content: space-between; padding: 4px 8px; border-radius: 7px; background: var(--panel-2); }
.calib .tot { background: var(--panel-3); font-weight: 800; font-size: 13px; }
.notes { display: flex; flex-direction: column; gap: 4px; max-height: 110px; overflow: auto; font-size: 11.5px; }
.notes div { padding: 5px 8px; border-radius: 7px; background: var(--panel-2); }
.notes small { color: var(--faint); }

/* toast */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 80; }
.toast { min-width: 280px; max-width: 360px; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line-strong); box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; animation: pop .2s ease-out; cursor: pointer; font-size: 12px; }
.toast.critical { border-color: var(--crit); }
.toast b { display: block; font-size: 12.5px; }
.empty { display: grid; place-items: center; height: 100%; color: var(--faint); font-size: 12px; }

@media (max-width: 1100px) {
  body { overflow: auto; }
  .app { height: auto; min-height: 100vh; }
  .dash { height: auto; grid-template-columns: 1fr; grid-template-rows: auto; grid-template-areas: "kpi" "gps" "cam" "twin" "km" "tix"; }
  .dash > .panel { height: 300px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .main { overflow: visible; }
  .login { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .ana, .detail { grid-template-columns: 1fr; grid-template-rows: auto; height: auto; }
  .ana .side, .detail .hd { grid-row: auto; grid-column: auto; flex-wrap: wrap; }
  .ana .panel, .detail > .panel { height: 280px; }
  .modal { height: 100%; }
  .top { overflow-x: auto; }
}
@media print {
  body { overflow: visible; background: #fff; color: #000; }
  .app, .toasts { display: none !important; }
  .overlay { position: static; background: none; padding: 0; backdrop-filter: none; }
  .modal { box-shadow: none; border: 0; height: auto; width: 100%; }
  .mh button, .no-print { display: none !important; }
  .mb { overflow: visible; }
  .tbl-wrap { overflow: visible; }
}

/* API feed status */
.feed-card { flex: 1; display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); font-size: 12px; }
.feed-card b { font-size: 13px; }
.feed-card small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.fc-ic { color: var(--accent); }
.fc-st { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 14px; margin-top: 2px; }
.fc-st i, .feed i { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex: none; }
.st-live .fc-st i, .st-demo .fc-st i, .feed.st-live i, .feed.st-demo i { background: var(--ok); animation: pulse 1.6s infinite; }
.st-down .fc-st i, .feed.st-down i { background: var(--med); }
.st-error .fc-st i, .feed.st-error i { background: var(--crit); }
.st-error { border-color: var(--crit); }
.st-down { border-color: var(--med); }
.feed { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); padding: 5px 9px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel-2); white-space: nowrap; cursor: pointer; }
.feed b { color: var(--text); font-weight: 700; }
.feed.st-error { border-color: var(--crit); color: var(--crit); }
.feed.st-down { border-color: var(--med); }

/* light / dark switch */
.theme-seg button { display: inline-flex; align-items: center; gap: 5px; }

/* alert detail: action column */
.prio { font-weight: 800; font-size: 13px; padding: 6px 10px; border-radius: 8px; margin-bottom: 6px; border: 1px solid; }
.prio-crit { color: #fff; background: var(--crit); border-color: var(--crit); }
.prio-high { color: var(--high); border-color: var(--high); background: color-mix(in srgb, var(--high) 12%, transparent); }
.prio-medium { color: var(--med); border-color: var(--med); }
.prio-low { color: var(--low); border-color: var(--low); }
ol.steps { margin: 0 0 8px; padding-left: 18px; font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.bus12 { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 6px 8px; border-radius: 8px; background: var(--panel-2); }
.bus12 b { font-size: 16px; margin-left: auto; }
.past-list { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; margin-top: 4px; }
.past-list div { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 6px; background: var(--panel-2); cursor: pointer; }
.past-list div span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.past-list div.cur { outline: 1px solid var(--accent); }
.past-list div:hover { background: var(--panel-3); }

/* masters */
.tag-demo { font-size: 9.5px; padding: 1px 5px; border-radius: 4px; background: var(--panel-3); color: var(--faint); text-transform: uppercase; vertical-align: 1px; }
.exp-bad { color: var(--crit); font-weight: 700; } .exp-warn { color: var(--high); font-weight: 700; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; background: var(--faint); }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--med); }
h4.fg { margin: 10px 0 6px; font-size: 12px; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.av-img { border-radius: 50%; object-fit: cover; display: block; border: 2px solid var(--line-strong); }
.av-ini { display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, var(--tata), var(--accent-2)); color: #fff; font-weight: 800; }
.pill-stat { font-size: 12px; padding: 5px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); text-decoration: none; }
.pill-stat b { color: var(--text); font-size: 14px; }
.pill-stat.warn { border-color: var(--high); }
.face-box { position: relative; width: 120px; height: 140px; border-radius: 12px; border: 2px dashed var(--accent); display: grid; place-items: center; color: var(--accent); overflow: hidden; flex: none; background: var(--panel-2); }
.face-box img { width: 100%; height: 100%; object-fit: cover; }
.face-scan { position: absolute; left: 0; right: 0; height: 3px; background: var(--accent-2); box-shadow: 0 0 10px var(--accent-2); animation: fscan 2s ease-in-out infinite alternate; }
@keyframes fscan { from { top: 4px; } to { top: calc(100% - 7px); } }
.route-list { display: flex; flex-direction: column; gap: 5px; }
.route-item { text-align: left; border: 1px solid var(--line); background: var(--panel-2); border-radius: 10px; padding: 7px 9px; }
.route-item b { display: block; font-size: 12.5px; }
.route-item span { font-size: 11px; color: var(--muted); }
.route-item.on, .route-item:hover { border-color: var(--accent); }

/* live cameras */
.cam-grid { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 8px; height: 100%; }
.cam-tile { position: relative; border-radius: 10px; overflow: hidden; background: #05080d; border: 1px solid var(--line); min-height: 0; }
.live-idle { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #cbd5e1; font-size: 12px; text-align: center; }
.live-idle .ic { color: var(--accent); }
.live-idle span { color: #8fa2bf; font-size: 11px; margin-bottom: 4px; }
.live-wrap { position: absolute; inset: 0; }
.live-wrap canvas, .live-wrap video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.live-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 6px; padding: 4px 8px; background: rgba(0,0,0,.6); color: #fff; font-size: 11.5px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--crit); animation: blink 1s steps(2) infinite; }
.icon-btn.sm { width: 24px; height: 24px; }
.live-head { font-size: 11.5px; margin-bottom: 6px; }
.live-body { height: calc(100% - 22px); }

/* voice box */
.voice { display: grid; grid-template-columns: 240px 1fr; gap: 14px; }
.voice-side { display: flex; flex-direction: column; gap: 8px; }
.voice-main { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.meters { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: 11.5px; color: var(--muted); }
.meters span { display: flex; align-items: center; gap: 5px; margin-bottom: 4px; }
.meter { height: 10px; border-radius: 6px; background: var(--panel-3); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--ok), var(--accent-2)); transition: width .08s; }
.meter.drv i { background: linear-gradient(90deg, var(--accent), #a78bfa); }
.ptt { position: relative; width: 170px; height: 170px; border-radius: 50%; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #fff;
  background: radial-gradient(circle at 35% 30%, #4aa3ff, var(--tata) 60%, #0b3e73); box-shadow: 0 10px 30px rgba(20,103,179,.45), inset 0 -6px 14px rgba(0,0,0,.3); user-select: none; touch-action: none; }
.ptt b { font-size: 13px; letter-spacing: .06em; }
.ptt small { font-size: 10px; opacity: .8; }
.ptt.on { background: radial-gradient(circle at 35% 30%, #6ee7b7, #059669 60%, #065f46); box-shadow: 0 10px 30px rgba(5,150,105,.5); }
.ptt-ring { position: absolute; inset: -8px; border-radius: 50%; border: 2px solid var(--accent); opacity: .5; }
.ptt.on .ptt-ring { border-color: var(--ok); animation: ping 1.2s ease-out infinite; }
.switch-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.switch-row .switch { margin: 0; }
.call-time { font-size: 15px; font-weight: 800; }
.v-status { font-size: 12px; color: var(--muted); min-height: 16px; }
.call-log { width: 100%; font-size: 11.5px; display: flex; flex-direction: column; gap: 3px; }
.call-log div { padding: 3px 8px; border-radius: 6px; background: var(--panel-2); }

/* SOS pop-up */
.sos-pop { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px;
  background: var(--panel); border: 2px solid var(--crit); box-shadow: 0 0 0 6px color-mix(in srgb, var(--crit) 25%, transparent), 0 20px 50px rgba(0,0,0,.45); animation: sosglow 1.2s ease-in-out infinite; max-width: calc(100vw - 32px); }
.sos-badge { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--crit); color: #fff; flex: none; }
.sos-txt { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); min-width: 280px; max-width: 420px; }
.sos-txt b { font-size: 16px; color: var(--crit); }

/* dashboard camera tabs + 3D bus */
.cam-tabs { display: flex; gap: 3px; margin-left: auto; }
.cam-tabs button { font-size: 11px; padding: 3px 7px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); white-space: nowrap; }
.cam-tabs button b { color: var(--text); margin-left: 3px; }
.cam-tabs button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.cam-tabs button.on b { color: #fff; }
.bus-views { position: absolute; left: 8px; top: 6px; z-index: 3; }
.bus-views button { font-size: 11px; padding: 3px 8px; }
.bus-label { font-size: 10.5px; padding: 3px 6px; }
.bus-label b { font-size: 11px; }
.bus-label.camera { border-color: var(--accent); }
.voice-chip { cursor: pointer; }
.voice-chip:hover rect { fill: var(--accent); }
.page-3d { position: relative; height: 100%; }

/* reminders */
.bell { position: relative; width: 36px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); display: grid; place-items: center; }
.bell b { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; border-radius: 9px; font-size: 10.5px; display: grid; place-items: center; padding: 0 4px; background: var(--faint); color: #fff; }
.bell.due { color: var(--high); border-color: var(--high); animation: ring 1.4s ease-in-out infinite; }
.bell.due b { background: var(--high); }
.bell.crit b { background: var(--crit); }
@keyframes ring { 0%, 60%, 100% { transform: rotate(0); } 10%, 30%, 50% { transform: rotate(-10deg); } 20%, 40% { transform: rotate(10deg); } }
.rem-chip { font-size: 10px; font-weight: 700; color: var(--accent); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rem-chip.soon { color: var(--high); }
.rem-chip.over { color: #fff; background: var(--crit); padding: 1px 5px; border-radius: 5px; animation: blink 1s steps(2) infinite; }
.rem-stack { position: fixed; right: 16px; top: 62px; z-index: 85; display: flex; flex-direction: column; gap: 8px; }
.rem-pop { display: flex; gap: 10px; align-items: flex-start; width: 400px; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line-strong); border-left: 5px solid var(--accent); box-shadow: var(--shadow); animation: pop .2s ease-out; position: relative; }
.rem-pop.lv-critical { border-left-color: var(--crit); } .rem-pop.lv-high { border-left-color: var(--high); } .rem-pop.lv-medium { border-left-color: var(--med); } .rem-pop.lv-low { border-left-color: var(--low); }
.rem-ic { color: var(--high); padding-top: 2px; }
.rem-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.rem-txt b { font-size: 13px; } .rem-txt small { color: var(--muted); }
.rem-btns { display: flex; flex-direction: column; gap: 4px; }
.rem-pop [data-k=x] { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; }
.rem-drawer { position: fixed; right: 0; top: 52px; bottom: 0; width: 420px; z-index: 60; background: var(--panel); border-left: 1px solid var(--line-strong); box-shadow: var(--shadow); display: flex; flex-direction: column; padding: 10px; gap: 6px; animation: pop .2s ease-out; }
.rem-head { display: flex; align-items: center; } .rem-head h3 { margin: 0; font-size: 14px; display: flex; gap: 6px; align-items: center; flex: 1; }
.rem-sum { font-size: 12px; } .rem-sum b { color: var(--text); }
.rem-rule { font-size: 11.5px; padding: 6px 8px; border-radius: 8px; background: var(--panel-2); color: var(--muted); }
.rem-list { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 5px; }
.rem-row { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); border-left: 4px solid var(--accent); }
.rem-row.lv-critical { border-left-color: var(--crit); } .rem-row.lv-high { border-left-color: var(--high); } .rem-row.lv-medium { border-left-color: var(--med); } .rem-row.lv-low { border-left-color: var(--low); }
.rem-row.over { background: color-mix(in srgb, var(--crit) 8%, var(--panel-2)); }
.rr-main { flex: 1; min-width: 0; cursor: pointer; display: flex; flex-direction: column; font-size: 11.5px; }
.rr-main b { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.call-box { margin-top: 8px; padding: 8px; border-radius: 10px; border: 1px dashed var(--line-strong); font-size: 12px; }
.call-box > div:first-child { display: flex; justify-content: space-between; align-items: center; }
.call-box .rem-chip { font-size: 13px; }
.call-box small { color: var(--muted); }
.call-hist { margin-top: 4px; display: flex; flex-direction: column; gap: 2px; font-size: 11px; }
.call-hist div { display: flex; align-items: center; gap: 4px; }

/* help + tour */
.help-i { width: 17px; height: 17px; border-radius: 50%; border: 1px solid var(--accent); background: transparent; color: var(--accent); font: 700 10.5px/1 Georgia, serif; font-style: italic; display: inline-grid; place-items: center; margin-left: 4px; padding: 0; flex: none; }
.help-i:hover { background: var(--accent); color: #fff; }
.kpis { position: relative; } .kpis > .help-i { position: absolute; right: -4px; top: -6px; z-index: 2; background: var(--panel); }
.help-pop { position: fixed; z-index: 120; width: 340px; padding: 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--accent); box-shadow: var(--shadow); font-size: 12.5px; animation: pop .15s ease-out; }
.help-pop b { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--accent); }
.help-pop p { margin: 6px 0 10px; line-height: 1.5; }
.tour { position: fixed; inset: 0; z-index: 110; }
.tour-dim { position: absolute; inset: 0; background: rgba(3,8,18,.6); }
.tour-spot { position: absolute; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(3,8,18,.62), 0 0 0 3px var(--accent), 0 0 24px var(--accent); transition: all .3s; pointer-events: none; }
.tour-card { position: absolute; width: 380px; padding: 14px 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--accent); box-shadow: 0 20px 60px rgba(0,0,0,.5); animation: pop .2s ease-out; }
.tour-card.wide { width: 760px; max-width: calc(100vw - 24px); }
.tour-card h3 { margin: 4px 0 6px; font-size: 16px; }
.tour-card p { margin: 0 0 8px; font-size: 13px; line-height: 1.55; color: var(--muted); }
.tour-step { font-size: 11px; color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.tour-dots { display: flex; gap: 4px; margin: 6px 0 10px; } .tour-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); } .tour-dots i.on { background: var(--accent); width: 18px; border-radius: 4px; }
.journey { width: 100%; height: auto; display: block; }
.journey .j-node circle { fill: var(--panel-2); stroke: var(--accent); stroke-width: 2; }
.journey .j-node { animation: jpulse 3.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes jpulse { 0%, 100% { opacity: .75; } 15% { opacity: 1; } }
.journey .j-ic { color: var(--accent); }
.journey .j-t { font-size: 12px; font-weight: 800; fill: var(--text); }
.journey .j-s { font-size: 9.5px; fill: var(--muted); }
.journey .j-wire { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 5 4; animation: dash 1s linear infinite; }
.journey .j-dot { fill: var(--accent-2); filter: drop-shadow(0 0 6px var(--accent-2)); }

/* science page */
.sci-top { display: flex; align-items: center; gap: 16px; padding: 8px 12px; }
.sci-top > div { flex: 0 0 360px; }
.sci-top .journey { flex: 1; max-height: 92px; }
.heat { display: grid; grid-template-columns: 30px repeat(24, minmax(0, 1fr)); gap: 2px; font-size: 9.5px; color: var(--muted); }
.heat .hh { text-align: center; } .heat .hd { display: flex; align-items: center; }
.heat .hc { aspect-ratio: 1.6; border: 0; border-radius: 3px; padding: 0; min-height: 12px; }
.heat .hc:hover { outline: 2px solid var(--accent); }
.formulas { display: flex; flex-direction: column; gap: 6px; }
.fcard { padding: 7px 9px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; }
.fcard b { font-size: 12px; color: var(--accent); }
.fcard code { font: 600 11px ui-monospace, Menlo, monospace; color: var(--text); background: var(--panel-3); padding: 3px 6px; border-radius: 6px; }
.fcard span { color: var(--muted); line-height: 1.45; }
.rem-set { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--accent); background: var(--panel); }
.rem-set > b { display: flex; align-items: center; gap: 6px; width: 100%; font-size: 13px; }
.rem-set > span.muted { width: 100%; font-size: 11.5px; margin-top: -6px; }
.rem-set .field { width: 130px; }

/* compact top bar */
.top { gap: 8px; padding: 0 10px; }
.top .title { font-size: 14px; }
.top .title small { font-size: 10.5px; }
.who .who-txt { display: none; }
.feed b { display: none; }
.feed { padding: 5px 8px; }
.theme-seg button { padding: 5px 8px; }
@media (min-width: 1550px) { .who .who-txt { display: block; } .feed b { display: inline; } }

/* attend tickets */
.attend-btn { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 10px; border: 0; font-weight: 800; font-size: 13px; color: #fff;
  background: linear-gradient(160deg, #f59e0b, #ea580c); box-shadow: 0 4px 14px rgba(234,88,12,.4); white-space: nowrap; }
.attend-btn b { min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 5px; background: #fff; color: #c2410c; font-size: 11.5px; }
.attend-btn.due { animation: attglow 1.4s ease-in-out infinite; }
.attend-btn.due .ic { animation: ring 1.4s ease-in-out infinite; }
.attend-btn.crit b { background: #fff; color: var(--crit); }
@keyframes attglow { 50% { box-shadow: 0 0 0 5px rgba(245,158,11,.35), 0 4px 18px rgba(234,88,12,.6); } }
.modal.attend-m { width: min(1100px, 100%); height: min(620px, 100%); }
.attend-grid { display: grid; grid-template-columns: 340px 1fr; gap: 10px; height: 100%; }
.att-q { display: flex; flex-direction: column; min-height: 0; }
.att-sum { font-size: 12px; color: var(--muted); margin-bottom: 6px; } .att-sum b { color: var(--text); font-size: 15px; }
.att-list { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 5px; }
.att-item { display: flex; align-items: center; gap: 6px; text-align: left; padding: 7px 8px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); border-left: 4px solid var(--accent); }
.att-item > span:first-child { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.att-item b { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .att-item small { font-size: 11px; color: var(--muted); }
.att-item.lv-critical { border-left-color: var(--crit); } .att-item.lv-high { border-left-color: var(--high); } .att-item.lv-medium { border-left-color: var(--med); } .att-item.lv-low { border-left-color: var(--low); }
.att-item.on { outline: 2px solid var(--accent); } .att-item.over { background: color-mix(in srgb, var(--crit) 7%, var(--panel-2)); }
.att-cur { overflow: auto; padding: 2px 4px; }
.att-head { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); border-left: 6px solid var(--accent); }
.att-head.lv-critical { border-left-color: var(--crit); } .att-head.lv-high { border-left-color: var(--high); } .att-head.lv-medium { border-left-color: var(--med); }
.att-head > div:first-child { flex: 1; } .att-head h3 { margin: 2px 0 4px; font-size: 16px; display: flex; gap: 6px; align-items: center; }
.att-timer { display: flex; flex-direction: column; align-items: center; padding: 6px 10px; border-radius: 10px; background: var(--panel-2); font-size: 11px; color: var(--muted); }
.att-timer b { font-size: 16px; }
.att-facts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 8px 0; }
.att-facts div { padding: 6px 8px; border-radius: 8px; background: var(--panel-2); display: flex; flex-direction: column; font-size: 11px; color: var(--muted); }
.att-facts b { font-size: 14px; color: var(--text); }
.att-steps { padding: 8px 10px; border-radius: 10px; border: 1px dashed var(--line-strong); }
.att-steps > b { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--accent); margin-bottom: 4px; }
.att-close { display: flex; gap: 8px; margin-top: 8px; } .att-close .field:first-child { width: 280px; }
.close-btn { background: linear-gradient(160deg, #16a34a, #15803d) !important; }
.tix { position: relative; }
.tix-act { display: none; position: absolute; right: 6px; bottom: 4px; gap: 4px; }
.tix:hover .tix-act, .tix:focus-within .tix-act { display: flex; }
.tix-act .btn { padding: 3px 8px; font-size: 11px; box-shadow: var(--shadow); }

.attend-btn { padding: 0 10px; gap: 5px; }
.top .seg button { padding: 5px 9px; }
.feed { padding: 5px 7px; }

/* v4 layout: wider tickets, shorter schematics */
.dash { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) clamp(380px, 32%, 560px); grid-template-rows: 82px minmax(0, .88fr) minmax(0, 1fr); }
.tix { grid-template-columns: 30px minmax(0, 1fr) auto auto; }
.tix-act { display: flex; position: static; flex-direction: column; gap: 3px; }
.tix-act .btn { box-shadow: none; padding: 3px 8px; }
.tix .ts + .ts { color: var(--faint); }
/* slim reminder strip, bottom-left, out of the way */
.rem-strip-host { position: fixed; left: 72px; bottom: 10px; z-index: 85; }
.rem-strip { display: flex; align-items: center; gap: 6px; padding: 5px 6px 5px 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line-strong); border-left: 4px solid var(--accent); box-shadow: var(--shadow); font-size: 12px; max-width: min(760px, calc(100vw - 90px)); animation: pop .2s ease-out; }
.rem-strip.lv-critical { border-left-color: var(--crit); } .rem-strip.lv-high { border-left-color: var(--high); } .rem-strip.lv-medium { border-left-color: var(--med); } .rem-strip.lv-low { border-left-color: var(--low); }
.rs-ic { color: var(--high); display: flex; }
.rs-txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.rem-strip .btn { padding: 3px 8px; font-size: 11px; }
.toasts { left: 72px; right: auto; bottom: 54px; }
.toast { min-width: 240px; max-width: 420px; padding: 7px 10px; font-size: 11.5px; }
.kpi { padding: 8px 9px; }
.kpi .k-l { font-size: 10.5px; gap: 4px; }
.kpi .k-v { font-size: 23px; }
.kpi .k-s { font-size: 10px; }

/* nav home / back */
.nav { overflow-y: auto; gap: 2px; padding: 6px 0; }
.nav a { padding: 5px 0 4px; }
.nav-hb { display: flex; gap: 3px; margin-bottom: 4px; }
.nav-hb button { width: 25px; height: 25px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--accent); display: grid; place-items: center; padding: 0; }
.nav-hb button:hover { background: var(--accent); color: #fff; }
.ic.flip { transform: rotate(180deg); }
/* fleet status + alerts tiles */
.kpis { grid-template-columns: repeat(9, minmax(0, 1fr)); }
.kpi-fleet { grid-column: span 2; }
.fl3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 4px; }
.fl3.two { grid-template-columns: 1fr 1fr; }
.fl3 button { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 3px 4px; text-align: left; display: flex; flex-direction: column; }
.fl3 button:hover { border-color: var(--accent); }
.fl3 b { font-size: 20px; line-height: 1.1; }
.fl3 span { font-size: 10px; color: var(--muted); display: flex; align-items: center; gap: 2px; white-space: nowrap; }
.fl3 button.warn { border-color: var(--med); } .fl3 button.bad { border-color: var(--high); }
.dot.bad { background: var(--high); }
.st.nrd { color: var(--med); background: color-mix(in srgb, var(--med) 15%, transparent); font-weight: 700; }
.issue { display: inline-block; font-size: 10.5px; padding: 1px 6px; border-radius: 5px; background: color-mix(in srgb, var(--high) 14%, transparent); color: var(--high); margin: 1px 0; }
/* km on dashboard */
.km-top { display: flex; align-items: flex-end; gap: 8px; }
.km-mini { cursor: pointer; padding: 3px 7px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); display: flex; flex-direction: column; font-size: 10px; color: var(--muted); }
.km-mini b { font-size: 13px; color: var(--text); } .km-mini.live b { color: var(--ok); }
.km-mini:hover { border-color: var(--accent); }
.big-num small { font-size: 11px; }
/* km page */
.km-page { grid-template-rows: auto minmax(0, 1fr); }
.km-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.km-bar h2 { margin: 0 6px 0 0; font-size: 17px; display: flex; gap: 6px; align-items: center; }
.km-bar .seg button { padding: 5px 8px; font-size: 11.5px; }
.km-grid { display: grid; grid-template-columns: 420px 1fr; gap: 8px; min-height: 0; }
.km-right { display: grid; grid-template-rows: auto minmax(0, 1fr) minmax(0, 1.1fr); gap: 8px; min-height: 0; }
.km-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.km-card { text-align: left; border: 1px solid var(--line); background: linear-gradient(160deg, var(--panel-2), var(--panel)); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; }
.km-card span { font-size: 11px; color: var(--muted); } .km-card b { font-size: 20px; } .km-card small { font-size: 10.5px; color: var(--faint); }
.km-card[data-k] { cursor: pointer; } .km-card[data-k]:hover { border-color: var(--accent); }
.odo-total { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; padding: 0 10px 6px; }
.odo-total div { padding: 6px 10px; border-radius: 10px; background: var(--panel-2); display: flex; flex-direction: column; font-size: 11px; color: var(--muted); }
.odo-total b { font-size: 24px; color: var(--ok); font-variant-numeric: tabular-nums; }
.odo { font: 700 12px ui-monospace, Menlo, monospace; padding: 2px 6px; border-radius: 5px; background: #0b1220; color: #7dd3fc; letter-spacing: .04em; }
/* hotspot map */
.hot { display: grid; grid-template-columns: 1fr 380px; gap: 10px; height: 100%; }
.hot-map { position: relative; }
.hot-legend { position: absolute; left: 10px; bottom: 26px; z-index: 500; display: flex; align-items: center; gap: 6px; font-size: 10.5px; background: var(--panel); padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line); }
.hot-legend i { width: 90px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #22c55e, #eab308, #f97316, #ef4444); }
.hot-side { overflow: auto; display: flex; flex-direction: column; gap: 4px; padding-right: 4px; }
.hot-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.hot-kpis div { padding: 6px 8px; border-radius: 9px; background: var(--panel-2); display: flex; flex-direction: column; font-size: 10.5px; color: var(--muted); }
.hot-kpis b { font-size: 18px; color: var(--text); }
.hot-list { display: flex; flex-direction: column; gap: 4px; }
.hot-list button { display: flex; align-items: center; gap: 8px; text-align: left; padding: 6px 8px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); font-size: 11.5px; }
.hot-list button:hover { border-color: var(--accent); }
.hot-list b { color: var(--high); } .hot-list span { flex: 1; min-width: 0; display: flex; flex-direction: column; } .hot-list small { color: var(--muted); font-size: 10.5px; }
.hot-list em { font-style: normal; font-weight: 800; white-space: nowrap; }
ul.why { margin: 0; padding-left: 16px; font-size: 12px; display: flex; flex-direction: column; gap: 3px; }
.acts { display: flex; flex-direction: column; gap: 4px; }
.acts button { display: flex; align-items: center; gap: 8px; text-align: left; padding: 7px 9px; border-radius: 9px; border: 1px solid var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--panel)); font-size: 12px; color: var(--text); }
.acts button span { flex: 1; } .acts button .ic { color: var(--accent); }
.acts button:hover { background: color-mix(in srgb, var(--accent) 18%, var(--panel)); }
/* report document */
.rp { background: #fff; color: #0e1b2e; border-radius: 12px; padding: 22px 26px; max-width: 980px; margin: 0 auto; font-size: 12.5px; }
.rp-head { display: flex; gap: 18px; align-items: center; border-bottom: 3px solid #1467b3; padding-bottom: 12px; margin-bottom: 12px; }
.rp-head h1 { margin: 0; font-size: 20px; color: #0e1b2e; } .rp-head p { margin: 2px 0; color: #50637e; } .rp-meta { font-size: 11px; }
.rp h2 { font-size: 13px; color: #1467b3; margin: 14px 0 6px; text-transform: uppercase; letter-spacing: .05em; }
.rp-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rp-kpi { border: 1px solid #d8e2ee; border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; }
.rp-kpi span { font-size: 11px; color: #50637e; } .rp-kpi b { font-size: 20px; } .rp-kpi small { font-size: 10.5px; }
.rp-good { color: #16a34a; } .rp-bad { color: #dc2626; }
.rp-lvbar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; }
.rp-lvbar i.lv-low { background: #0d9488; } .rp-lvbar i.lv-medium { background: #ca8a04; } .rp-lvbar i.lv-high { background: #ea580c; } .rp-lvbar i.lv-critical { background: #dc2626; }
.rp-legend { font-size: 11px; color: #50637e; margin-top: 4px; }
.rp-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.rp-t { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.rp-t th { text-align: left; background: #eef4fb; color: #50637e; padding: 5px 7px; font-size: 10.5px; text-transform: uppercase; }
.rp-t td { padding: 5px 7px; border-top: 1px solid #e3eaf3; }
.rp-chart { width: 100%; height: auto; }
.rp-foot { margin-top: 16px; font-size: 10.5px; color: #8394ab; border-top: 1px solid #e3eaf3; padding-top: 8px; }
.rp .logo-chip { display: inline-flex; }
.rp .chip.low { color: #0d9488; } .rp .chip.medium { color: #ca8a04; } .rp .chip.high { color: #ea580c; }
.rp-sent { font-size: 11.5px; color: var(--muted); padding: 6px 10px; margin: 0 auto 8px; max-width: 980px; border-radius: 8px; background: var(--panel-2); line-height: 1.6; }
@media print { .rp { max-width: none; padding: 0; } }

.km-top { flex-wrap: nowrap; }
.km-top .big-num { font-size: 26px; white-space: nowrap; }
.km-mini { white-space: nowrap; padding: 2px 6px; }
.km-mini b { font-size: 12px; }

.map-style { box-shadow: var(--shadow); }
.map-style button { padding: 4px 9px; font-size: 11px; }
.map-sites { top: 46px !important; }

/* single-bus playback */
.bus-pick { margin-left: 8px; font-size: 12px; padding: 4px 8px; }
.pb-bar { position: absolute; left: 10px; right: 10px; bottom: 26px; z-index: 600; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 12px; background: color-mix(in srgb, var(--panel) 94%, transparent); border: 1px solid var(--line-strong); box-shadow: var(--shadow); }
.pb-bar .seg button { padding: 4px 8px; font-size: 11px; }
.pb-slider { position: relative; flex: 1; }
.pb-slider input { width: 100%; accent-color: var(--accent); position: relative; z-index: 1; }
.pb-marks { position: absolute; left: 0; right: 0; top: -6px; height: 6px; }
.pb-marks i { position: absolute; width: 3px; height: 9px; border-radius: 2px; background: var(--accent); transform: translateX(-1px); }
.pb-marks i.lv-critical { background: var(--crit); } .pb-marks i.lv-high { background: var(--high); } .pb-marks i.lv-medium { background: var(--med); } .pb-marks i.lv-low { background: var(--low); }
.pb-time { font-size: 13px; min-width: 120px; text-align: right; }
#pbLive.on { animation: attglow 1.6s ease-in-out infinite; }
.pb-bus { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: radial-gradient(circle at 35% 30%, #4aa3ff, #1467b3); border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(20,103,179,.3), 0 4px 10px rgba(0,0,0,.4); }
.pb-vio { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #fff; border: 2px solid #fff; background: var(--low); box-shadow: 0 2px 6px rgba(0,0,0,.35); opacity: .55; transition: opacity .2s, transform .2s; }
.pb-vio.lv-critical { background: var(--crit); } .pb-vio.lv-high { background: var(--high); } .pb-vio.lv-medium { background: var(--med); }
.pb-vio.passed { opacity: 1; transform: scale(1.15); }
.pb-head { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
.pb-head > b { font-size: 18px; color: var(--text); }
.pb-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.pb-stats div { padding: 6px 8px; border-radius: 9px; background: var(--panel-2); display: flex; flex-direction: column; font-size: 11px; color: var(--muted); }
.pb-stats b { font-size: 15px; color: var(--text); }
.pb-issue { margin-top: 6px; font-size: 11.5px; padding: 6px 8px; border-radius: 8px; color: var(--high); background: color-mix(in srgb, var(--high) 12%, transparent); }
.pb-list { display: flex; flex-direction: column; gap: 4px; }
.pb-list button { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); text-align: left; font-size: 11.5px; border-left: 4px solid var(--low); opacity: .65; }
.pb-list button.lv-critical { border-left-color: var(--crit); } .pb-list button.lv-high { border-left-color: var(--high); } .pb-list button.lv-medium { border-left-color: var(--med); }
.pb-list button.passed { opacity: 1; }
.pb-list button:hover { border-color: var(--accent); }
.pbl-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-list em { color: var(--accent); padding: 2px 4px; border-radius: 5px; } .pb-list em:hover { background: var(--accent); color: #fff; }
/* keep Leaflet's internal layers (z-index 400–1000) inside the map so pop-ups always sit in front */
.map, .leaflet-container { isolation: isolate; z-index: 0; }
.overlay { z-index: 3000; }
.toasts { z-index: 3100; } .rem-strip-host { z-index: 3100; } .sos-pop { z-index: 3200; }
.tour { z-index: 3300; } .help-pop { z-index: 3400; } .rem-drawer { z-index: 2900; }
.pb-bar, .hot-legend { z-index: 10; }

/* bus search + camera in single-bus view */
.bus-search { position: relative; margin-left: 8px; display: flex; align-items: center; gap: 4px; color: var(--muted); }
.bus-search input { width: 230px; padding: 5px 9px; font-size: 12px; }
.bs-list { display: none; position: absolute; top: 100%; right: 0; margin-top: 4px; width: 340px; max-height: 360px; overflow: auto; z-index: 2000; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow); padding: 4px; }
.bs-list.open { display: block; }
.bs-list button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 6px 8px; border: 0; border-radius: 7px; background: transparent; font-size: 11.5px; }
.bs-list button b { font-size: 12.5px; min-width: 100px; color: var(--text); } .bs-list button span { flex: 1; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bs-list button.on, .bs-list button:hover { background: var(--panel-3); }
.bs-list button.cur b { color: var(--accent); }
.pb-camtabs { margin-bottom: 6px; } .pb-camtabs button { padding: 4px 8px; font-size: 11px; }
.pb-camtile { position: relative; aspect-ratio: 16 / 9; margin-bottom: 10px; }
.pb-camnote { font-size: 11.5px; padding: 6px 8px; border-radius: 8px; background: var(--panel-2); margin-bottom: 8px; display: flex; gap: 6px; align-items: center; }

/* Novus */
.novus { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.novus .field > span { display: flex; align-items: center; gap: 5px; font-size: 11.5px; }
.nv-msg { margin-top: 6px; font-size: 12px; min-height: 16px; }
.nv-clips { display: grid; gap: 8px; }
.cam-grid.three { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.cam-grid.three .cam-tile:first-child { grid-row: span 2; }
.live-note { font-size: 10.5px; opacity: .8; }

/* demo data switch (super admin) */
.demo-sw { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--muted); border-radius: 99px; padding: 0 7px 0 3px; font: 600 10.5px/16px inherit; cursor: pointer; }
.demo-sw i { width: 22px; height: 12px; border-radius: 6px; background: var(--faint); position: relative; }
.demo-sw i::after { content: ''; position: absolute; left: 1px; top: 1px; width: 10px; height: 10px; border-radius: 50%; background: #fff; transition: left .15s; }
.demo-sw.on { color: var(--text); border-color: var(--accent); }
.demo-sw.on i { background: var(--accent); } .demo-sw.on i::after { left: 11px; }
.demo-sw:hover { border-color: var(--accent); }
.demo-tag { color: var(--med); font-weight: 700; }

/* integration dashboard */
.ig .pb { padding: 8px 12px 12px; }
.ig-tiles { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.ig-tile { text-align: left; border: 1px solid var(--line); background: linear-gradient(160deg, var(--panel-2), var(--panel)); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; }
.ig-tile span { font-size: 11px; color: var(--muted); } .ig-tile b { font-size: 24px; line-height: 1.15; } .ig-tile small { font-size: 10.5px; color: var(--faint); }
.ig-tile.on, .ig-tile:hover { border-color: var(--accent); }
.ig-tile.ok b { color: var(--ok); } .ig-tile.warn b { color: var(--med); } .ig-tile.bad b { color: var(--high); }
.ig-row { display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px; margin-top: 10px; }
.ig-ping, .ig-agent { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: var(--panel-2); }
.ig-ints { display: flex; flex-direction: column; gap: 5px; }
.ig-int { display: grid; grid-template-columns: 12px 1fr auto; gap: 2px 8px; align-items: center; padding: 6px 9px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); font-size: 12px; }
.ig-int i { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); }
.ig-int.st-live i, .ig-int.st-demo i { background: var(--ok); } .ig-int.st-down i { background: var(--med); } .ig-int.st-error i { background: var(--crit); }
.ig-int span { font-weight: 700; font-size: 11.5px; } .ig-int small { grid-column: 2 / 4; color: var(--muted); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ig-agent { margin-top: 10px; }
.ig-sum { font-size: 12px; font-weight: 700; margin: 6px 0; }
.ig-dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 6px; max-height: 300px; overflow: auto; }
.ig-d { padding: 8px 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent); font-size: 12px; display: flex; flex-direction: column; gap: 3px; }
.ig-d.sc-oem { border-left-color: var(--high); }
.ig-d > div { display: flex; gap: 6px; align-items: center; } .ig-d .tag { font-size: 10px; padding: 1px 6px; border-radius: 5px; background: var(--panel-3); color: var(--muted); margin-left: auto; white-space: nowrap; }
.ig-d p { margin: 0; } .ig-d small { color: var(--muted); font-size: 10.5px; }
.ig-d .btn { align-self: flex-start; margin-top: 2px; } .ig-res { font-size: 11px; color: var(--accent); }
.ig-ok { padding: 8px; border-radius: 8px; background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); font-size: 12px; font-weight: 700; display: flex; gap: 6px; align-items: center; }
.k-ping { margin-left: auto; font-size: 10px; font-weight: 700; color: var(--ok); text-decoration: none; padding: 0 5px; border-radius: 5px; background: color-mix(in srgb, var(--ok) 12%, transparent); }
.k-ping.slow { color: var(--high); background: color-mix(in srgb, var(--high) 12%, transparent); }
.kpi-fleet .k-l { width: 100%; }
/* ticket controls up top in the alert window */
.act-col .notes { max-height: 70px; }
.act-col ol.steps { margin-bottom: 6px; }

/* call recordings */
.rec-list { display: flex; flex-direction: column; gap: 3px; }
.rec-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 11px; padding: 3px 6px; border-radius: 6px; background: var(--panel-2); }
.rec-row > span { flex: 1; display: flex; align-items: center; gap: 4px; }
.rec-row .btn { padding: 2px 6px; font-size: 10.5px; }
.rec-player { width: 100%; } .rec-player audio, td .rec-player audio { width: 100%; height: 30px; margin-top: 3px; }

/* Tata Tele route design */
.tel { border-color: color-mix(in srgb, var(--accent-2) 45%, var(--line)); }
.tr-svg { width: 100%; height: auto; display: block; }
.tr-node rect { fill: var(--panel-2); stroke: var(--line-strong); }
.tr-node.hub rect { stroke: var(--accent); stroke-width: 1.6; } .tr-node.tata rect { stroke: #1467b3; stroke-width: 1.6; fill: color-mix(in srgb, #1467b3 10%, var(--panel-2)); }
.tr-node text { fill: var(--text); font-size: 11.5px; font-weight: 700; } .tr-node .sub { fill: var(--muted); font-size: 9.5px; font-weight: 500; }
.tr-ic { color: var(--accent); }
.tr-wire { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 6 5; animation: dash 1s linear infinite; }
.tr-wire.back { stroke: var(--ok); } .tr-wire.in { stroke: var(--med); }
.tr-step { fill: var(--accent); } .tr-n { fill: #fff; font-size: 10px; font-weight: 800; text-anchor: middle; }
.tr-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 6px; }
.tr-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 5px; font-size: 12px; }
.tr-steps li span { display: block; color: var(--muted); font-size: 11.5px; }
.tr-need { margin: 0 0 6px; padding-left: 18px; font-size: 12px; }

/* condensed dashboard: alert board + buses needing action */
.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; height: 100%; }
.bg { display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); padding: 5px; }
.bg-h { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800; color: var(--muted); padding: 0 2px 4px; text-transform: uppercase; letter-spacing: .03em; }
.bg-h .ic { color: var(--accent); } .bg-h b { margin-left: auto; color: var(--text); font-size: 13px; }
.bg-t { display: flex; flex-direction: column; gap: 3px; overflow: auto; }
.bt { display: flex; align-items: center; gap: 4px; padding: 3px 5px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel); font-size: 10.5px; text-align: left; }
.bt span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .bt b { font-size: 12.5px; } .bt .ic { color: var(--accent); flex: none; }
.bt em { font-style: normal; font-size: 9.5px; font-weight: 800; color: #fff; background: var(--crit); border-radius: 5px; padding: 0 4px; }
.bt.zero { opacity: .45; } .bt.high { border-color: var(--high); } .bt.crit { border-color: var(--crit); }
.bt:hover { border-color: var(--accent); opacity: 1; }
.rb td { padding: 4px 6px; font-size: 11.5px; vertical-align: middle; } .rb th { padding: 5px 6px; }
.rb .muted { font-size: 10.5px; }

/* client (Tata) management dashboard */
.cdash { display: grid; height: 100%; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: 82px minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "k k k" "y y p" "t r z"; }
.cd-kpis { grid-area: k; } .cd-trend { grid-area: t; } .cd-plants { grid-area: p; } .cd-types { grid-area: y; } .cd-resp { grid-area: r; } .cd-risk { grid-area: z; }
.cd-open { display: inline-block; transition: transform .3s; }
.cd-open.up { color: var(--high); animation: bump .6s; } .cd-open.down { color: var(--ok); animation: bump .6s; }
@keyframes bump { 40% { transform: scale(1.35); } }
.cd-resp-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cd-resp-row div, .cd-km div { padding: 6px 8px; border-radius: 9px; background: var(--panel-2); display: flex; flex-direction: column; font-size: 11px; color: var(--muted); }
.cd-resp-row b, .cd-km b { font-size: 18px; color: var(--text); }
.cd-risk { display: flex; flex-direction: column; gap: 8px; height: 100%; }
.cd-km { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; cursor: pointer; margin-top: auto; }
.client-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--accent); padding: 5px 9px; border-radius: 99px; border: 1px solid var(--accent); white-space: nowrap; }
.av.client { background: linear-gradient(135deg, #0f766e, #22c55e); }

.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; height: 100%; }
.bcol { display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow: auto; }
.bg { padding: 4px 5px; flex: none; }
.bg-t { overflow: visible; gap: 2px; }
.bt { padding: 2px 5px; font-size: 11px; border-radius: 6px; }
.bt b { font-size: 12px; min-width: 18px; text-align: right; }

/* attending + SLA tags */
.ht { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 5px; margin-top: 2px; white-space: nowrap; }
.ht.att { color: #fff; background: var(--accent); animation: pulse 1.6s infinite; }
.ht.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.ht.late { color: var(--high); background: color-mix(in srgb, var(--high) 12%, transparent); }
.ht.wait { color: var(--med); background: color-mix(in srgb, var(--med) 12%, transparent); }
.tix .ht { display: block; width: fit-content; }
.pf-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.pf-bar { display: inline-flex; align-items: center; gap: 6px; } .pf-bar i { display: inline-block; height: 8px; border-radius: 4px; max-width: 70px; min-width: 2px; } .pf-bar b { font-size: 12px; }

/* movable windows */
.drag-handle { cursor: move; user-select: none; touch-action: none; }
.drag-handle button, .drag-handle input, .drag-handle select { cursor: pointer; }
.modal.dragging { box-shadow: 0 40px 100px rgba(0,0,0,.6); opacity: .97; }
.rem-strip .rs-txt.drag-handle { cursor: move; }

/* attend console filters */
.att-filt { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 0 0 6px; }
.att-filt select, .att-filt input { font: inherit; font-size: 11.5px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--text); min-width: 0; }
.att-filt input { grid-column: 1 / -1; }
.att-filt button { grid-column: 1 / -1; font-size: 11px; padding: 3px; border: 1px solid var(--accent); color: var(--accent); background: none; border-radius: 6px; cursor: pointer; }

/* attend console — 3D alert schematic beside the steps */
.att-mid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 8px; margin-top: 6px; }
.att-3d { position: relative; height: 170px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: radial-gradient(ellipse at 50% 70%, var(--panel-3), var(--panel)); cursor: grab; }
.att-3d .bus-views { top: auto; bottom: 4px; left: 4px; }
.att-3d .bus-views button { font-size: 10px; padding: 2px 6px; }
.att-mid .att-steps { margin: 0; }
.bus-focus { pointer-events: none; border-width: 2px; }
.bus-focus em { color: var(--text); font-weight: 600; }
.bus-focus { font-size: 10.5px; padding: 3px 7px; }
.bus-focus b { font-size: 11px; }

/* why no data — per-bus data path */
.wn { display: grid; grid-template-rows: auto auto 1fr auto; gap: 8px; height: 100%; min-height: 0; }
.wn-head { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); border-left: 4px solid var(--accent); background: var(--panel-2); }
.wn-head.lv-critical { border-left-color: var(--crit); } .wn-head.lv-high { border-left-color: var(--high); } .wn-head.lv-medium { border-left-color: var(--med); } .wn-head.lv-low { border-left-color: var(--ok); }
.wn-head h3 { margin: 0 0 2px; display: flex; align-items: center; gap: 8px; font-size: 16px; }
.wn-head .muted { font-size: 11.5px; }
.wn-hit { margin-left: auto; text-align: right; display: grid; }
.wn-hit span { font-size: 11px; color: var(--muted); } .wn-hit b { font-size: 20px; } .wn-hit small { font-size: 11px; color: var(--muted); }
.wn-chain { width: 100%; height: 116px; }
.wn-chain .wn-t { font-size: 11.5px; font-weight: 700; fill: var(--text); }
.wn-chain .wn-s { font-size: 11px; fill: var(--muted); }
.wn-chain .wn-sub { font-size: 11px; fill: var(--muted); }
.wn-chain .wn-brk { font-size: 10.5px; font-weight: 700; fill: var(--high); }
.wn-pulse { animation: wnP 1.4s ease-in-out infinite; }
@keyframes wnP { 50% { stroke-opacity: .35; } }
.wn-mid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 10px; min-height: 0; }
.wn-3d { position: relative; min-height: 190px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: radial-gradient(ellipse at 50% 70%, var(--panel-3), var(--panel)); cursor: grab; }
.wn-3d .bus-views { top: auto; bottom: 4px; left: 4px; } .wn-3d .bus-views button { font-size: 10px; padding: 2px 6px; }
.wn-why { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; overflow: auto; font-size: 12.5px; }
.wn-why > b { display: flex; align-items: center; gap: 6px; color: var(--accent); }
.wn-why p { margin: 4px 0 8px; } .wn-why ol { margin: 4px 0 6px; }
.wn-st { font-size: 11.5px; } .wn-strip { width: 100%; height: 40px; display: block; margin-top: 4px; }
.wn-strip .wn-sub { font-size: 10px; fill: var(--muted); }

/* integration analytics */
.an { display: grid; grid-template-rows: auto 210px minmax(0, 1fr); gap: 8px; height: 100%; min-height: 0; }
.an-k { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.an-k .ig-tile { cursor: default; padding: 8px 10px; }
.an-c { display: grid; grid-template-columns: 1.15fr 1fr 1.2fr; gap: 8px; min-height: 0; }
.an-p { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: grid; grid-template-rows: auto minmax(0, 1fr); position: relative; min-height: 0; }
.an-p > b { font-size: 12px; } .an-p .hint { position: absolute; right: 10px; top: 9px; font-size: 10.5px; color: var(--faint); }
.an-cv { position: relative; min-height: 0; }
.an-t { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; }
.an-t .tbl-wrap { overflow: auto; min-height: 0; }
.wn-cat { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; font-size: 11.5px; }
.wn-cat::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }

/* learn regions & routes */
.lr { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 8px; height: 100%; min-height: 0; }
.lr-top { display: flex; align-items: flex-end; gap: 10px; } .lr-top p { margin: 0; font-size: 12px; flex: 1; color: var(--muted); }
.lr-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 10px; min-height: 0; }
.lr-left { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; gap: 6px; min-height: 0; }
.lr-left .tbl-wrap { overflow: auto; min-height: 0; }
.lr-sum { display: flex; gap: 6px; flex-wrap: wrap; }
.lr-g { border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; display: grid; font-size: 12px; } .lr-g.new { border-color: var(--accent); }
.lr-g small { color: var(--muted); font-size: 10.5px; }
.lr-warn { font-size: 12px; padding: 6px 9px; border-radius: 8px; border: 1px solid var(--med); background: color-mix(in srgb, var(--med) 12%, transparent); }
.lr-ok { font-size: 12px; padding: 6px 9px; border-radius: 8px; border: 1px solid var(--ok); }
.lr-bad { color: var(--high); font-weight: 700; text-decoration: line-through; }
.lr-map { position: relative; border-radius: 10px; overflow: hidden; min-height: 300px; border: 1px solid var(--line); }
.lr-tag { font-style: normal; font-size: 10px; padding: 1px 6px; border-radius: 6px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }

/* safety performance */
.sp { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; gap: 8px; height: 100%; min-height: 0; }
.sp-k { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; } .sp-k .ig-tile { cursor: default; padding: 8px 10px; }
.sp-b { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr); gap: 8px; min-height: 0; }
.sp-ch { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: grid; grid-template-rows: auto minmax(0, 1fr); position: relative; min-height: 0; }
.sp-ch > b { font-size: 12px; display: flex; align-items: center; gap: 6px; } .sp-ch .hint { position: absolute; right: 10px; top: 9px; font-size: 10.5px; color: var(--faint); }
.sp-t { overflow: auto; min-height: 0; border: 1px solid var(--line); border-radius: 10px; }
.sp-g { display: inline-flex; gap: 5px; align-items: center; font-weight: 700; color: var(--c); }
.sp-g i { font-style: normal; font-size: 10.5px; padding: 0 5px; border-radius: 5px; color: #fff; background: var(--c); }
.sp-chip { font-size: 12px; padding: 3px 8px; border-radius: 8px; border: 1px solid var(--accent); }
.sp-chip button { border: 0; background: none; color: var(--muted); cursor: pointer; }
.sp-note { font-size: 11px; }

/* km bank */
.kb { display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 8px; height: 100%; min-height: 0; }
.kb > .tbl-wrap, .kb-d .tbl-wrap { overflow: auto; min-height: 0; }
.kb-d { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 6px; min-height: 0; }

/* clients */
.us-left { display: grid; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; min-height: 0; }
.cl-chip { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 6px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); margin: 1px 0; }
.cl-cell { display: inline-flex; flex-wrap: wrap; gap: 3px; align-items: center; }
.cl-cell .btn.sm { padding: 1px 6px; }
.cl-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin-top: 4px; font-size: 12.5px; }
.cl-checks label:first-child { grid-column: 1 / -1; }

.logo-chip img.client { height: 18px; max-width: 120px; object-fit: contain; }

/* add login — kind chooser */
.kind-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kind-card { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 4px 12px; align-items: center; text-align: left; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); cursor: pointer; font: inherit; }
.kind-card svg { grid-row: 1 / 3; } .kind-card b { font-size: 14.5px; } .kind-card small { grid-column: 2; color: var(--muted); font-size: 12px; line-height: 1.35; }
.kind-card:hover { border-color: var(--accent); }
.kind-card.k-lcs svg { color: var(--accent); } .kind-card.k-cl svg { color: var(--ok); }
.kind-tag { display: inline-block; font-size: 10.5px; padding: 1px 7px; border-radius: 6px; background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); font-weight: 600; }
.k-cl .kind-tag { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.kind-head { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 10px; }
.kind-head small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.cl-pick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.logo-up { display: inline-flex; gap: 6px; align-items: center; }
.logo-up img { height: 30px; max-width: 140px; object-fit: contain; background: #fff; border-radius: 6px; padding: 3px 6px; }
.note-ro, .note-ops { font-size: 12px; padding: 7px 10px; border-radius: 8px; margin-top: 8px; display: flex; gap: 6px; align-items: center; }
.note-ro { border: 1px solid var(--ok); } .note-ops { border: 1px solid var(--accent); }

/* client 3D / schematic ticket panel */
.cd-3d .ph { gap: 8px; } .cd-tabs button { font-size: 11px; padding: 3px 8px; } .cd-tabs button b { margin-left: 4px; font-size: 10px; opacity: .8; }
.cd-3dh { position: relative; min-height: 0; padding: 4px; }
.cd-3dh > svg { width: 100%; height: 100%; }
.cf .cf-n { font-size: 16px; font-weight: 800; fill: var(--text); } .cf .cf-t { font-size: 11.5px; font-weight: 700; fill: var(--text); } .cf .cf-s { font-size: 10px; fill: var(--muted); }
.cf .cf-p, .cf .cf-l { cursor: pointer; } .cf .cf-p:hover { opacity: .85; }

/* auto-repair engine */
.af .pb { display: grid; gap: 8px; }
.af-k { display: grid; grid-template-columns: repeat(5, minmax(0, 150px)) 1fr; gap: 8px; align-items: stretch; }
.af-k > div { border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; display: grid; }
.af-k span { font-size: 11px; color: var(--muted); } .af-k b { font-size: 18px; } .af-k b.ok { color: var(--ok); } .af-k b.bad { color: var(--crit); } .af-k b.warn { color: var(--med); font-size: 14px; } .af-k small { font-size: 10.5px; color: var(--muted); }
.af-k .af-how { font-size: 11.5px; color: var(--muted); display: block; }
.af-pend { display: flex; gap: 6px; flex-wrap: wrap; } .af-p { font-size: 11.5px; border: 1px solid var(--accent); border-radius: 8px; padding: 3px 8px; display: inline-flex; gap: 5px; align-items: center; } .af-p.bad { border-color: var(--crit); }
.wn-fix { font-size: 12px; padding: 5px 8px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 12%, transparent); display: flex; gap: 6px; align-items: center; }
.wn-tabs { margin-left: 12px; } .wn-tabs button { font-size: 11.5px; }
/* connectivity & tampering */
.wn-c { grid-template-rows: auto minmax(0, 1fr); }
.wn-connh { min-height: 0; }
.cn { display: grid; grid-template-rows: auto 200px auto minmax(0, 1fr); gap: 8px; height: 100%; min-height: 0; }
.cn-top { display: flex; gap: 10px; align-items: center; }
.cn-verdict { flex: 1; display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); border-left-width: 4px; font-size: 12.5px; }
.cn-verdict b { display: block; font-size: 14px; } .cn-verdict.v-crit { border-left-color: var(--crit); } .cn-verdict.v-crit b { color: var(--crit); }
.cn-verdict.v-sys { border-left-color: var(--accent); } .cn-verdict.v-warn { border-left-color: var(--med); } .cn-verdict.v-high { border-left-color: var(--high); } .cn-verdict.v-ok { border-left-color: var(--ok); }
.cn-mid { display: grid; grid-template-columns: 1fr 1fr 1.1fr; gap: 8px; min-height: 0; }
.cn-c { border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; } .cn-c > b { font-size: 12px; }
.cn-c svg { width: 100%; height: 100%; }
.cn-big { font-size: 22px; font-weight: 800; fill: #fff; paint-order: stroke; stroke: rgba(0,0,0,.35); stroke-width: 3px; } .cn-sm { font-size: 9.5px; fill: var(--muted); } .cn-n { font-size: 13px; font-weight: 800; fill: var(--text); } .cn-warn { font-size: 11px; fill: var(--crit); }
.cn-l { display: grid; gap: 3px; overflow: auto; }
.cn-leg { display: grid; grid-template-columns: 12px 1fr auto; gap: 0 6px; align-items: center; font-size: 11.5px; border-bottom: 1px dashed var(--line); padding: 2px 0; }
.cn-leg i { width: 10px; height: 10px; border-radius: 3px; } .cn-leg small { grid-column: 2 / -1; color: var(--muted); font-size: 10.5px; } .cn-leg span { font-weight: 700; }
.cn-tl { font-size: 11.5px; } .cn-lane { width: 100%; height: 46px; display: block; }
.cn-list { overflow: auto; min-height: 0; }

.cn-c { grid-template-rows: auto auto minmax(0, 1fr); } .cn-sm2 { font-size: 10px; color: var(--muted); }

/* clients & users */
.cm-name { display: inline-flex; align-items: center; gap: 8px; } .cm-name img { height: 22px; max-width: 70px; object-fit: contain; background: #fff; border-radius: 5px; padding: 2px 4px; }
.cm-nologo { display: inline-grid; place-items: center; width: 28px; height: 22px; border-radius: 5px; background: var(--panel-3); font-style: normal; font-size: 10px; font-weight: 700; color: var(--muted); }
.cm-act { white-space: nowrap; } .cm-act .btn { margin-right: 4px; }
.btn.danger-o { border-color: var(--crit); color: var(--crit); }
.ec { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 10px; height: 100%; min-height: 0; } .ec-body { overflow: auto; min-height: 0; }
.svc { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 10px; border: 1px solid var(--ok); margin-bottom: 10px; } .svc.stopped { border-color: var(--crit); }
.svc > div { flex: 1; } .svc b { display: block; font-size: 15px; } .svc span { font-size: 12px; color: var(--muted); } .svc.stopped b { color: var(--crit); }

/* fleet tile with total + month trend window */
.kpi-fleet .fl3 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; } .kpi-fleet .fl3 button { padding: 3px; min-width: 0; } .kpi-fleet .fl3 b { font-size: 18px; } .kpi-fleet .fl3 span { font-size: 9px; overflow: hidden; text-overflow: ellipsis; }
.tr { display: grid; grid-template-rows: auto auto minmax(0, 1fr) 150px; gap: 8px; height: 100%; min-height: 0; }
.tr-c { min-height: 0; border: 1px solid var(--line); border-radius: 10px; background: radial-gradient(ellipse at 50% 80%, var(--panel-2), var(--panel)); }
.tr-svg { width: 100%; height: 100%; display: block; }
.tr-grid { stroke: var(--line); stroke-dasharray: 3 4; } .tr-ax { font-size: 10px; fill: var(--muted); }
.tr-v { font-size: 11px; font-weight: 800; fill: var(--text); } .tr-m { font-size: 10.5px; font-weight: 600; fill: var(--muted); } .tr-m.part { fill: var(--accent); }
.tr-b { cursor: pointer; } .tr-b:hover { opacity: .82; }
.tr-t { overflow: auto; min-height: 0; }

/* not-live 3D data path */
.an-pc { grid-template-columns: 1fr; }
.an-pipe { grid-template-rows: auto minmax(0, 1fr); background: radial-gradient(ellipse at 50% 90%, var(--panel-2), var(--panel)); }
.pp-svg { width: 100%; height: 100%; display: block; }
.pp-st, .pp-bus, [data-stage] { cursor: pointer; } .pp-st:hover, .pp-bus:hover { opacity: .85; }
.pp-n { font-size: 12px; font-weight: 700; fill: #fff; } .pp-c { font-size: 12.5px; font-weight: 800; fill: var(--text); } .pp-s { font-size: 10.5px; fill: var(--muted); }
.pp-live { font-size: 12px; font-weight: 700; fill: var(--ok); }
.kpis.cd-kpis { grid-template-columns: repeat(10, minmax(0, 1fr)); }

/* ===== dashboard number tiles — equal size, themed ===== */
.dash { grid-template-rows: 94px minmax(0, 1fr) minmax(0, 1fr); }
.cdash { grid-template-rows: 94px minmax(0, 1fr) minmax(0, 1fr); }
.kpis { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
.kpis.cd-kpis { grid-template-columns: repeat(9, minmax(0, 1fr)); }
.kt { --tc: #2563eb; position: relative; overflow: hidden; cursor: pointer; border-radius: 12px; padding: 8px 10px 7px; min-width: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--tc) 17%, var(--panel)) 0%, color-mix(in srgb, var(--tc) 5%, var(--panel)) 60%, var(--panel) 100%);
  border: 1px solid color-mix(in srgb, var(--tc) 28%, var(--line)); box-shadow: 0 1px 2px rgba(0,0,0,.05), inset 0 3px 0 var(--tc);
  display: grid; grid-template-rows: auto 1fr auto; transition: transform .15s, box-shadow .15s; }
.kt:hover { transform: translateY(-2px); box-shadow: 0 8px 22px color-mix(in srgb, var(--tc) 25%, transparent), inset 0 3px 0 var(--tc); }
.kt-h { display: flex; align-items: center; gap: 6px; min-width: 0; position: relative; z-index: 1; }
.kt-ic { flex: none; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; color: #fff; background: linear-gradient(140deg, color-mix(in srgb, var(--tc) 75%, #fff), var(--tc)); box-shadow: 0 2px 6px color-mix(in srgb, var(--tc) 45%, transparent); }
.kt-l { font-size: 11.5px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kt .k-ping { margin-left: auto; font-size: 9.5px; }
.kt-v { font-size: 25px; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; align-self: center; position: relative; z-index: 1; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kt-v small { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 1px; }
.kt-r { display: flex; flex-wrap: wrap; gap: 3px 4px; position: relative; z-index: 1; min-height: 18px; }
.kt-m { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; color: var(--muted); padding: 1px 6px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--tc) 22%, var(--line)); background: color-mix(in srgb, var(--panel) 75%, transparent); white-space: nowrap; cursor: pointer; font-family: inherit; }
.kt-m b { color: var(--text); font-size: 10.5px; } .kt-m:hover { border-color: var(--tc); }
.kt-m .dot { width: 6px; height: 6px; }
.kt-art { position: absolute; right: -6px; bottom: -8px; color: var(--tc); opacity: .13; transform: rotate(-8deg); pointer-events: none; }
.kt.crit .kt-v { color: var(--crit); } .kt.hi .kt-v { color: var(--high); }
.kt.sos-on { animation: sosglow 1.2s ease-in-out infinite; }
.t-blue { --tc: #2563eb; } .t-teal { --tc: #0d9488; } .t-amber { --tc: #d97706; } .t-indigo { --tc: #4f46e5; } .t-violet { --tc: #7c3aed; }
.t-orange { --tc: #ea580c; } .t-red { --tc: #dc2626; } .t-slate { --tc: #64748b; } .t-sky { --tc: #0284c7; } .t-green { --tc: #16a34a; }
:root[data-theme="dark"] .kt, :root:not([data-theme="light"]) .kt { box-shadow: 0 1px 0 rgba(255,255,255,.03), inset 0 3px 0 var(--tc); }
/* fleet tile: big number left, live / NRD / faulty stacked on the right */
.kt.kt-col { grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 6px; }
.kt.kt-col .kt-h { grid-column: 1 / -1; }
.kt.kt-col .kt-v { display: flex; flex-direction: column; line-height: 1; }
.kt.kt-col .kt-v small { margin: 2px 0 0; font-size: 10.5px; }
.kt.kt-col .kt-r { flex-direction: column; align-items: stretch; justify-content: center; gap: 2px; }
.kt.kt-col .kt-m { justify-content: flex-start; padding: 0 5px; font-size: 9.5px; }
/* number row across the full width; tickets column starts below it */
.dash { grid-template-areas: "kpi kpi kpi" "gps cam tix" "twin km tix"; }
.kt-r { flex-wrap: nowrap; overflow: hidden; }
@media (max-width: 900px) { .dash { grid-template-areas: "kpi" "gps" "cam" "twin" "km" "tix"; } .kpis { grid-template-columns: repeat(2, 1fr); } }
.kt.kt-long .kt-v { font-size: 21px; }
.cd-kpis .kt-m { padding: 0 4px; font-size: 9.5px; gap: 2px; } .cd-kpis .kt-m b { font-size: 10px; } .cd-kpis .kt-r { gap: 3px; }
.cd-kpis .kt-m { padding: 0 3px; }

/* ---------- signal-loss intelligence (signal.js) + NRD map + fleet health ---------- */
.an-k { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.nm { display: grid; grid-template-columns: 1fr 290px; gap: 10px; height: min(62vh, 470px); }
.nm-map { position: relative; height: 100%; min-height: 260px; border-radius: 10px; overflow: hidden; }
.nm-side { display: flex; flex-direction: column; gap: 8px; overflow: auto; font-size: 12px; }
.nm-ctr { padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--high) 12%, var(--panel-2)); border: 1px solid color-mix(in srgb, var(--high) 40%, transparent); display: flex; flex-direction: column; }
.nm-ctr span { font-size: 11px; color: var(--muted); } .nm-ctr b { font-size: 22px; font-variant-numeric: tabular-nums; color: var(--high); line-height: 1.2; } .nm-ctr small { color: var(--muted); }
.nm-ctr.live { background: color-mix(in srgb, var(--ok) 12%, var(--panel-2)); border-color: color-mix(in srgb, var(--ok) 40%, transparent); } .nm-ctr.live b { color: var(--ok); }
.nm-dl { display: grid; grid-template-columns: 88px 1fr; gap: 3px 8px; margin: 0; } .nm-dl dt { color: var(--muted); } .nm-dl dd { margin: 0; }
.nm-why { padding: 8px 10px; border-radius: 10px; background: var(--panel-2); line-height: 1.45; font-size: 11.5px; }
.nm-pin { width: 30px; height: 30px; border-radius: 50%; background: #f97316; color: #fff; display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 0 0 6px rgba(249,115,22,.25); animation: ping 2s ease-out infinite; }
.btn.ic-only { padding: 3px 6px; } .nm-btn { color: var(--accent); }
.sg-dot { border-radius: 50%; background: color-mix(in srgb, var(--c) 80%, transparent); color: #fff; font-weight: 800; font-size: 11px; display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.sg { display: flex; flex-direction: column; gap: 8px; height: 100%; min-height: 0; }
.sg-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 11px; }
.sg-k { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); } .sg-k i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); } .sg-k b { color: var(--text); }
.sg-grid { display: grid; grid-template-columns: 1fr 560px; gap: 8px; flex: 1; min-height: 0; }
.sg-map { position: relative; min-height: 0; } .sg-map .map { height: 100%; }
.sg-leg { position: absolute; left: 8px; bottom: 22px; z-index: 10; display: flex; flex-direction: column; gap: 2px; font-size: 10.5px; background: var(--panel); padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line); }
.sg-leg i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.sg-side { display: grid; grid-template-rows: auto 1fr 1fr auto; gap: 6px; min-height: 0; overflow: hidden; }
.sg-side .panel { min-height: 0; display: flex; flex-direction: column; } .sg-side .ph { padding: 5px 10px; } .sg-side .ph h3 { font-size: 12px; }
.sg-t { overflow: auto; padding: 0 !important; min-height: 0; } .sg-t .tbl td, .sg-t .tbl th { padding: 3px 6px; font-size: 11px; }
.sg-flag td { background: color-mix(in srgb, var(--high) 8%, transparent); }
.sg-z { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 8px !important; }
.sg-z button { display: flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); font-size: 11px; text-align: left; }
.sg-z b { color: #3b82f6; font-size: 14px; } .sg-z span { display: flex; flex-direction: column; } .sg-z small { color: var(--muted); font-size: 9.5px; }
.seg.sm button { padding: 2px 7px; font-size: 10.5px; }
.issue.hot { background: color-mix(in srgb, var(--high) 22%, transparent); font-weight: 700; }
.hot-sig { position: absolute; right: 10px; top: 10px; z-index: 10; }
.hv-sig { font-size: 11px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; } .hv-sig b { color: var(--text); }
.hv { display: grid; grid-template-columns: 1.15fr 1fr; grid-template-rows: auto minmax(0, 1fr); gap: 8px; height: calc(100% - 36px); min-height: 0; }
.hv-pipe .pb { padding: 4px 8px; } .hv-pipe .pb > svg { width: 100%; height: auto; max-height: 190px; }
.hv-map { grid-row: 1 / 3; grid-column: 2; position: relative; min-height: 0; } .hv-map .map { height: 100%; min-height: 240px; }
.hv-leg { position: absolute; left: 8px; bottom: 22px; z-index: 10; display: flex; flex-wrap: wrap; gap: 4px 10px; max-width: 80%; font-size: 10px; background: var(--panel); padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line); }
.hv-leg i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; }
.hv-list { min-height: 0; overflow: hidden; } .hv-list .tbl-wrap { height: 100%; overflow: auto; } .hv-list .tbl td, .hv-list .tbl th { padding: 4px 6px; font-size: 11px; }
@media (max-width: 1100px) { .sg-grid, .hv, .nm { grid-template-columns: 1fr; } .hv-map { grid-row: auto; grid-column: auto; height: 260px; } }
/* left menu: all items on one screen (no scrolling) at 1408×680 */
.nav { gap: 1px; padding: 4px 0; scrollbar-width: none; }
.nav a { width: 54px; padding: 3px 0 2px; gap: 2px; font-size: 9px; border-radius: 9px; white-space: nowrap; }
.nav a span { overflow: hidden; text-overflow: ellipsis; max-width: 52px; }
.nav .sep { margin: 2px 0; }
.nav-hb { margin-bottom: 2px; }
@media (max-height: 640px) { .nav a { padding: 2px 0; } .nav a .ic { width: 15px; height: 15px; } }
/* ---------- offenders + driver safety index (offenders.js) ---------- */
.hs-n { border-radius: 50%; background: var(--c); color: #fff; font-weight: 800; font-size: 11px; display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.35); cursor: pointer; }
.hs-off { margin: 5px 0; padding: 5px 7px; border-radius: 7px; background: rgba(127,127,127,.12); font-size: 11px; line-height: 1.5; }
.of { display: grid; grid-template-columns: 1fr 360px; gap: 8px; height: 100%; min-height: 0; }
.of-l { display: grid; grid-template-rows: 150px minmax(0, 1fr); gap: 8px; min-height: 0; }
.of-top { flex-direction: row; align-items: center; gap: 10px; padding: 4px 10px; }
.of-pw { width: 300px; flex: none; } .of-podium { width: 100%; height: 146px; }
.of-pod { cursor: pointer; } .of-pod:hover { filter: brightness(1.12); }
.of-pn { font-size: 10.5px; font-weight: 700; fill: var(--text); } .of-ps { font-size: 8.5px; fill: var(--muted); } .of-pr { font-size: 15px; font-weight: 800; fill: #fff; }
.of-kp { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex: 1; }
.of-kp > div:not(.seg) { padding: 5px 10px; border-radius: 9px; background: var(--panel-2); display: flex; flex-direction: column; font-size: 10.5px; color: var(--muted); min-width: 84px; }
.of-kp b { font-size: 19px; color: var(--text); } .of-kp .c-crit b { color: var(--crit); } .of-kp .c-high b { color: var(--high); }
.of-kp small { flex-basis: 100%; }
.of-tb .ph { padding: 5px 8px; } .of-tb .tbl-wrap { flex: 1; overflow: auto; min-height: 0; }
.of-tb .tbl td, .of-tb .tbl th { padding: 3px 6px; font-size: 11px; }
.of-tb tr.sel td { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.of-why { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.of-r { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.of-card { display: flex; gap: 8px; padding: 8px; font-size: 11.5px; align-items: flex-start; border-bottom: 1px solid var(--line); }
.of-pic { width: 110px; flex: none; } .of-snap { width: 90px; border-radius: 6px; flex: none; }
.of-ty { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.of-ty span { display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px; border-radius: 6px; background: var(--panel-2); font-size: 10.5px; } .of-ty b { color: var(--high); }
.of-map { position: relative; min-height: 0; }
.of-bus { width: 22px; height: 22px; border-radius: 50%; background: #1467b3; color: #fff; display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.ds { display: flex; flex-direction: column; gap: 8px; height: 100%; min-height: 0; }
.ds-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .ds-avg { font-size: 11.5px; color: var(--muted); }
.ds-grid { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; flex: 1; min-height: 0; }
.ds-c .pb { display: grid; place-items: center; min-height: 0; } .ds-3d { width: 100%; height: 100%; max-height: 230px; }
.ds-blk { cursor: pointer; } .ds-blk:hover { filter: brightness(1.12); }
.ds-n { font-size: 11px; font-weight: 800; fill: var(--text); } .ds-l { font-size: 9px; fill: var(--muted); }
.ds-gt { min-height: 0; } .ds-gt .tbl-wrap, .ds-dl .tbl-wrap { overflow: auto; min-height: 0; flex: 1; }
.ds-dl { grid-column: 1 / -1; } .ds-dl .ph { padding: 5px 10px; }
.ds-gt .tbl td, .ds-dl .tbl td, .ds-gt .tbl th, .ds-dl .tbl th { padding: 3px 6px; font-size: 11px; }
.dd { display: grid; grid-template-columns: 300px 1fr 1fr; gap: 8px; height: 100%; min-height: 0; }
.dd-k { padding: 10px; overflow: auto; font-size: 11.5px; }
.dd-score { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; } .dd-score b { font-size: 40px; color: var(--c); line-height: 1; } .dd-score span { color: var(--muted); }
.dd-h { overflow: auto; } .dd-m { position: relative; min-height: 0; }
@media (max-width: 1100px) { .of, .dd, .ds-grid { grid-template-columns: 1fr; } .of-map, .dd-m { height: 300px; } }
/* ---------- Safety science — 3D pictorials ---------- */
.sci-top { display: flex; align-items: center; gap: 10px; }
.sci3 .ph { padding: 5px 10px; } .sci3 .ph h3 { font-size: 12.5px; }
.sci-c { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 0; overflow: hidden; padding: 4px 8px; }
.sci-c svg { width: 100%; flex: 1; min-height: 0; }
.sci-pipe { max-height: 100%; }
.sp-blk, .sp-lay, .sp-hr { cursor: pointer; } .sp-blk:hover, .sp-lay:hover, .sp-hr:hover { filter: brightness(1.15); }
.sp-t { font-size: 12px; font-weight: 700; fill: var(--text); } .sp-v { font-size: 12px; font-weight: 800; fill: var(--text); } .sp-s { font-size: 9.5px; fill: var(--muted); }
.sp-pc { font-size: 12px; font-weight: 800; fill: #fff; } .sp-pl { font-size: 10px; fill: var(--muted); }
.sci-note { font-size: 10.5px; color: var(--muted); line-height: 1.35; text-align: center; padding: 2px 4px; }
.sci-acts { display: flex; flex-direction: column; gap: 4px; overflow: auto; padding: 6px 8px; }
.sci-acts button { display: flex; align-items: center; gap: 8px; text-align: left; padding: 5px 8px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); font-size: 11.5px; color: var(--text); }
.sci-acts button:hover { border-color: var(--accent); }
.sci-acts b { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 11px; flex: none; }
.sci-ai { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; color: #fff; background: linear-gradient(150deg, var(--tata), var(--accent)); box-shadow: 2px 3px 0 color-mix(in srgb, var(--tata) 55%, #000); }
.sci-acts span:last-child { display: flex; flex-direction: column; min-width: 0; } .sci-acts em { font-style: normal; font-weight: 600; } .sci-acts small { color: var(--muted); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sci-top > .seg { flex: none; } .sci3 .sci-top > div:first-child { flex: 1 1 auto; }
/* ---------- Alert logic page (rules.js) ---------- */
.rl { display: flex; flex-direction: column; gap: 8px; height: 100%; min-height: 0; }
.rl-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .rl-head h2 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.rl-rem { display: flex; align-items: center; gap: 8px; padding: 3px 10px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.rl-rem label { display: inline-flex; align-items: center; gap: 3px; } .rl-rem input[type=number] { width: 42px; padding: 2px 4px; font-size: 11px; }
.rl-body { display: grid; grid-template-columns: 430px 1fr; gap: 8px; flex: 1; min-height: 0; }
.rl-list { overflow: auto; padding: 4px 6px; display: block; }
.rl-list h4 { margin: 6px 4px 2px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.rl-row { display: grid; grid-template-columns: 16px 1fr 62px 52px 40px 28px 30px; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 8px; font-size: 11px; cursor: pointer; border: 1px solid transparent; }
.rl-row:hover { background: var(--panel-2); } .rl-row.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); } .rl-row.off { opacity: .5; }
.rl-row .ic { color: var(--accent); } .rl-n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; } .rl-std, .rl-fl, .rl-tk { color: var(--muted); font-size: 10px; } .rl-c { text-align: right; }
.rl-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.switch.sm { width: 28px; height: 16px; } .switch.sm span::after { width: 10px; height: 10px; }
.rl-ed { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; overflow: auto; }
.rl-eh { display: flex; align-items: center; gap: 10px; } .rl-eh .ic { color: var(--accent); } .rl-eh > div:not(.rl-wi) { display: flex; flex-direction: column; font-size: 11px; } .rl-eh b { font-size: 14px; }
.rl-wi { white-space: nowrap; padding: 5px 10px; border-radius: 10px; background: var(--panel-2); font-size: 11.5px; } .rl-wi span { display: block; font-size: 10px; color: var(--muted); } .rl-wi b { font-size: 15px; } .rl-wi small { color: var(--muted); }
.rl-viz { display: grid; grid-template-columns: 1fr 150px; gap: 10px; align-items: center; }
.rl-ramp { width: 100%; height: auto; max-height: 150px; touch-action: none; } .rl-h { cursor: ew-resize; }
.rl-s { font-size: 10px; fill: var(--muted); } .rl-hl { font-size: 9.5px; font-weight: 700; fill: var(--text); } .rl-cap { font-size: 10.5px; }
.rl-pic { width: 100%; max-height: 110px; }
.rl-f { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.rl-st { display: flex; flex-direction: column; gap: 2px; font-size: 10.5px; color: var(--muted); padding: 5px 8px; border-radius: 9px; background: var(--panel-2); }
.rl-st > div { display: flex; align-items: center; gap: 2px; } .rl-st input { width: 100%; min-width: 0; padding: 3px 5px; font-size: 12px; text-align: center; }
.rl-st button { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--text); padding: 0; font-weight: 700; flex: none; }
.rl-st select { font-size: 11.5px; padding: 3px; } .rl-desc { grid-column: span 2; } .rl-desc input { text-align: left; }
.rl-log { display: flex; flex-direction: column; gap: 2px; font-size: 10.5px; padding: 6px 8px; border-radius: 9px; border: 1px dashed var(--line); }
@media (max-width: 1100px) { .rl-body { grid-template-columns: 1fr; } .rl-f { grid-template-columns: repeat(2, 1fr); } }
/* ---------- registration & compliance (register.js) ---------- */
.rg-steps { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 11.5px; color: var(--muted); }
.rg-steps span { display: inline-flex; align-items: center; gap: 5px; } .rg-steps b { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line); font-size: 11px; }
.rg-steps span.on { color: var(--text); font-weight: 700; } .rg-steps span.on b { background: var(--accent); color: #fff; border-color: var(--accent); } .rg-steps span.done b { background: var(--ok); color: #fff; border-color: var(--ok); }
.rg-steps i { flex: 1; height: 1px; background: var(--line); }
.rg-aad { display: grid; grid-template-columns: 240px 1fr; gap: 12px; }
.rg-card { height: 150px; border-radius: 10px; border: 1px dashed var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); overflow: hidden; font-size: 11px; }
.rg-card img { width: 100%; height: 100%; object-fit: cover; filter: blur(3px); }
.rg-cons { display: flex; gap: 6px; align-items: flex-start; font-size: 11.5px; margin: 6px 0; }
.rg-note { display: flex; gap: 6px; padding: 7px 9px; border-radius: 9px; background: var(--panel-2); font-size: 11px; line-height: 1.45; } .rg-note .ic { color: var(--ok); flex: none; }
.rg-face { display: grid; grid-template-columns: 1fr 200px; gap: 12px; }
.rg-cam { position: relative; height: 270px; border-radius: 12px; overflow: hidden; background: #0b1220; }
.rg-cam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.rg-oval { position: absolute; left: 50%; top: 50%; width: 150px; height: 200px; transform: translate(-50%, -50%); border: 3px dashed rgba(255,255,255,.85); border-radius: 50%; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.rg-hint { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; color: #fff; font-weight: 700; font-size: 12px; }
.rg-shots { display: flex; flex-direction: column; gap: 6px; } .rg-shots > div { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.rg-shots img, .rg-shots > div > .ic { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; background: var(--panel-2); }
.rg-rev { display: flex; gap: 14px; } .rg-rev img { width: 110px; height: 110px; border-radius: 12px; object-fit: cover; }
.cp { display: flex; flex-direction: column; gap: 8px; height: 100%; min-height: 0; } .cp .tbl-wrap { flex: 1; overflow: auto; min-height: 0; }
.cp-t td, .cp-t th { padding: 4px 6px; font-size: 11px; white-space: nowrap; } .cp-t td.click { cursor: pointer; } .cp-t td.click:hover { background: var(--panel-2); }
.cp-b { display: inline-block; padding: 1px 6px; border-radius: 6px; font-size: 10.5px; }
.cp-b.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); } .cp-b.warn { color: var(--high); background: color-mix(in srgb, var(--high) 14%, transparent); }
.cp-b.bad { color: #fff; background: var(--crit); font-weight: 700; } .cp-b.none { color: var(--muted); border: 1px dashed var(--line); }
.cp-src { font-style: normal; font-size: 8.5px; font-weight: 800; color: var(--accent); margin-left: 3px; vertical-align: super; }
/* pending-to-attend count on the Alerts by type board */
.bt-w { font-style: normal; font-size: 9.5px; font-weight: 800; color: #fff; background: var(--high); border-radius: 5px; padding: 0 4px; cursor: pointer; white-space: nowrap; }
.bt-w:hover { filter: brightness(1.15); } .bg-h .bt-w { margin-left: auto; margin-right: 4px; font-size: 9px; }
/* ---------- analysis "at a glance" (glance.js) ---------- */
.gl { display: flex; flex-direction: column; gap: 8px; height: 100%; min-height: 0; }
.g-top { display: grid; grid-template-columns: 200px 1fr 230px 250px; gap: 8px; }
.g-top > div { border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); padding: 8px 10px; font-size: 11.5px; min-width: 0; }
.g-verdict { display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.g-verdict span { font-size: 18px; line-height: 1; } .g-verdict b { font-size: 17px; } .g-verdict small { color: var(--muted); font-size: 10.5px; }
.g-verdict.v-bad { border-color: var(--high); background: color-mix(in srgb, var(--high) 12%, var(--panel-2)); } .g-verdict.v-bad span, .g-verdict.v-bad b { color: var(--high); }
.g-verdict.v-warn span, .g-verdict.v-warn b { color: var(--med); } .g-verdict.v-good span, .g-verdict.v-good b { color: var(--ok); }
.g-take > b { display: flex; align-items: center; gap: 5px; } .g-take .ic { color: var(--accent); }
.g-take ul { margin: 4px 0 0; padding-left: 16px; line-height: 1.5; } .g-take li b { color: var(--text); } .g-crit { color: var(--crit) !important; }
.g-acts { display: flex; flex-direction: column; gap: 3px; }
.g-acts button { display: flex; align-items: center; gap: 6px; text-align: left; padding: 3px 7px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 11px; }
.g-acts button:hover { border-color: var(--accent); } .g-acts .ic { color: var(--accent); flex: none; }
.g-kpi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; align-content: start; }
.g-kpi > div:not(.seg) { display: flex; flex-direction: column; } .g-kpi span { font-size: 10px; color: var(--muted); } .g-kpi b { font-size: 20px; } .g-kpi small { font-size: 10px; color: var(--muted); }
.g-kpi .seg { grid-column: 1 / -1; justify-self: start; }
.g-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; flex: 1; min-height: 0; }
.g-grid .ph { padding: 5px 10px; } .g-grid .ph h3 { font-size: 12.5px; }
.g-pb { display: flex; align-items: center; justify-content: center; min-height: 0; padding: 2px 6px; } .g-svg { width: 100%; height: 100%; }
.g-hit { cursor: pointer; } g.g-hit:hover { filter: brightness(1.18); }
.g-v { font-size: 12px; font-weight: 800; fill: var(--text); } .g-s { font-size: 9.5px; fill: var(--muted); } .g-l { font-size: 11px; font-weight: 700; fill: var(--text); text-transform: capitalize; }
.g-who { display: flex; flex-direction: column; gap: 3px; overflow: auto; height: 100%; }
.g-who button { display: flex; align-items: center; gap: 5px; padding: 3px 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font-size: 11px; text-align: left; }
.g-who button:hover { border-color: var(--accent); } .g-who .ic { color: var(--accent); }
.g-rank { width: 18px; height: 18px; border-radius: 50%; background: var(--panel-3); display: grid; place-items: center; font-size: 10px; font-weight: 800; } .g-rank.top { background: var(--high); color: #fff; }
.g-nm { width: 104px; flex: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.g-bar { flex: 1; min-width: 30px; height: 9px; border-radius: 5px; background: var(--panel-3); overflow: hidden; box-shadow: inset 0 -2px 0 rgba(0,0,0,.15); } .g-bar i { display: block; height: 100%; background: linear-gradient(180deg, #3b82f6, #1467b3); border-radius: 5px; }
.g-who b { width: 26px; text-align: right; flex: none; } .g-who small { width: 30px; flex: none; color: var(--muted); font-size: 10px; } .g-rank, .g-who .ic { flex: none; }
.g-std { display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
@media (max-width: 1100px) { .g-top, .g-grid { grid-template-columns: 1fr; } }

.rl-ed { gap: 6px; padding: 8px 12px; } .rl-st { padding: 4px 8px; } .rl-viz { grid-template-columns: 1fr 120px; }
/* ---------- one bus, all details (Masters.vehicleCard) ---------- */
.vc-row { cursor: pointer; } .vc-row:hover td { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.vc-link { color: var(--accent); cursor: pointer; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 3px; }
.vc { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 8px; height: 100%; min-height: 0; }
.vc-3d { display: flex; flex-direction: column; min-height: 0; }
.vc-head { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px 0; font-size: 11.5px; }
.vc-reg { display: flex; align-items: center; gap: 8px; } .vc-reg b { font-size: 20px; letter-spacing: .02em; }
.vc-bus { position: relative; flex: 1; min-height: 240px; } .vc-hint { font-size: 10.5px; padding: 0 12px 6px; }
.vc-side { display: grid; grid-template-rows: auto auto auto auto; gap: 6px; overflow: auto; min-height: 0; }
.vc-c { padding: 6px 10px 8px; font-size: 11.5px; } .vc-c h4 { margin: 0 0 4px; font-size: 12px; display: flex; align-items: center; gap: 5px; } .vc-c h4 .ic { color: var(--accent); }
.vc-c .nm-dl { grid-template-columns: 82px 1fr; }
.vc-drv { display: inline-flex; align-items: center; gap: 5px; } .vc-drv img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.vc-devs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; margin-bottom: 5px; }
.vc-devs button { display: flex; align-items: center; gap: 4px; padding: 3px 5px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font-size: 10px; text-align: left; min-width: 0; }
.vc-devs button span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .vc-devs button .ic { color: var(--accent); flex: none; }
.vc-devs button.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--panel-2)); }
.vc-dd { padding: 5px 8px; border-radius: 8px; background: var(--panel-2); min-height: 40px; }
.vc-k { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.vc-k button { display: flex; flex-direction: column; align-items: flex-start; padding: 4px 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); }
.vc-k button:hover, .vc-cp button:hover, .vc-devs button:hover { border-color: var(--accent); }
.vc-k span { font-size: 9.5px; color: var(--muted); } .vc-k b { font-size: 16px; } .vc-k small { font-size: 10px; color: var(--muted); }
.vc-odo { font-size: 10.5px; margin-top: 4px; }
.vc-cp { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
.vc-cp button { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 3px 6px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font-size: 10.5px; }
@media (max-width: 1100px) { .vc { grid-template-columns: 1fr; } .vc-bus { height: 300px; } }
/* picture band at the top of a Detailed report */
.g-band { display: grid; grid-template-columns: 1.5fr 0.9fr 1.5fr 1fr 1.1fr 1fr; gap: 6px; margin-bottom: 8px; height: 168px; }
.g-band > div { border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); padding: 5px 7px; min-width: 0; display: flex; flex-direction: column; overflow: hidden; font-size: 11px; }
.g-band > div > b { display: flex; align-items: center; gap: 4px; font-size: 11px; } .g-band > div > b .ic { color: var(--accent); }
.g-band .g-svg { flex: 1; min-height: 0; }
.g-bt .g-verdict { flex-direction: row; align-items: center; gap: 6px; } .g-bt .g-verdict b { font-size: 14px; } .g-bt .g-verdict span { font-size: 14px; }
.g-bt ul { margin: 2px 0 0; padding-left: 14px; line-height: 1.4; font-size: 10.5px; overflow: hidden; }
.g-band .g-who button { padding: 2px 4px; font-size: 10px; } .g-band .g-nm { width: 70px; } .g-band .g-who small { display: none; }
.g-pl { display: flex; flex-direction: column; gap: 3px; margin-top: 3px; }
.g-pl span { position: relative; display: flex; justify-content: space-between; gap: 4px; padding: 2px 5px; border-radius: 6px; overflow: hidden; font-size: 10px; }
.g-pl span i { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--accent) 18%, transparent); border-radius: 6px; }
.g-pl em { position: relative; font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .g-pl b { position: relative; }
@media (max-width: 1100px) { .g-band { grid-template-columns: 1fr 1fr; height: auto; } }
/* "reported N× before" links (signal history / alert repeats) */
.sg-rep { display: inline-block; font-size: 11.5px; color: var(--accent); text-decoration: none; padding: 3px 8px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); line-height: 1.35; }
.sg-rep:hover { border-color: var(--accent); } .sg-rep b { color: inherit; }
.sg-rep.hot { color: var(--high); background: color-mix(in srgb, var(--high) 12%, transparent); border-color: color-mix(in srgb, var(--high) 40%, transparent); }
.sg-rep.none { color: var(--muted); background: var(--panel-2); border-color: var(--line); }
.sg-rep.sm { padding: 1px 6px; font-size: 10.5px; font-weight: 700; }
.rep-box { padding: 4px 10px 6px; }
.sg-pat { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.sg-pat > div { padding: 7px 10px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); font-size: 11.5px; line-height: 1.45; }
.sg-pat b { display: inline-flex; align-items: center; gap: 4px; } .sg-pat ul { margin: 3px 0 0; padding-left: 16px; } .sg-pat p { margin: 3px 0; }
.sg-pat .ic { color: var(--accent); }

.sg-rep .ic { vertical-align: -2px; margin-right: 4px; }
/* ---------- dashboard Fleet map (fleetmap.js) ---------- */
.fm { position: relative; width: 100%; height: 100%; min-height: 200px; border-radius: 10px; overflow: hidden; }
.fm .fm-map { position: absolute; inset: 0; border-radius: 10px; }
.fm-inset { position: absolute; left: 8px; top: 8px; width: 92px; height: 104px; z-index: 450; border-radius: 8px; border: 1px solid var(--line); box-shadow: 0 2px 8px rgba(0,0,0,.25); overflow: hidden; background: #e5e7eb; }
.fm-inset::after { content: 'India'; position: absolute; left: 4px; bottom: 2px; font-size: 9px; font-weight: 700; color: #334155; z-index: 500; }
.fm-leg { position: absolute; left: 8px; bottom: 8px; z-index: 450; display: flex; flex-wrap: wrap; gap: 3px 9px; max-width: 70%; padding: 3px 8px; border-radius: 8px; background: color-mix(in srgb, var(--panel) 92%, transparent); border: 1px solid var(--line); font-size: 10px; }
.fm-leg i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 3px; vertical-align: -1px; } .fm-leg b { margin-left: 2px; }
.fm-bus { filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); cursor: pointer; transition: transform .15s; } .fm-bus:hover { transform: scale(1.25); }
.fm-bus.pulse { animation: fmPulse 1.2s ease-in-out infinite; } @keyframes fmPulse { 50% { transform: scale(1.22); filter: drop-shadow(0 0 6px #dc2626); } }
.fm-plant { display: flex; align-items: center; gap: 4px; white-space: nowrap; cursor: pointer; }
.fm-plant > div { display: flex; flex-direction: column; padding: 1px 6px; border-radius: 8px; background: var(--panel); border: 1px solid var(--accent); box-shadow: 0 2px 6px rgba(0,0,0,.2); font-size: 10px; color: var(--muted); line-height: 1.3; }
.fm-plant b { font-size: 10.5px; color: var(--text); } .fm-plant em { font-style: normal; } .fm-plant .c { color: var(--crit); font-weight: 700; }
.lm-leg { left: 10px; bottom: 26px; z-index: 500; font-size: 10.5px; }
.lm-plant > div { padding: 2px 7px; }
.lm-alert { width: 16px; height: 15px; display: grid; place-items: center; color: #fff; font-size: 10px; font-weight: 900; clip-path: polygon(50% 0, 100% 100%, 0 100%); padding-top: 3px; cursor: pointer; }
.lm-alert.high { background: #f97316; } .lm-alert.critical { background: #dc2626; }
.heat-seg { margin-bottom: 4px; }
.nv-more { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 6px; }
.nv-more .tbl td { vertical-align: middle; }
.vc-conn { display: grid; grid-template-columns: 170px 1fr; gap: 8px; align-items: center; padding: 4px 12px 8px; border-top: 1px solid var(--line); }
.vc-cpie .cn-pie { width: 100%; height: auto; max-height: 112px; }
.vc-cl { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; min-width: 0; } .vc-cl > b { display: flex; align-items: center; gap: 5px; } .vc-cl > b .ic { color: var(--accent); }
.vc-cbig { font-size: 13px; } .vc-cbig span { font-size: 18px; font-weight: 800; } .vc-cbig a { color: var(--accent); font-weight: 700; } .vc-cbig a.c-high { color: var(--high); }
.vc-crow { display: flex; align-items: center; gap: 6px; padding: 2px 6px; border-radius: 6px; color: var(--text); text-decoration: none; font-size: 11px; } .vc-crow:hover { background: var(--panel-2); }
.vc-crow i { width: 9px; height: 9px; border-radius: 50%; flex: none; } .vc-crow b { margin-left: auto; } .vc-crow small { color: var(--muted); width: 52px; text-align: right; }
.vc-bus { min-height: 200px; }
/* backend server panel (server.js) */
.sv-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.sv-steps > div { display: flex; flex-direction: column; gap: 5px; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); font-size: 11.5px; }
.sv-steps b { font-size: 12.5px; } .sv-steps span { color: var(--muted); line-height: 1.4; } .sv-steps .btn { align-self: flex-start; }
@media (max-width: 1100px) { .sv-steps { grid-template-columns: 1fr; } }
/* server ticket detail (server.js ticketDetail) */
.st-d { display: flex; flex-direction: column; gap: 8px; font-size: 12px; }
.st-top { display: flex; align-items: center; gap: 10px; } .st-top > .ic { color: var(--accent); flex: none; }
.st-top > div:nth-child(2) { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; } .st-top b { font-size: 15px; }
.st-score { display: flex; flex-direction: column; align-items: center; padding: 4px 12px; border-radius: 10px; background: var(--panel-2); } .st-score b { font-size: 22px; } .st-score small { color: var(--muted); font-size: 10px; }
.st-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.st-k { padding: 5px 8px; border-radius: 8px; background: var(--panel-2); display: flex; flex-direction: column; } .st-k span { font-size: 10px; color: var(--muted); } .st-k b { font-size: 13.5px; }
.st-mid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; min-height: 0; }
.st-map { position: relative; height: 210px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.st-tl { display: flex; flex-direction: column; gap: 4px; max-height: 210px; overflow: auto; padding-right: 4px; }
.st-ev { display: grid; grid-template-columns: 10px 96px 1fr; gap: 6px; align-items: baseline; position: relative; } .st-ev i { width: 8px; height: 8px; border-radius: 50%; background: var(--high); align-self: center; }
.st-ev.attend i, .st-ev.call i { background: var(--accent); } .st-ev.note i { background: var(--muted); } .st-ev.close i { background: var(--ok); }
.st-ev span { color: var(--muted); font-size: 10.5px; } .st-ev small { grid-column: 3; color: var(--muted); }
.st-past { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; padding-top: 4px; border-top: 1px dashed var(--line); font-size: 11px; }
.st-do { padding: 6px 10px; border-radius: 8px; background: var(--panel-2); } .st-do ol { margin: 3px 0 0; padding-left: 18px; }
.st-act { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-top: 6px; border-top: 1px solid var(--line); }
@media (max-width: 900px) { .st-grid { grid-template-columns: repeat(3, 1fr); } .st-mid { grid-template-columns: 1fr; } }
.st.ack { color: var(--med); background: color-mix(in srgb, var(--med) 14%, transparent); font-weight: 700; }
.st-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
/* Attend console on server tickets (server.js) */
.sa { display: grid; grid-template-columns: 360px 1fr; gap: 8px; height: 100%; min-height: 0; }
.sa-q { display: flex; flex-direction: column; min-height: 0; } .sa-qh { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 12px; flex-wrap: wrap; } .sa-qh b { display: flex; align-items: center; gap: 5px; }
.sa-list { overflow: auto; display: flex; flex-direction: column; gap: 4px; padding: 6px; min-height: 0; }
.sa-it { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); text-align: left; font-size: 11.5px; }
.sa-it > .ic { flex: none; color: var(--accent); } .sa-it > span:nth-child(2) { display: flex; flex-direction: column; flex: 1; min-width: 0; } .sa-it small { color: var(--muted); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-it.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; } .sa-it.due { border-left: 4px solid var(--high); } .sa-it.lv-critical.due { border-left-color: var(--crit); }
.sa-r { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; } .sa-r em { font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--muted); white-space: nowrap; } .sa-it.due .sa-r em { color: var(--high); }
.sa-d { overflow: auto; padding: 10px 12px; min-height: 0; }
.src-seg { margin-left: auto; }
@media (max-width: 1000px) { .sa { grid-template-columns: 1fr; } }
/* server master strip on Vehicles / Drivers pages */
.ms-strip { flex-basis: 100%; display: flex; align-items: center; gap: 8px; padding: 5px 10px; margin-top: 4px; border-radius: 9px; background: color-mix(in srgb, var(--accent) 9%, var(--panel-2)); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); font-size: 11.5px; }
.ms-strip > .ic { color: var(--accent); flex: none; } .ms-strip span { flex: 1; min-width: 0; } .ms-strip .btn { flex: none; }
.page-head:has(.ms-strip) { flex-wrap: wrap; }

/* km + signal loss from the shared server (js/server.js kmNote) */
.ks-note{display:inline-flex;align-items:center;gap:5px;font-size:11px;font-weight:600;color:var(--accent);background:color-mix(in srgb,var(--accent) 10%,transparent);border:1px solid color-mix(in srgb,var(--accent) 25%,transparent);border-radius:999px;padding:2px 9px;white-space:nowrap}

/* full screen: a page (top-bar button) or any window (title-bar button) — js/ui.js pageFull / modal.full */
body.pg-full .app { grid-template-columns: 1fr; grid-template-rows: 1fr; }
body.pg-full .app > .top, body.pg-full .app > .nav { display: none; }
body.pg-full .main { grid-row: 1; grid-column: 1; }
.pg-exit { display: none; }
body.pg-full .pg-exit { display: inline-flex; position: fixed; bottom: 12px; right: 14px; z-index: 40; gap: 5px; box-shadow: 0 4px 14px rgba(0,0,0,.25); opacity: .55; }
body.pg-full .pg-exit:hover { opacity: 1; }
.modal.full { width: 100vw !important; max-width: 100vw !important; height: 100vh !important; max-height: 100vh !important; border-radius: 0; translate: none !important; }
.overlay:has(.modal.full) { padding: 0; }

/* 3D risk matrix on every ticket (js/riskmatrix.js) — CSS 3D boxes, drag to turn */
.rm { display: flex; flex-direction: column; min-height: 0; height: 100%; gap: 4px; }
.rm-stage { flex: 1; min-height: 120px; position: relative; perspective: 900px; overflow: hidden; cursor: grab; touch-action: none; user-select: none; border-radius: 10px; background: radial-gradient(ellipse at 50% 70%, var(--panel-2), transparent 70%); }
.rm-stage.drag { cursor: grabbing; }
.rm-plane { --cell: 40px; --hz: .76px; position: absolute; left: 52%; top: 64%; width: calc(var(--cell) * var(--nc, 4)); height: calc(var(--cell) * var(--nr, 4)); transform-style: preserve-3d;
  transform: translate(-50%, -50%) rotateX(var(--rx, 58deg)) rotateZ(var(--rz, -38deg));
  background: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px var(--cell)), repeating-linear-gradient(0deg, var(--line) 0 1px, transparent 1px var(--cell)), color-mix(in srgb, var(--panel-2) 70%, transparent);
  border: 1px solid var(--line-strong); }
.rm-wall { position: absolute; left: 0; top: 0; width: 100%; height: calc(var(--hz) * 100); transform-origin: top; transform: rotateX(90deg); border: 1px dashed var(--line); background: color-mix(in srgb, var(--panel-2) 35%, transparent); }
.rm-wall-l { width: calc(var(--hz) * 100); height: 100%; transform-origin: left; transform: rotateY(-90deg); }
.rm-th { position: absolute; left: 0; right: 0; bottom: calc(var(--hz) * var(--t)); border-top: 1px dashed var(--line-strong); }
.rm-wall-l .rm-th { top: 0; bottom: 0; left: calc(var(--hz) * var(--t)); right: auto; border-top: 0; border-left: 1px dashed var(--line-strong); }
.rm-wall .rm-th { bottom: auto; top: calc(var(--hz) * var(--t)); }
.rm-th span { position: absolute; right: 2px; top: -12px; font-size: 8.5px; font-weight: 700; color: var(--muted); }
.rm-th.lv-medium span { color: var(--med); } .rm-th.lv-high span { color: var(--high); } .rm-th.lv-critical span { color: var(--crit); }
.rm-bar { --bw: calc(var(--cell) * .62); --h: calc(var(--hz) * var(--s)); --col: var(--low); position: absolute; width: var(--bw); height: var(--bw); transform-style: preserve-3d;
  left: calc(var(--cell) * var(--c) + var(--cell) * .19); top: calc(var(--cell) * (var(--nr, 4) - 1 - var(--r)) + var(--cell) * .19); }
.rm-bar.lv-medium { --col: var(--med); } .rm-bar.lv-high { --col: var(--high); } .rm-bar.lv-critical { --col: var(--crit); }
.rm-bar i { position: absolute; display: block; font-style: normal; backface-visibility: visible; }
.rm-bar .t { inset: 0; transform: translateZ(var(--h)); background: var(--col); display: grid; place-items: center; font-size: calc(var(--cell) * .24); font-weight: 800; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.45); }
.rm-bar .f, .rm-bar .b { left: 0; width: var(--bw); height: var(--h); transform-origin: top; transform: rotateX(90deg); background: color-mix(in srgb, var(--col) 72%, #000); }
.rm-bar .f { top: var(--bw); } .rm-bar .b { top: 0; }
.rm-bar .l, .rm-bar .rr { top: 0; width: var(--h); height: var(--bw); transform-origin: left; transform: rotateY(-90deg); background: color-mix(in srgb, var(--col) 84%, #000); }
.rm-bar .l { left: 0; } .rm-bar .rr { left: var(--bw); }
.rm-bar:not(.me) i { opacity: .5; }
.rm-bar.me i { outline: 2px solid var(--text); outline-offset: -1px; }
.rm-bar.me .t { font-size: calc(var(--cell) * .3); }
.rm-pin { position: absolute; left: 50%; top: 50%; transform-style: preserve-3d; transform: translateZ(calc(var(--h) + 6px)) rotateZ(calc(-1 * var(--rz, -38deg))) rotateX(calc(-1 * var(--rx, 58deg))); pointer-events: none; }
.rm-pin span { position: absolute; left: 0; bottom: 0; transform: translateX(-50%); white-space: nowrap; font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 999px; color: #fff; background: var(--col); box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.rm-xl, .rm-yl { position: absolute; font-size: calc(var(--cell) * .22); color: var(--muted); font-weight: 600; white-space: nowrap; text-align: center; }
.rm-xl { top: calc(100% + 3px); left: calc(var(--cell) * var(--c)); width: var(--cell); }
.rm-yl { right: calc(100% + 4px); top: calc(var(--cell) * (var(--nr, 4) - 1 - var(--r))); height: var(--cell); line-height: var(--cell); }
.rm-xl.on, .rm-yl.on { color: var(--text); font-weight: 800; }
.rm-ax { position: absolute; font-size: calc(var(--cell) * .2); color: var(--faint); white-space: nowrap; }
.rm-ax-x { top: calc(100% + var(--cell) * .42); left: 0; width: 100%; text-align: center; }
.rm-ax-y { right: calc(100% + var(--cell) * .95); top: 50%; transform: translate(50%, -50%) rotate(-90deg); }
.rm-sum { font-size: 11px; line-height: 1.4; flex: none; }
/* ticket window: one screen, no scroll (Drill.detail) */
.modal.ticket { width: min(1560px, 100%); height: 100%; max-height: 900px; }
.modal.ticket .detail { grid-template-columns: 1fr 1.15fr 1fr 1.1fr; }
.modal.ticket .detail > .panel { min-height: 0; overflow: hidden; }
.rm-panel .pb { display: flex; flex-direction: column; min-height: 0; gap: 4px; }
.rm-host { flex: 1; min-height: 0; }
.rm-bands { font-size: 10px; line-height: 1.35; flex: none; }
.modal.ticket .act-col { overflow: hidden; }
/* map full screen (button added to every Leaflet map in js/ui.js) */
.leaflet-bar.map-fs { display: grid; place-items: center; width: 30px; height: 30px; background: var(--panel); color: var(--text); cursor: pointer; }
.leaflet-bar.map-fs:hover { background: var(--panel-2); }
.leaflet-container:fullscreen { width: 100vw !important; height: 100vh !important; border-radius: 0 !important; }
.modal.ticket .clip-pb { flex: 0 1 auto; min-height: 0; overflow: hidden; }
.modal.ticket .past-in { flex: 1; min-height: 0; overflow: hidden; border-top: 1px solid var(--line); }
.modal.ticket .past-in .pb { padding-top: 4px; }
.modal.ticket .act-col .steps li { margin-bottom: 1px; }
.modal.ticket .act-col .pb { padding: 6px 10px; }
.modal.ticket .act-col .ph { padding-top: 6px; padding-bottom: 4px; }
.modal.ticket .act-col .prio { padding: 4px 8px; margin-bottom: 4px; font-size: 12px; }
.modal.ticket .act-col ol.steps { font-size: 11.5px; margin-bottom: 4px; }
.modal.ticket .act-col .call-box { margin-top: 5px; padding: 5px 8px; }
.modal.ticket .act-col .toolbar { gap: 5px; }
.modal.ticket .rep-box { padding: 2px 10px 4px; font-size: 11.5px; }
/* Attend console: bus 3D | risk matrix 3D | what to do — fits one screen */
.modal.attend-m { height: 100%; max-height: 760px; }
.att-mid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr); }
.att-mid .att-3d, .att-rm { height: 200px; }
.att-rm { border: 1px solid var(--line); border-radius: 10px; padding: 2px 6px 4px; overflow: hidden; }
.att-rm .rm-sum { font-size: 10px; }
.att-cur { overflow: hidden; }
/* server ticket: one screen — map | 3D risk matrix | history */
.modal.stk { width: min(1240px, 100%); height: 100%; max-height: 780px; }
.modal.stk .st-d, .sa-d .st-d { height: 100%; min-height: 0; }
.st-mid { grid-template-columns: 1fr 1.1fr 1fr; flex: 1; min-height: 190px; }
.st-map, .st-tl { height: auto; max-height: none; min-height: 0; }
.st-tl { overflow: hidden; }
.st-rm { display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--line); border-radius: 10px; padding: 4px 8px; }
.st-rm > b { font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }
.st-rm .rm-host { flex: 1; min-height: 0; }
.st-rm .rm-sum { font-size: 10px; }
.sa-d { overflow: hidden; }
@media (max-width: 900px) { .st-mid { grid-template-columns: 1fr; } .st-rm { height: 240px; } }
/* generic 3D bar charts (RiskMatrix.bars): colour per bar, value on top */
.rm-bar.cx .t { font-size: calc(var(--cell) * .22); }
.rm-bar.cx { --col: var(--accent); }
.rm-bar.cx.k-ok { --col: var(--low); } .rm-bar.cx.k-warn { --col: var(--med); } .rm-bar.cx.k-high { --col: var(--high); } .rm-bar.cx.k-bad { --col: var(--crit); }
.rm-bar.zero i { opacity: .18 !important; }
.rm-xl.sm { font-size: calc(var(--cell) * .19); overflow: hidden; text-overflow: ellipsis; }

/* closed-tickets bank (js/closedbank.js) — one screen */
.cb { display: grid; grid-template-rows: auto auto minmax(0, 1.25fr) minmax(0, 1fr); gap: 8px; height: 100%; min-height: 0; }
.cb-f { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 11.5px; }
.cb-f input, .cb-f select { height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text); padding: 0 8px; font: inherit; }
.cb-f label { display: inline-flex; gap: 4px; align-items: center; color: var(--muted); }
.cb-q { flex: 1; min-width: 260px; display: flex; align-items: center; gap: 6px; padding: 0 8px; border: 1px solid var(--accent); border-radius: 9px; background: var(--panel); color: var(--accent); }
.cb-q input { flex: 1; border: 0 !important; background: transparent !important; outline: none; }
.cb-k { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.cb-kt { text-align: left; display: flex; flex-direction: column; gap: 1px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: linear-gradient(160deg, var(--panel), var(--panel-2)); color: var(--text); cursor: default; font: inherit; border-left: 4px solid var(--accent); }
.cb-kt[data-k] { cursor: pointer; } .cb-kt[data-k]:hover { border-color: var(--accent); }
.cb-kt span { font-size: 10.5px; color: var(--muted); } .cb-kt b { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .cb-kt small { font-size: 10px; color: var(--muted); }
.cb-kt.ok { border-left-color: var(--low); } .cb-kt.warn { border-left-color: var(--med); }
.cb-mid { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 8px; min-height: 0; }
.cb-mid .panel, .cb-list { min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.cb-mid .pb, .cb-list .pb { flex: 1; min-height: 0; overflow: hidden; }
.cb-3d { padding: 0 !important; }
.cb-life { width: 100%; height: 100%; }
.cb-n { fill: var(--panel-2); stroke: var(--line-strong); } .cb-n.r { stroke: var(--high); } .cb-n.f { stroke: var(--accent); } .cb-n.c { stroke: var(--ok); fill: color-mix(in srgb, var(--ok) 10%, var(--panel-2)); }
.cb-nt { font-size: 12px; font-weight: 800; fill: var(--text); } .cb-ns { font-size: 10px; fill: var(--muted); }
.cb-a { stroke: var(--accent); stroke-width: 2.5; } .cb-ah { fill: var(--accent); } .cb-at { font-size: 11px; font-weight: 800; fill: var(--accent); }
.cb-bar0 { fill: var(--panel-3); } .cb-bar1 { fill: var(--ok); }
.cb-pg { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; }
.cb-tbl td, .cb-tbl th { padding: 4px 8px; font-size: 11.5px; white-space: nowrap; }
.cb-tbl tbody tr { cursor: pointer; } .cb-tbl tbody tr:hover { background: var(--panel-2); }
.cb-tbl a { color: var(--accent); text-decoration: none; } .cb-tbl a:hover { text-decoration: underline; }
.cb-note { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.cb-ct { font-weight: 800; padding: 1px 7px; border-radius: 999px; } .cb-ct.k-ok { color: var(--low); } .cb-ct.k-warn { color: var(--med); } .cb-ct.k-high { color: var(--high); } .cb-ct.k-bad { color: #fff; background: var(--crit); }
.page-head .cb-open { margin-left: 8px; }
/* main ticket window — every figure clickable, colour by level */
.modal.ticket .hd .stat-card { position: relative; border-top: 3px solid var(--accent); background: linear-gradient(170deg, var(--panel), var(--panel-2)); transition: transform .12s, box-shadow .12s; }
.modal.ticket .hd .stat-card[data-go] { cursor: pointer; }
.modal.ticket .hd .stat-card[data-go]:hover, .modal.ticket .hd .stat-card:has(a:hover) { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.18); border-color: var(--accent); }
.modal.ticket .hd .stat-card[data-go]::after { content: '↗'; position: absolute; right: 7px; top: 5px; font-size: 10px; color: var(--faint); }
.modal.ticket .hd .stat-card a { color: inherit; text-decoration: none; border-bottom: 1px dashed var(--line-strong); } .modal.ticket .hd .stat-card a:hover { color: var(--accent); }
.modal.ticket .hd .sc-risk.lv-low { border-top-color: var(--low); } .modal.ticket .hd .sc-risk.lv-medium { border-top-color: var(--med); }
.modal.ticket .hd .sc-risk.lv-high { border-top-color: var(--high); } .modal.ticket .hd .sc-risk.lv-critical { border-top-color: var(--crit); background: linear-gradient(170deg, color-mix(in srgb, var(--crit) 10%, var(--panel)), var(--panel-2)); }
.modal.ticket .hd .sc-dev { border-top-color: var(--high); }
.modal.ticket .detail > .panel { border-top: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.g-tag { font-size: 9px; font-weight: 800; padding: 0 5px; border-radius: 999px; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
[data-drop][hidden], [data-drop-more][hidden] { display: none !important; }
.modal.ticket .past-in svg.schem { max-height: 44px; width: 100%; }
.modal.ticket .past-in .bus12 { padding: 4px 8px; }
/* hover explanation card (UI.tip) */
.htip { position: fixed; left: 0; top: 0; z-index: 5000; display: none; max-width: 320px; padding: 8px 11px; border-radius: 10px; background: var(--panel); color: var(--text); border: 1px solid var(--line-strong); box-shadow: 0 10px 30px rgba(0,0,0,.28); font-size: 11.5px; line-height: 1.45; pointer-events: none; }
.htip b { display: block; font-size: 12.5px; margin-bottom: 3px; color: var(--accent); }
.htip div { color: var(--text); } .htip div + div { margin-top: 1px; }
.htip em { display: block; margin-top: 5px; font-style: normal; font-size: 10.5px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 4px; }
[data-tip] { cursor: help; } button[data-tip], .sp-lay[data-tip], .sp-hr[data-tip], .sp-blk[data-tip], a[data-tip] { cursor: pointer; }

/* ticket score tower (RiskMatrix.mount) — blocks stacked on a 0–100 scale, zones = level */
.rt { display: flex; gap: 8px; height: 100%; min-height: 0; }
.rt-stage { --px: 2px; --bw: 46px; position: relative; flex: 1 1 54%; min-width: 150px; overflow: hidden; cursor: grab; touch-action: none; user-select: none; }
.rt-zones { position: absolute; left: 0; bottom: 14px; width: 44px; height: calc(var(--px) * 100); }
.rz { position: absolute; left: 0; right: 0; bottom: calc(var(--a) * var(--px)); height: calc((var(--b) - var(--a)) * var(--px)); background: color-mix(in srgb, var(--zc) 22%, transparent); border-left: 4px solid var(--zc); display: flex; flex-direction: column; justify-content: center; padding-left: 4px; }
.rz span { font-size: 9.5px; font-weight: 800; color: var(--zc); line-height: 1; } .rz small { position: absolute; bottom: -1px; left: 6px; font-size: 8px; color: var(--muted); }
.rz.on { background: color-mix(in srgb, var(--zc) 40%, transparent); box-shadow: inset 0 0 0 1px var(--zc); }
.rz.lv-low { --zc: var(--low); } .rz.lv-medium { --zc: var(--med); } .rz.lv-high { --zc: var(--high); } .rz.lv-critical { --zc: var(--crit); }
.rt-3d { position: absolute; left: 62px; bottom: 14px; width: var(--bw); height: calc(var(--px) * 100); perspective: 520px; perspective-origin: 50% 0%; }
.rt-scene { position: absolute; inset: 0; transform-style: preserve-3d; transform-origin: 50% 100%; transform: rotateX(var(--rx, -16deg)) rotateY(var(--ry, -32deg)); }
.rt-line { position: absolute; left: -8px; width: calc(var(--bw) * 1.9); bottom: calc(var(--a) * var(--px)); border-top: 1px dashed var(--line-strong); transform: translateZ(calc(var(--bw) * -0.8)); }
.st3 { --c: var(--accent); position: absolute; left: 0; bottom: calc(var(--y) * var(--px)); width: var(--bw); height: calc(var(--h) * var(--px)); transform-style: preserve-3d; }
.st3 i { position: absolute; display: block; }
.st3 .f { inset: 0; background: var(--c); box-shadow: inset 0 1px 0 rgba(255,255,255,.35); }
.st3 .r { top: 0; left: 100%; width: calc(var(--bw) * .8); height: 100%; transform-origin: left; transform: rotateY(90deg); background: color-mix(in srgb, var(--c) 68%, #000); }
.st3 .t { left: 0; top: 0; width: 100%; height: calc(var(--bw) * .8); transform-origin: top; transform: rotateX(-90deg); background: color-mix(in srgb, var(--c) 80%, #fff); }
.st3.lv-low { --c: var(--low); } .st3.lv-medium { --c: var(--med); } .st3.lv-high { --c: var(--high); } .st3.lv-critical { --c: var(--crit); }
.st3.p-rep { --c: #6366f1; } .st3.p-hc { --c: #a855f7; } .st3.p-night { --c: #1e3a8a; } .st3.p-move { --c: #0ea5e9; } .st3.p-floor { --c: #64748b; }
.st3:hover .f { filter: brightness(1.15); }
.rt-labs { position: absolute; left: calc(70px + var(--bw) * 1.8); right: 2px; bottom: 14px; height: calc(var(--px) * 100); pointer-events: none; }
.st-lab { position: absolute; left: 0; right: 0; transform: translateY(50%); font-size: 10.5px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); padding-left: 7px; border-left: 3px solid var(--lc, var(--accent)); }
.st-lab b { color: var(--text); margin-right: 4px; }
.st-lab.p-band { --lc: var(--high); } .st-lab.p-rep { --lc: #6366f1; } .st-lab.p-hc { --lc: #a855f7; } .st-lab.p-night { --lc: #1e3a8a; } .st-lab.p-move { --lc: #0ea5e9; } .st-lab.p-floor { --lc: #64748b; }
.rt-top { position: absolute; left: 50px; bottom: calc(var(--s) * var(--px) + 22px); padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; color: #fff; background: var(--zc, var(--accent)); white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.rt-top.lv-low { --zc: var(--low); } .rt-top.lv-medium { --zc: var(--med); } .rt-top.lv-high { --zc: var(--high); } .rt-top.lv-critical { --zc: var(--crit); }
.rt-side { flex: 1 1 46%; min-width: 0; display: flex; flex-direction: column; gap: 4px; overflow: hidden; font-size: 10.5px; }
.rt-bus { display: flex; gap: 7px; align-items: center; padding: 5px 7px; border-radius: 9px; background: var(--panel-2); color: var(--text); text-decoration: none; border-left: 4px solid var(--gc); }
.rt-bus:hover { background: var(--panel-3); }
.rt-bus .rt-g { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 14px; color: #fff; background: var(--gc); }
.rt-bus b { font-size: 12.5px; } .rt-bus small { display: block; color: var(--muted); font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.rt-bus > span:last-child { min-width: 0; }
.rt-bus.k-ok { --gc: var(--low); } .rt-bus.k-warn { --gc: var(--med); } .rt-bus.k-high { --gc: var(--high); } .rt-bus.k-bad { --gc: var(--crit); }
.rt-ph { font-weight: 700; color: var(--text); font-size: 10.5px; }
.rt-past { display: flex; flex-direction: column; gap: 2px; min-height: 0; }
.rt-past a { display: grid; grid-template-columns: 34px 1fr auto; gap: 4px; align-items: center; padding: 2px 6px; border-radius: 6px; background: var(--panel-2); color: var(--text); text-decoration: none; white-space: nowrap; overflow: hidden; }
.rt-past a:hover { background: var(--panel-3); } .rt-past a span { color: var(--muted); font-variant-numeric: tabular-nums; }
.rt-past a i { font-style: normal; font-size: 9px; font-weight: 800; text-transform: uppercase; color: var(--lvc); }
.rt-past a.lv-low { --lvc: var(--low); } .rt-past a.lv-medium { --lvc: var(--med); } .rt-past a.lv-high { --lvc: var(--high); } .rt-past a.lv-critical { --lvc: var(--crit); }
/* narrow panels: tower on top, bus score + earlier alerts underneath */
.rm-host, .att-rm, .st-rm .rm-host { container-type: size; }
@container (max-width: 430px) {
  .rt { flex-direction: column; gap: 4px; }
  .rt-stage { flex: 1 1 auto; min-height: 110px; min-width: 0; }
  .rt-side { flex: 0 1 auto; max-height: 48%; }
  .rt-bus small { max-width: 100%; }
  .rt-past { flex-direction: row; flex-wrap: wrap; }
  .rt-past a { grid-template-columns: auto auto auto; flex: 1 1 45%; }
}

/* Tickets page: threat analytics band (js/tickana.js) */
.tka { display: grid; grid-template-columns: 1.05fr 1.5fr 1.35fr 1.15fr 1.25fr; gap: 8px; height: 188px; min-height: 0; }
.tka-c { min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; padding: 6px 8px; border-radius: 12px; border: 1px solid var(--line); background: linear-gradient(170deg, var(--panel), var(--panel-2)); }
.tka-h { display: flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 800; color: var(--text); flex: none; }
.tka-h span { margin-left: auto; font-size: 9.5px; font-weight: 500; color: var(--muted); }
.tka-3d { flex: 1; min-height: 0; }
.tka-kp { display: grid; grid-template-rows: repeat(4, 1fr); gap: 4px; padding: 5px; }
.tka-k { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; align-items: center; text-align: left; padding: 2px 8px; border-radius: 8px; border: 0; border-left: 4px solid var(--low); background: var(--panel-2); color: var(--text); font: inherit; cursor: help; }
.tka-k[data-go] { cursor: pointer; } .tka-k:hover { background: var(--panel-3); }
.tka-k span { font-size: 10px; color: var(--muted); } .tka-k b { grid-row: 1 / 3; grid-column: 2; font-size: 18px; } .tka-k small { font-size: 9px; color: var(--muted); }
.tka-k.warn { border-left-color: var(--med); } .tka-k.bad { border-left-color: var(--crit); } .tka-k.bad b { color: var(--crit); }
.tka-off { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; min-height: 0; }
.tka-off a { display: grid; grid-template-columns: 14px minmax(0, 1.1fr) 1fr auto; gap: 5px; align-items: center; color: var(--text); text-decoration: none; padding: 2px 4px; border-radius: 6px; font-size: 10.5px; }
.tka-off a:hover { background: var(--panel-3); } .tka-off a > b { color: var(--muted); font-size: 9.5px; }
.tka-or { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; } .tka-or small { display: block; font-weight: 400; color: var(--muted); font-size: 9px; overflow: hidden; text-overflow: ellipsis; }
.tka-ob { height: 8px; border-radius: 4px; background: var(--panel-3); overflow: hidden; } .tka-ob i { display: block; height: 100%; background: var(--med); border-radius: 4px; } .tka-ob i.hot { background: var(--high); }
.tka-off em { font-style: normal; font-weight: 800; font-size: 11px; }
.tka-empty { font-size: 10.5px; padding: 6px 2px; }
.tka-flow { width: 100%; flex: none; margin-top: 4px; }
.tka-n { fill: var(--panel-2); stroke: var(--line-strong); } .tka-n.c { stroke: var(--accent); } .tka-n.v { stroke: var(--high); fill: color-mix(in srgb, var(--high) 12%, var(--panel-2)); } .tka-n.d { stroke: var(--ok); }
.tka-nt { font-size: 9px; fill: var(--muted); } .tka-nv { font-size: 15px; font-weight: 800; fill: var(--text); } .tka-ns { font-size: 8.5px; fill: var(--muted); }
.tka-a { stroke: var(--accent); stroke-width: 2; } .tka-ah { fill: var(--accent); }
.tka-cont { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; font-size: 10.5px; }
.tka-cont a { padding: 2px 7px; border-radius: 999px; background: color-mix(in srgb, var(--high) 12%, var(--panel-2)); color: var(--text); text-decoration: none; border: 1px solid color-mix(in srgb, var(--high) 35%, transparent); }
.tka-cont a b { color: var(--high); } .tka-cont a i { font-style: normal; color: var(--muted); margin-left: 3px; font-size: 9.5px; }
@media (max-width: 1100px) { .tka { grid-template-columns: repeat(3, minmax(0, 1fr)); height: auto; } .tka-c { height: 170px; } }
.tka-off { gap: 1px; margin-top: 2px; } .tka-off a { padding: 1px 4px; }
.overlay:has(.modal.full) { padding: 0; }
#tipBtn.on { color: var(--accent); }
.tka-svg { width: 100%; height: 100%; display: block; }
.tka-night { fill: color-mix(in srgb, #6366f1 9%, transparent); }
.tka-grid { stroke: var(--line); stroke-dasharray: 3 3; }
.tka-sm { font-size: 9px; fill: var(--muted); } .tka-pk { font-size: 10px; font-weight: 800; fill: var(--text); }
.tka-lb { font-size: 10px; fill: var(--text); } .tka-cnt { font-size: 10.5px; font-weight: 800; fill: var(--text); }
.tka-zero { fill: var(--line-strong); }
.tka-col:hover polygon, .tka-row:hover polygon { filter: brightness(1.15); } .tka-col, .tka-row { cursor: pointer; }
/* Check dashcam clips (js/clipcheck.js) */
.cc { display: flex; flex-direction: column; gap: 8px; height: 100%; min-height: 0; }
.cc-k { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.cc-k div { padding: 6px 10px; border-radius: 10px; background: var(--panel-2); border-left: 4px solid var(--accent); display: flex; flex-direction: column; }
.cc-k div.ok { border-left-color: var(--ok); } .cc-k div.warn { border-left-color: var(--med); } .cc-k div.bad { border-left-color: var(--high); }
.cc-k b { font-size: 20px; } .cc-k span { font-size: 11px; color: var(--muted); }
.cc-why { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--high) 10%, var(--panel-2)); font-size: 12px; }
.cc-t { flex: 1; min-height: 0; overflow: auto; } .cc-p { font-size: 11px; }
.cc-r { font-weight: 700; } .cc-r.ok { color: var(--ok); } .cc-r.warn { color: var(--med); } .cc-r.bad { color: var(--high); }

/* Client report · AI (js/clientreport.js) */
.cr-wrap { display: flex; flex-direction: column; gap: 8px; height: 100%; min-height: 0; }
.cr-doc { flex: 1; min-height: 0; overflow: auto; padding: 4px; }
.cr-aitag { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: #7c3aed; background: color-mix(in srgb, #7c3aed 10%, transparent); border: 1px solid color-mix(in srgb, #7c3aed 30%, transparent); padding: 2px 9px; border-radius: 999px; }
.cr .rp-head { align-items: flex-start; }
.cr-ai { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 12px; border-radius: 12px; background: linear-gradient(160deg, #7c3aed, #1467b3); color: #fff; }
.cr-ai b { font-size: 13px; } .cr-ai small { font-size: 9.5px; opacity: .85; }
.cr-f { margin: 0 0 8px; padding-left: 18px; line-height: 1.55; } .cr-f li { margin: 2px 0; }
.cr-k { grid-template-columns: repeat(4, 1fr); margin-bottom: 8px; }
.cr-k small { color: #50637e; }
.cr-bad { color: #dc2626 !important; } .cr-good { color: #16a34a !important; } .cr-flat { color: #64748b; }
.cr-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0; }
.cr-ch { border: 1px solid #d8e2ee; border-radius: 10px; padding: 6px 8px; } .cr-ch svg { width: 100%; height: auto; display: block; }
.cr-cht { font-size: 11.5px; font-weight: 800; color: #1467b3; }
.cr-t { width: 100%; border-collapse: collapse; font-size: 11.5px; } .cr-t th, .cr-t td { padding: 4px 7px; border-bottom: 1px solid #e5ebf3; text-align: left; } .cr-t th { background: #f1f5fb; color: #334155; font-size: 11px; }
.cr-t td.num, .cr-t th.num { text-align: right; } .cr-t td small { margin-left: 4px; font-size: 9.5px; }
.cr-a { padding-left: 20px; line-height: 1.55; } .cr-a li { margin: 4px 0; }
.cr-foot { margin-top: 14px; padding: 8px 10px; border-radius: 10px; background: #f5f3ff; border: 1px solid #ddd6fe; font-size: 10.5px; color: #4c1d95; line-height: 1.5; }
@media print { .cr-doc { overflow: visible; } }
.cr-leg { float: right; font-size: 9.5px; font-weight: 500; color: #64748b; } .cr-leg i { display: inline-block; width: 8px; height: 8px; margin: 0 3px 0 6px; border-radius: 2px; }
.cr-dmeta { font-size: 11px; color: #50637e; margin: 0 0 6px; } .cr-dmeta a { color: #1467b3; font-weight: 700; }
.cr-day { border: 1px solid #ddd6fe; background: #faf8ff; border-radius: 10px; padding: 6px 10px; margin-bottom: 6px; } .cr-day b { color: #4c1d95; font-size: 12px; }

/* AI command brief (js/aibrief.js) */
.ab { display: flex; flex-direction: column; height: 100%; min-height: 0; gap: 6px; }
.ab-tabs { display: flex; gap: 4px; align-items: center; flex: none; }
.ab-tabs button { border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font: inherit; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; cursor: pointer; }
.ab-tabs button.on { background: linear-gradient(160deg, #7c3aed, var(--accent)); color: #fff; border-color: transparent; }
.ab-ai { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 800; color: #7c3aed; }
.ab-b { flex: 1; min-height: 0; overflow: hidden; }
.ab-ov { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 6px; height: 100%; }
.ab-c4 { min-height: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; padding: 5px 7px; background: linear-gradient(170deg, var(--panel), var(--panel-2)); cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.ab-c4:hover { border-color: var(--accent); }
.ab-c4.ab-act { border-left: 3px solid var(--crit); }
.ab-h { display: flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 800; color: var(--text); flex: none; } .ab-h span { margin-left: auto; font-size: 10px; color: var(--muted); font-weight: 700; }
.ab-r, .ab-a { display: flex; align-items: center; gap: 7px; padding: 3px 5px; border-radius: 8px; text-decoration: none; color: var(--text); background: var(--panel-2); }
.ab-r:hover, .ab-a:hover { background: var(--panel-3); }
.ab-g { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-size: 12.5px; background: var(--gc); box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.ab-g.lv-critical { --gc: var(--crit); } .ab-g.lv-high { --gc: var(--high); } .ab-g.lv-medium { --gc: var(--med); } .ab-g.lv-low { --gc: var(--low); }
.ab-rt { flex: 1; min-width: 0; font-size: 11px; line-height: 1.25; } .ab-rt small { color: var(--muted); } .ab-rt em { display: block; font-style: normal; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-a { border-left: 3px solid var(--lvc, var(--accent)); } .ab-a.lv-critical { --lvc: var(--crit); } .ab-a.lv-high { --lvc: var(--high); } .ab-a.lv-medium { --lvc: var(--med); }
.ab-a > svg { color: var(--lvc, var(--accent)); flex: none; } .ab-a span { min-width: 0; font-size: 11px; line-height: 1.25; } .ab-a small { display: block; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-ks { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.ab-k { padding: 3px 7px; border-radius: 8px; background: var(--panel-2); border-left: 3px solid var(--low); display: flex; flex-direction: column; line-height: 1.2; }
.ab-k span { font-size: 9.5px; color: var(--muted); } .ab-k b { font-size: 15px; } .ab-k b small { font-size: 10px; color: var(--muted); } .ab-k > small { font-size: 9.5px; color: var(--muted); }
.ab-k.warn { border-left-color: var(--med); } .ab-k.bad { border-left-color: var(--crit); } .ab-k.bad b { color: var(--crit); }
.ab-list { display: flex; flex-direction: column; gap: 4px; height: 100%; overflow: hidden; }
.ab-full { display: flex; flex-direction: column; gap: 5px; height: 100%; overflow: hidden; }
.ab-ln { display: flex; gap: 6px; align-items: flex-start; font-size: 11px; color: var(--text); } .ab-ln > svg { color: var(--accent); flex: none; margin-top: 1px; } .ab-ln a { color: var(--accent); }
.ab-c { color: var(--crit); } .ab-e { font-size: 11px; padding: 6px; }
/* chart click → analytics on top, details underneath (UI.chartDetail) */
.cdt { display: flex; flex-direction: column; gap: 8px; }
.cdt-ks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cdt-k { padding: 6px 10px; border-radius: 10px; background: var(--panel-2); border-left: 4px solid var(--accent); display: flex; flex-direction: column; }
.cdt-k span { font-size: 10.5px; color: var(--muted); } .cdt-k b { font-size: 18px; } .cdt-k small { font-size: 10px; color: var(--muted); } .cdt-k.hot { border-left-color: var(--high); }
.cdt-c { height: 200px; position: relative; } .cdt-h { margin: 2px 0 0; font-size: 12px; color: var(--accent); }
.cdt-t { max-height: 240px; overflow: auto; } .cdt-on td { background: color-mix(in srgb, var(--high) 14%, transparent); font-weight: 700; }
.tka-cv { font-size: 8px; font-weight: 700; fill: var(--text); }
/* frequent routes (js/routelearn.js) + MapView */
.lr-tag.ok { color: #16a34a; border-color: color-mix(in srgb, #16a34a 40%, transparent); background: color-mix(in srgb, #16a34a 10%, transparent); }
.site-dot.rs-a { background: #16a34a; color: #fff; } .site-dot.rs-b { background: #dc2626; color: #fff; }
.rs-stop { width: 18px; height: 18px; border-radius: 50%; background: #16a34a; color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.mv { display: flex; flex-direction: column; height: 100%; gap: 6px; } .mv .map { flex: 1; min-height: 0; border-radius: 10px; } .mv-leg { font-size: 11px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
/* ticket validation (js/validation.js) */
.vl-chip { display: inline-block; font-size: 9.5px; font-weight: 800; padding: 1px 7px; border-radius: 999px; color: var(--vc); border: 1px solid color-mix(in srgb, var(--vc) 45%, transparent); background: color-mix(in srgb, var(--vc) 12%, transparent); white-space: nowrap; }
.vl-chip.pending { --vc: var(--med); }
.vl-f { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; } .vl-def { grid-column: 1 / -1; font-size: 10.5px; color: var(--muted); line-height: 1.35; }
.att-close { flex-wrap: wrap; } .att-val { flex: 1 1 100%; } .att-val .vl-f { margin-top: 0; }
.tk-val .vl-f { margin: 4px 0 6px; }
.vl-m { display: flex; flex-direction: column; gap: 8px; } .vl-c { border: 1px solid var(--line); border-left: 4px solid var(--vc); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.vl-ch { display: flex; gap: 8px; align-items: center; font-size: 11px; color: var(--muted); }
.st-val { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; } .st-val .vl-f { flex: 1; margin-top: 0; }
/* shifts (js/shifts.js) */
.ab-ks.ab-k3 { grid-template-columns: repeat(3, 1fr); } .ab-k3 .ab-k b { font-size: 13px; } .ab-k3 .ab-k { padding: 2px 6px; }
.ab-off { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; } .ab-off div { font-size: 10.5px; padding: 2px 6px; border-radius: 6px; background: var(--panel-2); } .ab-off span { display: block; color: var(--muted); font-size: 9.5px; }
.shift-note { padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--med) 14%, transparent); border: 1px solid color-mix(in srgb, var(--med) 40%, transparent); font-size: 12px; margin-bottom: 10px; display: flex; gap: 6px; align-items: flex-start; }
.sh { display: flex; flex-direction: column; gap: 8px; height: 100%; overflow: auto; } .sh-h { margin: 4px 0 0; font-size: 13px; color: var(--accent); }
.sh-k { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; } .sh-k div { padding: 6px 10px; border-radius: 10px; background: var(--panel-2); border-left: 4px solid var(--accent); display: flex; flex-direction: column; } .sh-k span { font-size: 10.5px; color: var(--muted); } .sh-k b { font-size: 18px; }
.sh-t tfoot td { font-weight: 700; border-top: 2px solid var(--line-strong); } .sh-t tr.on td { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.sh-sla { font-weight: 800; } .sh-sla.ok { color: var(--ok); } .sh-sla.warn { color: var(--med); } .sh-sla.bad { color: var(--crit); }
/* ticket risk gauge (RiskMatrix.mount) — equal halves: gauge on top, bus safety + earlier alerts below */
.rt-stage.rg { display: flex; gap: 6px; align-items: center; cursor: default; overflow: hidden; }
.rg-svg { flex: 1.25 1 0; min-width: 0; height: 100%; max-height: 100%; }
.rg-zt { font-size: 7.5px; font-weight: 800; fill: #fff; } .rg-tk { font-size: 7px; fill: var(--muted); }
.rg-pc { font-size: 24px; font-weight: 900; } .rg-lv { font-size: 7.5px; font-weight: 800; fill: var(--muted); letter-spacing: .04em; }
.rg-l { flex: 1 1 0; min-width: 0; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 10.5px; }
.rg-l li { display: grid; grid-template-columns: 8px auto 1fr auto; gap: 5px; align-items: center; padding: 2px 5px; border-radius: 6px; background: var(--panel-2); }
.rg-l li i { width: 8px; height: 8px; border-radius: 2px; } .rg-l li span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); } .rg-l li em { font-style: normal; font-weight: 800; color: var(--text); }
.rg-l li.rg-h { display: block; background: transparent; font-size: 11px; padding: 0 2px; } .rg-l li.rg-h b { font-size: 16px; }
.rt { flex-direction: column; } .rt-stage { flex: 1 1 50% !important; min-height: 0 !important; } .rt-side { flex: 1 1 50% !important; max-height: none !important; }
@container (max-width: 430px) { .rt-stage.rg { flex-direction: row; } }
/* master search (js/search.js) */
.ms-pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px 0 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.ms-pill:hover { border-color: var(--accent); color: var(--text); } .ms-pill kbd, .ms-in kbd { font: inherit; font-size: 10px; padding: 1px 5px; border-radius: 5px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); }
.ms { display: flex; flex-direction: column; gap: 8px; }
.ms-in { display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 2px solid var(--accent); border-radius: 12px; background: var(--panel); color: var(--accent); }
.ms-in input { flex: 1; height: 42px; border: 0; outline: none; background: transparent; color: var(--text); font: inherit; font-size: 15px; }
.ms-r { max-height: 56vh; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.ms-g { font-size: 10.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 6px 2px 2px; } .ms-g span { color: var(--accent); }
.ms-i { display: flex; align-items: center; gap: 9px; padding: 6px 9px; border-radius: 9px; cursor: pointer; } .ms-i > svg { color: var(--accent); flex: none; }
.ms-i span { flex: 1; min-width: 0; } .ms-i b { font-size: 12.5px; } .ms-i small { display: block; color: var(--muted); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-i.on, .ms-i:hover { background: color-mix(in srgb, var(--accent) 12%, var(--panel-2)); }
.ms-e { padding: 18px; text-align: center; color: var(--muted); font-size: 12px; } .ms-f { font-size: 10.5px; }
.ms-i .chip { flex: none; width: auto; }
.ms-u { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 11px; color: #7c3aed; font-weight: 700; margin: 2px 2px 4px; } .ms-u span { padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, #7c3aed 12%, transparent); border: 1px solid color-mix(in srgb, #7c3aed 30%, transparent); }
.ms-i.best { border-left: 3px solid #7c3aed; background: color-mix(in srgb, #7c3aed 6%, transparent); }

/* live cams: bus status lights */
.cl-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--faint); flex: none; }
.cl-dot.green { background: #16a34a; box-shadow: 0 0 0 3px color-mix(in srgb, #16a34a 25%, transparent); animation: clPulse 2s ease-in-out infinite; }
.cl-dot.red { background: #dc2626; box-shadow: 0 0 0 3px color-mix(in srgb, #dc2626 22%, transparent); }
.cl-dot.amber { background: #f59e0b; } .cl-dot.off { background: #94a3b8; }
@keyframes clPulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, #16a34a 0%, transparent); } }
.cl-leg { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; font-size: 10.5px; color: var(--muted); }
.cl-txt { font-size: 11px; font-weight: 600; margin-left: 6px; } .cl-txt.green { color: #16a34a; } .cl-txt.red { color: #dc2626; } .cl-txt.amber { color: #d97706; } .cl-txt.off { color: var(--muted); }
.live-note2:empty { display: none; }

/* left menu badge (New pings) */
.nav a { position: relative; }
.nav-badge { position: absolute; top: 1px; right: 4px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px; background: #f97316; color: #fff; font-size: 9.5px; font-weight: 800; line-height: 15px; text-align: center; box-shadow: 0 0 0 2px var(--panel); animation: npPulse 1.6s ease-in-out infinite; }
@keyframes npPulse { 50% { transform: scale(1.12); } }

/* control-room officers */
.kpis.k8 { grid-template-columns: repeat(var(--kc, 9), minmax(0, 1fr)); }
.of-p { display: grid; grid-template-rows: auto minmax(0, 1fr) minmax(0, 0.9fr); gap: 10px; height: 100%; min-height: 0; }
.of-top { display: flex; gap: 14px; align-items: center; }
.of-sum { display: grid; gap: 4px; } .of-sum b { font-size: 14px; } .of-sum span { font-size: 12.5px; } .of-sum small { font-size: 11px; color: var(--muted); }
.of-rv { font-size: 22px; font-weight: 800; } .of-rl { font-size: 10px; fill: var(--muted); font-weight: 600; }
.of-mid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 10px; min-height: 0; }
.of-parts { overflow: auto; min-height: 0; border: 1px solid var(--line); border-radius: 10px; }
.of-chart { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; } .of-chart > b { font-size: 12px; }
.of-bar { display: inline-block; width: 90px; height: 7px; border-radius: 4px; background: var(--line); overflow: hidden; vertical-align: middle; } .of-bar i { display: block; height: 100%; }
.ofp-why { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; overflow: auto; min-height: 0; } .ofp-why > b { font-size: 12.5px; display: flex; gap: 6px; align-items: center; color: var(--high); }
.of-wg { padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 12px; }
.of-tl { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.of-t { font: inherit; font-size: 11px; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); cursor: pointer; } .of-t:hover { border-color: var(--accent); }
.of-rights { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px 14px; font-size: 12.5px; margin-top: 4px; }
.of-board { display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px; flex: 1; min-height: 360px; }
.of-tg { display: grid; gap: 10px; }
.of-p > * { min-width: 0; width: 100%; } .ofp-why { grid-column: 1 / -1; }
.kpis.k8 .kt-m { padding: 0 3px; font-size: 9.5px; gap: 2px; } .kpis.k8 .kt-m b { font-size: 10px; } .kpis.k8 .kt-r { gap: 3px; } .kpis.k8 .kt-l { font-size: 11px; } .kpis.k8 .kt { padding: 7px 8px 6px; }

/* upload window (Google Sheet / Excel / CSV / PDF) */
.im { display: grid; grid-template-rows: auto auto auto auto minmax(0, 1fr) auto; gap: 8px; height: 100%; min-height: 0; }
.im-src { display: grid; grid-template-columns: 1fr 1.6fr 1.2fr; gap: 8px; }
.im-box { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: grid; gap: 6px; align-content: start; } .im-box > b { display: flex; gap: 6px; align-items: center; font-size: 13px; } .im-box > span { font-size: 11.5px; color: var(--muted); }
.im-msg { font-size: 12.5px; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--med); background: color-mix(in srgb, var(--med) 10%, transparent); }
.im-map { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: end; font-size: 11.5px; } .im-map > b { width: 100%; font-size: 12px; } .im-map label { display: grid; gap: 2px; }
.im-sum { font-size: 12.5px; } .im-prev { overflow: auto; min-height: 0; } .im-bad td { color: var(--high); }

/* daily report 09:00 → 09:00 */
.dr { display: flex; flex-direction: column; gap: 8px; height: 100%; min-height: 0; }
.dr-cl { display: inline-flex; align-items: center; gap: 6px; } .dr-cl img { height: 18px; max-width: 60px; object-fit: contain; background: #fff; border-radius: 4px; padding: 1px 3px; }
.dr-cfg { display: grid; gap: 8px; overflow: auto; }
.dr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.dr-sec { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--panel-2); } .dr-sec.off { opacity: .55; }
.dr-sh { display: flex; gap: 6px; align-items: center; font-size: 12.5px; } .dr-fs { display: grid; gap: 2px; margin-top: 5px; padding-left: 20px; font-size: 11.5px; color: var(--muted); }
.dr-head { display: flex; align-items: center; gap: 16px; } .dr-title { flex: 1; } .dr-title h1 { margin: 0 0 4px; }
.dr-clogo { height: 46px; max-width: 160px; object-fit: contain; } .dr-llogo { height: 40px; }
#drBanner { position: fixed; bottom: 64px; right: 16px; z-index: 2500; display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 12px; border-radius: 12px;
  background: var(--panel); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: 0 10px 30px rgba(0,0,0,.18), inset 0 3px 0 var(--accent); max-width: min(560px, calc(100vw - 32px)); animation: drIn .4s ease; }
#drBanner img { height: 26px; max-width: 80px; object-fit: contain; background: #fff; border-radius: 5px; padding: 2px 4px; }
#drBanner > div { display: grid; font-size: 12px; min-width: 0; } #drBanner b { font-size: 13px; } #drBanner span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dr-b-ic { color: var(--accent); display: grid; }
@keyframes drIn { from { opacity: 0; transform: translateY(10px); } }
@media print { #drBanner { display: none; } }
.dr, .dr-cfg { min-width: 0; max-width: 100%; } .dr-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* alarm buzzer bar */
#buzzBar { position: fixed; top: 56px; left: 50%; transform: translateX(-50%); z-index: 2800; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px; border-radius: 14px;
  background: var(--panel); border: 2px solid var(--high); box-shadow: 0 14px 40px rgba(0,0,0,.3); max-width: min(900px, calc(100vw - 32px)); }
#buzzBar.lv-critical { border-color: var(--crit); }
#buzzBar > div { display: grid; min-width: 0; } #buzzBar b { font-size: 15px; letter-spacing: .02em; } #buzzBar span { font-size: 12px; color: var(--muted); }
.bz-ic { color: var(--high); display: grid; animation: bzShake .5s ease-in-out infinite; } #buzzBar.lv-critical .bz-ic { color: var(--crit); }
#buzzBar.night { animation: bzFlash 1s steps(2, start) infinite; }
@keyframes bzShake { 25% { transform: rotate(-14deg); } 75% { transform: rotate(14deg); } }
@keyframes bzFlash { 50% { background: color-mix(in srgb, var(--crit) 22%, var(--panel)); } }
@media print { #buzzBar { display: none; } }

/* incoming data sources per client */
.ds { display: grid; gap: 8px; margin-top: 8px; } .ds-h { display: grid; gap: 2px; font-size: 12.5px; } .ds-h .muted { font-size: 11.5px; }
.ds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.ds-c { border: 1px solid var(--line); border-radius: 10px; padding: 7px 9px; display: grid; gap: 4px; background: var(--panel-2); opacity: .65; } .ds-c.on { opacity: 1; border-color: color-mix(in srgb, var(--ok) 55%, var(--line)); }
.ds-t { display: flex; gap: 6px; align-items: center; font-size: 12.5px; } .ds-c small { color: var(--muted); font-size: 10.5px; } .ds-c .inp { font-size: 11.5px; padding: 3px 6px; }
.ds-hist { font-size: 11.5px; margin-top: 8px; } .ds-hist div { padding: 2px 0; border-bottom: 1px dashed var(--line); }

/* reverse API */
.ra { display: grid; gap: 10px; } .ra-body { min-height: 200px; } .ra-lead { margin: 4px 2px 0; font-size: 12.5px; }
.ra-grid { display: grid; grid-template-columns: minmax(250px, 320px) 1fr; gap: 12px; align-items: start; }
.ra-card { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 7px; background: var(--panel-2); font-size: 12.5px; }
.ra-card label { display: grid; gap: 3px; } .ra-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; } .ra-checks label { display: flex; gap: 5px; align-items: center; }
.ra-list { overflow: auto; max-height: 60vh; } .ra-list tr.off td { opacity: .5; text-decoration: line-through; } .ra-list tr.off td:last-child { text-decoration: none; opacity: 1; }
.ra-url { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .nowrap { white-space: nowrap; }
.ra-once { border: 1px dashed var(--warn, #d08a00); border-radius: 10px; padding: 8px; display: grid; gap: 6px; }
.ra-code { display: block; white-space: pre-wrap; word-break: break-all; font: 11.5px ui-monospace, Menlo, monospace; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.ra-warn { padding: 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.ra-guide { display: grid; gap: 6px; font-size: 12.5px; } .ra-guide h4 { margin: 8px 0 0; } .ra-guide code { font-size: 11.5px; }
.ra-flow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; } .ra-node { padding: 8px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); font-weight: 600; } .ra-arrow { font-size: 11px; color: var(--muted); }
.ra-sub { margin-top: 8px; } .ra-card .ok, .ra-list .ok { color: var(--ok); } .ra-list .bad { color: var(--bad, #c62828); }
/* versions / history */
.hist { display: grid; gap: 8px; } .hist-row { display: grid; grid-template-columns: 140px 1fr; gap: 10px; border-bottom: 1px dashed var(--line); padding-bottom: 7px; font-size: 12px; }
.hist-when { color: var(--muted); } .hist-when b { color: var(--text); } .hist-act { font-weight: 700; text-transform: capitalize; } .hist-t td { padding: 2px 6px; }
.hist-old { color: var(--muted); text-decoration: line-through; } .hist-new { font-weight: 600; }
@media (max-width: 1100px) { .ra-grid { grid-template-columns: 1fr; } .hist-row { grid-template-columns: 1fr; } }

/* Copilot importer */
.cp-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; padding: 6px 8px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 8%, var(--panel-2)); border: 1px solid var(--line); }
.cp-chip { padding: 2px 8px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-size: 11px; }
.cp-why { display: block; color: var(--muted); font-size: 10.5px; margin-top: 1px; } .im-fill { margin-top: 3px; font-size: 11px; }
.im-paste { display: grid; gap: 6px; } .im-paste textarea { font: 12px ui-monospace, Menlo, monospace; }
.im-warn td { background: color-mix(in srgb, var(--warn, #d08a00) 7%, transparent); } .im-odd { color: var(--warn, #d08a00); font-weight: 600; }
.cp-pick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
/* geofences */
.gf-page { grid-template-rows: auto 1fr; } .gf-body { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 12px; min-height: 0; }
.gf-body .panel { min-height: 0; display: flex; flex-direction: column; } .gf-body .pb { flex: 1; min-height: 0; overflow: auto; } .gf-body .map { height: 100%; min-height: 360px; }
.gf-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
tr.gf-off td { opacity: .5; } tr.gf-off td:last-child { opacity: 1; } .gf-body tr[data-g] { cursor: pointer; } .gf-body tr.sel td { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.gf-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; } .gf-wide { grid-column: 1 / -1; } .mono { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; }
@media (max-width: 900px) { .gf-body { grid-template-columns: 1fr; } .gf-form { grid-template-columns: 1fr; } }

.btn.icon-btn { padding-left: 6px; padding-right: 6px; } .btn.icon-btn .ic { margin: 0; }

/* vehicle form: clients + six camera slots */
.vc-t td { padding: 3px 4px; } .vc-t select, .vc-t input { width: 100%; min-width: 70px; font-size: 12px; } .vc-t tr.vc-ended td { opacity: .5; }
.cam-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
.cam-slot { display: grid; grid-template-columns: auto auto auto 1fr auto; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; font-size: 12px; opacity: .6; cursor: pointer; }
.cam-slot:has(input[type=checkbox]:checked), .cam-slot.on:not(:has(input[type=checkbox]:not(:checked))) { opacity: 1; border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.cam-n { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700; }
.cam-slot small { grid-column: 4; } .cam-ch { grid-column: 5; grid-row: 1; display: flex; align-items: center; gap: 2px; color: var(--muted); font-size: 11px; } .cam-ch input { width: 40px; font-size: 11.5px; padding: 1px 3px; }
@media (max-width: 760px) { .cam-slots { grid-template-columns: 1fr; } }
/* carbon */
.cb-page { grid-template-rows: auto auto 1fr; grid-template-columns: minmax(0, 1fr); } .cb-kpis { grid-area: auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.cb-body { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 12px; min-height: 0; } .cb-body .panel { min-height: 0; display: flex; flex-direction: column; } .cb-body .pb { flex: 1; min-height: 0; overflow: auto; }
.cb-bar { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 12px; margin: 5px 0; } .cb-bar i { display: block; height: 10px; border-radius: 5px; background: var(--ok); }
@media (max-width: 900px) { .cb-kpis { grid-template-columns: 1fr 1fr; } .cb-body { grid-template-columns: 1fr; } }

/* trips */
.tp-set { display: grid; gap: 10px; font-size: 12.5px; } .tp-on { display: flex; gap: 6px; align-items: center; }
.tp-m { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; } .tp-m > b { grid-column: 1 / -1; }
.tp-mc { display: flex; gap: 8px; align-items: flex-start; padding: 7px 9px; border: 1px solid var(--line); border-radius: 10px; opacity: .6; } .tp-mc.on { opacity: 1; border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.tp-mc span { display: grid; } .tp-mc small { color: var(--muted); font-size: 11px; }
.tp-k { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; } .tp-k > div { display: grid; gap: 3px; align-content: start; } .tp-k label { display: flex; gap: 5px; align-items: center; font-size: 12px; }
.tp-page { grid-template-rows: auto auto 1fr; grid-template-columns: minmax(0, 1fr); }
.tp-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.tp-body { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 12px; min-height: 0; } .tp-body .panel { min-height: 0; display: flex; flex-direction: column; } .tp-body .pb { flex: 1; min-height: 0; overflow: auto; }
.tp-row { cursor: pointer; } .tp-row:hover td { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.tp-st { padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--panel-2); border: 1px solid var(--line); white-space: nowrap; }
.tp-st.ok { color: var(--ok); } .tp-st.live { color: var(--accent); } .tp-st.warn { color: var(--warn, #d08a00); } .tp-st.bad { color: var(--high); } .tp-st.muted { color: var(--muted); }
.tp-fl { display: inline-block; margin: 1px 3px 1px 0; padding: 0 6px; border-radius: 6px; font-size: 10.5px; background: color-mix(in srgb, var(--warn, #d08a00) 14%, transparent); white-space: nowrap; }
.tp-fl.crit { background: color-mix(in srgb, var(--crit) 16%, transparent); color: var(--crit); }
.tp-days { display: flex; align-items: flex-end; gap: 4px; height: 170px; } .tp-day { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-size: 10px; }
.tp-day i { display: block; width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; } .tp-day span { color: var(--muted); }
.tp-d { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 12px; } .tp-dl { display: grid; gap: 10px; align-content: start; } .tp-d .tp-map { position: relative; inset: auto; min-height: 380px; border-radius: 12px; }
.tp-tls { display: grid; gap: 2px; } .tp-tl { display: grid; grid-template-columns: 14px 150px 1fr; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.tp-tl i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line); } .tp-tl.on { color: var(--text); } .tp-tl.on i { background: var(--accent); border-color: var(--accent); }
.tp-k2 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .tp-k2 small { font-size: 10.5px; color: var(--muted); font-weight: 400; } .tp-fls { display: flex; flex-wrap: wrap; gap: 4px; }
@media (max-width: 1000px) { .tp-kpis { grid-template-columns: repeat(3, 1fr); } .tp-body, .tp-d { grid-template-columns: 1fr; } .tp-k { grid-template-columns: 1fr; } }

/* portal engine meter */
.eng-m { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); cursor: pointer; font: inherit; color: var(--text); line-height: 1; }
.eng-m span { display: grid; text-align: left; } .eng-m b { font-size: 11.5px; } .eng-m small { font-size: 9.5px; color: var(--muted); }
.eng-m.busy { border-color: color-mix(in srgb, var(--warn, #d08a00) 60%, var(--line)); } .eng-m.high { border-color: var(--high); } .eng-m.high small { color: var(--high); font-weight: 700; }
.eng-p { display: grid; gap: 8px; }

/* 11+ dashboard tiles: titles a touch smaller so every tile still reads in one row */
.kpis.k11 .kt-l { font-size: 10px; letter-spacing: -.1px; } .kpis.k11 .kt-h { gap: 3px; } .kpis.k11 .kt-ic { transform: scale(.9); }

.tp-body tr.sel td { background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* API page: incoming data chart */
#apiDash { padding: 10px 12px; grid-column: 1 / -1; } .ad { display: grid; gap: 8px; font-size: 12px; }
.ad-h { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .ad-h > b { font-size: 13.5px; display: flex; gap: 6px; align-items: center; }
.ad-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; } .ad-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.ad-rows { display: grid; gap: 5px; } .ad-row { display: grid; grid-template-columns: minmax(110px, 200px) 1fr 86px 92px; gap: 10px; align-items: center; }
.ad-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-track { height: 16px; background: var(--panel-2); border-radius: 5px; overflow: hidden; } .ad-bar { height: 100%; display: flex; border-radius: 5px; overflow: hidden; } .ad-bar i { display: block; height: 100%; }
.ad-bar.ad-one { background: #2f6fdb; } .ad-num { display: flex; gap: 6px; align-items: baseline; justify-content: flex-end; } .ad-num b { font-size: 13px; } .ad-num span, .ad-srow > span:last-child { color: var(--muted); font-size: 11px; }
.ad-fleet { text-align: right; } .ad-fleet small { color: var(--muted); }
.ad-src { display: grid; gap: 4px; border-top: 1px dashed var(--line); padding-top: 6px; } .ad-srow { display: grid; grid-template-columns: minmax(110px, 260px) 1fr 44px 70px; gap: 10px; align-items: center; } .ad-srow .ad-track { height: 10px; } .ad-srow b { text-align: right; }
@media (max-width: 760px) { .ad-row { grid-template-columns: 1fr 70px; } .ad-row .ad-track { grid-column: 1 / -1; grid-row: 2; } .ad-fleet { display: none; } .ad-srow { grid-template-columns: 1fr 44px; } .ad-srow .ad-track, .ad-srow > span:last-child { display: none; } }

/* errors ledger */
#errPanel { grid-column: 1 / -1; } .er-ks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.er-k { border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; display: grid; background: var(--panel-2); } .er-k span { font-size: 11px; color: var(--muted); } .er-k b { font-size: 20px; } .er-k small { font-size: 10.5px; color: var(--muted); }
.er-k.ok b { color: var(--ok); } .er-k.warn b { color: var(--warn, #d08a00); }
.er-bar { height: 8px; border-radius: 5px; background: color-mix(in srgb, var(--warn, #d08a00) 35%, var(--panel-2)); overflow: hidden; margin-bottom: 8px; } .er-bar i { display: block; height: 100%; background: var(--ok); }
.er-t td { vertical-align: top; } .er-why { font-size: 11.5px; max-width: 280px; } .er-ex { font-size: 10.5px; max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.er-h { padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; } .er-h.auto { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); } .er-h.person { color: var(--warn, #d08a00); background: color-mix(in srgb, var(--warn, #d08a00) 14%, transparent); }
.er-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); cursor: pointer; font: inherit; color: var(--text); line-height: 1; }
.er-chip span { display: grid; text-align: left; } .er-chip b { font-size: 11.5px; } .er-chip small { font-size: 9.5px; color: var(--muted); } .er-chip.warn { border-color: color-mix(in srgb, var(--warn, #d08a00) 60%, var(--line)); } .er-chip.warn .ic { color: var(--warn, #d08a00); } .er-chip.ok .ic { color: var(--ok); }
@media (max-width: 900px) { .er-ks { grid-template-columns: 1fr 1fr; } }

/* everything is a link */
td.lk { color: var(--accent); cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; } td.lk:hover { text-decoration-style: solid; }
td.lk-num { cursor: pointer; } td.lk-num:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.lk-rec th { text-align: left; width: 40%; color: var(--muted); font-weight: 500; } .lk-rec td.lk-hit { font-weight: 700; color: var(--accent); }
a.lk-kpi { text-decoration: none; color: inherit; cursor: pointer; } a.lk-kpi:hover { border-color: var(--accent); }

/* data science */
.ds-tabs { grid-column: 1 / -1; margin-bottom: 2px; } .ds-tabs .seg button { display: inline-flex; gap: 5px; align-items: center; }
.ds-page { grid-template-rows: auto auto 1fr; grid-template-columns: minmax(0, 1fr); } .ds-head h2 { margin: 0; display: flex; gap: 6px; align-items: center; font-size: 17px; }
.ds-box { min-height: 0; overflow: auto; } .ds-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; font-size: 12px; }
.ds-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 12px; } .ds-wide { grid-column: 1 / -1; }
.ds3d { width: 100%; height: auto; display: block; } .ds3d-bar { cursor: pointer; } .ds3d-bar:hover rect, .ds3d-bar.on rect { filter: brightness(1.12); stroke: var(--text); stroke-width: 1.2; }
.ds3d-v { font: 700 11px system-ui, sans-serif; fill: var(--text); } .ds3d-l { font: 600 10px system-ui, sans-serif; fill: var(--text); } .ds3d-s { font: 9px system-ui, sans-serif; fill: var(--muted); }
.ds-bands { display: flex; gap: 8px; margin-bottom: 6px; } .ds-bands a { flex: 1; display: grid; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); border-left: 4px solid var(--c); text-decoration: none; color: var(--text); background: var(--panel-2); }
.ds-bands b { font-size: 20px; } .ds-bands span { font-size: 11px; color: var(--muted); }
.ds-hb { display: grid; gap: 4px; } .ds-hbr { display: grid; grid-template-columns: minmax(90px, 170px) 1fr auto; gap: 8px; align-items: center; font-size: 11.5px; cursor: pointer; padding: 1px 3px; border-radius: 6px; } .ds-hbr:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.ds-hbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .ds-hbt { position: relative; height: 12px; background: var(--panel-2); border-radius: 4px; } .ds-hbt i { display: block; height: 100%; border-radius: 4px; } .ds-hbt em { position: absolute; top: -2px; width: 2px; height: 16px; background: var(--text); opacity: .55; }
.ds-big { font-size: 13px; font-weight: 600; margin: 6px 2px 0; } .ds-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } .ds-adv li { margin: 3px 0; font-size: 12.5px; }
.ds-why { font-size: 11px; max-width: 380px; } .ds-map { height: 220px; border-radius: 10px; margin: 8px 0; position: relative; }
.ds-basis { margin-top: 10px; border: 1px dashed var(--line); border-radius: 10px; padding: 8px 12px; font-size: 12px; background: var(--panel-2); } .ds-basis summary { cursor: pointer; font-weight: 700; display: flex; gap: 6px; align-items: center; } .ds-basis li { margin: 4px 0; }
.ds-ins { display: grid; gap: 10px; } .ds-in { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--panel); } .ds-in-h { display: flex; gap: 8px; align-items: center; } .ds-in-h b { flex: 1; font-size: 13.5px; }
.ds-in-b { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; font-size: 12px; } .ds-in-b span { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin-bottom: 2px; }
@media (max-width: 1000px) { .ds-grid, .ds-two, .ds-in-b { grid-template-columns: 1fr; } }

.ds-tabs.inline { display: inline-block; margin: 0 0 0 8px; grid-column: auto; vertical-align: middle; } .ds-tabs.inline .seg button[data-dst="safety"] { display: none; }

/* report header: company + LCS Logistics Control Tower Daily Operations Report */
.dr-title h1 { display: grid; gap: 2px; } .dr-co { font-size: 1.15em; } .dr-name { font-size: .62em; font-weight: 600; letter-spacing: .2px; opacity: .85; }

/* issue desk */
.is-chip { display: inline-flex; gap: 4px; align-items: center; } .is-chip button { font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 999px; line-height: 1; }
.is-rep { display: inline-flex; gap: 4px; align-items: center; padding: 5px 10px; font-size: 11.5px !important; font-weight: 600; } .is-rep:hover { border-color: var(--accent); color: var(--accent); }
.is-tot { display: inline-flex; gap: 8px; padding: 2px 9px; } .is-tot span { display: grid; text-align: center; } .is-tot b { font-size: 11.5px; } .is-tot small { font-size: 9.5px; color: var(--muted); } .is-tot.has { border-color: color-mix(in srgb, var(--warn, #d08a00) 60%, var(--line)); }
.is-list { display: grid; gap: 10px; margin-top: 10px; } .is-card { border: 1px solid var(--line); border-left: 4px solid var(--warn, #d08a00); border-radius: 10px; padding: 10px 12px; background: var(--panel); display: grid; gap: 5px; }
.is-card.in-progress { border-left-color: var(--accent); } .is-card.closed { border-left-color: var(--ok); opacity: .92; }
.is-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; } .is-st { padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--panel-2); }
.is-st.open { color: var(--warn, #d08a00); } .is-st.in-progress { color: var(--accent); } .is-st.closed { color: var(--ok); } .is-urg { padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 700; color: #fff; background: var(--crit); }
.is-sub { font-weight: 700; font-size: 13.5px; } .is-det { white-space: pre-wrap; font-size: 12.5px; } .is-who { font-size: 11.5px; display: flex; gap: 4px; align-items: center; }
.is-resp { background: color-mix(in srgb, var(--ok) 8%, var(--panel-2)); border-radius: 8px; padding: 6px 9px; font-size: 12.5px; white-space: pre-wrap; } .is-resp span { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.is-act { display: grid; gap: 6px; } .is-act textarea { width: 100%; font: inherit; font-size: 12.5px; }
/* top bar fits one line up to 1408 px with every chip (engine, errors, issues) — nothing removed, only tighter */
header.top .is-rep, header.top .is-tot, header.top .er-chip, header.top .eng-m { white-space: nowrap; flex: none; }
@media (max-width: 1600px) {
  header.top { gap: 5px; }
  header.top .seg button { padding: 4px 6px; font-size: 11.5px; }
  header.top .ms-pill { padding: 0 8px; } header.top .ms-pill > :not(svg) { display: none; }
  header.top .eng-m small, header.top .er-chip small, header.top .is-tot small { display: none; }
  header.top .eng-m { padding: 2px 6px 2px 3px; } header.top .eng-m svg { width: 30px; height: 18px; }
  header.top .er-chip span + span::before, header.top .is-tot span + span::before { content: '·'; margin-right: 3px; color: var(--muted); }
  header.top .er-chip span, header.top .is-tot span { display: inline; }
  header.top .is-tot b::after { content: ' open'; font-weight: 400; color: var(--muted); font-size: 10.5px; } header.top .is-tot span + span b::after { content: ' closed'; }
  header.top .brand { min-width: 0; flex-shrink: 1; } header.top .brand .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  header.top .brand img { max-height: 28px; }
  header.top .feed { padding-left: 6px; padding-right: 6px; }
}
@media (max-width: 1600px) {
  header.top .brand .title { min-width: 150px; font-size: 12.5px; line-height: 1.15; }   /* the title always shows (two short lines if needed) */
  header.top .brand .title small { font-size: 10px; }
  header.top .is-rep { padding: 5px 8px; } header.top .seg button { padding: 4px 5px; }
}
@media (max-width: 1600px) {
  header.top { gap: 3px; }
  header.top .brand { flex: none; min-width: auto; overflow: visible; } header.top .brand .title { min-width: 0; max-width: 132px; font-size: 11.5px; }
  header.top .seg button { font-size: 11px; padding: 4px 5px; }
  header.top .icon-btn { width: 27px; min-width: 27px; padding: 0; }
  header.top .is-tot { padding: 2px 7px; font-size: 10.5px; }
}
@media (max-width: 1600px) { header.top #talkBtn .tb-l { display: none; } header.top #talkBtn { padding: 0 8px; } }
@media (max-width: 1600px) {
  /* counts stacked (number above a tiny label) — narrower than one line, still says open / closed */
  header.top .er-chip span, header.top .is-tot span { display: grid; text-align: center; line-height: 1.05; }
  header.top .er-chip small, header.top .is-tot small { display: block; font-size: 9px; }
  header.top .er-chip span + span::before, header.top .is-tot span + span::before { content: none; }
  header.top .is-tot b::after, header.top .is-tot span + span b::after { content: none; }
  header.top .is-tot { gap: 6px; }
  header.top .client-tag .ct-l { display: none; } header.top .client-tag { padding-left: 6px; padding-right: 6px; }
}
@media (max-width: 1600px) { header.top .er-chip small { display: none; } header.top .er-chip span { display: inline; } header.top .er-chip span + span::before { content: '·'; margin: 0 3px; color: var(--muted); } header.top .er-chip { gap: 3px; padding: 2px 7px; } }
@media (max-width: 1600px) { header.top #remBell { padding-left: 8px; padding-right: 8px; } header.top .is-rep { padding: 5px 7px; font-size: 11px !important; gap: 3px; } }
.dbh-k { grid-template-columns: repeat(5, minmax(0, 1fr)); } .dbh-k .ok b { color: var(--ok); } .dbh-k .warn b { color: var(--warn, #d08a00); } .dbh-k small { display: block; font-size: 10.5px; color: var(--muted); } .dbh-q { max-width: 520px; font-size: 11px; white-space: normal; word-break: break-word; }
.kpis.k12 .kt-l { font-size: 9.5px; letter-spacing: -.2px; } .kpis.k12 .kt-h { gap: 2px; } .kpis.k12 .kt-h .badge, .kpis.k12 .kt-h .kt-badge { transform: scale(.85); transform-origin: right center; } .kpis.k12 .kt { padding-left: 6px; padding-right: 6px; }
.is-bus { display: inline-flex; gap: 3px; align-items: center; font-size: 11.5px; font-weight: 600; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--panel-2); text-decoration: none; }
/* Report issue — highlighted on every page (filled, gentle glow; not red: red is only for danger) */
header.top .is-rep, .is-chip .is-rep { background: linear-gradient(135deg, #7c3aed, #4f46e5) !important; color: #fff !important; border-color: transparent !important; box-shadow: 0 0 0 0 rgba(124, 58, 237, .55); animation: isGlow 2.8s ease-out infinite; }
header.top .is-rep .ic, .is-chip .is-rep .ic { color: #fff; }
header.top .is-rep:hover, .is-chip .is-rep:hover { filter: brightness(1.12); color: #fff !important; }
@keyframes isGlow { 0% { box-shadow: 0 0 0 0 rgba(124, 58, 237, .55); } 70% { box-shadow: 0 0 0 7px rgba(124, 58, 237, 0); } 100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0); } }
@media (prefers-reduced-motion: reduce) { header.top .is-rep, .is-chip .is-rep { animation: none; } }
@media (max-width: 1600px) { header.top .is-rep { padding: 5px 6px; } header.top .is-tot { padding: 2px 6px; } }
/* client rights: switched-off buttons */
.cr-noissue .is-rep { display: none !important; }
.cr-grid .toolbar { flex-wrap: wrap; gap: 4px 14px; }
/* password eye (pwview.js) */
.pwv-wrap { position: relative; vertical-align: middle; }
.pwv-wrap > input { padding-right: 32px !important; box-sizing: border-box; }
.pwv-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted, #8a94a6); cursor: pointer; border-radius: 6px; padding: 0; }
.pwv-btn:hover, .pwv-btn.on { color: var(--accent, #3b82f6); background: color-mix(in srgb, currentColor 12%, transparent); }
.cr-grid .toolbar label { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; white-space: nowrap; margin: 0; }
.cr-grid .toolbar input[type=checkbox] { width: auto; margin: 0; }
/* Trip on-time (js/tripontime.js) — green on time, amber late (red stays for danger) */
.ot-bar { display: flex; overflow: hidden; } .ot-bar i { display: block; height: 100%; } .ot-on { background: var(--ok); } .ot-late { background: var(--warn); border-radius: 0 4px 4px 0; }
.st.ot-ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); } .st.ot-warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.st.ot-bad { background: color-mix(in srgb, var(--warn) 26%, transparent); color: var(--warn); font-weight: 700; } .st.ot-muted { color: var(--muted); }
.ot-lt { color: var(--warn); } .ds-bands a.on { outline: 2px solid var(--c); }
.ec-saved { margin-bottom: 8px; } .ec-rules td, .ec-rules th { padding: 3px 6px; font-size: 11.5px; }
.ec-req button { padding: 2px 10px; font-size: 11.5px; } .ec-off td { opacity: .55; } .ec-off td:first-child, .ec-off td:nth-child(2) { opacity: 1; }
.ec-rules input::placeholder { color: var(--muted); opacity: .55; }
.ec-ct { max-height: calc(100vh - 330px); } .ec-ct td { padding: 3px 6px; font-size: 11.5px; } .ec-rules-wrap, .ec .tbl-wrap:has(.ec-rules) { max-height: calc(100vh - 330px) !important; }
/* Add client: vehicle types, upload cards */
.ec-vt { flex-wrap: wrap; gap: 4px 14px; } .ec-vt label { display: inline-flex; gap: 5px; align-items: center; }
.ec-ups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ec-up { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 4px; background: var(--panel-2); } .ec-up span { font-size: 11.5px; } .ec-up .ec-up-n { font-weight: 700; font-size: 13px; } .ec-up button { justify-self: start; }
/* Add client: tabs wrap onto two lines instead of widening the window; tick boxes sit next to their names */
#ecTabs { display: flex; flex-wrap: wrap; height: auto; max-width: 100%; } .ec { min-width: 0; } .ec-body { min-width: 0; overflow-x: hidden; }
.ec-vt label { white-space: nowrap; font-size: 12.5px; } .ec-vt input[type=checkbox] { width: auto; margin: 0; }
/* Fleet analytics in the 3D bus spot (js/fleetinsight.js) */
.fi { height: 100%; display: flex; flex-direction: column; gap: 6px; padding: 6px 8px; overflow: auto; }
.fi-top { display: flex; gap: 6px; align-items: center; font-size: 12.5px; } .fi-top .muted { font-size: 11px; margin-left: auto; }
.fi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; flex: 1; min-height: 0; }
.fi-box { border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; background: var(--panel-2); min-width: 0; overflow: hidden; }
.fi-h { display: flex; gap: 5px; align-items: center; font-size: 11.5px; margin-bottom: 3px; } .fi-h .muted { margin-left: auto; font-size: 10.5px; }
.fi-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; align-items: center; font-size: 11.5px; padding: 2px 3px; border-radius: 6px; cursor: pointer; }
.fi-row:hover, .fi-t tr:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.fi-row .fi-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .fi-row small { font-size: 10px; white-space: nowrap; }
.fi-row:has(.fi-bar) { grid-template-columns: minmax(70px, 1fr) minmax(40px, 1.2fr) auto auto; }
.fi-bar { height: 7px; background: var(--panel); border-radius: 4px; overflow: hidden; display: block; } .fi-bar i { display: block; height: 100%; border-radius: 4px; }
.fi-t td, .fi-t th { padding: 2px 4px; font-size: 10.5px; } .fi-t tr { cursor: pointer; }
.fi-box:has(.fi-t) { grid-column: 1 / -1; }
/* Add client: vehicle-type drop-down, vehicle search */
.ec-dd { position: relative; } .ec-dd summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; background: var(--panel); font-size: 12.5px; }
.ec-dd summary::-webkit-details-marker { display: none; } .ec-dd summary svg { transform: rotate(-90deg); } .ec-dd[open] summary svg { transform: rotate(90deg); }
.ec-dd-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); max-height: 220px; overflow-y: auto; display: grid !important; gap: 2px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: 0 10px 28px rgba(0,0,0,.25); }
.ec-dd-list label { display: flex !important; gap: 6px; align-items: center; padding: 3px 4px; border-radius: 6px; font-size: 12.5px; } .ec-dd-list label:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); } .ec-dd-list label .muted { font-size: 10.5px; margin-left: auto; }
.ec-dd-all { border-bottom: 1px dashed var(--line); }
.ec-vs-in { display: inline-flex; align-items: center; gap: 6px; flex: 1; min-width: 320px; } .ec-vs-in input { flex: 1; }
.ec-vr { margin: 4px 0 8px; } .ec-untag summary { cursor: pointer; font-size: 11.5px; color: var(--muted); margin: 4px 0; }
/* Live status: client list in the AI brief (scrolls for 200+ clients) */
.ls-cl { margin-top: 6px; border-top: 1px dashed var(--line); padding-top: 4px; } .ls-clh { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; } .ls-clh a { font-size: 11px; }
.ls-cls { max-height: 96px; overflow-y: auto; display: grid; gap: 1px; margin-top: 3px; }
.ls-cr { display: grid; grid-template-columns: minmax(0, 1fr) 46px 52px; gap: 6px; font-size: 11px; color: var(--text); text-decoration: none; padding: 1px 4px; border-radius: 5px; } .ls-cr:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.ls-cr span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .ls-cr small { text-align: right; color: var(--muted); } .ls-cr small.w { color: var(--warn); } .ls-cr small.c { color: var(--high, #dc2626); font-weight: 700; }
.ls-w { color: var(--warn); } .ls-c { color: var(--high, #dc2626); }
/* 13+ dashboard tiles still fit 1408 px */
.kpis.k13 { gap: 4px; } .kpis.k13 .kt { padding: 6px 5px 5px; min-width: 0; } .kpis.k13 .kt-v, .kpis.k13 .kt-big { font-size: 20px; } .kpis.k13 .kt-l { font-size: 9px; } .kpis.k13 .kt-m { font-size: 9px; } .kpis.k13 .kt-m b { font-size: 9.5px; } .kpis.k13 .kt-ic { transform: scale(.82); }
.kpis.k13 .kt * { min-width: 0; } .kpis.k13 .kt-r { overflow: hidden; }
/* header: a little more room at 1408 px when counters grow (super admin) */
@media (max-width: 1600px) { header.top { gap: 4px; column-gap: 4px; } header.top .seg button { padding-left: 5px; padding-right: 5px; } header.top .is-chip .is-tot { padding-left: 5px; padding-right: 5px; } }
/* top bar drop-downs: client (200+, search, scroll) and plant */
.hd-dd { position: relative; flex: none; } .hd-dd-b { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--text); font-size: 12.5px; font-weight: 600; cursor: pointer; max-width: 170px; }
.hd-dd-b span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; } .hd-dd.open .hd-dd-b, .hd-dd-b:hover { border-color: var(--accent); }
.hd-dd-p { display: none; position: absolute; top: calc(100% + 4px); left: 0; z-index: 400; width: 270px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: 0 14px 34px rgba(0,0,0,.28); }
.hd-dd.open .hd-dd-p { display: grid; gap: 5px; } .hd-dd-l { max-height: 300px; overflow-y: auto; display: grid; gap: 1px; }
.hd-dd-l button { text-align: left; border: 0; background: none; color: var(--text); padding: 6px 8px; border-radius: 7px; font-size: 12.5px; cursor: pointer; } .hd-dd-l button:hover { background: color-mix(in srgb, var(--accent) 9%, transparent); } .hd-dd-l button.on { background: var(--accent); color: #fff; } .hd-dd-l small { opacity: .7; font-size: 10.5px; }
.hd-dd-all { font-size: 12px; padding: 5px 8px; border-top: 1px dashed var(--line); display: flex; gap: 5px; align-items: center; }
@media (max-width: 1600px) { .hd-dd-b { max-width: 128px; padding: 0 7px; gap: 4px; font-size: 12px; } .hd-dd-b span { max-width: 78px; } }
/* Add client: its own plants */
.ec-pl { flex-wrap: wrap; gap: 4px 16px; } .ec-pl label { display: inline-flex; gap: 5px; align-items: center; font-size: 12.5px; } .ec-pl input { width: auto; margin: 0; }
.ec-np { border: 1px dashed var(--accent); border-radius: 12px; padding: 8px 10px; margin: 8px 0; background: color-mix(in srgb, var(--accent) 4%, transparent); } .ec-np > b { font-size: 12.5px; display: flex; gap: 5px; align-items: center; }
/* client badge on every alert (control-room logins with several clients) */
.cl-tag { display: inline-block; vertical-align: middle; margin-right: 5px; padding: 1px 7px; border-radius: 6px; background: var(--cc); color: #fff; font-size: 10.5px; font-weight: 800; letter-spacing: .2px; text-transform: uppercase; line-height: 1.5; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; box-shadow: 0 0 0 1px color-mix(in srgb, var(--cc) 40%, transparent); }
.cl-tag.none { background: var(--muted); }
.tix .tt .cl-tag, .att-item .cl-tag, .bz .cl-tag, .rs-txt .cl-tag { font-size: 10px; }
.tix-cl { display: flex; gap: 4px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: thin; }
.tix-cl button { flex: none; display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 8px; padding: 2px 8px; font-size: 11px; cursor: pointer; white-space: nowrap; }
.tix-cl button i { width: 8px; height: 8px; border-radius: 50%; background: var(--cc); } .tix-cl button b { font-size: 10.5px; } .tix-cl button.on { border-color: var(--cc, var(--accent)); box-shadow: inset 0 0 0 1px var(--cc, var(--accent)); font-weight: 700; }
.cm-unowned { margin-bottom: 8px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12.5px; }
/* search line above every list (js/tablesearch.js) */
.ts-bar { display: flex; align-items: center; gap: 6px; margin: 2px 0 4px; flex: none; }
.ts-bar .ts-ic { color: var(--muted); font-size: 14px; } .ts-bar .ts-in { flex: 1; min-width: 0; height: 28px; padding: 3px 8px; font-size: 12px; }
.ts-bar .ts-n { font-size: 11px; color: var(--muted); white-space: nowrap; }
/* driver face from the dashcam only */
.fp { margin-top: 8px; border: 1px dashed var(--line); border-radius: 12px; padding: 8px 10px; }
.fp-h { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12px; } .fp-h .muted { flex: 1; font-size: 11px; min-width: 260px; }
.fp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; max-height: 210px; overflow-y: auto; margin-top: 6px; }
.fp-it { display: grid; grid-template-columns: 44px 1fr auto; gap: 6px; align-items: center; text-align: left; border: 1px solid var(--line); border-radius: 10px; padding: 4px 6px; background: var(--panel); color: var(--text); cursor: pointer; }
.fp-it img, .fp-noimg { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; display: grid; place-items: center; background: var(--panel-2); color: var(--muted); }
.fp-it span small { display: block; font-size: 10.5px; color: var(--muted); } .fp-it.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.fp-live { color: var(--accent); padding: 4px; border-radius: 6px; } .fp-live:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
/* India map — first view of the dashboard picture panel */
.im { position: relative; height: 100%; min-height: 200px; display: flex; flex-direction: column; } .im-map { flex: 1; min-height: 180px; border-radius: 10px; }
.im-hd { position: absolute; z-index: 500; left: 50px; top: 6px; background: color-mix(in srgb, var(--panel) 88%, transparent); border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; font-size: 11.5px; }
.im-hd .im-cl { font-weight: 700; color: var(--accent); }
.im-n { display: grid; place-items: center; } .im-n b { background: #1d4ed8; color: #fff; border-radius: 9px; padding: 0 6px; font-size: 11px; line-height: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.tix-q { width: 100%; height: 26px; padding: 2px 8px; font-size: 11.5px; margin: 2px 0 4px; }
/* super admin: stop / resume incoming data (top of API page) */
#ipBox { grid-column: 1 / -1; margin-bottom: 8px; }
.ip { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.ip > div { flex: 1; display: grid; gap: 2px; } .ip > div span { font-size: 11.5px; color: var(--muted); }
.ip-on { border-left: 4px solid var(--ok); } .ip-off { border-left: 4px solid var(--muted); }
.ip-paused { border-left: 4px solid var(--warn); background: color-mix(in srgb, var(--warn) 10%, var(--panel)); } .ip-paused > svg { color: var(--warn); }
.btn.ip-stop { border-color: var(--warn); color: var(--warn); } .btn.ip-stop:hover { background: color-mix(in srgb, var(--warn) 12%, transparent); }
