/* JNV Employee Portal v4.0: design system
   Brand: the JNV AI Worx brand guide v1.2 (palette, type, graphic language) with the JNV Ventures gold mark.
   Rules: docs/DESIGN_GUIDE_V4.md. Every colour, radius, shadow and motion value is a token defined here.
   Theme: html[data-theme="light"|"dark"]; the "system" preference is resolved by theme.js and main.js.
   Class names are a contract with the page scripts: restyle, never rename. */

/* ============================================================ fonts (self-hosted) */
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/Unbounded-400.ttf") format("truetype"); }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/fonts/Unbounded-600.ttf") format("truetype"); }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 800; font-display: swap; src: url("/static/fonts/Unbounded-800.ttf") format("truetype"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/Manrope-400.ttf") format("truetype"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/fonts/Manrope-500.ttf") format("truetype"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 700; font-display: swap; src: url("/static/fonts/Manrope-700.ttf") format("truetype"); }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url("/static/fonts/InstrumentSerif-Italic.ttf") format("truetype"); }

/* ============================================================ tokens */
:root {
  /* type */
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Unbounded", "Manrope", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-accent: "Instrument Serif", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Courier New", monospace;
  --fs-xs: 11px; --fs-sm: 12px; --fs: 13.5px; --fs-md: 14px; --fs-lg: 16px; --fs-xl: 22px; --fs-kpi: 24px;
  /* spacing scale (use these, not ad-hoc values) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px;
  --page-x: 24px; --page-y: 20px; --gap: 16px;
  /* shape */
  --r-sm: 8px; --r: 10px; --r-lg: 16px; --r-xl: 16px; --r-tile: 12px; --r-pill: 999px;
  --ctl-h: 36px; --ctl-h-sm: 28px; --ctl-h-lg: 44px;
  /* layout */
  --rail-w: 72px; --sb-w: 264px; --top-h: 60px; --content-max: 1680px;
  /* motion */
  --ease: cubic-bezier(.22,.8,.24,1); --t: .16s; --t-slide: .22s;

  /* brand palette (JNV AI Worx brand guide v1.2) */
  --ink: #0A1828; --blue: #106EBE; --bright: #00ABE4; --turq: #178582; --mint: #0FFCBE; --gold: #BFA181;
  --steel: #B2B5E0; --pastel: #C5ADC5; --light: #E9F1FA; --lilac: #F8F8F9; --white: #FFFFFF; --graphite: #55627A;
  --signal: linear-gradient(90deg, #106EBE 0%, #00ABE4 55%, #0FFCBE 100%);
  --grad: var(--signal);
  --grad-soft: linear-gradient(135deg, rgba(16,110,190,.10), rgba(0,171,228,.08));
  --dotted: rgba(16,110,190,.30);

  /* sidebar: Dark Classic Blue in both themes so the gold mark reads well */
  --sb-bg: #0A1828; --sb-bg-2: #0E2238; --sb-text: #C9D4E3; --sb-muted: #7F8FA8; --sb-line: rgba(255,255,255,.08);
  --sb-hover: rgba(255,255,255,.06); --sb-active: rgba(0,171,228,.16); --sb-active-text: #FFFFFF; --sb-icon-active: #0FFCBE;
  --sb-icon: #8FA0B8; --sb-tip: #13294A;

  /* light theme (default) */
  --bg: #F8F8F9; --surface: #FFFFFF; --surface-solid: #FFFFFF; --surface-2: #F3F6FA; --surface-3: #E9F1FA; --elev: #FFFFFF;
  --line: #DCE4EE; --line-2: #E8EEF5; --line-strong: #C3CFDD;
  --text: #0A1828; --text-2: #1F2D40; --muted: #55627A; --faint: #8A95A8;
  --primary: #106EBE; --primary-h: #0E62A9; --primary-a: #0B548F; --primary-fg: #FFFFFF; --primary-soft: #E9F1FA; --primary-text: #0E62A9;
  --kicker: #106EBE; --accent-text: #55627A;
  --focus: 0 0 0 3px rgba(16,110,190,.32);
  --good: #178582; --good-bg: #E3F4F2; --good-line: #B6E0DA;
  --warn: #B7791F; --warn-bg: #FBF3E0; --warn-line: #F0D9A3;
  --bad: #C8373E; --bad-bg: #FCE9EA; --bad-line: #F3BFC2;
  --info: #106EBE; --info-bg: #E9F1FA; --info-line: #BFD6EE;
  --violet: #6B5B95; --violet-bg: #EFEAF5;
  --hold-bg: rgba(197,173,197,.40); --hold-fg: #55627A;
  --grey-bg: #EEF1F5; --grey-fg: #55627A;
  --live: #178582; --live-glow: rgba(23,133,130,.18);
  --shadow-sm: 0 1px 2px rgba(10,24,40,.05);
  --shadow: 0 2px 10px rgba(10,24,40,.06);
  --shadow-lg: 0 18px 48px rgba(10,24,40,.18);
  --shadow-sb: 8px 0 32px rgba(10,24,40,.28);
  --overlay: rgba(10,24,40,.45);
  --row-hover: #E9F1FA; --zebra: #F4F8FC; --input-bg: #FFFFFF; --kcol: #F3F6FA;
  --toast-bg: #0A1828; --toast-fg: #FFFFFF; --toast-line: rgba(255,255,255,.08);
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2355627A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --chart-grid: rgba(10,24,40,.08); --chart-text: #55627A;
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #0A1828; --surface: rgba(255,255,255,.06); --surface-solid: #192635; --surface-2: #0F2440; --surface-3: #15305A; --elev: #13294A;
  --line: rgba(255,255,255,.14); --line-2: rgba(255,255,255,.09); --line-strong: rgba(255,255,255,.24);
  --text: #FFFFFF; --text-2: #DCE4EE; --muted: #B2B5E0; --faint: #7F8FA8;
  --primary: #00ABE4; --primary-h: #2BC0F2; --primary-a: #0096C9; --primary-fg: #0A1828; --primary-soft: rgba(0,171,228,.16); --primary-text: #6FD3F7;
  --kicker: #0FFCBE; --accent-text: #B2B5E0;
  --focus: 0 0 0 3px rgba(0,171,228,.40);
  --good: #0FFCBE; --good-bg: rgba(15,252,190,.12); --good-line: rgba(15,252,190,.30);
  --warn: #F2C14E; --warn-bg: rgba(242,193,78,.14); --warn-line: rgba(242,193,78,.32);
  --bad: #FF7B7B; --bad-bg: rgba(255,123,123,.14); --bad-line: rgba(255,123,123,.32);
  --info: #6FD3F7; --info-bg: rgba(0,171,228,.14); --info-line: rgba(111,211,247,.32);
  --violet: #C5ADC5; --violet-bg: rgba(197,173,197,.16);
  --hold-bg: rgba(197,173,197,.18); --hold-fg: #DCE4EE;
  --grey-bg: rgba(178,181,224,.12); --grey-fg: #B2B5E0;
  --live: #0FFCBE; --live-glow: rgba(15,252,190,.18);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.30);
  --shadow: 0 2px 12px rgba(0,0,0,.28);
  --shadow-lg: 0 22px 56px rgba(0,0,0,.55);
  --overlay: rgba(4,10,18,.62);
  --row-hover: rgba(255,255,255,.05); --zebra: rgba(255,255,255,.025); --input-bg: #0F2440; --kcol: rgba(255,255,255,.03);
  --toast-bg: #13294A; --toast-fg: #FFFFFF; --toast-line: rgba(255,255,255,.14);
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B2B5E0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --chart-grid: rgba(220,228,238,.10); --chart-text: #B2B5E0;
  color-scheme: dark;
}
@media (max-width: 1440px) { :root { --page-x: 20px; --gap: 14px; } }

/* ============================================================ base */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: var(--fs); line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-feature-settings: "tnum" 0; }
a { color: var(--primary-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
b, strong { font-weight: 700; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
::selection { background: rgba(16,110,190,.22); }
html[data-theme="dark"] ::selection { background: rgba(0,171,228,.32); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.skip { position: absolute; left: 8px; top: -40px; z-index: 500; background: var(--primary); color: var(--primary-fg); padding: 8px 12px; border-radius: var(--r-sm); font-weight: 700; }
.skip:focus { top: 8px; }
svg.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.ic.sm { width: 15px; height: 15px; } svg.ic.lg { width: 22px; height: 22px; } svg.ic.flip { transform: rotate(180deg); }
svg.ic.brand { stroke: none; }
kbd { font-family: var(--font); font-size: 10.5px; font-weight: 700; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; padding: 0 5px; color: var(--muted); background: var(--surface-solid); line-height: 1.6; }
h1, h2, h3, h4, h5 { color: var(--text); }

/* ============================================================ app frame */
/* The sidebar is fixed; the content keeps a constant left offset (the rail) so it never jumps when the
   sidebar slides open over it. Only pinning changes the offset. */
.app { min-height: 100vh; padding-left: var(--rail-w); transition: padding-left var(--t-slide) var(--ease); }
.app.pinned { padding-left: var(--sb-w); }
.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }

/* ============================================================ sidebar */
.sidebar { position: fixed; z-index: 60; top: 0; bottom: 0; left: 0; width: var(--rail-w); display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--sb-bg) 0%, var(--sb-bg-2) 100%); color: var(--sb-text); overflow: hidden;
  border-right: 1px solid var(--sb-line); transition: width var(--t-slide) var(--ease), box-shadow var(--t-slide) var(--ease); }
.app.sb-expanded .sidebar { width: var(--sb-w); }
.app.sb-open:not(.pinned) .sidebar { box-shadow: var(--shadow-sb); }
.sb-head { display: flex; align-items: center; gap: var(--s1); height: var(--top-h); padding: 0 6px 0 14px; border-bottom: 1px solid var(--sb-line); flex: none; }
.sb-brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; color: inherit; text-decoration: none !important; }
.sb-brand img { width: 40px; height: auto; flex: none; display: block; }
.sb-brand .bt { min-width: 0; transition: opacity var(--t) var(--ease); }
.sb-brand b { display: block; color: #FFFFFF; font-family: var(--font-display); font-weight: 600; font-size: 12px; line-height: 1.2; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-brand span { display: block; font-size: 11px; line-height: 1.35; color: var(--sb-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.sb-pin { border: 0; background: transparent; color: var(--sb-muted); width: 28px; height: 28px; border-radius: var(--r-sm); display: grid; place-items: center; cursor: pointer; flex: none; transition: color var(--t), background var(--t), opacity var(--t); }
.sb-pin:hover { color: #FFFFFF; background: var(--sb-hover); }
.app.pinned .sb-pin { color: var(--sb-icon-active); }
.app:not(.sb-expanded) .sb-brand .bt { width: 0; opacity: 0; overflow: hidden; }
.app:not(.sb-expanded) .sb-pin { display: none; }
.app:not(.sb-expanded) .sb-head { padding: 0; justify-content: center; }
.app:not(.sb-expanded) .sb-brand { flex: none; }

.nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: var(--s2) 0 var(--s4); scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.14) transparent; }
.nav .sec { display: flex; align-items: center; height: 28px; margin: 12px 0 2px; padding: 0 24px; font-family: var(--font-display); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 2px; color: var(--sb-muted); white-space: nowrap; }
.nav .sec::before { content: ""; display: none; }
.app:not(.sb-expanded) .nav .sec { justify-content: center; padding: 0; font-size: 0; letter-spacing: 0; }
.app:not(.sb-expanded) .nav .sec::before { display: block; width: 24px; height: 1px; background: var(--sb-line); }
.nav .grp:first-child .sec { margin-top: 2px; }
.nav a, .nav .sub-toggle { position: relative; display: flex; align-items: center; gap: 12px; height: 40px; margin: 2px 12px; padding: 0 12px; border-radius: var(--r); color: var(--sb-text); font-size: 13px; font-weight: 500; white-space: nowrap; text-decoration: none !important; border: 0; background: transparent; cursor: pointer; width: calc(100% - 24px); text-align: left; transition: background var(--t), color var(--t); }
.nav a:hover, .nav .sub-toggle:hover { background: var(--sb-hover); color: #FFFFFF; }
.nav a svg.ic, .nav .sub-toggle > svg.ic:first-child { width: 20px; height: 20px; color: var(--sb-icon); transition: color var(--t); }
.nav a:hover svg.ic { color: #FFFFFF; }
.nav a.active, .nav .sub-toggle.active { background: var(--sb-active); color: var(--sb-active-text); font-weight: 700; }
.nav a.active svg.ic, .nav .sub-toggle.active > svg.ic:first-child { color: var(--sb-icon-active); }
.nav a.active::before, .nav .sub-toggle.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--mint); }
.nav .lbl { flex: 1; overflow: hidden; text-overflow: ellipsis; transition: opacity var(--t) var(--ease); }
.nav .cnt { font-size: 10.5px; font-weight: 700; background: rgba(255,255,255,.12); color: #FFFFFF; border-radius: var(--r-pill); padding: 1px 7px; min-width: 20px; text-align: center; line-height: 16px; }
.nav .cnt.hot { background: var(--bright); color: var(--ink); }
.nav .chev { width: 14px; height: 14px; color: var(--sb-muted); transition: transform var(--t); }
.nav .has-sub.open > .sub-toggle .chev { transform: rotate(180deg); }
.nav .subs { display: none; margin: 0 12px 4px 36px; padding-left: 12px; border-left: 1px solid var(--sb-line); }
.nav .has-sub.open > .subs { display: block; }
.nav .subs a { height: 32px; margin: 1px 0; width: 100%; padding: 0 10px; font-size: 12.5px; color: var(--sb-muted); }
.nav .subs a:hover { color: #FFFFFF; }
.nav .subs a.active::before { display: none; }
.nav .subs a.active { font-weight: 700; color: #FFFFFF; }
.app:not(.sb-expanded) .nav .lbl, .app:not(.sb-expanded) .nav .chev { opacity: 0; }
.app:not(.sb-expanded) .nav .subs { display: none !important; }
.app:not(.sb-expanded) .nav a .cnt, .app:not(.sb-expanded) .nav .sub-toggle .cnt { position: absolute; top: 3px; left: 30px; padding: 0 5px; font-size: 9.5px; min-width: 0; }
/* tooltips on the rail (shown before the panel slides open, and for keyboard focus) */
.app:not(.sb-expanded) .nav [data-tip]:hover::after, .app:not(.sb-expanded) .nav [data-tip]:focus-visible::after {
  content: attr(data-tip); position: fixed; left: calc(var(--rail-w) + 8px); background: var(--sb-tip); color: #FFFFFF; padding: 6px 10px; border-radius: var(--r-sm);
  font-size: 12px; font-weight: 500; box-shadow: var(--shadow-lg); z-index: 400; pointer-events: none; white-space: nowrap; border: 1px solid var(--sb-line); }
.sb-foot { flex: none; padding: 10px 16px 12px; border-top: 1px solid var(--sb-line); font-size: 11px; color: var(--sb-muted); white-space: nowrap; overflow: hidden; display: flex; align-items: center; gap: 10px; min-height: 48px; }
.sb-foot .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; transition: opacity var(--t); }
.app:not(.sb-expanded) .sb-foot { justify-content: center; padding: 10px 0; }
.app:not(.sb-expanded) .sb-foot .t { display: none; }
.sb-foot .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgba(15,252,190,.18); flex: none; }

/* ============================================================ top bar */
.topbar { display: flex; align-items: center; gap: var(--s2); padding: 0 var(--page-x); height: var(--top-h); flex: none; position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--surface-solid) 92%, transparent); backdrop-filter: saturate(1.3) blur(10px); border-bottom: 1px solid var(--line); }
html[data-theme="dark"] .topbar { background: rgba(10,24,40,.86); }
.topbar .titles { min-width: 0; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; line-height: 1.3; }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--primary-text); } .crumbs .sep { opacity: .55; }
.topbar h1 { font-family: var(--font-display); font-size: 18px; font-weight: 600; letter-spacing: -.01em; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.topbar .grow { flex: 1; }
.cmd-trigger { display: flex; align-items: center; gap: 8px; width: min(320px, 28vw); height: var(--ctl-h); padding: 0 8px 0 12px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface-2); color: var(--muted); cursor: pointer; font-size: 13px; transition: border-color var(--t), background var(--t); }
.cmd-trigger svg.ic { color: var(--primary); }
.cmd-trigger:hover { border-color: var(--line-strong); background: var(--surface-solid); }
.cmd-trigger span { flex: 1; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cmd-trigger kbd { border-radius: var(--r-pill); padding: 0 7px; }
.dropdown { position: absolute; right: 0; top: calc(100% + 8px); background: var(--elev); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); min-width: 260px; max-height: 72vh; overflow-y: auto; z-index: 70; padding: 6px; animation: pop .14s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.dropdown .di { display: flex; align-items: flex-start; gap: 10px; min-height: 34px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--text); cursor: pointer; font-size: 13px; font-weight: 500; flex-wrap: wrap; line-height: 1.4; }
.dropdown .di:hover, .dropdown .di:focus { background: var(--surface-3); text-decoration: none; outline: none; }
.dropdown .di small { color: var(--muted); display: block; width: 100%; font-weight: 400; }
.dropdown .di svg.ic { color: var(--muted); margin-top: 1px; }
.dropdown .di:hover svg.ic, .dropdown .di:focus svg.ic { color: var(--primary-text); }
.dropdown .dh { padding: 8px 10px 4px; font-family: var(--font-display); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; color: var(--kicker); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.dropdown hr { border: 0; border-top: 1px solid var(--line-2); margin: 5px 0; }
.bell { position: relative; }
.bell .count { position: absolute; top: -2px; right: -2px; background: var(--primary); color: var(--primary-fg); font-size: 10px; font-weight: 700; border-radius: var(--r-pill); padding: 0 5px; min-width: 17px; line-height: 16px; text-align: center; border: 2px solid var(--surface-solid); }
.today-chip { color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; padding: 0 4px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--light); color: var(--ink); display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; letter-spacing: .3px; flex: none; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; } .avatar.lg { width: 40px; height: 40px; font-size: 14px; }
.avatar.c1 { background: #E9F1FA; } .avatar.c2 { background: #EFE7EF; }
.avatar.c3 { background: #E3F4F2; } .avatar.c4 { background: #F3ECE4; }
.avatar.c5 { background: #ECEDF8; } .avatar.c6 { background: #EEF1F5; }
html[data-theme="dark"] .avatar, html[data-theme="dark"] .avatar.c1, html[data-theme="dark"] .avatar.c2, html[data-theme="dark"] .avatar.c3,
html[data-theme="dark"] .avatar.c4, html[data-theme="dark"] .avatar.c5, html[data-theme="dark"] .avatar.c6 { background: rgba(255,255,255,.12); color: #FFFFFF; }
.user-btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid transparent; background: transparent; border-radius: var(--r-pill); padding: 2px 8px 2px 2px; cursor: pointer; }
.user-btn:hover { background: var(--surface-3); }
.user-btn .un { font-weight: 700; font-size: 12.5px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.period-sel { height: var(--ctl-h); border-radius: var(--r-pill); border: 1px solid var(--line); background-color: var(--surface-2); padding: 0 30px 0 12px; font-size: 12.5px; font-weight: 500; }

/* ============================================================ page */
.view { padding: var(--page-y) var(--page-x) 48px; overflow-y: auto; flex: 1; scroll-behavior: smooth; }
.view > * { max-width: var(--content-max); margin-left: auto; margin-right: auto; }
.page-head { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); min-height: 44px; }
.page-head h2 { margin: 0; font-family: var(--font-display); font-size: var(--fs-xl); font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.page-head .grow { flex: 1; }
.page-head .actions { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.page-kicker { display: block; font-family: var(--font-display); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 2px; color: var(--kicker); margin: 0 0 6px; line-height: 1.3; }
/* the accent line: Instrument Serif Italic, at most once per screen (greeting, sign-in tagline) */
.accent-line { font-family: var(--font-accent); font-style: italic; font-weight: 400; font-size: 22px; line-height: 1.25; color: var(--accent-text); letter-spacing: 0; margin: 4px 0 0; }
.page-head p.accent-line { font-size: 21px; color: var(--accent-text); margin-top: 4px; }
.page-head p.accent-line + p { margin-top: 2px; }
/* kept for compatibility; v3.1 uses the compact page-head instead of a hero banner */
.hello { display: none; }

/* next required action (computed from real data) */
.next-action { display: flex; align-items: center; gap: var(--s3); padding: 12px 16px; margin-bottom: var(--s4); border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.next-action::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary); }
.next-action .na-ic { width: 36px; height: 36px; border-radius: var(--r); display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); flex: none; }
.next-action.bad .na-ic { background: var(--bad-bg); color: var(--bad); } .next-action.bad::before { background: var(--bad); }
.next-action.warn .na-ic { background: var(--warn-bg); color: var(--warn); } .next-action.warn::before { background: var(--warn); }
.next-action.good .na-ic { background: var(--good-bg); color: var(--good); } .next-action.good::before { background: var(--good); }
.next-action .na-t { flex: 1; min-width: 0; }
.next-action .na-t b { display: block; font-size: 13.5px; }
.next-action .na-t span { color: var(--muted); font-size: 12.5px; }
.next-action .na-k { font-family: var(--font-display); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; color: var(--kicker); }

/* exception band: the few numbers that need a decision */
.xband { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-bottom: var(--s4); box-shadow: var(--shadow-sm); }
.xband .x { background: var(--surface-solid); padding: 12px 16px; display: flex; align-items: center; gap: 12px; cursor: pointer; transition: background var(--t); text-decoration: none !important; color: inherit; }
.xband .x:hover { background: var(--row-hover); }
.xband .x .n { font-family: var(--font-display); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 26px; }
.xband .x .l { font-size: 12px; color: var(--muted); line-height: 1.3; }
.xband .x.hot .n { color: var(--bad); } .xband .x.warm .n { color: var(--warn); } .xband .x.ok .n { color: var(--good); }

/* ============================================================ Today strip (home pages) */
.today { margin-bottom: var(--gap); }
.today:empty { display: none; }
.today > .panel { margin-bottom: 0; overflow: hidden; }
.today-grid { --today-cols: 6; display: grid; grid-template-columns: repeat(var(--today-cols), minmax(0, 1fr)); gap: 0; }
.today-tile { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 76px; padding: 12px 16px; background: var(--surface-solid); box-shadow: 1px 0 0 var(--line-2), 0 1px 0 var(--line-2); color: inherit; text-decoration: none !important; min-width: 0; transition: background var(--t); position: relative; }
html[data-theme="dark"] .today-tile { background: transparent; }
a.today-tile:hover { background: var(--row-hover); }
a.today-tile:focus-visible { box-shadow: inset 0 0 0 3px rgba(16,110,190,.32); border-radius: 0; }
.today-tile .tt-val { font-family: var(--font-display); font-size: 20px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--text); }
.today-tile .tt-lbl { font-size: 12px; color: var(--muted); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-tile.is-zero .tt-val { color: var(--muted); }
.today-tile.is-bad .tt-val, .today-tile.bad .tt-val { color: var(--bad); }
.today-tile.is-blue .tt-val, .today-tile.blue .tt-val { color: var(--primary-text); }
.today-tile .tt-kicker { font-family: var(--font-display); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; color: var(--kicker); }
.today-tile .tt-title { font-weight: 700; font-size: 13px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.today-tile .tt-link { font-size: 12px; font-weight: 700; color: var(--primary-text); align-self: flex-start; }
.today-tile.today-pinned { background: var(--primary-soft); }
.today-tile.today-pinned::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--gold); }
html[data-theme="dark"] .today-tile.today-pinned { background: rgba(0,171,228,.10); }

/* ============================================================ buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--ctl-h); padding: 0 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface-solid); cursor: pointer; font-size: 13px; font-weight: 700; white-space: nowrap; line-height: 1; color: var(--text); transition: background var(--t), border-color var(--t), box-shadow var(--t), color var(--t), transform var(--t); text-decoration: none !important; }
html[data-theme="dark"] .btn { background: var(--surface); }
.btn:hover { background: var(--surface-3); border-color: var(--line-strong); }
html[data-theme="dark"] .btn:hover { background: rgba(255,255,255,.10); }
.btn:active { transform: translateY(1px); }
.btn.primary, html[data-theme="dark"] .btn.primary { background: var(--primary); border-color: transparent; color: var(--primary-fg); box-shadow: 0 1px 2px rgba(10,24,40,.16); }
.btn.primary:hover, html[data-theme="dark"] .btn.primary:hover { background: var(--primary-h); }
.btn.primary:active { background: var(--primary-a); }
.btn.grad, html[data-theme="dark"] .btn.grad { background: var(--signal); border-color: transparent; color: #FFFFFF; text-shadow: 0 1px 1px rgba(10,24,40,.25); }
.btn.grad:hover { filter: brightness(1.05); }
.btn.danger, html[data-theme="dark"] .btn.danger { background: var(--bad); border-color: transparent; color: #FFFFFF; }
.btn.danger:hover, html[data-theme="dark"] .btn.danger:hover { background: var(--bad); filter: brightness(.92); }
html[data-theme="dark"] .btn.danger { color: var(--ink); }
.btn.ghost.danger, html[data-theme="dark"] .btn.ghost.danger { background: transparent; color: var(--bad); }
.btn.ghost.danger:hover { background: var(--bad-bg); filter: none; }
.btn.sm { height: var(--ctl-h-sm); padding: 0 10px; font-size: 12px; border-radius: var(--r-sm); gap: 6px; }
.btn.ghost, html[data-theme="dark"] .btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover, html[data-theme="dark"] .btn.ghost:hover { background: var(--surface-3); }
html[data-theme="dark"] .btn.ghost:hover { background: rgba(255,255,255,.08); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.block { width: 100%; }
/* sign-in provider buttons: default button, 44 px, brand glyph at 18 px on the left */
.btn.provider { height: var(--ctl-h-lg); width: 100%; justify-content: center; gap: 10px; font-size: 13.5px; position: relative; }
.btn.provider svg.ic { width: 18px; height: 18px; stroke: none; }
.btn.provider img { width: 18px; height: 18px; }
.icon-btn { border: 1px solid transparent; background: transparent; border-radius: var(--r); width: var(--ctl-h); height: var(--ctl-h); cursor: pointer; display: inline-grid; place-items: center; font-size: 15px; color: var(--muted); transition: background var(--t), color var(--t); position: relative; flex: none; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
html[data-theme="dark"] .icon-btn:hover { background: rgba(255,255,255,.08); }
input[type=text], input[type=date], input[type=time], input[type=number], input[type=search], input[type=email], input[type=password], input[type=url], input[type=tel], select, textarea {
  height: var(--ctl-h); padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r); background-color: var(--input-bg); min-width: 0; transition: border-color var(--t), box-shadow var(--t); }
select { padding-right: 6px; }
select:not([multiple]):not([size]) { -webkit-appearance: none; appearance: none; background-image: var(--chev); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px 16px; padding-right: 32px; }
select[multiple] { height: auto; padding: 6px 8px; }
textarea { height: auto; padding: 8px 12px; resize: vertical; min-height: 72px; width: 100%; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
input[readonly], input:disabled, select:disabled, textarea:disabled { background-color: var(--surface-2); color: var(--muted); }
input::placeholder, textarea::placeholder { color: var(--faint); }
label.chk { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); width: 16px; height: 16px; }

/* ============================================================ cards & panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); margin-bottom: var(--gap); min-width: 0; }
.panel > .ph { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 16px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.panel > .ph h3 { margin: 0; font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.panel > .ph h2 { margin: 0; font-family: var(--font-display); font-size: 15px; font-weight: 600; }
.panel > .ph h3 svg.ic { color: var(--primary-text); width: 16px; height: 16px; }
.panel > .ph .sub { color: var(--muted); font-size: 12px; }
.panel > .ph .grow { flex: 1; }
.panel > .pb { padding: var(--s4); }
.panel > .pb.flush { padding: 0; }
.panel .panel { box-shadow: none; }
/* one tinted panel per page at most, for emphasis */
.panel.tint { background: var(--light); border-color: transparent; box-shadow: none; }
.panel.tint > .ph { border-bottom-color: rgba(16,110,190,.14); }
html[data-theme="dark"] .panel.tint { background: rgba(0,171,228,.08); border-color: rgba(0,171,228,.18); }
html[data-theme="dark"] .panel.tint > .ph { border-bottom-color: rgba(0,171,228,.18); }
/* compact KPI tiles: same height, aligned label / value / trend */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: var(--gap); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; min-height: 88px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--shadow-sm); cursor: pointer; position: relative; overflow: hidden; transition: border-color var(--t), box-shadow var(--t); }
.kpi:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.kpi .lbl { color: var(--muted); font-size: 12px; font-weight: 500; display: flex; align-items: center; gap: 6px; line-height: 1.3; }
.kpi .lbl svg.ic { width: 14px; height: 14px; color: var(--muted); }
.kpi .vrow { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.kpi .val { font-family: var(--font-display); font-size: var(--fs-kpi); font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi .scope { display: block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: var(--faint); letter-spacing: 1px; }
.kpi .delta { align-self: flex-start; display: inline-flex; align-items: center; gap: 2px; font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: var(--r-pill); line-height: 18px; }
.kpi .delta svg.ic { width: 12px; height: 12px; }
.kpi .delta.up { color: var(--good); background: var(--good-bg); } .kpi .delta.down { color: var(--bad); background: var(--bad-bg); } .kpi .delta.flat { color: var(--muted); background: var(--grey-bg); }
.kpi .delta.up.inv { color: var(--bad); background: var(--bad-bg); } .kpi .delta.down.inv { color: var(--good); background: var(--good-bg); }
.kpi.bad .val { color: var(--bad); } .kpi.warn .val { color: var(--warn); } .kpi.good .val { color: var(--good); }
.kpi.bad { box-shadow: inset 3px 0 0 var(--bad), var(--shadow-sm); } .kpi.warn { box-shadow: inset 3px 0 0 var(--warn), var(--shadow-sm); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: var(--gap); }
.grid2 > *, .grid3 > *, .grid-main > * { min-width: 0; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: var(--gap); }
.grid-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: var(--gap); align-items: start; }
.chart-box { position: relative; height: 230px; }
.chart-box.tall { height: 300px; } .chart-box.short { height: 170px; }

/* ============================================================ toolbar & filters */
.toolbar { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; margin-bottom: var(--s3); }
.toolbar .grow { flex: 1; }
.filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 16px; margin-bottom: var(--s3); }
.filters label { font-size: 11px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.filters select, .filters input { height: 32px; font-size: 12.5px; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--text); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface-2); padding: 2px; gap: 2px; flex: none; }
.seg button { border: 0; background: transparent; padding: 0 12px; height: 30px; cursor: pointer; font-size: 12.5px; border-radius: var(--r-sm); color: var(--muted); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface-solid); color: var(--primary-text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
html[data-theme="dark"] .seg button.on { background: var(--surface-3); color: #FFFFFF; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-pill); padding: 3px 10px; font-size: 12px; cursor: pointer; color: var(--text-2); }
.chip.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-text); font-weight: 700; }

/* ============================================================ tables */
.tbl-wrap { overflow-x: auto; }
@media (max-width: 600px) { .panel .tbl.dense { min-width: 560px; } }   /* phone: dashboard tables scroll sideways instead of wrapping every word */
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl th { text-align: left; font-weight: 700; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.panel .tbl tr:first-child th:first-child { border-top-left-radius: var(--r-lg); } .panel .tbl tr:first-child th:last-child { border-top-right-radius: var(--r-lg); }
.panel > .ph + .pb .tbl tr:first-child th { border-radius: 0 !important; }
.tbl th.sortable { cursor: pointer; } .tbl th.sortable:hover { color: var(--text); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl :where(tbody tr:nth-child(even)) td { background: var(--zebra); }
.tbl tbody tr { transition: background var(--t); }
.tbl tbody tr:hover td { background: var(--row-hover); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.sample td { background: color-mix(in srgb, var(--warn-bg) 60%, transparent); }
.tbl tr.archived td { opacity: .55; }
.tbl td.title { min-width: 200px; max-width: 420px; }
.tbl td.title a { color: var(--text); font-weight: 700; }
.tbl td.title a:hover { color: var(--primary-text); }
.tbl td.actions { white-space: nowrap; text-align: right; }
.tbl td.actions .btn.sm { padding: 0 8px; height: 26px; }
.tbl td.actions .btn.ghost { opacity: .6; } .tbl tr:hover td.actions .btn.ghost, .tbl td.actions .btn.ghost:focus-visible { opacity: 1; }
.tbl td select.inline { height: 28px; padding: 0 24px 0 6px; font-size: 12px; border-color: transparent; background-color: transparent; background-position: right 4px center; background-size: 14px 14px; max-width: 170px; }
.tbl td select.inline:hover { border-color: var(--line-strong); background-color: var(--input-bg); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.compact .tbl td { padding: 6px 10px; } .compact .tbl th { padding: 7px 10px; }
.code { color: var(--muted); font-size: 11.5px; font-family: var(--mono); white-space: nowrap; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 8px 16px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line-2); flex-wrap: wrap; gap: 8px; }
.pager select { height: 28px; }
/* empty state: a dotted ring (graphic language) with one Mint node, a headline, one sentence, one action */
.empty { padding: 32px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.empty b { display: block; color: var(--text); font-family: var(--font-display); font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.empty .em-ic { width: 48px; height: 48px; border-radius: 50%; border: 2px dashed var(--dotted); background: transparent; display: grid; place-items: center; margin: 0 auto 12px; color: var(--primary-text); position: relative; }
.empty .em-ic::after { content: ""; position: absolute; top: 2px; right: 2px; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 2px var(--surface-solid); }
html[data-theme="dark"] .empty .em-ic { border-color: rgba(0,171,228,.40); }
.empty .btn { margin-top: 12px; }
/* skeleton loading */
.skel { padding: 14px 16px; display: grid; gap: 10px; }
.skeleton { background: linear-gradient(90deg, var(--surface-3) 25%, var(--line-2) 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 6px; height: 12px; }
.skeleton.h { height: 22px; width: 40%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ============================================================ badges & indicators */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--r-pill); font-size: 11px; font-weight: 700; white-space: nowrap; background: var(--grey-bg); color: var(--grey-fg); line-height: 16px; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; display: none; }
.b-Overdue, .b-Red, .b-Blocked, .b-Critical, .b-AtRisk, .b-rejected, .b-Rejected, .b-Escalation, .b-Missing { background: var(--bad-bg); color: var(--bad); }
.b-DueToday, .b-Amber, .b-Waiting, .b-WaitingforResponse, .b-High, .b-OnHold, .b-PendingApproval, .b-submitted, .b-Submitted, .b-returned, .b-Returned, .b-PendingReview, .b-Due { background: var(--warn-bg); color: var(--warn); }
.b-Completed, .b-Green, .b-Held, .b-Approved, .b-approved, .b-Closed, .b-ConfirmedDecision, .b-Active, .b-OnTrack { background: var(--good-bg); color: var(--good); }
.b-Upcoming, .b-InProgress, .b-Planning, .b-Scheduled, .b-Meeting, .b-ProposedOption, .b-draft, .b-Draft, .b-NotStarted, .b-Open, .b-Notdueyet { background: var(--info-bg); color: var(--info); }
.b-Cancelled, .b-Grey, .b-NoDate, .b-Low, .b-Exited, .b-Notrequired, .b-NoData { background: var(--grey-bg); color: var(--grey-fg); }
.b-OpenQuestion, .b-manager, .b-Manager { background: var(--violet-bg); color: var(--violet); }
.b-sample { background: var(--warn-bg); color: var(--warn); }
/* v4 status map (design guide section 5) */
.b-Planning, .b-submitted, .b-Submitted { background: var(--light); color: var(--blue); }
.b-InProgress { background: rgba(16,110,190,.12); color: var(--blue); }
.b-Completed { background: rgba(23,133,130,.12); color: var(--turq); }
.b-OnHold { background: var(--hold-bg); color: var(--hold-fg); }
.b-Critical { background: var(--bad); color: #FFFFFF; }
html[data-theme="dark"] .b-Planning, html[data-theme="dark"] .b-submitted, html[data-theme="dark"] .b-Submitted, html[data-theme="dark"] .b-InProgress { background: var(--info-bg); color: var(--info); }
html[data-theme="dark"] .b-Completed { background: var(--good-bg); color: var(--good); }
html[data-theme="dark"] .b-Critical { background: var(--bad); color: var(--ink); }
.b-Overdue::before, .b-Blocked::before, .b-Completed::before, .b-InProgress::before, .b-WaitingforResponse::before, .b-NotStarted::before { display: inline-block; }
.health-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.h-Green { background: var(--good); } .h-Amber { background: var(--warn); } .h-Red { background: var(--bad); } .h-Grey { background: var(--faint); }
.old-date { text-decoration: line-through; color: var(--faint); font-size: 11.5px; margin-right: 5px; }
.new-date { font-weight: 700; }
.rev-tag { font-size: 10.5px; font-weight: 700; color: var(--warn); margin-left: 5px; cursor: pointer; background: var(--warn-bg); padding: 0 6px; border-radius: var(--r-pill); }
.progress { height: 6px; background: var(--surface-3); border-radius: 6px; overflow: hidden; min-width: 70px; }
.progress > i { display: block; height: 100%; background: var(--signal); border-radius: 6px; transition: width .4s var(--ease); }
.progress.big { height: 9px; }
.ring { --p: 0; --c: var(--primary); width: 58px; height: 58px; border-radius: 50%; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-3) 0); display: grid; place-items: center; flex: none; }
.ring::before { content: ""; grid-area: 1/1; width: 46px; height: 46px; border-radius: 50%; background: var(--surface-solid); }
.ring b { grid-area: 1/1; font-family: var(--font-display); font-size: 12px; font-weight: 600; position: relative; font-variant-numeric: tabular-nums; }
/* entity tag: group companies on people rows, org chart nodes and the account page */
.entity-tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: var(--r-pill); font-size: 11px; font-weight: 700; line-height: 18px; white-space: nowrap; background: var(--grey-bg); color: var(--grey-fg); vertical-align: middle; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.entity-tag.is-worx, .entity-tag.worx { background: var(--light); color: var(--blue); }
html[data-theme="dark"] .entity-tag.is-worx, html[data-theme="dark"] .entity-tag.worx { background: var(--info-bg); color: var(--info); }

/* ============================================================ modal */
.modal-back { position: fixed; inset: 0; background: var(--overlay); backdrop-filter: blur(2px); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 100; overflow-y: auto; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--elev); border: 1px solid var(--line); border-radius: var(--r-xl); width: min(860px, 100%); box-shadow: var(--shadow-lg); animation: rise .2s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.99); } }
.modal.sm { width: min(500px, 100%); }
.modal.lg { width: min(1120px, 100%); }
.modal .mh { display: flex; align-items: center; gap: 8px; padding: 16px 24px; border-bottom: 1px solid var(--line-2); }
.modal .mh h3 { margin: 0; font-family: var(--font-display); font-size: 16px; font-weight: 600; letter-spacing: -.01em; flex: 1; line-height: 1.3; }
.modal .mb { padding: 20px 24px; max-height: 70vh; overflow-y: auto; }
.modal .mf { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 24px; border-top: 1px solid var(--line-2); background: var(--surface-2); border-radius: 0 0 var(--r-xl) var(--r-xl); flex-wrap: wrap; }
html[data-theme="dark"] .modal .mf { background: rgba(255,255,255,.03); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .fsec { grid-column: 1 / -1; font-family: var(--font-display); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 2px; color: var(--kicker); border-bottom: 1px solid var(--line-2); padding-bottom: 6px; margin-top: 6px; }
.field label { display: block; font-size: 12px; color: var(--text); margin-bottom: 6px; font-weight: 700; }
.field label .req { color: var(--primary-text); }
.field input, .field select { width: 100%; }
.field .help { font-size: 12px; color: var(--muted); margin-top: 4px; }
.field.err input, .field.err select, .field.err textarea { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); }
.field .emsg { color: var(--bad); font-size: 12px; margin-top: 4px; font-weight: 500; }
.reason-box { background: var(--warn-bg); border: 1px solid var(--warn-line); padding: 12px 14px; border-radius: var(--r); }

/* ============================================================ command palette */
.cmdk-back { align-items: flex-start; padding-top: 12vh; }
.cmdk { width: min(640px, 100%); background: var(--elev); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); overflow: hidden; animation: rise .16s var(--ease); }
.cmdk-in { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line-2); }
.cmdk-in svg.ic { color: var(--primary); }
.cmdk-in input { flex: 1; height: 48px; border: 0 !important; box-shadow: none !important; background: transparent; font-size: 15px; padding: 0; }
.cmdk-list { max-height: min(56vh, 460px); overflow-y: auto; padding: 6px; }
.cmdk-g { font-family: var(--font-display); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; color: var(--kicker); padding: 12px 10px 4px; }
.cmdk-i { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; color: var(--text); }
.cmdk-i svg.ic { color: var(--muted); width: 16px; height: 16px; }
.cmdk-i .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-i .h { font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.cmdk-i.on { background: var(--primary-soft); }
.cmdk-i.on svg.ic { color: var(--primary-text); }
.cmdk-foot { display: flex; gap: 14px; padding: 8px 16px; border-top: 1px solid var(--line-2); font-size: 11.5px; color: var(--faint); background: var(--surface-2); }

/* ============================================================ toast */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--toast-bg); color: var(--toast-fg); padding: 12px 16px 12px 14px; border-radius: 12px; box-shadow: 0 12px 30px rgba(10,24,40,.28); max-width: 420px; font-size: 13px; font-weight: 500; display: flex; gap: 12px; align-items: stretch; animation: rise .2s var(--ease); border: 1px solid var(--toast-line); }
.toast::before { content: ""; width: 3px; border-radius: 3px; flex: none; align-self: stretch; min-height: 18px; background: var(--mint); }
.toast.err::before { background: #FF7B7B; } .toast.warn::before { background: #F2C14E; }

/* ============================================================ misc */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: var(--s4); flex-wrap: wrap; }
.tabs button { border: 0; background: transparent; height: 36px; padding: 0 12px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; font-size: 13px; font-weight: 700; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 6px; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); border-bottom-color: var(--primary); }
.tabs button .n { background: var(--surface-3); color: var(--text-2); border-radius: var(--r-pill); padding: 0 7px; font-size: 11px; margin-left: 2px; line-height: 17px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .nowrap { white-space: nowrap; } .faint { color: var(--faint); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }
.banner { padding: 10px 14px; border-radius: var(--r); margin-bottom: var(--s4); font-size: 13px; border: 1px solid; display: flex; gap: 10px; align-items: flex-start; }
.banner.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.banner.info { background: var(--info-bg); border-color: var(--info-line); color: var(--info); }
.banner.bad { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); }
.banner.good { background: var(--good-bg); border-color: var(--good-line); color: var(--good); }
.banner b, .banner a { color: inherit; }
.attn { display: flex; gap: 12px; padding: 10px 16px; min-height: 48px; border-bottom: 1px solid var(--line-2); align-items: center; cursor: pointer; transition: background var(--t); color: inherit; text-decoration: none !important; }
.attn:last-child { border-bottom: 0; }
.attn:hover { background: var(--row-hover); }
.attn .t { flex: 1; min-width: 0; }
.attn .t .tt { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; white-space: pre-wrap; }
.dl-flags { color: var(--bad); font-size: 12px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: var(--r-pill); background: var(--primary-soft); color: var(--primary-text); font-size: 12px; font-weight: 700; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line-2); }
.feed li:last-child { border-bottom: 0; }
.feed .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 6px; flex: none; }
.feed li.read .dot { background: var(--line-strong); }
.feed .w { flex: 1; min-width: 0; }
.feed .when { font-size: 11.5px; color: var(--faint); }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person .pn { font-weight: 700; } .person .pd { font-size: 11.5px; color: var(--muted); }
.callout { border: 2px dashed var(--dotted); border-radius: var(--r); padding: 10px 14px; color: var(--muted); font-size: 12.5px; }
.note-ai { font-size: 11.5px; color: var(--faint); display: inline-flex; align-items: center; gap: 5px; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.list-plain li:last-child { border-bottom: 0; }

/* ============================================================ announcements */
.post-list { display: grid; gap: var(--gap); }
.post-card { position: relative; cursor: pointer; transition: border-color var(--t), box-shadow var(--t); overflow: hidden; }
.post-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.post-card:focus-visible { box-shadow: var(--focus), var(--shadow-sm); border-radius: var(--r-lg); }
.post-card > .pb { padding: 18px 20px; }
.post-card.is-draft { border-style: dashed; }
.post-card .unread-dot, .post-card.unread::after { position: absolute; top: 20px; left: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.post-card.unread::after { content: ""; }
.post-card .unread-dot ~ .pb, .post-card.unread > .pb { padding-left: 24px; }
html[data-theme="dark"] .post-card .unread-dot, html[data-theme="dark"] .post-card.unread::after { background: var(--mint); box-shadow: 0 0 0 4px rgba(15,252,190,.16); }
.post-card:has(.unread-dot)::after { content: none; }
.post-kicker { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.post-kind { font-family: var(--font-display); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 2px; color: var(--kicker); line-height: 1.3; }
.post-kind.k-policy { color: var(--violet); }
.post-kind.k-event { color: var(--good); }
.post-kind.k-welcome { color: var(--primary-text); }
html[data-theme="dark"] .post-kind.k-welcome, html[data-theme="dark"] .post-kind.k-announcement { color: var(--mint); }
.post-pin { display: inline-flex; color: var(--gold); }
.post-pin svg.ic { width: 15px; height: 15px; fill: rgba(191,161,129,.28); }
.post-card .post-title, .post-title { margin: 0 0 6px; font-family: var(--font-display); font-size: 16px; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
.post-meta { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.post-excerpt { margin: 0; color: var(--text-2); font-size: 13.5px; line-height: 1.6; }
.post-body { font-size: 13.5px; line-height: 1.6; color: var(--text-2); max-width: 760px; }
.post-body p { margin: 0 0 12px; } .post-body p:last-child { margin-bottom: 0; }
.post-body ul, .post-body ol { margin: 0 0 12px; padding-left: 20px; }
.post-body h3, .post-body h4 { font-size: 14px; font-weight: 700; margin: 18px 0 6px; }
.post-actions { gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2); }

/* ============================================================ projects / kanban / gantt */
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: var(--gap); }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; cursor: pointer; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; transition: box-shadow var(--t), border-color var(--t); }
.pcard::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--line); }
.pcard:hover { box-shadow: var(--shadow); border-color: var(--line-strong); }
.pcard.h-Red-top::before { background: var(--bad); } .pcard.h-Amber-top::before { background: var(--warn); } .pcard.h-Green-top::before { background: var(--good); }
.pcard h4 { margin: 4px 0 6px; font-size: 14.5px; font-weight: 700; }
.pcard .meta { color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; margin: 8px 0 5px; }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: var(--kcol); border-radius: var(--r-lg); padding: 10px; min-height: 220px; border: 1px solid var(--line-2); }
.kcol.over { outline: 2px dashed var(--primary); outline-offset: -2px; }
.kcol h5 { margin: 2px 4px 10px; font-family: var(--font-display); font-size: 10px; font-weight: 600; text-transform: uppercase; color: var(--muted); letter-spacing: 1.5px; display: flex; justify-content: space-between; }
.kcard { background: var(--surface-solid); border: 1px solid var(--line); border-radius: var(--r-tile); padding: 10px 12px; margin-bottom: 8px; cursor: grab; font-size: 12.5px; box-shadow: var(--shadow-sm); transition: box-shadow var(--t), border-color var(--t); }
html[data-theme="dark"] .kcard { background: rgba(255,255,255,.06); }
.kcard:hover { box-shadow: var(--shadow); border-color: var(--line-strong); }
.kcard:focus-visible { box-shadow: var(--focus); }
.kcard b { display: block; margin-bottom: 5px; font-weight: 700; }
.gantt { position: relative; }
.gantt .grow-row { display: grid; grid-template-columns: 220px 1fr; border-bottom: 1px solid var(--line-2); min-height: 34px; align-items: center; }
.gantt .gname { padding: 6px 12px; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gantt .gtrack { position: relative; height: 34px; }
.gantt .gbar { position: absolute; top: 10px; height: 14px; border-radius: 7px; background: color-mix(in srgb, var(--primary) 18%, transparent); }
.gantt .gbar > i { display: block; height: 100%; background: var(--signal); border-radius: 7px; }
.gantt .gms { position: absolute; top: 10px; width: 12px; height: 12px; transform: rotate(45deg); background: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 70%, var(--ink)); }
.gantt .gms.done { background: var(--good); border-color: color-mix(in srgb, var(--good) 70%, var(--ink)); }
.gantt .gtoday { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bad); opacity: .6; z-index: 2; }
.gantt .gscale { display: grid; grid-template-columns: 220px 1fr; font-size: 11px; color: var(--muted); border-bottom: 1px solid var(--line); }
.gantt .gscale .ticks { position: relative; height: 24px; }
.gantt .gscale .ticks span { white-space: nowrap; position: absolute; top: 5px; border-left: 1px solid var(--line); padding-left: 3px; height: 19px; }

/* ============================================================ calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-left: 1px solid var(--line); border-top: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.cal .dow { background: var(--surface-2); font-size: 11px; color: var(--muted); text-align: center; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.cal .day { min-height: 104px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 5px; background: var(--surface); }
.cal .day.other { background: var(--surface-2); } .cal .day.other .dn { color: var(--faint); }
.cal .day.today { background: var(--primary-soft); } .cal .day.today .dn { color: var(--primary-text); font-weight: 700; }
.cal .day.over { outline: 2px dashed var(--primary); outline-offset: -2px; }
html[data-theme="dark"] .cal .day { background: transparent; }
html[data-theme="dark"] .cal .day.other { background: rgba(0,0,0,.16); }
html[data-theme="dark"] .cal .day.today { background: var(--primary-soft); }
html[data-theme="dark"] .cal .dow { background: rgba(255,255,255,.03); }
.cal .dn { font-size: 12px; margin: 0 3px 4px; font-variant-numeric: tabular-nums; }
.ev { font-size: 11.5px; font-weight: 500; padding: 2px 7px; border-radius: 6px; margin-bottom: 3px; background: var(--info-bg); color: var(--info); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; border-left: 3px solid var(--info); }
.ev[draggable=true] { cursor: grab; }
.ev.Overdue { background: var(--bad-bg); color: var(--bad); border-left-color: var(--bad); }
.ev.DueToday { background: var(--warn-bg); color: var(--warn); border-left-color: var(--warn); }
.ev.Completed { background: var(--good-bg); color: var(--good); border-left-color: var(--good); text-decoration: line-through; }
.ev.Meeting { background: var(--violet-bg); color: var(--violet); border-left-color: var(--violet); }
.ev.Follow-up { background: var(--warn-bg); color: var(--warn); border-left-color: var(--warn); }
.ev.Project { background: var(--surface-3); color: var(--text-2); border-left-color: var(--gold); }
.week-list .wd { border-bottom: 1px solid var(--line); padding: 10px 4px; }
.week-list .wd h5 { margin: 0 0 6px; font-size: 13px; font-weight: 700; }

/* ============================================================ timeline (my tasks) */
.tl { position: relative; padding-left: 22px; }
.tl::before { content: ""; position: absolute; left: 7px; top: 4px; bottom: 4px; width: 0; border-left: 2px dashed var(--dotted); }
.tl .tl-day { margin-bottom: 14px; }
.tl .tl-day h5 { margin: 0 0 6px; font-family: var(--font-display); font-size: 10.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 1.5px; position: relative; }
.tl .tl-day h5::before { content: ""; position: absolute; left: -20px; top: 1px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface-solid); border: 2px solid var(--primary); }
.tl .tl-day.past h5::before { border-color: var(--bad); }
.tl .tl-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-tile); padding: 8px 12px; margin-bottom: 6px; display: flex; gap: 10px; align-items: center; cursor: pointer; transition: border-color var(--t); }
.tl .tl-item:hover { border-color: var(--line-strong); }

/* ============================================================ org chart */
.org-wrap { overflow: auto; padding: 18px 10px 24px; }
.org-tree, .org-tree ul { list-style: none; margin: 0; padding: 0; }
.org-tree { display: flex; justify-content: center; }
.org-tree ul { display: flex; justify-content: center; padding-top: 20px; position: relative; }
.org-tree li { display: flex; flex-direction: column; align-items: center; position: relative; padding: 20px 6px 0; }
.org-tree li::before, .org-tree li::after { content: ""; position: absolute; top: 0; right: 50%; width: 50%; height: 20px; border-top: 2px solid var(--line-strong); }
.org-tree li::after { right: auto; left: 50%; border-left: 2px solid var(--line-strong); }
.org-tree li:only-child::before, .org-tree li:only-child::after { display: none; }
.org-tree li:only-child { padding-top: 0; }
.org-tree li:first-child::before, .org-tree li:last-child::after { border: 0 none; }
.org-tree li:last-child::before { border-right: 2px solid var(--line-strong); border-radius: 0 8px 0 0; }
.org-tree li:first-child::after { border-radius: 8px 0 0 0; }
.org-tree ul ul::before, .org-tree > li > ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 20px; border-left: 2px solid var(--line-strong); }
.org-tree > li { padding-top: 0; }
.onode { background: var(--surface-solid); border: 1px solid var(--line); border-radius: var(--r-tile); padding: 10px 12px; width: 184px; text-align: left; box-shadow: var(--shadow-sm); cursor: pointer; display: flex; gap: 10px; align-items: center; position: relative; transition: box-shadow var(--t), border-color var(--t); }
html[data-theme="dark"] .onode { background: #13243A; }
.onode:hover { box-shadow: var(--shadow); border-color: var(--primary); }
.onode.me { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft), var(--shadow-sm); }
.onode.inactive { opacity: .55; }
.onode.hit { box-shadow: 0 0 0 3px rgba(16,110,190,.45), var(--shadow); }
html[data-theme="dark"] .onode.hit { box-shadow: 0 0 0 3px rgba(15,252,190,.45), var(--shadow); }
.onode .on { font-weight: 700; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.onode .od { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.onode .entity-tag { margin-top: 3px; font-size: 10px; line-height: 16px; padding: 0 6px; }
.onode .tg { position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); border: 1px solid var(--line); background: var(--surface-solid); border-radius: var(--r-pill); font-size: 10.5px; font-weight: 700; padding: 0 8px; color: var(--muted); cursor: pointer; z-index: 2; }
.onode .tg:hover { color: var(--primary-text); border-color: var(--primary); }
.org-tree li.fold > ul { display: none; }

/* ============================================================ wizard / stepper (setup guide) */
.stepper { display: flex; flex-direction: column; gap: 4px; position: relative; }
.stepper .st { display: flex; gap: 12px; align-items: center; padding: 8px 10px; border-radius: var(--r); cursor: pointer; color: var(--muted); position: relative; }
.stepper .st + .st::before { content: ""; position: absolute; left: 21px; top: -10px; height: 14px; border-left: 2px dashed var(--dotted); }
.stepper .st:hover { background: var(--surface-3); }
html[data-theme="dark"] .stepper .st:hover { background: rgba(255,255,255,.06); }
.stepper .st.on { background: var(--primary-soft); color: var(--primary-text); font-weight: 700; }
.stepper .st i { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface-solid); display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 700; flex: none; position: relative; z-index: 1; }
.stepper .st.done i { background: var(--good); border-color: var(--good); color: #FFFFFF; }
html[data-theme="dark"] .stepper .st.done i { color: var(--ink); }
.stepper .st.on i { border-color: var(--primary); color: var(--primary-text); }
.stepper .st.on i::after { content: ""; position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 2px var(--surface-solid); }
.wizard { display: grid; grid-template-columns: 260px 1fr; gap: var(--gap); align-items: start; }

/* ============================================================ report preview */
.report { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px 28px; box-shadow: var(--shadow-sm); }
.report h2 { margin: 0; color: var(--text); font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.report .rsub { color: var(--muted); font-size: 12.5px; margin: 4px 0 14px; }
.report h3 { color: var(--text); font-size: 14px; font-weight: 700; margin: 20px 0 8px; border-bottom: 1px solid var(--line); padding-bottom: 6px; display: flex; gap: 8px; align-items: baseline; }
.report h3 .n { color: var(--faint); font-size: 12px; font-weight: 400; }
.report .note { font-style: italic; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.report .sumgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 22px; }
.report .sumgrid div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dotted var(--line-strong); padding: 4px 0; }
.report .sumgrid b { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.report .meta { font-size: 11.5px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line-2); padding: 8px 10px; border-radius: var(--r-sm); margin-bottom: 12px; }
.report-list button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; font-size: 13px; color: var(--text-2); }
.report-list button:hover { background: var(--surface-3); }
.report-list button.on { background: var(--primary-soft); color: var(--primary-text); font-weight: 700; }
.hist-list { list-style: none; padding: 0; margin: 0; }
.hist-list li { padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 12.5px; }
.hist-list li .when { color: var(--faint); font-size: 11.5px; display: block; }
.map-tbl td, .map-tbl th { padding: 5px 8px; }
.import-row-err td { background: var(--bad-bg); } .import-row-dup td { background: var(--warn-bg); }

/* ============================================================ sign-in (design guide section 6) */
body.auth-mode { background: var(--lilac); }
html[data-theme="dark"] body.auth-mode { background: var(--bg); }
#authRoot { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 45fr) minmax(420px, 55fr); }
/* left: Dark Classic Blue hero (markup from pages3.js: section.auth-side.auth-hero > .auth-sphere.one, .auth-sphere.two,
   .auth-ring, .auth-hero-brand (gold mark + product name), .auth-hero-copy (.auth-headline, .accent-line), .fine) */
.auth-side { background: linear-gradient(160deg, #0A1828 0%, #0E2238 100%); color: #FFFFFF; padding: 40px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; min-height: 100vh; position: relative; overflow: hidden; isolation: isolate; border-right: 1px solid rgba(255,255,255,.06); }
.auth-side::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--signal); z-index: 2; }
.auth-side > * { position: relative; z-index: 1; }
/* two signal-gradient spheres cropped by the panel edge, behind the text */
.auth-side > .auth-sphere, .auth-side .auth-sphere { position: absolute; z-index: 0; border-radius: 50%; pointer-events: none;
  width: 520px; height: 520px; right: -170px; bottom: -190px;
  background: radial-gradient(circle at 32% 30%, rgba(15,252,190,.85) 0%, rgba(0,171,228,.70) 28%, rgba(16,110,190,.55) 52%, rgba(16,110,190,0) 71%); opacity: .75; }
.auth-side .auth-sphere ~ .auth-sphere, .auth-side .auth-sphere.two, .auth-side .auth-sphere.alt { width: 220px; height: 220px; right: -70px; bottom: 330px;
  background: radial-gradient(circle at 35% 32%, rgba(15,252,190,.75) 0%, rgba(0,171,228,.55) 34%, rgba(16,110,190,0) 70%); opacity: .6; }
/* the faint dotted ring (graphic language) */
.auth-side > .auth-ring, .auth-side .auth-ring { position: absolute; z-index: 0; pointer-events: none; width: 640px; height: 640px; right: -260px; bottom: -280px; border-radius: 50%; border: 2px dashed rgba(178,181,224,.18); }
.auth-side .auth-ring::after { content: ""; position: absolute; top: 92px; left: 92px; width: 10px; height: 10px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 5px rgba(15,252,190,.16); }
/* brand row: gold mark at 56 px and the product name */
.auth-hero-brand, .auth-side .auth-brand, .auth-side .auth-top { display: flex; align-items: center; gap: 14px; margin: 0; }
.auth-side img, .auth-side img.auth-logo { width: 56px; height: auto; display: block; flex: none; }
.auth-hero-brand h1, .auth-hero-brand b, .auth-side .auth-brand b, .auth-side .auth-top b, .auth-side .auth-name { display: block; margin: 0; font-family: var(--font-display); font-size: 20px; font-weight: 600; color: #FFFFFF; letter-spacing: -.01em; line-height: 1.25; }
.auth-side .auth-brand span { color: var(--steel); font-size: 12px; }
/* centre: headline and the accent line */
.auth-hero-copy, .auth-hero:not(.auth-side) { margin: auto 0; max-width: 540px; padding: 24px 0; }
.auth-headline, .auth-hero-copy h2, .auth-hero:not(.auth-side) h1 { font-family: var(--font-display); font-size: 36px; font-weight: 600; line-height: 1.15; letter-spacing: -.02em; color: #FFFFFF; margin: 0 0 16px; max-width: 520px; }
.auth-side .accent-line { font-size: 24px; line-height: 1.3; color: var(--steel); margin: 0; max-width: 480px; }
.auth-side p.lead, .auth-hero-copy p.lead { color: #C9D4E3; font-size: 14px; line-height: 1.6; max-width: 470px; margin: 16px 0 0; }
.auth-side .page-kicker { color: var(--mint); }
.auth-side ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.auth-side li { display: flex; gap: 10px; align-items: center; color: #DCE4EE; font-size: 13px; }
.auth-side li i { width: 28px; height: 28px; border-radius: var(--r-sm); background: rgba(255,255,255,.08); color: var(--mint); display: grid; place-items: center; flex: none; font-style: normal; }
.auth-side .fine, .auth-side .auth-fine { font-size: 12px; color: var(--sb-muted); margin: 0; }
/* right: White Lilac with a 400 px card */
.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px 24px; background: var(--lilac); }
html[data-theme="dark"] .auth-main { background: var(--bg); }
.auth-card { width: min(400px, 100%); }
.auth-card .auth-mark { width: 56px; height: auto; display: none; margin: 0 0 20px; }
.auth-card h2 { font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 6px; line-height: 1.25; }
.auth-card .sub { color: var(--muted); margin: 0 0 24px; font-size: 13.5px; }
.auth-card .field { margin-bottom: 14px; }
.auth-card .field input, .auth-card .field select { width: 100%; height: var(--ctl-h-lg); padding: 0 14px; border-radius: var(--r); font-size: 14px; }
.auth-card .btn.primary { height: var(--ctl-h-lg); border-radius: var(--r); font-size: 14px; }
.auth-card .btn.block + p, .auth-card form + p, .auth-card .auth-forgot { margin: 14px 0 0; font-size: 12.5px; color: var(--muted); }
.auth-providers { display: grid; gap: 10px; margin: 0 0 4px; }
.auth-providers:empty { display: none; }
.auth-providers .btn.provider { background: var(--white); border-color: var(--line-strong); color: var(--ink); }
.auth-providers .btn.provider:hover { background: var(--surface-3); border-color: var(--line-strong); }
html[data-theme="dark"] .auth-providers .btn.provider { background: rgba(255,255,255,.06); border-color: var(--line); color: #FFFFFF; }
html[data-theme="dark"] .auth-providers .btn.provider:hover { background: rgba(255,255,255,.10); }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--muted); font-size: 12px; white-space: nowrap; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 70px !important; }
.pw-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); height: 30px; border: 0; background: transparent; color: var(--primary-text); cursor: pointer; font-size: 12px; font-weight: 700; padding: 0 10px; border-radius: var(--r-sm); }
.pw-wrap button:hover { background: var(--surface-3); color: var(--text); }
.caps { color: var(--warn); font-size: 12px; margin-top: 4px; font-weight: 700; }
.auth-brand { margin-bottom: 18px; }
.auth-brand b { display: block; font-family: var(--font-display); font-size: 19px; font-weight: 600; color: var(--text); }
.auth-brand span { color: var(--muted); font-size: 12.5px; }
.auth-msg { min-height: 18px; font-size: 12.5px; margin: 4px 0 12px; }
.auth-msg.err { color: var(--bad); font-weight: 700; background: var(--bad-bg); border: 1px solid var(--bad-line); border-radius: var(--r); padding: 10px 12px; }
.auth-msg.ok, .auth-msg.good { color: var(--good); font-weight: 700; background: var(--good-bg); border: 1px solid var(--good-line); border-radius: var(--r); padding: 10px 12px; }
.auth-msg.info { color: var(--info); font-weight: 700; background: var(--info-bg); border: 1px solid var(--info-line); border-radius: var(--r); padding: 10px 12px; }
.auth-msg:empty { padding: 0; border: 0; background: none; }
.auth-foot { margin-top: 28px; font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.auth-foot svg.ic { color: var(--primary-text); }
.mfa-key { font-family: var(--mono); font-size: 17px; letter-spacing: 1px; background: var(--surface-2); border: 1px solid var(--line); padding: 12px 14px; border-radius: var(--r); word-break: break-all; }
.bg-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 300; background: var(--bad); color: #FFFFFF; text-align: center; padding: 6px; font-size: 12.5px; font-weight: 700; }

/* ============================================================ responsive */
.menu-btn { display: none !important; }
.drawer-scrim { display: none; }
@media (max-width: 1280px) { .grid-main { grid-template-columns: 1fr; } .wizard { grid-template-columns: 1fr; } .auth-side { padding: 36px 40px; } .auth-headline, .auth-hero-copy h2 { font-size: 30px; } }
@media (max-width: 1100px) { .cmd-trigger { width: 220px; } .today-chip { display: none; } #authRoot { grid-template-columns: minmax(0, 1fr) minmax(400px, 1fr); } }
@media (max-width: 900px) {
  .app, .app.pinned { padding-left: 0; }
  .sidebar { width: var(--sb-w) !important; transform: translateX(-102%); transition: transform var(--t-slide) var(--ease); box-shadow: none; }
  .app.nav-open .sidebar { transform: none; box-shadow: var(--shadow-sb); }
  .app.nav-open .drawer-scrim { display: block; position: fixed; inset: 0; background: var(--overlay); z-index: 55; }
  .sb-pin { display: none; }
  .menu-btn { display: inline-grid !important; }
  .form-grid { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .cmd-trigger { width: var(--ctl-h); padding: 0; justify-content: center; }
  .cmd-trigger span, .cmd-trigger kbd { display: none; }
  .period-sel, .user-btn .un, .crumbs, .topbar > .grow { display: none; }
  .topbar { padding: 0 10px; gap: 4px; }
  .topbar .titles { flex: 1 1 auto; }
  .topbar h1 { font-size: 16px; }
  #quickAddBtn { padding: 0 10px; }
  .view { padding: 14px; }
  .today-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* sign-in stacks: a short dark band with the mark and tagline, then the card */
  #authRoot { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-side { padding: 24px 20px 28px; min-height: 0; gap: 0; justify-content: flex-start; }
  .auth-side .auth-ring { width: 360px; height: 360px; right: -150px; bottom: -200px; }
  .auth-side .auth-ring::after { display: none; }
  .auth-side .auth-sphere { width: 300px; height: 300px; right: -110px; bottom: -170px; }
  .auth-side .auth-sphere ~ .auth-sphere, .auth-side .auth-sphere.two, .auth-side .auth-sphere.alt { width: 120px; height: 120px; right: -40px; bottom: auto; top: -40px; }
  .auth-side img, .auth-side img.auth-logo { width: 44px; }
  .auth-hero-brand h1, .auth-hero-brand b { font-size: 16px; }
  .auth-hero-copy, .auth-hero:not(.auth-side) { margin: 18px 0 0; padding: 0; }
  .auth-headline, .auth-hero-copy h2, .auth-hero:not(.auth-side) h1 { font-size: 22px; margin-bottom: 6px; }
  .auth-side .accent-line { font-size: 18px; }
  .auth-side p.lead, .auth-side ul, .auth-side .fine, .auth-side .auth-fine { display: none; }
  .auth-main { align-items: flex-start; padding: 28px 16px 32px; }
  .auth-card .auth-mark { display: none; }
  .kv { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  :root { --page-x: 16px; }
  .view { padding: 14px 16px 40px; }
  .btn, .icon-btn { min-height: 40px; }
  .btn.sm { min-height: 0; }
  .tbl td.actions .btn.sm { min-height: 0; }
  .today-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .today-tile { min-height: 68px; padding: 10px 12px; }
  .today-tile .tt-val { font-size: 18px; }
  .today-tile .tt-lbl { white-space: normal; }
  .topbar h1 { font-size: 15px; }
  .today-tile.today-pinned { grid-column: 1 / -1; }
  .page-head h2 { font-size: 19px; }
  .page-head p.accent-line { font-size: 19px; }
  .modal .mh, .modal .mb, .modal .mf { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 520px) { #helpBtn, #themeBtn, #quickAddBtn .qa-l { display: none; } .kpi .val { font-size: 20px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }

@media print {
  body { background: #FFFFFF; color: #000000; font-size: 11px; }
  .sidebar, .topbar, .no-print, .toasts, .toolbar, .filters, .today { display: none !important; }
  .app, .app.pinned { padding: 0; } .main { height: auto; } .view { padding: 0; overflow: visible; }
  .report { border: 0; padding: 0; box-shadow: none; }
  .tbl th { position: static; }
  .report h3 { break-after: avoid; }
  .tbl tr { break-inside: avoid; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
/* row "more actions" menu */
.rm-menu { min-width: 210px; z-index: 120; }
.rm-menu .di { width: 100%; border: 0; background: transparent; text-align: left; align-items: center; font-size: 13px; }
.rm-menu .di.danger { color: var(--bad); } .rm-menu .di.danger svg.ic { color: var(--bad); }
.rm-btn { font-size: 16px; letter-spacing: 1px; }

/* ===================================================================== v3.2 additions
   primary indicators, severity-ordered attention list, reporting status bar, change table,
   secondary indicator strip, EA support strip, desktop sidebar backdrop, small fixes */
.panel > .pb.flush > .pb { padding: var(--s3) var(--s4); }                      /* D-08: empty text inside flush panels */
.pfoot { padding: 8px 16px; border-top: 1px solid var(--line-2); }
.od { color: var(--bad); font-weight: 700; }

.pkpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: var(--gap); }
.pkpis.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
a.pk { text-decoration: none; color: inherit; }
.pk { all: unset; box-sizing: border-box; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 14px 12px 16px;
  display: flex; flex-direction: column; gap: 4px; min-height: 108px; cursor: pointer; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: border-color var(--t), box-shadow var(--t); }
.pk:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.pk:focus-visible { outline: none; box-shadow: var(--focus), var(--shadow-sm); }
.pk::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--turq); opacity: .7; }
html[data-theme="dark"] .pk::before { background: var(--mint); opacity: .55; }
.pk.bad::before, html[data-theme="dark"] .pk.bad::before { background: var(--bad); opacity: 1; } .pk.warn::before, html[data-theme="dark"] .pk.warn::before { background: var(--warn); opacity: 1; }
.pk .lbl { color: var(--muted); font-size: 12px; font-weight: 500; display: flex; gap: 6px; align-items: center; line-height: 1.3; }
.pk .lbl svg.ic { color: var(--muted); width: 14px; height: 14px; flex: none; }
.pk .val { font-family: var(--font-display); font-size: 26px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.pk.bad .val { color: var(--bad); } .pk.warn .val { color: var(--warn); } .pk.ok .val { color: var(--text); }
.pk .sub { font-size: 12px; color: var(--muted); line-height: 1.35; }

.chips { display: flex; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--line-2); overflow-x: auto; scrollbar-width: thin; }
.chip { all: unset; box-sizing: border-box; white-space: nowrap; font-size: 12px; font-weight: 500; padding: 4px 11px; border-radius: var(--r-pill); border: 1px solid var(--line); color: var(--muted); cursor: pointer; line-height: 1.4; transition: border-color var(--t), background var(--t), color var(--t); }
.chip b { color: var(--text); font-weight: 700; margin-left: 2px; }
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip:focus-visible { outline: none; box-shadow: var(--focus); }
.chip.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-text); font-weight: 700; }
.chip.on b { color: var(--primary-text); }
.chip.sev-critical b { color: var(--bad); } .chip.sev-high b { color: var(--warn); }
.attn .sev { width: 3px; align-self: stretch; border-radius: 2px; margin: -2px 0; flex: none; background: var(--line); }
.attn.sev-critical .sev { background: var(--bad); } .attn.sev-high .sev { background: var(--warn); } .attn.sev-medium .sev { background: var(--info); } .attn.sev-info .sev { background: var(--line-strong); }
.badge.b-sev-critical { background: var(--bad-bg); color: var(--bad); } .badge.b-sev-high { background: var(--warn-bg); color: var(--warn); }
.badge.b-sev-medium { background: var(--info-bg); color: var(--info); } .badge.b-sev-info { background: var(--grey-bg); color: var(--muted); }
#exAttn .attn .badge { flex: none; min-width: 128px; text-align: center; justify-content: center; }

.segbar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--line-2); gap: 2px; }
.segbar i, .seglegend i { display: block; }
.segbar i.good, .seglegend i.good { background: var(--good); } .segbar i.warn, .seglegend i.warn { background: var(--warn); }
.segbar i.info, .seglegend i.info { background: var(--info); } .segbar i.grey, .seglegend i.grey { background: var(--faint); } .segbar i.bad, .seglegend i.bad { background: var(--bad); }
.seglegend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.seglegend span { display: inline-flex; align-items: center; gap: 6px; }
.seglegend i { width: 10px; height: 10px; border-radius: 3px; }
.seglegend b { color: var(--text); }

.chg { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 700; padding: 0 7px; border-radius: var(--r-pill); line-height: 18px; }
.chg svg.ic { width: 12px; height: 12px; }
.chg.good { color: var(--good); background: var(--good-bg); } .chg.bad { color: var(--bad); background: var(--bad-bg); } .chg.flat, .chg:not(.good):not(.bad) { color: var(--muted); background: var(--grey-bg); }

.skpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.sk { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-right: 1px solid var(--line-2); color: inherit; text-decoration: none !important; }
.sk:hover { background: var(--row-hover); }
.sk .l { font-size: 12px; color: var(--muted); } .sk .n { font-family: var(--font-display); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }

.supgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sup { padding: 12px 16px; border-right: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 8px; }
.sup:last-child { border-right: 0; }
.sup-n { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; }
.sup-n a { color: inherit; }
.sup-n .n { font-family: var(--font-display); font-weight: 600; font-size: 18px; margin-right: 3px; font-variant-numeric: tabular-nums; }
.sup-b { display: flex; gap: 6px; flex-wrap: wrap; }

/* desktop: a light backdrop while the auto-hide sidebar overlays the page (it never blocks clicks) */
@media (min-width: 901px) {
  .app.sb-expanded:not(.pinned) .drawer-scrim { display: block; position: fixed; inset: 0 0 0 var(--sb-w); background: rgba(10,24,40,.10); z-index: 55; pointer-events: none; animation: fade .15s ease; }
  html[data-theme="dark"] .app.sb-expanded:not(.pinned) .drawer-scrim { background: rgba(0,0,0,.28); }
}
@media (max-width: 1280px) { .pkpis { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; } .pkpis.six { grid-template-columns: repeat(3, minmax(0, 1fr)); } .pk .val { font-size: 22px; } #exAttn .attn .badge { min-width: 0; } }
@media (max-width: 1100px) { .pkpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .supgrid { grid-template-columns: 1fr; } .sup { border-right: 0; border-bottom: 1px solid var(--line-2); } }
@media (max-width: 600px) {
  .pkpis, .pkpis.six { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pk { min-height: 0; padding: 10px 12px; } .pk .val { font-size: 20px; } .pk .sub { font-size: 11px; }
  .pk:last-child:nth-child(odd) { grid-column: span 2; }
  #exAttn .attn .badge { display: none; }
  .skpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .app.sb-expanded:not(.pinned) .drawer-scrim { animation: none; } }
/* phones: segmented tabs, toolbars and bare tables stay inside the screen (found by the v3.2 390 px sweep) */
@media (max-width: 600px) {
  .seg { flex-wrap: wrap; max-width: 100%; height: auto; }
  .seg button { flex: 1 1 auto; }
  .toolbar, .row { flex-wrap: wrap; }
  .toolbar > *, .row > * { max-width: 100%; }
  #view table.tbl { display: block; overflow-x: auto; max-width: 100%; }
  #view .tbl-wrap table.tbl { display: table; }
}
@media (max-width: 760px) { #view .grid2[style*="grid-template-columns"], #view .grid3 { grid-template-columns: minmax(0, 1fr) !important; } }
/* P&L / CRM */
.tbl.kv th { width: 34%; text-transform: none; letter-spacing: 0; font-size: 12px; background: transparent; position: static; }
.tbl.pnl tr.tot td { background: var(--surface-2); border-top: 1px solid var(--line); }
.modal .mb h4 { margin: 16px 0 6px; font-size: 12.5px; font-weight: 700; }
.tbl td.num, .tbl th.num { white-space: nowrap; }
.kpi .ksub { display: block; font-size: 12px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.kcol h5 span { white-space: nowrap; margin-left: 6px; }
.kanban.pipe { grid-auto-columns: minmax(146px, 1fr); }
.kanban.pipe .kcard { padding: 9px; font-size: 12px; }
.dense .tbl th, .dense .tbl td { padding: 8px 6px; } .dense .tbl th:first-child, .dense .tbl td:first-child { padding-left: 14px; }

/* ---------- Executive Command Centre (Phase 1) */
.cc-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: -4px 0 var(--gap); }
.cc-period button { height: 30px; }
.cc-jump { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; }
.cc-jump a { color: var(--muted); text-decoration: none; padding: 4px 0; border-bottom: 1px dashed transparent; font-weight: 500; }
.cc-jump a:hover, .cc-jump a:focus-visible { color: var(--primary-text); border-bottom-color: var(--primary); outline: none; }
.cc-sec { margin-bottom: calc(var(--gap) * 1.4); scroll-margin-top: 76px; }
.cc-h { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.cc-h h3 { margin: 0; font-family: var(--font-display); font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.cc-h h3:focus { outline: none; }
.cc-h .sub { color: var(--muted); font-size: 12px; }
.cc-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
a.kpi { color: inherit; text-decoration: none !important; }
a.kpi:focus-visible { outline: none; box-shadow: var(--focus), var(--shadow-sm); }
.kpi.cc-tile .val { font-size: 22px; }
.kpi.cc-tile.bad .val { color: var(--bad); } .kpi.cc-tile.warn .val { color: var(--warn); }
.kpi .cc-nodata { font-size: 15px; font-weight: 500; font-family: var(--font); letter-spacing: 0; }
.cc-sec .tbl tr.tot td { font-weight: 700; background: var(--surface-2); }
.cc-sec .tbl tr.muted td { color: var(--muted); }
.hbar { display: block; height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; min-width: 40px; }
.hbar i { display: block; height: 100%; border-radius: 4px; background: var(--primary); }
.hbar.bad i { background: var(--bad); }
.cc-table { margin-top: 8px; font-size: 12.5px; }
.cc-table summary { cursor: pointer; color: var(--muted); font-weight: 500; }
.cc-table summary:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
#ccExcB .attn b, .cc-sec .attn b { font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) { .cc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .cc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .kpi.cc-tile .val { font-size: 18px; } .seg.cc-period { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; } .seg.cc-period button { justify-content: center; padding: 0 4px; } .cc-sec .seg { flex-wrap: wrap; } }
.cc-h .grow { flex: 1 1 auto; }

/* ---------- v3.4 Phase 2: Resources & Capacity ---------- */
.rs-period, .rs-filters { flex-wrap: wrap; gap: 10px; margin-bottom: 12px; align-items: center; }
.rs-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.rs-badge.rs-over { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); }
.rs-badge.rs-under { background: var(--info-bg); border-color: var(--info-line); color: var(--info); }
.rs-badge.rs-ok { background: var(--good-bg); border-color: var(--good-line); color: var(--good); }
.rs-util { display: inline-flex; vertical-align: middle; width: 90px; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.rs-util i { display: block; height: 100%; background: var(--good); }
.rs-util.rs-under i { background: var(--info); }
.rs-util.rs-over i { background: var(--warn); }
.rs-util b { display: block; height: 100%; background: var(--bad); }
.rs-level { font-size: 12px; font-weight: 700; white-space: nowrap; }
.rs-level.l1 { color: var(--muted); } .rs-level.l4 { color: var(--good); }
.rs-tbl tr[data-person] { cursor: pointer; }
.rs-tbl tr[data-person]:hover { background: var(--row-hover); }
.rs-sub > td { background: var(--surface-2); padding: 8px 16px 12px; }
.rs-overrow td { background: var(--bad-bg); }
.rs-person { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.rs-mini { display: flex; flex-wrap: wrap; gap: 14px; }
.rs-mini div { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.rs-mini b { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--text); }
.rs-flag { font-size: 12.5px; padding: 3px 0 3px 10px; border-left: 3px solid var(--line); margin: 3px 0; }
.rs-flag.high { border-color: var(--bad); } .rs-flag.medium { border-color: var(--warn); } .rs-flag.low { border-color: var(--info); }
.rs-check .banner { margin-top: 8px; }
tr.tot td { border-top: 2px solid var(--line); }
@media (max-width: 720px) { .rs-util { width: 56px; } .rs-mini { gap: 10px; } }

/* ---------- v3.5 Phase 3: Commercial & Financial Control ---------- */
.ftag { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.ftag.ft-actual { background: var(--good-bg); border-color: var(--good-line); color: var(--good); }
.ftag.ft-committed { background: var(--info-bg); border-color: var(--info-line); color: var(--info); }
.ftag.ft-forecast { background: var(--surface-2); color: var(--muted); border-style: dashed; }
.ftag.ft-estimate { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); border-style: dashed; }
.cm-range { flex-wrap: wrap; gap: 10px; margin-bottom: 10px; align-items: center; }
.cm-funnel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.cm-step { border: 1px solid var(--line); border-radius: var(--r-tile); padding: 12px 14px; background: var(--surface-2); }
.cm-step .n { font-family: var(--font-display); font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cm-step .l { font-weight: 700; }
.cm-lines input { width: 100%; min-width: 0; }
.cm-lines input.num { text-align: right; }
.cm-totals { margin-top: 8px; }
.cm-inv-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.hbar.est i { background: transparent; border: 1px dashed var(--warn); box-sizing: border-box; }
.hbar.est { margin-top: 3px; }
@media (max-width: 720px) { .cm-funnel { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* v3.6 Phase 4: digital twin operations */
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: var(--row-hover); }
.cc-ops-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cc-ops-grid .panel { margin: 0; }
.cc-ops-l { gap: 8px; padding: 3px 0; font-size: 13px; border-bottom: 1px dashed var(--line); }
.cc-ops-l:last-of-type { border-bottom: 0; }
@media (max-width: 1100px) { .cc-ops-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .cc-ops-grid { grid-template-columns: 1fr; } }
