/* WiFi Tomorrow — Fleet dashboard. Tokens follow the WiFi Tomorrow design system. */
:root {
  color-scheme: light;
  --bg: #F4F3EF;            /* paper */
  --surface: #FBFAF7;       /* surface */
  --surface-2: #EFEDE7;
  --ice: #D9E6F0;
  --night: #171A2E;
  --on-night: #F1EFF8;
  --ink: #15131F;
  --ink-2: #5A5870;
  --ink-3: #6B6982;
  --line: #DCD9D0;
  --line-2: #C9C5D6;
  --line-strong: #8E8BA3;
  --accent: #5440E6;        /* signal */
  --accent-ink: #FBFAF7;
  --accent-soft: #ECE9FF;
  --accent-on-night: #9D8FFF;
  --good: #5FD9A3;          /* mint: fills only */
  --good-ink: #167A52;      /* uptime: text */
  --warning: #E59A1D;
  --serious: #E8742A;
  --critical: #C13A26;      /* coral */
  --muted-dot: #A9A7BE;
  --bar-track: #E6E3EE;
  --row-hover: #F1EFF8;
  --shadow: 0 12px 32px -8px rgba(21,19,31,.16);
  --shadow-float: 0 18px 48px -12px rgba(21,19,31,.28);
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: Inter, "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --display: "Bricolage Grotesque", Inter, system-ui, sans-serif;
  --r-sm: 6px; --r-md: 12px; --r-lg: 20px; --r-full: 999px;
  --ease: cubic-bezier(.2,.7,.2,1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0D0B14; --surface: #151726; --surface-2: #1E2136; --ice: #263056; --night: #0A0912; --on-night: #F1EFF8;
    --ink: #F1EFF8; --ink-2: #C9C7DA; --ink-3: #A9A7BE; --line: #2C2F47; --line-2: #3A3D5C; --line-strong: #5C5A78;
    --accent: #9D8FFF; --accent-ink: #0D0B14; --accent-soft: rgba(157,143,255,.16); --good-ink: #6EE0AC;
    --critical: #FF7A63; --serious: #FF9A5C; --warning: #F2B544; --muted-dot: #5C5A78; --bar-track: #2C2F47; --row-hover: #1B1E33;
    --shadow: 0 12px 32px -8px rgba(0,0,0,.6); --shadow-float: 0 18px 48px -12px rgba(0,0,0,.8);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0D0B14; --surface: #151726; --surface-2: #1E2136; --ice: #263056; --night: #0A0912; --on-night: #F1EFF8;
  --ink: #F1EFF8; --ink-2: #C9C7DA; --ink-3: #A9A7BE; --line: #2C2F47; --line-2: #3A3D5C; --line-strong: #5C5A78;
  --accent: #9D8FFF; --accent-ink: #0D0B14; --accent-soft: rgba(157,143,255,.16); --good-ink: #6EE0AC;
  --critical: #FF7A63; --serious: #FF9A5C; --warning: #F2B544; --muted-dot: #5C5A78; --bar-track: #2C2F47; --row-hover: #1B1E33;
  --shadow: 0 12px 32px -8px rgba(0,0,0,.6); --shadow-float: 0 18px 48px -12px rgba(0,0,0,.8);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.hidden { display: none !important; }

/* ---------------- motion */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slidein { from { transform: translateX(48px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -48%) scale(.97); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 0 rgba(95,217,163,.55); } 70% { box-shadow: 0 0 0 6px rgba(95,217,163,0); } }
@keyframes ripple { from { transform: scale(.05); opacity: .9; } to { transform: scale(1); opacity: 0; } }
@keyframes sp { to { transform: rotate(360deg); } }
.intro .kpi { animation: rise .5s var(--ease) both; }
.intro .kpi:nth-child(2) { animation-delay: .06s; } .intro .kpi:nth-child(3) { animation-delay: .12s; }
.intro .kpi:nth-child(4) { animation-delay: .18s; } .intro .kpi:nth-child(5) { animation-delay: .24s; }
.intro .kpi:nth-child(6) { animation-delay: .30s; }
.intro .filters { animation: fade .5s .3s both; }
.intro .tablewrap { animation: rise .55s .32s var(--ease) both; }
.intro .panel, .intro .cards > * { animation: rise .45s var(--ease) both; }

/* ---------------- top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px; padding: 0 24px; height: 64px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; color: var(--ink); }
.brand .mark { display: grid; place-items: center; }
.brand .mark svg { display: block; }
.brand .word { font-family: var(--display); font-weight: 800; font-size: 15px; letter-spacing: .01em; text-transform: uppercase; line-height: 1; }
.brand .tag { font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); padding: 3px 8px; border-radius: var(--r-full); }
.brand .sub { font-weight: 400; color: var(--ink-3); }
.tabs { display: flex; gap: 4px; overflow-x: auto; }
.tab { border: 0; background: none; padding: 8px 14px; border-radius: var(--r-full); color: var(--ink-2); cursor: pointer; white-space: nowrap;
  font-weight: 500; transition: background .15s, color .15s; }
.tab:hover { background: var(--surface-2); color: var(--ink); }
.tab[aria-selected="true"] { color: var(--on-night); background: var(--night); }
:root[data-theme="dark"] .tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); } }
.spacer { flex: 1; }
.who { display: flex; align-items: center; gap: 10px; white-space: nowrap; color: var(--ink-2); }
.role { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; padding: 3px 9px; border-radius: var(--r-full);
  border: 1px solid var(--line-2); color: var(--ink-2); }

/* ---------------- buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); background: var(--surface);
  padding: 7px 16px; border-radius: var(--r-full); cursor: pointer; white-space: nowrap; font-weight: 500; text-decoration: none; color: var(--ink);
  transition: background .15s, border-color .15s, transform .1s, filter .15s; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.1); background: var(--accent); }
.btn.danger { border-color: var(--critical); color: var(--critical); }
.btn.danger.solid { background: var(--critical); color: #FBFAF7; }
.btn.ghost { border-color: transparent; background: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.sm { padding: 4px 12px; font-size: 12.5px; }

main { padding: 24px; max-width: 1800px; margin: 0 auto; }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r-md); margin-bottom: 16px;
  border: 1px solid var(--serious); background: color-mix(in srgb, var(--serious) 10%, var(--surface)); }
.banner.info { border-color: var(--accent); background: var(--accent-soft); }

/* ---------------- KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px 18px; overflow: hidden; }
.kpi .label { font-family: var(--mono); color: var(--ink-2); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; font-weight: 500; }
.kpi .value { font-family: var(--display); font-size: 36px; font-weight: 500; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.05; margin-top: 10px; }
.kpi .value small { font-family: var(--sans); font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--ink-3); }
.kpi .foot { color: var(--ink-3); font-size: 12px; margin-top: 6px; }
/* the first tile (Online now) is the live one: a night slab with a breathing mint dot and signal arcs */
.kpi:first-child { background: var(--night); border-color: var(--night); color: var(--on-night); }
.kpi:first-child .label { color: #A9A7BE; padding-left: 16px; }
.kpi:first-child .label::before { content: ""; position: absolute; left: 0; top: 50%; margin-top: -4px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--good); animation: breathe 2s ease-out infinite; }
.kpi:first-child .value small, .kpi:first-child .foot { color: #A9A7BE; }
.kpi:first-child > * { position: relative; z-index: 1; }
.kpi:first-child::after { content: ""; position: absolute; right: -86px; top: -86px; width: 172px; height: 172px; border-radius: 50%; pointer-events: none;
  background: repeating-radial-gradient(circle, transparent 0 22px, rgba(157,143,255,.26) 22px 23.5px); }
:root[data-theme="dark"] .kpi:first-child { background: #1B1745; border-color: #2A2468; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .kpi:first-child { background: #1B1745; border-color: #2A2468; } }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } main { padding: 14px 16px; } }

/* ---------------- filter row */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.search { flex: 0 1 320px; min-width: 180px; padding: 8px 16px; border: 1px solid var(--line-strong); border-radius: var(--r-full); background: var(--surface); }
.search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--r-full); padding: 6px 13px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; transition: background .15s, color .15s, border-color .15s; }
.chip:hover { border-color: var(--line-strong); }
.chip[aria-pressed="true"] { background: var(--night); color: var(--on-night); border-color: var(--night); }
:root[data-theme="dark"] .chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); } }
.chip .n { font-family: var(--mono); font-size: 11.5px; font-variant-numeric: tabular-nums; color: inherit; opacity: .7; }
select.sel { padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-full); background: var(--surface); }
.updated { margin-left: auto; color: var(--ink-3); font-size: 12px; display: flex; align-items: center; gap: 10px; }

/* ---------------- table */
.tablewrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: auto; max-height: calc(100vh - 300px); }
table.grid { border-collapse: separate; border-spacing: 0; width: 100%; font-variant-numeric: tabular-nums; }
table.grid th { position: sticky; top: 0; z-index: 2; background: var(--surface); text-align: left; vertical-align: bottom;
  font-family: var(--mono); font-size: 10.5px; line-height: 1.3; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-2); font-weight: 500;
  padding: 14px 12px 10px; border-bottom: 1px solid var(--line-2); cursor: pointer; user-select: none; white-space: nowrap; }
table.grid th:hover { color: var(--ink); }
table.grid th .arrow { display: inline-block; width: 10px; color: var(--accent); }
table.grid th .dag { color: var(--accent); }
table.grid td { padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: top; transition: background .12s; }
table.grid tbody tr { cursor: pointer; }
table.grid tbody tr:last-child td { border-bottom: 0; }
table.grid tbody tr:hover td { background: var(--row-hover); }
table.grid tbody tr.stale td { opacity: .55; }
table.grid tbody tr.dead td { opacity: .45; }
table.grid td.num { text-align: left; }
table.grid td.pend { white-space: normal; min-width: 150px; }
table.grid th.num { text-align: left; }
.empty { padding: 48px; text-align: center; color: var(--ink-3); }

.status { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted-dot); }
.dot.good { background: var(--good); animation: breathe 2.4s ease-out infinite; }
.dot.critical { background: var(--critical); }
.dot.warning { background: var(--warning); }
.dot.standby { background: transparent; border: 2px solid var(--ink-3); width: 9px; height: 9px; }
.sub { color: var(--ink-3); font-size: 12px; font-weight: 400; }

.use { min-width: 130px; }
.use .nums { display: flex; justify-content: flex-start; gap: 8px; }
.bar { position: relative; height: 5px; border-radius: var(--r-full); background: var(--bar-track); margin-top: 5px; overflow: hidden; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: var(--r-full); background: var(--accent); transition: width .6s var(--ease); }
.bar > i.warning { background: var(--warning); }
.bar > i.critical { background: var(--critical); }
.pill { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: var(--r-full); background: var(--surface-2); color: var(--ink-2); }
.pill.accent { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.pw { font-family: var(--mono); font-size: 12px; }
.reveal { filter: blur(4px); transition: filter .15s; }
tr:hover .reveal, .reveal:hover { filter: none; }

/* ---------------- drawer */
.scrim { position: fixed; inset: 0; background: rgba(13,11,20,.32); z-index: 30; }
.scrim.enter { animation: fade .25s both; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100vw); background: var(--surface); z-index: 31;
  box-shadow: var(--shadow-float); display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.drawer.enter { animation: slidein .32s var(--ease) both; }
.drawer header { padding: 20px 24px 16px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.drawer header h2 { margin: 0 0 4px; font-family: var(--display); font-weight: 600; font-size: 26px; letter-spacing: -.02em; line-height: 1.1; }
.drawer .body { overflow: auto; padding: 4px 24px 32px; }
.section { padding: 20px 0; border-bottom: 1px solid var(--line); }
.section:last-child { border-bottom: 0; }
.section h3 { margin: 0 0 12px; font-family: var(--mono); font-size: 10.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.kv { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px 18px; }
.kv .k { color: var(--ink-3); font-size: 12px; }
.kv .v { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; font-weight: 500; }
@media (max-width: 560px) { .kv { grid-template-columns: repeat(2, minmax(0,1fr)); } }

/* ---------------- forms */
.form { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.form label.full { grid-column: 1 / -1; }
.form input, .form select, .form textarea { padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); color: var(--ink); font-weight: 400; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form textarea { min-height: 90px; font-family: var(--mono); font-size: 12px; }
.form .check { flex-direction: row; align-items: center; gap: 8px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions { display: grid; gap: 10px; }
.action { border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; }
.action .title { font-weight: 600; margin-bottom: 2px; }
.action .desc { color: var(--ink-3); font-size: 12.5px; margin-bottom: 10px; }
.result { margin-top: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); font-size: 13px; }
.result.ok { box-shadow: inset 3px 0 0 var(--good); }
.result.bad { box-shadow: inset 3px 0 0 var(--critical); }
.result ol { margin: 6px 0 0; padding-left: 18px; }

/* ---------------- sparkline */
.spark { width: 100%; height: 72px; display: block; }
.spark .ln { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark .base { stroke: var(--line-2); stroke-width: 1; }
.spark .cap { stroke: var(--critical); stroke-width: 1; stroke-dasharray: 3 3; }
.spark .hair { stroke: var(--ink-3); stroke-width: 1; }
.spark .pt { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.sparkwrap { position: relative; }
.tip { position: absolute; pointer-events: none; background: var(--night); color: var(--on-night); font-size: 12px; padding: 4px 9px;
  border-radius: var(--r-sm); white-space: nowrap; transform: translate(-50%, -110%); font-family: var(--mono); }
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.charts .ct { font-size: 12.5px; color: var(--ink-2); margin-bottom: 4px; display: flex; justify-content: space-between; }

/* ---------------- cards & generic tables */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; }
.card h4 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; margin-bottom: 18px; }
.panel h2 { margin: 0 0 6px; font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.panel p { margin: 0 0 14px; color: var(--ink-2); }
table.plain { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
table.plain th { text-align: left; font-family: var(--mono); font-size: 10.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-2); padding: 10px 8px; border-bottom: 1px solid var(--line-2); }
table.plain td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
pre.code { background: var(--surface-2); padding: 14px; border-radius: var(--r-md); overflow: auto; font: 12px/1.6 var(--mono); margin: 8px 0 0; white-space: pre-wrap; }
.outcome { font-family: var(--mono); font-size: 11px; padding: 2px 9px; border-radius: var(--r-full); background: var(--surface-2); white-space: nowrap; }
.outcome.ok, .outcome.executed { color: var(--good-ink); }
.outcome.failed, .outcome.error, .outcome.unconfirmed, .outcome.session_expired, .outcome.endpoint_moved { color: var(--critical); }
.outcome.precondition_failed, .outcome.device_offline { color: var(--serious); }

/* ---------------- sign-in: dark paper, the glow, rippling signal rings */
.login { position: relative; min-height: 100vh; display: grid; place-items: center; padding: 16px; overflow: hidden;
  background: radial-gradient(ellipse at 95% 110%, #C13A26 0%, #5440E6 22%, #221A5E 42%, #0D0B14 68%);
  color-scheme: dark; color: #F1EFF8;
  --surface: rgba(21,23,38,.82); --surface-2: #1E2136; --ink: #F1EFF8; --ink-2: #C9C7DA; --ink-3: #A9A7BE;
  --line: #2C2F47; --line-2: #3A3D5C; --line-strong: #5C5A78; --accent: #9D8FFF; --accent-ink: #0D0B14; --accent-soft: rgba(157,143,255,.18); --critical: #FF7A63; }
.login-rings { position: absolute; right: -40vmin; bottom: -40vmin; width: 120vmin; height: 120vmin; pointer-events: none; }
.login-rings::before { content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 11vmin, rgba(157,143,255,.16) 11vmin calc(11vmin + 2px)); }
.login-rings i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(157,143,255,.7); opacity: 0;
  animation: ripple 6s cubic-bezier(.2,.6,.3,1) infinite; }
.login-rings i:nth-child(2) { animation-delay: 2s; } .login-rings i:nth-child(3) { animation-delay: 4s; }
.login .box { position: relative; width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 32px;
  box-shadow: 0 24px 64px -16px rgba(0,0,0,.6); backdrop-filter: blur(18px); animation: rise .6s var(--ease) both; }
.login .brand .word { font-size: 17px; }
.login h1 { font-family: var(--display); font-weight: 600; font-size: 32px; letter-spacing: -.025em; line-height: 1.05; margin: 22px 0 6px; }
.login p { color: var(--ink-2); margin: 0 0 22px; }
.login .form { grid-template-columns: 1fr; }
.login .form input { background: rgba(13,11,20,.5); }
.login .btn.primary { padding: 11px 18px; margin-top: 4px; }
.login .or { text-align: center; color: var(--ink-3); font-size: 12px; margin: 14px 0; }
.err { color: var(--critical); font-size: 13px; min-height: 18px; }

#toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 8px); background: var(--night); color: var(--on-night);
  padding: 10px 18px; border-radius: var(--r-full); opacity: 0; transition: opacity .2s, transform .25s var(--ease); pointer-events: none; z-index: 50; max-width: 90vw;
  box-shadow: var(--shadow-float); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: sp .8s linear infinite; display: inline-block; }
@media (max-width: 720px) { .topbar { gap: 4px 10px; padding: 8px 16px; height: auto; flex-wrap: wrap; } .topbar .tabs { order: 5; width: 100%; } .topbar .pill { display: none; } .tablewrap { max-height: none; } .brand .tag, .who .name { display: none; } .charts { grid-template-columns: 1fr; } }

/* ---------------- Fleet AI */
.ai-fab { position: fixed; right: 24px; bottom: 24px; z-index: 40; display: inline-flex; align-items: center; gap: 8px;
  background: var(--night); color: var(--on-night); border: 0; border-radius: var(--r-full); padding: 12px 20px; font-weight: 600;
  box-shadow: var(--shadow-float); cursor: pointer; transition: transform .2s var(--ease), filter .2s; }
.ai-fab:hover { transform: translateY(-2px); filter: brightness(1.2); }
:root[data-theme="dark"] .ai-fab { background: var(--accent); color: var(--accent-ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ai-fab { background: var(--accent); color: var(--accent-ink); } }
.ai-spark { color: var(--accent); font-size: 15px; line-height: 1; }
.ai-fab .ai-spark { color: #9D8FFF; }
:root[data-theme="dark"] .ai-fab .ai-spark { color: var(--accent-ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ai-fab .ai-spark { color: var(--accent-ink); } }
.ai-spark.big { font-size: 30px; margin-bottom: 8px; }
.ai-panel { position: fixed; right: 16px; bottom: 16px; top: 80px; width: min(440px, calc(100vw - 32px)); z-index: 40;
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-float);
  display: flex; flex-direction: column; overflow: hidden; animation: rise .3s var(--ease) both; }
.ai-panel header { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--line); }
.ai-panel header strong { font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: -.01em; }
.ai-bar { padding: 8px 12px; border-bottom: 1px solid var(--line); }
.ai-threads { width: 100%; }
.ai-list { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ai-empty { margin: auto 0; text-align: center; color: var(--ink-2); padding: 10px; }
.ai-empty p { margin: 6px 0 14px; font-size: 13px; }
.ai-sugg { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.ai-sugg .chip { font-size: 12.5px; }
.ai-msg { max-width: 92%; padding: 10px 14px; border-radius: 16px; font-size: 13.5px; line-height: 1.55; overflow-wrap: anywhere; animation: rise .25s var(--ease) both; }
.ai-msg.user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 6px; white-space: pre-wrap; }
.ai-msg.assistant { align-self: flex-start; background: var(--accent-soft); border-bottom-left-radius: 6px; }
.ai-msg.error { align-self: stretch; border: 1px solid var(--critical); color: var(--critical); background: none; }
.ai-md p { margin: 0 0 6px; } .ai-md p:last-child { margin-bottom: 0; }
.ai-md ul, .ai-md ol { margin: 4px 0 6px; padding-left: 18px; }
.ai-md code { font-family: var(--mono); font-size: 12px; background: var(--surface); padding: 1px 5px; border-radius: 4px; }
.ai-md .ai-h { font-weight: 650; margin: 6px 0 4px; }
.ai-md pre.code { margin: 6px 0; }
.ai-tablewrap { overflow-x: auto; margin: 6px 0; }
.ai-md table.plain th, .ai-md table.plain td { padding: 4px 8px; font-size: 12.5px; white-space: nowrap; }
.ai-tool { align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); padding: 0 4px; }
.ai-tool .dot { width: 6px; height: 6px; }
.ai-pending { align-self: stretch; border: 1px solid var(--serious); border-radius: 16px; padding: 14px; background: var(--surface); }
.ai-pending.executed { border-color: var(--good); } .ai-pending.cancelled, .ai-pending.expired { border-color: var(--line-2); opacity: .8; }
.ai-pending.failed { border-color: var(--critical); }
.ai-pending .title { font-weight: 600; margin: 4px 0; }
.ai-pending ol { margin: 4px 0; padding-left: 18px; font-size: 13px; }
.ai-pending-tag { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
.ai-compose { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); align-items: flex-end; }
.ai-input { flex: 1; resize: none; border: 1px solid var(--line-strong); border-radius: 18px; padding: 10px 14px; background: var(--surface); max-height: 140px; font-size: 13.5px; }
.ai-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ai-compose .btn { height: 40px; width: 40px; justify-content: center; padding: 0; font-size: 16px; }
.ai-foot { font-size: 11px; color: var(--ink-3); padding: 0 16px 12px; }
.ai-typing { display: inline-flex; gap: 4px; } .ai-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: aib 1s infinite; }
.ai-typing i:nth-child(2) { animation-delay: .15s; } .ai-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes aib { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (max-width: 560px) { .ai-panel { right: 8px; left: 8px; width: auto; top: 64px; bottom: 8px; } }

/* ---------------- actions, review modal, bulk bar, click-to-edit */
table.grid th.sel, table.grid td.sel { width: 34px; padding-right: 0; cursor: default; }
table.grid td.sel input, table.grid th.sel input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }
table.grid tbody tr.picked td { background: var(--accent-soft); }
.bulkbar { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 35; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  background: var(--night); color: var(--on-night); border: 1px solid var(--night); border-radius: var(--r-full); padding: 8px 10px 8px 20px; box-shadow: var(--shadow-float); max-width: calc(100vw - 32px);
  animation: fade .2s both; }
.bulkbar .btn { background: rgba(241,239,248,.08); border-color: rgba(241,239,248,.22); color: var(--on-night); }
.bulkbar .btn:hover { background: rgba(241,239,248,.16); }
.bulkbar .btn.primary { background: #9D8FFF; border-color: #9D8FFF; color: #0D0B14; }
.bulkbar .btn.danger { border-color: #FF7A63; color: #FF7A63; }
.action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.action-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 12px 14px; border: 1px solid var(--line-2);
  border-radius: var(--r-md); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s, transform .15s var(--ease); }
.action-btn:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
@media (max-width: 560px) { .action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.modal-scrim { z-index: 45; background: rgba(13,11,20,.45); animation: fade .2s both; }
.modal { position: fixed; z-index: 46; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(860px, calc(100vw - 24px)); max-height: calc(100vh - 32px);
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-float); display: flex; flex-direction: column;
  animation: pop .28s var(--ease) both; }
.modal header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 22px 10px; }
.modal header h2 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 24px; letter-spacing: -.02em; }
.modal > .form { padding: 0 22px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.modal > .form .full { grid-column: 1 / -1; }
.modal-body { padding: 4px 22px 10px; overflow: auto; }
.modal-foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; padding: 14px 22px 18px; border-top: 1px solid var(--line); }
.modal-foot .typed { display: flex; align-items: center; gap: 6px; }
.modal-foot .typed input { width: 160px; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-full); background: var(--surface); }
table.review td { vertical-align: top; }
.review-notes { margin: 8px 0 0; padding-left: 18px; }
.rec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
.rec-full { grid-column: 1 / -1; }
.rec { position: relative; padding: 8px 10px; border-radius: var(--r-md); border: 1px solid transparent; min-height: 48px; transition: background .15s, border-color .15s; }
.rec .k { color: var(--ink-3); font-size: 12px; }
.rec .v { white-space: pre-wrap; overflow-wrap: anywhere; font-weight: 500; }
.rec.editable { cursor: text; }
.rec.editable:hover, .rec.editable:focus { border-color: var(--line-2); background: var(--surface-2); outline: none; }
.rec .rec-edit { position: absolute; right: 10px; top: 8px; color: var(--ink-3); opacity: 0; font-size: 13px; transition: opacity .15s; }
.rec.editable:hover .rec-edit, .rec.editable:focus .rec-edit { opacity: 1; }
.rec input, .rec select, .rec textarea { width: 100%; padding: 6px 9px; border: 1px solid var(--accent); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font: inherit; }
#toast.has-action { pointer-events: auto; display: flex; align-items: center; gap: 12px; }
.toast-btn { border: 0; background: none; color: #9D8FFF; font-weight: 700; cursor: pointer; padding: 0; }

/* ---------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
