/* wbsquad control tower - design tokens + layout. Mock with sample data only. */
:root {
  color-scheme: light;
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --raised: #eef0f3;
  --border: rgba(16, 22, 32, 0.10);
  --border-strong: rgba(16, 22, 32, 0.18);
  --text: #12161c;
  --text-2: #475060;
  --text-3: #66707e;
  --accent: #2a78d6;
  --accent-ink: #ffffff;
  --accent-wash: rgba(42, 120, 214, 0.10);
  --good: #0ca30c;
  --warn: #fab219;
  --serious: #ec835a;
  --crit: #d03b3b;
  --good-text: #006300;
  --warn-text: #8a5a00;
  --crit-text: #b42323;
  --grid: #e3e5e9;
  --shadow: 0 1px 2px rgba(16, 22, 32, 0.05);
  --side-w: 244px;
  --radius: 12px;
}
/* Light is the base; the page script sets data-theme="dark" (default) or "light". */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #12151a;
  --surface: #1a1e25;
  --surface-2: #20252d;
  --raised: #262c35;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e6e8ec;
  --text-2: #aab1bc;
  --text-3: #8a919c;
  --accent: #4b93f0;
  --accent-ink: #0b1220;
  --accent-wash: rgba(75, 147, 240, 0.14);
  --good-text: #3fcf3f;
  --warn-text: #f5bd3d;
  --crit-text: #f27c7c;
  --grid: #2a3039;
  --shadow: none;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 16px 12px; display: flex; flex-direction: column; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 2px; }
.brand-mark { width: 28px; height: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.brand-mark i { background: var(--text-3); border-radius: 3px; opacity: .55; }
.brand-mark i:first-child { background: var(--accent); opacity: 1; }
.brand-name { font-weight: 650; letter-spacing: -0.01em; font-size: 16px; }
.brand-sub { font-size: 11px; color: var(--text-3); margin-top: -2px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); padding: 0 10px 6px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  color: var(--text-2); position: relative;
}
.nav a svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav a:hover { background: var(--raised); color: var(--text); }
.nav a.active { background: var(--accent-wash); color: var(--text); font-weight: 600; }
.nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav .count { margin-left: auto; font-size: 12px; padding: 1px 7px; border-radius: 999px; background: var(--raised); color: var(--text-2); }
.nav .count.hot { background: var(--crit); color: #fff; }
.apps a .soon { margin-left: auto; font-size: 11px; color: var(--text-3); }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-wash); color: var(--accent); display: grid; place-items: center; font-weight: 650; font-size: 12px; }
.who { line-height: 1.25; min-width: 0; }
.who b { display: block; font-weight: 600; font-size: 13px; }
.who span { font-size: 12px; color: var(--text-3); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 24px; background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.search {
  flex: 1 1 260px; max-width: 420px; display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; color: var(--text-3);
}
.search input { all: unset; flex: 1; color: var(--text); min-width: 0; }
.search input::placeholder { color: var(--text-3); }
.search kbd { font: 11px system-ui; border: 1px solid var(--border-strong); border-radius: 5px; padding: 1px 6px; color: var(--text-3); }
.chip, .select {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 10px; font-size: 13px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
}
.chip svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--text-3); }
.chip:hover { border-color: var(--border-strong); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.spacer { flex: 1; }
.sample { font-size: 12px; color: var(--warn-text); border: 1px dashed var(--warn); padding: 5px 10px; border-radius: 999px; }
.iconbtn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.iconbtn svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.content { padding: 24px; max-width: 1560px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 24px; letter-spacing: -0.02em; font-weight: 650; }
.page-head p { margin: 2px 0 0; color: var(--text-3); }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; color: var(--text-2); font-size: 13px; }
.seg button[aria-pressed="true"] { background: var(--raised); color: var(--text); font-weight: 600; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.card-h h2 { margin: 0; font-size: 14px; font-weight: 650; }
.card-h .hint { font-size: 12px; color: var(--text-3); }
.card-b { padding: 14px 18px 18px; }
.grid { display: grid; gap: 16px; }
.row-top { grid-template-columns: minmax(280px, 4fr) 8fr; }
.kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.row-mid { grid-template-columns: 7fr 5fr; }
.row-chart { grid-template-columns: 7fr 5fr; }

/* hero */
.hero { padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; height: 100%; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 600; }
.hero-fig { font-size: 64px; line-height: 1; font-weight: 650; letter-spacing: -0.035em; }
.delta { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.delta.bad { color: var(--crit-text); }
.delta.good { color: var(--good-text); }
.delta small { color: var(--text-3); font-weight: 400; }
.segbar { display: flex; gap: 2px; height: 8px; border-radius: 999px; overflow: hidden; margin-top: 6px; }
.segbar i { display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.legend b { color: var(--text); font-weight: 600; }
.hero-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); display: flex; gap: 8px; align-items: center; color: var(--text-2); font-size: 13px; }

/* kpi tile */
.tile { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; position: relative; min-width: 0; }
.tile:hover { border-color: var(--border-strong); }
.tile-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tile-label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.status { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.status svg { width: 11px; height: 11px; }
.status.crit { color: var(--crit-text); background: color-mix(in srgb, var(--crit) 14%, transparent); }
.status.warn { color: var(--warn-text); background: color-mix(in srgb, var(--warn) 18%, transparent); }
.status.good { color: var(--good-text); background: color-mix(in srgb, var(--good) 14%, transparent); }
.tile-val { font-size: 38px; line-height: 1.05; font-weight: 650; letter-spacing: -0.03em; }
.tile-sub { font-size: 12.5px; color: var(--text-3); }
.tile-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.spark { width: 96px; height: 34px; flex: none; }

/* meter list */
.meters { display: flex; flex-direction: column; }
.meter { display: grid; grid-template-columns: 150px 1fr 150px; gap: 14px; align-items: center; padding: 11px 0; border-top: 1px solid var(--border); }
.meter:first-child { border-top: 0; }
.meter-name { font-weight: 550; }
.meter-name small { display: block; color: var(--text-3); font-weight: 400; font-size: 12px; }
.track { height: 8px; border-radius: 999px; background: var(--raised); overflow: hidden; }
.fill { height: 100%; border-radius: 999px; }
.meter-fig { text-align: right; }
.meter-fig b { font-size: 16px; font-weight: 650; }
.meter-fig small { display: block; font-size: 12px; color: var(--text-3); }

/* decision queue */
.queue { display: flex; flex-direction: column; }
.q { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 12px 0; border-top: 1px solid var(--border); align-items: center; }
.q:first-child { border-top: 0; }
.q-title { font-weight: 560; display: flex; align-items: center; gap: 8px; }
.q-meta { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.q-act { font-size: 12.5px; color: var(--text-2); margin-top: 4px; }
.sev { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.btn { border: 1px solid var(--border-strong); background: var(--surface); padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 550; }
.btn:hover { background: var(--raised); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.06); }
.btnrow { display: flex; gap: 6px; }
.link { color: var(--accent); font-size: 13px; font-weight: 550; }

/* charts */
.chart { width: 100%; display: block; }
.chart text { fill: var(--text-3); font: 11.5px system-ui, sans-serif; }
.chart .gl { stroke: var(--grid); stroke-width: 1; }
.chart .bl { stroke: var(--border-strong); stroke-width: 1; }
.chart-wrap { position: relative; }
.tip {
  position: absolute; pointer-events: none; padding: 7px 10px; font-size: 12.5px; border-radius: 8px; z-index: 3;
  background: var(--raised); border: 1px solid var(--border-strong); box-shadow: 0 6px 18px rgba(0,0,0,.25);
  transform: translate(-50%, -110%); white-space: nowrap; opacity: 0; transition: opacity .08s;
}
.tip b { font-weight: 650; }
.tip small { color: var(--text-3); display: block; }

/* table */
.tabs { display: flex; gap: 4px; }
.tabs button { border: 0; background: none; padding: 5px 11px; border-radius: 8px; color: var(--text-2); font-size: 13px; }
.tabs button[aria-selected="true"] { background: var(--raised); color: var(--text); font-weight: 600; }
table { width: 100%; border-collapse: collapse; }
th { text-align: right; font-size: 12px; font-weight: 600; color: var(--text-3); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
td { text-align: right; padding: 11px 12px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td:first-child { font-weight: 560; }
.sla { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.sla i { width: 8px; height: 8px; border-radius: 50%; }
.sla.dim { color: var(--text-3); }
.zero { color: var(--text-3); }
.tablewrap { overflow-x: auto; }

.note { font-size: 12px; color: var(--text-3); text-align: center; padding: 4px 0 8px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -6px; }
.filters .chip svg:last-child { width: 13px; height: 13px; }
.flow { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.fstep { position: relative; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.fstep:not(:last-child)::after { content: ""; position: absolute; right: -9px; top: 50%; width: 8px; height: 8px; border-right: 2px solid var(--border-strong); border-top: 2px solid var(--border-strong); transform: translateY(-50%) rotate(45deg); }
.fstep .n { font-size: 12.5px; color: var(--text-2); font-weight: 550; }
.fstep .v { font-size: 28px; font-weight: 650; letter-spacing: -0.025em; line-height: 1.15; margin: 2px 0; }
.fstep .p { font-size: 12.5px; color: var(--text-3); }
.fstep .t { font-size: 12.5px; color: var(--text-2); margin-top: 6px; }
.fstep .status { margin-top: 8px; }
.status.serious { color: var(--crit-text); background: color-mix(in srgb, var(--serious) 18%, transparent); }
.status.info { color: var(--accent); background: var(--accent-wash); }
.status.mute { color: var(--text-2); background: var(--raised); }
.miniStats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.miniStats .s .l { font-size: 12.5px; color: var(--text-3); }
.miniStats .s .v { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; }
.miniStats .s .d { font-size: 12px; color: var(--text-3); }
.splitlbl { font-size: 12.5px; color: var(--text-2); margin: 14px 0 6px; font-weight: 550; }
.tallbar { display: flex; gap: 2px; height: 28px; }
.tallbar i { display: flex; align-items: center; padding-left: 8px; font-style: normal; font-size: 12px; font-weight: 600; color: #fff; border-radius: 4px; overflow: hidden; white-space: nowrap; }
.tallbar i.dk { color: #0b0b0b; }
.fresh { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.fresh .f { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); }
.fresh .f b { display: block; font-weight: 600; }
.fresh .f span { font-size: 12.5px; color: var(--text-3); }
.fresh .f .status { margin-top: 6px; }
td.l, th.l { text-align: left; }
td.wrapc { white-space: normal; min-width: 220px; text-align: left; color: var(--text-2); }
.idc { color: var(--text-3); font-variant-numeric: tabular-nums; }
@media (max-width: 1500px) { .flow { grid-template-columns: repeat(3, minmax(0, 1fr)); } .fstep::after { display: none; } }
@media (max-width: 1180px) { .fresh, .miniStats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1180px) {
  .app { grid-template-columns: 68px 1fr; }
  :root { --side-w: 68px; }
  .brand-name, .brand-sub, .nav-label, .nav a span, .nav .count, .apps a .soon, .who, .side-foot .who { display: none; }
  .nav a { justify-content: center; padding: 10px; }
  .nav a.active::before { left: -12px; }
  .brand { justify-content: center; padding: 4px 0; }
  .side-foot { justify-content: center; padding: 8px; }
  .row-top, .row-mid, .row-chart { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .content { padding: 16px; }
  .top { padding: 10px 16px; }
  .meter { grid-template-columns: 1fr; gap: 6px; }
  .meter-fig { text-align: left; }
  .tile-val { font-size: 30px; }
  .hero-fig { font-size: 52px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
