/* Visual system ("lab console", 2026-11): palette, type and the app shell (full-height side menu
   with the brand, sticky top bar with status pills and the account menu). Loaded after the other
   stylesheets: it re-points their tokens, so every page picks up the palette. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../vendor/fonts/inter-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("../vendor/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2"); }

:root {
  --font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 10px;
  --side-w: 228px;
  --top-h: 56px;
}
:root[data-theme="dark"] {
  --page: #0a0c0f; --surface-1: #111419; --surface-2: #161a20; --surface-3: #1e242c;
  --text-primary: #e8ebef; --text-secondary: #aab2bd; --text-muted: #828b97;
  --grid: #1f252d; --axis: #2a313b; --border: #1f252d; --border-strong: #2a313b;
  --accent: #7aa7ff; --accent-wash: rgba(122,167,255,.12); --accent-fill: #3b74e6; --accent-text: #8fb4ff;
  --good: #3ddc97; --warning: #f5b942; --serious: #f0905f; --critical: #ff6b6b;
  --good-text: #3ddc97; --warning-text: #f5b942; --critical-text: #ff7b7b;
  --hover: #1b2028;
  --ok-bg: rgba(61,220,151,.12); --warn-bg: rgba(245,185,66,.12); --bad-bg: rgba(255,107,107,.12);
  --idle: #4b535e; --violet: #b197fc;
}
:root[data-theme="light"] {
  --page: #f4f5f7; --surface-1: #ffffff; --surface-2: #f7f8fa; --surface-3: #eceef2;
  --text-primary: #15181d; --text-secondary: #4b5360; --text-muted: #646c79;
  --grid: #e4e7eb; --axis: #d6dae0; --border: #e4e7eb; --border-strong: #d6dae0;
  --accent: #2459c9; --accent-wash: rgba(36,89,201,.08); --accent-fill: #2459c9; --accent-text: #1f4fb5;
  --good: #0f8a5a; --warning: #c88c00; --serious: #c4612c; --critical: #c93636;
  --good-text: #0b7a4f; --warning-text: #8a5800; --critical-text: #b42f2f;
  --hover: #eef0f3;
  --ok-bg: rgba(15,138,90,.1); --warn-bg: rgba(200,140,0,.12); --bad-bg: rgba(201,54,54,.09);
  --idle: #a7aeb8; --violet: #6d4fd6;
}
body { font-feature-settings: "tnum" 1, "cv11" 1; -webkit-font-smoothing: antialiased; }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -.02em; }
h2 { font-size: 13.5px; letter-spacing: -.005em; }
h3 { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; color: var(--text-muted); }
code, pre, .mono { font-size: .92em; }
.warn-text { color: var(--warning-text); }
.ico { width: 16px; height: 16px; display: block; flex: none; }
.ic-wrap { display: inline-flex; align-items: center; }

/* --- layout: side menu | (top bar / main) --- */
.layout { display: block; padding-top: 0; min-height: 100vh; }
.col { margin-left: var(--side-w); min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.main { margin-left: 0; padding: 22px 28px 60px; max-width: 1480px; width: 100%; }

/* --- side menu --- */
.sidebar { top: 0; width: var(--side-w); padding: 12px 10px 14px; background: var(--page); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 25; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 10px; color: var(--text-primary); }
.sidebar .brand .logo { width: 30px; height: 30px; flex: none; }
.brand-name { font-weight: 750; font-size: 17px; letter-spacing: -.02em; }
.side-org:empty { display: none; }
.side-org { padding: 0 4px 6px; min-height: 0; }
.side-org .cl-organizationSwitcherTrigger { width: 100%; justify-content: space-between; padding: 4px 8px; border-radius: 7px;
  border: 1px solid var(--border-strong); }
.sidebar a { padding: 6px 10px; border-radius: 7px; gap: 10px; }
.sidebar a.active { background: var(--accent-wash); color: var(--text-primary); box-shadow: inset 2px 0 0 var(--accent); }
.sidebar .ni { width: 16px; display: inline-flex; color: var(--text-muted); }
.sidebar .ni .ico { width: 16px; height: 16px; }
.sidebar a.active .ni { color: var(--accent); }
.sidebar .count.warn-text { color: var(--warning-text); }
.nav-group-head { margin: 12px 0 2px; font-size: 11px; font-weight: 600; letter-spacing: .05em; }
.nav-recent { margin: 2px 0 2px 18px; padding-left: 8px; border-left: 1px solid var(--border); }
.nav-recent .nav-title { margin: 6px 4px 2px 2px; }
.nav-recent .nav-instances a { padding: 3px 6px; font-size: 12.5px; }
.nav-recent .nav-more, .nav-recent a.nav-hidden { padding-left: 6px; }
.nav-group.collapsed .nav-recent { display: none; }
.nav-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }

/* --- top bar --- */
.banner { position: sticky; top: 0; inset: auto; height: var(--top-h); gap: 12px; padding: 0 20px 0 28px; z-index: 20;
  background: color-mix(in srgb, var(--page) 88%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.banner .brand-m { display: none; }
.banner .brand-m .logo { width: 30px; height: 30px; }
.crumb { color: var(--text-muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 26vw; }
.crumb b { color: var(--text-primary); font-weight: 600; }
.crumb:empty { display: none; }
.search { flex: 1 1 300px; max-width: 440px; min-width: 160px; height: 34px; padding: 0 8px 0 10px; display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface-1); color: var(--text-muted); font-weight: 400; cursor: text; }
.search:hover { background: var(--surface-1); border-color: var(--text-muted); }
.search .ico { width: 15px; height: 15px; }
.search-ph { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.search kbd { flex: none; border-bottom-width: 1px; background: transparent; color: var(--text-muted); }
.pills { display: flex; align-items: center; gap: 6px; margin-left: auto; min-width: 0; }
.banner-stats { margin-left: 0; gap: 6px; font-size: 12.5px; }
.pill, .banner-restart, .support-pill, .banner-alert:not(:empty) { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; margin: 0;
  border-radius: 999px; border: 1px solid var(--border-strong); background: transparent; color: var(--text-secondary); font-size: 12.5px; white-space: nowrap; flex: none; }
a.pill:hover, .banner-restart:hover { text-decoration: none; background: var(--hover); color: var(--text-primary); }
.pill b { color: var(--text-primary); font-weight: 600; }
.banner-restart, .banner-approvals { background: var(--warn-bg); border-color: transparent; color: var(--warning-text); font-weight: 550; }
.banner-restart:empty { display: none; }
.banner-restart .ic { color: inherit; }
.banner-alert:not(:empty) { background: var(--bad-bg); border-color: transparent; color: var(--critical-text); font-weight: 550; }
.support-pill { background: var(--warn-bg); border-color: transparent; color: var(--warning-text); }
.support-pill.acting { background: var(--critical); color: #fff; }
.bstat-more { width: 32px; height: 28px; padding: 0; justify-content: center; border-radius: 999px; border: 1px solid var(--border-strong); background: transparent; }
.bstat-pop { top: calc(var(--top-h) - 4px); min-width: 260px; }
.banner-actions { gap: 6px; }
.banner-actions .btn.primary { height: 32px; padding: 0 12px; border-radius: 8px; }
.banner-actions .btn.primary .ico { width: 14px; height: 14px; }
.banner .icon-btn { width: 32px; height: 32px; padding: 0; justify-content: center; border-color: transparent; color: var(--text-secondary); }
.banner .icon-btn:hover { border-color: var(--border-strong); background: var(--hover); }
.banner .icon-btn[aria-pressed="true"] { color: var(--accent); background: var(--accent-wash); }
.banner .icon-btn .ico { width: 16px; height: 16px; }

/* account menu */
.acct { position: relative; }
.acct-btn { padding: 0; border: 0; background: none; border-radius: 50%; }
.acct-btn:hover { background: none; }
.av { width: 30px; height: 30px; border-radius: 50%; background: #3a4352; color: #e3e8ef; display: grid; place-items: center;
  font-size: 11.5px; font-weight: 650; overflow: hidden; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.acct-pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 250px; padding: 6px; z-index: 40; display: flex; flex-direction: column; gap: 1px;
  background: var(--surface-1); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.35); }
.acct-pop[hidden] { display: none; }
.acct-pop > a, .acct-pop > button, .acct-pop .acct-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; border-radius: 7px;
  background: none; color: var(--text-primary); font-size: 13px; font-weight: 450; text-align: left; cursor: pointer; }
.acct-pop > a:hover, .acct-pop > button:hover, .acct-pop .acct-item:hover { background: var(--hover); text-decoration: none; }
.acct-pop .ico { width: 15px; height: 15px; color: var(--text-muted); }
.acct-who { padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.acct-who:empty { display: none; }
.acct-who b { display: block; font-size: 13px; }
.acct-pop .auth-box { display: flex; flex-direction: column; gap: 1px; border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; }
.acct-pop .auth-box:empty { display: none; }

/* --- shared components of the new pages --- */
.card { border-radius: var(--radius); }
.dot { width: 7px; height: 7px; background: var(--idle); }
.dot.info { background: var(--accent); }
.tag-new { font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--violet); border: 1px solid color-mix(in srgb, var(--violet) 45%, transparent);
  border-radius: 4px; padding: 0 4px; }

/* --- tablet / phone --- */
@media (max-width: 1280px) { .crumb { display: none; } }
@media (max-width: 1100px) { .search-ph, .search kbd { display: none; } .search { flex: 0 0 34px; min-width: 34px; padding: 0; justify-content: center; } }
@media (max-width: 900px) {
  .col { margin-left: 0; }
  .sidebar { top: 0; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .banner { padding: 0 10px; gap: 6px; }
  .banner .brand-m { display: flex; flex: none; align-items: center; height: 40px; padding: 0 2px; }
  .main { padding: 16px; }
}
@media (pointer: coarse), (max-width: 700px) {
  .search { flex-basis: 40px; min-width: 40px; height: 40px; }
  .acct-btn { min-width: 40px; min-height: 40px; display: grid; place-items: center; }
  .acct-pop > a, .acct-pop > button { min-height: 40px; }
}
@media (max-width: 480px) { .banner .pills .banner-approvals { padding: 0 8px; } }

/* phone: bottom tab bar (the side menu stays behind ☰ / More) */
.tabbar { display: none; }
@media (max-width: 700px) {
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 22; display: grid; grid-template-columns: repeat(5, 1fr);
    padding: 4px 4px calc(6px + env(safe-area-inset-bottom)); background: var(--surface-1); border-top: 1px solid var(--border); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 48px; padding: 4px 0 0;
    border: 0; background: none; border-radius: 8px; font-size: 10.5px; font-weight: 500; color: var(--text-muted); }
  .tabbar a:hover, .tabbar button:hover { text-decoration: none; background: none; color: var(--text-primary); }
  .tabbar a.on { color: var(--accent); }
  .tabbar .ico { width: 20px; height: 20px; }
  .main { padding-bottom: 90px; }
  .toasts { bottom: 76px; }
  .banner .search, .bstat-more { border-color: transparent; background: none; }
  .banner-actions .btn.primary { width: 40px; padding: 0; justify-content: center; }
  body.signed-out .tabbar { display: none; }
}
