/* SCOREVEX design system - Gauge V brand tokens. Fonts: Inter / JetBrains Mono if installed, otherwise system stacks — no font files are bundled. */
:root {
  /* Brand: Gauge V (Vex Indigo / Signal Cyan / Obsidian / Slate Light) - see docs/BRAND-GUIDELINES.md */
  --obsidian: #0F172A; --graphite: #1E293B; --midnight: #334155; --slate: #F8FAFC; --mist: #E2E8F0;
  --indigo: #4F46E5; --glow: #818CF8; --cyan: #22D3EE;
  --ok: #10B981; --warn: #F59E0B; --high: #F97316; --bad: #DC2626;
  --bg: #F8FAFC; --surface: #FFFFFF; --surface-2: #F1F5F9; --ink: #0F172A; --ink-2: #475569; --ink-3: #475569;
  --line: #E2E8F0; --grid: #E2E8F0; --track: #E2E8F0; --accent: #4F46E5; --accent-ink: #FFFFFF; --link: #4F46E5; --chart: #4F46E5; --focus: #4F46E5;
  --side: #0F172A; --side-ink: #CBD5E1; --side-on: #FFFFFF;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 10px; --shadow: 0 1px 2px rgba(15,23,42,.06), 0 4px 14px rgba(15,23,42,.05);
}
.theme-dark {
  --bg: #0F172A; --surface: #1E293B; --surface-2: #162033; --ink: #F8FAFC; --ink-2: #94A3B8; --ink-3: #94A3B8;
  --line: #334155; --grid: #334155; --track: #334155; --link: #818CF8; --chart: #818CF8; --focus: #22D3EE; --shadow: 0 1px 2px rgba(0,0,0,.4);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 var(--sans); background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 15px; } h4 { font-size: 13px; }
p { margin: 0 0 8px; }
a { color: var(--link); }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
pre { margin: 0; padding: 12px; background: #0F172A; color: #E2E8F0; border-radius: 8px; overflow: auto; max-height: 420px; white-space: pre-wrap; word-break: break-word; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ico { flex: none; }
.muted { color: var(--ink-3); } .small { font-size: 12px; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.row { display: flex; gap: 12px; align-items: center; } .row.wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; } .gap-s { gap: 6px; }
.stack > * + * { margin-top: 14px; }
.spacer { flex: 1; }
.row > select { width: auto; min-width: 140px; max-width: 100%; }
.chart { height: auto; max-width: 100%; display: block; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px; z-index: 99; }

/* shell */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 14px 10px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 14px; color: #fff; }
.brand-logo { display: block; flex: none; max-width: 100%; }
.brand.login-brand { padding: 0 0 6px; }
.brand-tag { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--glow); border: 1px solid var(--midnight); border-radius: 99px; padding: 1px 8px; }
.nav-group { margin: 12px 10px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: #64748B; }
.nav { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--side-ink); text-decoration: none; cursor: pointer; border: 0; background: none; width: 100%; font: inherit; text-align: left; }
.nav:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav.on { background: rgba(99,102,241,.22); color: #fff; box-shadow: inset 3px 0 0 var(--glow); }
.nav .count { margin-left: auto; background: var(--accent); color: #fff; font-size: 11px; border-radius: 99px; padding: 0 7px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.content { padding: 22px 24px 60px; max-width: 1400px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { color: var(--ink-3); margin: 2px 0 0; }
.env-switch { display: inline-flex; background: var(--surface-2); border-radius: 99px; padding: 3px; border: 1px solid var(--line); }
.env-switch button { border: 0; background: none; padding: 4px 14px; border-radius: 99px; font: inherit; font-weight: 600; font-size: 12px; cursor: pointer; color: var(--ink-2); }
.env-switch button.on.sandbox { background: var(--warn); color: #1f1300; } .env-switch button.on.production { background: var(--ok); color: #03281c; }
.banner { padding: 8px 24px; font-weight: 600; font-size: 13px; display: flex; gap: 10px; align-items: center; }
.banner.sandbox { background: #FEF3C7; color: #78350F; } .banner.imp { background: #7C2D12; color: #fff; } .banner.prod { background: #D1FAE5; color: #064E3B; }
.menu-toggle { display: none; }

/* components */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; } .card-head h3 { flex: 1; }
.grid { display: grid; gap: 16px; } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stat { display: flex; flex-direction: column; gap: 2px; } .stat .v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; } .stat .l { color: var(--ink-3); font-size: 12px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); } .btn.primary:hover { filter: brightness(.94); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; } .btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.icon-btn { border: 0; background: none; cursor: pointer; padding: 6px; border-radius: 6px; color: var(--ink-2); display: inline-grid; place-items: center; } .icon-btn:hover { background: var(--surface-2); }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; width: 100%; min-width: 0; }
input[type=checkbox], input[type=radio] { width: auto; }
textarea { resize: vertical; font-family: var(--mono); font-size: 12.5px; }
.field { display: flex; flex-direction: column; gap: 4px; } .field > span { font-weight: 600; font-size: 12px; color: var(--ink-2); } .field small { color: var(--ink-3); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; } .form-grid .full { grid-column: 1 / -1; }
.badge { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.tier-low { background: #D1FAE5; color: #065F46; } .tier-watchlist { background: #FEF3C7; color: #92400E; } .tier-high { background: #FFEDD5; color: #9A3412; } .tier-critical { background: #FEE2E2; color: #991B1B; }
.theme-dark .tier-low { background: #064E3B; color: #A7F3D0; } .theme-dark .tier-watchlist { background: #78350F; color: #FDE68A; } .theme-dark .tier-high { background: #7C2D12; color: #FED7AA; } .theme-dark .tier-critical { background: #7F1D1D; color: #FECACA; }
.b-neutral { background: var(--surface-2); color: var(--ink-2); } .b-ok { background: #D1FAE5; color: #065F46; } .b-warn { background: #FEF3C7; color: #92400E; } .b-bad { background: #FEE2E2; color: #991B1B; } .b-info { background: #DBEAFE; color: #1E40AF; }
.chip { display: inline-block; font-size: 11px; font-family: var(--mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; margin: 0 4px 4px 0; }
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; } .tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; } .tbl tr.clickable { cursor: pointer; } .tbl tr.clickable:hover td { background: var(--surface-2); }
.tbl tr.sel td { background: rgba(79,70,229,.08); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tab { border: 0; background: none; padding: 9px 14px; font: inherit; font-weight: 600; color: var(--ink-3); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; } .tab.on { color: var(--ink); border-bottom-color: var(--accent); }
.empty { text-align: center; color: var(--ink-3); padding: 28px 10px; display: grid; justify-items: center; gap: 6px; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 30px auto; } @keyframes spin { to { transform: rotate(360deg); } }
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 100; }
.toast { background: var(--obsidian); color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); max-width: 380px; border-left: 4px solid #64748B; } .t-error { border-left-color: var(--bad); } .t-ok { border-left-color: var(--ok); } .t-warn { border-left-color: var(--warn); }
.modal-back { position: fixed; inset: 0; background: rgba(2,6,23,.55); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--surface); color: var(--ink); border-radius: 12px; width: min(520px, 100%); max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.4); } .modal.wide { width: min(860px, 100%); }
.modal-head { display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); } .modal-head h3 { flex: 1; }
.modal-body { padding: 16px; overflow: auto; } .modal-foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--surface); border-left: 1px solid var(--line); box-shadow: -10px 0 40px rgba(0,0,0,.2); z-index: 40; display: flex; flex-direction: column; }
.drawer-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; } .drawer-body { padding: 16px; overflow: auto; flex: 1; } .drawer-foot { padding: 12px 16px; border-top: 1px solid var(--line); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; } .kv dt { color: var(--ink-3); } .kv dd { margin: 0; word-break: break-word; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); } .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.chart .axis, .chart text.axis { font-size: 10px; fill: var(--ink-3); } .gauge-num { font-size: 34px; font-weight: 700; } .gauge-lbl { font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.hint-box { background: var(--surface-2); border: 1px dashed var(--line); border-radius: 8px; padding: 10px 12px; color: var(--ink-2); font-size: 13px; }
.warnbox { background: #FEF3C7; color: #78350F; border-radius: 8px; padding: 10px 12px; font-size: 13px; } .errbox { background: #FEE2E2; color: #7F1D1D; border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.timeline { position: relative; margin: 0; padding: 0 0 0 18px; list-style: none; border-left: 2px solid var(--line); } .timeline li { position: relative; padding: 0 0 14px 6px; } .timeline li::before { content: ""; position: absolute; left: -25px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }
.diff { font-family: var(--mono); font-size: 12px; border: 1px solid var(--line); border-radius: 8px; overflow: auto; } .diff div { padding: 1px 10px; white-space: pre-wrap; } .diff .add { background: rgba(16,185,129,.18); } .diff .del { background: rgba(239,68,68,.18); }

/* kanban */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; }
.kcol { background: var(--surface-2); border-radius: 10px; padding: 10px; min-height: 240px; border: 2px solid transparent; } .kcol.over { border-color: var(--accent); }
.kcol h4 { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--ink-2); }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 8px; cursor: grab; box-shadow: var(--shadow); } .kcard:active { cursor: grabbing; } .kcard.dragging { opacity: .4; }
/* rule builder */
.rb-group { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; padding: 10px; background: var(--surface-2); margin: 6px 0; } .rb-group .rb-group { background: var(--surface); border-left-color: var(--warn); }
.rb-group.over, .rb-drop.over { outline: 2px dashed var(--accent); } .rb-cond { display: grid; grid-template-columns: 22px minmax(150px, 2fr) 110px minmax(100px, 1fr) 30px; gap: 8px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; margin: 6px 0; }
.rb-cond.bad { border-color: var(--bad); } .rb-handle { cursor: grab; color: var(--ink-3); display: grid; place-items: center; } .rb-drop { height: 8px; border-radius: 4px; margin: 0; } .rb-drop.over { height: 22px; background: rgba(79,70,229,.12); }
.rb-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; } .rb-toggle button { border: 0; background: var(--surface); padding: 3px 12px; font: inherit; font-weight: 700; cursor: pointer; color: var(--ink-2); } .rb-toggle button.on { background: var(--obsidian); color: #fff; }
.slider-row { display: flex; align-items: center; gap: 10px; } .slider-row input[type=range] { flex: 1; padding: 0; }
.api-ex { display: grid; grid-template-columns: 300px 1fr; gap: 16px; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, #0F172A, #1E293B); padding: 16px; } .login-card { width: min(400px, 100%); background: var(--surface); border-radius: 14px; padding: 28px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.login-card h1 { margin: 10px 0 4px; } .bar { height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; } .bar > i { display: block; height: 100%; background: var(--accent); }

/* v8/v9: split sign-in hub, SSO/SCIM panel, connector wizard, usage meter */
.okbox { background: #D1FAE5; color: #064E3B; border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.theme-dark .okbox, .okbox.dark { background: #064E3B; color: #D1FAE5; }
.login-wrap.split { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(320px, 440px); place-items: center; gap: 0; padding: 0; }
.login-wrap.split .login-card { width: min(420px, calc(100% - 32px)); margin: 24px; }
.login-pitch { color: #F8FAFC; padding: 48px; max-width: 520px; justify-self: end; } .login-pitch h2 { font-size: 30px; line-height: 1.2; margin: 28px 0 18px; } .login-pitch ul { padding-left: 18px; color: #CBD5E1; line-height: 1.9; }
.ssohint { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--surface-2); border: 1px solid var(--accent); border-radius: 8px; padding: 8px 10px; font-size: 13px; } .ssohint a { font-weight: 700; color: var(--link); }
.copy-row { display: flex; gap: 8px; align-items: center; } .copy-row code { flex: 1; overflow-wrap: anywhere; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font-size: 12px; }
.map-row { display: grid; grid-template-columns: 2fr 1.4fr 1.6fr 34px; gap: 8px; align-items: center; margin: 6px 0; }
.checks { list-style: none; padding: 0; margin: 0; } .checks li { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; } .checks .ok { color: var(--ok); } .checks .no { color: var(--bad); }
.dbgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; } .dbcard { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 12px; cursor: pointer; font: inherit; color: var(--ink); }
.dbcard:hover:not(:disabled) { border-color: var(--accent); } .dbcard.on { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(79,70,229,.25); } .dbcard:disabled { opacity: .55; cursor: not-allowed; } .dbcard small { display: block; color: var(--ink-2); margin-top: 4px; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; } .steps span { padding: 4px 10px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 700; } .steps span.on { background: var(--accent); color: #fff; } .steps span.done { color: var(--ok); }
.meter { position: relative; height: 14px; border-radius: 7px; background: var(--track); overflow: visible; } .meter > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 7px; background: var(--accent); }
.meter .proj { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink-2); } .meter .proj::after { content: attr(data-l); position: absolute; top: 18px; left: -30px; font-size: 11px; color: var(--ink-2); white-space: nowrap; }
.tiercards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; } .tiercard.current { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(79,70,229,.25); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 860px) { .login-wrap.split { grid-template-columns: 1fr; } .login-pitch { display: none; } .map-row { grid-template-columns: 1fr 1fr; } }

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; } .side { position: fixed; left: -260px; width: 240px; z-index: 30; transition: left .2s; } .side.open { left: 0; }
  .menu-toggle { display: inline-grid; } .g4, .g3 { grid-template-columns: repeat(2, 1fr); } .g-main, .api-ex { grid-template-columns: 1fr; } .content { padding: 16px 14px 60px; }
}
@media (max-width: 560px) { .g2, .g3, .g4, .form-grid { grid-template-columns: 1fr; } .rb-cond { grid-template-columns: 22px 1fr 30px; } .rb-cond > :nth-child(3), .rb-cond > :nth-child(4) { grid-column: 2 / 3; } .kv { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print { .side, .topbar, .banner, .btn, .tabs, .toasts { display: none !important; } .app { display: block; } .content { padding: 0; } body { background: #fff; color: #000; } .theme-dark { --bg: #fff; --surface: #fff; --ink: #000; --ink-2: #333; --ink-3: #555; --line: #ccc; } }
