/* ============================================================================
   VisualGuard design tokens. Calm enterprise palette, blue (#2563EB) accent.
   Light is the default; dark keeps the same blue accent on neutral slate.
   Everything reads var(--…) so re-mapping here re-skins the whole app. The
   legacy --pink/--pink-2/--violet names are kept as aliases (now blue) so the
   hundreds of existing call sites recolor without edits. No gradients.
   ============================================================================ */
:root {
  /* dark theme (neutral slate + blue accent) */
  --bg: #0b0e14;
  --panel: #141a24;
  --panel-2: #1b2230;
  --border: #262e3d;
  --text: #e7eaf0;
  --muted: #9aa3b2;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-active: #1d4ed8;
  --pink: #2563eb;      /* alias → primary */
  --pink-2: #3b82f6;    /* alias → brighter accent / links */
  --violet: #60a5fa;    /* alias → secondary blue */
  --blue: #3b82f6;
  --green: #22c55e;
  --teal: #2dd4bf;
  --amber: #f59e0b;
  --red: #ef4444;
  --gray: #6b7280;
  --info: #3b82f6;
  --grad: var(--primary);          /* flat — no gradients */
  --grad-approve: var(--green);
  --grad-mismatch: var(--primary);
  --crit: #b91c1c;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --nav-active-bg: color-mix(in srgb, var(--primary) 20%, var(--panel-2));
  --nav-hover-bg: color-mix(in srgb, var(--panel-2) 65%, transparent);
  color-scheme: dark;
}

/* Light theme — the default & primary palette from the design spec. */
:root[data-theme="light"] {
  --bg: #f8fafc;
  --panel: #ffffff;
  --panel-2: #f1f5f9;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-active: #1e40af;
  --pink: #2563eb;
  --pink-2: #2563eb;
  --violet: #3b82f6;
  --blue: #3b82f6;
  --green: #22c55e;
  --teal: #0d9488;
  --amber: #f59e0b;
  --red: #ef4444;
  --gray: #94a3b8;
  --info: #3b82f6;
  --grad: var(--primary);
  --grad-approve: var(--green);
  --grad-mismatch: var(--primary);
  --crit: #b91c1c;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.04);
  --nav-active-bg: color-mix(in srgb, var(--primary) 10%, #ffffff);
  --nav-hover-bg: #f1f5f9;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.num { font-variant-numeric: tabular-nums; }
a { color: inherit; text-decoration: none; }
/* Screen-reader-only text (announced, never painted). */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

#root { display: grid; grid-template-columns: 220px 1fr; height: 100vh; transition: grid-template-columns 0.24s cubic-bezier(0.4, 0, 0.2, 1); }
html[data-sidebar="collapsed"] #root { grid-template-columns: 68px 1fr; }

/* sidebar */
/* overflow-x hidden keeps the label wipe clean while collapsing; overflow-y
   auto lets a tall nav (WORKSPACE + SCRIPTS + CONFIGURE) scroll instead of
   clipping on short viewports. */
.side { border-right: 1px solid var(--border); display: flex; flex-direction: column; background: var(--panel); overflow-x: hidden; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 14px 14px 16px; font-weight: 700; font-size: 17px; }
.brand-mark { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); }
.brand .logo { width: 32px; height: 32px; flex: none; display: grid; place-items: center; }
.brand .logo svg { width: 32px; height: 32px; display: block; filter: drop-shadow(0 2px 4px rgba(37,99,235,.28)); }
.brand .g { color: var(--pink-2); }
.brand-word { white-space: nowrap; }
.side-toggle { margin-left: auto; width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; flex: none; transition: background 0.15s, color 0.15s; }
.side-toggle:hover { background: var(--panel-2); color: var(--text); border-color: var(--border); }
.side .section { color: #6b7280; font-size: 11px; font-weight: 600; letter-spacing: 0.09em; padding: 18px 18px 8px 20px; white-space: nowrap; }
.side-spacer { flex: 1; }
.nav { position: relative; display: flex; align-items: center; gap: 12px; margin: 1px 8px; padding: 9px 10px 9px 12px; border-radius: 10px; color: var(--muted); cursor: pointer; font-size: 15px; font-weight: 500; white-space: nowrap; }
.nav:hover { background: var(--nav-hover-bg); color: var(--text); }
.nav.active { background: var(--nav-active-bg); color: var(--text); font-weight: 600; }
.nav.active::before { content: ""; position: absolute; left: -8px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 2px 2px 0; background: var(--pink); }
.nav-ico { display: inline-flex; flex: none; opacity: 0.8; }
.nav.active .nav-ico { opacity: 1; }
.nav .nav-label { flex: 1; overflow: hidden; }
.nav .badge { margin-left: auto; background: color-mix(in srgb, var(--pink) 22%, var(--panel)); color: var(--pink-2); border-radius: 999px; font-size: 11px; font-weight: 700; padding: 2px 9px; }
.storchip { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--border); cursor: pointer; white-space: nowrap; }
.storchip:hover { background: var(--panel-2); }
.storchip .sdot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.storchip .sk { font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.storchip .sv { font-size: 13px; font-weight: 600; }
.storchip .aitag { margin-left: auto; font-size: 10px; font-weight: 700; color: #fff; background: var(--grad); border-radius: 5px; padding: 2px 7px; }

/* ---- collapsed sidebar ---- */
html[data-sidebar="collapsed"] .brand { flex-direction: column; gap: 10px; padding: 14px 0 8px; }
html[data-sidebar="collapsed"] .brand-word { display: none; }
html[data-sidebar="collapsed"] .side-toggle { margin-left: 0; }
html[data-sidebar="collapsed"] .side .section { height: 1px; margin: 10px 16px; padding: 0; background: var(--border); overflow: hidden; color: transparent; }
html[data-sidebar="collapsed"] .nav { margin: 2px 10px; padding: 10px; justify-content: center; gap: 0; }
html[data-sidebar="collapsed"] .nav-label { display: none; }
html[data-sidebar="collapsed"] .nav.active::before { left: -10px; }
html[data-sidebar="collapsed"] .nav .badge { position: absolute; top: 1px; right: 3px; margin: 0; padding: 0 5px; font-size: 9px; }
html[data-sidebar="collapsed"] .storchip { justify-content: center; padding: 12px 0; }
html[data-sidebar="collapsed"] .stor-text, html[data-sidebar="collapsed"] .storchip .aitag { display: none; }

/* main */
.main { overflow: hidden; display: flex; flex-direction: column; position: relative; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 16px 24px; padding-right: 232px; border-bottom: 1px solid var(--border); }
.topbar h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
.crumbs { color: var(--muted); font-size: 13px; flex: 1; }
.crumbs b { color: var(--text); }
.content { flex: 1; overflow: auto; padding: 24px; }

/* Four button variants: Primary (blue filled) · Secondary (.ghost) · Danger
   (.reject, red outline) · Ghost (.subtle, text only). ~40px tall, radius 10. */
.btn { border: 1px solid transparent; border-radius: 10px; padding: 10px 16px; font-weight: 600; font-size: 14px; line-height: 1.25; cursor: pointer; color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease; }
.btn.primary { background: var(--primary); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.primary:active { background: var(--primary-active); }
.btn.approve { background: var(--green); }
.btn.approve:hover { background: color-mix(in srgb, var(--green) 88%, #000); }
.btn.ghost { background: var(--panel); border: 1px solid var(--border); color: var(--text); }
.btn.ghost:hover { background: var(--panel-2); border-color: color-mix(in srgb, var(--text) 22%, var(--border)); }
.btn.reject { background: transparent; color: var(--red); border: 1px solid color-mix(in srgb, var(--red) 50%, transparent); }
.btn.reject:hover { background: color-mix(in srgb, var(--red) 10%, transparent); }
/* active review decision */
.btn.approve.done { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--green) 60%, transparent); }
.btn.reject.done { background: color-mix(in srgb, var(--red) 16%, transparent); color: #fca5a5; border-color: color-mix(in srgb, var(--red) 60%, transparent); }
.btn.ghost.done { background: color-mix(in srgb, var(--info) 14%, transparent); color: var(--info); border-color: color-mix(in srgb, var(--info) 45%, transparent); }
.review-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-left: 7px; vertical-align: middle; }
.rv-chip.rejected { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); border: 1px solid color-mix(in srgb, var(--red) 40%, transparent); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn.spin { opacity: 0.7; pointer-events: none; }

.pill { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); }
.pill.review { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 45%, transparent); background: color-mix(in srgb, var(--amber) 12%, transparent); }
.pill.passed { color: var(--green); border-color: color-mix(in srgb, var(--green) 45%, transparent); background: color-mix(in srgb, var(--green) 12%, transparent); }
.pill.running { color: var(--pink-2); }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.tile { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.tile .l { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.tile .n { font-size: 26px; font-weight: 800; margin-top: 6px; }

/* table */
.table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--border); }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: var(--panel-2); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; }

/* review layout */
.review { display: grid; grid-template-columns: 300px 1fr 320px; gap: 0; height: 100%; }
.rev-col { overflow-y: auto; padding: 16px; }
.rev-col.left { border-right: 1px solid var(--border); }
.rev-col.right { border-left: 1px solid var(--border); display: flex; flex-direction: column; }
.group-label { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 12px 2px 8px; display: flex; justify-content: space-between; }
.row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; }
.row:hover { background: var(--panel); }
.row.sel { background: var(--panel); border-color: color-mix(in srgb, var(--pink) 55%, transparent); }
.thumb { width: 46px; height: 30px; border-radius: 5px; object-fit: cover; background: #fff; border: 1px solid var(--border); flex: none; }
.thumb.empty { background: var(--panel-2); }
.row .meta { flex: 1; min-width: 0; }
.row .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .subt { font-size: 11px; color: var(--muted); }
.row .pct { font-size: 12px; font-weight: 600; }

.viewer-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.viewer-head h2 { font-size: 16px; margin: 0; }
.tag { font-size: 11px; padding: 3px 8px; border-radius: 6px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--border); }
.seg { margin-left: auto; display: flex; background: var(--panel); border: 1px solid var(--border); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: none; background: transparent; color: var(--muted); font-size: 12px; padding: 5px 11px; border-radius: 7px; cursor: pointer; }
.seg button.active { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.stage { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 16px; min-height: 320px; }
.sxs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
figure { margin: 0; }
figcaption { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 5px; }
.stage img { width: 100%; display: block; border-radius: 8px; background: #fff; border: 1px solid var(--border); }
.stack { position: relative; }
.stack .top { position: absolute; inset: 0; }
.stack .top img { border: none; }
.slider-wrap { position: relative; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.slider-wrap .over { position: absolute; inset: 0; overflow: hidden; width: 50%; }
.slider-wrap img { border: none; border-radius: 0; }
.tagfloat { position: absolute; top: 8px; font-size: 10px; font-weight: 700; padding: 3px 7px; border-radius: 5px; color: #fff; }
.tagfloat.base { left: 8px; background: #334155; }
.tagfloat.cur { right: 8px; background: var(--pink); }
input[type="range"] { width: 100%; margin-top: 12px; accent-color: var(--pink); }
.empty-note { color: var(--muted); font-style: italic; padding: 40px; text-align: center; }

.mismatch { margin-top: 14px; display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); }
.mismatch .track { flex: 1; height: 8px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.mismatch .fill { height: 100%; background: var(--grad-mismatch); }
.mismatch .val { color: var(--text); font-weight: 600; }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 18px; margin-bottom: 16px; }
.card h3 { font-size: 13px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.ai-dot { width: 18px; height: 18px; border-radius: 5px; background: var(--grad); display: grid; place-items: center; color: #fff; font-size: 12px; }
.pills { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.badge2 { font-size: 10px; font-weight: 700; padding: 4px 9px; border-radius: 6px; color: #fff; }
.badge2.outline { background: transparent; border: 1px solid currentColor; }
.ai p { margin: 0; line-height: 1.55; }
.unavailable { color: var(--muted); font-style: italic; }
.details { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; }
.details .k { font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.details .v { font-size: 13px; font-weight: 600; }
.actions { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }
.hint { font-size: 11px; color: var(--muted); text-align: center; }

.banner { background: color-mix(in srgb, var(--red) 15%, transparent); border: 1px solid color-mix(in srgb, var(--red) 45%, transparent); color: #fecaca; padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }

/* project switcher (Builds topbar) */
.projsel { background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 13px; font-weight: 600; }
.crumbs[style] { flex: 0 0 auto; }

/* projects grid */
.proj-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 900px) { .proj-grid { grid-template-columns: 1fr; } }
.proj-card { min-width: 0; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 18px; cursor: pointer; transition: border-color 0.15s; }
.proj-card:hover { border-color: color-mix(in srgb, var(--pink) 40%, var(--border)); }
.proj-card.sel { border-color: var(--pink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pink) 40%, transparent); }
.phead { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.pav { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 18px; flex: none; }
.pmeta { flex: 1; min-width: 0; }
.pname { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pid { margin-left: 8px; font-size: 11px; font-weight: 600; color: var(--muted); font-family: ui-monospace, Menlo, monospace; }
.prepo { font-size: 12px; color: var(--muted); font-family: ui-monospace, Menlo, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phead > .pill { flex: 0 0 auto; display: inline-flex; align-items: center; white-space: nowrap; width: auto; }
.pstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.pstat-l { font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.pstat-n { font-size: 18px; font-weight: 800; margin-top: 3px; }
.pfoot { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); padding-top: 12px; }
.pfoot-l { font-size: 13px; }
.pfoot-r { display: flex; align-items: center; gap: 8px; }
.envchips { display: flex; gap: 5px; }
.envchip { font-size: 9px; font-weight: 700; letter-spacing: 0.04em; color: var(--muted); border: 1px solid var(--border); border-radius: 5px; padding: 2px 6px; }

/* ---- Environments ---- */
.env-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.env-card { min-width: 0; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.env-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.kind { font-size: 10px; font-weight: 700; letter-spacing: 0.04em; padding: 3px 9px; border-radius: 999px; }
.k-staging { color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, transparent); border: 1px solid color-mix(in srgb, var(--blue) 38%, transparent); }
.k-qa { color: var(--teal); background: color-mix(in srgb, var(--teal) 14%, transparent); border: 1px solid color-mix(in srgb, var(--teal) 40%, transparent); }
.k-prod { color: var(--amber); background: color-mix(in srgb, var(--amber) 14%, transparent); border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent); }
.env-name { font-weight: 700; font-size: 15px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.env-lat { font-size: 12px; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.env-lat .ldot { width: 7px; height: 7px; border-radius: 50%; }
.lat-ok { color: #22c55e; } .lat-ok .ldot { background: #22c55e; }
.lat-slow { color: #f59e0b; } .lat-slow .ldot { background: #f59e0b; }
.lat-down { color: #ef4444; } .lat-down .ldot { background: #ef4444; }
textarea.field { resize: vertical; min-height: 120px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.env-url { background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 12px; margin-bottom: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.allow-box { border: 1px dashed var(--border); border-radius: 9px; padding: 10px; min-height: 96px; }
.allow-title { font-size: 10px; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 8px; }
.allow-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.allow-chip { font-size: 10px; font-family: ui-monospace, Menlo, monospace; color: var(--text); background: var(--panel-2); border: 1px solid var(--border); border-radius: 5px; padding: 3px 6px; }
.allow-more { font-size: 10px; color: var(--muted); background: var(--panel-2); border: 1px solid var(--border); border-radius: 5px; padding: 3px 6px; }
.deny { font-size: 10px; font-weight: 600; color: #f87171; }

.env-bottom { display: grid; grid-template-columns: 1fr 360px; gap: 16px; align-items: start; }
.matrix-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.matrix-note { color: var(--muted); font-size: 12px; margin-top: 6px; max-width: 620px; line-height: 1.5; }
.muted-sm { color: var(--muted); font-size: 11px; font-weight: 500; }
.refresh { color: var(--pink-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.matrix-grid { display: grid; align-items: center; row-gap: 6px; column-gap: 10px; }
.mcol { text-align: center; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.mcol-name { font-size: 12px; font-weight: 600; }
.mcol-kind { font-size: 9px; letter-spacing: 0.06em; color: var(--muted); margin-top: 2px; }
.mrow-id { display: flex; align-items: center; gap: 10px; padding: 12px 0; }
.id-av { width: 30px; height: 30px; border-radius: 7px; flex: none; opacity: 0.85; }
.id-name { font-weight: 700; }
.id-kind { font-size: 11px; color: var(--muted); font-family: ui-monospace, Menlo, monospace; }
.mcell { display: flex; justify-content: center; }
.sess { font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: 7px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.sess .sdotc { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sess-none { color: var(--muted); border: 1px dashed var(--border); font-weight: 500; }
.sess-na { color: color-mix(in srgb, var(--muted) 70%, transparent); border: 1px dashed var(--border); font-weight: 500; }
.sess-fresh { color: #22c55e; background: color-mix(in srgb, #22c55e 12%, transparent); border: 1px solid color-mix(in srgb, #22c55e 40%, transparent); }
.sess-expiring { color: #f59e0b; background: color-mix(in srgb, #f59e0b 12%, transparent); border: 1px solid color-mix(in srgb, #f59e0b 40%, transparent); }
.sess-expired { color: #ef4444; background: color-mix(in srgb, #ef4444 14%, transparent); border: 1px solid color-mix(in srgb, #ef4444 45%, transparent); }
.sess-refresh { color: #60a5fa; background: color-mix(in srgb, #3b82f6 14%, transparent); border: 1px solid color-mix(in srgb, #3b82f6 45%, transparent); }
.sess-readonly { color: #22c55e; border: 1px solid color-mix(in srgb, #22c55e 40%, transparent); }
.matrix-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); margin-top: 14px; padding-top: 12px; }
.legend { display: flex; align-items: center; gap: 16px; font-size: 11px; color: var(--muted); }
.leg { display: inline-flex; align-items: center; gap: 6px; }
.leg .ldotc { width: 7px; height: 7px; border-radius: 50%; }
.leg-red { color: #f87171; }

.sandbox-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.sbx-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.sbx-row:last-child { border-bottom: none; }
.sbx-k { display: inline-flex; align-items: center; }
.sbx-k .chk { color: #22c55e; font-weight: 700; }
.sbx-v { color: var(--muted); }

/* modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: grid; place-items: center; z-index: 50; }
.modal { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 22px; width: 440px; max-width: 92vw; }
.modal h3 { margin: 0 0 4px; font-size: 17px; }
.modal-sub { color: var(--muted); font-size: 12px; margin-bottom: 16px; }
.field { width: 100%; background: var(--panel); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-bottom: 10px; }
.field:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
select.field { appearance: none; cursor: pointer; }
.field-label { font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin: 4px 2px 6px; }
.env-manage-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.manage-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-family: ui-monospace, Menlo, monospace; color: var(--text); background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; padding: 4px 5px 4px 9px; }
.chip-x { border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; }
.chip-x:hover { color: #f87171; }
.modal-err { color: #fca5a5; font-size: 12px; min-height: 16px; margin-bottom: 6px; }
.modal-actions { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.btn.danger { background: transparent; color: #f87171; border: 1px solid color-mix(in srgb, var(--red) 50%, transparent); }
.icon-btn { flex: none; background: transparent; border: 1px solid var(--border); color: var(--muted); border-radius: 7px; width: 26px; height: 26px; cursor: pointer; font-size: 12px; line-height: 1; }
.icon-btn:hover { color: var(--pink-2); border-color: color-mix(in srgb, var(--pink) 50%, transparent); }
.icon-btn.danger-icon:hover { color: #f87171; border-color: color-mix(in srgb, var(--red) 55%, transparent); }
.mrow-id .icon-btn { margin-left: auto; }

/* attach-environment picker */
.attach-list { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow: auto; margin-bottom: 12px; }
.attach-row { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--border); border-radius: 9px; }
.attach-meta { flex: 1; min-width: 0; }
.attach-name { font-weight: 700; font-size: 13px; }

/* ---- project mode + branch chips ---- */
.modetag { font-size: 9px; font-weight: 800; letter-spacing: 0.05em; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.modetag.ci { color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); border: 1px solid color-mix(in srgb, var(--primary) 42%, transparent); }
.modetag.monitor { color: var(--teal); background: color-mix(in srgb, var(--teal) 14%, transparent); border: 1px solid color-mix(in srgb, var(--teal) 42%, transparent); }
.pname .modetag { margin-left: 8px; vertical-align: middle; }
.arrow { color: var(--pink-2); font-weight: 700; }
.mode-note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); line-height: 1.5; margin: 2px 2px 12px; }

/* info banner (monitor / preview notices) */
.note-banner { background: color-mix(in srgb, var(--violet) 10%, var(--panel)); border: 1px solid color-mix(in srgb, var(--violet) 35%, var(--border)); color: var(--text); padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 13px; line-height: 1.55; }
.note-banner a { color: var(--pink-2); font-weight: 600; }

/* ---- baselines ledger ---- */
.env-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.env-tab { display: inline-flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--border); color: var(--muted); border-radius: 9px; padding: 8px 12px; cursor: pointer; font-size: 13px; }
.env-tab:hover { color: var(--text); }
.env-tab.active { border-color: var(--pink); color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pink) 35%, transparent); }
.env-tab-n { font-size: 10px; font-weight: 700; background: var(--panel-2); border-radius: 999px; padding: 1px 7px; color: var(--muted); }
.lineage-head { display: flex; align-items: center; gap: 10px; margin: 18px 2px 10px; }
.branch-chip { font-size: 12px; font-weight: 700; color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent); border-radius: 999px; padding: 3px 9px; }
.baseline-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 1100px) { .baseline-grid { grid-template-columns: repeat(2, 1fr); } }
.bl-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.bl-thumb { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-radius: 8px; background: #fff; border: 1px solid var(--border); }
.bl-thumb.empty { background: var(--panel-2); }
.bl-name { font-weight: 700; font-size: 14px; }
.bl-sub { margin-top: 3px; }
.btn.sm { padding: 6px 10px; font-size: 12px; align-self: flex-start; }

/* version / rollback list */
.ver-list { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow: auto; margin-bottom: 12px; }
.ver-row { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--border); border-radius: 9px; }
.ver-row.active { border-color: color-mix(in srgb, var(--green) 45%, transparent); background: color-mix(in srgb, var(--green) 8%, transparent); }
.ver-thumb { width: 64px; height: 40px; object-fit: cover; object-position: top; border-radius: 5px; background: #fff; border: 1px solid var(--border); flex: none; }
.ver-meta { flex: 1; min-width: 0; }

/* schedule enabled dots */
.dot-on { color: var(--green); font-weight: 600; }
.dot-off { color: var(--muted); }

/* ================= Project dashboard ================= */
.proj-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.ph-id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.pav.lg { width: 52px; height: 52px; border-radius: 13px; font-size: 22px; }
.ph-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ph-title h1 { font-size: 22px; margin: 0; }
/* .pill's "review" modifier collides with the .review layout grid — pin it back. */
.ph-title .pill, .ph-title .modetag { flex: 0 0 auto; width: auto; align-self: center; display: inline-flex; align-items: center; white-space: nowrap; }
.ph-sub { margin-top: 5px; font-size: 12px; }
.phmetrics { display: flex; gap: 26px; flex: none; padding-top: 4px; }
.phm { text-align: right; }
.phm-l { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.phm-n { font-size: 20px; font-weight: 800; margin-top: 4px; }
.phm-n.good { color: var(--green); }

.proj-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.ptab { position: relative; padding: 11px 14px; color: var(--muted); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.ptab:hover { color: var(--text); }
.ptab.active { color: var(--text); border-bottom-color: var(--pink); }
.ptab-n { margin-left: 7px; font-size: 11px; font-weight: 700; color: var(--muted); background: var(--panel-2); border-radius: 999px; padding: 1px 7px; }
.ptab.active .ptab-n { color: var(--primary); background: color-mix(in srgb, var(--primary) 16%, transparent); }
.tab-actions { display: flex; justify-content: flex-end; gap: 10px; margin-bottom: 14px; }

.dash-grid { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dash-rail { display: flex; flex-direction: column; gap: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-head h3 { margin: 0; font-size: 14px; }
.card-link { color: var(--pink-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.rail-card h3 { font-size: 13px; }

/* build bar chart */
.bchart { display: flex; align-items: flex-end; gap: 10px; height: 140px; padding: 8px 2px 0; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.bcol { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; justify-content: flex-end; }
.bar { width: 100%; max-width: 64px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px 6px 3px 3px; position: relative; overflow: hidden; cursor: pointer; display: flex; align-items: flex-start; }
.bar:hover { border-color: color-mix(in srgb, var(--pink) 50%, var(--border)); }
.bar-changed { width: 100%; background: var(--grad); }
.bcol-l { font-size: 10px; color: var(--muted); font-family: ui-monospace, Menlo, monospace; }

/* recent builds list */
.rb-list { display: flex; flex-direction: column; }
.rb-row { display: flex; align-items: center; gap: 12px; padding: 11px 6px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 13px; }
.rb-row:last-child { border-bottom: none; }
.rb-row:hover { background: var(--panel-2); border-radius: 8px; }
.rb-num { font-weight: 800; width: 42px; flex: none; }
.rb-ref { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rb-src { flex: 1; }
.rb-counts { white-space: nowrap; }
.c-changed { color: var(--pink-2); font-weight: 700; }
.c-new { color: var(--blue); font-weight: 700; }
.c-same { color: var(--muted); }
.rb-status { font-weight: 600; white-space: nowrap; width: 90px; text-align: right; }
.rb-when { width: 120px; text-align: right; flex: none; }

/* pages rows */
.pg-row { display: flex; align-items: center; gap: 14px; padding: 12px 6px; border-bottom: 1px solid var(--border); }
.pg-row:last-child { border-bottom: none; }
.pg-id { flex: 1; min-width: 0; }
.pg-name { font-weight: 700; font-size: 14px; }
.pg-path { margin-top: 2px; }
.pg-vp { color: var(--muted); }
.idchip { font-size: 11px; color: #93c5fd; background: color-mix(in srgb, #3b82f6 14%, transparent); border: 1px solid color-mix(in srgb, #3b82f6 35%, transparent); border-radius: 6px; padding: 3px 8px; white-space: nowrap; }
.pg-mask { font-size: 11px; color: var(--teal); }

/* baselines-by-branch rail */
.bb-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.bb-row:last-child { border-bottom: none; }
.bb-row.clickable { cursor: pointer; padding: 10px 8px; margin: 0 -8px; border-radius: 8px; border-bottom: 1px solid var(--border); }
.bb-row.clickable:hover { background: var(--panel-2); }
.bb-row.clickable .card-link { margin-left: auto; }
.bb-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.bb-meta { flex: 1; min-width: 0; }
.bb-branch { font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bb-ver { color: var(--muted); }
.bb-tag { font-size: 9px; font-weight: 800; padding: 2px 6px; border-radius: 4px; }
.bb-tag.active { color: var(--green); border: 1px solid color-mix(in srgb, var(--green) 45%, transparent); }
.bb-tag.stale { color: var(--muted); border: 1px solid var(--border); }

/* members rail */
.mem-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.mem-av { width: 30px; height: 30px; border-radius: 50%; flex: none; }
.mem-meta { flex: 1; min-width: 0; }
.mem-name { font-weight: 700; font-size: 13px; }
.role { font-size: 9px; font-weight: 800; letter-spacing: 0.04em; padding: 3px 8px; border-radius: 999px; color: var(--muted); border: 1px solid var(--border); }
.role.super { color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); border-color: color-mix(in srgb, var(--primary) 45%, transparent); }

/* integrations rail */
.intg-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.intg-row:last-child { border-bottom: none; }
.intg-name { font-weight: 700; font-size: 13px; }
.conn-ok { color: var(--green); font-size: 12px; font-weight: 600; white-space: nowrap; }
.conn-off { color: var(--muted); font-size: 12px; white-space: nowrap; }
.br-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }

/* ---- Build execution status indicators ---- */
.exec { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.exec-ico { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; font-size: 13px; line-height: 1; }
.exec-queued { color: var(--amber); }
.exec-queued .exec-ico { animation: vg-pulse 1.2s ease-in-out infinite; }
.exec-running { color: var(--pink-2); }
.exec-running .exec-ico { animation: vg-spin 0.8s linear infinite; }
.exec-passed { color: var(--green); }
.exec-failed { color: var(--red); }
.exec-cancelled { color: var(--muted); }
@keyframes vg-spin { to { transform: rotate(360deg); } }
@keyframes vg-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.8); } }
@media (prefers-reduced-motion: reduce) { .exec-ico { animation: none !important; } }
.build-cell { display: flex; align-items: center; gap: 10px; }
.rb-num { display: inline-flex; align-items: center; gap: 6px; }
.pill.running { display: inline-flex; align-items: center; gap: 5px; color: var(--pink-2); border-color: color-mix(in srgb, var(--pink) 45%, transparent); }

/* review chips (kept visually distinct from execution status) */
.rv-chip { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.rv-chip.needs { color: var(--amber); background: color-mix(in srgb, var(--amber) 14%, transparent); border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent); }
.rv-chip.approved { color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); border: 1px solid color-mix(in srgb, var(--green) 40%, transparent); }

/* ---- Scripts tab (tree of /tests + selection) ---- */
.scr-status { font-size: 12px; font-weight: 600; white-space: nowrap; }
.scripts-layout { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .scripts-layout { grid-template-columns: 1fr; } }
.scr-search { margin-bottom: 8px; }
.scr-tree { max-height: 62vh; overflow: auto; }
.tree-folder { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 7px; cursor: pointer; font-weight: 600; font-size: 13px; user-select: none; }
.tree-folder:hover { background: var(--panel-2); }
.tree-caret { width: 12px; color: var(--muted); font-size: 10px; }
.tree-fname { flex: 1; }
.tree-file { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.tree-file:hover { background: var(--panel-2); }
.tree-file input { accent-color: var(--pink); width: 15px; height: 15px; flex: none; cursor: pointer; }
.tree-filename { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-mtime { flex: none; }
.sel-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.sel-row:last-child { border-bottom: none; }
.sel-meta { flex: 1; min-width: 0; }
.sel-name { font-weight: 700; font-size: 13px; }
.sel-path { margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-row.disabled { opacity: 0.55; }

/* ---- Scripts section (workspace: Generate / Manage) ---- */
.scr-manage-bar { justify-content: space-between; align-items: flex-end; }
.scr-proj-pick { min-width: 260px; }
.gen-layout { grid-template-columns: minmax(380px, 0.95fr) minmax(0, 1.05fr); }
@media (max-width: 1439px) { .gen-layout { grid-template-columns: 1fr; } }
.gen-col { min-width: 0; }
.gen-out { position: sticky; top: 18px; min-width: 0; }
.gen-out-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.gen-out-t { font-size: 16px; font-weight: 650; }
.gen-path { display: block; margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.gen-out-btns { display: flex; gap: 8px; flex: none; }
.gen-code { margin: 0; padding: 14px 16px; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 12px; font-size: 12px; line-height: 1.6; color: var(--text);
  max-height: 60vh; overflow: auto; white-space: pre; tab-size: 2; }
.gen-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.gen-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 26px; gap: 10px; align-items: center; }
.gen-row-head { margin-bottom: 6px; }
.gen-row-head label { font-size: 12px; font-weight: 600; color: var(--muted); }
.inp.mono { color: var(--text); font-size: 13px; }

/* soft elevation reads better than borders alone on light surfaces */
.card, .modal, .proj-card, .env-card, .tile { box-shadow: var(--shadow); }

/* ================= Projects (engineering-platform view) ================= */
.proj-page { display: flex; flex-direction: column; }

/* operational stat strip (also acts as status filters) */
.proj-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.ptile { flex: 1 1 0; min-width: 120px; text-align: left; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; cursor: pointer; transition: border-color .12s, background .12s; box-shadow: var(--shadow); }
.ptile:hover { border-color: color-mix(in srgb, var(--pink) 35%, var(--border)); }
.ptile.active { border-color: var(--pink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pink) 30%, transparent), var(--shadow); }
.ptile-n { font-size: 22px; font-weight: 800; line-height: 1; }
.ptile-l { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.ptile.t-amber .ptile-n { color: var(--amber); }
.ptile.t-red .ptile-n { color: var(--red); }
.ptile.t-pink .ptile-n { color: var(--pink-2); }
.ptile.t-green .ptile-n { color: var(--green); }

/* toolbar */
.proj-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.proj-searchbox { position: relative; display: flex; align-items: center; flex: 1 1 260px; min-width: 220px; }
.srch-ico { position: absolute; left: 11px; color: var(--muted); display: inline-flex; pointer-events: none; }
.proj-search { width: 100%; background: var(--panel); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 9px 12px 9px 34px; font-size: 13px; }
.proj-search::placeholder { color: var(--muted); }
.proj-search:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pink) 18%, transparent); }
.proj-seg button, .proj-viewseg button { font-size: 12px; }
.proj-viewseg button { min-width: 34px; font-size: 14px; }
.proj-sort { background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; font-size: 12px; font-weight: 600; cursor: pointer; }
.proj-sort:focus { outline: none; border-color: var(--pink); }

/* dense list */
.proj-list { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.pr-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--border); cursor: pointer; color: inherit; }
.pr-row:last-child { border-bottom: none; }
.pr-row:hover { background: var(--panel-2); }
.pr-row.sel { box-shadow: inset 3px 0 0 var(--pink); }
.pr-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); }
.st-running .pr-dot { background: var(--pink-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pink) 22%, transparent); }
.st-review .pr-dot { background: var(--amber); }
.st-failing .pr-dot { background: var(--red); }
.st-passing .pr-dot { background: var(--green); }
.st-none .pr-dot { background: var(--muted); opacity: .5; }
.pr-av { width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px; }
.pr-main { flex: 1 1 auto; min-width: 0; }
.pr-name { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; }
.pr-name .modetag, .pmc-name + .modetag, .pmc-head .modetag { flex: none; }
.pr-sub { color: var(--muted); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-metrics { display: flex; gap: 20px; flex: none; }
.pm { text-align: right; min-width: 44px; }
.pm-n { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pm-n.good { color: var(--green); } .pm-n.warn { color: var(--amber); } .pm-n.bad { color: var(--red); }
.pm-l { font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.pr-build { display: inline-flex; align-items: center; gap: 8px; flex: none; min-width: 210px; justify-content: flex-end; font-size: 12px; }
.pr-edit { flex: none; opacity: 0.45; }
.pr-row:hover .pr-edit, .pm-card:hover .pr-edit { opacity: 1; }
.pm-card .pr-edit { position: relative; z-index: 1; }
@media (max-width: 1080px) { .proj-metrics { display: none; } .pr-build { min-width: 0; } }

/* grid */
.proj-mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.pm-card { display: block; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 14px; cursor: pointer; color: inherit; box-shadow: var(--shadow); transition: border-color .12s; }
.pm-card:hover { border-color: color-mix(in srgb, var(--pink) 40%, var(--border)); }
.pm-card.sel { border-color: var(--pink); }
.pmc-head { display: flex; align-items: center; gap: 10px; }
.pmc-name { flex: 1 1 auto; min-width: 0; font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pmc-sub { color: var(--muted); font-size: 12px; margin: 8px 0 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pmc-metrics { display: flex; gap: 22px; }
.pmc-metrics .pm { text-align: left; }
.pmc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--border); margin-top: 12px; padding-top: 10px; }
.pmc-foot .pr-build { min-width: 0; justify-content: flex-start; }

.proj-footer { padding: 14px 2px 4px; }

/* ================= Console tab (live build logs) ================= */
.console-wrap { display: flex; flex-direction: column; gap: 14px; }

/* status header */
.cstatus { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); }
.cstatus-main { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.cstatus-num { font-size: 16px; font-weight: 800; }
.cstatus-fields { display: flex; flex-wrap: wrap; gap: 26px; }
.cfield-k { font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.cfield-v { font-size: 13px; font-weight: 600; margin-top: 3px; font-variant-numeric: tabular-nums; }

/* progress */
.cprogress { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); }
.cprog-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; }
.cprog-track { height: 8px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.cprog-fill { height: 100%; background: var(--grad); border-radius: 999px; transition: width .4s ease; }
.cprog-fill.live { background-image: linear-gradient(90deg, var(--pink-2), var(--violet), var(--pink-2)); background-size: 200% 100%; animation: cprog-shimmer 1.4s linear infinite; }
@keyframes cprog-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .cprog-fill.live { animation: none; } }

/* counters */
.ccounters { display: flex; gap: 10px; flex-wrap: wrap; }
.cc { flex: 1 1 0; min-width: 92px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; box-shadow: var(--shadow); }
.cc-n { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cc-n.good { color: var(--green); } .cc-n.bad { color: var(--red); } .cc-n.info { color: var(--blue); } .cc-n.warn { color: var(--amber); }
.cc-l { font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }

/* toolbar */
.console-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.console-toolbar .btn.sm.active { color: var(--pink-2); border-color: color-mix(in srgb, var(--pink) 45%, transparent); }
.cerr-nav { display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; }
.cerr-count { color: var(--red); white-space: nowrap; }

/* log viewport — terminal feel */
.console-log { background: color-mix(in srgb, var(--panel-2) 60%, var(--bg)); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; height: 52vh; overflow: auto; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.7; box-shadow: var(--shadow); }
.clog-line { display: flex; gap: 10px; padding: 0 6px; border-left: 2px solid transparent; white-space: pre-wrap; word-break: break-word; }
.clog-line:hover { background: color-mix(in srgb, var(--panel) 55%, transparent); }
.clog-t { color: var(--muted); flex: none; }
.clog-lvl { flex: none; width: 62px; font-weight: 700; }
.clog-msg { flex: 1; min-width: 0; }
.lv-info .clog-lvl { color: var(--blue); }
.lv-success .clog-lvl { color: var(--green); }
.lv-warn .clog-lvl { color: var(--amber); }
.lv-error { border-left-color: var(--red); background: color-mix(in srgb, var(--red) 8%, transparent); }
.lv-error .clog-lvl, .lv-error .clog-msg { color: var(--red); }
.lv-debug .clog-lvl { color: var(--muted); } .lv-debug .clog-msg { color: var(--muted); }
.lv-system .clog-lvl { color: var(--violet); }
.clog-line.err-focus { outline: 1px solid var(--red); background: color-mix(in srgb, var(--red) 16%, transparent); }

/* ---- baseline groups (STAGING / PROD) ---- */
.group-badge { font-size: 10px; font-weight: 800; letter-spacing: 0.05em; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.group-badge.g-staging { color: #93c5fd; background: color-mix(in srgb, #3b82f6 16%, transparent); border: 1px solid color-mix(in srgb, #3b82f6 42%, transparent); }
.group-badge.g-prod { color: #fcd34d; background: color-mix(in srgb, #f59e0b 16%, transparent); border: 1px solid color-mix(in srgb, #f59e0b 42%, transparent); }
.env-tab .group-badge { font-size: 11px; }
.bl-source { margin: 0 2px 14px; }
.bl-source-sm { margin-top: 4px; }

/* ======================================================================
   Overview dashboard — the project command center (renderOverview).
   ====================================================================== */
.overview-content { padding: 20px 24px; }
.quick-actions { display: flex; align-items: center; gap: 8px; }
.qa-wrap { position: relative; }
.qa-menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; min-width: 180px; z-index: 40; display: none; }
.qa-menu.open { display: block; }
.qa-item { display: block; width: 100%; text-align: left; background: transparent; border: none; color: var(--text); font-size: 13px; padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.qa-item:hover { background: var(--panel-2); }
.btn.active-cust { border-color: var(--pink); color: var(--pink-2); }

.cust-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: color-mix(in srgb, var(--pink) 8%, var(--panel)); border: 1px dashed color-mix(in srgb, var(--pink) 45%, var(--border)); border-radius: 10px; padding: 10px 12px; margin-bottom: 16px; }
.cust-hint { font-size: 12px; color: var(--muted); }
.chip-btn { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; cursor: pointer; }
.chip-btn:hover { border-color: var(--pink); }
.chip-btn.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); }

.ov-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1200px) { .ov-grid > .ov-w { grid-column: span 6 !important; } }
@media (max-width: 720px) { .ov-grid > .ov-w { grid-column: span 12 !important; } }
.ov-w { min-width: 0; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; }
.ov-w-head { display: flex; align-items: center; gap: 8px; padding: 13px 15px; border-bottom: 1px solid var(--border); }
.ov-w-head h3 { font-size: 13px; margin: 0; flex: 1; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.ov-w-body { padding: 15px; }
.ov-w-ctrl { display: flex; align-items: center; gap: 2px; }
.ov-ico { background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 12px; width: 24px; height: 24px; border-radius: 6px; }
.ov-ico:hover { background: var(--panel-2); color: var(--text); }
.ov-ico.danger:hover { color: var(--red); }
.ov-drag { cursor: grab; color: var(--muted); font-size: 14px; }
.ov-grid.customizing .ov-w { border-style: dashed; border-color: color-mix(in srgb, var(--pink) 30%, var(--border)); }
.ov-w.ov-draggable { cursor: grab; }
.ov-w.dragging { opacity: 0.5; }
.ov-w.drop-target { border-color: var(--pink); box-shadow: inset 0 0 0 1px var(--pink); }
.w-badge { font-size: 9px; font-weight: 800; color: #fff; background: var(--grad); border-radius: 5px; padding: 2px 6px; letter-spacing: 0.04em; }
.w-link { display: inline-block; margin-top: 12px; color: var(--pink-2); font-size: 12px; font-weight: 600; }
.w-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.est-tag { font-size: 9px; font-weight: 700; color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 1px 4px; margin-left: 6px; text-transform: uppercase; letter-spacing: 0.03em; }
.soon-tag { font-size: 9px; font-weight: 700; color: var(--violet); border: 1px solid color-mix(in srgb, var(--violet) 40%, transparent); border-radius: 4px; padding: 1px 5px; margin-left: 6px; }
.link { color: var(--pink-2); }

/* empty states */
.ov-hero { text-align: center; padding: 44px 20px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 16px; }
.ov-hero-ico { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 14px; background: var(--grad); display: grid; place-items: center; color: #fff; font-size: 24px; }
.ov-hero h2 { margin: 0 0 8px; font-size: 18px; }
.ov-hero p { margin: 0 auto 16px; max-width: 460px; color: var(--muted); line-height: 1.55; }
.ov-empty { text-align: center; padding: 22px 10px; color: var(--muted); }
.ov-empty-ico { width: 34px; height: 34px; margin: 0 auto 8px; border-radius: 9px; background: var(--panel-2); display: grid; place-items: center; color: var(--green); font-size: 16px; }

/* KPI cards */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 1200px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .kpi-grid { grid-template-columns: 1fr; } }
.kpi { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 13px 14px; position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--violet); }
.kpi.tone-good::before { background: var(--green); } .kpi.tone-warn::before { background: var(--amber); } .kpi.tone-bad::before { background: var(--red); }
.kpi-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.kpi-l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.kpi-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.kpi-mid { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin: 8px 0 6px; }
.kpi-n { font-size: 25px; font-weight: 800; line-height: 1; }
.spark { display: inline-flex; opacity: 0.95; }
.kpi-foot { display: flex; align-items: center; gap: 4px; }
.kpi-tr { font-size: 11px; font-weight: 600; }
.kpi-tr.tr-good { color: var(--green); } .kpi-tr.tr-bad { color: var(--red); } .kpi-tr.tr-flat { color: var(--muted); }

/* charts */
.svg-chart { width: 100%; overflow: hidden; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.cl-item { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.cl-swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.seg.mini { padding: 2px; }
.seg.mini button { padding: 3px 9px; font-size: 11px; }

/* tables in widgets */
.ov-table { border-radius: 10px; }
.ov-table th { padding: 9px 12px; }
.ov-table td { padding: 10px 12px; font-size: 13px; }
.ov-table .rb-num { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.rv-name { display: flex; align-items: center; gap: 4px; }
.rev-actions { display: flex; gap: 5px; }
.mini-btn { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 7px; cursor: pointer; }
.mini-btn:hover { border-color: var(--pink); }
.mini-btn.ok { color: var(--green); border-color: color-mix(in srgb, var(--green) 40%, transparent); }
.mini-btn.no { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); }

/* environment health rows */
.env-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.env-row:last-child { border-bottom: none; }
.env-status-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 12%, transparent); }
.env-row-meta { flex: 1; min-width: 0; }
.env-row-name { font-weight: 600; display: flex; align-items: center; gap: 7px; }
.env-badge { font-size: 11px; font-weight: 700; }

/* meters (browsers / frameworks / health factors) */
.bar-row { margin-bottom: 12px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-row-top { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; margin-bottom: 5px; }
.meter { height: 7px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.meter.sm { height: 6px; }
.meter-fill { height: 100%; border-radius: 999px; }

/* console tail */
.con-tail { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; display: flex; flex-direction: column; gap: 3px; }
.con-line { display: flex; gap: 8px; }
.con-t { color: var(--muted); flex: none; }
.con-m { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.con-line.lv-success .con-m { color: var(--green); }
.con-line.lv-warn .con-m { color: var(--amber); }
.con-line.lv-error .con-m { color: var(--red); }
.con-line.lv-system .con-m { color: var(--violet); }
.con-line.lv-debug .con-m { color: var(--muted); }

/* queue */
.queue-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.queue-row:last-child { border-bottom: none; }
.queue-meta { min-width: 0; }
.q-run { color: var(--violet); font-size: 11px; font-weight: 700; }
.q-wait { color: var(--muted); font-size: 11px; font-weight: 700; }

/* feed rows (baseline / team / notifications) */
.feed-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.feed-row:last-child { border-bottom: none; }
.feed-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: none; }
.feed-meta { flex: 1; min-width: 0; }
.feed-verb { font-weight: 600; }
.mem-av.sm { width: 24px; height: 24px; flex: none; }

/* repository */
.repo-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.gh-ico { width: 24px; height: 24px; border-radius: 7px; background: var(--panel-2); display: grid; place-items: center; color: var(--text); }
.repo-grid { display: grid; grid-template-columns: 1fr; gap: 9px; }
.repo-kv { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.repo-kv:last-child { border-bottom: none; }
.repo-k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.repo-v { font-size: 13px; font-weight: 600; text-align: right; }

/* health */
.health-wrap { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.gauge { position: relative; width: 130px; height: 130px; flex: none; margin: 0 auto; }
.gauge-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gauge-n { font-size: 34px; font-weight: 800; line-height: 1; }
.gauge-band { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }
.health-factors { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 8px; }
.hf-row { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.hf-l { flex: 0 0 118px; color: var(--muted); }
.hf-row .meter { flex: 1; }
.hf-n { flex: 0 0 24px; text-align: right; font-weight: 700; }

/* insights */
.insight { display: flex; gap: 10px; align-items: flex-start; padding: 9px 11px; border-radius: 10px; background: var(--panel-2); margin-bottom: 8px; font-size: 13px; line-height: 1.5; }
.insight:last-child { margin-bottom: 0; }
.ins-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: none; }

/* performance */
.perf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 560px) { .perf-grid { grid-template-columns: repeat(2, 1fr); } }
.perf-cell { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px; }
.perf-l { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 5px; }
.perf-n { font-size: 19px; font-weight: 800; }

/* storage */
.storage-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.storage-used { font-size: 22px; font-weight: 800; }
.stack-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--panel-2); margin-bottom: 14px; }
.stack-seg { height: 100%; }
.storage-legend { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 16px; }
.sl-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.sl-l { flex: 1; }

/* ======================================================================
   Review lifecycle (identity dedup) — state chips, Reviews page, build detail.
   ====================================================================== */
.rstate-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; border: 1px solid currentColor; background: color-mix(in srgb, currentColor 10%, transparent); }
.rstate-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.rv-chip.superseded { color: var(--muted); background: color-mix(in srgb, var(--muted) 12%, transparent); border: 1px solid color-mix(in srgb, var(--muted) 40%, transparent); }

/* Reviews page */
.rev-section-head { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; }
.rev-section-head h3 { margin: 0; font-size: 15px; }
.rev-count { background: color-mix(in srgb, var(--amber) 18%, var(--panel)); color: var(--amber); font-weight: 800; font-size: 12px; padding: 2px 10px; border-radius: 999px; }
.rev-count.req { background: color-mix(in srgb, var(--red) 16%, var(--panel)); color: var(--red); }
.rev-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 900px) { .rev-grid { grid-template-columns: 1fr; } }
.rev-card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.rev-card-top { display: flex; gap: 14px; }
.rev-thumb { width: 96px; height: 64px; border-radius: 8px; object-fit: cover; object-position: top; background: #fff; border: 1px solid var(--border); flex: none; }
.rev-thumb.empty { background: var(--panel-2); }
.rev-card-meta { min-width: 0; flex: 1; }
.rev-card-name { font-size: 15px; margin-bottom: 4px; }
.rev-card-lineage { padding: 8px 10px; background: var(--panel-2); border-radius: 8px; }
.rev-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.sm { padding: 6px 12px; font-size: 12px; }
.btn.reject.sm { background: transparent; }

/* build detail — result-at-completion vs current-state summary */
.rev-build-summary { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 6px; }
.rbs-row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; padding: 3px 0; }
.rbs-row span:first-child { color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; font-size: 10px; }

/* build detail — superseded/auto-resolved occurrence (not actionable in place) */
.superseded-note { display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--panel-2); border: 1px dashed var(--border); border-radius: 12px; margin-top: auto; }
.superseded-note p { margin: 0; color: var(--muted); line-height: 1.5; font-size: 12.5px; }

/* build detail — snapshot lifecycle metadata */
.lifecycle { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.life-state { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.life-state .k { font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.life-kv { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; padding: 4px 0; border-bottom: 1px solid var(--border); }
.life-kv:last-child { border-bottom: none; }
.life-kv .k { color: var(--muted); }
.rv-name-cell .muted-sm { margin-top: 2px; }

/* ======================================================================
   Settings — admin danger zone, audit log, toasts.
   ====================================================================== */
.danger-zone { border: 1px solid color-mix(in srgb, var(--red) 45%, var(--border)); border-radius: 14px; padding: 16px; margin-bottom: 14px; background: color-mix(in srgb, var(--red) 6%, var(--panel)); }
.dz-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.dz-head h3 { margin: 0; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.dz-ico { color: var(--red); font-size: 16px; }
.dz-role { font-size: 11px; font-weight: 700; color: var(--violet); border: 1px solid color-mix(in srgb, var(--violet) 40%, transparent); border-radius: 999px; padding: 3px 10px; }
.dz-warn { font-size: 12px; line-height: 1.5; color: color-mix(in srgb, var(--red) 55%, var(--text)); background: color-mix(in srgb, var(--red) 10%, transparent); border-radius: 9px; padding: 10px 12px; margin-bottom: 14px; }
.dz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 900px) { .dz-grid { grid-template-columns: 1fr; } }
.dz-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.dz-card-head { display: flex; align-items: center; gap: 9px; }
.dz-card-ico { width: 30px; height: 30px; border-radius: 8px; background: color-mix(in srgb, var(--red) 14%, var(--panel-2)); color: var(--red); display: grid; place-items: center; font-size: 15px; flex: none; }
.dz-card-head h4 { margin: 0; font-size: 14px; }
.dz-card-desc { margin: 0; font-size: 12px; line-height: 1.55; color: var(--muted); flex: 1; }
.btn.danger-btn { background: var(--red); color: #fff; align-self: flex-start; }
.btn.danger-btn:hover { background: color-mix(in srgb, var(--red) 85%, #000); }
.btn.danger-btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.dz-modal-warn { font-size: 13px; line-height: 1.55; background: color-mix(in srgb, var(--red) 10%, transparent); border: 1px solid color-mix(in srgb, var(--red) 35%, transparent); border-radius: 9px; padding: 11px 12px; margin: 8px 0 4px; }

/* audit log */
.audit-card .card-head { display: flex; align-items: center; justify-content: space-between; }
.audit-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.audit-row:last-child { border-bottom: none; }
.audit-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: none; }
.audit-meta { flex: 1; min-width: 0; }
.audit-status { font-size: 11px; font-weight: 700; }
.audit-who { text-align: right; white-space: nowrap; }

/* toasts */
.toast-host { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast { min-width: 260px; max-width: 420px; padding: 12px 16px; border-radius: 10px; font-size: 13px; font-weight: 600; color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,0.35); opacity: 0; transform: translateY(10px); transition: opacity 0.25s, transform 0.25s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: var(--green); }
.toast-error { background: var(--red); }
.toast-info { background: var(--grad); }

/* ======================================================================
   Workspace Dashboard — cross-project widgets.
   ====================================================================== */
/* running builds */
.run-row { padding: 10px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.run-row:last-child { border-bottom: none; }
.run-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.run-proj { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.run-sub { margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* projects requiring attention — status chip */
.band-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; border: 1px solid currentColor; background: color-mix(in srgb, currentColor 10%, transparent); }
/* project health rows */
.ph-row { padding: 9px 0; border-bottom: 1px solid var(--border); }
.ph-row:last-child { border-bottom: none; }
.ph-row.clickable { cursor: pointer; }
.ph-row-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.ph-name { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13px; min-width: 0; }
/* recent activity rows */
.ra-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.ra-row:last-child { border-bottom: none; }
.ra-meta { flex: 1; min-width: 0; }
.ra-right { text-align: right; white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
/* repository activity rows */
.repo-act-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.repo-act-row:last-child { border-bottom: none; }
.repo-act-meta { flex: 1; min-width: 0; }
.repo-act-meta .mono { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gh-ico.sm { width: 24px; height: 24px; font-size: 13px; flex: none; }

/* ======================================================================
   User Settings — enterprise tabbed account experience.
   ====================================================================== */
/* Full-width content (no stranded right column). A generous cap keeps line
   lengths sane on ultra-wide displays while filling 1440–1920px screens. */
.settings-page { max-width: 1680px; }

/* avatars with initials */
.uav { border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; flex: none; letter-spacing: 0.02em; }
.uav.sm { width: 32px; height: 32px; font-size: 12px; }
.uav.xl { width: 68px; height: 68px; font-size: 24px; box-shadow: 0 4px 14px rgba(0,0,0,0.25); }

/* role badge */
.role-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
  padding: 4px 11px 4px 9px; border-radius: 999px; border: 1px solid var(--border); color: var(--text); background: var(--panel-2); white-space: nowrap; }
.role-badge .rb-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gray); }
.role-badge.role-super_admin { color: var(--violet); border-color: color-mix(in srgb, var(--violet) 45%, transparent); background: color-mix(in srgb, var(--violet) 12%, transparent); }
.role-badge.role-super_admin .rb-dot { background: var(--violet); }
.role-badge.role-admin { color: var(--blue); border-color: color-mix(in srgb, var(--blue) 45%, transparent); background: color-mix(in srgb, var(--blue) 12%, transparent); }
.role-badge.role-admin .rb-dot { background: var(--blue); }
.role-badge.role-user { color: var(--muted); }

/* identity hero */
.settings-hero { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.sh-meta { min-width: 0; }
.sh-name { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 700; }
.sh-mail { color: var(--muted); font-size: 13px; margin-top: 3px; }
.sh-sub { color: var(--muted); font-size: 13.5px; margin-top: 8px; max-width: 640px; line-height: 1.5; }

/* sticky tabs */
.settings-tabs { position: sticky; top: 0; z-index: 5; background: var(--bg); padding-top: 2px; margin-bottom: 22px; }
.settings-body { display: block; }

/* setting cards */
.set-card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 24px; margin-bottom: 18px; box-shadow: var(--shadow); }
.sc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.sc-head h3 { margin: 0; font-size: 16px; font-weight: 650; }
.sc-desc { margin: 4px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; flex-basis: 100%; }
.sc-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* form grid + controls — auto-fit packs fields to the available width so
   forms grow from 2 columns (≈1024px) up to 4 (≈1920px) instead of leaving
   a stranded column. Single-column forms (password) stay narrow. */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px 24px; }
.form-grid.one { grid-template-columns: 1fr; max-width: 480px; }
.fld { display: flex; flex-direction: column; gap: 7px; }
.fld > label { font-size: 12px; font-weight: 600; color: var(--muted); }
.fld-hint { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.inp { width: 100%; background: var(--panel); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.inp:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
select.inp { cursor: pointer; }
select.inp.sm { padding: 6px 8px; font-size: 12.5px; width: auto; min-width: 130px; }
.btn.subtle { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.btn.subtle:hover { color: var(--text); }
.btn.subtle.sm, .btn.sm { padding: 6px 12px; font-size: 12px; }
.btn.danger-text { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); }

/* avatar editor */
.avatar-edit { display: flex; align-items: center; gap: 18px; }
.ae-actions { display: flex; flex-direction: column; gap: 8px; }
.ae-btns { display: flex; gap: 10px; }

/* segmented control */
.segmented { display: inline-flex; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 3px; }
.segmented .seg { border: none; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; padding: 7px 16px; border-radius: 8px; cursor: pointer; }
.segmented .seg:hover { color: var(--text); }
.segmented .seg.active { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }

/* preference / toggle rows */
.pref-row, .tgl-row, .mfa-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.set-card .pref-row:first-of-type, .set-card .tgl-row:first-of-type, .set-card .mfa-row:first-of-type { padding-top: 0; }
.set-card .pref-row:last-child, .set-card .tgl-row:last-child, .set-card .mfa-row:last-child { border-bottom: none; padding-bottom: 0; }
.tgl-txt { min-width: 0; }
.tgl-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.tgl-desc { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.45; }

/* switch */
.switch { position: relative; width: 42px; height: 24px; border-radius: 999px; border: none; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--border); cursor: pointer; flex: none; transition: background 0.18s; }
.switch .sw-knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform 0.18s, background 0.18s; }
.switch.on { background: var(--grad); box-shadow: none; }
.switch.on .sw-knob { transform: translateX(18px); background: #fff; }

/* status chips */
.st-chip { display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); white-space: nowrap; }
.st-good { color: var(--green); border-color: color-mix(in srgb, var(--green) 40%, transparent); background: color-mix(in srgb, var(--green) 12%, transparent); }
.st-warn { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 40%, transparent); background: color-mix(in srgb, var(--amber) 12%, transparent); }
.st-bad { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); background: color-mix(in srgb, var(--red) 12%, transparent); }
.st-info { color: var(--blue); border-color: color-mix(in srgb, var(--blue) 40%, transparent); background: color-mix(in srgb, var(--blue) 12%, transparent); }
.st-muted { color: var(--muted); }
.st-neutral { color: var(--text); }

/* data tables (settings) */
.data-table tbody tr { cursor: default; }
.data-table tbody tr:hover { background: color-mix(in srgb, var(--panel-2) 55%, transparent); }
.data-table td { vertical-align: middle; }
.cell-strong { font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.member-cell { display: flex; align-items: center; gap: 11px; }
.tag-cur { font-size: 10px; font-weight: 700; color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); border-radius: 5px; padding: 2px 7px; }
.row-actions { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.icon-action { width: 30px; height: 30px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; display: grid; place-items: center; }
.icon-action:hover { background: var(--panel-2); color: var(--text); border-color: var(--border); }
.icon-action.danger-text:hover { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); }

/* team + audit toolbars */
.team-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.team-toolbar .inp:first-child { flex: 1; min-width: 200px; }
.team-count { margin-left: auto; }

/* tokens */
.scope-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.scope-chip { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--violet); background: color-mix(in srgb, var(--violet) 12%, transparent); border: 1px solid color-mix(in srgb, var(--violet) 30%, transparent); border-radius: 6px; padding: 2px 8px; }
.tok-ico { font-size: 13px; }
.scope-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin-bottom: 10px; }
.scope-opt { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); }
.token-reveal { background: var(--panel-2); border: 1px dashed color-mix(in srgb, var(--pink) 50%, var(--border)); border-radius: 9px; padding: 12px 14px; font-size: 13px; word-break: break-all; margin: 6px 0 14px; user-select: all; }

/* role access matrix */
.matrix-table th { text-align: center; }
.matrix-table th:first-child { text-align: left; }
.matrix-table td.matrix-cell { text-align: center; }
.mx-yes { color: var(--green); font-weight: 800; }
.mx-no { color: var(--gray); }

/* system settings */
.sys-note { font-size: 13px; color: var(--muted); line-height: 1.5; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; }
.sys-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; margin-bottom: 16px; }
.sys-grid .set-card { margin-bottom: 0; }
.sys-rows { display: flex; flex-direction: column; }
.sys-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.sys-row:last-child { border-bottom: none; }
.sys-k { color: var(--muted); }
.sys-v { font-weight: 600; text-align: right; }

/* keep resets full-width under the system grid */
.settings-body .danger-zone { margin-top: 4px; }

@media (max-width: 640px) {
  .scope-grid { grid-template-columns: 1fr; }
}

/* ======================================================================
   Top-right account menu + avatars (GitHub / Vercel / Datadog pattern).
   ====================================================================== */
.uav.md { width: 44px; height: 44px; font-size: 16px; }
.uav-img { background-size: cover; background-position: center; color: transparent; }

.acct { position: absolute; top: 11px; right: 20px; z-index: 40; }
.acct-btn { display: flex; align-items: center; gap: 10px; background: transparent; border: 1px solid transparent; border-radius: 10px; padding: 5px 8px 5px 6px; cursor: pointer; color: var(--text); }
.acct-btn:hover, .acct.open .acct-btn { background: var(--panel-2); border-color: var(--border); }
.acct-meta { text-align: left; line-height: 1.2; }
.acct-name { font-size: 13px; font-weight: 650; }
.acct-role { font-size: 11px; color: var(--muted); }
.acct-caret { color: var(--muted); display: inline-flex; transition: transform 0.18s; }
.acct.open .acct-caret { transform: rotate(180deg); }
.acct-menu { position: absolute; top: calc(100% + 8px); right: 0; width: 268px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 14px 36px rgba(0,0,0,0.38); padding: 8px; opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity 0.16s ease, transform 0.16s ease; }
.acct.open .acct-menu { opacity: 1; transform: translateY(0); pointer-events: auto; }
.acct-head { display: flex; gap: 12px; align-items: center; padding: 8px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.acct-head-meta { min-width: 0; }
.acct-head-name { font-size: 14px; font-weight: 700; }
.acct-head-mail { font-size: 11.5px; color: var(--muted); margin: 1px 0 7px; }
.acct-item { display: flex; align-items: center; gap: 11px; width: 100%; background: transparent; border: none; color: var(--text); font-size: 13px; font-weight: 500; padding: 9px 10px; border-radius: 8px; cursor: pointer; text-align: left; }
.acct-item:hover { background: var(--panel-2); }
.acct-item-ico { display: inline-flex; color: var(--muted); flex: none; }
.acct-item-lbl { flex: 1; }
.acct-item.danger { color: var(--red); }
.acct-item.danger .acct-item-ico { color: var(--red); }
.acct-theme { flex-direction: column; align-items: stretch; gap: 9px; cursor: default; }
.acct-theme:hover { background: transparent; }
.acct-theme-head { display: flex; align-items: center; gap: 11px; }
.acct-theme .segmented { width: 100%; padding: 2px; }
.acct-theme .seg { flex: 1; padding: 5px 0; font-size: 12px; }
.acct-sep { height: 1px; background: var(--border); margin: 6px 4px; }

/* Keyboard shortcuts modal */
.kbd-list { display: flex; flex-direction: column; margin: 6px 0 14px; }
.kbd-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 2px; border-bottom: 1px solid var(--border); font-size: 13px; }
.kbd-row:last-child { border-bottom: none; }
.kbd-keys { display: flex; gap: 5px; }
kbd { font-family: ui-monospace, "SFMono-Regular", monospace; font-size: 11px; background: var(--panel-2); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: 3px 7px; color: var(--text); }

/* When the account label is hidden (narrow), reclaim the reserved topbar space. */
@media (max-width: 1180px) {
  .acct-meta { display: none; }
  .topbar { padding-right: 86px; }
}

/* ======================================================================
   Reports + Pipelines pages.
   ====================================================================== */
.rep-card { display: flex; align-items: flex-start; gap: 14px; text-align: left; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px; cursor: pointer; color: var(--text); box-shadow: var(--shadow); transition: border-color 0.15s, transform 0.1s; }
.rep-card:hover { border-color: color-mix(in srgb, var(--pink) 45%, var(--border)); transform: translateY(-1px); }
.rep-ico { width: 38px; height: 38px; border-radius: 10px; background: color-mix(in srgb, var(--violet) 14%, var(--panel-2)); color: var(--violet); display: grid; place-items: center; flex: none; }
.rep-body { flex: 1; min-width: 0; }
.rep-title { font-size: 14px; font-weight: 650; }
.rep-desc { font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.rep-go { color: var(--muted); font-size: 18px; align-self: center; }
.rep-card:hover .rep-go { color: var(--pink-2); }
.rep-dot { display: inline-flex; color: var(--violet); }
.fmt-chip { font-size: 10.5px; font-weight: 700; color: var(--muted); background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; }
.integ-card { margin-bottom: 0 !important; }
.integ-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.integ-title { font-size: 14px; font-weight: 650; }

/* ======================================================================
   Projects page — reuses the Dashboard shell (.ov-w) + metric card (.kpi).
   ====================================================================== */
.proj-dash { margin-bottom: 16px; }              /* section spacing (matches .ov-grid gap) */
/* `.ov-section` (app.js) is a marker class only — it tags an `.ov-w` widget used
   standalone rather than inside the 12-col grid, and carries no styles of its own. */
.sec-info { display: inline-flex; color: var(--muted); cursor: help; margin-left: 2px; }
.ov-w-head h3 .sec-info svg { display: block; }
/* the shared metric card, made clickable for the Project-Status filter tiles */
.kpi.clickable { cursor: pointer; text-align: left; width: 100%; font: inherit; color: inherit; appearance: none; -webkit-appearance: none; transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s; }
.kpi.clickable:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); transform: translateY(-1px); }
.kpi.active { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.kpi-desc { font-size: 11px; font-weight: 600; color: var(--muted); }
.kpi-grid.proj-metrics.cols-5 { grid-template-columns: repeat(5, 1fr); }

.proj-health-seg button { font-weight: 600; }

/* enterprise list */
.proj-list { display: flex; flex-direction: column; gap: 10px; }
.pl-row { display: grid; grid-template-columns: minmax(230px, 1.7fr) 128px 118px 104px 128px 104px 120px 40px; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); transition: border-color 0.12s, box-shadow 0.12s; }
.pl-row:hover { border-color: color-mix(in srgb, var(--primary) 32%, var(--border)); }
.pl-row.sel { border-color: var(--primary); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 40%, transparent), var(--shadow); }
.pl-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pl-av { width: 38px; height: 38px; border-radius: 10px; flex: none; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 16px; }
.pl-idmeta { min-width: 0; }
.pl-name { display: flex; align-items: center; gap: 8px; }
.pl-nm { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-sub { display: flex; align-items: center; gap: 8px; margin-top: 3px; min-width: 0; }
.pl-repo { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.pl-cell-l { font-size: 10.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; white-space: nowrap; }
.pl-cell-v { font-size: 13.5px; font-weight: 600; }
.pl-cell-v .num { font-variant-numeric: tabular-nums; }
.pl-cell-v .num.amber { color: var(--amber); font-weight: 700; }
.lb-status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.lb-status .exec-ico { font-size: 13px; }
.lb-status.exec-passed { color: var(--green); }
.lb-status.exec-failed { color: var(--red); }
.lb-status.exec-running { color: var(--primary); }
.lb-status.exec-queued, .lb-status.exec-cancelled { color: var(--muted); }
.pl-spark { display: flex; align-items: center; justify-content: flex-end; height: 34px; }
.pl-spark.empty { min-height: 34px; }

/* overflow menu */
.ovm { position: relative; justify-self: end; }
.ovm-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.ovm-btn:hover { background: var(--panel-2); color: var(--text); border-color: var(--border); }
.ovm-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; min-width: 168px; background: var(--panel); border: 1px solid var(--border); border-radius: 11px; box-shadow: 0 12px 30px rgba(15,23,42,0.22); padding: 6px; opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity 0.14s, transform 0.14s; }
.ovm.open .ovm-menu { opacity: 1; transform: translateY(0); pointer-events: auto; }
.ovm-item { display: flex; align-items: center; gap: 10px; width: 100%; background: transparent; border: none; color: var(--text); font-size: 13px; font-weight: 500; padding: 8px 9px; border-radius: 8px; cursor: pointer; text-align: left; }
.ovm-item:hover { background: var(--panel-2); }
.ovm-item .ovm-ico { display: inline-flex; color: var(--muted); flex: none; }
.ovm-item.danger { color: var(--red); } .ovm-item.danger .ovm-ico { color: var(--red); }

/* enterprise card grid */
.proj-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.pcard { display: flex; flex-direction: column; gap: 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); transition: border-color 0.12s, transform 0.1s; }
.pcard:hover { border-color: color-mix(in srgb, var(--primary) 32%, var(--border)); transform: translateY(-1px); }
.pcard.sel { border-color: var(--primary); }
.pcard-head { display: flex; align-items: flex-start; gap: 12px; }
.pcard-idmeta { flex: 1; min-width: 0; }
.pcard-status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pcard-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; border-top: 1px solid var(--border); padding-top: 14px; }
.pcm-n { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.pcm-n.amber { color: var(--amber); }
.pcm-l { font-size: 11px; color: var(--muted); margin-top: 2px; }
.pcard-spark { height: 30px; }
.pcard-spark .spark svg { width: 100%; }

/* footer + pager */
.proj-footer { padding: 16px 2px 4px; display: flex; align-items: center; justify-content: space-between; }
.pager { display: flex; align-items: center; gap: 6px; }
.pg-btn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel); color: var(--muted); cursor: pointer; }
.pg-btn[disabled] { opacity: 0.5; cursor: default; }
.pg-num { min-width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 8px; font-size: 13px; font-weight: 600; }
.pg-num.active { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent); }

@media (max-width: 1120px) {
  .kpi-grid.proj-metrics.cols-5 { grid-template-columns: repeat(3, 1fr); }
  .kpi-grid.proj-metrics { grid-template-columns: repeat(2, 1fr); }
  .pl-row { grid-template-columns: minmax(190px, 1.5fr) 116px 104px 96px 120px 96px 40px; }
  .pl-row .pl-spark { display: none; }
}

/* ======================================================================
   Authentication screens (login / change password).
   Rendered without the app shell — #root is the full viewport here.
   ====================================================================== */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; background: var(--bg); grid-column: 1 / -1; }
.auth-card { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; padding: 32px; box-shadow: 0 10px 40px rgba(15, 23, 42, 0.10), var(--shadow); }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 24px; }
.auth-logo { width: 48px; height: 48px; }
.auth-logo svg { width: 48px; height: 48px; display: block; }
.auth-word { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.auth-word .g { color: var(--primary); }
.auth-tagline { font-size: 9.5px; font-weight: 700; letter-spacing: 0.18em; color: var(--muted); }
.auth-title { font-size: 20px; font-weight: 700; margin: 0 0 4px; text-align: center; }
.auth-sub { font-size: 13px; color: var(--muted); text-align: center; margin: 0 0 22px; line-height: 1.5; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form .fld { gap: 6px; }
.auth-error { font-size: 13px; font-weight: 500; color: var(--red); min-height: 18px; line-height: 1.45; }
.auth-error:not(:empty) { background: color-mix(in srgb, var(--red) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--red) 30%, transparent); border-radius: 9px; padding: 9px 11px; }
.auth-submit { width: 100%; justify-content: center; margin-top: 2px; }
.auth-foot { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border);
  text-align: center; font-size: 12px; color: var(--muted); }

/* password field with show/hide */
.pw-wrap { position: relative; display: flex; align-items: center; }
.pw-wrap .inp { padding-right: 62px; }
.pw-toggle { position: absolute; right: 6px; height: 28px; padding: 0 9px; border-radius: 7px;
  border: 1px solid transparent; background: transparent; color: var(--muted);
  font-size: 12px; font-weight: 600; cursor: pointer; }
.pw-toggle:hover { background: var(--panel-2); color: var(--text); border-color: var(--border); }

.pw-reqs-wrap { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; }
.pw-reqs-h { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.pw-reqs { margin: 0; padding: 0; list-style: none; font-size: 12.5px; line-height: 1.5; }

/* Live requirement rows: gray dot while unmet, green check once satisfied. */
.pw-req { display: flex; align-items: flex-start; gap: 7px; padding: 2.5px 0; color: var(--muted); transition: color 0.15s ease; }
.pw-req-ico { flex: none; display: grid; place-items: center; width: 16px; height: 19px; color: var(--muted); transition: color 0.15s ease; }
.pw-req-ico svg { display: block; }
.pw-req.ok { color: var(--text); }
.pw-req.ok .pw-req-ico { color: var(--green); }
.pw-req-t { min-width: 0; }

/* Confirmation match hint (mirrors the same dot/check language). */
.pw-match { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); min-height: 18px; }
.pw-match:empty { display: none; }
.pw-match.ok { color: var(--green); }
.pw-match.ok .pw-req-ico, .pw-match.bad .pw-req-ico { color: inherit; }

@media (prefers-reduced-motion: reduce) {
  .pw-req, .pw-req-ico { transition: none; }
}

/* ======================================================================
   User / member management widgets.
   ====================================================================== */
.assign-rows, .assign-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.assign-list { max-height: 240px; overflow: auto; }
.assign-row { display: flex; align-items: center; gap: 8px; }
.assign-row > select { flex: 1; min-width: 0; }
.assign-name { flex: 1; min-width: 0; }
.assign-name .cell-strong, .assign-name .muted-sm { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; color: inherit; font: inherit; }
.pick-row:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); background: var(--panel-2); }
.pick-row.sel { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.vg-members .data-table td { vertical-align: middle; }
.vg-members .sc-actions { justify-content: flex-start; }

/* Wide admin tables scroll horizontally instead of clipping their last column. */
.scroll-x { overflow-x: auto; }
.scroll-x > .table { min-width: 980px; }
/* Keep the user filters on one row: the search grows, the selects stay compact. */
.team-toolbar > select.inp { width: auto; flex: 0 0 auto; min-width: 132px; }
