/* ==========================================================================
   Org360 design system
   Tokens → base → layout → components → utilities
   ========================================================================== */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/assets/fonts/inter-latin-wght-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/assets/fonts/inter-latin-ext-wght-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  color-scheme: light;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* accent (brand) ramp — personal/company colour themes override these at runtime (see js/lib/appearance.js) */
  --brand: #5b5bd6; --brand-600: #4b4bc4; --brand-700: #3e3eab; --brand-50: #f0f0fe; --brand-100: #e2e2fc; --brand-200: #c9c9f8;
  --brand-text: var(--brand); /* brand used as text (≥4.5:1 on the page background) */
  --brand-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #06b6d4 100%);
  --on-brand: #ffffff;       /* text on --brand fills (white or near-black, whichever passes AA) */
  --logo-1: #6366f1; --logo-2: #8b5cf6; --logo-3: #06b6d4; --auth-glow-1: #4f46e5; --auth-glow-2: #0891b2; --auth-icon: #a5b4fc;

  --bg: #f5f6fa; --surface: #ffffff; --surface-2: #f8f9fc; --surface-3: #f1f3f8; --hover: #f3f4f9; --active: #eceefa;
  --border: #e4e7ef; --border-strong: #d3d8e3; --ring: rgba(91, 91, 214, 0.35);
  --text: #0f172a; --text-2: #475569; --muted: #8a93a6; --faint: #b4bccb;

  --green: #16a34a; --green-bg: #e8f7ee; --green-text: #0f7a38;
  --amber: #d97706; --amber-bg: #fdf4e3; --amber-text: #9a5b05;
  --red: #dc2626; --red-bg: #fdecec; --red-text: #b42323;
  --blue: #2563eb; --blue-bg: #e9f0fe; --blue-text: #1d4fc4;
  --violet: #7c3aed; --violet-bg: #f1eafe; --violet-text: #6429c9;
  --pink: #db2777; --pink-bg: #fde9f2; --pink-text: #b3175f;
  --teal: #0d9488; --teal-bg: #e3f6f4; --teal-text: #0b7169;
  --gray-bg: #eef0f5; --gray-text: #4b5566;

  /* chart palette (validated: dataviz reference order) */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #4a3aa7; --s8: #e34948;
  --grid: #eceef3; --axis: #cbd2de;

  /* navigation chrome (sidebar / rail); data-sidebar="light|brand" swap these below */
  --sidebar-bg: #0e1222; --sidebar-2: #151a2e; --sidebar-text: #c3c9dc; --sidebar-muted: #8b94b0; --sidebar-strong: #ffffff;
  --sidebar-active: rgba(124, 124, 240, 0.18); --sidebar-active-text: #ffffff; --sidebar-active-icon: #a5b4fc; --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-border: rgba(255, 255, 255, 0.04); --sidebar-sep: rgba(255, 255, 255, 0.07); --sidebar-indicator: linear-gradient(#818cf8, #22d3ee);
  --sidebar-brand-bg: #4341a8; --nav-badge-bg: #6366f1; --nav-badge-text: #ffffff;
  --wordmark-grad: linear-gradient(90deg, #a5b4fc, #c4b5fd 45%, #67e8f9); --wordmark-grad-strong: linear-gradient(90deg, #5b5bd6, #8b5cf6 55%, #0891b2);

  --corner: 1; --radius-sm: calc(6px * var(--corner)); --radius: calc(10px * var(--corner)); --radius-lg: calc(14px * var(--corner)); --radius-xl: calc(20px * var(--corner));
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 6px 16px -4px rgba(16, 24, 40, 0.1), 0 2px 6px -2px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 20px 40px -12px rgba(16, 24, 40, 0.22), 0 4px 12px -4px rgba(16, 24, 40, 0.08);
  --sidebar-w: 252px; --rail-w: 64px;
  --bar-h: 60px;            /* top bar row */
  --nav-h: 44px;            /* top navigation row (layout: top navigation) */
  --topbar-h: var(--bar-h); /* total sticky header height — pages use it for sticky offsets */
  --content-x: 28px; --content-pad: 24px var(--content-x) 48px;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme='light'])) {
    color-scheme: dark;
    --brand: #7b7bf0; --brand-600: #8d8df5; --brand-700: #a3a3f7; --brand-50: #1d1f3d; --brand-100: #25284d; --brand-200: #353a6b;
    --bg: #0b0e14; --surface: #131722; --surface-2: #171c28; --surface-3: #1c2230; --hover: #1d2332; --active: #232a3d;
    --border: #252c3b; --border-strong: #333b4e; --ring: rgba(123, 123, 240, 0.45);
    --text: #eef1f7; --text-2: #aab3c5; --muted: #7c8699; --faint: #535c70;
    --green-bg: rgba(22, 163, 74, 0.16); --green-text: #4ade80; --amber-bg: rgba(217, 119, 6, 0.18); --amber-text: #fbbf24;
    --red-bg: rgba(220, 38, 38, 0.18); --red-text: #f87171; --blue-bg: rgba(37, 99, 235, 0.2); --blue-text: #7aa7ff;
    --violet-bg: rgba(124, 58, 237, 0.22); --violet-text: #b794ff; --pink-bg: rgba(219, 39, 119, 0.2); --pink-text: #f472b6;
    --teal-bg: rgba(13, 148, 136, 0.2); --teal-text: #2dd4bf; --gray-bg: #232a38; --gray-text: #aab3c5;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    --grid: #222837; --axis: #394155;
    --sidebar-bg: #0a0d16; --sidebar-2: #10141f; --on-brand: #0b1020;
    --shadow-md: 0 6px 16px -4px rgba(0, 0, 0, 0.5); --shadow-lg: 0 20px 48px -12px rgba(0, 0, 0, 0.7);
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --brand: #7b7bf0; --brand-600: #8d8df5; --brand-700: #a3a3f7; --brand-50: #1d1f3d; --brand-100: #25284d; --brand-200: #353a6b;
  --bg: #0b0e14; --surface: #131722; --surface-2: #171c28; --surface-3: #1c2230; --hover: #1d2332; --active: #232a3d;
  --border: #252c3b; --border-strong: #333b4e; --ring: rgba(123, 123, 240, 0.45);
  --text: #eef1f7; --text-2: #aab3c5; --muted: #7c8699; --faint: #535c70;
  --green-bg: rgba(22, 163, 74, 0.16); --green-text: #4ade80; --amber-bg: rgba(217, 119, 6, 0.18); --amber-text: #fbbf24;
  --red-bg: rgba(220, 38, 38, 0.18); --red-text: #f87171; --blue-bg: rgba(37, 99, 235, 0.2); --blue-text: #7aa7ff;
  --violet-bg: rgba(124, 58, 237, 0.22); --violet-text: #b794ff; --pink-bg: rgba(219, 39, 119, 0.2); --pink-text: #f472b6;
  --teal-bg: rgba(13, 148, 136, 0.2); --teal-text: #2dd4bf; --gray-bg: #232a38; --gray-text: #aab3c5;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --grid: #222837; --axis: #394155;
  --sidebar-bg: #0a0d16; --sidebar-2: #10141f; --on-brand: #0b1020;
  --shadow-md: 0 6px 16px -4px rgba(0, 0, 0, 0.5); --shadow-lg: 0 20px 48px -12px rgba(0, 0, 0, 0.7);
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body { font-family: var(--font); font-size: 0.875rem; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01'; }
a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, h5 { margin: 0; font-weight: 650; letter-spacing: -0.01em; line-height: 1.25; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.1875rem; } h3 { font-size: 1rem; } h4 { font-size: 0.875rem; }
p { margin: 0 0 0.75em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
code, kbd, .mono { font-family: var(--mono); font-size: 0.78125rem; }
img { max-width: 100%; }
button { font-family: inherit; }
::selection { background: var(--brand-100); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; left: 12px; top: 12px; z-index: 400; padding: 8px 14px; border-radius: calc(8px * var(--corner)); background: var(--brand); color: var(--on-brand); font-weight: 600; transform: translateY(-200%); opacity: 0; }
.skip-link:focus { transform: none; opacity: 1; box-shadow: var(--shadow-lg); text-decoration: none; }
.content:focus { outline: none; }
.tabular, table { font-variant-numeric: tabular-nums; }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

/* ------------------------------------------------------------------ app layout
   Three navigation layouts (html[data-layout]): sidebar · compact (icon rail + flyouts) · topnav (menus across the top).
   Below 900px every layout uses the same mobile drawer (the full sidebar) behind the hamburger. */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.main { min-width: 0; display: flex; flex-direction: column; }
.content { flex: 1; padding: var(--content-pad); max-width: 1480px; width: 100%; margin: 0 auto; }
.content.wide { max-width: none; }
.rail, .topnav, .topbar-brand { display: none; }
@media (min-width: 901px) {
  :root[data-layout='compact'] .app { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
  :root[data-layout='compact'] .sidebar, :root[data-layout='topnav'] .sidebar { display: none; }
  :root[data-layout='compact'] .rail { display: flex; }
  :root[data-layout='topnav'] { --topbar-h: calc(var(--bar-h) + var(--nav-h)); }
  :root[data-layout='topnav'] .app { grid-template-columns: minmax(0, 1fr); }
  :root[data-layout='topnav'] .topnav { display: flex; }
  :root[data-layout='topnav'] .topbar-brand { display: flex; }
  :root[data-layout='topnav'] .content { max-width: none; }
  :root[data-layout='topnav'] .topbar { padding: 0 var(--content-x); }
  :root[data-layout='topnav'] .topnav { padding: 0 calc(var(--content-x) - 10px); }
}

/* navigation chrome styles (html[data-sidebar]) — dark is the default above */
:root[data-sidebar='light'] {
  --sidebar-bg: var(--surface); --sidebar-2: var(--surface-2); --sidebar-text: var(--text-2); --sidebar-muted: var(--muted); --sidebar-strong: var(--text);
  --sidebar-active: var(--brand-50); --sidebar-active-text: var(--brand-700); --sidebar-active-icon: var(--brand-text); --sidebar-hover: var(--hover);
  --sidebar-border: var(--border); --sidebar-sep: var(--border); --sidebar-indicator: var(--brand); --nav-badge-bg: var(--brand); --nav-badge-text: var(--on-brand);
  --wordmark-grad: var(--wordmark-grad-strong);
}
:root[data-sidebar='brand'] {
  --sidebar-bg: var(--sidebar-brand-bg); --sidebar-2: rgba(0, 0, 0, 0.18); --sidebar-text: rgba(255, 255, 255, 0.88); --sidebar-muted: rgba(255, 255, 255, 0.7); --sidebar-strong: #ffffff;
  --sidebar-active: rgba(255, 255, 255, 0.2); --sidebar-active-text: #ffffff; --sidebar-active-icon: #ffffff; --sidebar-hover: rgba(255, 255, 255, 0.11);
  --sidebar-border: rgba(255, 255, 255, 0.08); --sidebar-sep: rgba(255, 255, 255, 0.14); --sidebar-indicator: #ffffff; --nav-badge-bg: #ffffff; --nav-badge-text: var(--sidebar-brand-bg);
  --wordmark-grad: linear-gradient(90deg, #ffffff, rgba(255, 255, 255, 0.72));
}

/* sidebar (expanded layout + the mobile drawer for every layout) */
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--sidebar-bg); color: var(--sidebar-text); display: flex; flex-direction: column; overflow: hidden; z-index: 30; border-right: 1px solid var(--sidebar-border); }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 0 12px 0 16px; height: var(--bar-h); flex-shrink: 0; }
.brand-link { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none !important; border-radius: calc(8px * var(--corner)); }
.logo-mark { display: block; flex-shrink: 0; border-radius: calc(9px * var(--corner)); }
.wordmark { font-size: 1.1875rem; font-weight: 750; letter-spacing: -0.02em; color: var(--sidebar-strong); white-space: nowrap; line-height: 1; }
.wordmark span { background: var(--wordmark-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sidebar-brand .sb-toggle, .sidebar-brand .sb-close { margin-left: auto; }
.sidebar-company { margin: 2px 12px 8px; padding: 8px 10px; border-radius: calc(10px * var(--corner)); background: var(--sidebar-2); display: flex; align-items: center; gap: 10px; font-size: 0.78125rem; flex-shrink: 0; }
.sidebar-company .co-mark { width: 28px; height: 28px; border-radius: calc(8px * var(--corner)); flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 0.6875rem; font-weight: 700; color: #fff; background: linear-gradient(135deg, #334155, #1e293b); overflow: hidden; }
.sidebar-company .co-mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.sidebar-company .co-name { color: var(--sidebar-strong); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-company .co-sub { color: var(--sidebar-muted); font-size: 0.71875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 0 10px 16px; overscroll-behavior: contain; }
.sidebar-nav::-webkit-scrollbar { width: 6px; } .sidebar-nav::-webkit-scrollbar-thumb { background: var(--sidebar-sep); border-radius: 3px; }
.nav-section { margin-top: 14px; }
.nav-section:first-child { margin-top: 4px; }
.nav-section-title { font-size: 0.65625rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.08em; color: var(--sidebar-muted); padding: 6px 10px; white-space: nowrap; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 7px 10px; margin: 1px 0; border-radius: calc(8px * var(--corner)); color: var(--sidebar-text); font-size: 0.84375rem; font-weight: 500; cursor: pointer; white-space: nowrap; position: relative; text-decoration: none !important; transition: background 0.12s, color 0.12s; }
.nav-item:hover { background: var(--sidebar-hover); color: var(--sidebar-strong); }
.nav-item.active { background: var(--sidebar-active); color: var(--sidebar-active-text); font-weight: 600; }
.nav-item.active::before { content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--sidebar-indicator); }
.nav-item:focus-visible, .rail-item:focus-visible, .sb-toggle:focus-visible, .brand-link:focus-visible { outline: 2px solid var(--sidebar-active-icon); outline-offset: -2px; }
.nav-item .icon { flex-shrink: 0; opacity: 0.85; }
.nav-item.active .icon { opacity: 1; color: var(--sidebar-active-icon); }
.nav-label { overflow: hidden; text-overflow: ellipsis; }
.nav-badge { margin-left: auto; background: var(--nav-badge-bg); color: var(--nav-badge-text); font-size: 0.6875rem; font-weight: 700; padding: 0 7px; border-radius: 999px; line-height: 18px; min-width: 20px; text-align: center; }

/* small square icon buttons in the navigation chrome (collapse / expand / close) */
.sb-toggle, .sb-close { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex-shrink: 0; border: 0; border-radius: calc(7px * var(--corner)); background: transparent; color: var(--sidebar-muted); cursor: pointer; transition: background 0.12s, color 0.12s; }
.sb-toggle:hover, .sb-close:hover { background: var(--sidebar-hover); color: var(--sidebar-strong); }
.sb-close { display: none; }

/* compact layout: icon rail with tooltips and flyout section menus */
.rail { position: sticky; top: 0; height: 100vh; width: var(--rail-w); background: var(--sidebar-bg); color: var(--sidebar-text); flex-direction: column; align-items: center; z-index: 30; border-right: 1px solid var(--sidebar-border); }
.rail-top { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: calc((var(--bar-h) - 34px) / 2) 0 8px; flex-shrink: 0; }
.rail-nav { flex: 1; width: 100%; overflow-y: auto; overflow-x: hidden; padding: 4px 10px 16px; display: flex; flex-direction: column; align-items: center; gap: 2px; scrollbar-width: none; }
.rail-nav::-webkit-scrollbar { display: none; }
.rail-sep { width: 24px; height: 1px; background: var(--sidebar-sep); margin: 6px 0; flex-shrink: 0; }
.rail-item { position: relative; display: flex; align-items: center; justify-content: center; width: 44px; height: 40px; flex-shrink: 0; border: 0; border-radius: calc(10px * var(--corner)); background: transparent; color: var(--sidebar-text); cursor: pointer; text-decoration: none !important; transition: background 0.12s, color 0.12s; }
.rail-item .icon { opacity: 0.85; }
.rail-item:hover, .rail-item.open { background: var(--sidebar-hover); color: var(--sidebar-strong); }
.rail-item.active { background: var(--sidebar-active); color: var(--sidebar-active-text); }
.rail-item.active .icon { opacity: 1; color: var(--sidebar-active-icon); }
.rail-item.active::before { content: ''; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--sidebar-indicator); }
.rail-item .rail-caret { position: absolute; right: 3px; bottom: 3px; width: 0; height: 0; border-left: 4px solid transparent; border-bottom: 4px solid currentColor; opacity: 0.45; }
.rail-badge { position: absolute; top: 3px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--nav-badge-bg); color: var(--nav-badge-text); font-size: 0.625rem; font-weight: 700; line-height: 16px; text-align: center; box-shadow: 0 0 0 2px var(--sidebar-bg); }
.flyout { position: fixed; z-index: 90; min-width: 232px; max-width: 300px; max-height: calc(100vh - 16px); overflow-y: auto; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: calc(12px * var(--corner)); box-shadow: var(--shadow-lg); padding: 6px; animation: flyin 0.12s ease; }
@keyframes flyin { from { opacity: 0; transform: translateX(-4px); } }
.flyout-title { font-size: 0.6875rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); padding: 7px 10px 5px; }
.flyout .menu-item.active, .tn-menu .menu-item.active { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.flyout .menu-item.active .icon, .tn-menu .menu-item.active .icon { color: var(--brand-text); }
.menu-item .menu-badge { margin-left: auto; background: var(--brand); color: var(--on-brand); font-size: 0.6875rem; font-weight: 700; padding: 0 7px; border-radius: 999px; line-height: 18px; }

/* header: top bar row (+ navigation row in the top-navigation layout) */
.app-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.6) blur(12px); -webkit-backdrop-filter: saturate(1.6) blur(12px); border-bottom: 1px solid var(--border); }
.topbar { height: var(--bar-h); display: flex; align-items: center; gap: 12px; padding: 0 20px 0 16px; }
.topbar-brand { align-items: center; gap: 10px; flex-shrink: 0; margin-right: 8px; }
.topbar-brand .wordmark { color: var(--text); font-size: 1.125rem; }
.topbar-brand .wordmark span { background: var(--wordmark-grad-strong); -webkit-background-clip: text; background-clip: text; }
.topbar-brand .co-name { font-size: 0.8125rem; font-weight: 600; color: var(--text-2); padding-left: 12px; margin-left: 2px; border-left: 1px solid var(--border); white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.search-trigger { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px 0 12px; min-width: 280px; max-width: 460px; flex: 1; border: 1px solid var(--border); border-radius: calc(10px * var(--corner)); background: var(--surface); color: var(--muted); cursor: pointer; font-size: 0.84375rem; transition: border-color 0.15s, box-shadow 0.15s; }
.search-trigger:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.search-trigger kbd { margin-left: auto; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.topbar-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 12px 10px; }
.topbar-sub:not(:has(> :not(.hide-mobile))) { display: none; }
.topbar-sub .att-pop { left: 0; right: auto; } /* the clock popover opens rightwards from the left-hand chip */
.avatar-btn { display: inline-flex; align-items: center; justify-content: center; height: 36px; padding: 0 2px; border: 0; background: transparent; border-radius: 999px; cursor: pointer; }
.avatar-btn:hover .avatar, .avatar-btn[aria-expanded='true'] .avatar { box-shadow: 0 0 0 3px var(--ring); }
.clock-chip { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 10px; border-radius: 999px; font-weight: 600; font-size: 0.8125rem; border: 1px solid var(--border); background: var(--surface); cursor: pointer; color: var(--text); }
.clock-chip.on { background: var(--green-bg); border-color: transparent; color: var(--green-text); }
.clock-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.clock-chip.on .dot { background: var(--green); box-shadow: 0 0 0 4px rgba(22,163,74,0.18); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(22,163,74,0.05); } }
.impersonation-bar { background: linear-gradient(90deg, #4338ca, #7c3aed); color: #fff; font-size: 0.8125rem; padding: 7px 20px; display: flex; align-items: center; gap: 12px; }
.impersonation-bar button { margin-left: auto; }

/* page */
.page-header { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-header .titles { flex: 1; min-width: 240px; }
.page-header h1 { font-size: 1.4375rem; font-weight: 700; letter-spacing: -0.02em; }
.page-header .subtitle { color: var(--text-2); margin-top: 4px; font-size: 0.84375rem; }
.page-header .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.breadcrumbs { display: flex; gap: 6px; align-items: center; font-size: 0.78125rem; color: var(--muted); margin-bottom: 6px; }
.breadcrumbs a { color: var(--muted); } .breadcrumbs a:hover { color: var(--text); }

/* ------------------------------------------------------------------ components */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); min-width: 0; }
.card-header { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); min-height: 52px; }
.card-header.plain { border-bottom: 0; padding-bottom: 4px; }
.card-title { font-size: 0.90625rem; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.card-subtitle { font-size: 0.78125rem; color: var(--muted); font-weight: 450; }
.card-header .card-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-body { padding: 18px; }
.card-body.tight { padding: 12px 14px; }
.card-body.flush { padding: 0; }
.card-footer { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; align-items: center; }
.card.hoverable { transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s; cursor: pointer; }
.card.hoverable:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); transform: translateY(-1px); }
.card.gradient { background: var(--brand-grad); color: #fff; border: 0; }
.card.soft { background: var(--surface-2); box-shadow: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: calc(9px * var(--corner)); border: 1px solid transparent; font-size: 0.84375rem; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background 0.12s, border-color 0.12s, box-shadow 0.12s, color 0.12s; text-decoration: none !important; user-select: none; line-height: 1; }
.btn:disabled, .btn.disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: var(--on-brand); box-shadow: 0 1px 2px rgba(60, 60, 170, 0.25), inset 0 1px 0 rgba(255,255,255,0.12); }
.btn-primary:hover:not(:disabled) { background: var(--brand-600); }
.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text); box-shadow: var(--shadow-sm); }
.btn-secondary:hover:not(:disabled) { background: var(--hover); border-color: var(--border-strong); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(0.95); }
.btn-danger-soft { background: var(--red-bg); color: var(--red-text); }
.btn-success { background: var(--green); color: #fff; }
.btn-success-soft { background: var(--green-bg); color: var(--green-text); }
.btn-soft { background: var(--brand-50); color: var(--brand-700); }
.btn-soft:hover:not(:disabled) { background: var(--brand-100); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 0.78125rem; border-radius: calc(8px * var(--corner)); gap: 5px; }
.btn-xs { height: 24px; padding: 0 8px; font-size: 0.75rem; border-radius: calc(6px * var(--corner)); gap: 4px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 0.9375rem; border-radius: calc(11px * var(--corner)); }
.btn-icon { width: 36px; padding: 0; }
.btn-icon.btn-sm { width: 30px; } .btn-icon.btn-xs { width: 24px; }
.btn-block { width: 100%; }
.btn .spinner { width: 14px; height: 14px; }
.btn-group { display: inline-flex; } .btn-group .btn { border-radius: 0; } .btn-group .btn:first-child { border-radius: calc(9px * var(--corner)) 0 0 calc(9px * var(--corner)); } .btn-group .btn:last-child { border-radius: 0 calc(9px * var(--corner)) calc(9px * var(--corner)) 0; } .btn-group .btn + .btn { margin-left: -1px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: calc(9px * var(--corner)); border: 0; background: transparent; color: var(--text-2); cursor: pointer; position: relative; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn .dot-badge { position: absolute; top: 5px; right: 5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--red); color: #fff; font-size: 0.625rem; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg); }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 0.71875rem; font-weight: 600; white-space: nowrap; background: var(--gray-bg); color: var(--gray-text); line-height: 1; }
.badge .bdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-green { background: var(--green-bg); color: var(--green-text); } .badge-amber { background: var(--amber-bg); color: var(--amber-text); }
.badge-red { background: var(--red-bg); color: var(--red-text); } .badge-blue { background: var(--blue-bg); color: var(--blue-text); }
.badge-violet { background: var(--violet-bg); color: var(--violet-text); } .badge-pink { background: var(--pink-bg); color: var(--pink-text); }
.badge-teal { background: var(--teal-bg); color: var(--teal-text); } .badge-brand { background: var(--brand-50); color: var(--brand-700); }
.badge-outline { background: transparent; border: 1px solid var(--border); color: var(--text-2); }
.badge-lg { height: 26px; padding: 0 11px; font-size: 0.78125rem; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 0.78125rem; font-weight: 500; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-700); }
.chip .x { opacity: 0.6; } .chip .x:hover { opacity: 1; }

/* avatar */
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 650; flex-shrink: 0; overflow: hidden; background: var(--brand); user-select: none; position: relative; letter-spacing: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-ring { box-shadow: 0 0 0 2px var(--surface); }
.avatar-stack { display: inline-flex; } .avatar-stack .avatar { box-shadow: 0 0 0 2px var(--surface); } .avatar-stack .avatar + .avatar { margin-left: -8px; }
.avatar .presence { position: absolute; right: 0; bottom: 0; width: 28%; height: 28%; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 2px var(--surface); }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person .pname { font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .psub { font-size: 0.75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person a.pname:hover { color: var(--brand-text); text-decoration: none; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 0.78125rem; font-weight: 600; color: var(--text-2); }
.field .req { color: var(--red); margin-left: 2px; }
.field .help { font-size: 0.75rem; color: var(--muted); }
.field .error { font-size: 0.75rem; color: var(--red-text); }
.input, .select, .textarea { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: calc(9px * var(--corner)); background: var(--surface); color: var(--text); font: inherit; font-size: 0.84375rem; transition: border-color 0.12s, box-shadow 0.12s; outline: none; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus, .combo:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.input.invalid, .select.invalid, .textarea.invalid { border-color: var(--red); }
.input-sm, .select.input-sm { height: 32px; font-size: 0.8125rem; padding: 0 10px; border-radius: calc(8px * var(--corner)); }
.textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a93a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; cursor: pointer; }
.input-group { display: flex; align-items: stretch; } .input-group .input { border-radius: 0; } .input-group > :first-child { border-radius: calc(9px * var(--corner)) 0 0 calc(9px * var(--corner)); } .input-group > :last-child { border-radius: 0 calc(9px * var(--corner)) calc(9px * var(--corner)) 0; }
.input-addon { display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font-size: 0.8125rem; }
.input-group .input-addon:first-child { border-right: 0; } .input-group .input-addon:last-child { border-left: 0; }
.input-icon { position: relative; } .input-icon .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; } .input-icon .input { padding-left: 36px; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.84375rem; user-select: none; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; margin: 0; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.84375rem; user-select: none; }
.switch input { display: none; }
.switch .track { width: 36px; height: 20px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background 0.15s; flex-shrink: 0; }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.2); transition: transform 0.15s; }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(16px); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-section { margin-bottom: 22px; }
.form-section-title { font-size: 0.8125rem; font-weight: 650; color: var(--text); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.combo { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; min-height: 38px; padding: 4px 8px; border: 1px solid var(--border); border-radius: calc(9px * var(--corner)); background: var(--surface); cursor: text; }
.combo input { border: 0; outline: none; background: transparent; font: inherit; font-size: 0.84375rem; flex: 1; min-width: 80px; height: 28px; color: var(--text); }
.combo-menu { position: absolute; left: -1px; right: -1px; top: calc(100% + 4px); z-index: 60; background: var(--surface); border: 1px solid var(--border); border-radius: calc(10px * var(--corner)); box-shadow: var(--shadow-lg); max-height: 280px; overflow-y: auto; padding: 4px; }
.combo-option { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: calc(7px * var(--corner)); cursor: pointer; font-size: 0.84375rem; }
.combo-option:hover, .combo-option.hl { background: var(--hover); }
.dropzone { border: 1.5px dashed var(--border-strong); border-radius: calc(12px * var(--corner)); padding: 22px; text-align: center; color: var(--muted); cursor: pointer; transition: border-color 0.15s, background 0.15s; background: var(--surface-2); }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-50); color: var(--brand-700); }

/* segmented control & tabs */
.segmented { display: inline-flex; padding: 3px; background: var(--surface-3); border-radius: calc(10px * var(--corner)); gap: 2px; border: 1px solid var(--border); }
.segmented button { border: 0; background: transparent; height: 28px; padding: 0 12px; border-radius: calc(7px * var(--corner)); font-size: 0.78125rem; font-weight: 600; color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 10px 12px; border: 0; background: none; color: var(--text-2); font-size: 0.84375rem; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none !important; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand-text); border-bottom-color: var(--brand); }
.tab .count { background: var(--surface-3); color: var(--text-2); border-radius: 999px; padding: 1px 7px; font-size: 0.6875rem; }
.tab.active .count { background: var(--brand-50); color: var(--brand-700); }

/* table */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.84375rem; }
.table th { text-align: left; font-weight: 600; font-size: 0.75rem; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; z-index: 1; user-select: none; }
.table th.sortable { cursor: pointer; } .table th.sortable:hover { color: var(--text); }
.table th .sort-ind { display: inline-flex; vertical-align: middle; margin-left: 3px; opacity: 0.8; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 0.1s; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.selected td { background: var(--brand-50); }
.table .num, .table th.num { text-align: right; }
.table .shrink { width: 1%; white-space: nowrap; }
.table-dense td { padding: 7px 12px; } .table-dense th { padding: 8px 12px; }
.table tfoot td { font-weight: 650; background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 0; }
.table-toolbar { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.table-toolbar .grow, .grow { flex: 1; }
.table-footer { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 0.78125rem; color: var(--muted); }
.bulk-bar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--brand-50); border-bottom: 1px solid var(--brand-100); font-size: 0.8125rem; color: var(--brand-700); font-weight: 600; }

/* stat tiles */
.stat { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; }
.stat .stat-label { font-size: 0.78125rem; color: var(--text-2); font-weight: 550; display: flex; align-items: center; gap: 7px; }
.stat .stat-value { font-size: 1.625rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; color: var(--text); }
.stat .stat-foot { display: flex; align-items: center; gap: 8px; font-size: 0.75rem; color: var(--muted); min-height: 18px; }
.stat .stat-icon { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: calc(10px * var(--corner)); display: flex; align-items: center; justify-content: center; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 650; font-size: 0.75rem; }
.delta.up { color: var(--green-text); } .delta.down { color: var(--red-text); } .delta.flat { color: var(--muted); }
.tone-icon { width: 34px; height: 34px; border-radius: calc(10px * var(--corner)); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tone-brand { background: var(--brand-50); color: var(--brand-text); } .tone-green { background: var(--green-bg); color: var(--green-text); } .tone-amber { background: var(--amber-bg); color: var(--amber-text); }
.tone-red { background: var(--red-bg); color: var(--red-text); } .tone-blue { background: var(--blue-bg); color: var(--blue-text); } .tone-violet { background: var(--violet-bg); color: var(--violet-text); }
.tone-pink { background: var(--pink-bg); color: var(--pink-text); } .tone-teal { background: var(--teal-bg); color: var(--teal-text); } .tone-gray { background: var(--gray-bg); color: var(--gray-text); }

/* progress */
.progress { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; position: relative; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: var(--brand); transition: width 0.4s ease; }
.progress.sm { height: 5px; } .progress.lg { height: 12px; }
.progress.green > span { background: var(--green); } .progress.amber > span { background: var(--amber); } .progress.red > span { background: var(--red); } .progress.teal > span { background: var(--teal); }

/* list */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border); min-width: 0; }
.list-item:last-child { border-bottom: 0; }
.list-item.clickable { cursor: pointer; } .list-item.clickable:hover { background: var(--surface-2); }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-title { font-weight: 600; font-size: 0.84375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .li-sub { font-size: 0.78125rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kv { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 10px 16px; font-size: 0.84375rem; }
.kv dt { color: var(--muted); font-weight: 500; } .kv dd { margin: 0; color: var(--text); font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

/* empty / skeleton / spinner */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 44px 24px; color: var(--muted); gap: 8px; }
.empty .empty-icon { width: 52px; height: 52px; border-radius: calc(16px * var(--corner)); display: flex; align-items: center; justify-content: center; background: var(--brand-50); color: var(--brand-text); margin-bottom: 6px; }
.empty .empty-title { font-weight: 650; color: var(--text); font-size: 0.9375rem; }
.empty .empty-text { max-width: 380px; font-size: 0.8125rem; }
.skeleton { background: linear-gradient(90deg, var(--surface-3) 25%, var(--hover) 37%, var(--surface-3) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: calc(8px * var(--corner)); }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.spinner { width: 20px; height: 20px; border: 2px solid var(--border-strong); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.page-loading { display: flex; align-items: center; justify-content: center; min-height: 50vh; }

/* overlays */
.overlay { position: fixed; inset: 0; background: rgba(10, 14, 26, 0.45); backdrop-filter: blur(2px); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; animation: fadein 0.15s ease; overflow-y: auto; }
@keyframes fadein { from { opacity: 0; } }
@keyframes popin { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } }
.modal { background: var(--surface); border-radius: calc(16px * var(--corner)); box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; animation: popin 0.18s ease; border: 1px solid var(--border); display: flex; flex-direction: column; max-height: 84vh; }
.modal.sm { max-width: 420px; } .modal.lg { max-width: 780px; } .modal.xl { max-width: 1040px; }
.modal-header { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 12px; }
.modal-header h3 { font-size: 1.0625rem; font-weight: 650; }
.modal-header .modal-sub { color: var(--muted); font-size: 0.8125rem; margin-top: 3px; }
.modal-body { padding: 8px 20px 20px; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 calc(16px * var(--corner)) calc(16px * var(--corner)); }
.drawer-overlay { align-items: stretch; justify-content: flex-end; padding: 0; }
.drawer { background: var(--surface); width: 100%; max-width: 560px; height: 100vh; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slidein 0.2s ease; border-left: 1px solid var(--border); }
.drawer.lg { max-width: 760px; } .drawer.xl { max-width: 980px; }
.drawer-header { display: flex; align-items: flex-start; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px; }
.drawer-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); }
.menu { position: fixed; z-index: 120; min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: calc(12px * var(--corner)); box-shadow: var(--shadow-lg); padding: 5px; animation: popin 0.12s ease; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: calc(8px * var(--corner)); font-size: 0.84375rem; color: var(--text); cursor: pointer; text-align: left; text-decoration: none !important; }
.menu-item:hover { background: var(--hover); }
.menu-item.danger { color: var(--red-text); }
.menu-item .icon { color: var(--muted); } .menu-item.danger .icon { color: var(--red-text); }
.menu-sep { height: 1px; background: var(--border); margin: 5px 0; }
.menu-label { font-size: 0.6875rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 8px 10px 4px; }
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: calc(12px * var(--corner)); background: #111827; color: #f9fafb; box-shadow: var(--shadow-lg); font-size: 0.84375rem; animation: popin 0.2s ease; }
.toast .t-title { font-weight: 650; } .toast .t-body { color: #cbd5e1; font-size: 0.78125rem; margin-top: 2px; }
.toast.success .icon { color: #4ade80; } .toast.error .icon { color: #f87171; } .toast.info .icon { color: #93c5fd; } .toast.warning .icon { color: #fbbf24; }
.tooltip-float { position: fixed; z-index: 300; pointer-events: none; background: #111827; color: #f3f4f6; font-size: 0.75rem; padding: 6px 9px; border-radius: calc(7px * var(--corner)); box-shadow: var(--shadow-md); max-width: 280px; }

/* command palette */
.cmdk { width: 100%; max-width: 640px; background: var(--surface); border-radius: calc(16px * var(--corner)); box-shadow: var(--shadow-lg); border: 1px solid var(--border); overflow: hidden; animation: popin 0.15s ease; }
.cmdk-input { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--border); }
.cmdk-input input { flex: 1; height: 56px; border: 0; outline: none; background: transparent; font: inherit; font-size: 1rem; color: var(--text); }
.cmdk-list { max-height: 420px; overflow-y: auto; padding: 6px; }
.cmdk-group { font-size: 0.6875rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; padding: 10px 12px 4px; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: calc(9px * var(--corner)); cursor: pointer; font-size: 0.875rem; }
.cmdk-item.hl { background: var(--brand-50); }
.cmdk-item .ci-sub { font-size: 0.75rem; color: var(--muted); }
.cmdk-item .ci-type { margin-left: auto; font-size: 0.71875rem; color: var(--muted); }
.cmdk-foot { display: flex; gap: 14px; padding: 9px 16px; border-top: 1px solid var(--border); font-size: 0.71875rem; color: var(--muted); background: var(--surface-2); }
kbd, .kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: calc(5px * var(--corner)); border: 1px solid var(--border); border-bottom-width: 2px; background: var(--surface); color: var(--text-2); font-size: 0.6875rem; font-family: var(--font); font-weight: 600; }

/* notifications panel */
.notif-item { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: color-mix(in srgb, var(--brand-50) 60%, transparent); }
.notif-item .n-title { font-weight: 600; font-size: 0.84375rem; } .notif-item .n-body { font-size: 0.78125rem; color: var(--text-2); } .notif-item .n-time { font-size: 0.71875rem; color: var(--muted); margin-top: 3px; }

/* charts */
.chart { position: relative; width: 100%; }
.chart svg { display: block; overflow: visible; }
.chart text { font-family: var(--font); font-size: calc(11px + (1rem - 16px) * 0.5); fill: var(--muted); } /* axis labels scale at half rate so ticks laid out for 11px never collide */
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .axisline { stroke: var(--axis); stroke-width: 1; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.75rem; color: var(--text-2); margin-bottom: 10px; }
.chart-legend .lg-item { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend .lg-swatch { width: 10px; height: 10px; border-radius: 3px; }
.chart-tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md); border-radius: calc(9px * var(--corner)); padding: 8px 10px; font-size: 0.75rem; z-index: 5; white-space: nowrap; min-width: 120px; transform: translate(-50%, calc(-100% - 12px)); }
.chart-tip .tip-title { font-weight: 650; margin-bottom: 4px; color: var(--text); }
.chart-tip .tip-row { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.chart-tip .tip-row b { margin-left: auto; color: var(--text); font-weight: 650; padding-left: 12px; }
.chart-tip .sw { width: 8px; height: 8px; border-radius: 2px; }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.cal-dow { padding: 8px; font-size: 0.71875rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.cal-day { min-height: 108px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); position: relative; min-width: 0; }
.cal-day.muted { background: var(--surface-2); } .cal-day.muted .cal-num { color: var(--faint); }
.cal-day.weekend { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.cal-day.today .cal-num { background: var(--brand); color: var(--on-brand); }
.cal-num { display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; border-radius: 50%; font-size: 0.75rem; font-weight: 600; color: var(--text-2); }
.cal-event { display: flex; align-items: center; gap: 5px; font-size: 0.71875rem; font-weight: 550; padding: 2px 6px; border-radius: calc(5px * var(--corner)); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal-more { font-size: 0.6875rem; color: var(--muted); margin-top: 3px; padding-left: 4px; cursor: pointer; }

/* kanban */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; }
.kanban-col { flex: 0 0 290px; background: var(--surface-3); border-radius: calc(14px * var(--corner)); display: flex; flex-direction: column; max-height: calc(100vh - 230px); border: 1px solid var(--border); }
.kanban-col.over { outline: 2px dashed var(--brand); outline-offset: -2px; }
.kanban-col-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px; font-weight: 650; font-size: 0.8125rem; }
.kanban-col-head .count { color: var(--muted); font-weight: 600; }
.kanban-cards { padding: 4px 10px 12px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 60px; }
.kanban-card { background: var(--surface); border: 1px solid var(--border); border-radius: calc(11px * var(--corner)); padding: 11px 12px; box-shadow: var(--shadow-sm); cursor: grab; transition: box-shadow 0.12s, transform 0.12s; }
.kanban-card:hover { box-shadow: var(--shadow-md); }
.kanban-card.dragging { opacity: 0.5; transform: rotate(1.5deg); }

/* timeline */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ''; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--border); border-radius: 2px; }
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: -26px; top: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand); display: flex; align-items: center; justify-content: center; color: var(--brand); }
.tl-title { font-weight: 600; font-size: 0.84375rem; } .tl-meta { font-size: 0.75rem; color: var(--muted); } .tl-body { font-size: 0.8125rem; color: var(--text-2); margin-top: 4px; }

/* stepper */
.stepper { display: flex; align-items: center; gap: 8px; margin-bottom: 22px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
.step .step-num { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid var(--border-strong); font-size: 0.75rem; background: var(--surface); }
.step.active { color: var(--text); } .step.active .step-num { border-color: var(--brand); color: var(--brand-text); box-shadow: 0 0 0 4px var(--brand-50); }
.step.done .step-num { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.step-line { flex: 0 0 32px; height: 2px; background: var(--border); border-radius: 2px; }

/* org chart */
.org-canvas { position: relative; overflow: hidden; height: calc(100vh - 200px); min-height: 480px; background-color: var(--surface-2); background-image: radial-gradient(var(--border) 1px, transparent 1px); background-size: 22px 22px; border-radius: calc(14px * var(--corner)); border: 1px solid var(--border); cursor: grab; user-select: none; }
.org-canvas.dragging { cursor: grabbing; }
.org-node { position: absolute; width: 228px; background: var(--surface); border: 1px solid var(--border); border-radius: calc(12px * var(--corner)); box-shadow: var(--shadow); padding: 10px 12px; display: flex; gap: 10px; align-items: center; cursor: pointer; transition: box-shadow 0.12s, border-color 0.12s; }
.org-node:hover { box-shadow: var(--shadow-md); border-color: var(--brand-200); }
.org-node.hl { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.org-node .dept-bar { position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; }
.org-toggle { position: absolute; left: 50%; bottom: -12px; transform: translateX(-50%); height: 22px; min-width: 32px; padding: 0 7px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border-strong); font-size: 0.6875rem; font-weight: 700; color: var(--text-2); display: flex; align-items: center; justify-content: center; gap: 3px; cursor: pointer; z-index: 2; }
.org-toggle:hover { border-color: var(--brand); color: var(--brand); }

/* misc */
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.75rem; margin: 16px 0; } .divider-text::before, .divider-text::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.callout { display: flex; gap: 12px; padding: 12px 14px; border-radius: calc(12px * var(--corner)); font-size: 0.8125rem; border: 1px solid; }
.callout.info { background: var(--blue-bg); border-color: color-mix(in srgb, var(--blue) 25%, transparent); color: var(--blue-text); }
.callout.warning { background: var(--amber-bg); border-color: color-mix(in srgb, var(--amber) 25%, transparent); color: var(--amber-text); }
.callout.danger { background: var(--red-bg); border-color: color-mix(in srgb, var(--red) 25%, transparent); color: var(--red-text); }
.callout.success { background: var(--green-bg); border-color: color-mix(in srgb, var(--green) 25%, transparent); color: var(--green-text); }
.callout.brand { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-700); }
.callout .callout-title { font-weight: 650; }
.callout p { margin: 2px 0 0; color: inherit; opacity: 0.9; }
.callout .callout-action { flex-shrink: 0; align-self: center; }
@media (max-width: 720px) {
  .callout.has-action { flex-wrap: wrap; }
  .callout.has-action > .flex-1 { flex-basis: calc(100% - 34px); }
  .callout.has-action .callout-action { flex-basis: 100%; padding-left: 30px; }
}
.link { color: var(--brand-text); cursor: pointer; font-weight: 550; } .link:hover { text-decoration: underline; }
.rating { display: inline-flex; gap: 2px; } .rating .star { color: var(--faint); cursor: pointer; } .rating .star.on { color: #f59e0b; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.hero { border-radius: var(--radius-xl); padding: 24px 26px; background: var(--brand-grad); color: #fff; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,0.08); }
.hero h1, .hero h2 { color: #fff; }
.hero .muted-on-hero { color: rgba(255,255,255,0.8); }
.signature-pad { border: 1px dashed var(--border-strong); border-radius: calc(10px * var(--corner)); background: #fff; touch-action: none; cursor: crosshair; width: 100%; height: 160px; }
.color-swatch { width: 26px; height: 26px; border-radius: calc(8px * var(--corner)); border: 2px solid transparent; cursor: pointer; }
.color-swatch.active { border-color: var(--text); }
.pill-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.section-title { font-size: 0.75rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 10px; }
.big-number { font-size: 2.125rem; font-weight: 750; letter-spacing: -0.03em; line-height: 1.05; }
.avatar-upload { position: relative; cursor: pointer; } .avatar-upload .overlay-cam { position: absolute; inset: 0; border-radius: 50%; background: rgba(0,0,0,0.45); color: #fff; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.15s; } .avatar-upload:hover .overlay-cam { opacity: 1; }
.print-only { display: none; }

/* login */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--surface); }
.auth-side { background: radial-gradient(1200px 600px at -10% -10%, var(--auth-glow-1) 0%, transparent 55%), radial-gradient(900px 600px at 110% 110%, var(--auth-glow-2) 0%, transparent 55%), linear-gradient(160deg, #0b1024, #151638 60%, #0c1a2e); color: #fff; padding: 44px 52px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.auth-side .orb { position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,0.08); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; overflow-y: auto; }
.auth-card { width: 100%; max-width: 440px; }
.persona-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.persona { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--border); border-radius: calc(11px * var(--corner)); cursor: pointer; background: var(--surface); text-align: left; transition: border-color 0.12s, box-shadow 0.12s, background 0.12s; min-width: 0; }
.persona:hover { border-color: var(--brand-200); background: var(--brand-50); box-shadow: var(--shadow-sm); }
.feature-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 28px; }
.feature-list .fi { display: flex; gap: 10px; align-items: flex-start; font-size: 0.8125rem; color: rgba(255,255,255,0.82); }
.feature-list .fi .fic { width: 30px; height: 30px; border-radius: calc(9px * var(--corner)); background: rgba(255,255,255,0.08); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--auth-icon); }

/* ------------------------------------------------------------------ top navigation layout */
.topnav { position: relative; height: var(--nav-h); align-items: stretch; padding: 0 16px; }
.tn-list { display: flex; align-items: stretch; gap: 2px; min-width: 0; flex: 1; margin: 0; padding: 0; list-style: none; }
.tn-entry { position: relative; display: flex; align-items: center; }
.tn-entry.active::after { content: ''; position: absolute; left: 6px; right: 6px; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0; background: var(--brand); }
.tn-item { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px; border: 0; background: transparent; border-radius: calc(8px * var(--corner)); color: var(--text-2); font: inherit; font-size: 0.84375rem; font-weight: 550; white-space: nowrap; cursor: pointer; text-decoration: none !important; transition: background 0.12s, color 0.12s; }
.tn-item .icon { opacity: 0.8; flex-shrink: 0; }
.tn-item .tn-chev { opacity: 0.55; transition: transform 0.15s; }
.tn-item:hover, .tn-item[aria-expanded='true'] { background: var(--hover); color: var(--text); }
.tn-item[aria-expanded='true'] .tn-chev { transform: rotate(180deg); }
.tn-entry.active > .tn-item { color: var(--text); font-weight: 650; }
.tn-entry.active > .tn-item .icon { color: var(--brand-text); opacity: 1; }
.tn-badge { background: var(--brand); color: var(--on-brand); font-size: 0.6875rem; font-weight: 700; padding: 0 6px; border-radius: 999px; line-height: 17px; min-width: 18px; text-align: center; }
.tn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); flex-shrink: 0; }
.tn-menu { position: absolute; top: calc(100% - 2px); left: 0; z-index: 60; min-width: 240px; max-height: calc(100vh - var(--topbar-h) - 16px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: calc(12px * var(--corner)); box-shadow: var(--shadow-lg); padding: 6px; animation: popin 0.12s ease; }
.tn-menu.align-right { left: auto; right: 0; }
.tn-mega { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2px 10px; width: min(calc(var(--mega-cols, 3) * 222px), calc(100vw - 32px)); }
.tn-mega .flyout-title { padding-top: 9px; }
.tn-measure { position: absolute; left: 0; top: 0; width: max-content; height: 0; overflow: hidden; visibility: hidden; pointer-events: none; display: flex; gap: 2px; white-space: nowrap; }
.tn-measure > *, .tn-entry { flex-shrink: 0; }

/* popovers anchored to top-bar buttons (account menu, app launcher) */
.pop-anchor { position: relative; display: inline-flex; }
.popover { position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: calc(14px * var(--corner)); box-shadow: var(--shadow-lg); animation: popin 0.12s ease; max-height: calc(100vh - var(--bar-h) - 20px); overflow-y: auto; }
.acct { width: 308px; padding: 6px; }
.acct-head { display: flex; align-items: center; gap: 12px; padding: 10px 10px 12px; }
.acct-head .acct-name { font-weight: 650; line-height: 1.3; }
.acct-head .acct-sub { font-size: 0.75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-section { padding: 4px 10px 10px; }
.acct-section .menu-label { padding: 6px 0 6px; }
.acct-section .segmented + .segmented { margin-top: 8px; }
.acct-note { font-size: 0.75rem; color: var(--muted); padding: 2px 0 4px; }
.segmented.block { display: flex; width: 100%; }
.segmented.block button { flex: 1 1 0; justify-content: center; padding: 0 6px; }
.segmented button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.launcher { width: 336px; padding: 10px; }
.launcher-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 8px; }
.launcher-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; }
.app-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 6px 10px; border-radius: calc(12px * var(--corner)); color: var(--text); text-align: center; font-size: 0.78125rem; font-weight: 550; line-height: 1.25; text-decoration: none !important; min-width: 0; }
.app-tile:hover, .app-tile:focus-visible { background: var(--hover); }
.app-tile-icon { width: 44px; height: 44px; border-radius: calc(12px * var(--corner)); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-weight: 700; font-size: 0.9375rem; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06), var(--shadow-sm); }
.app-tile-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.tooltip-float { font-size: 0.75rem; line-height: 1.35; display: flex; align-items: center; gap: 8px; animation: fadein 0.1s ease; }
.tooltip-float kbd { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.22); color: #e5e7eb; height: 18px; min-width: 18px; font-size: 0.6875rem; }

/* ------------------------------------------------------------------ appearance settings UI (preferences + company branding) */
.ap-wrap { container-type: inline-size; }
.ap-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.ap-side { position: sticky; top: calc(var(--topbar-h) + 16px); }
.ap-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 8px 18px; padding: 14px 0; align-items: center; border-top: 1px solid var(--border); }
.ap-row:first-child { border-top: 0; padding-top: 2px; }
.ap-row.top { align-items: start; }
.ap-row-label { font-weight: 600; font-size: 0.84375rem; }
.ap-row-help { font-size: 0.75rem; color: var(--muted); margin-top: 2px; font-weight: 400; }
@container (max-width: 900px) { .ap-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; } .ap-side { position: static; order: -1; max-width: 480px; } }
@container (max-width: 560px) { .ap-row { grid-template-columns: minmax(0, 1fr); gap: 8px; } .ap-row .segmented { flex-wrap: wrap; } }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.swatch { --sw: var(--brand); position: relative; width: 30px; height: 30px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1); transition: transform 0.12s, box-shadow 0.12s; }
.swatch:hover { transform: scale(1.08); }
.swatch[aria-checked='true'] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--sw); }
.swatch:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; }
.swatch.company { background: var(--sw); }
.swatch .sw-tag { position: absolute; right: -5px; bottom: -5px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); color: var(--text-2); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 1px var(--border); }
.swatch.custom { background: conic-gradient(#ef4444, #f59e0b, #22c55e, #06b6d4, #6366f1, #d946ef, #ef4444); }
.swatch.custom.set { background: var(--sw); }
.swatch-colour-input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; }
.custom-hex { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.custom-hex .input { width: 120px; font-family: var(--mono); text-transform: lowercase; }
.opt-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.opt-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 8px 8px 9px; border: 1px solid var(--border); border-radius: calc(12px * var(--corner)); background: var(--surface); color: var(--text); cursor: pointer; text-align: left; font: inherit; min-width: 0; transition: border-color 0.12s, box-shadow 0.12s; }
.opt-card:hover:not(:disabled) { border-color: var(--border-strong); }
.opt-card[aria-checked='true'] { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.opt-card:disabled { opacity: 0.5; cursor: not-allowed; }
.opt-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.opt-label { display: flex; align-items: center; gap: 6px; font-size: 0.78125rem; font-weight: 600; padding: 0 2px; min-width: 0; }
.opt-label > span { line-height: 1.25; overflow-wrap: anywhere; }
.opt-check { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--brand); color: var(--on-brand); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--surface); }
/* tiny layout / sidebar-style thumbnails */
.thumb { --t-side: #0e1222; --t-line: rgba(255, 255, 255, 0.28); --t-act: var(--brand); height: 58px; border-radius: calc(7px * var(--corner)); background: var(--surface-3); border: 1px solid var(--border); display: flex; overflow: hidden; position: relative; }
.thumb[data-sb='light'] { --t-side: var(--surface); --t-line: var(--border-strong); }
.thumb[data-sb='brand'] { --t-side: var(--sidebar-brand-bg); --t-line: rgba(255, 255, 255, 0.4); }
.thumb .t-side { width: 30%; background: var(--t-side); padding: 7px 5px; display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--border); }
.thumb .t-side i { display: block; height: 3px; border-radius: 2px; background: var(--t-line); }
.thumb .t-side i.a { background: var(--t-act); }
.thumb .t-rail { width: 11%; background: var(--t-side); padding: 7px 0; display: flex; flex-direction: column; align-items: center; gap: 4px; border-right: 1px solid var(--border); }
.thumb .t-rail i { width: 5px; height: 5px; border-radius: 2px; background: var(--t-line); }
.thumb .t-rail i.a { background: var(--t-act); }
.thumb .t-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.thumb .t-bar { height: 10px; background: var(--surface); border-bottom: 1px solid var(--border); }
.thumb .t-nav { height: 9px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; gap: 3px; align-items: center; padding: 0 6px; }
.thumb .t-nav i { width: 12px; height: 3px; border-radius: 2px; background: var(--border-strong); }
.thumb .t-nav i.a { background: var(--t-act); }
.thumb .t-body { flex: 1; padding: 5px 6px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.thumb .t-body i { background: var(--surface); border: 1px solid var(--border); border-radius: calc(3px * var(--corner)); }
/* live mini-preview */
.ap-prev { --p-bg: #f5f6fa; --p-surface: #ffffff; --p-surface-2: #f8f9fc; --p-border: #e4e7ef; --p-text: #0f172a; --p-muted: #8a93a6; --p-line: #e9ecf2;
  --p-side: #0e1222; --p-side-text: rgba(255, 255, 255, 0.55); --p-side-act: rgba(124, 124, 240, 0.2); --p-side-act-text: #fff;
  border-radius: calc(14px * var(--corner)); border: 1px solid var(--border); overflow: hidden; background: var(--p-bg); color: var(--p-text); font-size: 10px; line-height: 1.3; box-shadow: var(--shadow); user-select: none; }
.ap-prev[data-mode='dark'] { --p-bg: #0b0e14; --p-surface: #131722; --p-surface-2: #171c28; --p-border: #252c3b; --p-text: #eef1f7; --p-muted: #7c8699; --p-line: #20273a; --p-side: #0a0d16; }
.ap-prev[data-sb='light'] { --p-side: var(--p-surface); --p-side-text: var(--p-muted); --p-side-act: var(--brand-50); --p-side-act-text: var(--brand-700); }
.ap-prev[data-sb='brand'] { --p-side: var(--sidebar-brand-bg); --p-side-text: rgba(255, 255, 255, 0.7); --p-side-act: rgba(255, 255, 255, 0.2); --p-side-act-text: #fff; }
.ap-prev[data-text='small'] { font-size: 9.4px; } .ap-prev[data-text='large'] { font-size: 11.25px; }
.apx-chrome { display: flex; align-items: center; gap: 4px; padding: 6px 8px; background: var(--p-surface-2); border-bottom: 1px solid var(--p-border); }
.apx-chrome i { width: 7px; height: 7px; border-radius: 50%; background: var(--p-border); }
.apx-window { display: flex; height: 236px; }
.apx-side { width: 30%; background: var(--p-side); padding: 8px 6px; display: flex; flex-direction: column; gap: 3px; border-right: 1px solid var(--p-border); }
.apx-side.rail { width: 34px; align-items: center; }
.apx-logo { display: flex; align-items: center; gap: 5px; margin: 0 2px 6px; font-weight: 750; font-size: 1.05em; color: var(--p-side-act-text); }
.ap-prev[data-sb='light'] .apx-logo { color: var(--p-text); }
.apx-logo b { width: 14px; height: 14px; border-radius: calc(4px * var(--corner)); background: var(--brand-grad); flex-shrink: 0; }
.apx-nav-item { display: flex; align-items: center; gap: 5px; padding: 3px 5px; border-radius: calc(4px * var(--corner)); color: var(--p-side-text); white-space: nowrap; overflow: hidden; }
.apx-nav-item u { width: 8px; height: 8px; border-radius: 2px; background: currentColor; opacity: 0.7; flex-shrink: 0; }
.apx-nav-item.a { background: var(--p-side-act); color: var(--p-side-act-text); font-weight: 600; }
.apx-side.rail .apx-nav-item { padding: 5px; }
.apx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.apx-top { display: flex; align-items: center; gap: 6px; padding: 0 8px; height: 22px; border-bottom: 1px solid var(--p-border); background: var(--p-surface); }
.apx-top .apx-logo { margin: 0 4px 0 0; color: var(--p-text); }
.apx-search { flex: 1; max-width: 90px; height: 11px; border-radius: calc(4px * var(--corner)); border: 1px solid var(--p-border); background: var(--p-bg); }
.apx-avatar { margin-left: auto; width: 12px; height: 12px; border-radius: 50%; background: var(--s5); }
.apx-tnav { display: flex; gap: 8px; align-items: center; padding: 0 10px; height: 18px; border-bottom: 1px solid var(--p-border); background: var(--p-surface); color: var(--p-muted); font-weight: 600; font-size: 0.9em; }
.apx-tnav .a { color: var(--p-text); box-shadow: 0 1px 0 var(--brand), inset 0 -2px 0 var(--brand); padding: 3px 0; }
.apx-body { flex: 1; padding: 10px; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.ap-prev[data-density='compact'] .apx-body { padding: 7px; gap: 5px; }
.apx-h { font-weight: 700; font-size: 1.3em; letter-spacing: -0.01em; }
.apx-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ap-prev[data-density='compact'] .apx-stats { gap: 4px; }
.apx-card { background: var(--p-surface); border: 1px solid var(--p-border); border-radius: calc(7px * var(--corner)); padding: 7px 8px; min-width: 0; }
.ap-prev[data-density='compact'] .apx-card { padding: 4px 6px; }
.apx-k { color: var(--p-muted); font-size: 0.85em; }
.apx-v { font-weight: 700; font-size: 1.35em; margin-top: 1px; }
.apx-bars { display: flex; align-items: flex-end; gap: 2px; height: 14px; margin-top: 3px; }
.apx-bars i { flex: 1; background: var(--s1); border-radius: 1px 1px 0 0; }
.apx-row { display: flex; align-items: center; gap: 6px; padding: 4px 0; border-top: 1px solid var(--p-line); }
.ap-prev[data-density='compact'] .apx-row { padding: 2px 0; }
.apx-row:first-of-type { border-top: 0; }
.apx-row u { width: 12px; height: 12px; border-radius: 50%; background: var(--p-line); flex-shrink: 0; }
.apx-row span { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.apx-pill { padding: 1px 6px; border-radius: 999px; background: var(--brand-50); color: var(--brand-700); font-weight: 600; font-size: 0.85em; }
.apx-btn { padding: 3px 8px; border-radius: calc(5px * var(--corner)); background: var(--brand); color: var(--on-brand); font-weight: 650; font-size: 0.9em; }
.apx-link { color: var(--brand-text); font-weight: 600; }
.ap-prev-caption { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 0.75rem; color: var(--muted); }
.app-list-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 10px; align-items: start; padding: 12px 0; border-top: 1px solid var(--border); }
.app-list-row:first-child { border-top: 0; }
.app-list-row > .app-row-actions { display: flex; gap: 4px; margin-top: 26px; }
@media (max-width: 720px) { .app-list-row { grid-template-columns: 44px minmax(0, 1fr); } .app-list-row > :nth-child(3), .app-list-row > :nth-child(4) { grid-column: 2; } .app-list-row > .app-row-actions { margin-top: 0; justify-content: flex-end; } }

/* ------------------------------------------------------------------ personal display options */
/* density */
:root[data-density='compact'] { --bar-h: 52px; --nav-h: 40px; --content-x: 20px; --content-pad: 16px var(--content-x) 32px; }
:root[data-density='compact'] .card-header { padding: 10px 14px; min-height: 44px; }
:root[data-density='compact'] .card-body { padding: 14px; }
:root[data-density='compact'] .card-body.tight { padding: 8px 10px; }
:root[data-density='compact'] .card-body.flush { padding: 0; }
:root[data-density='compact'] .card-footer { padding: 8px 14px; }
:root[data-density='compact'] .table td { padding: 7px 12px; }
:root[data-density='compact'] .table th { padding: 7px 12px; }
:root[data-density='compact'] .table-dense td { padding: 5px 10px; } :root[data-density='compact'] .table-dense th { padding: 6px 10px; }
:root[data-density='compact'] .table-toolbar { padding: 8px 12px; }
:root[data-density='compact'] .list-item { padding: 8px 14px; }
:root[data-density='compact'] .btn { height: 32px; padding: 0 12px; }
:root[data-density='compact'] .btn-sm { height: 28px; padding: 0 9px; }
:root[data-density='compact'] .btn-lg { height: 40px; }
:root[data-density='compact'] .btn-icon { width: 32px; padding: 0; } :root[data-density='compact'] .btn-icon.btn-sm { width: 28px; } :root[data-density='compact'] .btn-icon.btn-xs { width: 24px; }
:root[data-density='compact'] .input, :root[data-density='compact'] .select { height: 34px; }
:root[data-density='compact'] .combo { min-height: 34px; padding: 2px 8px; }
:root[data-density='compact'] .icon-btn { width: 34px; height: 34px; }
:root[data-density='compact'] .search-trigger { height: 34px; }
:root[data-density='compact'] .clock-chip { height: 32px; }
:root[data-density='compact'] .page-header { margin-bottom: 14px; }
:root[data-density='compact'] .stat { padding: 12px 14px; gap: 4px; }
:root[data-density='compact'] .stat .stat-value { font-size: 1.4375rem; }
:root[data-density='compact'] .tabs { margin-bottom: 14px; }
:root[data-density='compact'] .tab { padding: 8px 10px; }
:root[data-density='compact'] .form-grid { gap: 12px 14px; }
:root[data-density='compact'] .form-section { margin-bottom: 16px; }
:root[data-density='compact'] .gap-4 { gap: 12px; } :root[data-density='compact'] .gap-5 { gap: 14px; } :root[data-density='compact'] .gap-6 { gap: 18px; }
:root[data-density='compact'] .space-y-4 > * + * { margin-top: 12px; } :root[data-density='compact'] .space-y-5 > * + * { margin-top: 14px; }
:root[data-density='compact'] .nav-item { padding: 5px 10px; }
:root[data-density='compact'] .nav-section { margin-top: 10px; }
:root[data-density='compact'] .rail-item { height: 36px; }
:root[data-density='compact'] .menu-item { padding: 6px 10px; }
:root[data-density='compact'] .modal-header { padding: 14px 18px 10px; } :root[data-density='compact'] .modal-body { padding: 6px 18px 16px; } :root[data-density='compact'] .modal-footer { padding: 10px 18px; }
:root[data-density='compact'] .drawer-header { padding: 14px 18px; } :root[data-density='compact'] .drawer-body { padding: 16px 18px; }
:root[data-density='compact'] .cal-day { min-height: 88px; }
:root[data-density='compact'] .kanban-card { padding: 8px 10px; }
:root[data-density='compact'] .notif-item { padding: 9px 14px; }
:root[data-density='compact'] .ap-row { padding: 10px 0; }
/* text size — the design system sizes text in rem, so scaling the root scales text (not layout) */
:root[data-text='small'] { font-size: 93.75%; }
:root[data-text='large'] { font-size: 112.5%; }
/* corners */
:root[data-corners='subtle'] { --corner: 0.55; }
:root[data-corners='square'] { --corner: 0.18; }
/* motion: the toggle forces it; otherwise we follow the device setting */
:root[data-motion='reduce'] *, :root[data-motion='reduce'] *::before, :root[data-motion='reduce'] *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
:root[data-motion='reduce'] .spinner { animation-duration: 0.9s !important; animation-iteration-count: infinite !important; }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 0.9s !important; animation-iteration-count: infinite !important; } }

/* ------------------------------------------------------------------ utilities */
.flex { display: flex; } .inline-flex { display: inline-flex; } .grid { display: grid; } .block { display: block; } .hidden { display: none !important; }
.flex-col { flex-direction: column; } .flex-wrap { flex-wrap: wrap; } .items-center { align-items: center; } .items-start { align-items: flex-start; } .items-end { align-items: flex-end; } .items-stretch { align-items: stretch; }
.justify-between { justify-content: space-between; } .justify-center { justify-content: center; } .justify-end { justify-content: flex-end; }
.flex-1 { flex: 1; min-width: 0; } .shrink-0 { flex-shrink: 0; } .self-start { align-self: flex-start; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-5 { gap: 20px; } .gap-6 { gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } .grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); } .grid-auto-sm { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.grid-main-side { grid-template-columns: minmax(0, 1fr) 360px; } .grid-side-main { grid-template-columns: 300px minmax(0, 1fr); }
.col-span-2 { grid-column: span 2; } .col-span-3 { grid-column: span 3; } .col-span-full { grid-column: 1 / -1; }
.p-0 { padding: 0; } .p-2 { padding: 8px; } .p-3 { padding: 12px; } .p-4 { padding: 16px; } .p-5 { padding: 20px; } .p-6 { padding: 24px; }
.px-4 { padding-left: 16px; padding-right: 16px; } .py-2 { padding-top: 8px; padding-bottom: 8px; } .py-3 { padding-top: 12px; padding-bottom: 12px; }
.m-0 { margin: 0; } .mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-5 { margin-top: 20px; } .mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-5 { margin-bottom: 20px; } .mb-6 { margin-bottom: 24px; }
.pt-2 { padding-top: 8px; } .pt-3 { padding-top: 12px; } .pt-4 { padding-top: 16px; } .pb-2 { padding-bottom: 8px; } .pb-3 { padding-bottom: 12px; } .pb-4 { padding-bottom: 16px; } .px-2 { padding-left: 8px; padding-right: 8px; } .px-3 { padding-left: 12px; padding-right: 12px; } .py-1 { padding-top: 4px; padding-bottom: 4px; } .py-4 { padding-top: 16px; padding-bottom: 16px; }
.mt-8 { margin-top: 32px; } .mb-8 { margin-bottom: 32px; } .items-baseline { align-items: baseline; } .flex-none { flex: none; } .w-auto { width: auto; }
.ml-auto { margin-left: auto; } .mr-2 { margin-right: 8px; } .mx-auto { margin-left: auto; margin-right: auto; }
.w-full { width: 100%; } .h-full { height: 100%; } .min-w-0 { min-width: 0; } .max-w-sm { max-width: 420px; } .max-w-md { max-width: 640px; } .max-w-lg { max-width: 880px; }
.text-xs { font-size: 0.71875rem; } .text-sm { font-size: 0.78125rem; } .text-base { font-size: 0.875rem; } .text-md { font-size: 0.9375rem; } .text-lg { font-size: 1.0625rem; } .text-xl { font-size: 1.25rem; } .text-2xl { font-size: 1.625rem; } .text-3xl { font-size: 2rem; }
.font-normal { font-weight: 400; } .font-medium { font-weight: 500; } .font-semibold { font-weight: 600; } .font-bold { font-weight: 700; }
.text-muted { color: var(--muted); } .text-2 { color: var(--text-2); } .text-brand { color: var(--brand-text); } .text-green { color: var(--green-text); } .text-red { color: var(--red-text); } .text-amber { color: var(--amber-text); } .text-blue { color: var(--blue-text); } .text-white { color: #fff; }
.text-right { text-align: right; } .text-center { text-align: center; } .uppercase { text-transform: uppercase; letter-spacing: 0.05em; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; } .nowrap { white-space: nowrap; } .break-words { overflow-wrap: anywhere; }
.rounded { border-radius: var(--radius); } .rounded-lg { border-radius: var(--radius-lg); } .rounded-full { border-radius: 999px; }
.border { border: 1px solid var(--border); } .border-t { border-top: 1px solid var(--border); } .border-b { border-bottom: 1px solid var(--border); }
.bg-surface { background: var(--surface); } .bg-subtle { background: var(--surface-2); } .shadow { box-shadow: var(--shadow); }
.cursor-pointer { cursor: pointer; } .relative { position: relative; } .overflow-hidden { overflow: hidden; } .overflow-auto { overflow: auto; }
.sticky-top { position: sticky; top: calc(var(--topbar-h) + 12px); }
.space-y-2 > * + * { margin-top: 8px; } .space-y-3 > * + * { margin-top: 12px; } .space-y-4 > * + * { margin-top: 16px; } .space-y-5 > * + * { margin-top: 20px; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1200px) { .grid-main-side { grid-template-columns: 1fr; } .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-5, .grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .topbar-brand .co-name { display: none; } }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; max-width: 86vw; transform: translateX(-100%); visibility: hidden; transition: transform 0.2s, visibility 0s 0.2s; box-shadow: var(--shadow-lg); }
  .app.mobile-open .sidebar { transform: none; visibility: visible; transition: transform 0.2s; }
  .sidebar .sb-toggle { display: none; } .sidebar .sb-close { display: inline-flex; }
  .rail, .topnav, .topbar-brand { display: none !important; }
  .topbar { padding: 0 12px 0 8px; gap: 8px; }
  .content { padding: 16px 16px 40px; }
  .opt-cards { gap: 8px; }
  .card-header { flex-wrap: wrap; row-gap: 8px; }
  .popover { position: fixed; top: calc(var(--bar-h) + 6px); right: 8px; max-width: calc(100vw - 16px); }
  .search-trigger { min-width: 38px; }
  .search-trigger .st-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .search-trigger kbd, .search-trigger .ml-auto { display: none; }
  .grid-2, .grid-3, .grid-4, .grid-5, .grid-6, .grid-side-main, .form-grid { grid-template-columns: 1fr; }
  .grid-side-main[style*='grid-template-columns'] { grid-template-columns: minmax(0, 1fr) !important; } /* pages that size the side column inline (e.g. Settings) still stack on phones */
  .grid-side-main > .sticky-top { position: static; max-height: 280px !important; }
  .auth-page { grid-template-columns: 1fr; } .auth-side { display: none; }
  .hide-mobile { display: none !important; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv dd { margin-bottom: 8px; }
  .modal { max-height: 92vh; } .overlay { padding-top: 4vh; }
}
@media (min-width: 901px) { .show-mobile { display: none !important; } }

/* ------------------------------------------------------------------ print */
@media print {
  .sidebar, .rail, .app-header, .topbar, .topnav, .no-print, .toasts, .impersonation-bar, .page-header .actions, .tooltip-float, .flyout { display: none !important; }
  .app { display: block; } .content { padding: 0; max-width: none; }
  body { background: #fff; } .card { box-shadow: none; border-color: #ddd; break-inside: avoid; }
  .print-only { display: block; }
}
