:root, html[data-theme="dark"] {
  --bg: #0b0f19;
  --panel: rgba(12, 18, 32, .88);
  --card: rgba(16, 24, 42, .78);
  --line: rgba(148,163,184,.16);
  --text: #e8eef7;
  --muted: #93a0b5;
  --heading: #ffffff;
  --input: #080d18;
  --accent: #0ea5e9;
  --accent-2: #38bdf8;
  --ok: #10b981;
  --warn: #f59e0b;
  --bad: #f43f5e;
  --shadow: 0 20px 50px rgba(0,0,0,.35);
  --hover-row: rgba(14,165,233,.1);
  --nav-idle: #c5d0e0;
  --glass: rgba(12,18,32,.72);
}
html[data-theme="light"] {
  --bg: #eef3f8;
  --panel: #ffffff;
  --card: #ffffff;
  --line: #d9e3ef;
  --text: #1e293b;
  --muted: #64748b;
  --heading: #0b1b2b;
  --input: #f8fafc;
  --accent: #007cc2;
  --accent-2: #0284c7;
  --shadow: 0 16px 40px rgba(15,23,42,.08);
  --hover-row: rgba(0,124,194,.07);
  --nav-idle: #334155;
  --glass: rgba(255,255,255,.85);
}
html { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }
* { box-sizing: border-box; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Segoe UI, system-ui, sans-serif;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(0,124,194,.22), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, rgba(56,189,248,.08), transparent 50%);
}
.app-shell { position: relative; z-index: 1; }
.app-sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.brand-block { border-bottom: 1px solid var(--line); }
.health-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(0,124,194,.12), transparent);
  border-radius: 16px;
  padding: 12px 14px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  color: var(--nav-idle);
  font-size: 13.5px;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-link:hover { background: rgba(255,255,255,.05); color: var(--heading); }
html[data-theme="light"] .nav-link:hover { background: rgba(0,124,194,.08); }
.nav-link.is-active {
  background: linear-gradient(90deg, #007cc2, #0ea5e9);
  color: #fff !important;
  box-shadow: 0 8px 24px rgba(0,124,194,.28);
  font-weight: 600;
}
.nav-ico { width: 18px; height: 18px; flex-shrink: 0; opacity: .9; }
.nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nav-link.is-active .nav-badge { background: #fff; color: #007cc2; }
.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--glass);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.page-hero h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.04em;
  color: var(--heading);
}
.page-hero p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 36px; height: 36px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #007cc2, #38bdf8);
  color: #fff; font-weight: 800; font-size: 14px;
}
.bell-btn {
  position: relative;
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--card);
}
.bell-count {
  position: absolute; top: -4px; right: -4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: #ef4444; color: #fff;
  font-size: 10px; font-weight: 800; display: grid; place-items: center;
}

.muted { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 1px 0 rgba(255,255,255,.03) inset;
  backdrop-filter: blur(14px);
}
html[data-theme="light"] .card { box-shadow: var(--shadow); }
.card h2 { margin: 0 0 14px; font-size: 13px; font-weight: 700; color: var(--heading); letter-spacing: 0.04em; text-transform: uppercase; }
.kpi { position: relative; overflow: hidden; }
.kpi::after {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.kpi .n { font-size: 30px; font-weight: 800; color: var(--heading); letter-spacing: -0.04em; }
.kpi .l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-top: 6px; font-weight: 600; }
.kpi-bar { margin-top: 12px; height: 5px; border-radius: 999px; background: var(--line); overflow: hidden; }
.kpi-bar > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; color: var(--text); }
.table th, .table td { border-bottom: 1px solid var(--line); padding: 11px 12px; text-align: left; vertical-align: top; }
.table th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.table thead th { position: sticky; top: 0; background: var(--card); z-index: 1; }
.table tbody tr:nth-child(even) { background: rgba(148,163,184,.04); }
.table tbody tr.is-abn { background: rgba(244,63,94,.12); box-shadow: inset 3px 0 0 var(--bad); }
.table tbody tr.is-abn td { color: var(--heading); }
.table tbody tr:hover { background: var(--hover-row); }
.table a { color: #38bdf8; font-weight: 600; }
html[data-theme="light"] .table a { color: #0369a1; }
.badge { background: #3b82f6; color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 999px; font-weight: 700; }
.tag { display: inline-block; padding: 3px 9px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border-radius: 999px; }
.tag-passed, .tag-ok { background: #dcfce7; color: #166534; }
.tag-failed, .tag-bad { background: #fee2e2; color: #991b1b; }
.tag-submitted, .tag-verified, .tag-warn { background: #fef3c7; color: #92400e; }
.tag-draft, .tag-info { background: #dbeafe; color: #1d4ed8; }
.tag-open { background: #fee2e2; color: #991b1b; }
html[data-theme="dark"] .tag-passed, html[data-theme="dark"] .tag-ok { background: rgba(34,197,94,.15); color: #4ade80; }
html[data-theme="dark"] .tag-failed, html[data-theme="dark"] .tag-bad, html[data-theme="dark"] .tag-open { background: rgba(239,68,68,.15); color: #fca5a5; }
html[data-theme="dark"] .tag-submitted, html[data-theme="dark"] .tag-verified, html[data-theme="dark"] .tag-warn { background: rgba(245,158,11,.15); color: #fbbf24; }
html[data-theme="dark"] .tag-draft, html[data-theme="dark"] .tag-info { background: rgba(59,130,246,.18); color: #93c5fd; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: linear-gradient(180deg, #0090e0, #007cc2); color: #fff; padding: 9px 14px; font-size: 13px; cursor: pointer; border-radius: 11px; font-weight: 650; box-shadow: 0 8px 18px rgba(0,124,194,.25); }
.btn:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn-ghost:hover { border-color: var(--accent); color: var(--heading); }
.btn-ok { background: #166534; box-shadow: none; }
.btn-bad { background: #991b1b; box-shadow: none; }
.btn-warn { background: #b45309; box-shadow: none; }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; align-items: flex-end; }
label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 6px; font-weight: 600; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); background: var(--input); color: var(--text); font: inherit; border-radius: 12px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #38bdf8; box-shadow: 0 0 0 3px rgba(56,189,248,.18); }
textarea { min-height: 80px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.bay-block { margin-bottom: 12px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--card); }
.bay-block summary { cursor: pointer; font-weight: 650; padding: 12px 14px; background: var(--panel); color: var(--heading); }
.checks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 14px; }
.flash { padding: 12px 14px; margin-bottom: 14px; border: 1px solid rgba(56,189,248,.35); background: rgba(14,165,233,.1); border-radius: 14px; color: #7dd3fc; }
html[data-theme="light"] .flash { border-color: #93c5fd; background: #eff6ff; color: #1d4ed8; }
.chart-box { height: 280px; }
@media (max-width: 980px) {
  .grid, .form-grid, .checks { grid-template-columns: 1fr 1fr; }
}
.toolbar { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-bottom:16px; padding:10px; border:1px solid var(--line); background: var(--card); border-radius: 16px; }
.toolbar .grow { flex:1; min-width:180px; }
.toolbar input, .toolbar select { width:auto; min-width:160px; }
.tp-modal { display:none; position:fixed; inset:0; z-index:50; align-items:center; justify-content:center; background:rgba(2,6,23,.55); backdrop-filter: blur(8px); }
.tp-modal.open { display:flex; }
.tp-modal-card { width:min(560px,92vw); max-height:86vh; overflow:auto; background:var(--card); border:1px solid var(--line); border-radius:20px; padding:22px; box-shadow: var(--shadow); }
.tp-drawer { position:fixed; top:0; right:0; height:100%; width:min(420px,92vw); background:var(--panel); border-left:1px solid var(--line); z-index:60; transform:translateX(100%); transition:transform .22s ease; overflow:auto; padding:22px; }
.tp-drawer.open { transform:none; }
#tp-drawer-backdrop { display:none; position:fixed; inset:0; background:rgba(2,6,23,.45); z-index:55; }
#tp-drawer-backdrop.open { display:block; }
.tp-toast { position:fixed; bottom:24px; right:24px; z-index:80; background:var(--accent); color:#fff; padding:11px 16px; border-radius:14px; opacity:0; transform:translateY(8px); transition:.2s; pointer-events:none; font-size:13px; font-weight:600; box-shadow: var(--shadow); }
.tp-toast.show { opacity:1; transform:none; }
.js-grid thead th[data-sort]:hover { color:var(--accent-2); }
.js-grid thead th[data-sort]::after { content:' ↕'; opacity:.35; font-size:10px; }
.js-grid thead th[data-dir="asc"]::after { content:' ↑'; opacity:1; color:var(--accent-2); }
.js-grid thead th[data-dir="desc"]::after { content:' ↓'; opacity:1; color:var(--accent-2); }
.js-grid tbody tr[data-row-detail] { cursor:pointer; }
.js-grid tbody tr[data-row-detail]:hover { background:var(--hover-row); }
.tp-drop-wrap { position:relative; }
.tp-drop { display:none; position:absolute; right:0; top:calc(100% + 8px); min-width:220px; background:var(--card); border:1px solid var(--line); border-radius:14px; padding:6px; z-index:40; box-shadow:var(--shadow); }
.tp-drop.open { display:block; }
.tp-drop button, .tp-drop a { display:block; width:100%; text-align:left; background:transparent; border:0; color:var(--text); padding:9px 12px; border-radius:10px; font-size:13px; cursor:pointer; }
.tp-drop button:hover, .tp-drop a:hover { background:var(--accent); color:#fff; }
.nav-toggle { display:none; }
@media (max-width: 900px) {
  #app-sidebar { position:fixed; inset:0 auto 0 0; z-index:70; transform:translateX(-100%); transition:transform .2s ease; width:272px; }
  #app-sidebar.open { transform:none; }
  .nav-toggle { display:inline-flex; }
}
.check-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; max-height:360px; overflow:auto; padding:8px 0; }
.check-grid label { display:flex; gap:8px; align-items:center; color:var(--text); font-size:13px; }
.check-grid input { width:auto; }
.side-list button, .side-list a { display:block; width:100%; text-align:left; padding:10px 12px; border-radius:12px; color:var(--nav-idle); }
.side-list a.active, .side-list button.active { background:linear-gradient(90deg,#007cc2,#0ea5e9); color:#fff; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.theme-toggle button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1.2;
}
.theme-toggle button.active { background: var(--accent); color: #fff; }

html[data-theme="light"] .bg-tp-bg { background-color: var(--bg) !important; }
html[data-theme="light"] .bg-tp-panel { background-color: var(--panel) !important; }
html[data-theme="light"] .bg-tp-card { background-color: var(--card) !important; }
html[data-theme="light"] .border-tp-line { border-color: var(--line) !important; }
html[data-theme="light"] .text-white { color: var(--heading) !important; }
html[data-theme="light"] .btn:not(.btn-ghost),
html[data-theme="light"] .theme-toggle button.active,
html[data-theme="light"] .side-list a.active,
html[data-theme="light"] .side-list button.active,
html[data-theme="light"] .nav-link.is-active,
html[data-theme="light"] .nav-link.is-active * { color: #fff !important; }
html[data-theme="light"] .text-slate-100,
html[data-theme="light"] .text-slate-200,
html[data-theme="light"] .text-slate-300 { color: var(--text) !important; }
html[data-theme="light"] .text-slate-400,
html[data-theme="light"] .text-slate-500 { color: var(--muted) !important; }
html[data-theme="light"] .bg-\[\#070b14\],
html[data-theme="light"] .bg-\[\#060910\] { background-color: var(--bg) !important; }
html[data-theme="light"] .bg-\[\#121a2b\],
html[data-theme="light"] .bg-\[\#121a2b\]\/80 { background-color: var(--card) !important; }
html[data-theme="light"] .border-white\/10 { border-color: var(--line) !important; }
html[data-theme="light"] .text-red-200 { color: #991b1b !important; }
html[data-theme="light"] body::before {
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(0,124,194,.12), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, rgba(14,165,233,.08), transparent 50%);
}

.fm-layout { display:grid; grid-template-columns:260px 1fr; gap:14px; }
.fm-progress { height:6px; border-radius:999px; background:var(--line); overflow:hidden; }
.fm-progress > span { display:block; height:100%; background:linear-gradient(90deg,var(--accent),var(--accent-2)); }
.fm-sticky { position:sticky; bottom:12px; z-index:15; display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; margin-top:14px; padding:12px 16px; background:var(--glass); border:1px solid var(--line); border-radius:16px; backdrop-filter: blur(12px); }
.fm-bay-nav { border-left:3px solid transparent; }
.fm-bay-nav.bay-done { border-left-color:#16a34a; }
.fm-bay-nav.bay-partial { border-left-color:#ca8a04; }
.fm-bay-nav.bay-abn { border-left-color:#dc2626; }
.fm-abn label { color:#dc2626; }
@media (max-width: 900px) {
  .fm-layout { grid-template-columns:1fr; }
}
.live-status { font-size:10px; font-weight:800; letter-spacing:.1em; text-transform:uppercase; padding:6px 10px; border-radius:999px; border:1px solid var(--line); color:var(--muted); background: var(--card); }
.live-status[data-state="live"] { color:#4ade80; border-color:rgba(74,222,128,.35); }
.live-status[data-state="sync"] { color:#fbbf24; border-color:rgba(251,191,36,.35); }
.live-status[data-state="off"] { color:#f87171; border-color:rgba(248,113,113,.35); }
.login-role {
  position: relative;
  cursor: pointer;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.login-role::after {
  content: "→";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 16px;
  opacity: .45;
}
.login-role:hover { transform: translateY(-2px); border-color: #007cc2 !important; box-shadow: 0 12px 30px rgba(0,124,194,.18); }
.login-role:hover::after { color: #38bdf8; opacity: 1; }
@media print {
  aside, header, .toolbar, .tp-modal, .tp-drawer, #tp-drawer-backdrop, .no-print, body::before { display:none !important; }
  .content { padding:0 !important; }
}

::selection { background: rgba(0,124,194,.32); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(148,163,184,.28); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }
.kpi .n { font-variant-numeric: tabular-nums; }
.card:has(.table) { overflow-x: auto; }
.grid-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-split { grid-template-columns: 2fr 1fr; }
.grid-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 1200px) {
  .grid-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-split { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .grid, .grid-kpis, .grid-2, .form-grid, .checks { grid-template-columns: 1fr; }
}

.nav-group {
  margin: 12px 8px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.health-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.hchip {
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted);
}
.hchip-bad { color: #fda4af; border-color: rgba(244,63,94,.35); background: rgba(244,63,94,.12); }
.hchip-warn { color: #fcd34d; border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.12); }
.hchip-hot { color: #fb7185; border-color: rgba(244,63,94,.4); background: rgba(244,63,94,.1); }
.hchip-ok { color: #6ee7b7; border-color: rgba(16,185,129,.35); background: rgba(16,185,129,.1); }

.cmdk-trigger { gap: 10px; padding: 7px 12px; color: var(--muted); }
@media (max-width: 1100px) {
  .cmdk-trigger kbd { display: none; }
}
.cmdk {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 12vh 16px 16px;
  background: rgba(2,6,23,.55); backdrop-filter: blur(10px);
}
.cmdk[hidden] { display: none !important; }
.cmdk-card {
  width: min(560px, 94vw); background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 10px; box-shadow: var(--shadow);
}
.cmdk-card input { margin-bottom: 8px; }
.cmdk-item {
  display: flex; justify-content: space-between; gap: 10px;
  width: 100%; text-align: left; padding: 10px 12px; border: 0; background: transparent;
  color: var(--text); border-radius: 10px; cursor: pointer; font-size: 13px;
}
.cmdk-item small { color: var(--muted); }
.cmdk-item.is-active, .cmdk-item:hover { background: linear-gradient(90deg, #007cc2, #0ea5e9); color: #fff; }
.cmdk-item.is-active small, .cmdk-item:hover small { color: rgba(255,255,255,.8); }

.wf-stepper {
  display: flex; gap: 0; list-style: none; margin: 0 0 16px; padding: 0; overflow-x: auto;
}
.wf-stepper li {
  flex: 1; min-width: 120px; position: relative; padding: 8px 12px 8px 0;
  color: var(--muted); font-size: 12px; font-weight: 650;
}
.wf-stepper li::before {
  content: ""; display: block; height: 4px; border-radius: 99px; background: var(--line); margin-bottom: 8px;
}
.wf-stepper li.is-done { color: var(--ok); }
.wf-stepper li.is-done::before { background: var(--ok); }
.wf-stepper li.is-now { color: var(--accent-2); }
.wf-stepper li.is-now::before { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.wf-stepper li.is-fail, .wf-stepper li.is-fail.is-now { color: var(--bad); }
.wf-stepper li.is-fail::before { background: var(--bad); }
.wf-stepper small { display: block; font-weight: 500; opacity: .8; margin-top: 2px; }

.bay-strip {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; margin-bottom: 10px;
  position: sticky; top: 58px; z-index: 12; background: var(--bg);
}
.bay-chip {
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 999px; padding: 7px 12px; font-size: 12px; font-weight: 650; cursor: pointer;
}
.bay-chip.active { background: linear-gradient(90deg, #007cc2, #0ea5e9); color: #fff; border-color: transparent; }
.bay-chip.bay-done { box-shadow: inset 0 0 0 1px var(--ok); }
.bay-chip.bay-abn { box-shadow: inset 0 0 0 1px var(--bad); }
.bay-chip.bay-partial { box-shadow: inset 0 0 0 1px var(--warn); }

.fm-check { border: 1px solid transparent; border-radius: 12px; padding: 8px; }
.fm-check.is-alert { border-color: rgba(244,63,94,.5); background: rgba(244,63,94,.1); animation: pulse-alert .9s ease 2; }
.fm-alert {
  display: none; margin-top: 6px; font-size: 11px; font-weight: 700; color: #fda4af;
}
.fm-check.is-alert .fm-alert { display: block; }
@keyframes pulse-alert { 50% { box-shadow: 0 0 0 4px rgba(244,63,94,.18); } }

.heat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.heat-tile {
  display: flex; flex-direction: column; gap: 6px; padding: 14px;
  border-radius: 16px; border: 1px solid var(--line); background: var(--card); color: var(--text);
  text-decoration: none; min-height: 92px;
}
.heat-tile .val { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.heat-tile.ok { background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.35); }
.heat-tile.warn { background: rgba(245,158,11,.14); border-color: rgba(245,158,11,.4); }
.heat-tile.crit { background: rgba(244,63,94,.16); border-color: rgba(244,63,94,.45); box-shadow: 0 0 20px rgba(244,63,94,.15); }
.heat-tile.none { opacity: .7; }
.heat-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin: 8px 0 14px; }
.heat-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 99px; margin-right: 6px; }
.delta { font-variant-numeric: tabular-nums; font-weight: 700; }
.delta-up { color: var(--bad); }
.delta-dn { color: var(--ok); }

.cap-row { margin-bottom: 12px; }
.cap-meta { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
.cap-bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.cap-bar > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--ok), var(--accent)); }
.cap-bar.is-high > span { background: linear-gradient(90deg, var(--warn), var(--bad)); }

.kpi-dot { position: absolute; right: 14px; top: 14px; width: 8px; height: 8px; border-radius: 99px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.kpi.warn .kpi-dot { background: var(--warn); box-shadow: 0 0 10px var(--warn); }
.kpi.bad .kpi-dot { background: var(--bad); box-shadow: 0 0 10px var(--bad); }
.kpi.ok .kpi-dot { background: var(--ok); box-shadow: 0 0 10px var(--ok); }

html[data-theme="sunlight"] {
  color-scheme: light;
  --bg: #f3f4f6;
  --panel: #ffffff;
  --card: #ffffff;
  --line: #0f172a;
  --text: #0f172a;
  --muted: #334155;
  --heading: #020617;
  --input: #ffffff;
  --accent: #0369a1;
  --accent-2: #0284c7;
  --shadow: 0 10px 24px rgba(15,23,42,.12);
  --hover-row: rgba(3,105,161,.08);
  --nav-idle: #0f172a;
  --glass: rgba(255,255,255,.92);
}
html[data-theme="sunlight"] body { font-size: 16px; }
html[data-theme="sunlight"] .btn, html[data-theme="sunlight"] .nav-link,
html[data-theme="sunlight"] input, html[data-theme="sunlight"] select, html[data-theme="sunlight"] textarea,
html[data-theme="sunlight"] .bay-chip { min-height: 44px; }
html[data-theme="sunlight"] .card { border-width: 2px; }
html[data-theme="sunlight"] .btn:not(.btn-ghost),
html[data-theme="sunlight"] .theme-toggle button.active,
html[data-theme="sunlight"] .nav-link.is-active,
html[data-theme="sunlight"] .nav-link.is-active *,
html[data-theme="sunlight"] .side-list a.active,
html[data-theme="sunlight"] .side-list button.active,
html[data-theme="sunlight"] .bay-chip.active { color: #fff !important; }
html[data-theme="sunlight"] .text-white { color: var(--heading) !important; }
html[data-theme="sunlight"] .text-slate-400, html[data-theme="sunlight"] .text-slate-500 { color: var(--muted) !important; }
html[data-theme="sunlight"] body::before { background: none; }

.login-page { position: relative; overflow: hidden; }
.login-mesh {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .35;
  background-image:
    linear-gradient(rgba(56,189,248,.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56,189,248,.12) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: mesh-drift 28s linear infinite;
}
@keyframes mesh-drift { to { background-position: 48px 48px; } }
.login-kicker { font-size: 10px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.login-role.is-customer { border-style: dashed; }

html[data-theme="light"] .hchip-bad, html[data-theme="sunlight"] .hchip-bad { color: #9f1239; }
html[data-theme="light"] .hchip-warn, html[data-theme="sunlight"] .hchip-warn { color: #92400e; }
html[data-theme="light"] .hchip-ok, html[data-theme="sunlight"] .hchip-ok { color: #065f46; }
html[data-theme="sunlight"] .bg-tp-bg, html[data-theme="sunlight"] .bg-\[\#060910\], html[data-theme="sunlight"] .bg-\[\#0b0f19\] { background-color: var(--bg) !important; }
html[data-theme="light"] .bg-\[\#0b0f19\] { background-color: var(--bg) !important; }

.dt-badge {
  display: inline-block; margin-top: 6px; padding: 3px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 800; letter-spacing: .02em;
}
.dt-ok { background: rgba(16,185,129,.15); color: #6ee7b7; }
.dt-warn { background: rgba(245,158,11,.18); color: #fcd34d; }
.dt-crit { background: rgba(244,63,94,.18); color: #fda4af; }
html[data-theme="light"] .dt-ok, html[data-theme="sunlight"] .dt-ok { color: #047857; }
html[data-theme="light"] .dt-warn, html[data-theme="sunlight"] .dt-warn { color: #b45309; }
html[data-theme="light"] .dt-crit, html[data-theme="sunlight"] .dt-crit { color: #be123c; }

.photo-box { margin-top: 8px; }
.photo-btn input { display: none; }
.photo-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.photo-thumb {
  width: 92px; height: 92px; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); position: relative; display: block; background: #000;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb span {
  position: absolute; left: 0; right: 0; bottom: 0; font-size: 9px; padding: 2px 4px;
  background: rgba(0,0,0,.55); color: #fff;
}

.offline-banner {
  margin-bottom: 12px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid rgba(245,158,11,.4); background: rgba(245,158,11,.12);
  color: #fcd34d; font-size: 13px; font-weight: 650;
}

.sld-wrap { padding: 8px 0 24px; }
.sld-bus {
  margin: 0 12px 8px; padding: 14px 18px; border-radius: 14px;
  background: linear-gradient(90deg, #0ea5e9, #007cc2);
  color: #fff; font-weight: 800; letter-spacing: .08em;
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
}
.sld-bus small { font-weight: 500; opacity: .85; letter-spacing: 0; }
.sld-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0 10px;
  padding: 0 8px;
}
.sld-bay {
  position: relative; text-decoration: none; color: var(--text);
  text-align: center; padding: 28px 8px 14px; border-radius: 16px;
  border: 1px solid var(--line); background: var(--card); margin-top: 18px;
}
.sld-drop {
  position: absolute; left: 50%; top: -22px; width: 3px; height: 22px;
  background: #38bdf8; transform: translateX(-50%);
}
.sld-cb { font-size: 10px; font-weight: 800; letter-spacing: .08em; color: var(--muted); }
.sld-name { font-weight: 800; margin-top: 4px; }
.sld-who { font-size: 11px; color: var(--muted); margin-top: 2px; min-height: 16px; }
.sld-meta { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; font-variant-numeric: tabular-nums; }
.sld-flag { color: #fda4af; font-weight: 800; }
.sld-ok { box-shadow: inset 0 0 0 1px rgba(16,185,129,.45); }
.sld-ok .sld-drop { background: #10b981; }
.sld-warn { box-shadow: inset 0 0 0 1px rgba(245,158,11,.55); }
.sld-warn .sld-drop { background: #f59e0b; }
.sld-crit { box-shadow: 0 0 22px rgba(244,63,94,.25), inset 0 0 0 1px rgba(244,63,94,.6); }
.sld-crit .sld-drop { background: #f43f5e; }
.sld-none { opacity: .75; }
.speech-btn { margin-top: 8px; }
