/* Nahouli Group ERP design system: brand sheet of 2026-11-08.
   Brand Red #C1121F, Deep Red / Burgundy #8B0A14, Crimson #E63946, Brand Gold #D4AF37, Gold Dark #B8860B, Gold Light #F6D76B,
   Cream / Warm Ivory #FFF8E6, Light Neutral #F5F5F4, White #FFFFFF; neutrals #1F1F1F #4B5563 #9CA3AF #E5E7EB #F3F4F6.
   Light is the default (data-theme, set in base.html). Dark (2026-11-09): near-black #0D0E0F, graphite rail #141516, charcoal cards #191A1B, hairlines #2A2B2C, champagne #D6B36A, warm white #F2F0EB, muted #929292. :root holds the shared tokens + dark values, light overrides follow.
   Print always returns to the light values at the end of this file. */

/* Fonts are served by this site (static/fonts, variable weight, latin + latin-ext): no page waits on another server. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/inter-latin-ext.084b211fc382.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/inter-latin.4b73e2ff3024.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: "Plus Jakarta Sans"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("../fonts/plus-jakarta-sans-latin-ext.341687eeeb6a.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("../fonts/plus-jakarta-sans-latin.7660bd9909fb.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; }

:root {
  color-scheme: dark;
  --accent-fill: #C1121F; /* red behind white text; --accent is text and focus on the dark canvas */
  --on-gold: #1F1F1F; /* dark text on gold fills */
  --primary-red: #C1121F;
  --deep-red: #8B0A14;
  --champagne: #E6C98C;
  --cream: #FFF8E6;
  --bg: #0D0E0F;
  --surface: #191A1B;
  --surface-2: #1F2021;
  --surface-3: #262728;
  --ink: #F2F0EB;
  --heading: #F2F0EB;
  --ink-2: #D4D2CC;
  --muted: #929292; /* clears WCAG AA (4.5:1) on --bg and --surface-2 */
  --line: #2A2B2C;
  --line-strong: #3A3B3C;
  --line-hover: #D6B36A;
  --track: #2A2B2C; /* empty part of a progress bar */
  --scrollbar-thumb: #3A3B3C;
  --scrollbar-track: #191A1B;
  --hover: rgba(214, 179, 106, .07);
  --hover-2: rgba(214, 179, 106, .13);
  --hover-row: rgba(214, 179, 106, .05);
  --accent: #D6B36A;
  --accent-hover: #E6C98C;
  --accent-soft: rgba(214, 179, 106, .14);
  --ring: rgba(214, 179, 106, .30);
  --gold: #D6B36A;
  --gold-hover: #B8955A;
  --gold-soft: rgba(214, 179, 106, .13);
  --gold-line: rgba(214, 179, 106, .30);
  --gold-ink: #E6C98C;
  --ok: #4ADE80; --ok-bg: #0F2A1A; --ok-line: #1F6B3A; --ok-fill: #22C55E;
  --warn: #FBBF24; --warn-bg: #2E2008; --warn-line: #7A5A10;
  --bad: #FF8A9A; --bad-bg: #3A0F18; --bad-line: #8A2233; --bad-fill: #EF4444;
  --info: #93C5FD; --info-bg: #0F2140; --info-line: #2A4F86;
  --purple: #C4B5FD; --purple-bg: #241545; --purple-line: #4C3A8A;
  --orange: #FDBA74; --orange-bg: #33190A;
  --amber: #F59E0B;
  /* Fixed Deep Burgundy Navigation Sidebar (#8B0A14) with white labels and gold active indicator */
  --rail-bg: #141516;
  --rail-bg-deep: #0F1011;
  --rail-grad: linear-gradient(180deg, #141516 0%, #141516 100%);
  --rail-ink: #FFFFFF;
  --rail-muted: rgba(255, 255, 255, .68);
  --rail-hover: rgba(255, 255, 255, .08);
  --rail-active: #D6B36A;
  --rail-active-ink: #1F1F1F;
  --rail-active-soft: rgba(214, 179, 106, .12);
  --rail-line: rgba(255, 255, 255, .07);
  /* Hero & card tint tokens (all gradients live in :root per design-system invariant) */
  --btn-gold-grad: linear-gradient(180deg, #D6B36A 0%, #CBA55C 100%);
  --btn-gold-hover-grad: linear-gradient(180deg, #CBA55C 0%, #B8955A 100%);
  --btn-red-grad: linear-gradient(180deg, #C1121F 0%, #A80F1A 100%);
  --btn-red-hover-grad: linear-gradient(180deg, #A80F1A 0%, #8B0A14 100%);
  --topbar-grad: linear-gradient(180deg, #191A1B 0%, #191A1B 100%);
  --scope-pill-grad: linear-gradient(180deg, #1F2021 0%, #1F2021 100%);
  --hero-for-me: linear-gradient(100deg, #191A1B 0%, #1F2021 100%);
  --hero-executive: linear-gradient(100deg, #191A1B 0%, #1F2021 100%);
  --hero-module: linear-gradient(180deg, #191A1B 0%, #191A1B 100%);
  --rail-wave-grad: linear-gradient(135deg, rgba(214, 179, 106, .20) 0%, rgba(139, 10, 20, .12) 100%);
  /* Photo hero */
  --hero-photo-bg: #191A1B;
  --hero-photo-fade: linear-gradient(90deg, transparent 0%, #191A1B 34%);
  --hero-photo-fade-cover: linear-gradient(90deg, transparent 50%, #191A1B 68%);
  --hero-photo-ink: #fff;
  --hero-photo-muted: rgba(255, 248, 230, .90);
  --hero-photo-tile: rgba(13, 14, 15, .62);
  --hero-photo-line: rgba(214, 179, 106, .28);
  --tint-emerald-bg: linear-gradient(180deg, #191A1B 0%, #1F2021 100%);
  --tint-emerald-solid: rgba(34, 197, 94, .16);
  --tint-emerald-border: rgba(34, 197, 94, .28);
  --tint-emerald-icon: rgba(34, 197, 94, .22);
  --tint-emerald-ink: #4ADE80;
  --tint-emerald-accent: #22C55E;
  --tint-amber-bg: linear-gradient(180deg, #191A1B 0%, #1F2021 100%);
  --tint-amber-solid: rgba(214, 179, 106, .16);
  --tint-amber-border: rgba(214, 179, 106, .28);
  --tint-amber-icon: rgba(214, 179, 106, .22);
  --tint-amber-ink: #F6D76B;
  --tint-amber-accent: #F59E0B;
  --tint-rose-bg: linear-gradient(180deg, #191A1B 0%, #1F2021 100%);
  --tint-rose-solid: rgba(193, 18, 31, .20);
  --tint-rose-border: rgba(230, 57, 70, .32);
  --tint-rose-icon: rgba(193, 18, 31, .28);
  --tint-rose-ink: #FF8A9A;
  --tint-rose-accent: #EF4444;
  --tint-purple-bg: linear-gradient(180deg, #191A1B 0%, #1F2021 100%);
  --tint-purple-solid: rgba(139, 92, 246, .16);
  --tint-purple-border: rgba(139, 92, 246, .30);
  --tint-purple-icon: rgba(139, 92, 246, .22);
  --tint-purple-ink: #C4B5FD;
  --tint-purple-accent: #8B5CF6;
  --tint-blue-bg: linear-gradient(180deg, #191A1B 0%, #1F2021 100%);
  --tint-blue-solid: rgba(59, 130, 246, .16);
  --tint-blue-border: rgba(59, 130, 246, .30);
  --tint-blue-icon: rgba(59, 130, 246, .22);
  --tint-blue-ink: #93C5FD;
  --tint-blue-accent: #3B82F6;
  --tint-peach-bg: var(--tint-amber-bg);
  --tint-peach-solid: var(--tint-amber-solid);
  --tint-peach-border: var(--tint-amber-border);
  --tint-peach-icon: var(--tint-amber-icon);
  --tint-peach-ink: var(--tint-amber-ink);
  --tint-peach-accent: var(--tint-amber-accent);
  /* 8px spacing & restrained enterprise radii */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, .24);
  --shadow-pop: 0 0 0 1px rgba(214, 179, 106, .20), 0 8px 16px rgba(0, 0, 0, .45);
  --shadow-gold: 0 1px 2px rgba(184, 134, 11, .20);
  --shadow-red: 0 1px 2px rgba(193, 18, 31, .20);
  --ambient: linear-gradient(180deg, #0D0E0F 0%, #0D0E0F 100%);
  --ambient-strong: linear-gradient(180deg, #0D0E0F 0%, #0D0E0F 100%);
  /* Glass (floating layers only). */
  --glass-bg: rgba(20, 21, 22, .88);
  --glass-dark: rgba(20, 21, 22, .96);
  --glass-blur: blur(16px) saturate(160%);
  --highlight: inset 0 1px 0 rgba(255, 255, 255, .05), inset 0 0 0 1px rgba(214, 179, 106, .22);
  --highlight-dark: inset 0 1px 0 rgba(255, 255, 255, .08);
  --scrim: rgba(0, 0, 0, .55);
  --t: 120ms ease-out;
  --display: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --rail: 248px;
  --rail-collapsed: 64px;
}
/* Light (default): enterprise light neutral canvas (#F5F5F4), crisp white surfaces (#FFFFFF), controlled charcoal typography (#1F1F1F). */
:root[data-theme="light"] {
  color-scheme: light;
  --gold: #D4AF37;
  --gold-hover: #B8860B;
  --champagne: #F6D76B;
  --btn-gold-grad: linear-gradient(180deg, #D4AF37 0%, #C9A22E 100%);
  --btn-gold-hover-grad: linear-gradient(180deg, #C9A22E 0%, #B8860B 100%);
  --hero-photo-line: rgba(246, 215, 107, .28);
  --rail-bg: #580810;
  --rail-bg-deep: #3E050B;
  --rail-grad: linear-gradient(180deg, #580810 0%, #3E050B 100%);
  --rail-muted: rgba(255, 248, 240, .78);
  --rail-active: #D4AF37;
  --rail-active-soft: rgba(212, 175, 55, .18);
  --rail-line: rgba(255, 255, 255, .12);
  --hero-for-me: linear-gradient(100deg, #4A0810 0%, #7A0F1B 68%, #9E1926 100%);
  --hero-executive: linear-gradient(100deg, #8B0A14 0%, #C1121F 78%, #E63946 100%);
  --hero-photo-bg: #8B0A14;
  --hero-photo-fade: linear-gradient(90deg, transparent 0%, #8B0A14 34%);
  --hero-photo-fade-cover: linear-gradient(90deg, transparent 50%, #8B0A14 68%);
  --hero-photo-tile: rgba(62, 5, 11, .52);
  --glass-dark: rgba(139, 10, 20, .96);
  --bg: #F5F5F4;
  --surface: #FFFFFF;
  --surface-2: #FAF9F6;
  --surface-3: #F3F4F6;
  --ink: #1F1F1F;
  --heading: #1F1F1F;
  --ink-2: #4B5563;
  --muted: #6B7280;
  --line: #E5E7EB;
  --line-strong: #D1D5DB;
  --line-hover: #9CA3AF;
  --track: #E5E7EB;
  --scrollbar-thumb: #9CA3AF;
  --scrollbar-track: #F3F4F6;
  --hover: rgba(31, 31, 31, .035);
  --hover-2: rgba(31, 31, 31, .065);
  --hover-row: rgba(31, 31, 31, .025);
  --accent: #C1121F;
  --accent-hover: #8B0A14;
  --accent-soft: #FDECEE;
  --ring: rgba(193, 18, 31, .18);
  --gold-soft: #FFF8E6;
  --gold-line: #F6D76B;
  --gold-ink: #8A6400;
  --ok: #15803D;
  --ok-bg: #ECFDF5;
  --ok-line: #A7F3D0;
  --warn: #B45309;
  --warn-bg: #FFFBEB;
  --warn-line: #FDE68A;
  --bad: #C1121F;
  --bad-bg: #FEF2F2;
  --bad-line: #FECACA;
  --info: #1D4ED8;
  --info-bg: #EFF6FF;
  --info-line: #BFDBFE;
  --purple: #6D28D9;
  --purple-bg: #F5F3FF;
  --purple-line: #DDD6FE;
  --orange: #B45309;
  --orange-bg: #FFF7ED;
  --topbar-grad: linear-gradient(180deg, #FFFFFF 0%, #FFFFFF 100%);
  --scope-pill-grad: linear-gradient(180deg, #FAF9F6 0%, #FAF9F6 100%);
  --hero-module: linear-gradient(180deg, #FFFFFF 0%, #FFFFFF 100%);
  --tint-emerald-bg: linear-gradient(180deg, #FFFFFF 0%, #FFFFFF 100%);
  --tint-emerald-solid: #ECFDF5;
  --tint-emerald-border: #D1FAE5;
  --tint-emerald-icon: #D1FAE5;
  --tint-emerald-ink: #15803D;
  --tint-amber-bg: linear-gradient(180deg, #FFFFFF 0%, #FFFFFF 100%);
  --tint-amber-solid: #FFF8E6;
  --tint-amber-border: #FDE68A;
  --tint-amber-icon: #FEF3C7;
  --tint-amber-ink: #92400E;
  --tint-rose-bg: linear-gradient(180deg, #FFFFFF 0%, #FFFFFF 100%);
  --tint-rose-solid: #FEF2F2;
  --tint-rose-border: #FECACA;
  --tint-rose-icon: #FEE2E2;
  --tint-rose-ink: #C1121F;
  --tint-purple-bg: linear-gradient(180deg, #FFFFFF 0%, #FFFFFF 100%);
  --tint-purple-solid: #F5F3FF;
  --tint-purple-border: #DDD6FE;
  --tint-purple-icon: #EDE9FE;
  --tint-purple-ink: #6D28D9;
  --tint-purple-accent: #7C3AED;
  --tint-blue-bg: linear-gradient(180deg, #FFFFFF 0%, #FFFFFF 100%);
  --tint-blue-solid: #EFF6FF;
  --tint-blue-border: #BFDBFE;
  --tint-blue-icon: #DBEAFE;
  --tint-blue-ink: #1D4ED8;
  --tint-blue-accent: #2563EB;
  --tint-peach-bg: var(--tint-amber-bg);
  --tint-peach-solid: var(--tint-amber-solid);
  --tint-peach-border: var(--tint-amber-border);
  --tint-peach-icon: var(--tint-amber-icon);
  --tint-peach-ink: var(--tint-amber-ink);
  --shadow-card: 0 1px 2px rgba(31, 31, 31, .04), 0 1px 3px rgba(31, 31, 31, .03);
  --shadow-pop: 0 0 0 1px rgba(229, 231, 235, .95), 0 8px 16px -4px rgba(31, 31, 31, .10);
  --ambient: linear-gradient(180deg, #F5F5F4 0%, #F5F5F4 100%);
  --ambient-strong: linear-gradient(135deg, #FFF8E6 0%, #F5F5F4 100%);
  --glass-bg: rgba(255, 255, 255, .95);
  --highlight: inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 0 0 1px rgba(229, 231, 235, .85);
  --scrim: rgba(31, 31, 31, .40);
}
/* Glass falls back to opaque where it can't blur or the user asks for less transparency. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass-bg: rgba(20, 21, 22, .98); --glass-dark: rgba(20, 21, 22, .98); }
  :root[data-theme="light"] { --glass-bg: rgba(255, 255, 255, .98); }
}
@media (prefers-reduced-transparency: reduce) {
  :root, :root[data-theme="light"] { --glass-bg: var(--surface); --glass-dark: var(--rail-bg); --glass-blur: none; }
}

/* ---- base ---- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; min-width: 320px; background: var(--bg); }
/* body stays transparent: its own background would paint over the z-index:-1 ambient layer. */
body { margin: 0; min-height: 100vh; font-family: var(--sans); font-variant-numeric: tabular-nums; font-size: 14px; line-height: 1.5; color: var(--ink); -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: var(--ambient); pointer-events: none; }
body:has(main.auth-main)::before { background: var(--ambient-strong); }
body.nav-open { overflow: hidden; }
::selection { background: var(--ring); }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; border: 0; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { color: var(--heading); font-family: var(--display); font-weight: 700; letter-spacing: -.015em; text-wrap: balance; }
h1 { margin: 0; font-family: var(--display); font-size: clamp(1.375rem, 1.8vw, 1.625rem); font-weight: 700; line-height: 1.2; letter-spacing: -.02em; }
.muted { color: var(--muted); font-size: .8125rem; line-height: 1.5; }
.eyebrow { display: block; margin-bottom: 4px; color: var(--accent); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }

/* ---- shell: sidebar rail + content ---- */
.shell { display: flex; min-height: 100dvh; }
main { flex: 1; min-width: 0; width: 100%; min-height: 100dvh; padding: 16px clamp(16px, 2.2vw, 32px) 64px; overflow-wrap: break-word; }
.app-content { width: 100%; max-width: 1440px; margin-inline: auto; }
.mobile-header, .mobile-bottom-nav, .rail-backdrop { display: none; }

/* Persistent Top Header Bar (Desktop): minimal breadcrumbs, central search, workspace selector, notifications, profile, theme toggle */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 52px; margin-bottom: 16px; padding: 8px 16px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-card);
}
.topbar-crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--muted); font-size: .8125rem; font-weight: 500; }
.topbar-home { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: var(--radius-sm); color: var(--ink-2); font-weight: 600; transition: background-color var(--t), color var(--t); }
.topbar-home .nav-icon { width: 15px; height: 15px; color: var(--accent); opacity: 1; }
.topbar-home:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.topbar-sep { color: var(--line-strong); font-weight: 500; }
.topbar-current { color: var(--ink); font-family: var(--sans); font-size: .875rem; font-weight: 600; letter-spacing: -.01em; }
.topbar-center { flex: 1; max-width: 420px; margin-inline: auto; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-scope {
  display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 4px 10px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2);
  color: var(--ink-2); font-size: .78rem; font-weight: 600; white-space: nowrap;
}
.topbar-scope-icon { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; color: var(--accent); }
.topbar-scope-icon .nav-icon { width: 14px; height: 14px; opacity: 1; }
.topbar-icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink-2); transition: background-color var(--t), border-color var(--t), color var(--t);
}
.topbar-icon-btn .nav-icon { width: 16px; height: 16px; }
.topbar-pin { display: contents; }
button.topbar-icon-btn { padding: 0; cursor: pointer; }
.topbar-icon-btn.is-pinned { border-color: var(--accent); color: var(--accent); }
.rail nav a[data-pin-toggle] { color: var(--rail-muted); }
.rail .pin-row { display: flex; align-items: center; }
.rail .pin-row a { flex: 1; min-width: 0; }
.rail .pin-row a[data-dead] { opacity: .55; text-decoration: line-through; }
.rail .pin-emoji { display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }
.rail .pin-x { background: none; border: 0; color: var(--rail-muted); cursor: pointer; padding: 0 10px; min-height: 44px; font-size: 18px; opacity: 0; transition: opacity 120ms; }
.rail .pin-row:hover .pin-x, .rail .pin-row:focus-within .pin-x, .rail .pin-row:has(a[data-dead]) .pin-x { opacity: 1; }
.rail.is-collapsed .pin-x { display: none; }
.topbar-icon-btn:hover { border-color: var(--line-strong); background: var(--hover); color: var(--ink); text-decoration: none; }
.topbar-badge {
  position: absolute; top: -4px; right: -4px; display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 4px; border: 2px solid var(--surface); border-radius: 999px;
  background: var(--accent-fill); color: #fff; font-size: .625rem; font-weight: 700; line-height: 1;
}
.topbar-avatar-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface-2); overflow: hidden;
  transition: border-color var(--t);
}
.topbar-avatar-link:hover { border-color: var(--line-strong); text-decoration: none; }
.topbar-avatar-link .employee-avatar { width: 100%; height: 100%; border: 0; border-radius: 0; }
.topbar-avatar-initials { font-size: .75rem; font-weight: 700; color: var(--accent); }

/* Desktop: Fixed Deep Burgundy Navigation Sidebar (#8B0A14) with white labels and Champagne Gold (#D4AF37) active indicator */
.rail {
  position: sticky; top: 0; z-index: 30; display: flex; flex-direction: column; width: var(--rail); flex: 0 0 var(--rail); height: 100dvh; margin: 0;
  border-radius: 0; background: var(--rail-bg); color: var(--rail-ink);
  border-right: 1px solid var(--rail-line);
  transition: width 150ms ease-out, flex-basis 150ms ease-out; overflow: hidden;
}
.rail :focus-visible, .mobile-header :focus-visible { outline-color: var(--gold); }
.rail .brand { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 60px; padding: 12px 14px 12px 16px; border-bottom: 1px solid var(--rail-line); color: #fff; font-size: .95rem; font-weight: 700; line-height: 1.2; letter-spacing: -.015em; }
.brand-copy { min-width: 0; margin-right: auto; white-space: nowrap; font-size: .92rem; }
.brand-logo { display: block; flex: none; height: auto; }
.rail.is-collapsed .brand-logo { width: 34px; height: auto; }
.login-logo { display: block; height: auto; margin: 0 auto 16px; }
.rail .brand small { display: block; margin-top: 2px; color: var(--rail-muted); font-size: .7rem; font-weight: 500; letter-spacing: .01em; }
.rail-toggle { display: inline-flex; flex: 0 0 auto; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 32px; height: 32px; min-height: 32px; margin: 0; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; }
.rail-toggle:hover { background: var(--rail-hover); border-color: transparent; }
.rail-toggle span { display: block; width: 15px; height: 1.75px; border-radius: 1px; background: var(--rail-ink); }
.rail nav { flex: 1; padding: 8px 10px 12px; overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--rail-line) transparent; }
.rail nav::-webkit-scrollbar { width: 5px; }
.rail nav::-webkit-scrollbar-thumb { background: var(--rail-line); border-radius: 3px; }
.rail nav a, .rail nav button.link, .rail nav .nav-disabled {
  display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; min-height: 36px; margin: 2px 0; padding: 7px 10px;
  border: 0; border-radius: var(--radius-sm); background: none; color: var(--rail-ink); font: inherit; font-size: .84375rem; font-weight: 500; text-align: left; cursor: pointer;
  transition: background-color var(--t), color var(--t);
}
.rail nav a:hover, .rail nav button.link:hover { background: var(--rail-hover); color: #fff; text-decoration: none; }
.rail nav a.active { background: var(--rail-active-soft); color: #fff; font-weight: 700; box-shadow: inset 4px 0 0 var(--rail-active); }
.rail nav .nav-disabled { opacity: .5; cursor: default; }
.rail nav .nav-disabled .soon { margin-left: auto; color: var(--rail-muted); font-size: .68rem; }
.nav-icon { flex: 0 0 18px; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.rail nav a .nav-icon { color: var(--rail-ink); }
.rail nav a.active .nav-icon { opacity: 1; stroke-width: 2.1; color: var(--rail-active); }
.rail nav a .count { margin-left: auto; }
.rail nav .group { padding: 14px 10px 4px; color: var(--rail-muted); font-size: .68rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.rail nav .group:first-child { padding-top: 4px; }
.rail nav .group[role="button"] { display: flex; align-items: center; justify-content: space-between; min-height: 32px; cursor: pointer; border-radius: var(--radius-sm); transition: color 120ms; }
.rail nav .group[role="button"]::after { content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.75px 1.75px 0; transform: rotate(-45deg); transition: transform 120ms; }
.rail nav .group[aria-expanded="true"]::after { transform: rotate(45deg); }
.rail nav .group[role="button"]:hover, .rail nav .group[role="button"]:focus-visible { color: #fff; }
.rail:not(.is-collapsed) nav a.nav-folded { display: none; }
.rail .count { min-width: 20px; padding: 1px 6px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, .16); color: #fff; font-size: .68rem; font-weight: 600; text-align: center; line-height: 1.3; }
.rail nav a.active .count { background: var(--rail-active); color: var(--rail-active-ink); font-weight: 700; }
.rail .me { display: flex; align-items: center; gap: 10px; margin: 0; padding: 12px 14px; border-top: 1px solid var(--rail-line); background: rgba(0, 0, 0, .12); }
.rail .me-avatar { position: relative; display: inline-flex; flex: 0 0 34px; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: .72rem; font-weight: 700; text-transform: uppercase; }
.rail .me-avatar:has(.employee-avatar) { padding: 0; background: transparent; }
.rail .me-avatar:hover { text-decoration: none; }
.rail .me-avatar::after { content: ""; position: absolute; right: 0; bottom: 0; width: 9px; height: 9px; border: 2px solid var(--rail-bg); border-radius: 50%; background: var(--ok-fill); }
.rail .me-copy { min-width: 0; flex: 1; }
.rail .me-copy > a { display: block; color: #fff; }
.rail .me-copy > a:hover { text-decoration: none; }
.rail .me strong { display: block; color: #fff; font-size: .8125rem; font-weight: 600; overflow-wrap: anywhere; }
.rail .me span { display: block; color: var(--rail-muted); font-size: .72rem; overflow-wrap: anywhere; }
.rail .me-actions { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.rail .me-link { color: var(--rail-muted); font-size: .72rem; font-weight: 500; }
.rail .me-link:hover { color: #fff; text-decoration: underline; }
.rail .me-sep { display: inline !important; color: var(--rail-muted); font-size: .72rem; }
.rail .me form { display: inline; margin: 0; }
.rail .me button.link { display: inline; padding: 0; margin: 0; border: 0; background: transparent; box-shadow: none; color: var(--rail-muted); font-size: .72rem; font-weight: 500; width: auto; min-height: 0; }
.rail .me button.link:hover { color: #fff; text-decoration: underline; background: transparent; }

.rail.is-collapsed { width: var(--rail-collapsed); flex-basis: var(--rail-collapsed); }
.rail.is-collapsed .brand { flex-direction: column; justify-content: center; gap: 8px; padding: 12px 0; }
.rail.is-collapsed .brand-copy, .rail.is-collapsed .me-copy, .rail.is-collapsed nav .group { display: none; }
.rail.is-collapsed nav { padding: 6px 0 12px; }
.rail.is-collapsed nav a, .rail.is-collapsed nav .nav-disabled { position: relative; justify-content: center; width: 40px; height: 36px; margin: 2px auto; padding: 0; }
.rail.is-collapsed nav a > span:not(.count), .rail.is-collapsed nav .nav-disabled > span { display: none; }
.rail.is-collapsed .nav-icon { width: 18px; height: 18px; }
/* Collapsed = pins only (2026-11-10): pins live in .pin-row, every other menu link is a direct child of nav. */
.rail.is-collapsed nav > a:not([data-pin-toggle]), .rail.is-collapsed nav > .nav-disabled { display: none; }
.rail.is-collapsed .count { position: absolute; top: -2px; right: -2px; min-width: 16px; margin: 0; padding: 0 4px; font-size: .62rem; }
.rail.is-collapsed .me { justify-content: center; min-height: 56px; margin: 0; padding: 10px 0; }

/* ---- flash toasts (bottom-right; base.html's armToasts removes them 300ms after .flash-out) ---- */
.toast-container { position: fixed; right: 20px; bottom: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 40px)); }
.flash { padding: 12px 16px; border: 1px solid; border-radius: var(--radius); box-shadow: var(--shadow-pop); font-size: .875rem; font-weight: 500; animation: flash-in 150ms ease-out; }
.flash.flash-out { animation: flash-out 150ms ease-in forwards; }
@keyframes flash-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes flash-out { to { opacity: 0; } }
.flash-success { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.flash-error { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.flash-info, .flash-warning { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }

/* ---- page structure ---- */
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 0 22px; padding: 20px 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--hero-module); box-shadow: var(--shadow-card); }
.page-header p { max-width: 720px; margin: 6px 0 0; color: var(--ink-2); font-size: .9375rem; line-height: 1.5; }
.page-header .actions { flex-wrap: nowrap; justify-content: flex-end; }
.panel { margin-bottom: 16px; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-card); }
.panel h2 { margin: 0 0 12px; color: var(--ink); font-size: 1.0625rem; font-weight: 700; letter-spacing: -.015em; }
/* The first panel of a page that has no .page-header/h1 carries the page title. */
.app-content > .panel:not(.panel ~ .panel):not(.page-header ~ .panel):not(h1 ~ .panel) > h2,
.app-content > .panel:not(.panel ~ .panel):not(.page-header ~ .panel):not(h1 ~ .panel) > .row-between > h2,
.app-content > h2.page-title { margin-bottom: 4px; font-size: clamp(1.5rem, 2.2vw, 2rem); font-weight: 700; line-height: 1.15; letter-spacing: -.03em; }
.app-content > h2.page-title { margin: 0 0 20px; }
.panel > h2 + p.muted, .panel > .row-between + p.muted { margin: -2px 0 14px; }
.row-between { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.row-between h2 { margin: 0; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.actions .btn { margin: 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.section-heading { margin-top: 22px !important; }
.compact-row { gap: 8px; }
.toolbar-row { flex-wrap: wrap; gap: 12px; }
.toolbar-row-spaced { margin-top: 10px; }
.access-rule-row { max-width: 680px; }
.notification-unread { background: var(--gold-soft); font-weight: 600; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
fieldset.panel { margin: 12px 0; padding: 20px; }
legend { padding: 0 6px; color: var(--ink); font-size: .8125rem; font-weight: 600; }
details { margin-top: 10px; padding: 8px 12px; border-radius: var(--radius); background: var(--surface-2); }
details summary { margin: 0; color: var(--ink-2); font-size: .8125rem; font-weight: 500; cursor: pointer; }
details summary::marker { color: var(--muted); }

/* ---- cards: tiles, hubs, task cards ---- */
.metric-row { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 112px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-card); color: inherit; text-decoration: none; transition: background-color var(--t), border-color var(--t); overflow: hidden; }
a.metric-card:hover { border-color: var(--line-strong); background: var(--surface-2); text-decoration: none; }
.metric-card .label { display: block; color: var(--ink-2); font-size: .84rem; font-weight: 700; }
.metric-card .value { margin-top: 6px; color: var(--ink); font-size: 2.1rem; font-weight: 800; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums lining-nums; }
.metric-card.alert { border-color: var(--tint-rose-border); background: var(--tint-rose-bg); }
.metric-card.alert .value { color: var(--tint-rose-ink); }
.metric-card.attn { border-color: var(--tint-amber-border); background: var(--tint-amber-bg); }
.metric-card.attn .value { color: var(--tint-amber-ink); }
.metric-card.ok { border-color: var(--tint-emerald-border); background: var(--tint-emerald-bg); }
.metric-card.ok .value { color: var(--tint-emerald-ink); }
.metric-card.tint-emerald { border-color: var(--tint-emerald-border); background: var(--tint-emerald-bg); }
.metric-card.tint-amber { border-color: var(--tint-amber-border); background: var(--tint-amber-bg); }
.metric-card.tint-rose { border-color: var(--tint-rose-border); background: var(--tint-rose-bg); }
.metric-card.tint-purple { border-color: var(--tint-purple-border); background: var(--tint-purple-bg); }
.metric-card.tint-blue { border-color: var(--tint-blue-border); background: var(--tint-blue-bg); }
.metric-card.tint-peach { border-color: var(--tint-peach-border); background: var(--tint-peach-bg); }

.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.hub-card { display: grid; grid-template-columns: 46px minmax(0, 1fr) 22px; align-items: center; gap: 14px; min-height: 86px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-card); color: var(--ink); transition: background-color var(--t), border-color var(--t); }
.hub-card:hover { border-color: var(--line-strong); background: var(--surface-2); color: var(--ink); text-decoration: none; }
.hub-card-icon { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: var(--radius); background: var(--tint-amber-solid); color: var(--tint-amber-ink); }
.hub-card:nth-child(6n+1) .hub-card-icon { background: var(--tint-purple-solid); color: var(--tint-purple-ink); }
.hub-card:nth-child(6n+2) .hub-card-icon { background: var(--tint-emerald-solid); color: var(--tint-emerald-ink); }
.hub-card:nth-child(6n+3) .hub-card-icon { background: var(--tint-amber-solid); color: var(--tint-amber-ink); }
.hub-card:nth-child(6n+4) .hub-card-icon { background: var(--tint-blue-solid); color: var(--tint-blue-ink); }
.hub-card:nth-child(6n+5) .hub-card-icon { background: var(--tint-rose-solid); color: var(--tint-rose-ink); }
.hub-card:nth-child(6n+6) .hub-card-icon { background: var(--tint-peach-solid); color: var(--tint-peach-ink); }
.hub-card-icon.tint-emerald { background: var(--tint-emerald-solid) !important; color: var(--tint-emerald-ink) !important; }
.hub-card-icon.tint-amber { background: var(--tint-amber-solid) !important; color: var(--tint-amber-ink) !important; }
.hub-card-icon.tint-rose { background: var(--tint-rose-solid) !important; color: var(--tint-rose-ink) !important; }
.hub-card-icon.tint-purple { background: var(--tint-purple-solid) !important; color: var(--tint-purple-ink) !important; }
.hub-card-icon.tint-blue { background: var(--tint-blue-solid) !important; color: var(--tint-blue-ink) !important; }
.hub-card-icon.tint-peach { background: var(--tint-peach-solid) !important; color: var(--tint-peach-ink) !important; }
.hub-card-icon .nav-icon { width: 21px; height: 21px; opacity: 1; }
.hub-card strong, .hub-card small { display: block; }
.hub-card strong { font-size: .9375rem; font-weight: 700; color: var(--ink); }
.hub-card small { margin-top: 3px; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.hub-card-arrow { color: var(--muted); font-weight: 700; transition: color var(--t); }
.hub-card:hover .hub-card-arrow { color: var(--ink); }
.trace-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.trace-card { position: relative; display: flex; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-card); transition: background-color var(--t), border-color var(--t); }
.trace-card:hover { border-color: var(--line-strong); background: var(--surface-2); }
.trace-card form.trace-start { display: flex; flex: 1; margin: 0; }
.trace-start button { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 6px; flex: 1; min-height: 168px; margin: 0; padding: 18px; border: 0; border-radius: inherit; background: transparent; color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.trace-start button:hover { border: 0; background: transparent; color: var(--ink); }
.trace-card-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-bottom: 8px; border-radius: var(--radius); background: var(--surface-2); color: var(--accent); }
.trace-card-icon .nav-icon { width: 19px; height: 19px; }
.trace-card strong { font-size: 1rem; font-weight: 600; line-height: 1.3; }
.trace-card small { color: var(--muted); font-size: .75rem; }
.trace-card-action { margin-top: auto; padding-top: 10px; color: var(--accent); font-size: .8125rem; font-weight: 600; }
.trace-remove { position: absolute; top: 10px; right: 10px; margin: 0; }
.trace-remove button { width: 28px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: .8125rem; line-height: 1; cursor: pointer; }
.trace-remove button:hover { color: var(--bad); border-color: var(--bad); }
.trace-add { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.trace-add label { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 220px; }

.task-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 10px; }
.task-card { display: block; min-height: 120px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-card); color: inherit; text-decoration: none; transition: background-color var(--t), border-color var(--t); }
.task-card:hover { border-color: var(--line-strong); background: var(--surface-2); text-decoration: none; }
.task-card-title { margin-bottom: 6px; font-size: 1rem; font-weight: 600; line-height: 1.3; }
.task-card-meta { margin-bottom: 14px; color: var(--muted); font-size: .8125rem; }
.task-card-action { margin-top: auto; color: var(--accent); font-size: .8125rem; font-weight: 600; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.hero .today { color: var(--ink-2); font-size: 1rem; font-weight: 600; }
.empty { padding: 24px 2px; color: var(--ink-2); text-align: left; }
.empty strong { display: block; margin-bottom: 4px; color: var(--ink); font-size: 1.05rem; font-weight: 600; letter-spacing: -.01em; }
.empty-state { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 32px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-card); color: var(--muted); }
.empty-state strong { color: var(--ink); font-size: 1.05rem; font-weight: 600; }
.empty-state .btn { margin-top: 10px; }
.compact-empty { padding: 24px 4px; font-size: .8125rem; }
.compact-empty strong { font-size: .9rem; }

/* ---- forms ---- */
label { display: block; margin-top: 16px; color: var(--ink-2); font-size: .8125rem; font-weight: 600; }
label.inline { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--ink); font-weight: 400; }
input, select, textarea {
  max-width: 100%; min-height: 40px; margin: 6px 0 2px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: inherit; transition: border-color var(--t), box-shadow var(--t);
}
/* Single selects get the concept's chevron; multi-selects/listboxes keep the native look. */
select:not([multiple]):not([size]) {
  appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235d6675' stroke-width='2.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 12px center; background-size: 16px;
}
textarea { min-height: 96px; line-height: 1.5; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--line-hover); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 0; box-shadow: 0 0 0 3px var(--ring); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--accent); }
input[type=file] { min-height: 44px; padding: 5px; border-style: dashed; background: var(--surface-2); color: var(--muted); font-size: .78rem; cursor: pointer; }
input[type=file]::file-selector-button { height: 30px; margin-right: 10px; padding: 0 12px; border: 0; border-radius: var(--radius-sm); background: var(--hover-2); color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; transition: background-color var(--t); }
input[type=file]::file-selector-button:hover { background: var(--line-strong); }
/* Bare forms are single-record detail forms: cap field width instead of stretching across the panel. */
.panel form:not(.inline-form) input:not([type=checkbox]):not([type=radio]):not([type=file]):not(.compact),
.panel form:not(.inline-form) select:not(.compact) { display: block; width: 100%; max-width: 460px; }
.panel form:not(.inline-form) textarea { display: block; width: 100%; max-width: 640px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 0 24px; max-width: 1080px; }
.form-grid > * { min-width: 0; }  /* a select with long options never widens its column past the screen */
.form-grid label input:not([type=checkbox]), .form-grid label select { width: 100% !important; max-width: none !important; }
.form-intro { max-width: 680px; margin: -4px 0 18px; color: var(--ink-2); }
.field-hint { display: block; margin: 4px 0 2px; color: var(--muted); font-size: .78rem; font-weight: 400; line-height: 1.45; }
.field-block { padding: 16px 0; border-bottom: 1px solid var(--line); }
.field-block:last-of-type { border-bottom: 0; }
.field-block > label { margin-top: 0; color: var(--ink); font-size: .875rem; }
.field-block .muted { margin: 2px 0 4px; }
.errorlist { margin: 0 0 8px; padding: 0; color: var(--bad); font-size: .8125rem; list-style: none; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; }
.inline-form input, .inline-form select { width: auto; margin: 0; }
.inline-form button { margin-top: 0; }
.inline-form span { color: var(--muted); font-size: .8125rem; }
.filter-bar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.filter-bar label { margin: 0; }
.filter-bar input, .filter-bar select { display: block; min-width: 180px; margin-top: 5px; }
.decision-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.decision-actions button { margin: 0; }
.decision-actions .decision-note { flex-basis: 100%; margin: 0; color: var(--muted); font-size: .8125rem; }

/* Binary/multiple choices are tappable tiles over native radios/checkboxes (keyboard + screen-reader safe). */
.choice-group { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 2px; padding: 0; border: 0; }
.choice-group legend { padding: 0; }
.choice-option { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; margin: 0; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink); font-size: .875rem; font-weight: 600; cursor: pointer; transition: background-color var(--t), border-color var(--t); }
.choice-option:hover { background: var(--hover); }
.choice-option input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.choice-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-hover); box-shadow: inset 0 0 0 1px var(--accent); }
.choice-option.pass:has(input:checked), .choice-option.clear:has(input:checked) { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok); }
.choice-option.fail:has(input:checked), .choice-option.issue:has(input:checked) { border-color: var(--bad); background: var(--bad-bg); color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); }
.choice-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.checklist-card-fieldset { min-width: 0; margin: 22px 0; padding: 0; border: 0; }
.checklist-card-fieldset legend { margin-bottom: 10px; color: var(--ink); font-weight: 600; }
.checklist-card-fieldset .muted { margin: 8px 0 0; }
.checklist-choice-grid > div { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.checklist-choice-grid > div > div { min-width: 0; }
.checklist-choice-grid label { display: flex; align-items: center; gap: 10px; height: 100%; min-height: 52px; margin: 0; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); font-weight: 500; line-height: 1.35; cursor: pointer; transition: background-color var(--t), border-color var(--t); }
.checklist-choice-grid label:hover { background: var(--hover); }
.checklist-choice-grid label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.checklist-choice-grid label:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.checklist-choice-grid input[type=checkbox] { flex: none; }

/* Date/time controls: native date picker made fully clickable; time uses a Now / Set time chooser (see base.html). */
input[type=date], input[type=datetime-local] { cursor: pointer; accent-color: var(--accent); }
input[type=date]::-webkit-calendar-picker-indicator, input[type=datetime-local]::-webkit-calendar-picker-indicator { padding: 4px; border-radius: var(--radius-sm); cursor: pointer; transition: background-color var(--t); }
input[type=date]:hover::-webkit-calendar-picker-indicator, input[type=datetime-local]:hover::-webkit-calendar-picker-indicator { background: var(--hover); }
.time-choice-source { display: none !important; }
.time-choice, .date-time-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 2px; }
.time-choice.compact, .date-time-choice.compact { margin-top: 5px; }
.time-choice-actions { display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--radius-sm); background: var(--hover); }
.time-choice-actions button { min-height: 30px; margin: 0; padding: 4px 10px; border: 0; border-radius: 5px; background: transparent; color: var(--ink-2); font-size: .78rem; font-weight: 600; }
.time-choice-actions button + button { margin-left: 0; }
.time-choice-actions button:hover { background: var(--hover-2); color: var(--ink); border-color: transparent; }
.time-choice-actions button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-card), 0 0 0 1px var(--line); }
.time-choice-select { min-width: 146px; min-height: 36px; margin: 0; font-variant-numeric: tabular-nums; }
.date-time-choice-date { width: 155px; margin: 0; }

/* ---- buttons: red primary, neutral secondary, red outline (enterprise hierarchy) ---- */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; margin-top: 12px; padding: 6px 14px;
  border: 1px solid var(--deep-red); border-radius: var(--radius-sm); background: var(--btn-red-grad); color: #fff;
  font: inherit; font-size: .8125rem; font-weight: 600; line-height: 1.3; text-decoration: none; cursor: pointer;
  transition: background-color var(--t), border-color var(--t), color var(--t);
}
button:hover, .btn:hover { border-color: var(--deep-red); background: var(--btn-red-hover-grad); color: #fff; text-decoration: none; }
button:disabled { cursor: not-allowed; opacity: .55; }
button.secondary, .btn.secondary { border-color: var(--line-strong); background: var(--surface); color: var(--ink); box-shadow: none; }
button.secondary:hover, .btn.secondary:hover { border-color: var(--line-hover); background: var(--surface-3); color: var(--ink); }
button.outline, .btn.outline, .btn-outline { border-color: var(--accent); background: var(--surface); color: var(--accent); box-shadow: none; }
button.outline:hover, .btn.outline:hover, .btn-outline:hover { border-color: var(--accent-hover); background: var(--accent-soft); color: var(--accent-hover); text-decoration: none; }
button.danger, .btn.danger { border-color: var(--bad-line); background: var(--surface); color: var(--bad); }
button.danger:hover, .btn.danger:hover { border-color: var(--bad); background: var(--bad-bg); color: var(--bad); }
/* Page-level primary actions ("+ New KPI") are the biggest control on the screen. */
.page-header .btn, .kpi-list-header .btn { min-height: 38px; margin-top: 0; padding: 7px 16px; font-size: .84rem; }
/* Page-level primary actions carry the red shadow; on a red photo band the primary turns gold so it stays visible. */
.page-header .btn:not(.secondary):not(.outline):not(.danger), .kpi-list-header .btn:not(.secondary):not(.outline):not(.danger), form.login-form button { box-shadow: var(--shadow-red); }
.photo-hero .btn:not(.secondary):not(.outline):not(.danger) { border-color: var(--gold-hover); background: var(--btn-gold-grad); color: var(--on-gold); box-shadow: var(--shadow-gold); }
.photo-hero .btn.secondary { border-color: var(--hero-photo-line); background: var(--hero-photo-bg); color: var(--hero-photo-ink); box-shadow: none; }
.photo-hero .btn.secondary:hover { border-color: var(--gold); background: var(--rail-bg-deep); color: var(--hero-photo-ink); }
button + button, button + .btn, .btn + button, form.inline + .btn { margin-left: 8px; }
form.inline { display: inline; }
.compact-btn { min-height: 30px; margin: 0; padding: 4px 10px; font-size: .78rem; }
.text-link { font-size: .8125rem; font-weight: 600; white-space: nowrap; }

/* Segmented control (Chart/List, KPI chart switch, Tabs) */
.view-toggle { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-3); }
.view-toggle button { min-height: 30px; margin: 0; padding: 4px 12px; border: 0 !important; border-radius: 5px; background: transparent; color: var(--ink-2); font-size: .78rem; font-weight: 600; }
.view-toggle button + button { margin-left: 0; }
.view-toggle button:hover { background: var(--hover); color: var(--ink); }
.view-toggle a { display: inline-flex; align-items: center; justify-content: center; min-height: 30px; padding: 4px 12px; border-radius: 5px; color: var(--ink-2); font-size: .78rem; font-weight: 600; text-decoration: none; transition: background-color var(--t), color var(--t); }
.view-toggle a:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.view-toggle button.active, .view-toggle a.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-card); }
/* Link tabs (Tasks, Stock counts, Payslips): one shared look, so a page never shows them unstyled. */
.tasks-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.tasks-filter a { display: inline-flex; align-items: center; padding: 6px 12px; border: 1px solid transparent; border-radius: var(--radius-sm); color: var(--muted); font-size: .8125rem; font-weight: 600; text-decoration: none; transition: background-color var(--t), color var(--t), border-color var(--t); }
.tasks-filter a:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.tasks-filter a.current { background: var(--surface); border-color: var(--line-strong); color: var(--ink); box-shadow: var(--shadow-card); }

/* ---- tables ---- */
.data-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.table-wrap { width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); scrollbar-width: thin; }
.table-wrap .data-table { min-width: 680px; }
.data-table th, .data-table td { padding: 11px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.data-table th { position: sticky; top: 0; z-index: 2; background: var(--surface-3); color: var(--ink-2); font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background-color var(--t), box-shadow var(--t); }
.data-table tbody tr:hover { background: var(--hover-row); box-shadow: inset 3px 0 0 var(--accent); }
.data-table td a { color: var(--ink); font-weight: 600; }
.data-table td a:hover { color: var(--accent); }
.panel:has(> .data-table), .panel:has(> .table-wrap) { overflow-x: auto; }
.panel > ul:not(.errorlist) { margin: 0; padding: 0; list-style: none; }
.panel > ul:not(.errorlist) > li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.panel > ul:not(.errorlist) > li:last-child { border-bottom: 0; }
.timeline-item { padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: .8125rem; }
.timeline-item:last-child { border-bottom: 0; }
.list-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin: 16px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-card); }
/* Inside a panel the toolbar is an inset, not a second floating card. */
.panel .list-toolbar, .panel .hub-card { background: var(--surface-2); box-shadow: none; }
.panel .hub-card:hover { background: var(--hover); }
.list-toolbar label { display: grid; gap: 5px; margin: 0; color: var(--muted); font-size: .75rem; font-weight: 600; }
.list-toolbar select, .list-toolbar input { width: auto; min-width: 150px; margin: 0; }
.list-toolbar .toolbar-actions { display: flex; align-items: center; gap: 8px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 8px; padding: 14px 2px 2px; }
.pagination-summary { color: var(--muted); font-size: .78rem; font-weight: 500; }
.pagination-links { display: flex; align-items: center; gap: 6px; }
.pagination-links a, .pagination-links .current { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font-size: .8rem; font-weight: 600; text-decoration: none; transition: background-color var(--t), border-color var(--t), color var(--t); }
.pagination-links a:hover { background: var(--hover); border-color: var(--line-hover); color: var(--ink); }
.pagination-links .current { background: var(--btn-red-grad); border-color: var(--accent-hover); color: #fff; box-shadow: var(--shadow-red); }
.pagination-links .ellipsis { padding: 0 3px; color: var(--muted); font-weight: 600; }

/* ---- status badges: subtle enterprise tags (class names are dynamic: status-{{ value|lower }}) ---- */
.status-badge { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 2px 9px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-3); color: var(--ink-2); font-size: .74rem; font-weight: 600; white-space: nowrap; }
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-published, .status-approved, .status-closed, .status-pass, .status-present, .status-ok, .status-accepted, .status-sent, .status-converted { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok); }
.status-pending_approval, .status-submitted, .status-warning, .status-pending, .status-receiving, .status-partial { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn); }
.status-rejected, .status-critical, .status-fail, .status-absent, .status-open, .status-suspended, .status-cancelled, .status-late { border-color: var(--bad-line); background: var(--bad-bg); color: var(--bad); }
.status-late { font-weight: 700; }
.status-late::before { border-radius: 1px; transform: rotate(45deg); }
.status-returned { border-color: var(--warn-line); background: var(--orange-bg); color: var(--orange); }
.status-info, .status-excused, .status-leave, .status-in_progress { border-color: var(--info-line); background: var(--info-bg); color: var(--info); }
.status-in_progress::before { background: transparent; border: 2px solid currentColor; box-sizing: border-box; }
.late-tag { display: inline-flex; padding: 1px 6px; border: 1px solid var(--bad-line); border-radius: 4px; background: var(--bad-bg); color: var(--bad); font-size: .65rem; font-weight: 600; text-transform: uppercase; }
.doc-type { display: inline-flex; padding: 2px 8px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-hover); font-size: .74rem; font-weight: 600; white-space: nowrap; }

/* ---- page-specific blocks that live in this file ---- */
/* People / profile */
.employee-avatar { display: inline-flex; flex: 0 0 auto; overflow: hidden; border: 1px solid var(--line); border-radius: 50%; background: var(--accent-soft); }
.employee-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 42px; height: 42px; }
.avatar-md { width: 52px; height: 52px; }
.avatar-lg { width: 72px; height: 72px; }
.avatar-xl { width: 88px; height: 88px; }
.avatar-rail { width: 100%; height: 100%; border: 0; }
.employee-list-identity { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); }
.employee-list-identity:hover { color: var(--accent); text-decoration: none; }
.employee-list-identity strong, .employee-list-identity small { display: block; }
.employee-list-identity small { margin-top: 2px; color: var(--muted); font-size: .78rem; }
.profile-heading, .profile-hero { display: flex; align-items: center; gap: 18px; }
.profile-heading h1, .profile-heading p, .profile-hero h2, .profile-hero p { margin: 0; }
.profile-heading p { margin-top: 4px; color: var(--muted); }
.appearance-editor { margin: 24px 0 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.appearance-editor h2, .appearance-editor p { margin: 0; }
.appearance-editor p { margin-top: 3px; }
.photo-upload-row { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-top: 14px; }
.photo-upload { min-width: min(360px, 100%); margin: 0; }
.photo-upload input { display: block; width: 100%; }
.remove-photo { display: inline-flex; align-items: center; gap: 7px; margin: 18px 0 0; font-weight: 500; }
.remove-photo input { margin: 0; }
.avatar-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 10px; max-width: 960px; margin: 22px 0 0; padding: 0; border: 0; }
.avatar-picker legend { grid-column: 1 / -1; margin-bottom: 8px; padding: 0; color: var(--ink-2); font-size: .8125rem; font-weight: 600; }
.avatar-option { position: relative; display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; margin: 0; padding: 10px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-align: center; cursor: pointer; transition: background-color var(--t), border-color var(--t); }
.avatar-option:hover { background: var(--surface-2); border-color: var(--line-strong); }
.avatar-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.avatar-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.avatar-option img { width: 64px; height: 64px; border-radius: 16px; }
.avatar-option span { color: var(--ink-2); font-size: .76rem; line-height: 1.25; font-weight: 500; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.danger-zone h2, .danger-zone p { margin: 0; }
.danger-zone form, .danger-zone button { margin: 0; }
.permission-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; margin: 0; padding: 0; border: 0; }
.permission-grid legend { padding: 0 8px; font-weight: 600; }
.permission-option { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 11px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; font-weight: 500; transition: background-color var(--t); }
.permission-option:hover { background: var(--surface-2); }
.permission-option input { flex: 0 0 auto; margin-top: 2px; }
.permission-option strong, .permission-option small { display: block; }
.permission-option small { margin-top: 2px; color: var(--muted); font-weight: 400; }
.permission-option.is-inherited { border-style: dashed; background: var(--info-bg); }
.permission-module-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.permission-module-head h2 { margin: 0; font-size: 1rem; }
.permission-module-head .btn { padding: 4px 12px; font-size: .78rem; }
.permission-note { font-size: .78rem; font-style: italic; }
.permission-form .panel { margin-bottom: 16px; }
.setup-grid { display: grid; grid-template-columns: repeat(2, minmax(280px, 1fr)); gap: 16px; }
.setup-grid .panel { margin: 0; }

/* Organization chart / tree */
.org-workspace { margin: 0; padding: 10px 0 0; border: 0; border-radius: 0; background: transparent; }
.org-workspace .row-between { padding: 0 2px 18px; border-bottom: 1px solid var(--line); }
.org-workspace .org-chart-wrap { min-height: 440px; margin-top: 16px; padding: 22px 16px 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.org-workspace .org-tree { margin-top: 16px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.org-tree { display: flex; flex-direction: column; gap: 4px; }
.org-node { padding: 6px 14px; border-left: 2px solid var(--line-strong); font-size: .9rem; }
.org-node.group { border-left-color: var(--ink); font-size: 1rem; font-weight: 600; }
.org-node.company { margin-left: 22px; border-left-color: var(--accent); }
.org-node.branch { margin-left: 44px; }
.org-node.department { margin-left: 66px; color: var(--ink-2); font-size: .85rem; }
.org-node .tag { margin-right: 8px; color: var(--muted); font-size: .75rem; }
.org-chart-wrap { padding: 8px 0 16px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-inline: contain; }
.org-chart, .org-chart .tier { display: flex; justify-content: center; margin: 0; padding: 0; list-style: none; }
.org-chart { width: max-content; min-width: 100%; }
.org-chart .tier { position: relative; padding-top: 24px; }
.org-chart li.node { position: relative; flex: 0 0 auto; padding: 24px 10px 0; text-align: center; }
.org-chart > li.node { padding-top: 0; }
.org-chart li.node::before, .org-chart li.node::after { content: ""; position: absolute; top: 0; right: 50%; width: 50%; height: 24px; border-top: 1px solid var(--line-strong); }
.org-chart li.node::after { right: auto; left: 50%; border-left: 1px solid var(--line-strong); }
.org-chart li.node:only-child::before, .org-chart li.node:only-child::after { border-top: 0; }
.org-chart li.node:only-child { padding-top: 0; }
.org-chart li.node:first-child::before, .org-chart li.node:last-child::after { border: 0; }
.org-chart li.node:last-child::before { border-right: 1px solid var(--line-strong); }
.org-chart > li.node::before, .org-chart > li.node::after { display: none; }
.org-chart .tier::before { content: ""; position: absolute; top: 0; left: 50%; width: 1px; height: 24px; background: var(--line-strong); }
.org-card { display: inline-block; width: 290px; min-width: 0; max-width: calc(100vw - 68px); padding: 12px 16px; border: 1px solid var(--line); border-top: 3px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink); font-size: .9rem; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.org-card .tag { display: block; margin-bottom: 3px; color: var(--muted); font-size: .75rem; font-weight: 600; }
.org-card.group { border-top-color: var(--accent-fill); background: var(--accent-fill); color: #fff; font-size: 1rem; font-weight: 600; }
.org-card.group .tag { color: #fff; }
.org-card.company { border-top-color: var(--accent); font-weight: 500; }
.org-card.branch { border-top-color: var(--line-strong); }
.org-card .depts { display: flex; flex-wrap: wrap; gap: 4px; max-width: 220px; margin-top: 10px; white-space: normal; }
.org-card .chip { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--hover); color: var(--ink-2); font-size: .76rem; }
.hide-staff .staff { display: none; }
.staff { max-width: 100%; margin: 8px 0 0; padding: 0 0 0 8px; border-left: 2px solid var(--line); color: var(--ink-2); font-size: .82rem; list-style: none; }
.staff li { padding: 2px 0; overflow-wrap: anywhere; }
.staff small { display: block; margin: 1px 0 0; color: var(--muted); font-size: .76rem; overflow-wrap: anywhere; }
.org-node .staff { margin-top: 4px; }
.org-card .dept .staff { margin: 4px 0; }
.arrow-flow { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: .875rem; }
.arrow-flow .step { padding: 7px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); font-size: .8125rem; font-weight: 500; }
.arrow-flow .arrow { color: var(--muted); }

/* Request launcher */
.request-catalog { display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }
.request-group { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-card); }
.request-group-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.request-group-heading h2 { margin: 0; font-size: 1rem; }
.request-group-heading > span { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--hover); color: var(--ink-2); font-size: .68rem; font-weight: 600; }
.request-launch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 8px; }
.request-launch-form { min-width: 0; margin: 0; }
.request-launch-card { display: grid; grid-template-columns: 30px minmax(0, 1fr) 20px; align-items: center; gap: 11px; width: 100%; min-height: 68px; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-align: left; }
.request-launch-card:hover { border-color: var(--line-strong); background: var(--surface-2); color: var(--ink); }
.request-launch-plus { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); font-size: 1.15rem; font-weight: 500; }
.request-launch-copy { min-width: 0; }
.request-launch-copy strong { display: block; color: inherit; font-size: .84rem; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.request-launch-copy small { display: block; margin-top: 4px; color: var(--muted); font-size: .75rem; font-weight: 400; overflow-wrap: anywhere; }
.request-launch-arrow { color: var(--muted); font-size: .95rem; transition: color var(--t); }
.request-launch-card:hover .request-launch-arrow { color: var(--accent); }
.request-launch-item { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: stretch; gap: 4px; min-width: 0; }
.favorite-toggle-form { display: flex; margin: 0; }
.favorite-toggle { width: 44px; min-height: 44px; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--muted); font-size: 1.2rem; line-height: 1; cursor: pointer; transition: color var(--t), border-color var(--t), background-color var(--t); }
.favorite-toggle:hover { border-color: var(--line-strong); background: var(--surface-2); color: var(--ink); }
.favorite-toggle.is-favorite { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn); }

/* Dynamic document forms (checklist execution) */
.execution-header, .execution-panel, .execution-panel + .panel { width: 100%; max-width: 960px; margin-inline: auto; }
.execution-header { align-items: center; margin-bottom: 24px; }
.execution-panel { padding: 0 28px; border-radius: var(--radius-lg); }
.execution-panel > p:first-child { margin: 0; padding: 22px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.execution-panel .field-block { padding: 24px 0; }
.execution-panel .field-block:first-of-type { padding-top: 26px; }
.field-label { margin: 0 0 10px; color: var(--ink); font-size: .9rem; font-weight: 600; }
.field-label span { color: var(--muted); font-size: .75rem; font-weight: 500; }
.field-label sup { margin-left: 3px; color: var(--bad); font-size: .75rem; }
.field-control { max-width: 520px; }
.field-control > input:not([type=checkbox]):not([type=file]), .field-control > select, .field-control > textarea { width: 100%; max-width: 520px !important; margin: 0; }
.field-control > textarea { min-height: 100px; resize: vertical; }
.field-control select[multiple] { min-height: 120px; }
.field-support { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(280px, 1.15fr); gap: 14px; margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.support-control, .upload-control { display: block; margin: 0; color: var(--muted); font-size: .72rem; font-weight: 600; }
.support-control > span, .upload-control > span { display: block; margin-bottom: 6px; }
.upload-control small { font-size: .68rem; font-weight: 400; }
.support-control input, .upload-control input { width: 100% !important; max-width: none !important; margin: 0 !important; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 0 24px; }
.form-actions .actions { flex-wrap: wrap; }
.form-actions button { margin: 0; }
.identity-attestation { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); color: var(--ink-2); }
.identity-attestation.signed { margin: 14px 0; }
.identity-avatar { display: inline-flex; flex: 0 0 30px; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-hover); font-size: .75rem; font-weight: 700; }
.identity-attestation strong, .identity-attestation small { display: block; }
.identity-attestation strong { color: var(--ink); font-size: .8rem; }
.identity-attestation small { margin-top: 1px; color: var(--muted); font-size: .75rem; }
.checklist-table-wrap { margin: 1rem 0; overflow-x: auto; }
.checklist-table caption { padding: .75rem 0; font-weight: 600; text-align: left; }
.checklist-table td { min-width: 150px; vertical-align: middle; }
.execution-panel .checklist-table .field-block { padding: 0; border: 0; }
.checklist-table .field-support { grid-template-columns: minmax(0, 1fr); padding: 8px; }
.checklist-table .field-support input { min-width: 0; max-width: 100%; }
.checklist-table details { margin-top: 8px; }

/* Visual checklist-table editor */
.table-builder { margin-top: 20px; }
.table-builder [hidden] { display: none !important; }
.table-builder-settings { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; }
.table-builder-settings input, .table-builder-settings select { width: 100%; max-width: none; }
.table-builder-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin: 24px 0 12px; }
.table-builder-toolbar p { margin: 0; }
.table-builder-toolbar button { white-space: nowrap; }
.table-builder-scroll { max-width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.table-builder-grid { width: 100%; border-collapse: separate; border-spacing: 0; }
.table-builder-grid caption { padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font-size: 1rem; font-weight: 600; text-align: left; }
.table-builder-grid th, .table-builder-grid td { min-width: 190px; padding: 10px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.table-builder-grid th { background: var(--surface-2); font-size: .8125rem; text-align: left; }
.table-builder-grid tr > :first-child { position: sticky; left: 0; z-index: 1; min-width: 250px; background: var(--surface-2); }
.table-builder-grid tr > :first-child:has(.table-builder-menu[open]) { z-index: 6; }
.table-builder-grid tr > :last-child { border-right: 0; }
.table-builder-grid tbody tr:last-child > * { border-bottom: 0; }
.table-builder-grid td { background: var(--surface); text-align: center; }
.split-cell { display: grid; gap: 6px; }
.split-entry { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 7rem) auto; gap: 6px; align-items: center; }
.split-entry input, .split-entry select { margin: 0; min-width: 0; width: 100%; }
.table-builder-split { display: grid; gap: 4px; font-size: .76rem; font-weight: 400; }
.table-builder-coltype { display: grid; gap: 5px; margin-top: 6px; }
.table-builder-coltype select, .table-builder-coltype input:not([type=checkbox]) { width: 100%; min-height: 32px; margin: 0; padding: 4px 8px; font-size: .78rem; font-weight: 400; }
.table-builder-coltype label { display: flex; align-items: center; gap: 6px; margin: 2px 0 0; color: var(--ink-2); font-size: .75rem; font-weight: 400; line-height: 1.25; cursor: pointer; }
.table-builder-coltype input[type=checkbox] { width: 15px; height: 15px; min-height: 0; margin: 0; flex: 0 0 auto; }
.coltype-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 4px; }
.table-builder-heading { display: flex; align-items: center; gap: 6px; }
.table-builder-heading input { width: 100%; min-width: 0; margin: 0; padding: 8px 10px; border-color: transparent; background: transparent; font-size: .875rem; font-weight: 600; }
.table-builder-heading input:hover, .table-builder-heading input:focus { border-color: var(--line-strong); background: var(--surface); }
.table-builder-heading .table-builder-remove { flex: 0 0 28px; width: 28px; height: 28px; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); font-size: 1.2rem; }
.table-builder-heading .table-builder-grip { flex: 0 0 20px; width: 20px; height: 28px; min-height: 0; margin: 0; padding: 0; border: 0; background: transparent; color: var(--muted); cursor: grab; }
.table-builder-menu { position: relative; flex: 0 0 28px; }
.table-builder-menu summary { list-style: none; width: 28px; height: 28px; line-height: 26px; text-align: center; border-radius: var(--radius-sm); color: var(--muted); cursor: pointer; }
.table-builder-menu summary::-webkit-details-marker { display: none; }
.table-builder-menu summary:hover, .table-builder-menu[open] summary { background: var(--bg); color: var(--ink, inherit); }
.table-builder-menu label { position: absolute; right: 0; top: 32px; z-index: 5; display: flex; gap: 6px; align-items: center; white-space: nowrap; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-pop); font-weight: 400; font-size: .875rem; }
.table-builder-grid .drop-target { box-shadow: inset 0 0 0 2px var(--accent); }
.table-builder-heading .table-builder-remove:hover:not(:disabled) { background: var(--bad-bg); color: var(--bad); }
.table-builder button:disabled { cursor: not-allowed; opacity: .35; }
.table-builder-grid td input:not([type=checkbox]), .table-builder-grid td select { width: 100%; min-width: 120px; margin: 0; padding: 8px 10px; background: var(--surface-2); font-size: .85rem; }
.table-builder-grid td input[type=checkbox] { width: 20px; height: 20px; margin: 8px; }
.table-builder-status { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 12px; color: var(--muted); font-size: .8rem; }
.table-builder-required { margin-top: 18px; }

/* Merged cells, totals and comparisons (builder + fill form) */
.table-builder-grid td[data-r] { position: relative; cursor: cell; user-select: none; }
.table-builder-grid td[data-r] > * { pointer-events: none; }
.table-builder-grid td.is-merged { background: var(--surface-2); }
.table-builder-grid td.is-label strong { font-size: .95rem; color: var(--ink); }
.table-builder-grid td.is-calc { background: var(--info-bg); }
.table-builder-grid td.is-selected { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.table-builder-grid td.is-ref { box-shadow: inset 0 0 0 2px var(--info); background: var(--info-bg); }
.table-builder-grid td.is-ref-check { box-shadow: inset 0 0 0 2px var(--warn); background: var(--warn-bg); }
.table-builder-grid td.is-picked { box-shadow: inset 0 0 0 2px var(--ok); background: var(--ok-bg); }
.table-builder-grid.is-picking td[data-r] { cursor: crosshair; }
.table-builder-grid th.group-cell, .checklist-table th.group-cell { min-width: 110px; width: 110px; background: var(--surface-2); color: var(--ink); font-weight: 600; text-align: center; vertical-align: middle; }
.table-builder-grid.has-groups tr > th.group-cell { position: sticky; left: 0; z-index: 2; }
.table-builder-grid.has-groups tr > th.row-head { position: sticky; left: 110px; z-index: 1; }
.table-builder-grid th.row-head.is-selected, .table-builder-grid th.group-cell.is-selected { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.table-builder-ref.is-row-ref { cursor: pointer; }
.table-builder-ref { flex: 0 0 auto; min-width: 22px; padding: 2px 6px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--ink-2); font-size: .75rem; font-weight: 600; text-align: center; }
.table-builder-msg { min-height: 1.2em; margin: 8px 0 0; color: var(--bad); font-size: .85rem; }
.cell-panel { display: grid; gap: 12px; margin-top: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.cell-panel[hidden] { display: none; }
.cell-panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.cell-panel .cell-kind { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; border: 0; }
.cell-panel .cell-kind legend { padding: 0; margin-bottom: 6px; font-weight: 600; font-size: .85rem; }
.cell-panel [hidden] { display: none; }
.cell-panel .formula-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.cell-panel .formula-bar input { flex: 1 1 220px; min-width: 0; margin: 0; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.cell-panel .formula-fx { padding: 6px 10px; border-radius: var(--radius-sm); background: var(--info-bg); color: var(--info); font-weight: 700; font-style: italic; }
.cell-panel [data-check-fields] { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.cell-panel [data-check-fields] input, .cell-panel [data-check-fields] select { width: auto; flex: 1 1 180px; margin: 0; }
.cell-panel-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: start; }
.cell-panel-row label { margin-top: 0; }
.cell-panel button.is-active { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.cell-unit-tag { position: absolute; top: 19px; right: 18px; padding: 1px 6px; border-radius: var(--radius-sm); background: var(--surface-3); color: var(--muted); font-size: .7rem; font-weight: 600; line-height: 1.2; transform: translateY(-50%); }
.cell-unit-tag.is-own { background: var(--accent-soft); color: var(--ink); }
.table-builder-grid td[data-r]:has(.cell-unit-tag) input:not([type=checkbox]) { padding-right: 44px; }
.calc-chip { display: inline-block; padding: 3px 8px; border-radius: var(--radius-sm); background: var(--info-bg); color: var(--info); font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .8rem; }
.calc-badge { display: block; margin-top: 4px; padding: 2px 8px; border-radius: var(--radius-sm); font-size: .75rem; font-weight: 600; }
.calc-badge-rule { background: var(--surface-2); color: var(--muted); }
.checklist-table td.merged-cell { background: var(--surface-2); vertical-align: middle; }
.checklist-table .table-label { font-size: .95rem; }
.checklist-table .calc-value { display: block; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--info-bg); color: var(--info); font-weight: 700; font-variant-numeric: tabular-nums; }
.checklist-table td.calc-pass .calc-badge { background: var(--ok-bg); color: var(--ok); }
.checklist-table td.calc-fail { box-shadow: inset 0 0 0 2px var(--bad); }
.checklist-table td.calc-fail .calc-badge { background: var(--bad-bg); color: var(--bad); }
.checklist-table td.calc-warn { box-shadow: inset 0 0 0 2px var(--warn); }
.checklist-table td.calc-warn .calc-badge { background: var(--warn-bg); color: var(--warn); }

/* Checklists and forms as spreadsheets (_table.html, _fields_sheet.html, checklist_sheet.js): gridlines, column
   letters + row numbers (the addresses formulas use), one-line cells whose control fills the cell, units in headers. */
.checklist-table-wrap.sheet-wrap { overflow-y: hidden; margin: 1.25rem 0; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.data-table.sheet { border-collapse: separate; border-spacing: 0; font-size: .8125rem; }
.checklist-table.sheet caption, .sheet-title { padding: 10px 12px; border-bottom: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); font-size: .875rem; font-weight: 600; text-align: left; }
.sheet-title { position: sticky; left: 0; }
.data-table.sheet th, .data-table.sheet td { padding: 6px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table.sheet tr > :last-child { border-right: 0; }
.data-table.sheet tbody tr:last-child > * { border-bottom: 0; }
.data-table.sheet tbody tr:hover { background: transparent; }
.data-table.sheet thead th { position: static; background: var(--surface-2); color: var(--ink-2); font-size: .75rem; font-weight: 600; text-align: left; }
.data-table.sheet .sheet-letters th { padding: 2px 6px; background: var(--surface-3); color: var(--muted); font-size: .6875rem; font-weight: 500; text-align: center; }
.data-table.sheet .sheet-rownum { position: sticky; left: 0; z-index: 1; width: 38px; min-width: 38px; padding: 0 6px; background: var(--surface-3); color: var(--muted); font-size: .6875rem; font-weight: 500; text-align: center; font-variant-numeric: tabular-nums; }
.data-table.sheet .is-active-head { background: var(--accent-soft); color: var(--ink); }
.data-table.sheet tbody th[scope=row]:not(.sheet-rownum) { min-width: 150px; background: var(--surface-2); color: var(--ink); font-size: .8125rem; font-weight: 600; }
.sheet-unit-chip { margin-left: 4px; padding: 1px 6px; border-radius: var(--radius-sm); background: var(--surface-3); color: var(--muted); font-size: .6875rem; font-weight: 500; white-space: nowrap; }
.data-table.sheet td { position: relative; min-width: 120px; height: 38px; background: var(--surface); }
.data-table.sheet td:has(> .sheet-cell), .data-table.sheet td.sheet-value:has(.field-control), .data-table.sheet td:has(> .calc-value) { padding: 0; }
.sheet .sheet-cell { padding: 0; border: 0; }
.sheet .field-control { max-width: none; }
.sheet td .field-control > input:not([type=checkbox]):not([type=file]), .sheet td .field-control > select, .sheet td .field-control > textarea {
  display: block; width: 100% !important; max-width: none !important; min-height: 38px; margin: 0; padding: 6px 10px; border: 0; border-radius: 0; background-color: transparent; box-shadow: none; color: var(--ink); font-size: .8125rem; }
.sheet td .field-control > select:not([multiple]) { padding-right: 30px; background-position: right 8px center; }
.sheet td .field-control > textarea { resize: vertical; }
.sheet td .field-control > select[multiple] { min-height: 0; }
.sheet td .field-control > :focus { box-shadow: none; }
.sheet td .field-control > :hover:not(:focus) { background-color: var(--hover); }
.sheet td.is-active { outline: 2px solid var(--accent); outline-offset: -2px; }
.sheet td.is-num input, .sheet td[data-numeric] input, .sheet td.is-num .cell-value { text-align: right; font-variant-numeric: tabular-nums; }
.sheet td.is-num .cell-value { display: block; }
.sheet input[type=number] { appearance: textfield; -moz-appearance: textfield; }
.sheet input[type=number]::-webkit-inner-spin-button, .sheet input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.sheet select.choice-select:has(option[value=Pass]:checked) { color: var(--ok); font-weight: 600; }
.sheet select.choice-select:has(option[value=Fail]:checked) { color: var(--bad); font-weight: 600; }
.sheet .cell-check-label { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; margin: 0; }
.checklist-table.sheet .cell-check-label span { display: none; }
.sheet td .upload-control { padding: 4px 8px; }
.sheet td.is-calc { background: var(--info-bg); }
.sheet tr.row-off > td:not([data-zero-off]) { opacity: .45; background: var(--surface-2); }
.checklist-table.sheet .calc-value { padding: 6px 10px; border-radius: 0; background: transparent; text-align: right; }
.sheet td.is-label { background: var(--surface-2); }
.data-table.sheet tbody th[scope=row]:has([data-dyn-remove]) { white-space: nowrap; }
.sheet th[scope=row] input[name^=dynlabel_] { display: inline-block !important; width: calc(100% - 38px) !important; max-width: none !important; min-width: 90px; min-height: 34px; margin: 0; padding: 4px 8px; vertical-align: middle; }
.sheet th[scope=row] [data-dyn-remove] { width: 30px; min-height: 30px; margin: 0 0 0 4px; padding: 0; vertical-align: middle; }
.data-table.sheet tfoot th, .data-table.sheet tfoot td { border-top: 2px solid var(--line-strong); border-bottom: 0; background: var(--surface-2); color: var(--ink); font-weight: 600; }
.data-table.sheet tfoot td.is-calc { background: var(--info-bg); }
.sheet td.calc-pass { background: var(--ok-bg); }
.sheet td.calc-fail, .sheet td.cell-fail { background: var(--bad-bg); }
.sheet td.calc-warn, .sheet td.cell-warning { background: var(--warn-bg); }
.sheet .calc-badge { display: inline-block; margin: 0 8px 6px; }
.sheet td > .status-badge { margin-left: 6px; }
.sheet .cell-unit { color: var(--muted); font-size: .72rem; }
.sheet td > .cell-unit { position: absolute; top: 19px; right: 8px; z-index: 1; padding: 1px 5px; border-radius: var(--radius-sm); background: var(--surface-3); color: var(--muted); font-size: .6875rem; font-weight: 600; line-height: 1.2; transform: translateY(-50%); pointer-events: none; }
.sheet td:has(> .cell-unit):has(.cell-note) > .cell-unit { right: 24px; }
.sheet td:has(> .cell-unit) .field-control > input:not([type=checkbox]):not([type=file]), .sheet td:has(> .cell-unit) > .calc-value { padding-right: 42px; }
.sheet td:has(> .cell-unit):has(.cell-note) .field-control > input:not([type=checkbox]):not([type=file]) { padding-right: 58px; }
.sheet .cell-split { display: block; }
.sheet .cell-comment { margin: 4px 0 0; color: var(--ink-2); font-size: .75rem; }
.sheet .cell-req { position: absolute; top: 2px; left: 4px; z-index: 1; color: var(--bad); font-size: .7rem; line-height: 1; pointer-events: none; }
/* Expected value: a corner marker (the cell's tooltip says it), like an Excel comment triangle */
.sheet .cell-hint { position: absolute; top: 0; right: 0; width: 0; height: 0; border-style: solid; border-width: 0 8px 8px 0; border-color: transparent var(--info) transparent transparent; pointer-events: none; }
.sheet .sheet-cell:has(.cell-note) .field-control > :not(.cell-check-label):not(.upload-control) { padding-right: 24px; }
.sheet details.cell-note { margin: 0; padding: 0; border-radius: 0; background: transparent; }
.cell-note > summary { position: absolute; right: 3px; bottom: 3px; z-index: 1; padding: 1px 4px; border-radius: var(--radius-sm); color: var(--muted); font-size: .75rem; line-height: 1.2; list-style: none; cursor: pointer; opacity: .6; transition: opacity var(--t), color var(--t), background-color var(--t); }
.cell-note > summary::-webkit-details-marker { display: none; }
.sheet td:hover .cell-note > summary, .cell-note[open] > summary, .cell-note > summary:focus-visible { opacity: 1; color: var(--ink); background: var(--hover); }
.sheet .cell-note[open] .field-support { grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 0; padding: 8px 8px 26px; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.sheet td.is-paste-bad { background: var(--warn-bg); outline: 2px dashed var(--warn); outline-offset: -2px; }
/* the plain-fields sheet: # | Field | Value | Unit | Expected | Note */
.item-search { display: flex; align-items: center; gap: .75rem; margin: 0 0 .75rem; }
.item-search input { flex: 1; min-height: 44px; font-size: 1rem; }
.item-search [data-item-count] { white-space: nowrap; }
.search-hide { display: none !important; }
.fields-sheet .sheet-name { width: 34%; min-width: 180px; }
.fields-sheet .sheet-name .field-label { margin: 0; font-size: .8125rem; }
.fields-sheet .sheet-name small { display: block; margin: 2px 0 0; font-size: .72rem; font-weight: 400; }
.fields-sheet .sheet-value { min-width: 200px; }
.fields-sheet .sheet-value .repayment-preview { margin: 0; padding: 0 10px 6px; }
.fields-sheet td.sheet-unit { width: 72px; min-width: 72px; color: var(--muted); }
.fields-sheet .sheet-expected { min-width: 140px; color: var(--ink-2); font-size: .75rem; }
.fields-sheet .sheet-note, .fields-sheet .sheet-note-head { width: 44px; min-width: 44px; padding: 0; text-align: center; }
.data-table.fields-sheet td.sheet-note { min-width: 44px; padding: 0; }
.fields-sheet .sheet-note:has(.cell-note[open]) { min-width: 280px; }
.fields-sheet .cell-note > summary { position: static; display: block; padding: 10px 0; text-align: center; }
.fields-sheet .cell-note[open] .field-support { padding: 8px; text-align: left; }
.fields-sheet [data-sim-slot]:empty { display: none; }
.execution-panel .fields-sheet tr.field-block { padding: 0; }
.fields-sheet .sim-badge { display: block; margin: 4px; }
/* formula bar + paste status (added by checklist_sheet.js) */
.sheet-bar { position: sticky; left: 0; display: flex; align-items: stretch; border-bottom: 1px solid var(--line-strong); background: var(--surface); font-size: .8125rem; }
.sheet-bar-ref { min-width: 64px; padding: 6px 10px; border-right: 1px solid var(--line); color: var(--ink); font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.sheet-bar-fx { padding: 6px 10px; border-right: 1px solid var(--line); color: var(--info); font-style: italic; font-weight: 700; }
.sheet-bar-content { flex: 1; min-width: 0; padding: 6px 10px; color: var(--ink-2); font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; overflow-wrap: anywhere; }
.sheet-msg { position: sticky; left: 0; margin: 0; padding: 8px 12px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: .78rem; }
.sheet-msg:empty { display: none; }
.sheet-msg.is-bad { background: var(--warn-bg); color: var(--warn); }
@media (max-width: 640px) {
  .fields-sheet thead { display: none; }
  .data-table.fields-sheet, .fields-sheet tbody { display: block; }
  .fields-sheet tr.field-block { display: grid; grid-template-columns: 32px minmax(0, 1fr) 44px; border-bottom: 1px solid var(--line); }
  .fields-sheet tr.field-block:last-child { border-bottom: 0; }
  .data-table.fields-sheet tr.field-block > * { height: auto; border: 0; }
  .fields-sheet tr.field-block > .sheet-rownum { position: static; grid-row: 1 / span 4; width: auto; min-width: 0; }
  .fields-sheet tr.field-block > .sheet-name { grid-column: 2; width: auto; min-width: 0; }
  .fields-sheet tr.field-block > .sheet-note { grid-column: 3; grid-row: 1; width: auto; min-width: 0; }
  .fields-sheet tr.field-block > .sheet-value, .fields-sheet tr.field-block > .sheet-unit, .fields-sheet tr.field-block > .sheet-expected { grid-column: 2 / 4; width: auto; min-width: 0; height: auto; }
  .data-table.fields-sheet tr.field-block > .sheet-value { border-top: 1px solid var(--line); }
  .fields-sheet tr.field-block > .sheet-unit:empty, .fields-sheet tr.field-block > .sheet-expected:empty { display: none; }
  .fields-sheet tr.field-block > .sheet-note:has(.cell-note[open]) { grid-column: 1 / 4; grid-row: auto; min-width: 0; }
  .data-table.sheet .sheet-rownum { width: 26px; min-width: 26px; padding: 0 2px; font-size: 11px; }
  .data-table.sheet td { min-width: 100px; height: 42px; }
  .sheet td .field-control > input:not([type=checkbox]):not([type=file]), .sheet td .field-control > select, .sheet td .field-control > textarea { min-height: 42px; padding: 6px 8px; font-size: .875rem; }
  .sheet td > .cell-unit { top: 21px; }
  .data-table.sheet tbody th[scope=row]:not(.sheet-rownum) { position: sticky; left: 26px; z-index: 1; min-width: 104px; max-width: 136px; padding: 6px 8px; font-size: .78rem; line-height: 1.25; overflow-wrap: break-word; }
  .checklist-table-wrap[data-dynamic="1"] .data-table.sheet tbody th[scope=row]:not(.sheet-rownum) { left: 0; max-width: none; }
  .table-builder-grid th, .table-builder-grid td { min-width: 155px; padding: 8px; }
  .table-builder-grid tr > :first-child { min-width: 160px; max-width: 180px; }
}

/* A split cell in a sheet stacks: answer on top, amount + remove below (three columns overlapped in a narrow cell) */
.sheet .split-cell { padding: 6px; }
.sheet .split-entry { grid-template-columns: minmax(0, 1fr) auto; }
.sheet .split-entry > :first-child { grid-column: 1 / -1; }
.sheet .split-entry input, .sheet .split-entry select { min-height: 34px; padding: 4px 8px; }
.sheet .split-entry [data-split-remove] { min-height: 34px; margin: 0; }
.sheet [data-split-add] { width: 100%; min-height: 34px; margin: 0; }

/* The Preview panel shows the form as employees read it, not the builder's Excel grid: no letters, row numbers or formula bar */
.document-preview-document .sheet-letters, .document-preview-document .sheet-rownum, .document-preview-document .sheet-bar, .document-preview-document .sheet-title { display: none; }
.document-preview-document .checklist-table-wrap.sheet-wrap { border: 0; border-radius: 0; background: transparent; }
.document-preview-document .checklist-table.sheet caption { display: table-caption; caption-side: top; padding: 0 0 8px; border: 0; background: transparent; }
.document-preview-document .data-table.sheet th, .document-preview-document .data-table.sheet td { border-right: 0; padding: 8px 10px; }
@media (max-width: 640px) {
  .document-preview-document .fields-sheet tr.field-block { grid-template-columns: minmax(0, 1fr) 44px; }
  .document-preview-document .fields-sheet tr.field-block > .sheet-name { grid-column: 1; }
  .document-preview-document .fields-sheet tr.field-block > .sheet-note { grid-column: 2; }
  .document-preview-document .fields-sheet tr.field-block > .sheet-value, .document-preview-document .fields-sheet tr.field-block > .sheet-unit, .document-preview-document .fields-sheet tr.field-block > .sheet-expected { grid-column: 1 / 3; }
}

/* SOP / rich text */
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 6px; }
.editor-toolbar button { margin: 0; padding: 4px 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-size: .8125rem; font-weight: 500; }
.editor-toolbar button:hover { background: var(--hover); border-color: var(--line-strong); color: var(--ink); }
.rich-editor { min-height: 240px; padding: 14px; overflow-y: auto; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.rich-editor table, .sop-body table { display: block; max-width: 100%; margin: 8px 0; overflow-x: auto; border-collapse: collapse; }
.rich-editor td, .sop-body td, .rich-editor th, .sop-body th { padding: 6px 10px; border: 1px solid var(--line-strong); }
.sop-body img { max-width: 100%; border-radius: var(--radius); }
.sop-body { max-width: 72ch; margin-bottom: 18px; line-height: 1.65; }
.sop-body h2, .sop-body h3 { margin: 1.2em 0 .4em; font-weight: 600; letter-spacing: -.01em; }

/* Assignment board, calendars, week strip */
.board-toolbar { margin-bottom: 16px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-card); }
.board-context { color: var(--muted); font-size: .8125rem; font-weight: 500; }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 16px; }
.week-day { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 68px; padding: 8px 6px; border: 1px solid transparent; border-radius: var(--radius); background: var(--surface-2); color: inherit; text-decoration: none; transition: background-color var(--t), border-color var(--t); }
.week-day:hover { background: var(--hover); text-decoration: none; }
.week-day.today { border-color: var(--accent); }
.week-day.selected { border-color: var(--accent); background: var(--accent-fill); color: #fff; }
.week-day.selected .muted { color: rgba(255, 255, 255, .85); }
.week-day-name { font-size: .65rem; font-weight: 600; opacity: .75; }
.week-day-num { font-size: .84rem; font-weight: 600; }
.week-day .cal-pct { margin-top: 3px; font-size: .72rem; }
.week-day.selected .cal-pct { color: #fff; }
.shift-board-section { margin-bottom: 16px; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-card); }
.shift-board-heading { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.shift-board-heading h2 { margin: 0; font-size: 1.05rem; }
.shift-time { padding: 4px 10px; border-radius: var(--radius-sm); background: var(--hover); color: var(--ink-2); font-size: .76rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.slot-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); gap: 1px; padding: 1px; background: var(--line); }
.slot-group { min-height: 160px; padding: 16px; border: 0; border-radius: 0; background: var(--surface); }
.slot-group-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: .86rem; font-weight: 600; }
.slot-count { min-width: 28px; padding: 1px 7px; border-radius: 999px; background: var(--hover); color: var(--muted); font-size: .68rem; text-align: center; }
.slot-chip { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.slot-chip .inline-form { margin: 0; }
.slot-chip.filled { min-height: 40px; padding: 5px 7px; border: 0; border-radius: var(--radius); background: var(--surface-2); }
.slot-chip.filled a { flex: 1; color: var(--ink); font-size: .83rem; font-weight: 500; }
.slot-chip.open { align-items: stretch; gap: 6px; }
.slot-chip.open select { width: 100%; min-width: 0; height: 34px; min-height: 34px; margin: 0; font-size: .78rem; }
.slot-open-note { display: block; margin: -2px 0 0 2px; color: var(--muted); font-size: .72rem; }
.slot-avatar { display: inline-flex; flex: 0 0 28px; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-hover); font-size: .69rem; font-weight: 700; }
.slot-remove { flex: 0 0 auto; width: 28px; height: 28px; min-height: 28px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 1rem; line-height: 1; }
.slot-remove:hover { background: var(--bad-bg); color: var(--bad); }
.slot-inputs { display: flex; flex-wrap: wrap; gap: 14px 20px; margin-top: 6px; }
.slot-inputs label.inline { flex-direction: column; align-items: flex-start; gap: 4px; margin-right: 0; }
.slot-inputs input { width: 70px !important; margin: 0 !important; }
.unslotted-note { margin: 0; padding: 14px 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.cal-period { padding: 0 4px; font-weight: 600; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-weekday { padding: 0 2px 4px; color: var(--muted); font-size: .72rem; font-weight: 600; }
.cal-day { display: flex; flex-direction: column; gap: 6px; min-height: 104px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: inherit; text-decoration: none; transition: background-color var(--t), border-color var(--t); }
.cal-day:hover { border-color: var(--line-strong); background: var(--surface-2); text-decoration: none; }
.cal-day.is-today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-day.other-month { opacity: .45; }
.cal-day.cal-day-off { border-color: var(--ok-line); background: var(--ok-bg); }
.cal-day-num { font-size: .95rem; font-weight: 600; }
.cal-pct { align-self: flex-start; font-size: 1rem; font-weight: 700; }
.cal-pct.pct-ok { color: var(--ok); }
.cal-pct.pct-warn { color: var(--warn); }
.cal-pct.pct-bad { color: var(--bad); }
.cal-pct-detail { font-size: .78rem; }
.cal-shift-chip { display: block; padding: 3px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--ink); font-size: .78rem; font-weight: 500; }
.cal-shift-chip:hover { border-color: var(--line-strong); }

/* Employee home & Redesigned Workspace */
.my-work-page { width: 100%; margin-inline: auto; }
.my-work-page .panel { margin-bottom: 14px; }
.work-hero { padding: 16px 18px; }
.work-hero .hero { align-items: center; }
.work-hero h1 { margin: 0; font-size: clamp(1.4rem, 2.2vw, 1.75rem); }
.work-eyebrow, .section-kicker { margin: 0 0 4px; color: var(--muted); font-size: .72rem; font-weight: 600; }
.work-date { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; }
.work-date .nav-icon { width: 14px; height: 14px; }
.work-date span { color: var(--champagne); }
.shift-summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.shift-status { display: inline-flex; align-items: center; gap: 6px; align-self: center; padding: 6px 13px; border-radius: 999px; background: var(--surface); color: var(--ink); font-size: .78rem; font-weight: 700; box-shadow: var(--shadow-card); }
.shift-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok-fill); }
.shift-link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 148px; min-height: 44px; padding: 8px 18px; border: 1px solid var(--gold); border-radius: var(--radius); background: var(--gold); color: var(--rail-active-ink); font-size: .84rem; font-weight: 700; text-align: center; box-shadow: var(--shadow-gold); transition: background-color var(--t), border-color var(--t); }
.shift-link:hover { background: var(--gold-hover); border-color: var(--gold-hover); color: var(--rail-active-ink); text-decoration: none; }
.shift-link span { font-size: .72rem; opacity: .88; }
.shift-link strong { font-size: .84rem; }
.shift-link.secondary { border: 1px solid var(--hero-photo-line); background: var(--hero-photo-tile); color: #fff; box-shadow: none; }
.shift-link.secondary:hover { border-color: var(--gold); background: var(--rail-bg-deep); color: #fff; }

/* Restrained Branded Hero Banner */
.hero-banner {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  min-height: 92px; margin-bottom: 16px; padding: 16px 22px; overflow: hidden;
  border: 1px solid var(--rail-line); border-radius: var(--radius-lg);
  background: var(--hero-for-me); color: #fff; box-shadow: var(--shadow-card);
}
.hero-banner-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero-banner-bg-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center right;
  pointer-events: none; z-index: 0; opacity: .28;
}
.hero-banner::after {
  content: ""; position: absolute; inset: 0;
  background: var(--hero-photo-fade); transform: scaleX(-1);
  opacity: .72; pointer-events: none; z-index: 0;
}
.hero-banner.hero-executive { background: var(--hero-executive); color: #fff; border-color: var(--rail-line); }
.hero-banner.hero-executive h1, .hero-banner.hero-executive .hero-meta-item { color: #fff; }
.hero-banner.hero-executive .hero-meta-item svg { stroke: var(--gold); }
.hero-banner-copy { position: relative; z-index: 2; max-width: 600px; }
.hero-banner-copy .work-eyebrow { color: var(--gold); font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 4px; }
.hero-banner-copy h1 { margin: 0; font-family: var(--display); font-size: clamp(1.35rem, 2vw, 1.7rem); font-weight: 700; letter-spacing: -.015em; color: #fff; }
.hero-banner-copy h1 .hero-name { color: var(--gold); }
.hero-meta-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; font-size: .8125rem; font-weight: 500; color: var(--hero-photo-muted); }
.hero-meta-item { display: inline-flex; align-items: center; gap: 6px; color: #fff; }
.hero-meta-item .nav-icon { width: 14px; height: 14px; opacity: 1; color: var(--gold); stroke: var(--gold); }
.hero-meta-sep { color: var(--champagne); opacity: .5; }
.hero-banner-art { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; margin-inline: auto; pointer-events: none; }
.hero-banner-art svg { display: block; width: 250px; height: 108px; }
.hero-banner-actions { position: relative; z-index: 2; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.btn-gold {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; margin: 0; padding: 6px 14px; border: 1px solid var(--gold-hover); border-radius: var(--radius-sm);
  background: var(--btn-gold-grad); color: var(--rail-active-ink); font-size: .8125rem; font-weight: 700;
  box-shadow: var(--shadow-gold); text-decoration: none; cursor: pointer; transition: background-color var(--t), border-color var(--t);
}
.btn-gold:hover { background: var(--btn-gold-hover-grad); border-color: var(--gold-hover); color: var(--rail-active-ink); text-decoration: none; }
.bento-head-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 32px; padding: 4px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font-size: .78rem; font-weight: 600; text-decoration: none;
  transition: background-color var(--t), border-color var(--t), color var(--t);
}
.bento-head-btn:hover { background: var(--surface-3); border-color: var(--line-hover); color: var(--ink); text-decoration: none; }
.bento-head-btn .nav-icon { width: 14px; height: 14px; color: var(--ink-2); }
.task-row-title { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; color: var(--ink); }
.task-row-icon {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 28px;
  width: 28px; height: 28px; border-radius: var(--radius-sm); background: var(--surface-3); border: 1px solid var(--line); color: var(--ink-2);
}
.task-row-icon .nav-icon { width: 14px; height: 14px; opacity: 1; }
.scope-badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 2px 8px; border-radius: var(--radius-sm); background: var(--surface-3); border: 1px solid var(--line);
  color: var(--ink-2); font-size: .74rem; font-weight: 600;
}
.due-cell { display: inline-flex; align-items: center; gap: 5px; font-weight: 500; color: var(--ink-2); }
.due-cell .nav-icon { width: 14px; height: 14px; color: var(--muted); }
.due-cell.is-overdue { color: var(--bad); font-weight: 600; }
.due-cell.is-overdue .nav-icon { color: var(--bad); }
.meta-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 16px; margin: 14px 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.meta-item { min-width: 0; }
.meta-label { display: block; color: var(--muted); font-size: .6875rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.meta-value { display: block; margin-top: 2px; color: var(--ink); font-size: .84rem; font-weight: 600; overflow-wrap: anywhere; }
.row-chevron {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink-2); font-weight: 700; font-size: .85rem;
}
.data-table tbody tr:hover .row-chevron { background: var(--surface-3); border-color: var(--line-strong); color: var(--ink); }

/* 4-Card Compact Enterprise KPI Strip */
.kpi-strip-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi-summary-card {
  position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  min-height: 92px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-card); color: var(--ink); text-decoration: none;
  transition: border-color var(--t), background-color var(--t); overflow: hidden;
}
a.kpi-summary-card:hover { text-decoration: none; border-color: var(--line-strong); background: var(--surface-2); }
.kpi-summary-card.tint-emerald { border-left: 3px solid var(--tint-emerald-accent); }
.kpi-summary-card.tint-amber { border-left: 3px solid var(--tint-amber-accent); }
.kpi-summary-card.tint-rose { border-left: 3px solid var(--tint-rose-accent); }
.kpi-summary-card.tint-purple { border-left: 3px solid var(--tint-purple-accent); }
.kpi-summary-card.tint-blue { border-left: 3px solid var(--tint-blue-accent); }
.kpi-summary-left { display: flex; align-items: flex-start; gap: 12px; min-width: 0; width: 100%; }
.kpi-summary-icon {
  display: inline-flex; flex: 0 0 36px; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--surface-3); color: var(--ink-2);
}
.tint-emerald .kpi-summary-icon { background: var(--tint-emerald-icon); color: var(--tint-emerald-ink); }
.tint-amber .kpi-summary-icon { background: var(--tint-amber-icon); color: var(--tint-amber-ink); }
.tint-rose .kpi-summary-icon { background: var(--tint-rose-icon); color: var(--tint-rose-ink); }
.tint-purple .kpi-summary-icon { background: var(--tint-purple-icon); color: var(--tint-purple-ink); }
.tint-blue .kpi-summary-icon { background: var(--tint-blue-icon); color: var(--tint-blue-ink); }
.kpi-summary-icon .nav-icon { width: 18px; height: 18px; opacity: 1; }
.kpi-summary-copy { min-width: 0; flex: 1; }
.kpi-summary-label { display: block; color: var(--muted); font-size: .76rem; font-weight: 600; line-height: 1.25; }
.kpi-summary-value { display: block; margin-top: 2px; color: var(--ink); font-size: 1.55rem; font-weight: 700; line-height: 1.1; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.kpi-summary-value small { color: var(--muted); font-size: 1rem; font-weight: 600; }
.kpi-summary-sub { display: block; margin-top: 3px; color: var(--muted); font-size: .72rem; font-weight: 500; }
.kpi-summary-pill {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; padding: 2px 8px;
  border-radius: var(--radius-sm); background: var(--surface-3); font-size: .7rem; font-weight: 600; white-space: nowrap;
}
.kpi-summary-pill.pill-bad { background: var(--bad-bg); color: var(--bad); }
.kpi-summary-pill.pill-warn { background: var(--warn-bg); color: var(--warn); }
.kpi-summary-pill.pill-ok { background: var(--surface-3); color: var(--ink-2); }
.kpi-ring-wrap { position: relative; flex: 0 0 62px; width: 62px; height: 62px; display: inline-flex; align-items: center; justify-content: center; }
.kpi-ring-svg { width: 62px; height: 62px; transform: rotate(-90deg); }
.kpi-ring-track { fill: none; stroke: var(--track); stroke-width: 6; }
.kpi-ring-fill { fill: none; stroke: var(--tint-emerald-accent); stroke-width: 6; stroke-linecap: round; }
.kpi-ring-label { position: absolute; color: var(--ink); font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-summary-art { flex: 0 0 52px; display: flex; align-items: center; justify-content: center; }


/* 2-Column Main Bento Workspace */
.bento-main-col { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.bento-panel { margin: 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-card); }
.bento-panel-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.bento-panel-title { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-family: var(--display); font-size: 1rem; font-weight: 700; color: var(--heading); }
.bento-title-icon { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: var(--radius-sm); background: var(--surface-3); color: var(--ink-2); }
.bento-title-icon .nav-icon { width: 15px; height: 15px; opacity: 1; }
.bento-head-link { display: inline-flex; align-items: center; gap: 5px; color: var(--accent); font-size: .8125rem; font-weight: 600; text-decoration: none; }
.bento-head-link:hover { color: var(--accent-hover); text-decoration: underline; }
.bento-head-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }

/* Tabbed My Tasks Table */
.task-tabs-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.task-tab-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; margin: 0; padding: 5px 12px;
  border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--muted);
  font-size: .8rem; font-weight: 600; cursor: pointer; transition: background-color var(--t), color var(--t), border-color var(--t);
}
.task-tab-btn + .task-tab-btn { margin-left: 0; }
.task-tab-btn:hover { background: var(--hover); color: var(--ink); border-color: transparent; }
.task-tab-btn.is-active { background: var(--surface-3); border-color: var(--line-strong); color: var(--ink); }
.task-tab-btn.tab-overdue { color: var(--bad); }
.task-tab-btn.tab-overdue.is-active { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); }
.task-filter-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.task-filter-search { flex: 1 1 200px; min-height: 36px; margin: 0; padding: 6px 12px; font-size: .8125rem; }
.task-filter-select { min-height: 36px; margin: 0; padding: 6px 32px 6px 10px; font-size: .8rem; }
.priority-pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: .72rem; font-weight: 600; white-space: nowrap; }
.priority-high, .priority-urgent { border-color: var(--bad-line); background: var(--bad-bg); color: var(--bad); }
.priority-high::before, .priority-urgent::before { content: "▲"; font-size: .58rem; line-height: 1; }
.priority-medium { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn); }
.priority-medium::before { content: "●"; font-size: .55rem; line-height: 1; }
.priority-low { border-color: var(--tint-blue-border); background: var(--info-bg); color: var(--info); }
.priority-low::before { content: "▼"; font-size: .58rem; line-height: 1; }
.priority-routine { border-color: var(--line); background: var(--surface-2); color: var(--muted); }
.task-progress-wrap { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.task-progress-pct { min-width: 30px; color: var(--ink-2); font-size: .76rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.task-progress-bar { flex: 1; height: 6px; overflow: hidden; border-radius: 4px; background: var(--track); }
.task-progress-fill { height: 100%; border-radius: 4px; background: var(--ok-fill); }
.task-progress-fill.is-amber { background: var(--amber); }

/* Bottom Split Row: Approvals & Kitchen Snapshot */
.approval-feed { display: flex; flex-direction: column; gap: 10px; }
.approval-row-card {
  display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2);
  transition: border-color var(--t), background-color var(--t);
}
.approval-row-card:hover { border-color: var(--line-strong); background: var(--surface); }
.approval-row-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; background: var(--tint-amber-solid); color: var(--tint-amber-ink); }
.approval-row-icon .nav-icon { width: 18px; height: 18px; opacity: 1; }
.approval-row-copy { min-width: 0; }
.approval-row-copy strong { display: block; color: var(--ink); font-size: .84rem; font-weight: 700; overflow-wrap: anywhere; }
.approval-row-copy small { display: block; margin-top: 2px; color: var(--muted); font-size: .73rem; overflow-wrap: anywhere; }
.approval-row-actions { display: flex; align-items: center; gap: 8px; }
.btn-review {
  display: inline-flex; align-items: center; justify-content: center; min-height: 30px; margin: 0; padding: 4px 12px;
  border: 1px solid var(--gold); border-radius: var(--radius-sm); background: var(--gold); color: var(--rail-active-ink);
  font-size: .76rem; font-weight: 700; text-decoration: none;
}
.btn-review:hover { background: var(--gold-hover); border-color: var(--gold-hover); color: var(--rail-active-ink); text-decoration: none; }



.work-section { padding: 16px 20px; }
.my-work-page .empty { padding: 8px 0; }
.work-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 2px 10px; }
.work-section-heading h2 { margin: 0; font-size: 1rem; }
.work-section-heading > a { margin-bottom: 1px; font-size: .78rem; font-weight: 600; }
.work-list-toggle { width: auto; min-height: 0; margin: 0 0 1px; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--accent); font-size: .78rem; font-weight: 600; }
.work-list-toggle:hover { background: transparent; color: var(--accent-hover); text-decoration: underline; }
.capped-list:not(.is-expanded) > :nth-child(n + 5) { display: none; }
.work-heading-links { display: flex; align-items: flex-end; gap: 16px; }
.panel > .work-list-toggle { margin-top: 10px; }
.my-work-page .task-cards { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; }
.my-work-page .task-card { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 68px; padding: 11px 14px; }
.task-card-icon { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: var(--radius); background: var(--tint-amber-solid); color: var(--tint-amber-ink); }
.task-card-icon .nav-icon { width: 20px; height: 20px; }
.task-card-icon-alert { background: var(--bad-bg); color: var(--bad); }
.task-card-copy { min-width: 0; }
.my-work-page .task-card-title { margin: 0; font-size: .85rem; font-weight: 700; overflow-wrap: anywhere; }
.my-work-page .task-card-meta { margin: 4px 0 0; font-size: .73rem; }
.my-work-page .task-card-action { align-self: center; margin: 0; padding: 6px 12px; border-radius: var(--radius-sm); background: var(--gold); color: var(--rail-active-ink); font-size: .74rem; font-weight: 700; white-space: nowrap; }
.sop-task-cards .task-card { grid-template-columns: 42px minmax(0, 1fr) auto; }
.work-flow { padding: 14px 18px; }
.work-flow summary { display: flex; align-items: center; justify-content: space-between; font-size: .82rem; font-weight: 700; list-style: none; }
.work-flow summary::-webkit-details-marker { display: none; }
.work-flow summary span { color: var(--gold-ink); font-size: .74rem; font-weight: 700; }
.work-flow[open] summary { margin-bottom: 14px; }

.form-panel { max-width: 900px; margin-inline: auto; }
.form-panel .field-block { display: grid; grid-template-columns: minmax(160px, 220px) minmax(0, 1fr); align-items: start; gap: 10px 18px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.form-panel .field-block label { padding-top: 10px; }
.form-panel .field-block small, .form-panel .field-block .error { grid-column: 2; color: var(--muted); font-size: .75rem; }
.form-panel .field-block .error { color: var(--bad); }
.form-panel input, .form-panel select, .form-panel textarea { width: 100%; margin: 0; }

/* ---- auth ---- */
main.auth-main { display: grid; place-items: center; padding: clamp(24px, 5vw, 64px); }
.auth-main .app-content { display: grid; place-items: center; }
/* The one glass card in the content layer: it sits alone on the strong ambient, so the frost has something to show. */
form.login-form { width: min(440px, 100%); max-width: none; margin: 0; padding: 38px; border: 1px solid var(--line-strong); border-radius: var(--radius-xl); background: var(--glass-bg); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--highlight), var(--shadow-pop); }
form.login-form h1 { margin: 0 0 6px; font-size: 1.9rem; }
form.login-form .sub { margin: 0 0 24px; color: var(--muted); font-size: .9375rem; }
form.login-form input { width: 100%; }
form.login-form button { width: 100%; min-height: 44px; margin-top: 20px; border-color: var(--accent-fill); background: var(--accent-fill); color: #fff; box-shadow: var(--shadow-red); font-size: .9375rem; font-weight: 700; }
form.login-form button:hover { border-color: var(--deep-red); background: var(--deep-red); color: #fff; }

/* ---- tablet: sidebar becomes an off-canvas drawer, bottom nav appears ---- */
@media (max-width: 1024px) {
  .shell { display: block; }
  .topbar { display: none; }
  /* The nav box stays flush with the viewport bottom (tests measure it); the glass pill is its ::before. */
  .mobile-bottom-nav { position: fixed; inset: auto 0 0; z-index: 900; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; height: calc(76px + env(safe-area-inset-bottom, 0px)); padding: 10px max(18px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px)); }
  .mobile-bottom-nav::before { content: ""; position: absolute; inset: 4px max(10px, env(safe-area-inset-right, 0px)) calc(4px + env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px)); z-index: -1; border-radius: 999px; background: var(--glass-bg); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--highlight), var(--shadow-pop); }
  .mobile-bottom-nav a, .mobile-bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 56px; padding: 6px 8px; border-radius: 999px; color: var(--muted); font-size: .72rem; font-weight: 600; line-height: 1.2; text-decoration: none; transition: background-color var(--t), color var(--t); }
  /* The Menu tab is a button: drop the global button chrome so it matches the links. */
  .mobile-bottom-nav button { margin: 0; border: 0; background: transparent; font-family: inherit; box-shadow: none; cursor: pointer; }
  .mobile-bottom-nav a:hover, .mobile-bottom-nav button:hover { background: var(--hover); color: var(--ink); }
  .mobile-bottom-nav a.active { background: var(--gold-soft); color: var(--gold-ink); font-weight: 800; }
  .mobile-bottom-nav .nav-icon { flex: 0 0 22px; width: 22px; height: 22px; }
  .mobile-bottom-nav a.active .nav-icon { opacity: 1; }
  body:has(.mobile-bottom-nav) main { padding-bottom: calc(124px + env(safe-area-inset-bottom, 0px)); }
  .mobile-header { position: fixed; inset: 0 0 auto; z-index: 900; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; height: calc(56px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) max(10px, env(safe-area-inset-right, 0px)) 0 max(10px, env(safe-area-inset-left, 0px)); background: var(--glass-dark); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
  .mobile-nav-toggle { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 42px; height: 42px; min-height: 42px; margin: 0; padding: 0; border: 0; background: transparent; }
  .mobile-nav-toggle:hover { background: var(--rail-hover); }
  .mobile-nav-toggle span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--rail-ink); }
  .mobile-brand { justify-self: center; display: flex; align-items: baseline; gap: 7px; color: #fff; text-decoration: none; }
  .mobile-brand:hover { text-decoration: none; }
  .mobile-brand strong { font-size: .95rem; font-weight: 700; letter-spacing: -.02em; }
  .mobile-brand span { color: var(--rail-muted); font-size: .68rem; font-weight: 600; }
  .mobile-actions { justify-self: end; display: flex; align-items: center; }
  .mobile-search { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; min-height: 42px; margin: 0; padding: 0; border: 0; border-radius: var(--radius); background: transparent; color: var(--rail-ink); transition: background-color var(--t); }
  .mobile-search .nav-icon { width: 21px; height: 21px; opacity: 1; }
  .mobile-search:hover { background: var(--rail-hover); }
  .mobile-notifications { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: var(--radius); color: var(--rail-ink); transition: background-color var(--t); }
  .mobile-notifications:hover { background: var(--rail-hover); }
  .mobile-notifications span { position: absolute; top: 4px; right: 3px; display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 4px; border: 2px solid var(--rail-bg); border-radius: 999px; background: var(--gold); color: var(--rail-active-ink); font-size: .58rem; font-weight: 700; }
  .rail-backdrop { position: fixed; inset: 0; z-index: 950; display: block; visibility: hidden; margin: 0; padding: 0; border: 0; border-radius: 0; background: var(--scrim); opacity: 0; transition: opacity 150ms ease-out, visibility 150ms; }
  .rail-backdrop:hover { background: var(--scrim); }
  .rail, .rail.is-collapsed { position: fixed; inset: 0 auto 0 0; z-index: 1000; display: flex; width: min(300px, calc(100vw - 48px)); height: 100dvh; margin: 0; overflow: hidden; border-radius: 0 var(--radius-xl) var(--radius-xl) 0; transform: translateX(-102%); transition: transform 150ms ease-out; }
  /* Off-canvas the rail slides over content, so it is dark glass here. */
  .rail { background: var(--glass-dark); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
  body.nav-open .rail { transform: translateX(0); box-shadow: var(--highlight-dark), var(--shadow-pop); }
  body.nav-open .rail-backdrop { visibility: visible; opacity: 1; }
  .rail .brand, .rail.is-collapsed .brand { justify-content: space-between; min-height: 72px; padding: calc(20px + env(safe-area-inset-top, 0px)) 14px 10px max(20px, env(safe-area-inset-left, 0px)); }
  .rail .brand-copy, .rail.is-collapsed .brand-copy { display: block; }
  .rail-toggle { display: none; }
  .rail nav, .rail.is-collapsed nav { display: block; flex: 1; padding: 6px 12px 16px max(12px, env(safe-area-inset-left, 0px)); overflow-x: hidden; overflow-y: auto; }
  .rail nav a, .rail.is-collapsed nav a, .rail nav .nav-disabled, .rail.is-collapsed nav .nav-disabled { justify-content: flex-start; width: 100%; height: auto; min-height: 46px; margin: 2px 0; padding: 10px 12px; white-space: normal; }
  .rail.is-collapsed nav a > span:not(.count), .rail.is-collapsed nav .nav-disabled > span { display: inline; }
  .rail.is-collapsed nav .group { display: flex; min-height: 44px; }
  .rail.is-collapsed nav a.nav-folded { display: none; }
  .rail.is-collapsed nav > a:not([data-pin-toggle], .nav-folded), .rail.is-collapsed nav > .nav-disabled { display: flex; }
  .rail.is-collapsed .count { position: static; margin: 0 0 0 auto; }
  .rail .me, .rail.is-collapsed .me { justify-content: flex-start; min-height: 0; margin: 0 20px; padding: 16px 0 calc(16px + env(safe-area-inset-bottom, 0px)); }
  .rail.is-collapsed .me-copy { display: block; }
  main { min-height: 100dvh; padding: calc(76px + env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-right, 0px)) calc(52px + env(safe-area-inset-bottom, 0px)) max(24px, env(safe-area-inset-left, 0px)); }
  .metric-row, .kpi-strip-4, .setup-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: 1fr; }
  .page-header { align-items: flex-start; }
  .hero-banner-art { display: none; }
}
@media (max-width: 900px) {
  .hero, .hero-banner { align-items: flex-start; flex-direction: column; }
  .hero-banner-actions { margin-left: 0; width: 100%; }
  .page-header { align-items: flex-start; flex-direction: column; margin-bottom: 20px; }
  .page-header .actions { flex-wrap: wrap; }
  .panel, .bento-panel { padding: 18px; }
  .org-workspace { padding-top: 2px; }
  .org-workspace .row-between { padding-bottom: 14px; }
  .org-workspace .org-chart-wrap { min-height: 360px; margin-inline: -4px; padding: 18px 8px; }
  .cal-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .cal-day { min-height: 56px; padding: 6px; font-size: .82rem; }
  .cal-weekday { display: none; }
  .board-toolbar { padding: 16px; }
  .board-toolbar .row-between { align-items: flex-start; }
  .board-context { display: none; }
  .filter-bar { width: 100%; }
  .filter-bar label { flex: 1 1 180px; }
  .filter-bar input, .filter-bar select { width: 100%; min-width: 0; }
  .shift-board-heading { padding: 16px; }
  .request-group { padding: 16px; }
  .execution-panel { max-width: none; padding: 0 20px; }
  .field-support { grid-template-columns: 1fr; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .form-actions > .danger { align-self: flex-start; }
}
@media (max-width: 760px) {
  .form-panel .field-block { grid-template-columns: 1fr; gap: 5px; }
  .form-panel .field-block label { padding: 0; }
  .form-panel .field-block small, .form-panel .field-block .error { grid-column: auto; }
}
@media (max-width: 700px) {
  .week-strip { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .week-day { padding: 6px 3px; font-size: .78rem; }
  .week-day-name { font-size: .62rem; }
  .list-toolbar { align-items: stretch; }
  .list-toolbar label, .list-toolbar select, .list-toolbar input { width: 100%; }
  .pagination { align-items: flex-start; flex-direction: column; }
  .table-builder-settings { grid-template-columns: 1fr; gap: 4px; }
  .table-builder-grid tr > :first-child { min-width: 170px; }
  .table-builder-grid th, .table-builder-grid td { min-width: 170px; padding: 8px; }
  .doc-head .actions { width: 100%; }
  .doc-head .actions .btn { flex: 1; text-align: center; }
  .doc-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .doc-filters select { width: 100%; min-width: 0; }
  .doc-filters .status-badge, .doc-filters > span, .doc-filters > a { grid-column: 1 / -1; }
  .doc-table.responsive-table tr { display: grid; grid-template-columns: 1fr 1fr; }
  .doc-table.responsive-table td { display: block; padding: 8px 12px; border-bottom: 0; }
  .doc-table.responsive-table td::before { display: block; margin-bottom: 2px; }
  .doc-table.responsive-table td:nth-child(3) { grid-column: 1 / -1; order: -1; padding-top: 12px; font-weight: 600; }
  .doc-table.responsive-table td:nth-child(3)::before, .doc-table.responsive-table td:nth-child(2), .doc-table.responsive-table td:nth-child(8) { display: none; }
  .doc-table.responsive-table td:nth-child(9) { grid-column: 1 / -1; padding-top: 0; }
  .doc-table.responsive-table td:nth-child(9):not(:has(form)) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
/* Hand-off sheets: steps are numbered dots whose colour follows the step's position (1 red, 2 gold, 3 deep red, 4 grey,
   then again). The same number and colour mark the columns each step fills, so "whose column is this" is one glance. */
[data-step="1"], [data-step="5"] { --step: var(--primary-red); --step-ink: #fff; }
[data-step="2"], [data-step="6"] { --step: var(--gold); --step-ink: var(--on-gold); }
[data-step="3"], [data-step="7"] { --step: var(--deep-red); --step-ink: #fff; }
[data-step="4"], [data-step="8"] { --step: var(--muted); --step-ink: #fff; }
.step-dot { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 999px; background: var(--step, var(--line-strong)); color: var(--step-ink, var(--ink)); font-size: 12px; font-weight: 700; line-height: 1; }
.sheet th[data-step] { box-shadow: inset 0 -3px 0 var(--step); }
.handoff-stepper { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.handoff-step { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 12px 6px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.handoff-step .step-dot { min-width: 32px; height: 32px; font-size: 14px; }
.handoff-step-text { display: grid; line-height: 1.2; }
.handoff-step-text strong { color: var(--heading); }
.handoff-step.is-next .step-dot { background: var(--surface); color: var(--muted); box-shadow: inset 0 0 0 2px var(--step); }
.handoff-step.is-now { border-color: var(--step, var(--accent)); background: var(--surface); color: var(--ink); box-shadow: 0 0 0 2px var(--ring); }
.handoff-step.is-done .step-dot, .handoff-step.is-approval.is-done .step-dot { background: var(--ok-fill); color: #fff; }
.handoff-step.is-approval .step-dot { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 2px var(--line-strong); }
.handoff-sent-back { margin: 0 0 16px; padding: 10px 14px; border: 1px solid var(--warn-line); border-radius: var(--radius); background: var(--warn-bg); color: var(--ink); }
button.handoff-go { min-height: 48px; padding-inline: 22px; font-size: 16px; }
.handoff-send-back { margin-top: 12px; }
.handoff-send-back > summary { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); cursor: pointer; list-style: none; }
.handoff-send-back form { display: grid; gap: 8px; max-width: 520px; margin-top: 8px; }
.product-pick { position: relative; max-width: 520px; margin-top: 8px; }
.product-pick input[type="search"] { width: 100%; min-height: 44px; }
.product-pick-results { display: grid; margin-top: 4px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-card); }
.product-pick-results:not(:has(button)) { padding: 10px 12px; color: var(--muted); }
.product-pick-option { display: flex; justify-content: space-between; gap: 12px; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 0; background: transparent; color: var(--ink); text-align: left; box-shadow: none; }
.product-pick-option:hover, .product-pick-option:focus-visible { background: var(--hover); color: var(--ink); }
.product-pick-option small { color: var(--muted); }
.product-row > span { display: inline-block; margin-right: 6px; }
.handoff-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.handoff-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color 120ms; }
.handoff-row:hover { border-color: var(--line-hover); text-decoration: none; }
.handoff-row-main { display: grid; gap: 2px; min-width: 0; }
.handoff-row-main strong { color: var(--heading); overflow-wrap: anywhere; }
.handoff-row-main small { color: var(--muted); }
.handoff-row-now { display: inline-flex; align-items: center; gap: 6px; flex: none; font-weight: 600; }
/* the simple builder */
.hb-section h2 { display: flex; align-items: center; gap: 10px; }
.hb-num { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 999px; background: var(--accent-fill); color: #fff; font-size: 16px; }
.hb-name { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.hb-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.hb-step { display: flex; align-items: center; gap: 8px; padding: 6px; border: 2px solid var(--step); border-radius: var(--radius-xl); background: var(--surface); }
.hb-step .step-dot, .hb-lock { min-width: 32px; height: 32px; font-size: 15px; }
.hb-step select { min-height: 44px; }
.hb-step select.hb-scope { max-width: 220px; color: var(--muted); }
.hb-tools { display: inline-flex; gap: 4px; }
.hb-tools button { min-width: 44px; min-height: 44px; padding: 0 8px; font-size: 18px; line-height: 1; }
.hb-approval { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.hb-lock { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 2px var(--line-strong); }
.hb-rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin: 0 0 12px; padding: 0; border: 0; }
.hb-rows legend { margin-bottom: 6px; font-weight: 600; }
.hb-choice { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); cursor: pointer; }
.hb-choice:has(input:checked) { border-color: var(--accent-fill); box-shadow: 0 0 0 2px var(--ring); }
.hb-choice span { display: grid; gap: 2px; }
.hb-choice small { color: var(--muted); }
.hb-sub { margin: 18px 0 8px; }
.hb-columns { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px; margin-bottom: 10px; }
.hb-column > *, .hb-column select, .hb-column input { min-width: 0; max-width: 100%; }
.hb-column select { width: 100%; }
.hb-column { display: grid; gap: 8px; align-content: start; padding: 10px; border: 1px solid var(--line); border-top: 4px solid var(--step); border-radius: var(--radius-lg); background: var(--surface); }
.hb-column-head { display: flex; gap: 6px; }
.hb-column-head input { flex: 1; min-width: 0; }
.hb-who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
button.hb-who-pick { white-space: normal; text-align: left; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 4px 10px 4px 4px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); box-shadow: none; }
button.hb-who-pick:hover { border-color: var(--step); background: var(--surface); color: var(--ink); }
button.hb-who-pick.is-picked { border-color: var(--step); box-shadow: inset 0 0 0 2px var(--step); font-weight: 700; }
.hb-required { margin-top: 12px; }
.hb-lock-hint { margin: 0 0 8px; }
.hb-viewers { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.hb-viewer { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.hb-viewer:has(input:checked) { border-color: var(--accent-fill); }
button.hb-lock-toggle { min-width: 32px; min-height: 32px; padding: 0 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); box-shadow: none; font-size: 14px; line-height: 1; vertical-align: middle; }
button.hb-lock-toggle:hover { border-color: var(--line-hover); background: var(--hover); color: var(--ink); }
button.hb-lock-toggle.is-locked { border-color: var(--line-strong); background: var(--surface-2); }
.hb-preview td.hb-cell { padding: 4px; box-shadow: inset 3px 0 0 var(--step, var(--line-strong)); }
.hb-preview td.hb-cell.is-locked { background: var(--surface-2); }
.hb-locked { display: flex; gap: 4px; align-items: center; }
.hb-locked input { flex: 1; min-width: 80px; min-height: 36px; font-weight: 600; }
button.hb-cell-pick { width: 100%; min-height: 36px; padding: 4px 8px; border: 1px dashed var(--line-strong); background: transparent; color: var(--muted); box-shadow: none; font-size: 12px; text-align: left; }
button.hb-cell-pick:hover { border-color: var(--step, var(--accent)); background: var(--hover); color: var(--ink); }
.hb-preview td.hb-preview-cell { color: var(--muted); font-size: 12px; box-shadow: inset 3px 0 0 var(--step); }

/* External customers: no rail, one slim header. Tokens only. */
.shell:has(.external-header) { flex-direction: column; }
.external-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 10px clamp(16px, 2.2vw, 32px); border-bottom: 1px solid var(--line); background: var(--surface); }
.external-brand { display: flex; align-items: center; gap: 10px; color: var(--heading); text-decoration: none; }
.external-brand:hover { text-decoration: none; }
.external-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.external-actions form { margin: 0; }
.external-actions a, .external-actions button { display: inline-flex; align-items: center; min-height: 44px; }
.external-actions .theme-switch button { min-height: 44px; }
a.request-launch-card { text-decoration: none; }
.portal-cards .request-launch-card { min-height: 96px; font-size: 1.05rem; }

@media print {
  .rail, .topbar, .mobile-header, .mobile-bottom-nav, .rail-backdrop, .toast-container, .app-install-banner, .actions, button, body::before { display: none !important; }
  body, main { background: #fff !important; }
  main { max-width: none; padding: 0; }
  .panel, .metric-card, .task-card { break-inside: avoid; border: 1px solid #bbb; box-shadow: none; }
}

/* ---- employee document viewer (modal) ---- */
.doc-viewer { width: min(960px, calc(100vw - 32px)); height: calc(100dvh - 48px); padding: 0; border: 0; border-radius: var(--radius-xl); background: var(--glass-bg); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); color: var(--ink); box-shadow: var(--highlight), var(--shadow-pop); }
.doc-viewer[open] { display: flex; flex-direction: column; }
.doc-viewer::backdrop { background: var(--scrim); }
.doc-viewer header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.doc-viewer h2 { margin: 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.doc-viewer header > div { display: flex; gap: 8px; flex-shrink: 0; }
.doc-viewer header button, .doc-viewer header .btn { margin: 0; }
.doc-viewer-body { flex: 1; min-height: 0; display: flex; justify-content: center; align-items: center; overflow: auto; background: var(--bg); }
.doc-viewer-body iframe { width: 100%; height: 100%; border: 0; }
.doc-viewer-body img { max-width: 100%; max-height: 100%; object-fit: contain; }
.link-button { background: none; border: 0; padding: 0; margin: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; width: auto; text-align: left; }

/* Favourite form cards on For me */
.fav-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.fav-card { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.fav-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fav-card-top .favorite-toggle-form { margin: 0; }
.fav-card-scope { color: var(--muted); font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; overflow-wrap: anywhere; }
.fav-card-title { margin: 0; font-size: 1rem; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.fav-card-code { margin: 0; color: var(--muted); font-size: .72rem; }
.fav-card-desc { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.fav-card-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.fav-card-last { color: var(--muted); font-size: .75rem; line-height: 1.4; }
.fav-card-last strong { display: block; color: var(--ink); font-size: .82rem; }
.fav-card-last small { display: block; font-size: .75rem; }
.fav-card-start { min-height: 44px; padding: 0 16px; border-radius: var(--radius); background: var(--accent-fill); color: #fff; font-weight: 600; }

/* Global search: integrated into .topbar on desktop, a button in the phone header; both open the same dialog. */
.search-bar { display: flex; width: 100%; }
.search-open {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; min-height: 34px; margin: 0; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2);
  color: var(--muted); font: inherit; font-size: .8125rem; font-weight: 500; cursor: pointer;
  transition: border-color var(--t), background-color var(--t), color var(--t);
}
.search-open:hover { border-color: var(--line-hover); background: var(--surface); color: var(--ink); }
.search-open-label { display: inline-flex; align-items: center; gap: 8px; }
.search-open kbd { padding: 1px 6px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink-2); font: inherit; font-size: .68rem; font-weight: 600; }
.search-dialog { width: min(680px, calc(100% - 24px)); max-height: 70dvh; margin: 10dvh auto 0; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-pop); color: var(--ink); transform-origin: top center; }
.search-dialog[open] { display: flex; flex-direction: column; }
.search-dialog::backdrop { background: var(--scrim); }
@media (prefers-reduced-motion: no-preference) {
  .search-dialog[open] { animation: search-in 150ms ease-out; }
  .search-dialog[open]::backdrop { animation: search-fade 150ms ease-out; }
}
@keyframes search-in { from { opacity: 0; transform: translateY(-12px) scale(.96); } }
@keyframes search-fade { from { opacity: 0; } }
@media (min-width: 1025px) { .toast-container { bottom: 24px; } }
.search-input { width: 100%; margin: 0; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; font-size: 1rem; }
.search-input:focus { outline: none; }
.search-results { overflow-y: auto; padding: 6px; }
.search-group { padding: 8px 10px 4px; color: var(--muted); font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.search-results a { display: flex; justify-content: space-between; gap: 12px; padding: 10px; border-radius: var(--radius); color: var(--ink); text-decoration: none; }
.search-results a small { color: var(--muted); }
.search-results a:hover, .search-results a.is-active { background: var(--gold-soft); }
.search-empty { padding: 16px 10px; color: var(--muted); }
@media (max-width: 1024px) { .search-bar { display: none; } }

/* Live filter forms update as you type; their submit buttons are redundant */
form[data-live] button[type="submit"] { display: none; }

/* ---- photo hero: copy on a dark food photograph, --hero-photo-* tokens only ---- */
.photo-hero { position: relative; isolation: isolate; container-type: inline-size; display: flex; align-items: center; min-height: 260px; margin: 0 0 18px; padding: 30px 40px; overflow: hidden;
  border-radius: var(--radius-xl); background: var(--hero-photo-bg); color: var(--hero-photo-ink); box-shadow: var(--shadow-card); }
.photo-hero-img { position: absolute; top: 0; right: 0; z-index: -1; width: auto; max-width: none; height: 100%; pointer-events: none;
  -webkit-mask-image: var(--hero-photo-fade); mask-image: var(--hero-photo-fade); }
.photo-hero-copy { position: relative; width: min(100%, 720px); }
.photo-hero-eyebrow { display: block; color: var(--hero-photo-muted); font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.photo-hero h1 { margin: 10px 0 6px; color: var(--hero-photo-ink); font-size: clamp(2rem, 3.4vw, 2.85rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.08; }
.photo-hero h1 span { color: var(--gold); }
.photo-hero p { margin: 0; color: var(--hero-photo-muted); font-size: 1.02rem; line-height: 1.45; }
.photo-hero p::after { content: ""; display: block; width: 48px; height: 3px; margin-top: 14px; border-radius: 2px; background: var(--gold); }
.photo-hero-stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 0; padding: 0; list-style: none; }
.photo-hero-stats li { display: flex; flex: 1 1 0; min-width: 0; align-items: center; gap: 12px; margin: 0; padding: 12px 14px; border: 1px solid var(--hero-photo-line); border-radius: var(--radius); background: var(--hero-photo-tile); }
.photo-hero-stats .nav-icon { flex: 0 0 30px; width: 30px; height: 30px; color: var(--gold); stroke-width: 1.6; opacity: 1; }
.photo-hero-stats li:nth-child(3) .nav-icon { color: var(--ok-fill); }
.photo-hero-stats span { color: var(--hero-photo-muted); font-size: .78rem; line-height: 1.3; }
.photo-hero-stats span { min-width: 0; }
.photo-hero-stats strong { display: block; color: var(--hero-photo-ink); font-size: 1.3rem; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
/* A narrower hero (the rail decides the width, not the viewport): the photo covers the band at full strength and fades
   out under the copy (the photos carry a dark left side). Only a really narrow hero dims it, where the copy runs over the food. */
@container (max-width: 1060px) {
  .photo-hero-img { width: 100%; object-fit: cover; object-position: 100% center; -webkit-mask-image: var(--hero-photo-fade-cover); mask-image: var(--hero-photo-fade-cover); }
}
@container (max-width: 760px) {
  .photo-hero-img { opacity: .42; -webkit-mask-image: none; mask-image: none; }
}
@media (max-width: 1024px) { .photo-hero { padding: 26px 24px; } }
/* A hub's own header as the band: the markup stays .page-header / .recipe-header, it only gains these classes. */
.photo-hero-pic { display: contents; }
.photo-hero-pic source { display: none; } /* not hidden by the browser: it would count as a flex item and push the copy */
.photo-hero.photo-hero-band { justify-content: space-between; gap: 20px; min-height: 200px; margin: 0 0 18px; padding: 28px 36px; border: 0; border-radius: var(--radius-xl); background: var(--hero-photo-bg); }
.photo-hero-band h1 { margin: 6px 0 4px; font-size: clamp(1.8rem, 3vw, 2.5rem); }
.photo-hero.photo-hero-band p { max-width: 560px; margin: 0; color: var(--hero-photo-muted); font-size: .95rem; }
.photo-hero-band .eyebrow { color: var(--gold); }
.photo-hero-band .orange { color: var(--gold); }
[dir="rtl"] .photo-hero-img { right: auto; left: 0; transform: scaleX(-1); }
@media print {
  .photo-hero-img { display: none; }
  .photo-hero.photo-hero-band { min-height: 0; padding: 0; background: none; box-shadow: none; }
  .photo-hero-band h1, .photo-hero.photo-hero-band p, .photo-hero-band .eyebrow { color: var(--ink); }
}

/* ---- empty states and the login photo ---- */
.empty-art { display: block; width: min(200px, 100%); height: auto; margin: 0 auto 12px; }
.empty-state.has-art { align-items: center; text-align: center; }
.empty.has-art, td.has-art { text-align: center; }
.login-photo { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }

/* Paper is always light. */
@media print {
  :root, :root[data-theme="light"] {
    color-scheme: light;
  --bg: #fff; --surface: #fff; --surface-2: #fff; --surface-3: #f4f4f4; --ink: #1F1F1F; --heading: #1F1F1F; --ink-2: #4B5563; --muted: #4B5563;
  --line: #bbb; --line-strong: #999; --accent: #8B0A14; --ok: #15803D; --ok-bg: #fff; --warn: #B45309; --warn-bg: #fff; --bad: #8B0A14; --bad-bg: #fff;
  --info: #1D4ED8; --info-bg: #fff; --purple: #6D28D9; --purple-bg: #fff; --orange: #B45309; --orange-bg: #fff; --gold-ink: #5C3400; --gold-soft: #fff; --hover: transparent; --hover-row: transparent;
  --topbar-grad: none; --scope-pill-grad: none; --hero-module: none; --accent-soft: transparent; --shadow-card: none; --shadow-pop: none; --track: #eee;
  --tint-emerald-bg: none; --tint-emerald-solid: transparent; --tint-emerald-icon: transparent; --tint-emerald-border: #bbb; --tint-emerald-ink: #1F1F1F;
  --tint-amber-bg: none; --tint-amber-solid: transparent; --tint-amber-icon: transparent; --tint-amber-border: #bbb; --tint-amber-ink: #1F1F1F;
  --tint-rose-bg: none; --tint-rose-solid: transparent; --tint-rose-icon: transparent; --tint-rose-border: #bbb; --tint-rose-ink: #1F1F1F;
  --tint-purple-bg: var(--tint-amber-bg); --tint-purple-solid: transparent; --tint-purple-icon: transparent; --tint-purple-border: #bbb; --tint-purple-ink: #1F1F1F;
  --tint-blue-bg: var(--tint-amber-bg); --tint-blue-solid: transparent; --tint-blue-icon: transparent; --tint-blue-border: #bbb; --tint-blue-ink: #1F1F1F;
  --tint-peach-bg: var(--tint-amber-bg); --tint-peach-solid: transparent; --tint-peach-icon: transparent; --tint-peach-border: #bbb; --tint-peach-ink: #1F1F1F;
  }
}

/* ---- light / dark switch: one in the top bar, one in the menu where the top bar is hidden ---- */
.theme-switch { display: flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.rail .theme-switch { display: none; border-color: var(--rail-line); background: transparent; }
.theme-switch button { display: inline-flex; flex: 1; align-items: center; justify-content: center; gap: 6px; min-height: 30px; min-width: 32px; margin: 0; padding: 0 8px; border: 0; border-radius: 4px; background: transparent; box-shadow: none; color: var(--ink-2); font-size: .8125rem; font-weight: 600; }
.theme-switch button:hover { border: 0; background: var(--hover-2); color: var(--ink); }
.rail .theme-switch button { min-height: 44px; color: var(--rail-ink); }
.rail .theme-switch button:hover { background: var(--rail-hover); color: var(--rail-ink); }
.theme-switch button[aria-pressed="true"], .theme-switch button[aria-pressed="true"]:hover, .rail .theme-switch button[aria-pressed="true"], .rail .theme-switch button[aria-pressed="true"]:hover { background: var(--gold); color: var(--on-gold); }
.theme-switch .nav-icon { flex: none; width: 16px; height: 16px; opacity: 1; }
.topbar .theme-switch span { display: none; }
@media (max-width: 1024px) { .rail .theme-switch { display: flex; margin: 12px 20px 0; } }

/* For Me compact pass (2026-11-09): tighter sections on desktop; Recent activity is the only bottom panel, so it spans the row. */
.my-work-page .work-section { padding: 12px 16px; }
.my-work-page .work-section-heading { margin-bottom: 8px; }
.my-work-page .work-bottom-split { grid-template-columns: 1fr; }

/* ---- record header: title block left, actions right, approval status as one strip underneath ---- */
.page-header:has(> .flash, > p.muted) { flex-wrap: wrap; align-items: flex-start; row-gap: 0; }
.page-header:has(> .flash, > p.muted) > div:first-child { flex: 1 1 320px; min-width: 0; }
.page-header:has(> .flash, > p.muted) > .actions { flex: 0 1 auto; align-items: center; gap: 8px; }
.page-header > .flash, .page-header > p.muted { flex: 1 1 100%; max-width: none; margin: 0; }
.page-header > .flash { margin-top: 18px; padding: 12px 16px; border-radius: var(--radius); font-size: .9375rem; box-shadow: none; }
.page-header > p.muted { margin-top: 10px; font-size: .85rem; }
.page-header > .flash + p.muted { margin-top: 8px; }
/* the sheet header's own details: one tidy column of meta, the date picker on a single row */
.execution-header > div:first-child h1 { margin: 0; overflow-wrap: anywhere; }
.execution-header > div:first-child > p { margin-top: 6px; }
.execution-header form.inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 14px; }
.execution-header form.inline label { display: grid; gap: 4px; margin: 0; font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.execution-header form.inline input[type=date] { min-height: 40px; }
.execution-header form.inline button { min-height: 40px; margin: 0; }
.execution-header .actions > * { margin: 0; }
.execution-header .actions form.inline { margin: 0; display: block; }
@media (max-width: 640px) {
  .page-header:has(> .flash, > p.muted) { flex-wrap: nowrap; align-items: stretch; }
  .page-header:has(> .flash, > p.muted) > div:first-child, .page-header > .flash, .page-header > p.muted { flex: 0 0 auto; }
  .page-header:has(> .flash, > p.muted) > .actions { margin-top: 14px; }
  .page-header > .flash { margin-top: 14px; }
  .execution-header .actions { justify-content: flex-start; }
}
