/* ==========================================================================
   TRADESYNC "CINEMATIC PRODUCTIVITY" THEME
   Premium SaaS Glassmorphic Design System
   
   🔒 LOCKED THEME - November 25, 2025
   ========================================================================== */

/* Satoshi — app UI typeface (Myth component library, 4 Nov 2026).
   Self-hosted variable font (weights 300–900) from Fontshare, ITF Free Font
   License: wwwroot/fonts/satoshi/LICENSE-FFL.txt. Files are unmodified. */
@font-face {
    font-family: 'Satoshi';
    src: url('../fonts/satoshi/Satoshi-Variable.woff2') format('woff2');
    font-weight: 300 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Satoshi';
    src: url('../fonts/satoshi/Satoshi-VariableItalic.woff2') format('woff2');
    font-weight: 300 900;
    font-style: italic;
    font-display: swap;
}

:root {
    /* ==========================================================================
       FIGMA PALETTE SCALES — Myth component library (4 Nov 2026)
       Source: Figma "[EXT] FCS — 360 Synk" › Component library › Colour palettes
       (node 49:7556). Names mirror the Figma variables: "Mono/9" → --mono-9,
       "Primary blue/6" → --blue-6, "RAG Green/5" → --rag-green-5.
       Raw scales only: components consume semantic tokens that point at these.
       Step 0/1 = lightest, highest step = darkest. Dotted swatches in Figma
       (the "key" shades) are marked ◆.
       ========================================================================== */

    /* Monochromatic (neutral surfaces, borders, text) */
    --mono-0: #FCFCFC;   /* ◆ */
    --mono-1: #F5F6F9;
    --mono-2: #E9EBF0;
    --mono-3: #D5D7E0;
    --mono-4: #A3A6B4;   /* ◆ */
    --mono-5: #8E91A0;
    --mono-6: #6F7282;
    --mono-7: #454857;
    --mono-8: #363946;
    --mono-9: #262832;
    --mono-10: #1D1F27;
    --mono-11: #16181F;  /* ◆ */

    /* Primary blue (actions, focus, selection) */
    --blue-0: #F6F9FF;
    --blue-1: #F1F6FE;
    --blue-2: #E3EDFD;
    --blue-3: #BBD4FB;   /* ◆ */
    --blue-4: #88B5FC;
    --blue-5: #5191F6;
    --blue-6: #1F6FEB;   /* ◆ primary */
    --blue-7: #165FD0;
    --blue-8: #154EA8;
    --blue-9: #123E81;
    --blue-10: #0F2D5C;
    --blue-11: #0F2D5C;  /* Figma currently has the same value as blue-10 */

    /* RAG — Green (done / positive) */
    --rag-green-1: #E6FDF1;
    --rag-green-2: #B3F8D6;
    --rag-green-3: #66F1AD;
    --rag-green-4: #33EC91;
    --rag-green-5: #00E776;  /* ◆ */
    --rag-green-6: #00B95E;
    --rag-green-7: #008B47;
    --rag-green-8: #005C2F;
    --rag-green-9: #004523;
    --rag-green-10: #002E18;

    /* Figma accent tints for tile icons (Job Activity 85:2483, 12 Nov 2026) */
    --accent-amber-3: #FFC655;
    --accent-mint-2: #CEFFED;
    --accent-pink-2: #FFC5F1;

    /* RAG — Red (wrong / destructive) */
    --rag-red-1: #FFECEC;
    --rag-red-2: #FFC7C7;
    --rag-red-3: #FF8F8E;
    --rag-red-4: #FF6969;
    --rag-red-5: #FF4443;    /* ◆ */
    --rag-red-6: #CC3636;
    --rag-red-7: #992928;
    --rag-red-8: #661B1B;
    --rag-red-9: #4D1414;
    --rag-red-10: #330E0D;

    /* RAG — Orange (needs attention / warning) */
    --rag-orange-1: #FFF3E6;
    --rag-orange-2: #FFDBB3;
    --rag-orange-3: #FFB766;
    --rag-orange-4: #FF9F33;
    --rag-orange-5: #FF8700; /* ◆ */
    --rag-orange-6: #CC6C00;
    --rag-orange-7: #995100;
    --rag-orange-8: #663600;
    --rag-orange-9: #4D2900;
    --rag-orange-10: #331B00;

    /* App shell surfaces — sampled from the Figma page designs (Jobs, Job, Operations
       dashboard; node 15:6262): page + top bar Mono/10, rules Mono/8. Side nav follows the
       "Sidebar open" component (node 15:5486, 5 Nov 2026): Mono/10, 196px wide, Mono/8 right rule. */
    --surface-page: var(--mono-10);
    --surface-nav: var(--mono-10);
    --sidebar-width: 210px;          /* Figma "Expanded nav bar" 247:4422 (was 196px) */
    --sidebar-rail-width: 80px;      /* Figma "Collapsed nav" 247:4386 — icon-only sidebar */
    --border-subtle: var(--mono-8);

    /* Cards, panels and tables — Figma component library (Card, Table header cell):
       flat Mono/9 fill, Mono/8 border, 16px radius; header labels Mono/4. */
    --surface-card: var(--mono-9);
    --border-card: var(--mono-8);
    --radius-card: 16px;
    --table-header-bg: var(--surface-card);
    --table-header-text: var(--mono-4);

    /* Buttons — Figma "Button" component (02 Buttons). Pill radius, Satoshi Medium 14/24.
       Sizes: Large 44px (page header, dialogs), Medium 40px (cards, filters), Small 32px (tables). */
    --surface-raised: #2B2D38;            /* hover fill for secondary / ghost, disabled fill */
    --btn-radius: 20px;
    --btn-primary-bg: var(--blue-6);
    --btn-primary-bg-hover: var(--blue-7);
    --btn-destructive-bg: var(--rag-red-6);
    --btn-destructive-bg-hover: var(--rag-red-5);
    --btn-positive-bg: var(--rag-green-7);
    --btn-positive-bg-hover: var(--rag-green-6);
    --btn-warning-bg: var(--rag-orange-6);
    --btn-warning-bg-hover: var(--rag-orange-5);
    --btn-secondary-bg: var(--mono-9);
    --btn-secondary-border: var(--mono-8);
    --btn-secondary-bg-hover: var(--surface-raised);
    --btn-secondary-border-hover: var(--mono-7);
    --btn-secondary-text: var(--mono-0);
    --btn-ghost-text: var(--blue-4);
    --btn-disabled-bg: var(--surface-raised);
    --btn-disabled-border: var(--mono-8);
    --btn-disabled-text: var(--mono-4);   /* Figma Mono/6 (2.9:1) brightened to 5.6:1 for readability (David, 5 Nov 2026) */

    /* Inputs — Figma "Text field" (01 Forms): Mono/9 fill, Mono/8 border, 20px radius, 44px tall.
       Focus = Blue/5 1.5px border; Error = Red/4 1.5px border; Disabled = Mono/10 fill, Mono/6 text.
       Textarea radius 16px. Labels Mono/3 Medium 14; placeholder Mono/5; helper 12px Mono/5. */
    --input-bg: var(--mono-9);
    --input-border: var(--mono-8);
    --input-border-hover: var(--mono-7);
    --input-border-focus: var(--blue-5);
    --input-border-error: var(--rag-red-4);
    --input-text: var(--mono-0);
    --input-placeholder: var(--mono-5);
    --input-label: var(--mono-3);
    --input-helper: var(--mono-5);
    --input-radius: 20px;
    --textarea-radius: 16px;
    --input-disabled-bg: var(--mono-10);
    --input-disabled-text: var(--mono-4);   /* Figma says Mono/6 (3.4:1); Mono/4 = 6.8:1 for readability (David, 4 Nov 2026) */

    /* ==========================================================================
       🔒 LOCKED COLOR PALETTE - Do Not Change
       ========================================================================== */
    
    /* Primary Brand */
    --ts-blue: #2196F3;              /* TradeSync Blue - Primary accent */
    --ts-blue-dark: #1976D2;         /* Darker blue for gradients */
    --ts-blue-light: #64B5F6;        /* Lighter blue for highlights */
    
    /* Core Backgrounds */
    /* 4 Nov 2026 (Figma tidy-up): repointed to the Mono scale so every existing use follows. */
    --deep-void: var(--mono-10);     /* Deepest background (was #0B0D10) — now the page colour */
    --glass-charcoal: var(--surface-card); /* Panel base (was #121212) */
    
    /* ==========================================================================
       TYPOGRAPHY SYSTEM - WCAG AA Compliant (Dec 31, 2025)
       All pages MUST use these variables - NO hardcoded values
       ========================================================================== */
    
    /* Text Colors - Contrast ratios on #0B0D10 background */
    --pure-white: #FFFFFF;           /* 18:1 - Primary content, values */
    /* DDA/readability (owner rule 2026-06-22): secondary text is WHITE, never hard-to-read grey.
       --starlight-silver is the secondary-TEXT token (~18:1). For genuine NON-TEXT grey (neutral
       accents/dots/borders/disabled), use --neutral-grey — do NOT use --starlight-silver. */
    --starlight-silver: #FFFFFF;     /* Secondary text — WHITE for readability/DDA */
    --neutral-grey: #94A3B8;         /* Non-text neutral grey ONLY (accents, dots, borders) */
    --text-muted: #C7CDD6;           /* Placeholders only — light + readable (was #64748B, too dim) */
    --text-label: #94A3B8;           /* Field LABELS (detail + form) — muted so VALUES (white) lead the hierarchy; AA ~6.5:1 on dark cards */
    --text-link: #64B5F6;            /* Links - always use this for clickable text */
    
    /* Font Sizes - rem-based for accessibility */
    --font-size-xs: 0.75rem;         /* 12px - Minimum for labels */
    --font-size-sm: 0.875rem;        /* 14px - Secondary text, metadata */
    --font-size-base: 1rem;          /* 16px - Body text, values */
    --font-size-lg: 1.125rem;        /* 18px - Subheadings */
    --font-size-xl: 1.25rem;         /* 20px - Section titles */
    --font-size-2xl: 1.5rem;         /* 24px - Page subtitles */
    --font-size-3xl: 2rem;           /* 32px - Dashboard stats */
    --font-size-4xl: 2.5rem;         /* 40px - Page titles */
    
    /* Font Weights */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* Status Colors — traffic-light canon (founder-approved 22 Jul 2026, DESIGN_SYSTEM.md § 2):
       green = done, blue = moving/healthy, yellow→orange = needs attention, red = wrong, grey = inert.
       StatusChipColorMapper (Helpers/) is the ONLY place statuses map to these — never per page. */
    --electric-amber: #FFE600;
    --success-green: #00E676;        /* Paid — money in the bank */
    --error-red: #FF5252;            /* Overdue / Rejected */
    --info-cyan: #29D6FF;            /* Neutral/insight accent (e.g. credit note, conversion). The ONLY non-blue cool accent — purple/pink are banned */
    --hot-orange: #FF9100;           /* Expiring soon / Expired quotes */
    --status-cobalt: #2979FF;        /* In Progress — active work is healthy, not a warning */
    --status-teal: #1DE9B6;          /* Invoiced / Part Paid — money in motion */
    --status-emerald: #66BB6A;       /* Completed — work done, distinct from Paid's brighter green */
    --status-lime: #C6E94A;          /* Accepted — a win, not yet money */
    --status-gold: #FFB300;          /* Due / On Hold — genuinely waiting on something */
    --status-crimson: #E53935;       /* Severely Overdue — worse than red */
    --status-slate: #78909C;         /* Closed / Written Off */
    --status-graphite: #546E7A;      /* Cancelled / Voided / Archived — dead, not urgent */
    --status-silver: #B0BEC5;        /* Draft / Inactive menu icons */
    
    /* ==========================================================================
       🔒 LOCKED CHARCOAL GRADIENT SYSTEM - November 25, 2025
       Use these for ALL cards, panels, and containers
       ========================================================================== */
    /* 4 Nov 2026 (Figma tidy-up): cards are a flat Mono/9 fill. Token names kept so the
       ~25 existing uses (and DesignSystemGlobalsTests) follow without page edits. */
    --charcoal-gradient: var(--surface-card);
    --charcoal-gradient-hover: var(--surface-card);
    
    /* Glassmorphism System — retired.
       11 Nov 2026 (Figma tidy-up): surfaces are flat, so the glass tokens now carry Figma
       values. Names kept so every existing use (~50) follows without page edits. */
    --glass-bg: var(--surface-card);              /* Flat Mono/9 (was 5% white overlay) */
    --glass-bg-hover: var(--surface-raised);      /* Figma raised hover fill (was 8% white) */
    --glass-border: var(--border-card);           /* Subtle 1px border — Mono/8 (was 10% white) */
    --glass-border-hover: var(--mono-7);          /* Quiet hover border (was 50% blue) */
    --glass-blur: 0px;                            /* No backdrop blur (was 12px) */
    
    /* ==========================================================================
       B+ DIALOG & OVERLAY (locked 2026-06-30) — DESIGN_SYSTEM_DIALOGS_VISUAL.md
       Modal tier: blue accent frame + 72% backdrop. Lightweight tier: same surface, white border.
       6 Nov 2026 (Myth Figma tidy-up, Figma "Dialog" 15:4834, signed off by the owner): the overlay
       tokens now carry the Figma modal — flat Mono/9 surface, Mono/8 border, deep shadow, no blue
       frame or glow, no glass blur. The 72% backdrop is unchanged. Names kept so every rule follows.
       ========================================================================== */
    --overlay-bplus-surface: var(--mono-9);
    --overlay-bplus-border-modal: var(--mono-8);
    --overlay-bplus-shadow-modal: 0 16px 48px rgba(0, 0, 0, 0.6);
    --overlay-bplus-backdrop: rgba(0, 0, 0, 0.72);
    --overlay-lightweight-border: var(--mono-8);
    --overlay-lightweight-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    --overlay-glass-blur: 0px;
    
    /* ==========================================================================
       GLOBAL 1 — THE NEON GLOW SYSTEM (locked 2026-06-19)
       ONE colour only: TradeSync blue. NEVER tint the glow to a status colour.
       Exactly THREE levels — nothing else:
         --glow-heavy   → ACTIONS (primary button / main call-to-action)
         --glow-medium  → ATTENTION / active / selected / hover ("draw the eye")
         --glow-low     → INFO only (subtle ambient presence, focused input)
       ========================================================================== */
    /* 11 Nov 2026 (Figma tidy-up): the Figma library has no glow — actions are flat fills,
       focus is a Blue/5 border, selection is a fill. The three levels are kept as names (so
       DesignSystemGlobalsTests and every use follow) but draw nothing. A zero transparent
       shadow, not `none`, because several rules list a glow beside another shadow and `none`
       inside a list would void the whole declaration.
       Was: heavy 20/40/80/120px, medium 16/32px, low 10px — all TradeSync blue. */
    --glow-heavy: 0 0 0 transparent;
    --glow-medium: 0 0 0 transparent;
    --glow-low: 0 0 0 transparent;

    /* Legacy aliases — map onto the 3 canonical levels above. Do not add new glow tokens. */
    --neon-glow: var(--glow-medium);
    --neon-glow-intense: var(--glow-heavy);
    --neon-accent: var(--blue-4);    /* Was used (ViewToolboxTalk links) but never defined; Figma link colour */
    
    /* Shadows */
    --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-elevated: 0 8px 32px rgba(0, 0, 0, 0.5);
    
    /* Typography */
    --font-stack: 'Satoshi', 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
}

/* ==========================================================================
   DECORATIVE GLOW SYSTEM - Brand Ambient Effects
   Use these globally for consistent glow behavior
   ========================================================================== */

/* ═══════════════════════════════════════════════════════════════════════════
   GLOBAL STAT/SUMMARY CARD INTERACTION (Feb 10, 2026 – unified v3)
   
   ONE pattern for ALL cards: .summary-card, .stat-card, .kpi-card,
   .activity-stat-card, and any card with .neon-hover-glow.
   
   Gold standard = Quotes list page:
     1. Default  = dark glassmorphic, KEEP per-page coloured left-border
     2. Hover    = neon blue glow + lift (card does NOT change colour)
     3. Selected = stronger persistent neon blue glow
   
   Coloured left borders (per-status) are PRESERVED on all cards.
   No coloured BACKGROUNDS. No coloured HOVER glows. No coloured SELECTED glows.
   Icons inside cards MAY be coloured – hover/selected glow is ALWAYS blue.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ==========================================================================
   GLOBAL USER AVATAR INITIALS (Feb 2026)
   Use class "avatar-initials" on MudAvatar for consistent two-initial display.
   Ensures same font weight/size/centering across Scheduling, Kanban, HR, etc.
   ========================================================================== */
.avatar-initials,
.mud-avatar.avatar-initials {
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.02em;
}
/* Optional: min-width so single-char fallback still aligns with two-char avatars */
.mud-avatar.avatar-initials {
    min-width: 2ch;
    justify-content: center;
}

/* RoleAvatar — 11 Nov 2026: now draws <UserAvatar> (Figma avatar, AVATAR section at the end of this file);
   role colour is still the StatusChip on directory pages. (Was a TradeSync-blue MudAvatar with a light ring.) */

/* Prevent clipped/partial halos */
.neon-hover-glow {
    position: relative;
    overflow: visible;
}

/* ── GLOBAL: Enforce blue-only hover/selected glow on ALL card types ─────
   Per-page coloured border-lefts are KEPT (each page defines its own).
   Only hover glow, selected glow, and detail-page ::before bars are
   forced to blue so no page can introduce coloured halos.               */

/* Per-page ::before accent bars keep their semantic colours (same as icons).
   Only the HOVER GLOW and SELECTED GLOW are forced to blue.               */

/* 11 Nov 2026 (Figma tidy-up): card hover is a quiet Mono/7 border — no blue glow, no
   blue border, no lift. Selected is a solid Blue/6 border (no glow) so it still reads. */

/* Activity-stat-cards: quiet hover */
.activity-stat-card:hover {
    box-shadow: var(--neon-glow) !important;
    border-color: var(--glass-border-hover) !important;
}

/* Activity-stat-card icon wraps: no hover halo */
.activity-stat-card:hover .stat-icon-wrap {
    box-shadow: none !important;
    background: rgba(33, 150, 243, 0.25) !important;
}

/* ── 1) Hover: quiet border, no glow, no lift ──────────────────────────── */
.neon-hover-glow:hover,
.neon-hover-glow:focus-visible,
.summary-card.clickable:hover,
.summary-card.neon-hover-glow:hover,
.stat-card.clickable:hover,
.kpi-card.clickable:hover,
.activity-stat-card:hover {
    box-shadow: var(--neon-glow) !important;
    border-color: var(--glass-border-hover) !important;
    transform: none;
}

/* ── 2) Selected: solid Blue/6 border, no glow ─────────────────────────── */
.summary-card.selected,
.stat-card.selected,
.kpi-card.selected,
.activity-stat-card.selected {
    box-shadow: var(--neon-glow-intense) !important;
    border-color: var(--blue-6) !important;
}

/* ── 3) Selected + hover: keep selected glow, no extra lift ────────────── */
.summary-card.selected:hover,
.summary-card.selected:focus-visible,
.stat-card.selected:hover,
.stat-card.selected:focus-visible,
.kpi-card.selected:hover,
.kpi-card.selected:focus-visible,
.activity-stat-card.selected:hover,
.activity-stat-card.selected:focus-visible {
    box-shadow: var(--neon-glow-intense) !important;
    border-color: var(--blue-6) !important;
    transform: none;
}

/* 2b) Persistent neon glow (use sparingly, e.g., dashboard hero card) */
.neon-persist-glow {
    box-shadow: var(--neon-glow);
    border-color: rgba(33, 150, 243, 0.30);
    position: relative;
    overflow: visible;
}

/* ==========================================================================
   GLOBAL STYLES
   ========================================================================== */

html, body {
    font-family: var(--font-stack);
    font-weight: 400;                            /* Satoshi Regular — Figma body weight (4 Nov 2026) */
    background: var(--surface-page);
    color: var(--pure-white);
    min-height: 100vh;
    margin: 0;
    /* Body scroll enabled - no overflow: hidden */
}

/* Page background — flat Mono/10 (Figma page designs, 4 Nov 2026; replaces the
   charcoal-to-midnight gradient with blue glows). */
.content-scroll-area {
    background: var(--surface-page);
}

/* Links */
a { color: var(--ts-blue); text-decoration: none; transition: all 0.2s ease; }
a:hover { color: var(--ts-blue-light); }

/* ==========================================================================
   PAGE HERO - Premium Title Section (Gold Standard from Data Import)
   ========================================================================== */

/* Page hero container - use at top of every page */
.page-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 0 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 24px;
}

.page-hero-left {
    display: flex;
    flex-direction: column;
}

/* Long Create/Edit forms (owner-approved list/UX plan, 25 Sep 2026): the page header —
   which holds Save / Cancel — sticks while the form scrolls. The SAME mechanism the Settings
   shell uses (SettingsShell .settings-hero, owner Q4 21 Sep): top 0 under the glass top bar, the
   bottom-aligned actions stay in view. One header, no second button row, no separate save bar.
   Opt-in per page (only genuinely long forms); off on phones, where a tall header would eat
   the screen. Needs no overflow ancestor other than visible (9f737c42d gotcha). */
.page-hero.page-hero-sticky {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--surface-page);
    padding-top: 8px;
}

@media (max-width: 600px) {
    .page-hero.page-hero-sticky { position: static; }
}

/* Breadcrumb navigation */
.page-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ts-blue);
    font-size: var(--font-size-sm);
    margin-bottom: 8px;
}

.page-breadcrumb a,
.page-breadcrumb .breadcrumb-link {
    color: var(--ts-blue);
    cursor: pointer;
    text-decoration: none;
}

.page-breadcrumb a:hover,
.page-breadcrumb .breadcrumb-link:hover {
    text-decoration: underline;
}

.page-breadcrumb span:not(.breadcrumb-link) {
    color: var(--starlight-silver);
}

/* Top-bar breadcrumb — Figma "Global nav" 247:4354 (11 Nov 2026): 14px, earlier crumbs Mono/4
   (links lighten on hover), the current page Mono/0, 17px Mono/5 chevrons, 8px apart. One line;
   long trails clip with an ellipsis. Hidden at phone width, where the search field needs the room. */
.page-breadcrumb.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    font-size: var(--font-size-sm);
    line-height: 16px;
    color: var(--mono-4);
}

.page-breadcrumb.topbar-breadcrumb > span,
.page-breadcrumb.topbar-breadcrumb > a {
    color: var(--mono-4);
    flex-shrink: 0;
}

.page-breadcrumb.topbar-breadcrumb > a:hover {
    color: var(--mono-0);
    text-decoration: none;
}

.page-breadcrumb.topbar-breadcrumb > .topbar-crumb-current {
    color: var(--mono-0);
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-breadcrumb.topbar-breadcrumb .topbar-crumb-sep.mud-icon-root {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    color: var(--mono-5);
}

/* The trail takes the free space on the left; the right group keeps its natural size. */
.topbar-left {
    flex: 1 1 auto;
    min-width: 0;
    margin-right: 16px;
}

.topbar-right {
    flex: 0 1 auto;
    min-width: 0;
}

/* 13 Nov 2026 (Myth UI follow-up 2): the record-page Back shows only at phone width, where the breadcrumb is hidden. */
.topbar-back-phone { display: none; }

/* 13 Nov 2026 (Smart Notes decision 1): "Take a note" is a top-bar icon on wider screens and an account-menu item at
   phone width, never both. */
.account-menu-take-note { display: none; }

@media (max-width: 700px) {
    .page-breadcrumb.topbar-breadcrumb { display: none; }
    .topbar-back-phone { display: inline-flex; }
    .topbar-take-note { display: none; }
    .account-menu-take-note { display: flex; }
    .topbar-left { flex: 0 0 auto; margin-right: 8px; }
    .topbar-right { flex: 1 1 auto; }
}

/* Browsers draw their own clear (×) in a type="search" field — Figma's search pill has none. */
.global-search-input {
    -webkit-appearance: none;
    appearance: none;
}
.global-search-input::-webkit-search-cancel-button,
.global-search-input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}

/* Main page title with blue gradient - Large elegant style */
.page-title {
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--pure-white);
    margin: 0;
    letter-spacing: -0.5px;
}

/* Blue-to-cyan gradient text - the signature look */
.title-gradient {
    /* 11 Nov 2026 (Figma "Jobs" page 85:4244, David): plain white page titles (was Blue/6 earlier today,
       before that a blue→cyan gradient). */
    background: none;
    color: var(--mono-0);
    -webkit-text-fill-color: var(--mono-0);
}

/* Alternative: Blue-to-purple gradient */
.title-gradient-purple {
    background: linear-gradient(135deg, #2196F3 0%, #9C27B0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Page subtitle */
.page-subtitle {
    color: var(--starlight-silver);
    font-size: var(--font-size-sm);
    margin: 10px 0 0 0;
}

/* Action buttons container (top right) — buttons/tools only; no workflow status pills (DESIGN_SYSTEM.md §4) */
.page-hero-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    /* 26 Oct 2026 (John, job detail at ~1360 px): on narrower screens the header buttons wrap as WHOLE buttons to a
       second row (right-aligned, as on wide screens) and never squeeze their text onto 2-3 lines. */
    flex-wrap: wrap;
    justify-content: flex-end;
    row-gap: 8px;
}

.page-hero-actions .mud-button-root {
    white-space: nowrap;
}

/* Detail page — canonical workflow status summary (Quote/Invoice pattern, globalised Jul 2026) */
.detail-status-card {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 24px 32px;
    background: var(--surface-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.detail-status-card__indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    background: rgba(33, 150, 243, 0.2);
    color: var(--ts-blue-light);
    font-size: var(--font-size-sm);
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.detail-status-card__metric {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-status-card__metric-label {
    font-size: var(--font-size-xs);
    color: var(--starlight-silver);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.detail-status-card__metric-value {
    font-size: var(--font-size-base);
    color: var(--pure-white);
    font-weight: 500;
}

/* Age modifiers — a queue that is slipping should look like it is slipping.
   Same traffic-light reading as the Active list's "days in review" column. */
.detail-status-card__metric-value.metric-warning { color: var(--electric-amber); }
.detail-status-card__metric-value.metric-danger { color: var(--error-red); }

.detail-status-card.tone-blue { border-color: rgba(33, 150, 243, 0.3); }
.detail-status-card.tone-green { border-color: rgba(0, 230, 118, 0.3); }
.detail-status-card.tone-amber { border-color: rgba(255, 152, 0, 0.3); }
.detail-status-card.tone-red { border-color: rgba(255, 82, 82, 0.5); }
.detail-status-card.tone-grey { border-color: rgba(158, 158, 158, 0.3); }
.detail-status-card.tone-cyan { border-color: rgba(0, 188, 212, 0.3); }

.detail-status-card.tone-blue .detail-status-card__indicator { background: rgba(33, 150, 243, 0.2); color: var(--ts-blue-light); }
.detail-status-card.tone-green .detail-status-card__indicator { background: rgba(0, 230, 118, 0.2); color: var(--success-green); }
.detail-status-card.tone-amber .detail-status-card__indicator { background: rgba(255, 152, 0, 0.2); color: var(--electric-amber); }
.detail-status-card.tone-red .detail-status-card__indicator { background: rgba(255, 82, 82, 0.2); color: var(--error-red); }
.detail-status-card.tone-grey .detail-status-card__indicator { background: rgba(158, 158, 158, 0.2); color: var(--starlight-silver); }
.detail-status-card.tone-cyan .detail-status-card__indicator { background: rgba(0, 188, 212, 0.2); color: var(--info-cyan); }

@media (max-width: 900px) {
    .detail-status-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 16px;
    }
}

/* GLOBAL 6 — title + primary action beside the heading */
.title-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* Title with icon prefix */
.page-title-with-icon {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-title-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(33, 150, 243, 0.3);
    border: 1px solid rgba(33, 150, 243, 0.4);
    color: var(--ts-blue-light);
    box-shadow: none;
}

/* ==========================================================================
   CINEMATIC LAYOUT - Sidebar & Topbar
   ========================================================================== */

.cinematic-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    /* Body scroll model - no overflow: hidden */
    background: var(--surface-page);
}

/* Full-screen map pages (Team location): fill the window under the top bar.
   The map template is height 100%; this gives the parent a real height. */
.cinematic-layout:has(.map-page) {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}
.cinematic-layout:has(.map-page) .main-content-wrapper {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.cinematic-layout:has(.map-page) .content-scroll-area {
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.cinematic-layout:has(.map-page) .content-scroll-area > * {
    flex: 1;
    min-height: 0;
    height: 100%;
}

/* Sidebar - Fixed position for body scroll model. Solid Mono/10 with a Mono/8 rule, 196px
   (Figma "Sidebar open", 5 Nov 2026; was 260px translucent glass with a backdrop blur). */
.cinematic-sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: var(--surface-nav);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    flex-shrink: 0;
}

.cinematic-sidebar.closed {
    width: 0;
    border: none;
    overflow: hidden;
    transform: translateX(calc(-1 * var(--sidebar-width)));
}

.sidebar-header {
    /* Must equal .cinematic-topbar height (70px) so the two bottom border
       lines meet flush at the logo/topbar junction on every page. */
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* 11 Nov 2026 (Figma "Expanded nav bar" 247:4422, Brand): the full 360°Synk logo, 52px tall,
       left-aligned 14px from the sidebar edge (was centred, 48px). */
    padding: 0 14px;
    border-bottom: 1px solid var(--glass-border);
}

.brand-logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
}

.main-logo {
    height: 52px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

/* Sidebar Close Button - Hidden on desktop, shown on tablet/laptop/mobile */
.sidebar-close-btn {
    display: none; /* Hidden by default on desktop */
    position: absolute;
    top: 20px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

/* Show close button on phones only (11 Nov 2026: tablets and laptops get the docked icon rail) */
@media (max-width: 768px) {
    .sidebar-close-btn {
        display: flex;
    }
    
    /* Adjust sidebar header to accommodate close button */
    .sidebar-header {
        position: relative;
    }
}

/* 11 Nov 2026 (David, Figma "Operations dashboard" 85:4513): the top bar has no menu button.
   Above phone width the sidebar is docked and always shown (full, or the 80px icon rail), so the
   button is hidden there and a sidebar someone closed earlier (saved per browser) still shows. On
   phones the sidebar is a slide-over and the menu button stays — it is the only way to reach
   navigation. Not the second-screen window (.layout-popout), which never shows a sidebar. */
@media (min-width: 769px) {
    .topbar-left .menu-trigger { display: none; }

    .cinematic-layout:not(.layout-popout) .cinematic-sidebar.closed {
        width: var(--sidebar-width);
        border-right: 1px solid var(--border-subtle);
        overflow: visible;
        transform: none;
    }

    .cinematic-layout.sidebar-collapsed:not(.layout-popout) .main-content-wrapper {
        margin-left: var(--sidebar-width);
    }
}

@media (min-width: 769px) {
    html.ts-nav-rail .cinematic-sidebar,
    html.ts-nav-rail .cinematic-layout:not(.layout-popout) .cinematic-sidebar.closed {
        width: var(--sidebar-rail-width);
    }

    html.ts-nav-rail .cinematic-layout:not(.layout-popout) .main-content-wrapper,
    html.ts-nav-rail .cinematic-layout.sidebar-collapsed:not(.layout-popout) .main-content-wrapper {
        margin-left: var(--sidebar-rail-width);
    }

    html.ts-nav-rail .sidebar-header,
    html.ts-nav-rail .brand-logo {
        padding: 0;
        justify-content: center;   /* the 360 mark sits centred in the 80px rail (David, 11 Nov 2026) */
    }
}

.main-logo-mark { display: none; height: 52px; width: 52px; }
@media (min-width: 769px) {
    html.ts-nav-rail .main-logo-full { display: none; }
    html.ts-nav-rail .main-logo-mark { display: block; }
}
/* Phones (slide-over sidebar): the 360 mark too, as in the rail (David, 11 Nov 2026). */
@media (max-width: 768px) {
    .main-logo-full { display: none; }
    .main-logo-mark { display: block; }
}
/* Collapse / expand toggle at the foot of the sidebar (Figma upload-02 on its side, Mono/4). */
.sidebar-footer {
    display: flex;
    justify-content: center;
    padding: 8px 0 16px;
    flex-shrink: 0;
}

.sidebar-rail-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 38px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--mono-4);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-rail-toggle:hover { background: var(--mono-9); color: var(--mono-0); }
.sidebar-rail-toggle:focus-visible { outline: 2px solid var(--mono-4); outline-offset: 2px; }

.sidebar-rail-toggle .mud-icon-root {
    width: 16px;
    height: 16px;
    transform: rotate(-90deg);              /* expanded: |<- collapse */
}

html.ts-nav-rail .sidebar-rail-toggle .mud-icon-root {
    transform: rotate(90deg);               /* rail: ->| expand (as Figma) */
}

@media (max-width: 768px) {
    .sidebar-footer { display: none; }      /* phones: slide-over, closed with X / backdrop */
}

/* Sidebar Backdrop - Click to close (phones only — the sidebar is a slide-over there) */
.sidebar-backdrop {
    display: none; /* Hidden by default on desktop */
}

@media (max-width: 768px) {
    .sidebar-backdrop {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    /* Show backdrop when sidebar is open */
    .cinematic-layout:not(.sidebar-collapsed) .sidebar-backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
}

/* Nav Group Styling */
.mud-nav-group .mud-nav-link {
    padding-left: 48px !important;
}

.mud-navmenu .mud-nav-group-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 12px 16px 6px 16px;
}

/* Section divider styling */
.nav-section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    padding: 16px 16px 8px 16px;
    margin-top: 8px;
}

/* AICR Module Special Styling */
.aicr-nav-group .mud-expand-panel-header {
    background: rgba(33, 150, 243, 0.1);
    border-left: 3px solid #2196F3;
}

.aicr-logo {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

.sidebar-content {
    flex: 1;
    min-height: 0;
    display: flex;              /* 11 Nov 2026: lets .sidebar-nav fill it so the foot links sit at the bottom */
    flex-direction: column;
    padding: 8px 8px 0; /* Figma "Side navigation" 247:4385: 8px sides */
    overflow-y: auto;
    --glow-x: 50%;
    --glow-y: 50%;
    position: relative;
}

/* Global glow that follows cursor across entire sidebar */
.sidebar-content::before {
    content: '';
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100%;
    display: none; /* 5 Nov 2026 (Figma tidy-up): no cursor glow on the flat sidebar */
    background: radial-gradient(
        400px circle at var(--glow-x) var(--glow-y),
        rgba(33, 150, 243, 0.08) 0%,
        transparent 60%
    );
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-content:hover::before {
    opacity: 1;
}

/* Topbar - Sticky for body scroll model. Solid Mono/10 like the page, with a Mono/8
   rule (Figma, 4 Nov 2026; was translucent glass with a backdrop blur). */
.cinematic-topbar {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: var(--surface-page);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 90;
    position: sticky;
    top: 0;
}

.topbar-left, .topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Figma header (node 243:2635): 16px between the search pill and each round button. */
.topbar-right {
    gap: 16px;
}

.main-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
    margin-left: var(--sidebar-width); /* Offset for fixed sidebar */
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* When sidebar is closed, remove the margin (class-based, no :has()) */
.cinematic-layout.sidebar-collapsed .main-content-wrapper {
    margin-left: 0;
}

/* Second-screen focus window: no sidebar chrome — full width for the record */
.cinematic-layout.layout-popout .cinematic-sidebar,
.cinematic-layout.layout-popout .sidebar-backdrop {
    display: none !important;
}
.cinematic-layout.layout-popout .main-content-wrapper {
    margin-left: 0;
}
.cinematic-layout.layout-popout .content-scroll-area {
    padding-top: 20px;
}

.content-scroll-area {
    flex: 1;
    /* Body scroll model - no overflow-y: auto */
    padding: 28px;
    min-height: 0; /* Allow content to determine height */
}

/* ==========================================================================
   GLASS PANELS - The Core Component
   ========================================================================== */

/* ==========================================================================
   GLASS PANELS - LOCKED CHARCOAL GRADIENT THEME (Nov 25, 2025)
   ========================================================================== */
.glass-panel,
.stat-card,
.chart-panel,
.premium-table-card,
.cinematic-card {
    background: var(--charcoal-gradient) !important;
    border: 1px solid var(--border-card) !important;
    border-radius: var(--radius-card) !important;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-panel:hover,
.stat-card:hover,
.chart-panel:hover,
.cinematic-card:hover {
    background: var(--charcoal-gradient-hover) !important;
    border-color: var(--glass-border-hover) !important; /* Quiet Mono/7 (was 50% blue) */
    box-shadow: var(--shadow-soft);              /* Same as rest — no glow (11 Nov 2026) */
    transform: none;                             /* No lift (Figma cards are flat) */
}

/* ==========================================================================
   STAT CARDS - Dashboard KPIs
   ========================================================================== */

.stat-card {
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    cursor: pointer;
    overflow: hidden;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.stat-icon.blue {
    background: rgba(33, 150, 243, 0.3);
    border: 1px solid rgba(33, 150, 243, 0.4);
    color: var(--ts-blue-light);
}

.stat-icon.green {
    background: rgba(0, 230, 118, 0.3);
    border: 1px solid rgba(0, 230, 118, 0.4);
    color: #81C784;
}

.stat-icon.amber {
    background: rgba(255, 230, 0, 0.3);
    border: 1px solid rgba(255, 230, 0, 0.4);
    color: #FFE082;
}

/* 11 Nov 2026 (Figma tidy-up): stat icons no longer glow at rest or on hover. */

.stat-content { flex: 1; }

.stat-label {
    color: var(--text-label);
    display: block;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.75rem;
    font-weight: 600;
}

.stat-value {
    color: var(--pure-white);
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 2rem;
    line-height: 1;
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

.stat-trend.positive { color: var(--success-green); }
.stat-trend.warning { color: var(--electric-amber); }
.stat-trend.neutral { color: var(--starlight-silver); }

/* ==========================================================================
   CHART PANELS
   ========================================================================== */

.chart-panel {
    padding: 28px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.chart-title {
    color: var(--pure-white);
    font-size: 1.1rem;
    font-weight: 500;
}

/* ==========================================================================
   DATA TABLES - High Density Enterprise Style
   ========================================================================== */

.premium-table-card {
    overflow: hidden;
}

.premium-table-card .mud-table-container {
    background: transparent !important;
    border: none !important;
}

.cinematic-table .mud-table-container {
    background: transparent !important;
    border: none !important;
}

.cinematic-table th {
    background: var(--table-header-bg) !important;
    /* Figma Table header cell: Satoshi Medium 12/18, Mono/4, sentence case, 12px padding */
    color: var(--table-header-text) !important;
    font-weight: var(--font-weight-medium) !important;
    font-size: var(--font-size-xs) !important;
    line-height: 18px;
    letter-spacing: normal;
    text-transform: none;
    border-bottom: 1px solid var(--border-card) !important;
    padding: 12px !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 2 !important;
}

.cinematic-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    color: rgba(255, 255, 255, 0.85) !important;
    /* 11 Nov 2026: 12px sides like the header cell (Figma Table — both 12px), so every column's header and its
       values (and the tick boxes) line up. Was 16px, 4px right of the header. */
    padding: 10px 12px !important;
    font-size: var(--font-size-sm) !important;
    transition: all 0.2s ease;
}

.cinematic-table tr {
    transition: all 0.2s ease;
}

.cinematic-table tr:hover td {
    background: var(--surface-raised) !important;   /* Figma Table: hover = Mono/9+ (was an 8% blue tint) */
}

/* Table Cell Helpers — GLOBAL list typography (DESIGN_SYSTEM.md §1) */
.client-cell { display: flex; flex-direction: column; line-height: 1.4; }
.client-name { font-weight: var(--font-weight-medium); color: var(--pure-white); font-size: var(--font-size-sm); }
.site-name { font-size: var(--font-size-xs); color: var(--starlight-silver); }
/* 11 Sep 2026 (multi-job audit): a second line under a table cell value — "share of £X" — same size and colour as .site-name, never an inline style. */
.cell-sub { display: block; font-size: var(--font-size-xs); color: var(--starlight-silver); }

.engineer-cell { display: flex; align-items: center; gap: 10px; }
.engineer-avatar {
    background: rgba(33, 150, 243, 0.25) !important;
    color: var(--ts-blue-light) !important;
    font-size: var(--font-size-xs) !important;
    height: 32px !important;
    width: 32px !important;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

.type-tag {
    background: rgba(33, 150, 243, 0.25);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: var(--font-size-xs);
    color: var(--ts-blue-light);
    border: 1px solid rgba(33, 150, 243, 0.3);
}

.date-cell { color: var(--starlight-silver); font-size: var(--font-size-sm); }
.date-cell.overdue { color: var(--error-red); font-weight: var(--font-weight-semibold); }

.font-mono {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: var(--starlight-silver) !important;
    font-size: var(--font-size-sm) !important;
}

/* Shared list row helpers — use on any *List*.razor table cell */
.list-cell-primary { font-size: var(--font-size-sm); color: var(--pure-white); }
.list-cell-secondary { font-size: var(--font-size-sm); color: var(--starlight-silver); }
.list-cell-meta { font-size: var(--font-size-sm); color: var(--text-muted); }
.list-cell-amount { font-size: var(--font-size-sm); font-weight: var(--font-weight-semibold); color: var(--pure-white); }
.list-cell-amount-success { font-size: var(--font-size-sm); font-weight: var(--font-weight-semibold); color: var(--success-green); }
.list-cell-amount-warning { font-size: var(--font-size-sm); font-weight: var(--font-weight-semibold); color: var(--electric-amber); }
.list-cell-link { font-size: var(--font-size-sm); color: var(--ts-blue); font-weight: var(--font-weight-medium); text-decoration: none; }
.list-inactive-chip { font-size: var(--font-size-sm) !important; height: auto; }
.job-ref { font-size: var(--font-size-sm); color: var(--starlight-silver); font-weight: var(--font-weight-medium); }
/* Wave C (8 Sep 2026): BLUE = a jump to ANOTHER record, and only that. A row's own reference stays
   white (.job-ref). inline-flex so two jumps can sit in one cell ("Client / Site"). */
.job-ref-link { display: inline-flex; align-items: center; gap: 4px; font-size: var(--font-size-sm); color: var(--ts-blue) !important; font-weight: var(--font-weight-medium); text-decoration: none !important; cursor: pointer; }
.job-ref-link:hover { text-decoration: underline !important; }
.item-subtitle { font-size: var(--font-size-sm); color: var(--text-muted); margin-top: 2px; }
.description-muted { font-size: var(--font-size-sm); color: var(--starlight-silver); }
.expiring-date { font-size: var(--font-size-sm); color: var(--electric-amber) !important; }
.paid-amount { color: var(--success-green); font-size: var(--font-size-sm); }
.outstanding-amount { font-size: var(--font-size-sm); color: var(--electric-amber); }
.part-paid-hint { font-size: var(--font-size-sm); color: var(--text-muted); }
.overdue-days { font-size: var(--font-size-sm); color: var(--error-red); }

/* Legacy workspace-hero titles on list pages — align with page-title scale */
.premium-workspace .hero-title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--pure-white);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}
.premium-workspace .hero-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin: 4px 0 0 0;
}
.premium-workspace .page-breadcrumb {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

/* ==========================================================================
   BUTTONS - Premium with Glow (GLOBAL 2 — locked)
   Only primary actions carry glow (--glow-heavy). Tools are blue-weighted.
   ========================================================================== */

/* ==========================================================================
   Disabled buttons look OFF, not broken (owner rule, 9 Sep 2026)
   "A green button with no text looks like a render issue." The theme forces vivid fills, white
   text and a glow on its buttons and never defined a disabled state, so a disabled button kept
   its colour while MudBlazor faded the text. Now every disabled filled / outlined button has an
   honest off look — flat dark fill, dimmed text, no glow, not-allowed cursor — and turns back to
   its colour the moment the form is ready. A BUSY button (it carries a spinner while saving or
   sending) keeps its colour so the user sees the work happening. Say WHY a button is off with a
   short note near the form; do not rely on a tooltip on a disabled button (it ignores the mouse).
   ========================================================================== */
button.mud-button-root:disabled:is(.mud-button-filled, .mud-button-outlined):not(:has(.mud-progress-circular)) {
    /* Figma Button State=disabled (4 Nov 2026) */
    background: var(--btn-disabled-bg) !important;
    background-image: none !important;
    color: var(--btn-disabled-text) !important;
    border: 1px solid var(--btn-disabled-border) !important;
    box-shadow: none !important;
    transform: none !important;
    cursor: not-allowed;
    pointer-events: auto;
}
button.mud-button-root:disabled:is(.mud-button-filled, .mud-button-outlined):not(:has(.mud-progress-circular)) .mud-icon-root {
    color: var(--btn-disabled-text) !important;
}

/* 16 Sep 2026 (owner: "no entry sign on every Create button — no gates!"): the 9 Sep disabled
   block above had been inserted BETWEEN `.btn-cinematic-primary,` and this partner selector,
   which joined every enabled primary button to the disabled rule — flat fill, dimmed text and a
   not-allowed cursor while perfectly clickable. The selector belongs here. Pinned by
   PrimaryButtonCursorPinTests. */
.btn-cinematic-primary,
.mud-button-root.mud-button-filled.mud-button-filled-primary.title-action-btn {
    /* Figma Button Type=Primary (4 Nov 2026): flat Blue/6, pill, no glow or lift. */
    background: var(--btn-primary-bg) !important;
    color: var(--pure-white) !important;
    border: none;
    padding: 10px 14px;
    border-radius: var(--btn-radius);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-sm);
    box-shadow: none;
    transition: background-color 0.15s ease;
}

.btn-cinematic-primary:hover,
.mud-button-root.mud-button-filled.mud-button-filled-primary.title-action-btn:hover {
    background: var(--btn-primary-bg-hover) !important;
    box-shadow: none;
}

/* GLOBAL 2 — tool buttons (Edit columns, Export…): Figma Button Type=Secondary (4 Nov 2026) */
.columns-btn,
.mud-button-root.mud-button-outlined.columns-btn {
    background: var(--btn-secondary-bg) !important;
    border-color: var(--btn-secondary-border) !important;
    color: var(--btn-secondary-text) !important;
    font-weight: var(--font-weight-medium) !important;
}

.columns-btn:hover,
.mud-button-root.mud-button-outlined.columns-btn:hover {
    background: var(--btn-secondary-bg-hover) !important;
    border-color: var(--btn-secondary-border-hover) !important;
    color: var(--btn-secondary-text) !important;
    box-shadow: none !important;
}

/* GLOBAL 2 — primary create beside title */
.title-action-btn {
    font-weight: var(--font-weight-medium) !important;
    padding: 10px 14px !important;
}

/* ==========================================================================
   SEARCH BOX - Glass Effect
   ========================================================================== */

.search-box {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 320px;
    color: var(--starlight-silver);
    transition: all 0.3s ease;
}

.search-box:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.search-box:focus-within {
    background: rgba(33, 150, 243, 0.1);
    border-color: var(--glass-border-hover);
    box-shadow: var(--glow-low);
}

/* ==========================================================================
   GLOBAL 3 — StatusChip (legacy .status-chip bridge + component target)
   ONE size everywhere. Tokens only. Migrate pages to <StatusChip> component.
   ========================================================================== */

.status-chip,
.mud-chip.status-chip {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 4px 12px !important;
    border-radius: 999px !important;
    font-size: var(--font-size-xs) !important;
    font-weight: var(--font-weight-medium) !important;
    line-height: 1 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    height: auto !important;
    border: 1px solid transparent !important;
}

.status-chip.clickable,
.mud-chip.status-chip.clickable { cursor: pointer; }

/* Semantic status colours — approved palette only */
.status-chip.active, .status-chip.valid, .status-chip.approved,
.status-chip.complete, .status-chip.completed, .status-chip.paid,
.status-chip.published, .status-chip.green {
    background: color-mix(in srgb, var(--success-green) 15%, transparent) !important;
    color: var(--success-green) !important;
}

.status-chip.inactive, .status-chip.draft, .status-chip.closed,
.status-chip.archived, .status-chip.grey {
    background: color-mix(in srgb, var(--neutral-grey) 15%, transparent) !important;
    color: var(--starlight-silver) !important;
}

.status-chip.scheduled, .status-chip.sent, .status-chip.blue,
.status-chip.invoiced, .status-chip.info {
    background: color-mix(in srgb, var(--ts-blue) 15%, transparent) !important;
    color: var(--ts-blue-light) !important;
}

.status-chip.inprogress, .status-chip.onhold, .status-chip.pending,
.status-chip.warning, .status-chip.expiring, .status-chip.amber,
.status-chip.inreview, .status-chip.returned, .status-chip.orange {
    background: color-mix(in srgb, var(--electric-amber) 15%, transparent) !important;
    color: var(--electric-amber) !important;
}

.status-chip.cancelled, .status-chip.overdue, .status-chip.expired,
.status-chip.rejected, .status-chip.failed, .status-chip.danger, .status-chip.red {
    background: color-mix(in srgb, var(--error-red) 15%, transparent) !important;
    color: var(--error-red) !important;
}

.status-chip.cyan, .status-chip.conversion, .status-chip.pipeline {
    background: color-mix(in srgb, var(--info-cyan) 15%, transparent) !important;
    color: var(--info-cyan) !important;
}

/* ==========================================================================
   GLOBAL 5 — SectionPanel (legacy .section-panel bridge)
   Tokens only. No decorative hover glow. Migrate to <SectionPanel> component.
   ========================================================================== */

.section-panel {
    background: var(--charcoal-gradient);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    overflow: hidden;
}

.section-panel .panel-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--glass-border);
}

.section-panel .section-icon,
.section-panel .panel-header .section-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    flex-shrink: 0;
}

.section-panel .section-icon.blue, .section-panel .section-icon.primary { color: var(--ts-blue); background: color-mix(in srgb, var(--ts-blue) 15%, transparent); }
.section-panel .section-icon.green, .section-panel .section-icon.success { color: var(--success-green); background: color-mix(in srgb, var(--success-green) 15%, transparent); }
.section-panel .section-icon.amber, .section-panel .section-icon.warning, .section-panel .section-icon.orange { color: var(--electric-amber); background: color-mix(in srgb, var(--electric-amber) 15%, transparent); }
.section-panel .section-icon.red, .section-panel .section-icon.danger, .section-panel .section-icon.error { color: var(--error-red); background: color-mix(in srgb, var(--error-red) 15%, transparent); }
.section-panel .section-icon.cyan, .section-panel .section-icon.info { color: var(--info-cyan); background: color-mix(in srgb, var(--info-cyan) 15%, transparent); }
.section-panel .section-icon.grey, .section-panel .section-icon.neutral { color: var(--neutral-grey); background: color-mix(in srgb, var(--neutral-grey) 15%, transparent); }

.section-panel .panel-header h3,
.section-panel .section-title {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: var(--pure-white);
    margin: 0;
}

/* Filter bars — FormLabel above inputs (Global 4) */
.filter-bar .form-label-container {
    margin-top: 0;
    margin-bottom: 4px;
}

.filter-bar .filter-label {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--starlight-silver);
}


.search-box input {
    background: transparent;
    border: none;
    color: var(--pure-white);
    outline: none;
    width: 100%;
    font-size: 0.9rem;
}

.search-box input::placeholder {
    color: var(--starlight-silver);
}

/* ==========================================================================
   LAYOUT HELPERS - Dashboard & List Pages
   DESIGN SYSTEM UNIFIED (Jan 29, 2026)
   premium-layout = premium-workspace, layout-header = page-hero
   ========================================================================== */

/* Page container - full height with dark background */
.premium-layout,
.premium-workspace {
    min-height: 100vh;
    background: var(--deep-void, #030305);
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
}

/* Page header - title and actions */
.layout-header,
.page-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px; /* 26 Oct 2026: the title and the header buttons never touch */
    padding: 0 0 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 24px;
}

/* Page title - Large elegant style (matches .page-title) */
.premium-h1 {
    font-weight: 300;
    font-size: 2.5rem;
    letter-spacing: -0.5px;
    color: var(--pure-white);
    margin: 0;
}

/* Add gradient effect to premium-h1 when used as page title */
.premium-h1.gradient,
.title-gradient {
    /* 11 Nov 2026 (Figma "Jobs" page 85:4244, David): plain white page titles (was Blue/6 earlier today,
       before that a blue→cyan gradient). */
    background: none;
    color: var(--mono-0);
    -webkit-text-fill-color: var(--mono-0);
}

/* section-panel and section-card — Global 5: tokens only, NO decorative hover glow */
.section-panel,
.section-card {
    background: var(--charcoal-gradient);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    padding: 24px;
    box-shadow: var(--shadow-soft);
}

/* panel-header and section-header are now identical */
.panel-header,
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Icon + title row inside section-card headers (detail/view pages) */
.section-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

/* Icon + title row inside SIDEBAR card headers (detail/view pages).
   Global so no page can stack the icon above the title by omitting it. */
.sidebar-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-header h2,
.panel-header h3,
.section-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
    color: #FFFFFF;
}

/* Feb 12, 2026: Global section-title standard — consistent card titles across all pages.
   Overrides page-level variants (.compact .section-title, etc.) so every card heading
   uses the same size, weight, and colour. */
.section-title,
h3.section-title,
.section-card .section-title,
.section-card.compact .section-title {
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: #FFFFFF !important;
    margin: 0 !important;
    letter-spacing: 0.3px !important;
}

/* Feb 12, 2026: Global sidebar-title standard — consistent sidebar card headings.
   Overrides page-level .sidebar-title so every sidebar card (Quote Info, Assignees,
   Quick Actions, Notes, Tasks, Related, etc.) uses the same size as section-title. */
.sidebar-card .sidebar-title,
h4.sidebar-title {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #FFFFFF !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin: 0 !important;
}

/* Sidebar info row labels — slightly larger for readability */
.sidebar-card .info-row .info-label {
    font-size: 0.85rem !important;
    color: #94A3B8 !important;
    font-weight: 500 !important;
}

.sidebar-card .info-row .info-value {
    font-size: 0.9rem !important;
    color: #FFFFFF !important;
    font-weight: 600 !important;
}

/* Section body for content */
.section-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Detail view vertical rhythm — GLOBAL (Jobs, Clients, Sites, etc.)
   One flex gap drives stack spacing; cards must not add outer margins.
   Stops per-page <style> leaks (e.g. activity-hub-card margins) doubling gaps. */
.premium-workspace .detail-container .detail-layout .main-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

.premium-workspace .detail-container .detail-layout .main-content > * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Contract page charts (9 Sep 2026): gauge · months · per-job, one row; stack on narrow screens. */
.contract-charts-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr) minmax(0, 1.3fr);
    gap: 16px;
    margin-bottom: 16px;
}
.contract-charts-grid > .contract-chart-card { min-width: 0; }
.contract-chart-caption {
    margin: 4px 0 0;
    color: var(--starlight-silver);
    font-size: var(--font-size-xs);
    text-align: center;
}
@media (max-width: 1200px) {
    .contract-charts-grid { grid-template-columns: minmax(0, 1fr); }
}

.premium-workspace .detail-container .detail-layout .main-content .two-column-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 0 !important;
}

/* 9 Sep 2026: a card on its own in a two-column grid takes the whole row (contract page: history without notes). */
.premium-workspace .detail-container .detail-layout .main-content .two-column-grid > .section-card:only-child { grid-column: 1 / -1; }
/* 17 Sep 2026 (owner, WS-XM-01): a lone card spans the row, so its label/value list flows into two columns — never one
   column in a wide card. Collapses with the grid on narrow screens (media rule below). */
.premium-workspace .detail-container .detail-layout .main-content .two-column-grid > .section-card:only-child .info-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 32px;
    row-gap: 12px;
}
@media (max-width: 1100px) {
    .premium-workspace .detail-container .detail-layout .main-content .two-column-grid > .section-card:only-child .info-list { grid-template-columns: 1fr; }
}

.premium-workspace .detail-container .detail-layout .main-content .two-column-grid > .section-card {
    margin: 0 !important;
}

.premium-workspace .detail-container .detail-layout .sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.premium-workspace .detail-container .detail-layout .sidebar > .sidebar-card {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.premium-workspace .detail-container .activity-hub-card,
.premium-workspace .detail-container .activity-hub-card.top-card {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

@media (max-width: 900px) {
    .premium-workspace .detail-container .detail-layout .main-content .two-column-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   DETAIL PAGE PRIMITIVES — GLOBAL (16 Sep 2026, HR sweep WS-HR-26)
   Twenty-seven detail pages carried these "verbatim from JobDetailsView" in their own <style>.
   They live here once. A page-local copy still wins where one remains (it loads later), so
   promoting them changes nothing until a page deletes its copy — which is the wave's job.
   Global 5 applies: tokens only, no decorative hover glow on cards.
   ========================================================================== */
.premium-workspace .detail-container .detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
}

.sidebar-card {
    background: var(--charcoal-gradient);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-soft);
}

.sidebar-header-left { display: flex; align-items: center; gap: 10px; }

/* 17 Sep 2026 (owner design walk, WS-HS-38): the sidebar CARD header lives here once. The bare `.sidebar-header`
   near the top of this file is the NAVIGATION rail's header (70px, centred) — a name collision — which is why
   every detail page kept its own copy of this rule, and none of those copies wrapped: a long title plus a count
   chip pushed straight past the card edge (Communication Register on the method statement page). Scoped to the
   card (0,2,0) so it beats both the nav rule and any page-local `.sidebar-header {}` regardless of load order. */
.sidebar-card .sidebar-header {
    height: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 0;
    border-bottom: none;
    margin-bottom: 16px;
}
.sidebar-card .sidebar-header-left { min-width: 0; }

.quick-actions { display: flex; flex-direction: column; gap: 8px; }
.quick-actions .mud-menu { width: 100% !important; }
.quick-actions .mud-menu > .mud-menu-activator { width: 100% !important; }
.quick-action-btn { justify-content: flex-start !important; width: 100% !important; }

/* Activity list — the one row primitive for "things about this record" (kit, training, H&S, pulse). */
.activity-list { display: flex; flex-direction: column; gap: 12px; }
.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.activity-item:last-child { border-bottom: none; }
.activity-item.clickable { cursor: pointer; }
.activity-item.clickable:hover .activity-value { color: var(--text-link); }
.activity-icon { color: var(--starlight-silver); }
.activity-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.activity-label { font-size: var(--font-size-xs); color: var(--starlight-silver); text-transform: uppercase; }
.activity-value { font-size: var(--font-size-sm); color: var(--pure-white); }

.description-text {
    color: var(--starlight-silver);
    font-size: var(--font-size-sm);
    line-height: 1.7;
    margin: 0;
}

/* Stat row — numbers-first strip inside a card (leave, training, H&S). Colour says the tone. */
.stat-row { display: flex; justify-content: space-around; flex-wrap: wrap; gap: 16px; margin-bottom: 12px; }
.stat-row .stat { display: flex; flex-direction: column; align-items: center; min-width: 72px; }
.stat-row .stat-value { font-size: 1.5rem; font-weight: 700; color: var(--ts-blue); line-height: 1.2; }
.stat-row .stat-value.stat-good { color: var(--success-green); }
.stat-row .stat-value.stat-bad { color: var(--error-red); }
.stat-row .stat-value.stat-warn { color: var(--electric-amber); }
.stat-row .stat-value.stat-info { color: var(--info-cyan); }
.stat-row .stat-label { font-size: var(--font-size-xs); color: var(--starlight-silver); text-transform: uppercase; text-align: center; }

.info-value.mono { font-family: var(--font-mono, monospace); }

.empty-message { color: var(--text-muted); font-size: var(--font-size-sm); margin: 0; }

@media (max-width: 1024px) {
    .premium-workspace .detail-container .detail-layout { grid-template-columns: 1fr; }
    .premium-workspace .detail-container .detail-layout .sidebar { flex-direction: row; flex-wrap: wrap; }
    .premium-workspace .detail-container .detail-layout .sidebar > .sidebar-card { flex: 1; min-width: 280px; }
}

/* Form content container */
.form-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Helper text styling */
.helper-text {
    font-size: 12px;
    color: rgba(148, 163, 184, 0.7);
    margin: 8px 0 0 0;
}

/* ============================================================================ */

.premium-subtitle {
    color: var(--starlight-silver);
    margin: 6px 0 0 0;
    font-size: 0.95rem;
}

.header-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    color: var(--starlight-silver);
    font-size: 0.9rem;
}

.action-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Dashboard Grid */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); /* Responsive grid as specified */
    gap: 24px;
}

.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
    gap: 24px;
}

/* ==========================================================================
   🔒 FORM INPUTS - UNIFIED PREMIUM STYLING (LOCKED Dec 18, 2025)
   All inputs across all pages MUST use this styling
   4 Nov 2026 (Myth Figma tidy-up): values now come from the --input-* tokens
   (Figma "Text field"): Mono/9 fill, Mono/8 border, 20px pill, 44px tall, Blue/5 focus.
   ========================================================================== */

/* --- BASE INPUT CONTAINER (Both Filled & Outlined) --- */
.mud-input-control {
    margin-bottom: 0 !important;
}

/* --- FILLED VARIANT --- */
.mud-input-filled,
.mud-input.mud-input-filled {
    background: var(--input-bg) !important;
    border: 1px solid var(--input-border) !important;
    border-radius: var(--input-radius) !important;
    transition: border-color 0.15s ease !important;
}

.mud-input-filled:hover,
.mud-input.mud-input-filled:hover {
    background: var(--input-bg) !important;
    border-color: var(--input-border-hover) !important;
}

.mud-input-filled.mud-input-focused,
.mud-focused .mud-input-filled,
.mud-input.mud-input-filled.mud-input-focused {
    background: var(--input-bg) !important;
    border-color: var(--input-border-focus) !important;
    box-shadow: inset 0 0 0 0.5px var(--input-border-focus) !important; /* 1.5px total */
}

/* Remove default filled underline */
.mud-input-filled .mud-input-underline::before,
.mud-input-filled .mud-input-underline::after {
    display: none !important;
}

/* --- OUTLINED VARIANT --- */
.mud-input-outlined,
.mud-input.mud-input-outlined,
.mud-input-outlined .mud-input-slot {
    background: var(--input-bg) !important;
    border-radius: var(--input-radius) !important;
}

/* The box carries the fill; the inner slot stays clear so selects, textareas and fields
   with icons never show a "box inside a box". */
.mud-input.mud-input-outlined .mud-input-slot,
.mud-input.mud-input-filled .mud-input-slot {
    background: transparent !important;
}

.mud-input-outlined .mud-input-outlined-border {
    border-color: var(--input-border) !important;
    border-width: 1px !important;
    border-radius: var(--input-radius) !important;
    transition: border-color 0.15s ease !important;
}

.mud-input-outlined:hover .mud-input-outlined-border {
    border-color: var(--input-border-hover) !important;
}

.mud-input-outlined.mud-input-focused .mud-input-outlined-border,
.mud-focused .mud-input-outlined .mud-input-outlined-border,
.mud-input-control.mud-input-focused .mud-input-outlined .mud-input-outlined-border,
.mud-picker.mud-picker-open .mud-input-outlined .mud-input-outlined-border {
    border-color: var(--input-border-focus) !important;
    border-width: 1.5px !important;
    box-shadow: none !important;
}

/* Textarea: 16px radius (Figma "Textarea") */
.mud-input.mud-input-outlined:has(textarea),
.mud-input.mud-input-outlined:has(textarea) .mud-input-outlined-border,
.mud-input.mud-input-filled:has(textarea) {
    border-radius: var(--textarea-radius) !important;
}

/* 44px one-line fields: 10px + 24px line + 10px (outlined only — filled keeps room for its label) */
.mud-input.mud-input-outlined:not(:has(textarea)) input.mud-input-slot {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    line-height: 24px !important;
    height: 24px;
}
.mud-input.mud-input-outlined div.mud-input-slot.mud-select-input:not([style*="display:none"]):not([style*="display: none"]) {
    box-sizing: border-box;
    min-height: 44px;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    display: flex !important;
    align-items: center !important;
}
.mud-input-control .mud-input-label-outlined:not(.mud-shrink) {
    transform: translate(14px, 12px) scale(1) !important;
}

/* --- LABELS - CONSISTENT ABOVE-FIELD STYLE --- */
.mud-input-label {
    color: var(--input-label) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    letter-spacing: normal !important;
}

/* Label when focused */
.mud-input-focused .mud-input-label,
.mud-focused .mud-input-label,
.mud-input-control.mud-input-control-focused .mud-input-label {
    color: var(--input-label) !important; /* Figma: labels do not change colour on focus */
}

/* Shrunk/floated label - ensure visibility */
.mud-input-label.mud-input-label-animated.mud-shrink,
.mud-input-label-filled.mud-shrink,
.mud-input-label-outlined.mud-shrink {
    transform: translate(12px, -9px) scale(0.85) !important;
    background: var(--surface-card) !important; /* masks the border; fields mostly sit on cards */
    padding: 0 6px !important;
    color: var(--input-label) !important;
}

/* Label focused + shrunk */
.mud-input-focused .mud-input-label.mud-shrink,
.mud-focused .mud-input-label.mud-shrink {
    color: var(--input-label) !important;
}

/* --- INPUT TEXT --- */
/* Feb 2, 2026: Ensure consistent cursor (caret) color across ALL input types */
.mud-input-control input,
.mud-input-control textarea,
.mud-input-slot input,
.mud-input-slot textarea,
.mud-select-input,
textarea.mud-input-slot,
input.mud-input-slot {
    color: var(--input-text) !important;
    font-size: 14px !important;
    caret-color: var(--input-text) !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
}

/* Explicit textarea styling for multiline fields (Lines > 1) */
.mud-input-outlined textarea,
.mud-input-filled textarea {
    caret-color: var(--pure-white) !important;
    color: var(--pure-white) !important;
    background: transparent !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
    margin-left: 0 !important;
}

/* Ensure textarea container padding matches single-line inputs */
.mud-input-outlined .mud-input-slot:has(textarea),
.mud-input-filled .mud-input-slot:has(textarea) {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Feb 4, 2026: Fix two-tone appearance on multiline textarea fields */
/* Remove inner slot background when textarea is present - outer container handles it */
.mud-input-outlined .mud-input-slot:has(textarea),
.mud-input-control:has(textarea) .mud-input-slot {
    background: transparent !important;
}

/* Feb 4, 2026: Added textarea for multiline field consistency */
.mud-input-control input::placeholder,
.mud-input-slot input::placeholder,
.mud-input-control textarea::placeholder,
.mud-input-slot textarea::placeholder {
    color: var(--input-placeholder) !important;
}

/* Feb 4, 2026: FormLabel consistency - ensure same height with/without tooltip icons */
/* GLOBAL 4 — locked form label (see Components/Form/FormLabel.razor) */
.form-label-container {
    margin-top: 12px;
    margin-bottom: 4px;
}

.form-label-row {
    min-height: 24px !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px;
}

.form-label {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--input-label);
    letter-spacing: normal;
    line-height: 1.4;
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.form-label .required {
    color: var(--input-border-error);
    font-weight: var(--font-weight-medium);
    margin-left: 2px;
}

.form-label-container:first-child,
.mud-grid-item .form-label-container:first-child {
    margin-top: 0;
}

.form-label-row .tooltip-icon {
    color: var(--starlight-silver);
    cursor: help;
    opacity: 0.7;
}

.form-label-row .tooltip-icon:hover {
    opacity: 1;
    color: var(--ts-blue);
}

/* Feb 4, 2026: MudGrid side-by-side field alignment */
.mud-grid-item {
    display: flex;
    flex-direction: column;
}

/* --- SELECT DROPDOWNS --- */
.mud-select .mud-input-slot {
    background: transparent !important;
    border-radius: var(--input-radius) !important;
}

.mud-select.mud-select-outlined .mud-input-outlined-border {
    border-color: var(--input-border) !important;
}

.mud-select.mud-select-outlined:hover .mud-input-outlined-border {
    border-color: var(--input-border-hover) !important;
}

.mud-select.mud-select-outlined.mud-input-focused .mud-input-outlined-border {
    border-color: var(--input-border-focus) !important;
    border-width: 1.5px !important;
    box-shadow: none !important;
}

/* Select dropdown icon */
.mud-select .mud-input-adornment svg {
    color: rgba(255, 255, 255, 0.5) !important;
}

.mud-select:hover .mud-input-adornment svg,
.mud-select.mud-input-focused .mud-input-adornment svg {
    color: var(--ts-blue) !important;
}

/* --- ADORNMENT ICONS --- */
.mud-input-adornment {
    color: rgba(255, 255, 255, 0.4) !important;
}

.mud-input-focused .mud-input-adornment,
.mud-focused .mud-input-adornment {
    color: var(--ts-blue) !important;
}

/* --- DATE PICKERS --- */
.mud-picker .mud-input-outlined-border {
    border-color: var(--input-border) !important;
    border-radius: var(--input-radius) !important;
}

.mud-picker:hover .mud-input-outlined-border {
    border-color: var(--input-border-hover) !important;
}

.mud-picker.mud-picker-open .mud-input-outlined-border {
    border-color: var(--input-border-focus) !important;
    border-width: 1.5px !important;
    box-shadow: none !important;
}

/* --- AUTOCOMPLETE --- */
.mud-autocomplete .mud-input-outlined-border {
    border-color: var(--input-border) !important;
    border-radius: var(--input-radius) !important;
}

.mud-autocomplete:hover .mud-input-outlined-border {
    border-color: var(--input-border-hover) !important;
}

.mud-autocomplete.mud-input-focused .mud-input-outlined-border {
    border-color: var(--input-border-focus) !important;
    border-width: 1.5px !important;
    box-shadow: none !important;
}

/* --- NUMERIC FIELDS --- */
.mud-input-control-type-number .mud-input-outlined-border {
    border-color: var(--input-border) !important;
}

/* --- LINE LIBRARY TYPEAHEAD (free-type + optional suggestions) --- */
.line-lib-combo {
    position: relative;
    width: 100%;
}

/* 13 Nov 2026 (Simon on live): the list opens in MudBlazor's popover layer via <LineLibSuggestionMenu>, so a card's
   overflow: hidden can no longer cut it off. It must never position itself inside the field again. */
.line-lib-popover { margin-top: 4px; }

.line-lib-menu {
    max-height: 280px;
    overflow-y: auto;
    background: var(--deep-void);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
    padding: 4px;
}

.line-lib-menu-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    color: var(--pure-white);
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
}

.line-lib-menu-item:hover,
.line-lib-menu-item.is-active {
    background: rgba(33, 150, 243, 0.16);
}

.line-lib-menu-title {
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.3;
}

.line-lib-menu-meta {
    font-size: 0.75rem;
    color: var(--starlight-silver);
    line-height: 1.3;
}

/* --- DISABLED STATE --- */
.mud-input-control.mud-disabled .mud-input-slot,
.mud-input-control.mud-disabled input {
    opacity: 1 !important;
    color: var(--input-disabled-text) !important;
    cursor: not-allowed !important;
}
.mud-input-control.mud-disabled .mud-input.mud-input-outlined,
.mud-input-control.mud-disabled .mud-input.mud-input-filled {
    background: var(--input-disabled-bg) !important;
}
.mud-input-control.mud-disabled .mud-input-label { color: var(--input-disabled-text) !important; }

/* --- ERROR STATE --- */
.mud-input-error .mud-input-outlined-border,
.mud-input-error .mud-input-filled,
.mud-input.mud-input-outlined.mud-input-error .mud-input-outlined-border {
    border-color: var(--input-border-error) !important;
    border-width: 1.5px !important;
}

.mud-input-error .mud-input-label {
    color: var(--input-border-error) !important;
}
.mud-input-control .mud-input-helper-text { color: var(--input-helper); font-size: var(--font-size-xs); }
.mud-input-control .mud-input-helper-text.mud-input-error,
.mud-input-error .mud-input-helper-text { color: var(--input-border-error) !important; }

/* --- HELPER TEXT --- */
.mud-input-helper-text {
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 12px !important;
}

.mud-input-error .mud-input-helper-text {
    color: var(--error-red) !important;
}

/* ==========================================================================
   BREADCRUMBS
   ========================================================================== */

.mud-breadcrumbs-item {
    color: var(--starlight-silver) !important;
    font-size: 0.9rem;
}

.mud-breadcrumbs-item:hover {
    color: var(--pure-white) !important;
}

/* ==========================================================================
   NAV MENU STYLING - Premium Cursor-Following Glow
   ========================================================================== */

/* ==========================================================================
   NAV GROUP - Active Module Highlighting (Jan 29, 2026)
   When a child nav link is active, highlight the parent group header
   ========================================================================== */

/* Nav group header that contains an active child - Use :has() selector */
.mud-nav-group:has(.mud-nav-link.active) > .mud-list-item {
    background: rgba(33, 150, 243, 0.15)!important;
    border-left: 3px solid var(--ts-blue) !important;
    border-radius: 0 10px 10px 0 !important;
}

/* Nav group header icon when active */
.mud-nav-group:has(.mud-nav-link.active) > .mud-list-item .mud-icon-root {
    color: var(--ts-blue-light) !important;
}

/* Nav group header text when active */
.mud-nav-group:has(.mud-nav-link.active) > .mud-list-item .mud-list-item-text {
    color: var(--pure-white) !important;
    font-weight: 600 !important;
}

/* Expanded nav group indicator - subtle glow on the entire group */
.mud-nav-group.mud-expanded:has(.mud-nav-link.active) {
    background: rgba(33, 150, 243, 0.03);
    border-radius: 12px;
    margin: 4px 0;
}

/* Fallback for browsers without :has() - use expanded state as visual cue */
.mud-nav-group.mud-expanded > .mud-list-item {
    background: rgba(255, 255, 255, 0.03) !important;
}

/* ==========================================================================
   NAV LINK STYLING
   ========================================================================== */

.mud-nav-link {
    position: relative;
    border-radius: 10px !important;
    margin: 2px 0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    z-index: 1;
}

/* Nav item glow background that follows cursor */
.mud-nav-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        120px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(33, 150, 243, 0.25) 0%,
        transparent 60%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border-radius: 10px;
}

.mud-nav-link:hover::before {
    opacity: 1;
}

/* Subtle border glow effect */
.mud-nav-link::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    padding: 1px;
    background: linear-gradient(
        135deg,
        transparent 40%,
        rgba(33, 150, 243, 0.3) 50%,
        transparent 60%
    );
    background-size: 200% 200%;
    background-position: var(--mouse-x, 50%) var(--mouse-y, 50%);
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mud-nav-link:hover::after {
    opacity: 1;
}

/* Default nav link text - slightly muted for contrast with active */
.mud-nav-link .mud-nav-link-text {
    color: var(--starlight-silver) !important;
    font-weight: 400;
    transition: all 0.2s ease;
}

.mud-nav-link .mud-icon-root {
    color: var(--starlight-silver) !important;
    transition: all 0.2s ease;
}

/* Hover state - brighten but don't match active */
.mud-nav-link:hover {
    background: rgba(33, 150, 243, 0.1) !important;
    transform: translateX(4px);
}

.mud-nav-link:hover .mud-nav-link-text {
    color: var(--pure-white) !important;
}

.mud-nav-link:hover .mud-icon-root {
    color: var(--ts-blue-light) !important;
}

/* Active state with permanent glow - ENHANCED VISIBILITY (Jan 29, 2026) */
.mud-nav-link.active {
    background: rgba(33, 150, 243, 0.25)!important;
    border-left: 4px solid var(--ts-blue) !important;
    border-radius: 0 10px 10px 0 !important;
    box-shadow: none;   /* 11 Nov 2026: inner blue glow removed (Figma: no glow) */
    transform: translateX(2px);
}

/* Active link text - make it white and bold */
.mud-nav-link.active .mud-nav-link-text {
    color: var(--pure-white) !important;
    font-weight: 600 !important;
}

/* Active link icon - make it blue */
.mud-nav-link.active .mud-icon-root {
    color: var(--ts-blue-light) !important;
}

.mud-nav-link.active::before {
    background: radial-gradient(
        120px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(33, 150, 243, 0.35) 0%,
        transparent 60%
    );
    opacity: 0.5;
}

/* Nav Group Headers */
.mud-navmenu .mud-nav-group > .mud-collapse-wrapper > .mud-list-item-text {
    position: relative;
}

.mud-navmenu .mud-nav-group > .mud-collapse-wrapper > .mud-list-item-text::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(33, 150, 243, 0.3),
        transparent
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mud-navmenu .mud-nav-group:hover > .mud-collapse-wrapper > .mud-list-item-text::after {
    opacity: 1;
}

/* ==========================================================================
   CUSTOM SCROLLBAR
   ========================================================================== */

.custom-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.custom-scroll::-webkit-scrollbar-track { background: transparent; }
.custom-scroll::-webkit-scrollbar-thumb { 
    background: rgba(255, 255, 255, 0.15); 
    border-radius: 4px; 
}
.custom-scroll::-webkit-scrollbar-thumb:hover { 
    background: rgba(255, 255, 255, 0.25); 
}

/* ==========================================================================
   STATUS PILLS - Glowing Badges
   ========================================================================== */

.status-pill {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pill.active,
.status-pill.in-progress {
    background: rgba(33, 150, 243, 0.2);
    color: var(--ts-blue-light);
    border: 1px solid rgba(33, 150, 243, 0.4);
    box-shadow: none;
}

.status-pill.completed {
    background: rgba(0, 230, 118, 0.2);
    color: #81C784;
    border: 1px solid rgba(0, 230, 118, 0.4);
    box-shadow: none;
}

.status-pill.pending,
.status-pill.scheduled {
    background: rgba(255, 230, 0, 0.2);
    color: #FFE082;
    border: 1px solid rgba(255, 230, 0, 0.4);
    box-shadow: none;
}

/* Feb 2, 2026: Comprehensive status colors - consistent across all modules */

/* Draft - Orange/Amber */
.status-pill.draft {
    background: rgba(255, 152, 0, 0.2);
    color: #FFB74D;
    border: 1px solid rgba(255, 152, 0, 0.4);
    box-shadow: none;
}

/* Sent - Blue */
.status-pill.sent {
    background: rgba(33, 150, 243, 0.2);
    color: #64B5F6;
    border: 1px solid rgba(33, 150, 243, 0.4);
    box-shadow: none;
}

/* Review - Amber (needs attention) */
.status-pill.review {
    background: rgba(255, 193, 7, 0.2);
    color: #FFD54F;
    border: 1px solid rgba(255, 193, 7, 0.4);
    box-shadow: none;
}

/* Accepted, Paid, Completed - Green (success) */
.status-pill.accepted,
.status-pill.paid {
    background: rgba(0, 230, 118, 0.2);
    color: #81C784;
    border: 1px solid rgba(0, 230, 118, 0.4);
    box-shadow: none;
}

/* Rejected - Red */
.status-pill.rejected {
    background: rgba(255, 82, 82, 0.2);
    color: #EF9A9A;
    border: 1px solid rgba(255, 82, 82, 0.4);
    box-shadow: none;
}

/* Overdue - Red (warning) */
.status-pill.overdue {
    background: rgba(255, 82, 82, 0.2);
    color: #EF9A9A;
    border: 1px solid rgba(255, 82, 82, 0.4);
    box-shadow: none;
}

/* Cancelled, Voided, Expired, Archived - Gray */
.status-pill.cancelled,
.status-pill.voided,
.status-pill.expired,
.status-pill.archived,
.status-pill.closed {
    background: rgba(158, 158, 158, 0.2);
    color: #BDBDBD;
    border: 1px solid rgba(158, 158, 158, 0.4);
    box-shadow: none;
}

/* Part Paid - Amber (partial) */
.status-pill.part-paid,
.status-pill.partpaid {
    background: rgba(255, 152, 0, 0.2);
    color: #FFB74D;
    border: 1px solid rgba(255, 152, 0, 0.4);
    box-shadow: none;
}

/* Due - Blue */
.status-pill.due {
    background: rgba(33, 150, 243, 0.2);
    color: #64B5F6;
    border: 1px solid rgba(33, 150, 243, 0.4);
    box-shadow: none;
}

/* On Hold - Amber */
.status-pill.on-hold,
.status-pill.onhold {
    background: rgba(255, 152, 0, 0.2);
    color: #FFB74D;
    border: 1px solid rgba(255, 152, 0, 0.4);
    box-shadow: none;
}

/* ==========================================================================
   FILTER BAR - Uses Unified Input Styling Above
   ========================================================================== */

/* Filter bar layout */
.filter-bar {
    display: flex;
    gap: 16px;
    padding: 16px 24px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-bar .mud-input-control {
    min-width: 160px;
}

.filter-bar .search-field {
    flex: 1;
    min-width: 280px;
}

/* Force labels to float in filter bar (always show above) */
.filter-bar .mud-input-label,
.filter-bar .mud-select .mud-input-label {
    transform: translate(12px, -9px) scale(0.85) !important;
    background: var(--deep-void) !important;
    padding: 0 6px !important;
}

/* ==========================================================================
   MUD BLAZOR OVERRIDES
   ========================================================================== */

/* Ensure MudBlazor respects our theme */
.mud-theme-dark {
    --mud-palette-background: var(--surface-page) !important;
    --mud-palette-surface: var(--surface-card) !important;
    --mud-palette-primary: var(--ts-blue) !important;
    --mud-palette-text-primary: var(--pure-white) !important;
    --mud-palette-text-secondary: var(--starlight-silver) !important;
}

/* ==========================================================================
   Feb 10, 2026: GLOBAL OVERLAY STYLING - Glassmorphic Gold Standard
   GLOBAL OVERLAY STYLING - B+ Dialog & Overlay Standard (locked 2026-06-30)
   Covers ALL MudBlazor overlay components: Dialogs, Popovers, Menus,
   Pickers, Autocomplete dropdowns, Select dropdowns, MessageBoxes.
   Authority: backend/web/DESIGN_SYSTEM_DIALOGS_VISUAL.md
   ========================================================================== */

/* --- POPOVER PANELS (Select dropdowns, Autocomplete, Menus, Pickers) — lightweight tier --- */
.mud-popover-paper {
    background: var(--overlay-bplus-surface) !important;
    backdrop-filter: blur(var(--overlay-glass-blur)) !important;
    -webkit-backdrop-filter: blur(var(--overlay-glass-blur)) !important;
    border: 1px solid var(--overlay-lightweight-border) !important;
    border-radius: 12px !important;
    box-shadow: var(--overlay-lightweight-shadow) !important;
    color: var(--pure-white) !important;
}

/* --- POPOVER LIST TEXT (ensure all text in dropdowns is white) --- */
.mud-popover-paper .mud-typography,
.mud-popover-paper .mud-list-item-text,
.mud-popover-paper .mud-list-item-text * {
    color: var(--pure-white) !important;
}

.mud-popover-paper .mud-list-item-text .mud-typography-body1 {
    color: var(--pure-white) !important;
}

/* --- MENU PANELS --- */
.mud-menu {
    color: var(--pure-white) !important;
}

/* --- LIST ITEMS in dropdowns/menus (hover + selected) --- */
.mud-list-item {
    border-radius: 8px !important;
    margin: 2px 4px !important;
    /* Proof run B8 (26 Sep 2026): MudBlazor makes a list item 100% wide; with the 4px side margins above it was
       8px wider than its menu, so the Change Status menu and the client picker showed a stray horizontal
       scrollbar. The item now stops at the menu's edge. */
    max-width: calc(100% - 8px) !important;
    transition: all 0.15s ease !important;
    color: var(--pure-white) !important;
}

.mud-list-item:hover {
    background: rgba(33, 150, 243, 0.1) !important;
}

.mud-list-item.mud-selected {
    background: rgba(33, 150, 243, 0.2) !important;
}

.mud-list-item.mud-selected:hover {
    background: rgba(33, 150, 243, 0.25) !important;
}

/* --- PICKER CONTAINERS (Date/Time pickers popup panels) --- */
.mud-picker-container,
.mud-picker-paper,
.mud-picker .mud-popover-paper {
    background: var(--overlay-bplus-surface) !important;
    backdrop-filter: blur(var(--overlay-glass-blur)) !important;
    -webkit-backdrop-filter: blur(var(--overlay-glass-blur)) !important;
    border: 1px solid var(--overlay-lightweight-border) !important;
    border-radius: 12px !important;
    box-shadow: var(--overlay-lightweight-shadow) !important;
    color: var(--pure-white) !important;
}

/* Picker header/toolbar */
.mud-picker-toolbar {
    background: rgba(33, 150, 243, 0.1) !important;
    color: var(--pure-white) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.mud-picker-toolbar .mud-typography {
    color: var(--pure-white) !important;
}

/* Picker calendar/clock text */
.mud-picker-calendar-header .mud-typography,
.mud-picker-calendar-day,
.mud-picker-month,
.mud-picker-year,
.mud-picker-calendar .mud-button-label {
    color: var(--pure-white) !important;
}

/* Picker navigation buttons */
.mud-picker-nav-button-icon,
.mud-picker-calendar-header-switch .mud-button-label {
    color: var(--pure-white) !important;
}

/* Picker selected day/item */
.mud-picker-calendar-day.mud-current,
.mud-picker-calendar-day.mud-selected,
.mud-picker-month.mud-current,
.mud-picker-year.mud-current {
    background: var(--ts-blue) !important;
    color: var(--pure-white) !important;
}

/* Picker hover states */
.mud-picker-calendar-day:hover,
.mud-picker-month:hover,
.mud-picker-year:hover {
    background: rgba(33, 150, 243, 0.15) !important;
}

/* Picker action buttons */
.mud-picker-actions .mud-button-text {
    color: var(--ts-blue) !important;
}

/* Time picker clock face */
.mud-time-picker-clock {
    background: rgba(255, 255, 255, 0.04) !important;
}

.mud-time-picker-clock .mud-time-picker-minute,
.mud-time-picker-clock .mud-time-picker-hour {
    color: var(--pure-white) !important;
}

/* --- OVERLAY BACKDROP (modal tier — B+ 72%) --- */
.mud-overlay {
    background-color: var(--overlay-bplus-backdrop) !important;
}

/* 12 Oct 2026: the account-menu click-away layer (MainLayout) must stay invisible — never the dimmed
   modal backdrop above. Extra specificity so no page-level overlay rule can tint it. */
html body .mud-overlay.user-menu-click-away,
html body .mud-overlay.user-menu-click-away .mud-overlay-scrim {
    background-color: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* --- MESSAGE BOX (used for ShowMessageBox confirmations) — modal tier B+ --- */
.mud-message-box .mud-dialog {
    background: var(--overlay-bplus-surface) !important;
    backdrop-filter: blur(var(--overlay-glass-blur)) !important;
    -webkit-backdrop-filter: blur(var(--overlay-glass-blur)) !important;
    border: 1px solid var(--overlay-bplus-border-modal) !important;
    border-radius: 16px !important;
    box-shadow: var(--overlay-bplus-shadow-modal) !important;
}

.mud-message-box .mud-dialog-title,
.mud-message-box .mud-dialog-content .mud-typography {
    color: var(--pure-white) !important;
}

.mud-message-box .mud-dialog-content {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* --- INPUTS INSIDE DIALOGS (ensure they match page-level input styling) --- */
.mud-dialog .mud-input-outlined .mud-input-outlined-border {
    border-color: var(--input-border) !important;
}

.mud-dialog .mud-input-outlined:hover .mud-input-outlined-border {
    border-color: var(--input-border-hover) !important;
}

.mud-dialog .mud-input-outlined.mud-input-focused .mud-input-outlined-border,
.mud-dialog .mud-focused .mud-input-outlined .mud-input-outlined-border {
    border-color: var(--input-border-focus) !important;
    border-width: 1.5px !important;
    box-shadow: none !important;
}

.mud-dialog .mud-input-filled,
.mud-dialog .mud-input.mud-input-filled,
.mud-dialog .mud-input-outlined .mud-input-slot,
.mud-dialog .mud-input-outlined {
    background: var(--input-bg) !important;
}

/* 14 Oct 2026 (John, Add material box): multi-line boxes and dropdowns showed a "box inside a box".
   The rule above paints the outer box AND its inner slot. On a one-line field the slot fills the box,
   so the two layers stack into one even shade. A textarea or a select's slot is smaller than its box,
   so the second layer showed as an inset panel. (The 4 Feb page-level fix for textareas is
   out-specified inside dialogs.) Here the slot goes clear and the box carries the stacked shade. */
.mud-dialog .mud-input-outlined:has(textarea),
.mud-dialog .mud-select .mud-input-outlined {
    background: var(--input-bg) !important;
}

.mud-dialog .mud-input-outlined:has(textarea) .mud-input-slot,
.mud-dialog .mud-select .mud-input-outlined .mud-input-slot {
    background: transparent !important;
}

.mud-dialog .mud-input-filled:hover,
.mud-dialog .mud-input.mud-input-filled:hover {
    background: var(--input-bg) !important;
}

.mud-dialog .mud-input-control input,
.mud-dialog .mud-input-control textarea,
.mud-dialog .mud-input-slot input,
.mud-dialog .mud-input-slot textarea,
.mud-dialog .mud-select-input {
    color: var(--pure-white) !important;
    caret-color: var(--pure-white) !important;
}

/* Feb 12, 2026: Reposition floating labels in dialogs — show above field, not on border
   Matches the visual style of form pages which use <FormLabel> above the field.
   Applied globally to all dialogs for consistency.
   MudBlazor renders label AFTER input in DOM, so we use flexbox order to move it above. */

/* Make the input control a flex column so we can reorder children */
.mud-dialog .mud-input-control {
    display: flex !important;
    flex-direction: column !important;
}

/* Move label to top (before input) using order */
.mud-dialog .mud-input-label,
.mud-dialog .mud-input-label.mud-input-label-animated,
.mud-dialog .mud-input-label-outlined {
    position: relative !important;
    transform: none !important;
    order: -1 !important;
    font-size: 14px !important;               /* Figma label: Medium 14, Mono/3, sentence case */
    color: var(--input-label) !important;
    font-weight: 500 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    margin-bottom: 6px !important;
    padding: 0 !important;
    background: none !important;
    display: block !important;
    pointer-events: none !important;
}

/* Override shrunk/animated states — keep label static above field */
.mud-dialog .mud-input-label.mud-shrink,
.mud-dialog .mud-input-label.mud-input-label-animated.mud-shrink,
.mud-dialog .mud-input-label-outlined.mud-shrink {
    transform: none !important;
    background: none !important;
    padding: 0 !important;
    font-size: 14px !important;
}

/* Focused label in dialogs — blue highlight */
.mud-dialog .mud-input-focused .mud-input-label,
.mud-dialog .mud-focused .mud-input-label {
    color: var(--input-label) !important;
}

.mud-dialog .mud-input-control input::placeholder,
.mud-dialog .mud-input-slot input::placeholder,
.mud-dialog .mud-input-control textarea::placeholder {
    color: var(--input-placeholder) !important;
}

/* Dialog select dropdown icon */
.mud-dialog .mud-select .mud-input-adornment svg {
    color: rgba(255, 255, 255, 0.5) !important;
}

.mud-dialog .mud-select:hover .mud-input-adornment svg,
.mud-dialog .mud-select.mud-input-focused .mud-input-adornment svg {
    color: var(--ts-blue) !important;
}

/* Dialog helper/error text */
.mud-dialog .mud-input-helper-text {
    color: rgba(255, 255, 255, 0.5) !important;
}

.mud-dialog .mud-input-error .mud-input-helper-text {
    color: var(--error-red) !important;
}

.mud-dialog .mud-input-error .mud-input-outlined-border {
    border-color: var(--input-border-error) !important;
}

/* --- AUTOCOMPLETE POPOVER (higher specificity for portal-rendered panels) --- */
.mud-popover-provider .mud-popover-paper,
.mud-popover-cascading-value .mud-popover-paper {
    background: var(--overlay-bplus-surface) !important;
    backdrop-filter: blur(var(--overlay-glass-blur)) !important;
    -webkit-backdrop-filter: blur(var(--overlay-glass-blur)) !important;
    border: 1px solid var(--overlay-lightweight-border) !important;
    border-radius: 12px !important;
    box-shadow: var(--overlay-lightweight-shadow) !important;
}

/* No-matches text in autocomplete */
.mud-autocomplete-popover .mud-list-item-text,
.mud-popover-paper .mud-list-item-text {
    color: var(--pure-white) !important;
}

/* ==========================================================================
   GLOBAL STATUS/TYPE MENU ITEM COLORS - Reusable across all dropdowns
   ========================================================================== */

/* Generic menu item layout */
.status-menu-item,
.type-menu-item,
.priority-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px;
    font-weight: 500;
}

/* Job Types - Active work colors (no grey for active types) */
.type-menu-item.reactive { color: #64B5F6; }      /* Blue - reactive/callout */
.type-menu-item.ppm { color: #81C784; }           /* Green - planned maintenance */
.type-menu-item.eicr { color: #FFB74D; }          /* Orange - inspection */
.type-menu-item.remedial { color: #FF8A65; }      /* Coral - follow-up work */
.type-menu-item.install { color: #4DD0E1; }       /* Cyan - new installation */
.type-menu-item.survey { color: #BA68C8; }        /* Purple - survey/assessment */
.type-menu-item.pat { color: #F06292; }           /* Pink - PAT testing */
.type-menu-item.emergency-lighting { color: #FFF176; } /* Yellow - emergency lighting */
.type-menu-item.ev { color: #4DB6AC; }            /* Teal - EV charging */
.type-menu-item.minor-works { color: #90A4AE; }   /* Blue-grey - minor works */
.type-menu-item.project { color: #7986CB; }       /* Indigo - larger project */
.type-menu-item.quote { color: #90A4AE; }         /* Blue-grey - quote work */

/* Feb 4, 2026: Type chips for JobsList (match menu colors) */
.type-chip.reactive { background: rgba(100, 181, 246, 0.15) !important; color: #64B5F6 !important; }
.type-chip.ppm { background: rgba(129, 199, 132, 0.15) !important; color: #81C784 !important; }
.type-chip.eicr { background: rgba(255, 183, 77, 0.15) !important; color: #FFB74D !important; }
.type-chip.remedial { background: rgba(255, 138, 101, 0.15) !important; color: #FF8A65 !important; }
.type-chip.install { background: rgba(77, 208, 225, 0.15) !important; color: #4DD0E1 !important; }
.type-chip.survey { background: rgba(186, 104, 200, 0.15) !important; color: #BA68C8 !important; }
.type-chip.pat { background: rgba(240, 98, 146, 0.15) !important; color: #F06292 !important; }
.type-chip.emergencylighting { background: rgba(255, 241, 118, 0.15) !important; color: #FFF176 !important; }
.type-chip.ev { background: rgba(77, 182, 172, 0.15) !important; color: #4DB6AC !important; }
.type-chip.minorworks { background: rgba(144, 164, 174, 0.15) !important; color: #90A4AE !important; }

/* Forms template category pills — the locked six-category vocabulary
   (owner decision, 8 Jul 2026): Certificate green, Inspection blue,
   Checklist yellow, Health & Safety orange, Report cyan, Form neutral. */
.type-chip.cat-certificate { background: rgba(0, 230, 118, 0.15) !important; color: var(--success-green) !important; }
.type-chip.cat-inspection { background: rgba(100, 181, 246, 0.15) !important; color: var(--ts-blue-light) !important; }
.type-chip.cat-checklist { background: rgba(255, 230, 0, 0.12) !important; color: var(--electric-amber) !important; }
.type-chip.cat-healthsafety { background: rgba(255, 145, 0, 0.15) !important; color: var(--hot-orange) !important; }
.type-chip.cat-report { background: rgba(41, 214, 255, 0.15) !important; color: var(--info-cyan) !important; }
.type-chip.cat-form { background: rgba(148, 163, 184, 0.15) !important; color: var(--neutral-grey) !important; }
.type-chip.cat-siteassets { background: rgba(41, 214, 255, 0.15) !important; color: var(--info-cyan) !important; }
.type-chip.cat-memberforms { background: rgba(255, 193, 7, 0.15) !important; color: var(--warning-amber, #FFC107) !important; }

/* Priority Levels - Urgency colors */
.priority-menu-item.low { color: #81C784; }       /* Green - low priority */
.priority-menu-item.medium { color: #64B5F6; }    /* Blue - medium/normal */
.priority-menu-item.high { color: #FFB74D; }      /* Orange - high priority */
.priority-menu-item.critical { color: #EF5350; }  /* Red - critical */
.priority-menu-item.emergency { color: #FF5252; } /* Bright red - emergency */
.priority-menu-item.urgent { color: #FF7043; }    /* Deep orange - urgent */

/* Priority Chip Colors (Feb 6, 2026) - Match status-pill pattern */
.priority-chip.low { background: rgba(129, 199, 132, 0.15) !important; color: #81C784 !important; }
.priority-chip.medium { background: rgba(100, 181, 246, 0.15) !important; color: #64B5F6 !important; }
.priority-chip.high { background: rgba(255, 183, 77, 0.15) !important; color: #FFB74D !important; }
.priority-chip.critical { background: rgba(239, 83, 80, 0.15) !important; color: #EF5350 !important; }
.priority-chip.emergency { background: rgba(255, 82, 82, 0.15) !important; color: #FF5252 !important; }
.priority-chip.urgent { background: rgba(255, 112, 67, 0.15) !important; color: #FF7043 !important; }

/* Status dropdown menu-item colours — the ONE shared set (traffic-light canon, 22 Jul 2026).
   Must agree with StatusChipColorMapper so the icon in the dropdown always matches the pill.
   Pages must NOT redeclare .status-menu-item.* colours locally. */
.status-menu-item.draft { color: var(--status-silver); }
.status-menu-item.scheduled { color: var(--ts-blue-light); }
.status-menu-item.inprogress,
.status-menu-item.in-progress { color: var(--status-cobalt); }
.status-menu-item.onhold,
.status-menu-item.on-hold { color: var(--status-gold); }
.status-menu-item.completed { color: var(--status-emerald); }
.status-menu-item.invoiced { color: var(--status-teal); }
.status-menu-item.paid { color: var(--success-green); }
.status-menu-item.closed { color: var(--status-slate); }
.status-menu-item.cancelled { color: var(--status-graphite); }
.status-menu-item.archived { color: var(--status-graphite); }
.status-menu-item.sent { color: var(--ts-blue-light); }
.status-menu-item.review { color: var(--electric-amber); }
.status-menu-item.accepted { color: var(--status-lime); }
.status-menu-item.rejected { color: var(--error-red); }
.status-menu-item.due { color: var(--status-gold); }
.status-menu-item.overdue { color: var(--error-red); }
.status-menu-item.partpaid { color: var(--status-teal); }
.status-menu-item.voided { color: var(--status-graphite); }
.status-menu-item.active { color: var(--success-green); }
.status-menu-item.inactive { color: var(--status-silver); }

/* MudBlazor dropdown note: Dropdowns use position:fixed and close on click-outside */

/* Chips */
.mud-chip {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.mud-chip.mud-chip-color-primary {
    background: rgba(33, 150, 243, 0.2) !important;
    border-color: rgba(33, 150, 243, 0.4);
}

.mud-chip.mud-chip-color-success {
    background: rgba(0, 230, 118, 0.2) !important;
    border-color: rgba(0, 230, 118, 0.4);
}

.mud-chip.mud-chip-color-warning {
    background: rgba(255, 230, 0, 0.2) !important;
    border-color: rgba(255, 230, 0, 0.4);
}

.mud-chip.mud-chip-color-error {
    background: rgba(255, 82, 82, 0.2) !important;
    border-color: rgba(255, 82, 82, 0.4);
}

/* ==========================================================================
   KANBAN BOARD - Frosted Glass Columns & Draggable Cards
   ========================================================================== */

.kanban-board {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 20px 0;
    min-height: calc(100vh - 200px);
}

.kanban-column {
    min-width: 320px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.3s ease;
}

.kanban-column:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-hover);
}

.kanban-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 8px;
}

.kanban-column-title {
    color: var(--pure-white);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kanban-column-count {
    background: rgba(33, 150, 243, 0.2);
    color: var(--ts-blue-light);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.kanban-cards-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 200px;
}

.kanban-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    cursor: grab;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kanban-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--glass-border-hover);
    transform: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.kanban-card:active {
    cursor: grabbing;
    opacity: 0.8;
}

.kanban-card.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.kanban-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.kanban-card-client {
    font-weight: 500;
    color: var(--pure-white);
    font-size: 0.9rem;
    flex: 1;
}

.kanban-card-priority {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kanban-card-priority.high {
    background: rgba(255, 82, 82, 0.2);
    color: #EF9A9A;
    border: 1px solid rgba(255, 82, 82, 0.4);
}

.kanban-card-priority.medium {
    background: rgba(255, 230, 0, 0.2);
    color: #FFE082;
    border: 1px solid rgba(255, 230, 0, 0.4);
}

.kanban-card-priority.low {
    background: rgba(0, 230, 118, 0.2);
    color: #81C784;
    border: 1px solid rgba(0, 230, 118, 0.4);
}

.kanban-card-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.kanban-card-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(33, 150, 243, 0.25);
    border: 1px solid rgba(33, 150, 243, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ts-blue-light);
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.kanban-card-due-date {
    color: var(--starlight-silver);
    font-size: 0.8rem;
    flex: 1;
}

.kanban-card-due-date.overdue {
    color: var(--error-red);
    font-weight: 600;
}

/* ==========================================================================
   SMART NOTES BOARD (13 Nov 2026, WP2) - My Tasks > Notes
   The board is the kanban board above; these are only the differences: it sits
   inside a page (no full-height board), the three columns share the width, and
   a card is a post-it with a quiet tint. Tints are the pill tokens: amber for
   a note I wrote, blue for one a colleague shared with me. Tokens only.
   (14 Nov 2026: the tints became paper post-its in a colour the creator chooses; see below.)
   ========================================================================== */

.my-tasks-tab-switch {
    margin-top: 12px;
}

.notes-board-shell {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.notes-board-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.kanban-board.notes-board {
    min-height: 0;
    padding: 0;
    align-items: flex-start;
}

.kanban-column.notes-column {
    flex: 1 1 0;
    min-width: 280px;
}

/* 14 Nov 2026 (John, on a tablet): a note dragged by touch from the first column slid BEHIND the cards in the columns
   to its right. A touch drag moves the real card, the card stays inside its own column, and each column is its own
   layer (the glass blur), painted in page order. So the column holding the card being dragged is lifted above the
   others for as long as the drag lasts.
   "Being dragged" is told two ways, either is enough:
   - the board's own dragging class (MudDropContainer ItemDraggingClass="note-dragging"), set while a drag is on;
   - the card's inline transform while it is moving. EVERY resting card already carries
     "transform: translate3d(0px, 0px, 0px)" from MudBlazor, so that exact resting value is excluded: only a card
     that has actually been moved (translate3d(…, …, 10px)) counts. (First version matched every resting card, so all
     three columns were lifted and none was in front: WEB TESTER, 14 Nov.) */
.kanban-column.notes-column:has(.mud-drop-item.note-dragging),
.kanban-column.notes-column:has(.mud-drop-item[style*="translate3d"]:not([style*="translate3d(0px, 0px, 0px)"])) {
    z-index: 5;
}

.kanban-cards-container.notes-dropzone {
    min-height: 120px;
}

.notes-column-empty {
    margin: 0;
    color: var(--text-label);
    font-size: var(--font-size-sm);
}

/* 14 Nov 2026 (John: post-it look, option C). A note is a paper post-it in the colour its creator chose: light paper,
   dark writing, square corners with one curled, a glue strip along the top, a soft shadow and a very slight tilt.
   The tilt straightens when the note is pointed at, tabbed into or dragged, and is off for anyone whose device asks
   for reduced motion. Whose note it is is said in words on the card, not by colour. Tokens only. */
.kanban-card.note-card.note-paper {
    position: relative;
    min-height: 150px;
    padding: 30px 14px 14px;
    border: 0;
    border-radius: 2px 2px 16px 2px;
    background: var(--note-paper-yellow);
    color: var(--note-paper-ink);
    box-shadow: var(--note-paper-shadow);
}

.kanban-card.note-card.note-paper::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 22px;
    border-radius: 2px 2px 0 0;
    background: var(--note-paper-strip);
    pointer-events: none;
}

.kanban-card.note-card.note-paper-yellow { background: var(--note-paper-yellow); }
.kanban-card.note-card.note-paper-blue { background: var(--note-paper-blue); }
.kanban-card.note-card.note-paper-green { background: var(--note-paper-green); }
.kanban-card.note-card.note-paper-orange { background: var(--note-paper-orange); }

.kanban-card.note-card.note-paper:hover,
.kanban-card.note-card.note-paper:focus-within {
    box-shadow: var(--note-paper-shadow-lifted);
}

/* The tilt exists ONLY for people who have not asked for reduced motion. (16 Nov fix, TABLET TESTER: a separate
   "reduce" rule lower down lost to these two on specificity, so the tilt stayed on. Now there is nothing to out-rank.) */
@media (prefers-reduced-motion: no-preference) {
    .notes-dropzone .mud-drop-item:nth-child(odd) .note-paper {
        transform: rotate(-1.1deg);
    }

    .notes-dropzone .mud-drop-item:nth-child(even) .note-paper {
        transform: rotate(0.9deg);
    }
}

.notes-dropzone .mud-drop-item .note-paper:hover,
.notes-dropzone .mud-drop-item .note-paper:focus-within,
.notes-dropzone .mud-drop-item .note-paper:active,
.notes-dropzone .mud-drop-item.note-dragging .note-paper,
.notes-dropzone .mud-drop-item[style*="translate3d"]:not([style*="translate3d(0px, 0px, 0px)"]) .note-paper {
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .notes-dropzone .mud-drop-item .note-paper {
        transform: none;
        transition: none;
    }
}

/* Dark ink on the paper: the words, the small print, the menu dots, the arrow and links. */
.kanban-card.note-card.note-paper .note-card-text {
    color: var(--note-paper-ink);
}

/* The ⋮ menu dots. The site-wide icon-button rule (html button.mud-icon-button:not(…), light grey, !important) is made
   for dark surfaces and left the dots at under 2:1 on paper, so this one is written to out-rank it, on notes only.
   Pointing at the dots still shows the site-wide hover (white dots on a dark disc), which reads fine on paper. */
html .kanban-card.note-card.note-paper button.mud-icon-button {
    color: var(--note-paper-ink) !important;
}

.note-paper .note-card-badge,
.note-paper .kanban-card-due-date,
.note-paper .note-card-shared-arrow {
    color: var(--note-paper-ink-soft);
}

/* Out-ranks the site-wide link colour (light blue, made for dark surfaces), at rest and on hover. */
.notes-dropzone .kanban-card.note-card.note-paper a.note-card-link,
.notes-dropzone .kanban-card.note-card.note-paper a.note-card-link:hover {
    color: var(--note-paper-ink-link);
}

.note-paper .note-card-text:focus-visible {
    outline-color: var(--note-paper-ink-link);
}

/* The colour row in the New note box: four paper squares, each a button with its name. */
.note-colour-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.note-colour-swatch {
    display: inline-flex;
    align-items: flex-end;
    justify-content: center;
    width: 72px;
    height: 56px;
    padding: 0 0 6px;
    border: 2px solid var(--glass-border);
    border-radius: 2px 2px 12px 2px;
    color: var(--note-paper-ink);
    font: inherit;
    font-size: var(--font-size-xs);
    font-weight: 600;
    cursor: pointer;
}

.note-colour-swatch.note-colour-swatch-on {
    border-color: var(--pure-white);
    box-shadow: var(--note-paper-shadow);
}

.note-colour-swatch:focus-visible {
    outline: 2px solid var(--ts-blue-light);
    outline-offset: 2px;
}

.note-colour-swatch:disabled {
    cursor: default;
    opacity: 0.6;
}

.note-colour-swatch.note-paper-yellow { background: var(--note-paper-yellow); }
.note-colour-swatch.note-paper-blue { background: var(--note-paper-blue); }
.note-colour-swatch.note-paper-green { background: var(--note-paper-green); }
.note-colour-swatch.note-paper-orange { background: var(--note-paper-orange); }

.note-card-people {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.note-card-shared-arrow {
    color: var(--text-label);
}

/* The note itself: a real button so it opens from the keyboard, styled as plain text. */
.note-card-text {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 6;
    overflow: hidden;
    padding: 0;
    border: 0;
    background: none;
    color: var(--pure-white);
    font: inherit;
    font-size: var(--font-size-sm);
    line-height: 1.45;
    text-align: left;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    cursor: pointer;
}

.note-card-text:focus-visible {
    outline: 2px solid var(--ts-blue-light);
    outline-offset: 2px;
    border-radius: 4px;
}

.note-card-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.note-card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-link);
    font-size: var(--font-size-sm);
}

/* N1 (14 Nov 2026): the composer's Save note button while the box is empty. It LOOKS switched off, exactly as a
   disabled filled button does, but still takes the click, so a click straight after typing is never lost. An empty note
   is refused in code. */
.mud-button-filled.note-save-empty,
.mud-button-filled.note-save-empty:hover,
.mud-button-filled.note-save-empty:focus-visible {
    color: var(--mud-palette-action-disabled) !important;
    background-color: var(--mud-palette-action-disabled-background) !important;
    box-shadow: none !important;
    cursor: default;
}

/* Smart Notes WP3 (13 Nov 2026): whose note it is in words, the colleague picker's rows, the history list. */
.note-card-badge {
    color: var(--text-label);
    font-size: var(--font-size-xs);
}

.colleague-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.colleague-option-name {
    color: var(--pure-white);
    font-size: var(--font-size-sm);
}

.colleague-option-role {
    color: var(--text-label);
    font-size: var(--font-size-xs);
}

/* 14 Nov 2026 (John, on a tablet): choosing several colleagues is a list of tick boxes on the dialog itself, not a
   drop-down, so a tap always lands. The whole row is the tap target (44px or taller). */
.colleague-ticklist {
    display: flex;
    flex-direction: column;
    max-height: 264px;
    overflow-y: auto;
    padding: 4px 8px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
}

.colleague-tick,
.colleague-tick .mud-checkbox {
    width: 100%;
    min-height: 44px;
}

.activity-item.note-history-item {
    align-items: flex-start;
}

/* 15 Nov 2026 (Smart Notes replies): the replies at the bottom of a note's own window — the history list's look. */
.note-replies {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--glass-border);
}

.activity-item.note-reply-item {
    align-items: flex-start;
}

.note-reply-body {
    margin: 4px 0 0;
    color: var(--starlight-silver);
    font-size: var(--font-size-sm);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.note-replies-send {
    display: flex;
    justify-content: flex-end;
}

.note-history-previous {
    margin: 4px 0 0;
    padding: 8px 12px;
    border-left: 2px solid var(--glass-border);
    color: var(--starlight-silver);
    font-size: var(--font-size-sm);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* ==========================================================================
   SUMMARY CARDS - Glow Effect with Blue Gradients
   ========================================================================== */

.summary-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-left: 4px solid rgba(33, 150, 243, 0.4);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 16px;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, var(--ts-blue) 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.summary-card:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-hover);
    transform: none;
    box-shadow: var(--neon-glow), var(--shadow-elevated);
}

.summary-card:hover::before {
    opacity: 1;
}

.summary-card-glow {
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(33, 150, 243, 0.15) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.summary-card:hover .summary-card-glow {
    opacity: 1;
}

/* ==========================================================================
   RESPONSIVE LAYOUT - Desktop, Laptop, Tablet, Mobile
   Updated: Feb 2, 2026 - Added laptop breakpoint with collapsed sidebar
   Single file, no page changes needed
   ========================================================================== */

/* Generic utility for card grids inside pages (no per-page changes needed) */
.card-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

@media (min-width: 769px) and (max-width: 1400px) {
    
    /* Tables: horizontal scroll on narrow screens */
    .glass-table-card,
    .glass-table-wrapper,
    .premium-table-card {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Reduce content padding slightly */
    .content-scroll-area {
        padding: 24px;
    }
    
    /* Charts responsive */
    .charts-row {
        grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    }
    
    /* Stat cards */
    .stat-value {
        font-size: 1.75rem;
    }
    
    /* Kanban columns */
    .kanban-column {
        min-width: 280px;
    }
}

/* Tablet-specific adjustments (768px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Charts stack vertically on smaller tablets */
    .charts-row {
        grid-template-columns: 1fr;
    }
    
    /* Reduce content padding */
    .content-scroll-area {
        padding: 20px;
    }
}

/* ==========================================================================
   MOBILE (< 768px)
   ========================================================================== */
@media (max-width: 768px) {
    /* Sidebar: overlay mode on mobile */
    .cinematic-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        width: var(--sidebar-width);
        transform: translateX(-100%);
        z-index: 1000;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    }
    
    .cinematic-sidebar.open {
        transform: translateX(0);
    }
    
    .cinematic-sidebar.closed {
        transform: translateX(-100%);
        width: var(--sidebar-width); /* Keep width, just slide off */
    }
    
    /* Main content takes full width - no sidebar margin on mobile */
    .main-content-wrapper {
        width: 100%;
        margin-left: 0 !important;
    }
    
    /* Topbar adjustments */
    .cinematic-topbar {
        padding: 0 16px;
        height: 60px;
    }
    
    .topbar-left {
        gap: 4px;
    }
    
    /* Hide breadcrumbs on mobile */
    .cinematic-breadcrumbs {
        display: none;
    }
    
    /* User profile - hide text, show avatar only */
    .user-profile-trigger .d-md-flex {
        display: none !important;
    }
    
    /* Further reduce content padding */
    .content-scroll-area {
        padding: 16px;
    }
    
    /* Stats cards: 2 columns, then 1 on very small */
    .summary-grid,
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    /* Stat cards smaller */
    .stat-card {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-icon {
        width: 44px;
        height: 44px;
    }
    
    /* Smaller titles */
    .premium-h1, .analytics-title {
        font-size: 1.5rem;
    }
    
    .premium-subtitle {
        font-size: 0.85rem;
    }
    
    /* Header layout stacks */
    .layout-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .header-actions,
    .action-group {
        width: 100%;
        flex-wrap: wrap;
    }
    
    /* Filter bar wraps */
    .filter-bar {
        padding: 12px 16px;
        gap: 12px;
    }
    
    .filter-bar .search-field {
        min-width: 100%;
        order: -1; /* Search first on mobile */
    }
    
    .filter-bar .mud-input-outlined,
    .filter-bar .mud-select-outlined {
        min-width: 140px;
        flex: 1;
    }
    
    /* Search box full width */
    .search-box {
        width: 100%;
    }
    
    /* Kanban horizontal scroll */
    .kanban-board {
        padding: 16px 0;
    }
    
    .kanban-column {
        min-width: 260px;
        padding: 16px;
    }
    
    /* Summary cards padding */
    .summary-card {
        padding: 16px;
    }
    
    /* Charts smaller */
    .chart-panel {
        padding: 16px;
    }
    
    /* Dialog full width on mobile */
    .mud-dialog {
        margin: 16px !important;
        max-width: calc(100vw - 32px) !important;
    }
}

/* ==========================================================================
   SMALL MOBILE (< 480px)
   ========================================================================== */
@media (max-width: 480px) {
    /* Stats cards: 1 column */
    .summary-grid,
    .stats-row {
        grid-template-columns: 1fr;
    }
    
    /* Even smaller padding */
    .content-scroll-area {
        padding: 12px;
    }
    
    .stat-card {
        padding: 14px;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .premium-h1 {
        font-size: 1.25rem;
    }
    
    /* Kanban single column view */
    .kanban-column {
        min-width: 100%;
    }
    
    /* Table cells tighter */
    .cinematic-table th,
    .cinematic-table td {
        padding: 8px 12px !important;
        font-size: 0.8rem !important;
    }
}

/* Sidebar backdrop is now handled by .sidebar-backdrop element (see above, covers all breakpoints ≤1400px) */

/* ===== GLOBAL SEARCH BAR =====
   Figma "Operations dashboard" header, node 243:2636 (11 Nov 2026): a 320px pill, Mono/9 fill,
   Mono/8 border, radius 20px, 14px side padding, 20px search icon in Mono/5, 12px Mono/5
   placeholder. 11 Nov 2026 (David): always visible at every width — no search button; Enter
   searches, Escape clears. Below 1200px the pill shrinks to share the bar with the breadcrumbs. */

.global-search-container {
    display: flex;
    align-items: center;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 320px;
    height: 44px;
    box-sizing: border-box;
    background: var(--mono-9);
    border: 1px solid var(--mono-8);
    border-radius: 20px;
    padding: 0 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: border-color 0.15s ease;
}

.search-input-wrapper:focus-within {
    border-color: var(--mono-6);
}

.search-input-icon.mud-icon-root {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--mono-5);
}

.global-search-input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    color: var(--mono-0);
    font-family: inherit;
    font-size: 12px;
    line-height: 24px;
    padding: 0;
}

.global-search-input::placeholder {
    color: var(--mono-5);
    opacity: 1;
}

.search-input-wrapper {
    flex-shrink: 1;
}

@media (max-width: 1199px) {
    .search-input-wrapper {
        width: 240px;
        min-width: 160px;
    }
}

@media (max-width: 700px) {
    .global-search-container {
        flex: 1 1 auto;
        min-width: 0;
    }

    .search-input-wrapper {
        width: 100%;
        min-width: 0;
    }

    .global-search-input {
        font-size: 14px; /* 14px+ stops iOS zooming into the field */
    }
}

/* ==========================================================================
   🔒 GLOBAL DESIGN SYSTEM - UNIFIED COMPONENTS (Dec 19, 2025)
   Single source of truth for all UI patterns
   ========================================================================== */

/* ==========================================================================
   TEXT HIERARCHY - WCAG AA Compliant (Dec 31, 2025)
   All pages MUST use these classes - NO hardcoded colors
   ========================================================================== */

/* Primary text - Names, titles, values, main content */
.text-primary,
.row-primary,
.card-title {
    color: var(--pure-white) !important;
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-base);
}

/* Secondary text - Metadata, descriptions, supporting info */
.text-secondary,
.row-secondary {
    color: var(--starlight-silver) !important;
    font-weight: var(--font-weight-normal);
    font-size: var(--font-size-sm);
}

/* Muted text - ONLY for placeholders, disabled states */
.text-muted,
.row-meta {
    color: var(--text-muted) !important;
    font-weight: var(--font-weight-normal);
    font-size: var(--font-size-sm);
}

/* Accent text - Only for interactive/clickable elements */
.text-accent {
    color: var(--ts-blue) !important;
}

/* ==========================================================================
   SETTINGS CARD ARCHETYPE - the 2-up toggle card every Settings page uses
   21 Sep 2026 (owner, sweep row WS-SET-03, tidy T1): "global styles should be global".
   This trio was copy-pasted byte-identical into eight Settings pages and existed in no
   stylesheet, so the copies drifted (Client portal folded at 900px, the Automations form
   at 700px, everything else at 960px). One home, one breakpoint. Settings pages lay
   controls 2-up to fill the width (DESIGN_SYSTEM § 5, Settings page template) - never a
   label far-left with a toggle far-right and a dead corridor between them.
   A page-local copy is counted by DesignSystemHardeningTests and must stay at zero.
   ========================================================================== */
.settings-two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.settings-toggle-card { padding: 16px; border-radius: 12px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.06); display: flex; flex-direction: column; gap: 8px; }
.option-hint { color: var(--starlight-silver); font-size: var(--font-size-sm, 0.85rem); }

/* T8 (22 Sep 2026, WS-SET-14): when two section cards sit side by side, a toggle grid INSIDE one of
   them stacks to one column - half a page cannot hold two toggle cards a-breast. */
.settings-two-col > .ts-sectionpanel .settings-two-col { grid-template-columns: 1fr; }

@media (max-width: 960px) {
    .settings-two-col { grid-template-columns: 1fr; }
}

/* ==========================================================================
   DASHBOARD GRIDS (21 Oct 2026, John: owner console rebuild step 3 - "no gaps, cards equal size")
   One home for dashboard rows, so a page never carries its own copy:
   - .dash-grid-2: a wide main column (2 parts) beside a side column (1 part, never narrower
     than 300px) - e.g. "Needs your yes" beside Quick actions. One column at 1100px and below.
   - .dash-grid-even: two equal columns (e.g. a 2 x 2 of panels). One column at 900px and below.
   Both stretch every panel in a row to the same height, so side-by-side panels never leave a gap.
   Finance and Operations dashboards keep their own grids (gold pages, untouched).
   ========================================================================== */
.dash-grid-2,
.dash-grid-even {
    display: grid;
    gap: 16px;
    align-items: stretch;
}

.dash-grid-2 { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
.dash-grid-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Each panel fills its cell (equal heights) and may shrink, so a chart or a wide table never
   pushes the grid wider than the page. */
.dash-grid-2 > *,
.dash-grid-even > * { min-width: 0; }

.dash-grid-2 > .ts-sectionpanel,
.dash-grid-even > .ts-sectionpanel,
.dash-grid-2 > .section-card,
.dash-grid-even > .section-card { height: 100%; }

@media (max-width: 1100px) {
    .dash-grid-2 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
    .dash-grid-even { grid-template-columns: minmax(0, 1fr); }
}

/* 21 Oct 2026 (John, Owner Cockpit): .dash-grid-3 - three equal panels in a row (the owner Home's Pipeline / Health /
   Support), one column at 1100px and below, panels stretched to the same height. */
.dash-grid-3 {
    display: grid;
    gap: 16px;
    align-items: stretch;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.dash-grid-3 > * { min-width: 0; }
.dash-grid-3 > .ts-sectionpanel,
.dash-grid-3 > .section-card { height: 100%; }
@media (max-width: 1100px) {
    .dash-grid-3 { grid-template-columns: minmax(0, 1fr); }
}

/* 21 Oct 2026 (Owner Cockpit): a bar of exactly six stat cards stays in balanced rows - six across, 3 + 3 on a
   medium screen, 2 + 2 + 2 on a small one, one column on a phone (the five-card rule's twin, further down). */
.summary-bar:has(> div:nth-of-type(6):last-of-type) {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}
@media (max-width: 1400px) {
    .summary-bar:has(> div:nth-of-type(6):last-of-type) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
    .summary-bar:has(> div:nth-of-type(6):last-of-type) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
    .summary-bar:has(> div:nth-of-type(6):last-of-type) { grid-template-columns: 1fr; }
}

/* 22 Sep 2026 (owner sitting, row #207): "previews hidden at bottom of pages? Should be open to the
   side — like form builder." A Settings page whose look is what the reader is judging (Quotes &
   invoices look, Email look & sign-off) lays its fields on the left and a LIVE sample on the right.
   The sample pane sticks below the sticky Settings header (its height is published as
   --settings-hero-h by settingsShellFoot.watch) so it stays in view while the fields scroll.
   Same proportions as the form builder's one-editor-body split. */
.settings-preview-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(400px, 46%); gap: 24px; align-items: start; }
.settings-preview-form { min-width: 0; }
.settings-preview-pane { position: sticky; top: calc(var(--settings-hero-h, 150px) + 8px); min-width: 0; }
.settings-preview-pane .sample-preview-host { height: calc(100vh - var(--settings-hero-h, 150px) - 190px); min-height: 420px; }
@media (max-width: 1280px) {
    .settings-preview-split { grid-template-columns: 1fr; }
    .settings-preview-pane { position: static; }
    .settings-preview-pane .sample-preview-host { height: 70vh; }
}

/* ==========================================================================
   INFO LABELS & VALUES - Standard patterns for detail pages
   Use these instead of hardcoding in individual pages
   ========================================================================== */

/* Info Grid — a WIDE card with many short fields: label over value, flowing into 2–4 columns.
   17 Sep 2026 (owner, WS-XM-01): promoted from the gold Job/Quote pages (page-local until now). Use it in a
   full-width section-card with many fields; use .info-list only in the small two-up cards (two-column-grid).
   Never a single-column list in a wide card — it leaves half the card empty and doubles the scroll. */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}
.info-grid .info-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}
.info-grid .info-item.span-2 { grid-column: span 2; }
.info-grid .info-label {
    font-size: var(--font-size-xs);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-label);
}
.info-grid .info-value {
    color: var(--pure-white);
    font-weight: 500;
    font-size: var(--font-size-sm);
    word-break: break-word;
}

/* Info List — horizontal label: value layout (global standard)
   Used on Job View, Client View, Quote View, etc.
   Feb 12, 2026: Moved from page-level CSS to global for consistency */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-list .info-item {
    /* 2-col grid so every value starts in one aligned column regardless of label
       length (the old flex + inline label left values "in and out"). */
    display: grid;
    grid-template-columns: 150px 1fr;
    align-items: start;
    gap: 8px;
    padding: 0;
    border-bottom: none;
}

.info-list .info-label {
    font-size: 0.75rem;
    color: var(--text-label);
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    text-align: left;
    padding-top: 2px;
    margin-bottom: 0;
}

.info-list .info-label::after {
    content: ' -';
    color: #64748B;
}

.info-list .info-value {
    font-size: 0.9rem;
    color: var(--pure-white, #fff);
    text-align: left;
}

/* Labels - Category headers, field names (non-list context) */
.info-label,
.field-label,
.meta-label {
    font-size: var(--font-size-xs);        /* 12px minimum */
    color: var(--text-label);              /* muted label so the white VALUE leads; AA ~6.5:1 on dark cards */
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    margin-bottom: 4px;
    display: block;
}

/* Values - Field values, data content */
.info-value,
.field-value {
    font-size: var(--font-size-base);      /* 16px for readability */
    color: var(--pure-white);              /* 18:1 contrast - PASSES AAA */
    font-weight: var(--font-weight-medium);
    line-height: 1.4;
}

/* Links within values */
.info-value.link,
.field-value.link {
    color: var(--text-link);
    text-decoration: none;
}

.info-value.link:hover,
.field-value.link:hover {
    text-decoration: underline;
    color: #90CAF9;
}

/* Warning state for values */
.info-value.warning,
.field-value.warning {
    color: #FFB74D !important;
}

/* Empty/not-set state */
.info-value.empty,
.field-value.empty {
    color: var(--text-muted);
    font-style: italic;
}

/* ── Quick Action levels (colour = action category; reusable across modules) ──
   Primary = filled hot-orange (the single most-likely next step). Cyan = compliance/cert
   (MudTheme Info is blue, not cyan, so this gives the true cyan family). Greens
   (create/revenue) use Color.Success, yellows (state) Color.Warning, greys Color.Default. */
/* Standalone (reusable on hero action buttons too). !important beats Mud's own
   colour + the .quick-action-btn layout rule. Every non-primary action gets a border
   matching its text colour; only the primary is filled (hot-orange, dark text). */
.qa-primary {
    background-color: var(--hot-orange) !important;
    border-color: var(--hot-orange) !important;
    color: #0B0D10 !important;            /* dark text on orange for contrast */
    font-weight: 600;
}
/* Keep the primary orange on hover (force bg so Mud's hover overlay can't darken it) — it brightens, never darkens, matching the outlined buttons' light hover. */
.qa-primary:hover { background-color: var(--hot-orange) !important; filter: brightness(1.1); }
/* ROOT-CAUSE GLOBAL FIX (supersedes the weak .qa-primary:hover above):
   27 detail pages carry a page-local `.quick-action-btn:hover { background: rgba(255,255,255,.05) !important }`
   darkener at specificity (0,2,0), loaded AFTER this theme — it TIES the plain
   `.qa-primary:hover` (0,2,0) and wins on source order, painting the primary a faint
   white tint (reads as "going dark"). This selector is (0,4,0), so it beats every such
   page-local rule regardless of load order, on BOTH background and border. Never lower
   its specificity below `.mud-button-root.quick-action-btn.qa-primary:hover`. (§12.5) */
.mud-button-root.quick-action-btn.qa-primary:hover {
    background-color: var(--hot-orange) !important;
    border-color: var(--hot-orange) !important;
    filter: brightness(1.12);
}

/* Rich option rows for MudAutocomplete dropdowns (ref line + Site · Client subtitle).
   Global because the autocomplete popover renders outside the page component. */
.job-option { display: flex; flex-direction: column; gap: 2px; }
.job-option-ref { color: var(--pure-white); font-weight: 600; }
.job-option-sub { color: var(--starlight-silver); font-size: 0.8rem; }

.qa-cyan {
    color: var(--info-cyan) !important;
    border-color: var(--info-cyan) !important;
}
.qa-cyan:hover { background-color: rgba(41, 214, 255, 0.10) !important; }

.qa-grey {
    color: var(--neutral-grey) !important;
    border-color: var(--neutral-grey) !important;
}
.qa-grey:hover { background-color: rgba(148, 163, 184, 0.10) !important; }

/* 17 Sep 2026 (owner: "Quick Actions all white"): a quick action with no tier at all — outlined, no Color, no
   qa-* class — used to fall to the framework's white. It is grey now, the utility tier, so a forgotten tier
   never reads as a broken button. The ladder classes and every coloured tier still win. */
.mud-button-root.quick-action-btn.mud-button-outlined-default:not(.qa-primary):not(.qa-cyan):not(.qa-grey) {
    color: var(--neutral-grey) !important;
    border-color: var(--neutral-grey) !important;
}

/* ── Solid-button text (4 Nov 2026, Figma) ──
   Solid buttons use the darker RAG shades (Red/6, Green/7, Orange/6) with white labels,
   replacing the old dark-text-on-bright rule (DESIGN_SYSTEM §4). */
.mud-button-filled-success,
.mud-button-filled-warning,
.mud-button-filled-error { color: var(--pure-white) !important; }

/* ── Muted field labels — TRULY global ──
   ≈19 detail pages set their own white .info-label colour in a local <style> block,
   which masked the global muted token (#1264). Labels are ALWAYS muted by design and
   values stay white, so force it globally (beats local non-important overrides). */
.info-label,
.field-label,
.meta-label,
.info-list .info-label,
.stat-label,
.tsc-label,
.tsc-sublabel { color: var(--text-label) !important; }

/* ── Collapsible section-card headers (reusable across detail pages) ──
   Full-width long-form / list cards collapse to reduce scroll while staying available. */
.section-header.collapsible-header {
    cursor: pointer;
    user-select: none;
}
.section-collapse-chevron {
    margin-left: auto;
    color: var(--text-label);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}
.section-header.collapsible-header:hover .section-collapse-chevron { color: var(--pure-white); }

/* Secondary identifier styling - MUTED, not blue.
   `.job-ref` is defined once above (~810, token-based --font-size-sm); only
   `.meta-ref` is styled here to avoid a duplicate/conflicting `.job-ref` rule. */
.meta-ref {
    color: var(--starlight-silver);
    font-size: 0.85rem;
}

/* ==========================================================================
   FORM SECTION PANELS - Create/Edit Pages
   ========================================================================== */

.section-panel {
    background: var(--charcoal-gradient) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border) !important;
    border-radius: 12px !important;
    padding: 24px;
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
}

/* Global 5: section panels do NOT get decorative hover glow */

/* Clickable section panels get pointer cursor */
.section-panel.clickable,
.section-panel.interactive {
    cursor: pointer;
}

/* Panel Header with Icon */
.panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.panel-header h3 {
    color: var(--pure-white);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.3px;
}

/* Section Icons - Semantic Colors */
.section-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.section-icon .mud-icon-root {
    font-size: 20px !important;
}

.section-icon.blue {
    background: rgba(33, 150, 243, 0.25);
    border: 1px solid rgba(33, 150, 243, 0.35);
    color: var(--ts-blue-light);
}

.section-icon.green {
    background: rgba(0, 230, 118, 0.25);
    border: 1px solid rgba(0, 230, 118, 0.35);
    color: #81C784;
}

.section-icon.orange {
    background: rgba(255, 152, 0, 0.25);
    border: 1px solid rgba(255, 152, 0, 0.35);
    color: #FFB74D;
}

.section-icon.purple {
    background: rgba(156, 39, 176, 0.25);
    border: 1px solid rgba(156, 39, 176, 0.35);
    color: #BA68C8;
}

.section-icon.cyan {
    background: rgba(0, 188, 212, 0.25);
    border: 1px solid rgba(0, 188, 212, 0.35);
    color: #4DD0E1;
}

.section-icon.red {
    background: rgba(255, 82, 82, 0.25);
    border: 1px solid rgba(255, 82, 82, 0.35);
    color: #EF5350;
}

.section-icon.amber {
    background: rgba(255, 193, 7, 0.25);
    border: 1px solid rgba(255, 193, 7, 0.35);
    color: #FFD54F;
}

/* Yellow/Gold - Softer tone for better icon visibility */
.section-icon.yellow {
    background: rgba(212, 175, 55, 0.25);
    border: 1px solid rgba(212, 175, 55, 0.4);
    color: #D4AF37; /* Muted gold - easier to see icon */
}

/* ==========================================================================
   LIST ROW STYLING - All list pages
   ========================================================================== */

/* Base list row */
.list-row {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: visible;
}

.list-row:hover {
    background: rgba(33, 150, 243, 0.08);
}

/* Clickable list rows get neon glow */
.list-row.clickable:hover,
.list-row.neon-hover-glow:hover {
    box-shadow: var(--neon-glow);
    border-color: var(--glass-border-hover);
}

/* Row content layout */
.row-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.row-primary {
    font-weight: 500;
    color: var(--pure-white);
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.row-secondary {
    color: var(--starlight-silver);
    font-size: 0.85rem;
}

.row-meta {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
}

/* ==========================================================================
   FILTER BAR - Standardized across all list pages
   ========================================================================== */

.filter-bar {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    flex-wrap: wrap;
    align-items: center;
    background: transparent;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 160px;
}

.filter-item.search-item {
    flex: 0 1 320px;
    min-width: 200px;
    max-width: 360px;
}

.filter-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.6);
}

/* ==========================================================================
   SUMMARY BAR (KPI Cards Container)
   ========================================================================== */

.summary-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    padding: 0 24px;
    margin-bottom: 24px;
}

/* Hub dashboards (Operations, HR, H&S, Resources, Finance) — single headline KPI strip */
.premium-workspace .hub-headline-strip,
.premium-workspace .ops-headline-strip {
    margin-bottom: 0;
}

.hub-dashboard-body {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 0 24px 24px;
    min-width: 0;
}

/* ==========================================================================
   WEEK SELECTOR BAR - Single-week view (Timesheets, Payroll Run)
   Gold standard: prev/next + week label, theme vars only
   ========================================================================== */

.week-selector-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px 24px;
    border-bottom: 1px solid var(--glass-border);
}

.week-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-base);
    color: var(--pure-white);
    min-width: 220px;
    justify-content: center;
}

.week-nav-btn {
    color: var(--text-muted) !important;
}

.week-nav-btn:hover {
    color: var(--ts-blue) !important;
}

/* ==========================================================================
   BUTTON UTILITIES
   ========================================================================== */

/* Primary action button */
.btn-primary-action,
.create-btn {
    background: var(--ts-blue)!important;
    color: var(--pure-white) !important;
    box-shadow: 0 4px 20px rgba(33, 150, 243, 0.4);
    padding: 8px 24px !important;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-primary-action:hover,
.create-btn:hover {
    transform: none;
    box-shadow: var(--neon-glow);
}

/* Secondary/Cancel button */
.btn-secondary,
.cancel-btn {
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: var(--starlight-silver) !important;
    background: transparent !important;
}

.btn-secondary:hover,
.cancel-btn:hover {
    border-color: rgba(255, 255, 255, 0.4) !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

/* Back button */
.back-btn {
    margin-bottom: 8px;
    color: var(--starlight-silver) !important;
}

/* ==========================================================================
   LAYOUT UTILITIES - Create/Edit Pages
   ========================================================================== */

.header-left {
    display: flex;
    flex-direction: column;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.title-icon {
    color: var(--success-green);
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px;
    color: var(--starlight-silver);
    gap: 16px;
}

/* ==========================================================================
   MODAL / DIALOG STYLING - B+ Focus Frame (locked 2026-06-30)
   Authority: backend/web/DESIGN_SYSTEM_DIALOGS_VISUAL.md
   Input/list rules: GLOBAL OVERLAY STYLING section above.
   ========================================================================== */

.mud-dialog {
    background: var(--overlay-bplus-surface) !important;
    backdrop-filter: blur(var(--overlay-glass-blur)) !important;
    -webkit-backdrop-filter: blur(var(--overlay-glass-blur)) !important;
    border: 1px solid var(--overlay-bplus-border-modal) !important;
    border-radius: 16px !important;
    box-shadow: var(--overlay-bplus-shadow-modal) !important;
    color: var(--pure-white) !important;
}

.mud-dialog .dialog-subtitle,
.mud-dialog-title .dialog-subtitle {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* RW-003 Send-to-client dialog (Jul 16, 2026) */
.mud-dialog .send-dialog-recipients {
    background: transparent;
}

.mud-dialog .send-dialog-recipients th.send-dialog-col-check {
    width: 64px;
}

.mud-dialog .send-dialog-caption {
    color: var(--starlight-silver);
}

.mud-dialog .send-dialog-caption--italic {
    color: var(--starlight-silver);
    font-style: italic;
}

.mud-dialog .send-dialog-manual-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.mud-dialog .send-dialog-manual-row .send-dialog-add-btn {
    margin-top: 2px;
}

.mud-dialog .send-dialog-secondary-action {
    margin-right: auto;
}

.mud-dialog-title {
    color: var(--pure-white) !important;
    font-weight: var(--font-weight-semibold) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 20px 24px !important;
    font-family: var(--font-stack) !important;
}

.mud-dialog-content {
    padding: 24px !important;
    color: var(--pure-white) !important;
}

.mud-dialog-content .mud-typography {
    color: var(--pure-white) !important;
}

.mud-dialog-content .mud-text-secondary,
.mud-dialog-content .mud-typography-body2 {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Quote kit picker/save dialogs — body keeps a usable width inside SmallForm. */
.kit-dialog-body {
    min-width: 420px;
}

.mud-dialog-actions {
    padding: 16px 24px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    gap: 12px !important;
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
}

/* Dialog body layout utilities — content only; chrome inherits from .mud-dialog above */
.dialog-form-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Yes/No choice fields (Create Job / Accept Quote contract link) — tokens only */
.choice-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

/* 9 Sep 2026 (owner render): the question fills its card and the answers sit left under the
   label, spaced apart. .choice-radio-control is MudBlazor's outer control, .choice-radio-row the
   radio group inside it (InputClass) — the flex row has to be on the group to reach the radios. */
.choice-radio-control {
    width: 100%;
    margin-top: 4px !important;
}

.choice-radio-control .mud-input-control-input-container {
    display: block;
}

.choice-radio-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px 28px;
}

.choice-radio-row .mud-radio {
    margin-inline-end: 0;
}

.choice-option-hint {
    font-size: var(--font-size-xs);
    color: var(--starlight-silver);
    line-height: 1.4;
}

.mud-dialog-content .dialog-subtitle {
    margin-bottom: 24px;
    line-height: 1.6;
}

.mud-dialog-content .dialog-subtitle strong {
    color: var(--pure-white);
}

.mud-dialog-content .reply-preview {
    margin: -8px 0 16px;
    padding: 12px 14px;
    border-left: 3px solid var(--ts-blue);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0 8px 8px 0;
    color: var(--starlight-silver);
    font-size: var(--font-size-sm);
    line-height: 1.5;
    font-style: italic;
}

/* Dialog action buttons: styled by the global FIGMA BUTTONS section (4 Nov 2026) —
   primary = Blue/6 pill, Cancel (outlined) = Secondary, text = Ghost. */

/* Dialog close button */
.mud-dialog .mud-dialog-close-button {
    color: rgba(255, 255, 255, 0.5) !important;
}

.mud-dialog .mud-dialog-close-button:hover {
    color: var(--pure-white) !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

/* Dialog chips, alerts, and other inner components */
.mud-dialog .mud-chip {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--pure-white) !important;
}

.mud-dialog .mud-alert {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 10px !important;
}

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    color: var(--starlight-silver);
}

.empty-state-icon {
    font-size: 48px !important;
    color: rgba(255, 255, 255, 0.2);
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--pure-white);
    margin-bottom: 8px;
}

.empty-state-description {
    font-size: 0.9rem;
    color: var(--starlight-silver);
    max-width: 400px;
}

/* ==========================================================================
   SEMANTIC STATUS COLORS FOR KPI SELECTION
   These MUST win over hover glow when .selected is applied
   ========================================================================== */

/* ═══════════════════════════════════════════════════════════════════════════
   Feb 9, 2026: UNIFIED SELECTED STATE – neon blue only
   Old semantic colors (green/amber/red/purple per status) removed.
   All selected cards now use the same neon blue glow defined above in the
   interaction section. This block is kept as documentation only.
   
   The universal rule is:  .summary-card.selected { neon-glow-intense }
   See "GLOBAL STAT/SUMMARY CARD INTERACTION" near top of file.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ==========================================================================
   GLOBAL MUDBLAZOR OVERRIDES - January 2026
   Ensures all MudBlazor components match the Cinematic Productivity theme
   ========================================================================== */

/* ==========================================================================
   MUDALERT - Override default garish backgrounds
   ========================================================================== */

.mud-alert {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 10px !important;
    backdrop-filter: blur(8px);
    color: var(--pure-white) !important;
}

.mud-alert .mud-alert-message {
    color: var(--pure-white) !important;
}

/* Info Alert - Subtle blue */
.mud-alert-filled-info,
.mud-alert-outlined-info,
.mud-alert-text-info {
    background: rgba(33, 150, 243, 0.1) !important;
    border-color: rgba(33, 150, 243, 0.25) !important;
}

.mud-alert-filled-info .mud-icon-root,
.mud-alert-outlined-info .mud-icon-root,
.mud-alert-text-info .mud-icon-root {
    color: var(--ts-blue-light) !important;
}

/* Success Alert - Subtle green */
.mud-alert-filled-success,
.mud-alert-outlined-success,
.mud-alert-text-success {
    background: rgba(0, 230, 118, 0.1) !important;
    border-color: rgba(0, 230, 118, 0.25) !important;
}

.mud-alert-filled-success .mud-icon-root,
.mud-alert-outlined-success .mud-icon-root,
.mud-alert-text-success .mud-icon-root {
    color: #81C784 !important;
}

/* Warning Alert - Subtle amber */
.mud-alert-filled-warning,
.mud-alert-outlined-warning,
.mud-alert-text-warning {
    background: rgba(255, 152, 0, 0.1) !important;
    border-color: rgba(255, 152, 0, 0.25) !important;
}

.mud-alert-filled-warning .mud-icon-root,
.mud-alert-outlined-warning .mud-icon-root,
.mud-alert-text-warning .mud-icon-root {
    color: #FFB74D !important;
}

/* Error Alert - Subtle red (NOT garish) */
.mud-alert-filled-error,
.mud-alert-outlined-error,
.mud-alert-text-error {
    background: rgba(255, 82, 82, 0.1) !important;
    border-color: rgba(255, 82, 82, 0.25) !important;
}

.mud-alert-filled-error .mud-icon-root,
.mud-alert-outlined-error .mud-icon-root,
.mud-alert-text-error .mud-icon-root {
    color: #EF9A9A !important;
}

/* ==========================================================================
   MUDCHIP - Override default colors
   ========================================================================== */

.mud-chip {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: var(--starlight-silver) !important;
}

.mud-chip:hover {
    background: rgba(255, 255, 255, 0.12) !important;
}

/* Primary Chip */
.mud-chip.mud-chip-color-primary {
    background: rgba(33, 150, 243, 0.15) !important;
    border-color: rgba(33, 150, 243, 0.3) !important;
    color: var(--ts-blue-light) !important;
}

/* Success Chip */
.mud-chip.mud-chip-color-success {
    background: rgba(0, 230, 118, 0.15) !important;
    border-color: rgba(0, 230, 118, 0.3) !important;
    color: #81C784 !important;
}

/* Warning Chip */
.mud-chip.mud-chip-color-warning {
    background: rgba(255, 152, 0, 0.15) !important;
    border-color: rgba(255, 152, 0, 0.3) !important;
    color: #FFB74D !important;
}

/* Error Chip - NOT harsh red */
.mud-chip.mud-chip-color-error {
    background: rgba(255, 82, 82, 0.15) !important;
    border-color: rgba(255, 82, 82, 0.3) !important;
    color: #EF9A9A !important;
}

/* Info Chip */
.mud-chip.mud-chip-color-info {
    background: rgba(33, 150, 243, 0.12) !important;
    border-color: rgba(33, 150, 243, 0.25) !important;
    color: var(--ts-blue-light) !important;
}

/* Secondary Chip - Use muted, NOT cyan */
.mud-chip.mud-chip-color-secondary {
    background: rgba(148, 163, 184, 0.12) !important;
    border-color: rgba(148, 163, 184, 0.25) !important;
    color: var(--starlight-silver) !important;
}

/* Tertiary Chip */
.mud-chip.mud-chip-color-tertiary {
    background: rgba(156, 39, 176, 0.12) !important;
    border-color: rgba(156, 39, 176, 0.25) !important;
    color: #CE93D8 !important;
}

/* ==========================================================================
   MUDTEXT Color Overrides - Eliminate harsh colors
   ========================================================================== */

/* Secondary text should be muted silver, NOT cyan */
.mud-secondary-text,
.mud-text-secondary {
    color: var(--starlight-silver) !important;
}

/* Error text - softer red */
.mud-error-text {
    color: #EF9A9A !important;
}

/* Warning text - softer amber */
.mud-warning-text {
    color: #FFB74D !important;
}

/* Success text - softer green */
.mud-success-text {
    color: #81C784 !important;
}

/* Info text - theme blue */
.mud-info-text {
    color: var(--ts-blue-light) !important;
}

/* MUDBUTTON colour overrides: replaced by the FIGMA BUTTONS section at the end of this file. */

/* ==========================================================================
   MUDAVATAR - Consistent styling
   ========================================================================== */

.mud-avatar {
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    letter-spacing: 0.5px;
}

/* Default avatar - charcoal with subtle border */
.mud-avatar.mud-avatar-color-default {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: var(--starlight-silver) !important;
}

/* Primary avatar */
.mud-avatar.mud-avatar-color-primary {
    background: rgba(33, 150, 243, 0.3)!important;
    border: 1px solid rgba(33, 150, 243, 0.4) !important;
    color: var(--ts-blue-light) !important;
}

/* Error avatar - softer */
.mud-avatar.mud-avatar-color-error {
    background: rgba(255, 82, 82, 0.2) !important;
    border: 1px solid rgba(255, 82, 82, 0.3) !important;
    color: #EF9A9A !important;
}

/* Secondary avatar - NOT cyan */
.mud-avatar.mud-avatar-color-secondary {
    background: rgba(148, 163, 184, 0.15) !important;
    border: 1px solid rgba(148, 163, 184, 0.25) !important;
    color: var(--starlight-silver) !important;
}

/* ==========================================================================
   MUDBADGE - Status indicators
   ========================================================================== */

.mud-badge .mud-badge-content {
    font-size: 0.65rem !important;
    font-weight: 600;
}

/* ==========================================================================
   MUDTOOLTIP - Match theme
   ========================================================================== */

.mud-tooltip {
    background: rgba(20, 24, 32, 0.96) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: var(--pure-white) !important;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    letter-spacing: 0.2px !important;
    border-radius: 10px !important;
    padding: 8px 14px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
}

/* ── Topbar Icon Buttons ──
   Figma header "Nav links" (nodes 243:2640/2642/2645, 11 Nov 2026): 44px circles, Mono/9 fill,
   Mono/8 border, 17px Mono/4 icon. Hover lifts the fill and border a step (was a blue glow). */
.topbar-right > .mud-icon-button,
.topbar-right > .global-search-container .mud-icon-button,
.topbar-right > .mud-tooltip-root > .mud-icon-button,
.topbar-right .topbar-bell-badge .mud-icon-button,
.topbar-left > .mud-icon-button,
.topbar-left > .mud-tooltip-root > .mud-icon-button {
    width: 44px;
    height: 44px;
    padding: 0;
    color: var(--mono-4);
    background: var(--mono-9);
    border: 1px solid var(--mono-8);
    border-radius: 100px;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.topbar-right > .mud-icon-button .mud-icon-root,
.topbar-right > .global-search-container .mud-icon-button .mud-icon-root,
.topbar-right > .mud-tooltip-root > .mud-icon-button .mud-icon-root,
.topbar-right .topbar-bell-badge .mud-icon-button .mud-icon-root,
.topbar-left > .mud-icon-button .mud-icon-root,
.topbar-left > .mud-tooltip-root > .mud-icon-button .mud-icon-root {
    width: 17px;
    height: 17px;
}

.topbar-right > .mud-icon-button:hover,
.topbar-right > .global-search-container .mud-icon-button:hover,
.topbar-right > .mud-tooltip-root > .mud-icon-button:hover,
.topbar-right .topbar-bell-badge .mud-icon-button:hover,
.topbar-left > .mud-icon-button:hover,
.topbar-left > .mud-tooltip-root > .mud-icon-button:hover {
    color: var(--mono-0);
    background: var(--surface-raised);
    border-color: var(--mono-7);
}

/* The close (X) inside the open search strip stays a plain small icon, not a circle. */
.topbar-right .search-input-wrapper .mud-icon-button {
    width: auto;
    height: auto;
    padding: 4px;
    background: transparent;
    border: none;
    color: var(--mono-5);
}

/* Unread badge: Figma "alert" — RAG red/5 circle, Mono/0 count, top-right of the bell.
   11 Nov 2026 (David): Figma's 8px count was too small to read; 10px text on a 16px circle,
   kept on the same top-right point. */
.topbar-bell-badge .mud-badge.mud-badge-top.right.mud-badge-overlap {
    inset: auto auto auto auto;
    top: 5px;
    left: 23px;
    transform: none;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 20px;
    background-color: var(--rag-red-5);
    color: var(--mono-0);
    font-size: 10px;
    font-weight: 500;
    line-height: 16px;
}

.topbar-bell-badge .mud-badge .mud-badge-content {
    font-size: 10px !important;
    font-weight: 500;
}

/* Avatar: Figma header node 243:2645 — 44px circle, Mono/9 fill, Mono/8 border, 16px Mono/4 initials. */
.topbar-avatar-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    border-radius: 100px;
}

.topbar-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    box-sizing: border-box;
    border-radius: 100px;
    background: var(--mono-9);
    border: 1px solid var(--mono-8);
    color: var(--mono-4);
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.topbar-avatar-trigger:hover .topbar-avatar {
    color: var(--mono-0);
    background: var(--surface-raised);
    border-color: var(--mono-7);
}

.topbar-avatar-trigger:focus-visible {
    outline: 2px solid var(--mono-4);
    outline-offset: 2px;
}

/* ==========================================================================
   MUDSNACKBAR - Toast notifications
   ========================================================================== */

.mud-snackbar {
    background: var(--overlay-bplus-surface) !important;
    backdrop-filter: blur(16px);
    border: 1px solid var(--overlay-lightweight-border) !important;
    border-radius: 12px !important;
}

.mud-snackbar.mud-snackbar-color-error {
    border-left: 3px solid #EF9A9A !important;
}

.mud-snackbar.mud-snackbar-color-success {
    border-left: 3px solid #81C784 !important;
}

.mud-snackbar.mud-snackbar-color-warning {
    border-left: 3px solid #FFB74D !important;
}

.mud-snackbar.mud-snackbar-color-info {
    border-left: 3px solid var(--ts-blue) !important;
}

/* ==========================================================================
   MUDINPUT / MUDTEXTFIELD - Form fields (late-file reinforcement)
   NOTE: Primary input rules are in the INPUT SYSTEM section above (~line 970).
   These are kept for specificity reinforcement only.
   Duplicate .mud-list-item rules removed Feb 10, 2026 - see GLOBAL OVERLAY
   STYLING section for the single source of truth.
   ========================================================================== */

/* (4 Nov 2026) A second, older set of outlined-input colours lived here and overrode the
   locked FORM INPUTS block; removed so the --input-* tokens are the one source. */

/* ==========================================================================
   MUDTABS - Tab styling
   ========================================================================== */

.mud-tabs .mud-tab {
    color: var(--starlight-silver) !important;
}

.mud-tabs .mud-tab.mud-tab-active {
    color: var(--ts-blue) !important;
}

.mud-tabs .mud-tab-slider {
    background: var(--ts-blue) !important;
}

/* ==========================================================================
   MUDPROGRESS - Loading indicators
   ========================================================================== */

.mud-progress-circular svg circle {
    stroke: var(--ts-blue) !important;
}

/* 11 Nov 2026 (Figma tidy-up) — Figma "Loading / Variant=Progress" (15:5030):
   4px rounded track (Mono/8), flat Primary blue/6 fill, label beside. Every size draws 4px,
   no stripes, no gradient. Primary / Secondary / Info / Default are Blue/6; Success, Warning
   and Error keep their meaning in the Figma RAG shades (was: every bar forced to a blue gradient). */
.mud-progress-linear.horizontal.mud-progress-linear-small,
.mud-progress-linear.horizontal.mud-progress-linear-medium,
.mud-progress-linear.horizontal.mud-progress-linear-large {
    height: 4px;
}

.mud-progress-linear,
.mud-progress-linear::before,
.mud-progress-linear .mud-progress-linear-bars,
.mud-progress-linear .mud-progress-linear-bar {
    border-radius: 2px !important;
}

.mud-progress-linear:not(.mud-progress-linear-buffer)::before {
    background-color: var(--mono-8) !important;
    opacity: 1 !important;
}

.mud-progress-linear .mud-progress-linear-bar {
    background: var(--blue-6) !important;
}
.mud-progress-linear.mud-progress-linear-color-success .mud-progress-linear-bar { background: var(--rag-green-6) !important; }
.mud-progress-linear.mud-progress-linear-color-warning .mud-progress-linear-bar { background: var(--rag-orange-5) !important; }
.mud-progress-linear.mud-progress-linear-color-error .mud-progress-linear-bar   { background: var(--rag-red-5) !important; }

.mud-progress-linear.mud-progress-linear-striped .mud-progress-linear-bar {
    background-image: none !important;
    animation: none !important;
}

/* ==========================================================================
   EXPANSION PANELS — Figma "Section panel" Collapsed / Expanded (15:5340, 15:5346)
   11 Nov 2026 (Figma tidy-up). Each MudExpansionPanel is its own card: Mono/9, Mono/8
   border, 16px radius, 16px padding, 12px between cards. Header = 20px title + chevron
   on the right (chevron up when open). Open: a Mono/8 divider 16px under the header,
   content 16px under the divider.
   ========================================================================== */
.mud-expansion-panels {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: transparent !important;
    box-shadow: none !important;
}

.mud-expansion-panels .mud-expand-panel,
.mud-expansion-panels .mud-expand-panel.mud-panel-expanded {
    margin: 0 !important;
    background: var(--surface-card) !important;
    border: 1px solid var(--border-card) !important;
    border-radius: var(--radius-card) !important;
    color: var(--pure-white);
    overflow: hidden;
}

.mud-expand-panel .mud-expand-panel-header {
    min-height: 0 !important;
    padding: 16px !important;
    gap: 12px;
    font-size: 1.25rem;               /* 20px title */
    line-height: 30px;
    font-weight: var(--font-weight-medium);
    color: var(--pure-white);
}

/* MudBlazor marks Dense on the content element, so look for it from the panel. */
.mud-expand-panel:has(.mud-expand-panel-dense) .mud-expand-panel-header,
.mud-expand-panel .mud-expand-panel-header.mud-expand-panel-dense {
    font-size: var(--font-size-base);  /* dense lists: 16px title, same padding */
    line-height: 24px;
}

.mud-expand-panel .mud-expand-panel-header .mud-expand-panel-icon {
    color: var(--mono-4);
}

.mud-expand-panel .mud-expand-panel-header:hover .mud-expand-panel-icon {
    color: var(--mono-2);
}

.mud-expand-panel .mud-expand-panel-content {
    margin: 0 16px;
    padding: 16px 0 !important;
    border-top: 1px solid var(--border-card);
    font-size: var(--font-size-sm);
    color: var(--pure-white);
}

/* ==========================================================================
   HELPER CLASSES FOR MANUAL OVERRIDES
   Use these in markup when Color="..." doesn't give desired result
   ========================================================================== */

/* Text colors */
.ts-text-primary { color: var(--pure-white) !important; }
.ts-text-secondary { color: var(--starlight-silver) !important; }
.ts-text-muted { color: var(--text-muted) !important; }
.ts-text-blue { color: var(--ts-blue-light) !important; }
.ts-text-success { color: #81C784 !important; }
.ts-text-warning { color: #FFB74D !important; }
.ts-text-danger { color: #EF9A9A !important; }

/* Badge/chip alternatives */
.ts-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ts-badge-success {
    background: rgba(0, 230, 118, 0.15);
    border: 1px solid rgba(0, 230, 118, 0.3);
    color: #81C784;
}

.ts-badge-warning {
    background: rgba(255, 152, 0, 0.15);
    border: 1px solid rgba(255, 152, 0, 0.3);
    color: #FFB74D;
}

.ts-badge-danger {
    background: rgba(255, 82, 82, 0.15);
    border: 1px solid rgba(255, 82, 82, 0.3);
    color: #EF9A9A;
}

.ts-badge-info {
    background: rgba(33, 150, 243, 0.15);
    border: 1px solid rgba(33, 150, 243, 0.3);
    color: var(--ts-blue-light);
}

.ts-badge-neutral {
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: var(--starlight-silver);
}

.ts-badge-purple {
    background: rgba(156, 39, 176, 0.15);
    border: 1px solid rgba(156, 39, 176, 0.3);
    color: #CE93D8;
}

/* ==========================================================================
   FORM BUILDER - Templates Grid & Cards (Jan 21, 2026)
   Matches HR Module premium styling with neon-hover-glow
   ========================================================================== */

.templates-container {
    margin-top: 24px;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.template-card {
    background: var(--charcoal-gradient);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
}

.template-card:hover {
    background: var(--charcoal-gradient-hover);
    border-color: var(--glass-border-hover);
    box-shadow: var(--neon-glow), var(--shadow-elevated);
    transform: none;
}

/* Status-specific left border accent */
.template-card.approved,
.template-card.published {
    border-left: 3px solid var(--success-green);
}

.template-card.draft {
    border-left: 3px solid var(--electric-amber);
}

.template-card.archived {
    border-left: 3px solid var(--neutral-grey);
}

.template-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.template-type {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ts-blue);
}

.template-type .mud-icon-root {
    font-size: 14px !important;
}

.template-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--pure-white);
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.template-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.template-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--starlight-silver);
}

.template-meta .meta-item .mud-icon-root {
    font-size: 14px !important;
    color: var(--starlight-silver);
}

.template-meta .meta-item.ai {
    color: var(--ts-blue-light);
}

.template-meta .meta-item.ai .mud-icon-root {
    color: var(--ts-blue-light);
}

.usage-stats {
    display: flex;
    gap: 24px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-bottom: 16px;
}

.usage-stats .stat-item {
    display: flex;
    flex-direction: column;
}

.usage-stats .stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--pure-white);
}

.usage-stats .stat-label {
    font-size: 0.7rem;
    color: var(--starlight-silver);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.template-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.template-date {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.template-date .mud-icon-root {
    font-size: 14px !important;
}

.template-actions {
    display: flex;
    gap: 4px;
}

.template-actions .mud-icon-button {
    color: var(--starlight-silver);
}

.template-actions .mud-icon-button:hover {
    color: var(--ts-blue);
    background: rgba(33, 150, 243, 0.1);
}

/* ==========================================================================
   UNIFIED BADGE SYSTEM (Feb 2, 2026)
   All header badges (status, flags, indicators) use consistent styling
   ========================================================================== */

/* Base header badge - use on ALL page header pills */
.header-badge {
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    padding: 4px 12px !important;
    height: 26px !important;
    min-width: auto !important;
    border-radius: 13px !important;
}

/* Ensure MudChip inside header-badge is consistent */
.header-badge .mud-chip-content {
    padding: 0 !important;
}

/* Status badges - colored backgrounds */
.header-badge.status-active {
    background: rgba(0, 230, 118, 0.2) !important;
    color: #81C784 !important;
    border: 1px solid rgba(0, 230, 118, 0.4) !important;
}

.header-badge.status-inactive {
    background: rgba(239, 83, 80, 0.2) !important;
    color: #EF5350 !important;
    border: 1px solid rgba(239, 83, 80, 0.4) !important;
}

/* Info badges - subtle/muted style */
.header-badge.info-badge {
    background: rgba(33, 150, 243, 0.15) !important;
    color: #64B5F6 !important;
    border: 1px solid rgba(33, 150, 243, 0.3) !important;
}

/* Warning badges */
.header-badge.warning-badge {
    background: rgba(255, 152, 0, 0.15) !important;
    color: #FFB74D !important;
    border: 1px solid rgba(255, 152, 0, 0.3) !important;
}

/* ==========================================================================
   TABLE CHIPS - Unified styling for all table badges (Feb 6, 2026)
   Ensures consistent size across Type, Priority, Status columns
   ========================================================================== */

/* Base class for ALL table chips - ensures consistent sizing */
.table-chip,
.type-chip,
.priority-chip,
.status-chip {
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
    padding: 2px 10px !important;
    height: 24px !important;
    min-height: 24px !important;
    line-height: 1.4 !important;
}

/* MudChip overrides - ensure Size.Small is consistent */
.mud-chip.mud-chip-size-small.type-chip,
.mud-chip.mud-chip-size-small.priority-chip,
.mud-chip.mud-chip-size-small.status-chip {
    height: 24px !important;
    font-size: 0.7rem !important;
}

/* Status chips with dropdown - add slight padding for icon */
.status-chip.clickable {
    padding-right: 6px !important;
    cursor: pointer;
}

/* Dropdown icon inside status chip - make it smaller and aligned */
.status-chip .status-dropdown-icon {
    font-size: 14px !important;
    margin-left: 2px;
    opacity: 0.7;
}

/* Legacy status-chip styling (for backwards compatibility) */
.status-chip {
    /* Base styles now inherited from unified rule above */
}

/* Job Status Chip Colors (Feb 6, 2026) */
.status-chip.draft {
    background: rgba(255, 152, 0, 0.15) !important;
    color: #FFB74D !important;
}
.status-chip.scheduled {
    background: rgba(255, 230, 0, 0.15) !important;
    color: #FFE082 !important;
}
.status-chip.inprogress,
.status-chip.in-progress {
    background: rgba(33, 150, 243, 0.15) !important;
    color: #64B5F6 !important;
}
.status-chip.onhold,
.status-chip.on-hold {
    background: rgba(255, 152, 0, 0.15) !important;
    color: #FFB74D !important;
}
.status-chip.completed {
    background: rgba(0, 230, 118, 0.15) !important;
    color: #81C784 !important;
}
.status-chip.cancelled {
    background: rgba(158, 158, 158, 0.15) !important;
    color: #BDBDBD !important;
}
.status-chip.closed {
    background: rgba(148, 163, 184, 0.12) !important;
    color: #94A3B8 !important;
}

/* Generic status chip colors (backward compat) */
.status-chip.approved,
.status-chip.published {
    background: rgba(0, 230, 118, 0.15) !important;
    color: #81C784 !important;
}

.status-chip.archived {
    background: rgba(148, 163, 184, 0.12) !important;
    color: var(--starlight-silver) !important;
}

/* POWRA / H&S assessment outcome chips */
.status-chip.safe {
    background: rgba(0, 230, 118, 0.15) !important;
    color: #81C784 !important;
}
.status-chip.unsafe {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #ef4444 !important;
}

/* HR Timesheet / Payroll Status Chips */
.status-chip.pending,
.status-chip.submitted {
    background: rgba(255, 152, 0, 0.15) !important;
    color: #FFB74D !important;
}
.status-chip.rejected {
    background: rgba(255, 82, 82, 0.15) !important;
    color: #ef5350 !important;
}
.status-chip.paid {
    background: rgba(33, 150, 243, 0.15) !important;
    color: #64B5F6 !important;
}
.status-chip.overdue {
    background: rgba(255, 82, 82, 0.25) !important;
    color: #ef5350 !important;
    animation: pulse-subtle 2s infinite;
}
.status-chip.not-submitted {
    background: rgba(158, 158, 158, 0.12) !important;
    color: #9E9E9E !important;
}

@keyframes pulse-subtle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* AI Summary Card Special Styling */
.summary-card.ai {
    border-left: 3px solid var(--ts-blue);
}

.summary-card.ai.selected {
    /* Feb 9, 2026: Defers to universal .summary-card.selected rule */
    background: transparent !important;
    border-color: rgba(33, 150, 243, 0.6) !important;
    box-shadow: var(--neon-glow-intense) !important;
}

/* ==========================================================================
   FORM BUILDER - Upload Zone (CreateFormTemplate)
   ========================================================================== */

.upload-zone {
    border: 2px dashed rgba(33, 150, 243, 0.3);
    border-radius: 16px;
    padding: 48px 24px;
    text-align: center;
    background: rgba(33, 150, 243, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-zone:hover {
    border-color: var(--glass-border-hover);
    background: rgba(33, 150, 243, 0.1);
    box-shadow: none;
}

.upload-zone .upload-icon {
    color: var(--ts-blue);
    margin-bottom: 16px;
}

.upload-zone h4 {
    color: var(--pure-white);
    font-weight: 500;
    margin-bottom: 8px;
}

.upload-zone p {
    color: var(--starlight-silver);
    font-size: 0.9rem;
    margin: 0;
}

.upload-zone .upload-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ==========================================================================
   FORM BUILDER - Field Editor (EditFormTemplate)
   ========================================================================== */

.field-editor-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 24px;
}

.fields-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-item {
    background: var(--surface-card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.field-item:hover {
    border-color: var(--glass-border-hover);
    background: rgba(33, 150, 243, 0.05);
}

.field-item.selected {
    border-color: rgba(33, 150, 243, 0.5);
    background: rgba(33, 150, 243, 0.1);
    box-shadow: none;
}

.field-label {
    font-weight: 600;
    color: var(--pure-white);
    margin-bottom: 4px;
}

.field-type {
    font-size: 0.8rem;
    color: var(--starlight-silver);
}

.field-confidence {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(33, 150, 243, 0.1);
    color: var(--ts-blue-light);
}

.field-properties-panel {
    background: var(--charcoal-gradient);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 24px;
    position: sticky;
    top: 24px;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.panel-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(33, 150, 243, 0.3);
    border: 1px solid rgba(33, 150, 243, 0.4);
    color: var(--ts-blue-light);
}

.panel-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--pure-white);
}

/* ==========================================================================
   CERTIFICATION HUB — Shared styles for certificate pages
   ========================================================================== */

.section-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.section-icon .mud-icon-root { font-size: 1.15rem !important; }
.section-icon.blue { background: rgba(33,150,243,0.15); }
.section-icon.blue .mud-icon-root { color: #64b5f6; }
.section-icon.green { background: rgba(0, 230, 118,0.15); }
.section-icon.green .mud-icon-root { color: #81c784; }
.section-icon.amber { background: rgba(255,152,0,0.15); }
.section-icon.amber .mud-icon-root { color: #ffb74d; }
.section-icon.red { background: rgba(255, 82, 82,0.15); }
.section-icon.red .mud-icon-root { color: #ef5350; }
.section-icon.teal { background: rgba(0,150,136,0.15); }
.section-icon.teal .mud-icon-root { color: #4db6ac; }

.table-section-header { display: flex; align-items: center; gap: 12px; padding: 18px 20px 16px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.table-section-header h3 { color: var(--pure-white); font-size: 1rem; font-weight: 600; margin: 0; flex: 1; }

.cert-link { color: var(--ts-blue-light); cursor: pointer; font-weight: 500; }
.cert-link:hover { text-decoration: underline; }
.stacked-cell { display: flex; flex-direction: column; gap: 2px; }
.primary-text { color: var(--pure-white); }
.secondary-text { color: var(--starlight-silver); font-size: 0.875rem; }

.days-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.78rem; font-weight: 600; background: rgba(100,181,246,0.12); color: #64b5f6; }
.overdue-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.78rem; font-weight: 600; background: rgba(239,83,80,0.15); color: #ef5350; }

.confidence-chip.green { background: rgba(0, 230, 118,0.15) !important; color: #81c784 !important; border: none !important; font-weight: 600 !important; }
.confidence-chip.amber { background: rgba(255,152,0,0.15) !important; color: #ffb74d !important; border: none !important; font-weight: 600 !important; }
.confidence-chip.red   { background: rgba(255, 82, 82,0.15) !important; color: #ef5350 !important; border: none !important; font-weight: 600 !important; }

.type-chip { border: 1px solid rgba(255,255,255,0.2) !important; }
.type-chip.eicr     { background: rgba(33,150,243,0.1) !important; color: #64b5f6 !important; border-color: rgba(33,150,243,0.3) !important; }
.type-chip.eic      { background: rgba(0, 230, 118,0.1) !important; color: #81c784 !important; border-color: rgba(0, 230, 118,0.3) !important; }
.type-chip.minorworks { background: rgba(255,152,0,0.1) !important; color: #ffb74d !important; border-color: rgba(255,152,0,0.3) !important; }

.cert-status-chip.draft        { background: color-mix(in srgb, var(--status-teal) 20%, transparent) !important; color: var(--status-teal) !important; border: none !important; }
.cert-status-chip.inreview     { background: rgba(33,150,243,0.2) !important; color: #64b5f6 !important; border: none !important; }
.cert-status-chip.approved     { background: rgba(0, 230, 118,0.2) !important; color: #81c784 !important; border: none !important; }
.cert-status-chip.returnedforchanges { background: rgba(255,152,0,0.2) !important; color: #ffb74d !important; border: none !important; }
.cert-status-chip.complete     { background: rgba(0,150,136,0.2) !important; color: #4db6ac !important; border: none !important; }
.cert-status-chip.archived     { background: rgba(121,85,72,0.2) !important; color: #a1887f !important; border: none !important; }

.type-chip.pat        { background: rgba(33,150,243,0.1) !important; color: #29D6FF !important; border-color: rgba(33,150,243,0.3) !important; }
.type-chip.emergency  { background: rgba(156,39,176,0.1) !important; color: #ce93d8 !important; border-color: rgba(156,39,176,0.3) !important; }

.active-filter-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 10px 16px; background: rgba(33,150,243,0.06); border: 1px solid rgba(33,150,243,0.2); border-radius: 10px; }
.clear-filter-btn { color: var(--starlight-silver) !important; font-size: 0.85rem; }

.cell-with-icon { display: flex; align-items: center; gap: 10px; }
.ref-link { color: var(--ts-blue-light); cursor: pointer; font-weight: 500; }
.ref-link:hover { text-decoration: underline; }
/* 11 Sep 2026 (materials completion audit W1): the cross-navigation link the Commercial door
   and other doors already use — DESIGN_SYSTEM §5 / §10.2 asked for one shared style. */
.cross-link { color: var(--text-link); cursor: pointer; font-weight: 500; }
.cross-link:hover { text-decoration: underline; }
/* 11 Sep 2026 (audit W2): the empty-state sentence a panel shows when it has nothing to list —
   promoted from page-local <style> blocks so every door renders it the same. */
.empty-message {
    color: var(--starlight-silver);
    font-size: var(--font-size-sm, 0.875rem);
    text-align: center;
    padding: 16px 0;
}
/* 11 Sep 2026 (materials audit W7): the three input widths every materials line editor shares —
   Order materials, the job's order dialog — so no dialog carries its own Style= widths. */
.mat-qty { max-width: 90px; }
.mat-unit { max-width: 80px; }
.mat-price { max-width: 100px; }
/* 28 Sep 2026 (QA journey 10, D8): the Description column takes the rest of the row, which crushed these
   three boxes to 28-41px so "each" could not be read. A floor keeps them usable; narrower on a phone. */
.mat-qty { min-width: 80px; }
.mat-unit { min-width: 80px; }
.mat-price { min-width: 96px; }
@media (max-width: 600px) {
    .mat-qty, .mat-unit { min-width: 64px; }
    .mat-price { min-width: 76px; }
}
/* 11 Sep 2026 (audit W15): the small meta line under a materials row, one size everywhere. */
.mat-meta { font-size: var(--font-size-sm); color: var(--starlight-silver); }
.unassigned { color: var(--starlight-silver); font-style: italic; font-size: 0.875rem; }
.menu-icon { margin-right: 8px; }

.summary-card .mud-icon-root { font-size: 1.8rem; }

/* Gold-standard left-border colour variants (matches Forms page pattern) */
.summary-card.active { border-left: 4px solid #00E676; }
.summary-card.active .mud-icon-root { color: #81c784; }
.summary-card.warning { border-left: 4px solid #ff9800; }
.summary-card.warning .mud-icon-root { color: #ffb74d; }
.summary-card.danger { border-left: 4px solid #FF5252; }
.summary-card.danger .mud-icon-root { color: #ef5350; }
.summary-card.ai { border-left: 4px solid var(--ts-blue); }
.summary-card.ai .mud-icon-root { color: #64b5f6; }

/* Legacy certificate card icon colours (no left border) */
.summary-card.draft .mud-icon-root { color: #94A3B8; }
.summary-card.inreview .mud-icon-root { color: #ffb74d; }
.summary-card.approved .mud-icon-root { color: #81c784; }
.summary-card.complete .mud-icon-root { color: #64b5f6; }
.summary-card.returned .mud-icon-root { color: #ffb74d; }
.summary-card.awaiting-review .mud-icon-root { color: #8B5CF6; }

/* Certificate Detail Page */
.loading-container, .error-container { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 60vh; gap: 16px; }
.workspace-hero { padding: 0 0 20px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.1); margin-bottom: 20px; }
.hero-content { display: flex; justify-content: space-between; align-items: flex-end; }
.hero-left { display: flex; flex-direction: column; }
.hero-right { display: flex; gap: 12px; }
.back-btn { margin-bottom: 12px; color: var(--starlight-silver) !important; }
.hero-title-row { display: flex; align-items: center; gap: 16px; }
.title-icon { font-size: 2.5rem !important; }
.title-content { display: flex; flex-direction: column; }
.hero-title { font-size: 1.5rem; font-weight: 500; color: var(--pure-white); margin: 0; }
.hero-ref { color: var(--starlight-silver); font-size: 0.9rem; }

.info-bar { display: flex; flex-wrap: wrap; gap: 24px; padding: 16px 20px; background: rgba(255, 255, 255, 0.03); border-radius: 12px; margin-bottom: 24px; }
.info-item { display: flex; align-items: center; gap: 8px; color: var(--starlight-silver); }
.info-item.clickable { cursor: pointer; }
.info-label { font-size: 0.85rem; }
.info-value { color: var(--pure-white); font-weight: 500; }
.info-value.link { color: var(--ts-blue-light); }
.info-value.link:hover { text-decoration: underline; }

.certificate-tabs { margin-bottom: 24px; }
.certificate-tabs .mud-tabs-header { background: rgba(255, 255, 255, 0.03) !important; border-radius: 12px; padding: 4px; }
.certificate-tabs .mud-tab { color: var(--starlight-silver) !important; }
.certificate-tabs .mud-tab.mud-tab-active { color: var(--pure-white) !important; background: rgba(33, 150, 243, 0.2) !important; }
.tab-content { padding: 24px 0; display: flex; flex-direction: column; gap: 20px; }

.glass-panel { background: var(--charcoal-gradient) !important; backdrop-filter: blur(12px); border: 1px solid rgba(255, 255, 255, 0.08) !important; border-radius: 16px !important; padding: 24px; }
.section-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; color: var(--pure-white); }
.section-header h3 { margin: 0; font-size: 1.1rem; font-weight: 500; }
.section-header .mud-icon-root { color: var(--ts-blue-light); }

.detail-fields-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
@media (max-width: 768px) { .detail-fields-grid { grid-template-columns: 1fr; } }
.data-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.data-item { display: flex; flex-direction: column; gap: 4px; padding: 12px; background: rgba(255, 255, 255, 0.03); border-radius: 8px; }
.data-label { color: var(--starlight-silver); font-size: var(--font-size-xs, 0.75rem); text-transform: uppercase; letter-spacing: 0.5px; }
.data-value { color: var(--pure-white); font-weight: 500; }

.eicr-details-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 768px) { .eicr-details-two-col { grid-template-columns: 1fr; } }
.eicr-subsection-title { color: var(--ts-blue-light); font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin: 0 0 16px 0; padding-bottom: 8px; border-bottom: 1px solid rgba(33, 150, 243, 0.15); }
.eicr-data-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.eicr-metadata-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 20px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.06); }

.bonding-section { margin-top: 20px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.bonding-section h4 { color: var(--starlight-silver); font-size: 0.9rem; margin: 0 0 12px 0; }
.bonding-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.bonding-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: rgba(255, 255, 255, 0.03); border-radius: 8px; }
.bonding-label { color: var(--starlight-silver); flex: 1; }
.bonding-status { font-weight: 600; }
.bonding-status.yes { color: #00E676; }
.bonding-status.no { color: #FF5252; }
.bonding-csa { color: var(--starlight-silver); font-size: 0.875rem; }

.board-card { margin-bottom: 16px; }
.board-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.board-title { display: flex; align-items: center; gap: 12px; }
.board-title h3 { margin: 0; color: var(--pure-white); font-size: 1.1rem; }
.board-meta { color: var(--starlight-silver); }

.test-results-table { background: transparent !important; }
.test-results-table th { background: rgba(0, 0, 0, 0.3) !important; color: var(--starlight-silver) !important; font-size: 0.75rem; padding: 12px !important; }
.test-results-table td { color: var(--pure-white) !important; padding: 12px !important; border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important; }

.checklist-section { margin-bottom: 20px; }
.checklist-subsection { color: var(--ts-blue-light); font-size: 0.9rem; margin: 0 0 12px 0; padding-bottom: 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.checklist-items { display: flex; flex-direction: column; gap: 8px; }
.checklist-item { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: rgba(255, 255, 255, 0.03); border-radius: 8px; }
.checklist-ref { color: var(--starlight-silver); font-weight: 600; width: 40px; }
.checklist-desc { flex: 1; color: var(--pure-white); }
.checklist-status { padding: 4px 12px; border-radius: 4px; font-weight: 600; font-size: 0.85rem; }
.checklist-status.pass { background: rgba(0, 230, 118, 0.2); color: #00E676; }
.checklist-status.fail { background: rgba(255, 82, 82, 0.2); color: #FF5252; }
.checklist-status.limitation { background: rgba(255, 152, 0, 0.2); color: #FF9800; }
.checklist-status.na { background: rgba(158, 158, 158, 0.2); color: #9E9E9E; }
.checklist-status.nv { background: rgba(33, 150, 243, 0.2); color: #2196F3; }

.observation-card { border-left: 4px solid; }
.observation-card.danger { border-left-color: #FF5252; }
.observation-card.warning { border-left-color: #FF9800; }
.observation-card.improvement { border-left-color: #2196F3; }
.observation-card.investigation { border-left-color: #9C27B0; }
.observation-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.bs-ref { color: var(--starlight-silver); font-size: 0.875rem; }
/* 19 Oct 2026 (John): QS review - the engineer changed the library's observation code. */
.observation-code-changed { color: var(--starlight-silver); font-size: 0.8125rem; font-style: italic; }
.observation-description { color: var(--pure-white); margin: 0 0 12px 0; }
.observation-location { display: flex; align-items: center; gap: 8px; color: var(--starlight-silver); font-size: 0.85rem; margin-bottom: 8px; }
.observation-remedy { color: #00E676; font-size: 0.9rem; padding: 12px; background: rgba(0, 230, 118, 0.1); border-radius: 8px; }
/* A2/A3 (2026-06-08) — schedule/circuit meta row + engineer notes on the QS observation card */
.observation-meta { display: flex; flex-wrap: wrap; gap: 16px; color: var(--starlight-silver); font-size: 0.85rem; margin-bottom: 8px; }
.observation-notes { color: var(--starlight-silver); font-size: 0.9rem; margin-top: 8px; padding: 12px; background: rgba(255, 255, 255, 0.04); border-radius: 8px; }

.summary-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 20px; }
.summary-item { padding: 16px; background: rgba(255, 255, 255, 0.03); border-radius: 8px; }
.summary-label { display: block; color: var(--starlight-silver); font-size: var(--font-size-xs, 0.75rem); margin-bottom: 4px; }
.summary-value { color: var(--pure-white); font-size: 1.1rem; font-weight: 500; }
.summary-value.satisfactory { color: #00E676; }
.summary-value.unsatisfactory { color: #FF5252; }
.recommendations-section, .limitations-section, .extent-section, .review-notes { margin-top: 20px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.recommendations-section h4, .limitations-section h4, .extent-section h4, .review-notes h4 { color: var(--starlight-silver); font-size: 0.9rem; margin: 0 0 12px 0; }
.recommendations-section p, .limitations-section p, .extent-section p, .review-notes p { color: var(--pure-white); margin: 0; }

.empty-section { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 40px; background: rgba(255, 255, 255, 0.02); border-radius: 12px; border: 1px dashed rgba(255, 255, 255, 0.1); color: var(--starlight-silver); }
.empty-section.success { border-color: rgba(0, 230, 118, 0.3); color: #00E676; }

.section-icon.grey  { background: rgba(100,116,139,0.15); }
.section-icon.grey .mud-icon-root  { color: #94A3B8; }

.confidence-score-display { display: flex; align-items: center; gap: 40px; padding: 20px 0; flex-wrap: wrap; }
.score-ring { width: 110px; height: 110px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 4px solid; }
.score-ring.score-green { border-color: #81c784; background: rgba(0, 230, 118,0.1); }
.score-ring.score-amber { border-color: #ffb74d; background: rgba(255,152,0,0.1); }
.score-ring.score-red   { border-color: #ef5350; background: rgba(255, 82, 82,0.1); }
.score-number { font-size: 2.2rem; font-weight: 700; color: var(--pure-white); line-height: 1; }
.score-pct { font-size: 1rem; color: var(--starlight-silver); }
.score-legend { display: flex; flex-direction: column; gap: 10px; }
.legend-item { display: flex; align-items: center; gap: 10px; font-size: 0.875rem; color: var(--starlight-silver); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-item.green .legend-dot { background: #81c784; }
.legend-item.amber .legend-dot { background: #ffb74d; }
.legend-item.red   .legend-dot { background: #ef5350; }
.legend-item.green { color: #81c784; }
.legend-item.amber { color: #ffb74d; }
.legend-item.red   { color: #ef5350; }

.qs-panel { border-left: 3px solid #81c784 !important; }
.qs-actions { display: flex; flex-direction: column; gap: 12px; }
.qs-buttons { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.submit-bar { display: flex; align-items: center; padding: 12px 16px; background: rgba(33, 150, 243, 0.08); border-radius: 12px; border: 1px solid rgba(33, 150, 243, 0.2); }

.cert-timeline { padding: 0; }
.timeline-entry { padding: 14px 16px; }
.timeline-header { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.status-transition { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.timeline-meta { display: flex; align-items: center; gap: 6px; }
.timeline-sep { color: var(--text-muted); }
.timeline-notes { color: var(--starlight-silver); margin-top: 8px; font-style: italic; font-size: 0.875rem; }

/* Return Certificate Dialog */
.return-dialog .mud-dialog-content { padding: 8px 24px 16px; }
.dialog-title-row { display: flex; align-items: center; gap: 14px; }
.dialog-title-icon { width: 40px; height: 40px; border-radius: 10px; background: rgba(255,152,0,0.15); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dialog-title-icon .mud-icon-root { color: #ffb74d; font-size: 1.25rem !important; }
.dialog-title-text { display: flex; flex-direction: column; gap: 2px; }
.dialog-title-main { font-size: 1rem; font-weight: 600; color: var(--pure-white); }
.dialog-title-sub { font-size: 0.8rem; color: var(--starlight-silver); }
.return-dialog-content { min-width: 480px; padding: 4px 0; }
.issues-section { display: flex; flex-direction: column; gap: 10px; }
.issues-label { font-size: 0.72rem; font-weight: 600; color: var(--starlight-silver); text-transform: uppercase; letter-spacing: 0.6px; }
.issue-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.issue-chip { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 500; cursor: pointer; border: 1px solid rgba(255,152,0,0.3); background: rgba(255,152,0,0.08); color: #ffb74d; transition: all 0.15s ease; }
.issue-chip:hover { background: rgba(255,152,0,0.18); border-color: rgba(255,152,0,0.5); }
.issue-chip.selected { background: rgba(255,152,0,0.25); border-color: #ffb74d; color: var(--pure-white); }
.premium-textarea .mud-input-outlined-border { border-color: rgba(255,255,255,0.12) !important; background: rgba(255,255,255,0.04) !important; transition: all 0.2s; }
.premium-textarea:hover .mud-input-outlined-border { border-color: rgba(255,152,0,0.4) !important; background: rgba(255,255,255,0.06) !important; }
.premium-textarea.mud-input-focused .mud-input-outlined-border { border-color: #ffb74d !important; box-shadow: 0 0 0 3px rgba(255,152,0,0.12); }
.premium-textarea textarea { color: var(--pure-white) !important; font-size: 0.9rem; }
.premium-textarea textarea::placeholder { color: rgba(255,255,255,0.35) !important; }
.btn-return-confirm { min-width: 170px; }
.char-count { text-align: right; }

/* PDF Import Page */
.import-panel { margin-bottom: 24px; }
.drop-zone { border: 2px dashed rgba(77,208,225,0.4); border-radius: 16px; padding: 24px; text-align: center; cursor: pointer; transition: all 0.2s; background: rgba(77,208,225,0.03); }
.drop-zone.dragging { border-color: #4DD0E1; background: rgba(77,208,225,0.08); }
.import-selection-bar { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; padding: 12px 16px; background: rgba(255,255,255,0.03); border-radius: 10px; border: 1px solid rgba(255,255,255,0.06); }
.extract-section-header { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; border-bottom: 1px solid rgba(33,150,243,0.2); padding-bottom: 8px; }
.extract-section-header h4 { margin: 0; }
.section-deselected { opacity: 0.35; position: relative; }
.section-deselected .extract-field { pointer-events: none; }
.section-deselected .extract-section-header { opacity: 1; }
.section-deselected .extract-section-header .mud-checkbox { opacity: 1; }
.extract-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.extract-section { background: rgba(255,255,255,0.05); border-radius: 12px; padding: 20px; border: 1px solid rgba(255,255,255,0.08); transition: opacity 0.2s ease; }
.extract-section h4 { color: var(--ts-blue-light); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; margin: 0 0 14px 0; }
.extract-field { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.05); gap: 12px; }
.ef-label { color: var(--starlight-silver); font-size: 0.85rem; white-space: nowrap; min-width: 120px; }
.ef-value { color: var(--pure-white); font-size: 0.85rem; font-weight: 600; text-align: right; flex: 1; word-break: break-word; }
.ef-value.low-confidence { color: var(--electric-amber); text-decoration: underline wavy rgba(255,183,77,0.5); }
.board-summary { padding: 8px 12px; color: #E2E8F0; font-size: 0.85rem; background: rgba(255,255,255,0.03); border-radius: 8px; margin-bottom: 6px; border-left: 3px solid var(--ts-blue); }
.obs-row { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.obs-code { font-weight: 700; color: var(--error-red); width: 36px; flex-shrink: 0; font-family: monospace; }
.obs-desc { color: var(--pure-white); font-size: 0.85rem; }
.obs-location { color: var(--starlight-silver); font-size: 0.78rem; font-style: italic; margin-left: auto; flex-shrink: 0; }
.obs-c1 { color: #FF5252; }
.obs-c2 { color: #FF9800; }
.obs-c3 { color: #00E676; }

/* AICR Import — Expandable Panel Cards */
/* 11 Nov 2026: panel card, header and content now come from the global Figma expansion-panel
   rules (EXPANSION PANELS above); only the title row pieces below stay page-specific. */
.aicr-panel-title { display: flex; align-items: center; gap: 10px; width: 100%; color: var(--pure-white); font-weight: 600; font-size: 0.9rem; }
.aicr-panel-icon { color: var(--ts-blue-light); }
.aicr-panel-count { margin-left: auto; color: var(--starlight-silver); font-size: 0.75rem; font-weight: 400; }
.aicr-panel-tag { margin-left: 8px; color: var(--ts-blue-light); font-size: 0.7rem; font-weight: 400; background: rgba(33,150,243,0.1); padding: 2px 8px; border-radius: 4px; }
.aicr-panel-cb { margin: -4px 0; }
.aicr-panel-deselected { opacity: 0.4; }
.aicr-panel-deselected .aicr-panel-title { opacity: 1; }
.aicr-panel-deselected .mud-checkbox { opacity: 1; pointer-events: auto; }
.aicr-fields-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0; }
.aicr-fields-grid .extract-field { padding: 8px 12px; }
.aicr-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 768px) { .aicr-two-col { grid-template-columns: 1fr; } }
/* Fixed label width so value columns align horizontally across both panels (Supply vs Supply Protective Device, etc.) */
.aicr-two-col .ef-label { width: 200px; min-width: 200px; flex-shrink: 0; }
.aicr-two-col .ef-value { flex: 1; min-width: 0; }
.aicr-sub-heading { color: var(--ts-blue-light); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.8px; font-weight: 600; margin: 0 0 10px 0; padding-bottom: 6px; border-bottom: 1px solid rgba(33,150,243,0.15); }

/* AICR Import — Board + Circuit Tables */
.aicr-board-card { background: rgba(255,255,255,0.03); border-radius: 10px; border: 1px solid rgba(255,255,255,0.06); padding: 16px; margin-bottom: 12px; }
.aicr-board-header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--starlight-silver); font-size: 0.85rem; margin-bottom: 10px; }
.aicr-board-header strong { color: var(--pure-white); font-size: 0.95rem; }
.aicr-board-circuit-count { margin-left: auto; color: var(--ts-blue-light); font-weight: 600; }
.aicr-board-header .phase-3p { color: var(--electric-amber); font-weight: 600; }
.aicr-circuit-table-wrap { overflow-x: auto; border-radius: 8px; }
.aicr-circuit-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; table-layout: fixed; }
.aicr-circuit-table th { background: rgba(0,0,0,0.3); color: var(--starlight-silver); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; font-size: 0.72rem; padding: 8px 6px; text-align: left; white-space: nowrap; border-bottom: 1px solid rgba(255,255,255,0.1); }
.aicr-circuit-table td { color: var(--pure-white); padding: 6px; border-bottom: 1px solid rgba(255,255,255,0.04); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aicr-circuit-table td:nth-child(2) { white-space: normal; word-break: break-word; overflow: visible; }
.aicr-circuit-table tbody tr:hover { background: rgba(33,150,243,0.06); }

/* AICR Import — Summary Strip */
.aicr-summary-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px;
    background: rgba(33,150,243,0.08);
    border: 1px solid rgba(33,150,243,0.15);
    border-radius: 12px;
}
@media (max-width: 768px) { .aicr-summary-strip { grid-template-columns: repeat(2, 1fr); } }
.aicr-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 0;
}
.aicr-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--pure-white);
    line-height: 1.2;
}
.aicr-stat-label {
    font-size: 0.72rem;
    color: var(--starlight-silver);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 500;
}

.assign-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 768px) { .assign-grid { grid-template-columns: 1fr; } .extract-grid { grid-template-columns: 1fr; } }

.extract-confidence-bar { margin-bottom: 20px; }
.confidence-meter { height: 6px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.confidence-fill { height: 100%; border-radius: 3px; transition: width 0.6s ease; }
.confidence-info { display: flex; align-items: center; font-size: 0.85rem; }

.loading-overlay { display: flex; align-items: center; justify-content: center; padding: 60px; }

.open-editor-btn {
    font-weight: 600 !important;
    padding: 10px 24px !important;
    background: var(--ts-blue)!important;
    box-shadow: none;
    transition: all 0.3s ease;
}
.open-editor-btn:hover {
    box-shadow: none;
    transform: none;
}

/* ===== Certificate Settings Page ===== */
.settings-row { display: flex; align-items: flex-start; gap: 24px; padding: 12px 0; }
.settings-field { display: flex; flex-direction: column; gap: 6px; min-width: 200px; }
.settings-toggle { display: flex; align-items: flex-start; gap: 12px; }
.toggle-label { color: var(--pure-white); font-weight: var(--font-weight-medium); display: block; }
.toggle-desc { color: var(--starlight-silver); font-size: 0.8rem; display: block; margin-top: 2px; }
.colour-preview { display: flex; align-items: center; gap: 12px; padding-top: 28px; }
.section-subtitle { color: var(--starlight-silver); font-size: 0.85rem; margin: 0; }
.cert-type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 4px 24px; margin-top: 12px; }
.cert-type-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.cert-type-code { color: var(--ts-blue-light); font-weight: 600; font-family: monospace; min-width: 70px; display: inline-block; }
.cert-type-name { color: var(--starlight-silver); font-size: 0.85rem; }

/* ===== Create Certificate Page ===== */
.create-cert-form { display: flex; flex-direction: column; gap: 16px; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; }

/* ===== PDF Import — Success State ===== */
.import-success-icon { text-align: center; margin-bottom: 32px; }
.import-success-icon .mud-icon-root { font-size: 4rem !important; color: var(--success-green); }
.import-success-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ===== Utility: inline toggle row ===== */
.toggle-row { display: flex; align-items: center; gap: 16px; }
.text-right { text-align: right; }

/* ===== GLOBAL: Sticky header bleed-through fix (Mar 30, 2026) =====
   Override all scoped page styles that use semi-transparent rgba() backgrounds
   on .cinematic-table th. Uses double class specificity to beat scoped CSS. */
.cinematic-table.cinematic-table th,
.mud-table.cinematic-table th {
    background: var(--table-header-bg) !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 2 !important;
}

/* ==========================================================================
   LIST ARCHETYPE — the one shell for every list page.
   A list page's root carries `class="premium-workspace list-page"`; the shell
   below (hero spacing, summary-card row, filter bar, glass-table frame) comes
   from here so all lists match WITHOUT private <style> copies. Scoped under
   .list-page (specificity 0,2,0) so it cleanly overrides the bare global
   defaults without !important — and pages WITHOUT the wrapper are untouched.
   Table HEADER colour is intentionally left to `.mud-table.cinematic-table th`
   above (already global + consistent). Tokens/rgba only (design ratchet).
   Pilot: JobsList + ListTemplate (Timesheets). Roll-out adds the wrapper +
   deletes each page's duplicate shell. See docs/planning/WEB_LAYOUT_CONSOLIDATION_PLAN.md
   ========================================================================== */

/* Hero: breadcrumb -> title (+ primary action beside) on the left; tools right */
.list-page .page-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 24px 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 24px;
}
.list-page .page-hero-left { display: flex; flex-direction: column; gap: 8px; }
.list-page .page-hero-actions { display: flex; gap: 12px; align-items: center; }
.list-page .page-breadcrumb a { color: var(--ts-blue); text-decoration: none; }
.list-page .page-breadcrumb a:hover { text-decoration: underline; }

/* Optional toolbar row (e.g. a period / week selector) */
.list-page .list-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 4px 24px 0;
}

/* Stat-card row — fills the width evenly regardless of the root's flex context */
.list-page .summary-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    width: 100%;
    box-sizing: border-box;
    padding: 0 24px;
    margin-bottom: 24px;
}

/* Active-filter indicator */
.list-page .active-filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: rgba(33, 150, 243, 0.08);
    border-bottom: 1px solid rgba(33, 150, 243, 0.2);
}
.list-page .active-filter-bar .filter-chip { font-weight: 600; }
.list-page .active-filter-bar .clear-filter-btn { color: var(--text-muted); font-size: var(--font-size-sm); }
.list-page .active-filter-bar .clear-filter-btn:hover { color: var(--pure-white); }

/* Filter / search bar */
.list-page .filter-bar {
    display: flex;
    gap: 16px;
    padding: 16px 24px;
    flex-wrap: wrap;
    align-items: flex-end;
}
.list-page .filter-item { display: flex; flex-direction: column; gap: 6px; min-width: 160px; }
.list-page .filter-item.search-item { flex: 0 1 320px; min-width: 200px; max-width: 360px; }
.list-page .filter-bar .premium-input .mud-input-outlined-border {
    border-color: var(--input-border) !important;
    background-color: transparent !important;
    transition: border-color 0.15s ease;
}
.list-page .filter-bar .premium-input:hover .mud-input-outlined-border {
    border-color: var(--input-border-hover) !important;
}
.list-page .filter-bar .premium-input.mud-input-control.mud-input-input-control.mud-input-focused .mud-input-outlined-border {
    border-color: var(--input-border-focus) !important;
    border-width: 1.5px !important;
    box-shadow: none;
}
.list-page .filter-bar .premium-input input,
.list-page .filter-bar .premium-input .mud-select-input { color: var(--pure-white) !important; font-weight: 500; }
.list-page .filter-bar .premium-input input::placeholder { color: var(--input-placeholder) !important; }
.list-page .filter-bar .premium-input .mud-input-adornment-icon { color: var(--starlight-silver) !important; }

/* Glass data-table frame (header colour stays with the global cinematic rule) */
.list-page .glass-table-card {
    margin: 0 24px 24px;
    background: var(--charcoal-gradient);
    border-radius: var(--radius-card);
    border: 1px solid var(--border-card);
    overflow: visible;
}
.list-page .cinematic-table { background: transparent !important; }
.list-page .table-row { cursor: pointer; transition: background-color 0.2s; }
.list-page .table-row:hover { background: var(--surface-raised) !important; }
.list-page .loading-state,
.list-page .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px;
    color: var(--text-muted);
    gap: 16px;
}
.list-page .empty-state h3 { color: var(--pure-white); margin: 0; }
.list-page .empty-state p { margin: 0 0 16px 0; }

/* ── Work lists: My Tasks, Team Tasks, Notifications (owner, 24 Sep 2026 — "snooze / dismiss / mark read etc — that
   should all feel / look similar"). One row-action set (WorkRowActions), one "N selected" bar (WorkBulkBar), one
   footer (ListFooter), one section header. Shared here — never a page-local copy. ── */
.cinematic-table .work-actions-col { width: 132px; text-align: right; }
.work-row-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    white-space: nowrap;
}
.work-bulk-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    padding: 10px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(33, 150, 243, 0.08);
    border-radius: 12px 12px 0 0;
}
.work-bulk-count { color: var(--pure-white); font-weight: 600; }
.work-bulk-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.work-bulk-clear { margin-left: auto; }
.work-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.work-section-header .work-section-count { color: var(--starlight-silver); font-weight: 500; }
.work-section-header.overdue { color: var(--error-red); }
.list-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    padding: 12px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.list-footer-count { color: var(--text-muted); font-size: var(--font-size-sm); }

/* Field → office attention cue on list rows (Fleet defects; Jobs pending field forms).
   One amber warning icon + tooltip; clears when office finishes the open item. */
.defect-warning-icon {
    color: var(--electric-amber) !important;
    animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ============================================================
   SETTINGS — STATIC (read-only / pointer) FIELDS (Aug 2026)
   A non-editable value or "this moved to X" pointer that sits
   where an input would. Mirrors the premium-input container so
   static and editable fields align on the same grid (founder
   feedback 3 Aug 2026: fixed text boxes looked odd/unaligned).
   ============================================================ */
.settings-static-field {
    display: flex;
    align-items: center;
    min-height: 56px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--starlight-silver);
    font-size: var(--font-size-sm, 0.875rem);
    line-height: 1.45;
}
.settings-static-field strong {
    color: var(--pure-white);
    font-weight: var(--font-weight-medium, 500);
    margin: 0 4px;
}

/* ============================================================
   PRERENDER AUTH WAIT (4 Aug 2026)
   Auth lives in browser localStorage, so the static prerender pass of any
   [Authorize] page always evaluates as anonymous. Routes.razor paints this
   honest loading state during that pass instead of a blank not-authorised
   frame — the "empty login page" a signed-in user used to be bounced through.
   ============================================================ */
.prerender-auth-wait {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 100vh;
    background: var(--deep-void);
    color: var(--starlight-silver);
    font-size: var(--font-size-sm, 0.875rem);
}

/* ============================================================================
   LINE ITEMS — the ONE read-only line-items table (Components/Shared/LineItemsTable.razor)
   Survey detail, quote detail and invoice detail all render it. Web sweep 8 Sep 2026
   (WS-SURV-05, owner ruling: pages that feed each other share one line-items UI).
   Values are the former QuoteDetailsView page-local rules, promoted verbatim.
   ============================================================================ */
.ts-lines { margin-top: 8px; }

.ts-lines__head,
.ts-lines__row {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr) 80px 100px 70px 100px;
    gap: 16px;
    padding: 12px 0;
    align-items: center;
}

.ts-lines__head {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.75rem;
    color: var(--starlight-silver);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ts-lines__row { border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.ts-lines__row:hover { background: rgba(33, 150, 243, 0.05); }

/* A description with no spaces (a long part number, web link or test text) must wrap
   inside its column, never push the page sideways (owner, 25 Sep 2026). */
.ts-lines__desc { min-width: 0; overflow-wrap: anywhere; }

.ts-lines__qty,
.ts-lines__price,
.ts-lines__vat,
.ts-lines__total { text-align: right; }

.ts-lines__code-value {
    font-family: monospace;
    color: var(--ts-blue-light);
    font-size: 0.85rem;
}

.ts-lines__total-value {
    color: var(--success-green);
    font-weight: 600;
}

.ts-lines__totals {
    margin-top: 20px;
    padding: 16px 20px;
    background: rgba(33, 150, 243, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(33, 150, 243, 0.1);
}

.ts-lines__totals-row {
    display: flex;
    justify-content: flex-end;
    gap: 48px;
    padding: 6px 0;
}

.ts-lines__totals-label { color: var(--starlight-silver); min-width: 100px; text-align: right; }
.ts-lines__totals-value { color: var(--pure-white); font-weight: 500; min-width: 120px; text-align: right; }

.ts-lines__grand {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ts-lines__grand .ts-lines__totals-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--pure-white);
}

.ts-lines__grand .ts-lines__totals-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ts-blue);
    text-shadow: none;
}

.ts-lines__hint {
    margin: 10px 0 0;
    font-size: 0.75rem;
    color: var(--starlight-silver);
    text-align: right;
}

.ts-lines__empty {
    color: var(--starlight-silver);
    font-size: 0.875rem;
    text-align: center;
    padding: 16px 0;
    margin: 0;
}

/* 25 Sep 2026 (owner): no code column while the Schedule of Rates library is off. */
.ts-lines--no-code .ts-lines__head,
.ts-lines--no-code .ts-lines__row { grid-template-columns: minmax(0, 1fr) 80px 100px 70px 100px; }

@media (max-width: 768px) {
    .ts-lines__head,
    .ts-lines__row,
    .ts-lines--no-code .ts-lines__head,
    .ts-lines--no-code .ts-lines__row { grid-template-columns: minmax(0, 1fr) 80px 100px; }
    .ts-lines__code,
    .ts-lines__qty,
    .ts-lines__vat { display: none; }
}

/* ============================================================================
   LINE ITEM EDIT ROWS — the ONE editable line row (Components/Shared/QuoteLineEditRow.razor;
   the same .line-item-row shell is used by the invoice and survey-material editors).
   Web sweep 8 Sep 2026 (WS-SURV-12/14). .line-item-row / .line-total / .dense-input /
   .no-label / .line-item-header / .pricing-pass-needed were page-local copies in
   CreateQuote and EditQuote (and missing on the invoice and survey editors) — promoted here.
   ============================================================================ */
.line-item-row {
    background: rgba(255, 255, 255, 0.02);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
    /* 26 Sep 2026 (invoicing re-run): the row is a size container, so the line grid lays itself out
       for the width the ROW actually has (a form column beside a side panel, the Copilot rail open),
       not the window width. See the @container rules under .line-item-grid. */
    container-type: inline-size;
    container-name: line-row;
}

.line-item-row:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--glass-border-hover);
}

.line-item-header {
    padding: 0 16px;
    margin-bottom: -8px;
}

.line-total {
    font-weight: 600;
    color: var(--success-green);
    font-size: 14px;
}

.dense-input .mud-input-control { margin-top: 0 !important; }
.no-label .mud-input-label { display: none !important; }

/* Pricing pass — a line still needing a sell price (design-system amber, no raw hex). */
.pricing-pass-needed .mud-input-outlined-border {
    border-color: var(--electric-amber) !important;
}

/* The quote line grid: columns mirror the read-only .ts-lines table
   (code · description · qty · price · vat · total) plus a tools cell.
   Inputs bottom-align so a wrapped label never pushes one field out of line. */
.line-item-grid {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) 90px 130px 80px 110px 40px;
    gap: 12px;
    /* Top-aligned: the description grows to several lines (WS-SURV-13), the other fields stay level with its first line. */
    align-items: start;
}

.line-item-grid > div { min-width: 0; }

/* 9 Sep 2026 (owner): every field on the row starts the same depth as the description. The
   description is a two-line textarea (MudBlazor: rows=2, margin 10.5px top/bottom when dense);
   the single-line inputs beside it get the same two-line content height (2lh) under their own
   10.5px padding, so SOR · Qty · Price · VAT · Total sit exactly as deep as the description's
   starting box. When the description grows, the others stay at that depth (top-aligned). */
.line-item-grid .mud-input > input.mud-input-root:not(.mud-input-root-multiline) {
    height: 2lh;
}

/* Total and tools sit on the input line, not floating above it (WS-SURV-14). */
.line-item-grid .li-total .line-total {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 40px;
    padding-right: 4px;
}

/* 9 Sep 2026: the total is a read-only field the same depth as its neighbours, green like the
   read-only tables; the tools cell carries a blank label so the bin sits level with the inputs. */
.line-item-grid .line-total-field .mud-input-slot,
.line-item-grid .line-total-field input {
    color: var(--success-green);
    font-weight: 600;
    text-align: right;
}

.line-item-grid .li-tools {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.line-item-grid .li-tools .mud-icon-button {
    /* Same depth as the fields: two lines at the input's font + the dense padding. */
    font-size: 1rem;
    line-height: 1.1876em;
    height: calc(2lh + 21px);
    width: 40px;
}

/* 25 Sep 2026 (owner): no SOR Code column while the Schedule of Rates library is off. */
.line-item-grid.line-item-grid--no-code {
    grid-template-columns: minmax(0, 1fr) 90px 130px 80px 110px 40px;
}

@media (max-width: 1024px) {
    .line-item-grid {
        grid-template-columns: 120px minmax(0, 1fr) 80px 120px 70px 100px 40px;
        gap: 8px;
    }
    .line-item-grid.line-item-grid--no-code {
        grid-template-columns: minmax(0, 1fr) 80px 120px 70px 100px 40px;
    }
}

@media (max-width: 768px) {
    .line-item-grid,
    .line-item-grid.line-item-grid--no-code {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .line-item-grid .li-desc { grid-column: 1 / -1; }
    .line-item-grid .li-sor { grid-column: 1 / 3; }
}

/* 26 Sep 2026 (invoicing re-run proof on dev): at 1500 px the quote editor's Description showed ONE LETTER
   PER LINE. The fixed columns (code 120 · qty 90 · price 130 · VAT 80 · total 110 · tools 40 + gaps ≈ 640 px)
   took the whole row, and minmax(0, 1fr) let the description shrink to nothing. When the ROW is narrower than
   the fixed columns plus a readable description, the description takes a full line of its own and the
   numbers sit on the line under it. This is sized by the row (container query), so it holds at every desktop
   width, with or without side panels. */
@container line-row (max-width: 960px) {
    .line-item-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr) minmax(0, 1.2fr) minmax(0, 0.7fr) minmax(0, 1fr) 40px;
        gap: 8px;
    }
    .line-item-grid.line-item-grid--no-code {
        grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr) minmax(0, 0.7fr) minmax(0, 1fr) 40px;
    }
    .line-item-grid .li-desc { grid-column: 1 / -1; order: -1; }
}

/* Phone width: the description on its own line, then two fields per line — 13 Nov 2026 (WEB TESTER, 390px): three
   a line left the Price box too narrow for "0.00" beside its spin buttons. */
@container line-row (max-width: 520px) {
    .line-item-grid,
    .line-item-grid.line-item-grid--no-code {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .line-item-grid .li-desc { grid-column: 1 / -1; order: -1; }
    .line-item-grid .li-sor { grid-column: 1 / -1; }
}

/* Line descriptions — first line is the heading, each further line a bullet (WS-SURV-13, 8 Sep 2026).
   Shared rule: TradeSync.Common.Text.LineDescriptionText; the PDF and the client portal draw the same. */
.ts-lines__bullets {
    margin: 4px 0 0 18px;
    padding: 0;
    color: var(--starlight-silver);
    font-size: 0.85rem;
}
.ts-lines__bullets li { margin: 2px 0; }

/* PDF-downloaded marker on list rows (Wave B, 8 Sep 2026): shown ONLY when the PDF has been
   downloaded, inline beside the row's title / reference — never a column of its own. */
.pdf-downloaded-icon {
    color: var(--error-red);
    font-size: var(--font-size-base);
    vertical-align: middle;
    margin-left: 6px;
}

/* ============================================================================
   AUTOMATIONS BUILDER — Wave 3 QuoteAccepted presentation (Settings → Automations).
   Tokens only. The stored workflow is unchanged; this is how it is shown.
   ============================================================================ */
.automation-builder {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.automation-builder-name {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: end;
}

.automation-builder-hint {
    margin: 0;
    color: var(--starlight-silver);
    font-size: var(--font-size-sm);
}

.automation-kind-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.automation-kind-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: color-mix(in srgb, var(--pure-white) 3%, transparent);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.automation-kind-card:hover,
.automation-kind-card:focus-visible {
    border-color: var(--glass-border-hover);
    box-shadow: var(--neon-glow);
}

.automation-kind-name {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: var(--pure-white);
}

.automation-kind-when {
    font-size: var(--font-size-sm);
    color: var(--starlight-silver);
}

.automation-sentence {
    margin: 0;
    padding: 16px 16px 16px 20px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    border-left: 3px solid var(--ts-blue);
    background: var(--glass-bg);
    color: var(--pure-white);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    line-height: 1.5;
}

.automation-builder-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
    gap: 16px;
    align-items: start;
}

.automation-builder-pane {
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    min-width: 0;
}

.automation-builder-pane-title {
    margin: 0 0 16px;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: var(--pure-white);
}

.automation-flow-canvas {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.automation-flow-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: color-mix(in srgb, var(--pure-white) 3%, transparent);
    cursor: pointer;
    text-align: left;
    color: inherit;
    font: inherit;
    --accent: var(--ts-blue);
}

.automation-flow-block:hover {
    border-color: color-mix(in srgb, var(--ts-blue) 45%, transparent);
}

.automation-flow-block.is-selected {
    border-color: var(--ts-blue);
    box-shadow: var(--neon-glow);
}

.automation-flow-block.is-when { --accent: var(--ts-blue); }
.automation-flow-block.is-if { --accent: var(--info-cyan); }
.automation-flow-block.is-wait { --accent: var(--electric-amber); }
.automation-flow-block.is-then { --accent: var(--success-green); }

.automation-flow-kind {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}

.automation-flow-title {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: var(--pure-white);
}

.automation-flow-subtitle {
    font-size: var(--font-size-sm);
    color: var(--starlight-silver);
}

.automation-flow-connector {
    width: 2px;
    height: 16px;
    margin-left: 24px;
    background: var(--neutral-grey);
    opacity: 0.4;
}

.automation-flow-add {
    margin-top: 12px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px dashed var(--neutral-grey);
    background: transparent;
    color: var(--pure-white);
    font-size: var(--font-size-lg);
    cursor: pointer;
}

.automation-inspector {
    min-height: 160px;
}

.automation-inspector-empty {
    margin: 0;
    color: var(--starlight-silver);
    font-size: var(--font-size-sm);
}

.automation-inspector-copy {
    margin: 8px 0 0;
    color: var(--starlight-silver);
    font-size: var(--font-size-sm);
}

.automation-list-summary {
    color: var(--starlight-silver);
    font-size: var(--font-size-sm);
}

.automation-activity-headline {
    font-weight: var(--font-weight-medium);
    color: var(--pure-white);
}

.automation-activity-did {
    margin-top: 4px;
    color: var(--starlight-silver);
    font-size: var(--font-size-sm);
}

.automation-activity-toggle {
    margin-top: 4px;
    padding-left: 0;
}

.automation-activity-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
    font-size: var(--font-size-xs);
    color: var(--starlight-silver);
}

.automation-tabs .mud-tabs-toolbar {
    border-bottom: 1px solid var(--glass-border);
}

.automation-tab-panel {
    padding-top: 16px;
}

@media (max-width: 900px) {
    .automation-builder-layout {
        grid-template-columns: 1fr;
    }

    .automation-builder-name {
        grid-template-columns: 1fr;
    }

    .automation-kind-list {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   ETT CONNECT BRAND (2 Oct 2026) - public pages an ETT Connect member opens from an ETT email
   (the confirm-your-email page). The same colours as the ETT app (mobile app_ett/theme/ett_color_tokens.dart).
   Not for office screens.
   ========================================================================== */
:root {
    --ett-background: #071F1D;
    --ett-brand-header: #0F7C73;
    --ett-surface: #0C3B37;
    --ett-text-secondary: #BFDAD7;
}

/* ==========================================================================
   PHONE WIDTH — no sideways scroll (QA 14 Oct 2026, card C)
   At 375 px the Jobs list was 598 px wide and Clients 793 px: the hero's tool buttons sat on
   one line beside the title, and the top bar's eight icons ran off the right edge. On a phone the
   hero stacks (title, then the buttons, which wrap). (11 Nov 2026: the Refresh and Open-on-second-
   screen top-bar icons this block used to hide are gone from the top bar altogether — Figma 85:4513.)
   Desktop is untouched.
   ========================================================================== */
@media (max-width: 700px) {
    .page-hero,
    .list-page .page-hero {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .page-hero-actions,
    .list-page .page-hero-actions {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 8px;
        min-width: 0;
    }
    .page-hero-actions .mud-button-root { white-space: nowrap; }
    /* Render check 14 Oct 2026 (lead): the title sits above its primary action, and the tools row is compact. */
    .title-row { flex-direction: column; align-items: flex-start; gap: 12px; }
    .page-hero-actions .mud-button-root:not(.mud-icon-button) {
        padding: 4px 10px;
        min-height: 32px;
        font-size: 0.8rem;
    }
    .topbar-left, .topbar-right { gap: 2px; min-width: 0; }
}

/* ==========================================================================
   FIVE STAT CARDS — balanced rows (render check 14 Oct 2026, lead)
   auto-fit put four cards on a row and the fifth alone (Saved materials at ~800 px). A bar with exactly five
   cards (each StatCard also writes a style tag, so cards are counted as divs) shows five across when there is
   room, 3 + 2 on a medium screen, and one column on a phone.
   ========================================================================== */
.summary-bar:has(> div:nth-of-type(5):last-of-type) {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}
@media (max-width: 1100px) {
    .summary-bar:has(> div:nth-of-type(5):last-of-type) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 700px) {
    .summary-bar:has(> div:nth-of-type(5):last-of-type) {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   SUMMARY STRIP — Figma "Summary strip example" 15:5299 (11 Nov 2026)
   A row of compact StatCards is one joined strip: no gaps, the cells share 1px Mono/8 lines
   (each overlaps its neighbour by half a pixel), and only the strip's outer corners are rounded.
   The column counts above (5 / 6 cards) still decide where it wraps.
   ========================================================================== */
.summary-bar:has(> .ts-statcard.tsc-compact) {
    gap: 0;
}

.summary-bar > .ts-statcard.tsc-compact {
    border-radius: 0;
    margin: -0.5px;
}

.summary-bar > .ts-statcard.tsc-compact:first-of-type { border-top-left-radius: 12px; border-bottom-left-radius: 12px; }
.summary-bar > .ts-statcard.tsc-compact:last-of-type { border-top-right-radius: 12px; border-bottom-right-radius: 12px; }


/* ==========================================================================
   AUTOFILL — ONE RULE FOR EVERY INPUT (28 Oct 2026, owner bug: "Register your interest"
   autofill turned a field light with light text, so it could not be read)
   Chrome / Edge / Safari paint their own background and text colour on a field the browser has
   filled in (:-webkit-autofill) and ignore ours. Cover that paint with an inset shadow in the
   field's own colour and force our text + caret colour back. Applies to plain inputs and to
   MudBlazor outlined / filled inputs alike (their <input> / <textarea> is matched directly).
   Colours come from tokens, never a fixed hex, so the rule is right in any theme:
     --ts-autofill-bg   field background (default: MudBlazor surface — flips with the theme)
     --ts-autofill-text field text       (default: MudBlazor primary text — flips with the theme)
   A page whose fields use a different background sets --ts-autofill-bg (and -text) on its own
   wrapper (e.g. .ri-page, .auth-card). Guarded by AutofillColourGuardTests28Oct.
   Colour only — no size, spacing or layout change.
   ========================================================================== */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
textarea:-webkit-autofill:active,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus,
select:-webkit-autofill:active {
    -webkit-text-fill-color: var(--ts-autofill-text, var(--mud-palette-text-primary)) !important;
    caret-color: var(--ts-autofill-text, var(--mud-palette-text-primary)) !important;
    -webkit-box-shadow: 0 0 0 1000px var(--ts-autofill-bg, var(--mud-palette-surface)) inset !important;
    box-shadow: 0 0 0 1000px var(--ts-autofill-bg, var(--mud-palette-surface)) inset !important;
    /* Fallback: hold the browser's own background change off for ~a week. */
    transition: background-color 600000s 0s, color 600000s 0s;
}

/* Standard pseudo-class (Firefox, newer Chrome/Safari). Kept as its own rule: a browser that does
   not know :autofill drops only this block, never the one above. */
input:autofill,
textarea:autofill,
select:autofill {
    -webkit-text-fill-color: var(--ts-autofill-text, var(--mud-palette-text-primary)) !important;
    caret-color: var(--ts-autofill-text, var(--mud-palette-text-primary)) !important;
    box-shadow: 0 0 0 1000px var(--ts-autofill-bg, var(--mud-palette-surface)) inset !important;
    transition: background-color 600000s 0s, color 600000s 0s;
}

/* ==========================================================================
   FIGMA BUTTONS — global MudButton styling (Myth tidy-up, 4 Nov 2026)
   Source: Figma component library "02 Buttons" (Button component set).
   Variant mapping (MudBlazor → Figma):
     Filled  Primary / Info            → Primary      (Blue/6, hover Blue/7)
     Filled  Error                     → Destructive  (Red/6, hover Red/5)
     Filled  Success                   → Positive     (Green/7, hover Green/6)
     Filled  Warning                   → Warning      (Orange/6, hover Orange/5)
     Filled  Default / Secondary / Dark,
     Outlined Default / Primary / Secondary / Info / Dark → Secondary (Mono/9 + Mono/8 border)
     Text    Primary / Info            → Ghost        (Blue/4 text, raised fill on hover)
   Sizes: Size.Large 44px, Size.Medium 40px, Size.Small 32px. Labels: sentence case,
   Satoshi Medium 14/24 (set in TradeSyncTheme.Typography.Button). Icon buttons are not
   touched here. Disabled look is the "DISABLED BUTTONS" rule earlier in this file.
   ========================================================================== */
.mud-button-root.mud-button {
    border-radius: var(--btn-radius);
    box-shadow: none;
    text-transform: none;
    letter-spacing: normal;
    font-weight: var(--font-weight-medium);
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

/* No lift on hover (page-local .create-btn / .save-btn copies still ask for one). */
.mud-button-root.mud-button:hover { transform: none; }

.mud-button-root.mud-button[class*="-size-large"]  { min-height: 44px; padding: 10px 14px; }
.mud-button-root.mud-button[class*="-size-medium"] { min-height: 40px; padding: 8px 12px; }
.mud-button-root.mud-button[class*="-size-small"]  { min-height: 32px; padding: 6px 12px; font-size: 13px; line-height: 20px; }
.mud-button-root.mud-button.mud-button-outlined[class*="-size-"] { border-width: 1px; }

/* Primary */
.mud-button-root.mud-button-filled.mud-button-filled-primary,
.mud-button-root.mud-button-filled.mud-button-filled-info {
    background: var(--btn-primary-bg) !important;
    color: var(--pure-white) !important;
    box-shadow: none !important;
}
.mud-button-root.mud-button-filled.mud-button-filled-primary:hover,
.mud-button-root.mud-button-filled.mud-button-filled-info:hover {
    background: var(--btn-primary-bg-hover) !important;
}

/* Destructive */
.mud-button-root.mud-button-filled.mud-button-filled-error { background: var(--btn-destructive-bg) !important; box-shadow: none !important; }
.mud-button-root.mud-button-filled.mud-button-filled-error:hover { background: var(--btn-destructive-bg-hover) !important; }

/* Positive */
.mud-button-root.mud-button-filled.mud-button-filled-success { background: var(--btn-positive-bg) !important; box-shadow: none !important; }
.mud-button-root.mud-button-filled.mud-button-filled-success:hover { background: var(--btn-positive-bg-hover) !important; }

/* Warning */
.mud-button-root.mud-button-filled.mud-button-filled-warning { background: var(--btn-warning-bg) !important; box-shadow: none !important; }
.mud-button-root.mud-button-filled.mud-button-filled-warning:hover { background: var(--btn-warning-bg-hover) !important; }

/* Secondary */
.mud-button-root.mud-button-filled:is(.mud-button-filled-default, .mud-button-filled-secondary, .mud-button-filled-dark),
.mud-button-root.mud-button-outlined:is(.mud-button-outlined-default, .mud-button-outlined-primary, .mud-button-outlined-secondary, .mud-button-outlined-info, .mud-button-outlined-dark) {
    background: var(--btn-secondary-bg);
    border: 1px solid var(--btn-secondary-border);
    color: var(--btn-secondary-text);
    box-shadow: none;
}
.mud-button-root.mud-button-filled:is(.mud-button-filled-default, .mud-button-filled-secondary, .mud-button-filled-dark):hover,
.mud-button-root.mud-button-outlined:is(.mud-button-outlined-default, .mud-button-outlined-primary, .mud-button-outlined-secondary, .mud-button-outlined-info, .mud-button-outlined-dark):hover {
    background: var(--btn-secondary-bg-hover);
    border-color: var(--btn-secondary-border-hover);
}

/* Outlined RAG buttons (no Figma equivalent): Secondary shape, coloured label kept for meaning */
.mud-button-root.mud-button-outlined:is(.mud-button-outlined-error, .mud-button-outlined-warning, .mud-button-outlined-success) {
    background: var(--btn-secondary-bg);
    border: 1px solid var(--btn-secondary-border);
}
.mud-button-root.mud-button-outlined.mud-button-outlined-error   { color: var(--rag-red-3); }
.mud-button-root.mud-button-outlined.mud-button-outlined-warning { color: var(--rag-orange-3); }
.mud-button-root.mud-button-outlined.mud-button-outlined-success { color: var(--rag-green-3); }
.mud-button-root.mud-button-outlined:is(.mud-button-outlined-error, .mud-button-outlined-warning, .mud-button-outlined-success):hover {
    background: var(--btn-secondary-bg-hover);
    border-color: var(--btn-secondary-border-hover);
}

/* Ghost */
.mud-button-root.mud-button-text:is(.mud-button-text-primary, .mud-button-text-info) { color: var(--btn-ghost-text); }
.mud-button-root.mud-button-text:hover { background: var(--surface-raised); }
.mud-button-root.mud-button-text.mud-button-text-error   { color: var(--rag-red-3); }
.mud-button-root.mud-button-text.mud-button-text-warning { color: var(--rag-orange-3); }

/* ==========================================================================
   FIGMA LABELS ABOVE — every MudBlazor input (Myth tidy-up, 4 Nov 2026)
   Figma "Text field": the label always sits above the field, never floating on the
   border. Most pages already do this with <FormLabel>; dialogs did it with their own
   rule (kept above). This makes the same true for any MudTextField / MudSelect /
   picker / autocomplete that still passes Label="…". MudBlazor renders the label
   after the input inside .mud-input-control-input-container, so the container becomes
   a column and the label is ordered first.
   ========================================================================== */
.mud-input-control > .mud-input-control-input-container {
    display: flex;
    flex-direction: column;
}
.mud-input-control .mud-input-control-input-container > .mud-input-label,
.mud-input-control .mud-input-control-input-container > .mud-input-label.mud-shrink,
.mud-input-control .mud-input-control-input-container > .mud-input-label.mud-input-label-animated.mud-shrink,
.filter-bar .mud-input-control .mud-input-control-input-container > .mud-input-label {
    position: relative !important;
    transform: none !important;
    order: -1;
    margin: 0 0 6px !important;
    padding: 0 !important;
    background: none !important;
    pointer-events: none;
    font-size: 14px !important;
    font-weight: var(--font-weight-medium) !important;
    line-height: 1.4 !important;
    color: var(--input-label) !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    white-space: normal;
}
.mud-input-control.mud-disabled .mud-input-control-input-container > .mud-input-label {
    color: var(--input-disabled-text) !important;
}
.mud-input-control.mud-input-error .mud-input-control-input-container > .mud-input-label,
.mud-input-control .mud-input-control-input-container > .mud-input-label.mud-input-error {
    color: var(--input-border-error) !important;
}
/* With the label out of the box, filled fields no longer need the top room MudBlazor
   leaves for a floating label: same 44px as outlined. */
.mud-input.mud-input-filled:not(:has(textarea)) input.mud-input-slot {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    line-height: 24px !important;
    height: 24px;
}
/* Text-variant (underline) fields keep MudBlazor's 16px gap for a floating label; drop it. */
.mud-input-control .mud-input-control-input-container > .mud-input.mud-input-text {
    margin-top: 0;
}

/* ==========================================================================
   FIGMA PILLS (Myth tidy-up, 5 Nov 2026) — Figma "Pill" (15:4265) and "Status pill" (15:4218).
   Pill = dark tint of a colour family + light label, 12px Bold, 28px (small) / 36px (large),
   fully rounded, no outline, sentence case. Status pill (a status you can change) = stronger
   fill, white Medium label, chevron. Figma has five families (grey, blue, green, orange, red).
   The founder-approved status colours (StatusChipColorMapper, 22 Jul 2026) have fifteen, so the
   extra ten are shades of those five families — every status keeps its own look.
   All label/fill pairs are 5:1 or better. Outlined chips become filled; a clickable chip that is
   outlined is "off" in a toggle group, so it shows as the grey pill.
   ========================================================================== */
:root {
    /* --pill-<hue>-bg / -fg = Pill; --pill-<hue>-solid (+ -solid-fg) = Status pill */
    --pill-grey-bg: var(--mono-8);          --pill-grey-fg: var(--mono-3);          --pill-grey-solid: var(--mono-7);
    --pill-slate-bg: var(--mono-7);         --pill-slate-fg: var(--mono-2);         --pill-slate-solid: var(--mono-6);
    --pill-graphite-bg: var(--mono-10);     --pill-graphite-fg: var(--mono-5);      --pill-graphite-solid: var(--mono-8);
    --pill-blue-bg: var(--blue-10);         --pill-blue-fg: var(--blue-3);          --pill-blue-solid: var(--blue-9);
    --pill-cobalt-bg: var(--blue-9);        --pill-cobalt-fg: var(--blue-2);        --pill-cobalt-solid: var(--blue-7);
    --pill-cyan-bg: var(--blue-8);          --pill-cyan-fg: var(--blue-1);          --pill-cyan-solid: var(--blue-8);
    --pill-green-bg: var(--rag-green-9);    --pill-green-fg: var(--rag-green-3);    --pill-green-solid: var(--rag-green-9);
    --pill-emerald-bg: var(--rag-green-8);  --pill-emerald-fg: var(--rag-green-2);  --pill-emerald-solid: var(--rag-green-8);
    --pill-teal-bg: var(--rag-green-10);    --pill-teal-fg: var(--rag-green-4);     --pill-teal-solid: var(--rag-green-10);
    --pill-lime-bg: var(--rag-green-6);     --pill-lime-fg: var(--rag-green-10);    --pill-lime-solid: var(--rag-green-6);
    --pill-lime-solid-fg: var(--rag-green-10);
    --pill-orange-bg: var(--rag-orange-8);  --pill-orange-fg: var(--rag-orange-2);  --pill-orange-solid: var(--rag-orange-7);
    --pill-amber-bg: var(--rag-orange-9);   --pill-amber-fg: var(--rag-orange-3);   --pill-amber-solid: var(--rag-orange-8);
    --pill-gold-bg: var(--rag-orange-10);   --pill-gold-fg: var(--rag-orange-4);    --pill-gold-solid: var(--rag-orange-9);
    --pill-red-bg: var(--rag-red-9);        --pill-red-fg: var(--rag-red-2);        --pill-red-solid: var(--rag-red-8);
    --pill-crimson-bg: var(--rag-red-7);    --pill-crimson-fg: var(--rag-red-1);    --pill-crimson-solid: var(--rag-red-7);
}

/* 14 Nov 2026 (John: post-it look, a colour per note). The four note papers and the ink that goes on them. Light
   paper on the dark board, dark writing: every ink/paper pair below is WCAG AA or better (4.5:1), checked by
   NotePaperLookTests14Nov. No pink, magenta or purple (DESIGN_SYSTEM.md § 1). */
:root {
    --note-paper-yellow: #FFE98F;
    --note-paper-blue: #BFDCFF;
    --note-paper-green: #BFEFC9;
    --note-paper-orange: #FFD0A1;
    --note-paper-ink: #1D1F27;        /* the note's words, menu dots */
    --note-paper-ink-soft: #454857;   /* "Only you", "Updated …" */
    --note-paper-ink-link: #123E81;   /* links on paper */
    --note-paper-strip: rgba(0, 0, 0, 0.07);              /* the "glue strip" along the top */
    --note-paper-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
    --note-paper-shadow-lifted: 0 12px 26px rgba(0, 0, 0, 0.55);
}

/* Default family = grey, set at low priority so every colour rule below out-ranks it
   (and a chip never inherits a parent chip's colour). */
.mud-chip, .status-chip { --pill-bg: var(--pill-grey-bg); --pill-fg: var(--pill-grey-fg); }

/* --- MudChip → Figma Pill. "html" + repeated class out-ranks the older chip rules and page styles. --- */
html .mud-chip.mud-chip.mud-chip {
    background: var(--pill-bg) !important;
    color: var(--pill-fg) !important;
    border: none !important;
    border-radius: 20px !important;
    box-shadow: none !important;
    font-family: var(--font-stack) !important;
    font-size: 12px !important;
    font-weight: var(--font-weight-bold, 700) !important;
    line-height: 16px !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    padding: 0 12px !important;
    gap: 8px; /* icon ↔ label (Figma Pill) */
    filter: none;
}
html .mud-chip.mud-chip.mud-chip:not([style*="height"]) {
    height: 28px !important;
    min-height: 28px !important;
}
html .mud-chip.mud-chip.mud-chip.mud-chip-size-medium:not([style*="height"]),
html .mud-chip.mud-chip.mud-chip.mud-chip-size-large:not([style*="height"]) {
    height: 36px !important;
    min-height: 36px !important;
    font-size: 14px !important;
    line-height: 20px !important;
}
html .mud-chip.mud-chip.mud-chip .mud-chip-content { gap: 8px; padding: 0 !important; }
html .mud-chip.mud-chip.mud-chip .mud-chip-icon,
html .mud-chip.mud-chip.mud-chip .mud-icon-root { color: inherit !important; width: 16px; height: 16px; font-size: 16px !important; margin: 0 !important; }
html .mud-chip.mud-chip.mud-chip.mud-clickable:hover { filter: brightness(1.15); }

/* Colour → family */
html .mud-chip.mud-chip.mud-chip-color-primary { --pill-bg: var(--pill-blue-bg); --pill-fg: var(--pill-blue-fg); }
html .mud-chip.mud-chip.mud-chip-color-info { --pill-bg: var(--pill-cyan-bg); --pill-fg: var(--pill-cyan-fg); }
html .mud-chip.mud-chip.mud-chip-color-success { --pill-bg: var(--pill-green-bg); --pill-fg: var(--pill-green-fg); }
html .mud-chip.mud-chip.mud-chip-color-warning { --pill-bg: var(--pill-orange-bg); --pill-fg: var(--pill-orange-fg); }
html .mud-chip.mud-chip.mud-chip-color-error { --pill-bg: var(--pill-red-bg); --pill-fg: var(--pill-red-fg); }
/* Toggle chips: outlined/text + clickable = "off" → grey; selected = its colour. */
html .mud-chip.mud-chip.mud-clickable.mud-chip-outlined:not(.mud-chip-selected),
html .mud-chip.mud-chip.mud-clickable.mud-chip-text:not(.mud-chip-selected) {
    --pill-bg: var(--pill-grey-bg);
    --pill-fg: var(--pill-grey-fg);
}

/* Job / form types, priorities and the legacy .status-chip classes keep their existing colour meaning. */
html .mud-chip.type-chip.reactive, html .mud-chip.type-chip.remedial,
html .mud-chip.priority-chip.urgent, html .mud-chip.priority-chip.critical,
html .status-chip.cancelled, html .status-chip.overdue, html .status-chip.expired, html .status-chip.rejected,
html .status-chip.failed, html .status-chip.danger, html .status-chip.red, html .status-chip.unsafe { --pill-bg: var(--pill-red-bg); --pill-fg: var(--pill-red-fg); }
html .mud-chip.priority-chip.emergency { --pill-bg: var(--pill-crimson-bg); --pill-fg: var(--pill-crimson-fg); }
html .mud-chip.type-chip.planned, html .mud-chip.type-chip.eicr, html .mud-chip.type-chip.cat-inspection,
html .mud-chip.priority-chip.medium,
html .status-chip.scheduled, html .status-chip.sent, html .status-chip.blue, html .status-chip.invoiced, html .status-chip.info,
html .status-chip.submitted { --pill-bg: var(--pill-blue-bg); --pill-fg: var(--pill-blue-fg); }
html .mud-chip.type-chip.inspection, html .mud-chip.type-chip.install, html .mud-chip.type-chip.pat,
html .mud-chip.type-chip.cat-report, html .mud-chip.type-chip.cat-siteassets,
html .status-chip.cyan, html .status-chip.conversion, html .status-chip.pipeline { --pill-bg: var(--pill-cyan-bg); --pill-fg: var(--pill-cyan-fg); }
html .mud-chip.type-chip.installation, html .mud-chip.type-chip.ppm, html .mud-chip.type-chip.eic,
html .mud-chip.type-chip.cat-certificate, html .mud-chip.priority-chip.low,
html .status-chip.active, html .status-chip.valid, html .status-chip.approved, html .status-chip.complete,
html .status-chip.completed, html .status-chip.paid, html .status-chip.published, html .status-chip.green,
html .status-chip.safe { --pill-bg: var(--pill-green-bg); --pill-fg: var(--pill-green-fg); }
html .mud-chip.type-chip.ev { --pill-bg: var(--pill-teal-bg); --pill-fg: var(--pill-teal-fg); }
html .mud-chip.type-chip.minorworks, html .mud-chip.type-chip.cat-healthsafety, html .mud-chip.priority-chip.high,
html .status-chip.returned, html .status-chip.orange { --pill-bg: var(--pill-orange-bg); --pill-fg: var(--pill-orange-fg); }
html .mud-chip.type-chip.emergencylighting, html .mud-chip.type-chip.emergency, html .mud-chip.type-chip.cat-checklist,
html .mud-chip.type-chip.cat-memberforms,
html .status-chip.inprogress, html .status-chip.in-progress, html .status-chip.onhold, html .status-chip.on-hold,
html .status-chip.pending, html .status-chip.warning, html .status-chip.expiring, html .status-chip.amber,
html .status-chip.inreview, html .status-chip.not-submitted { --pill-bg: var(--pill-amber-bg); --pill-fg: var(--pill-amber-fg); }
html .mud-chip.type-chip.survey, html .mud-chip.type-chip.cat-form,
html .status-chip.inactive, html .status-chip.draft, html .status-chip.closed, html .status-chip.archived,
html .status-chip.grey { --pill-bg: var(--pill-grey-bg); --pill-fg: var(--pill-grey-fg); }

/* Legacy .status-chip on plain spans (not MudChip) — same pill. */
html span.status-chip, html div.status-chip {
    background: var(--pill-bg) !important;
    color: var(--pill-fg) !important;
    border: none !important;
    border-radius: 20px !important;
    font-size: 12px !important;
    font-weight: var(--font-weight-bold, 700) !important;
    line-height: 16px !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    padding: 6px 12px !important;
    height: auto !important;
    min-height: 28px !important;
    box-sizing: border-box;
}

/* ==========================================================================
   FIGMA TABS (Myth tidy-up, 5 Nov 2026) — Figma "Tab item" (15:5372) / "Tabs row" (15:5411).
   Underline tabs on a 1px Mono/8 rule, 24px apart. Label 14px Medium: Mono/4 default, Mono/3 on
   hover (Mono/7 underline), Mono/0 when active with a 2px Primary blue/6 underline.
   Count badge: Mono/8 + Mono/4, active Blue/10 + Blue/3. No filled/pill tab bars.
   ========================================================================== */
html .mud-tabs .mud-tabs-tabbar.mud-tabs-tabbar,
html .mud-tabs .mud-tabs-header.mud-tabs-header {
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
}
html .mud-tabs:not(.mud-tabs-vertical) .mud-tabs-tabbar.mud-tabs-tabbar { border-bottom: 1px solid var(--mono-8) !important; }
html .mud-tabs .mud-tabs-tabbar-inner { min-height: 41px; }
html .mud-tabs .mud-tab.mud-tab {
    width: auto !important; /* MudBlazor stretches tabs to 100%; Figma tabs hug their label */
    min-width: 0 !important;
    min-height: 41px;
    padding: 10px 4px !important;
    margin-right: 24px;
    font-family: var(--font-stack) !important;
    font-size: 14px !important;
    font-weight: var(--font-weight-medium, 500) !important;
    line-height: 20px !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    color: var(--mono-4) !important;
    background: transparent !important;
    border-radius: 0 !important;
    opacity: 1;
    position: relative;
    overflow: visible;
    transition: color 0.15s ease;
}
/* The underline belongs to each tab (::before), so it always spans exactly that tab. MudBlazor's
   sliding underline is hidden: it positions itself by adding up tab widths and ignores the 24px gap,
   so it drifted left by 24px per tab (David, 5 Nov 2026). */
html .mud-tabs .mud-tab.mud-tab::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    border-radius: 1px;
    background: transparent;
    transition: background-color 0.15s ease;
}
html .mud-tabs .mud-tab-slider.mud-tab-slider { display: none !important; }
html .mud-tabs .mud-tab.mud-tab:hover:not(.mud-tab-active):not(.mud-disabled) { color: var(--mono-3) !important; }
html .mud-tabs .mud-tab.mud-tab:hover:not(.mud-tab-active):not(.mud-disabled)::before { background: var(--mono-7); }
html .mud-tabs .mud-tab.mud-tab.mud-tab-active { color: var(--mono-0) !important; background: transparent !important; }
html .mud-tabs .mud-tab.mud-tab.mud-tab-active::before { background: var(--blue-6); }
html .mud-tabs .mud-tab.mud-tab.mud-disabled { color: var(--mono-6) !important; }
html .mud-tabs .mud-tab.mud-tab:focus-visible { outline: 2px solid var(--blue-5); outline-offset: 2px; }
/* Count sits inline after the label (Figma), not as MudBlazor's floating corner badge. */
html .mud-tabs .mud-tab .mud-tab-badge { position: relative; display: inline-flex; margin-left: 8px; }
html .mud-tabs .mud-tab .mud-tab-badge .mud-badge-wrapper { position: static; inset: auto; transform: none; display: inline-flex; }
html .mud-tabs .mud-tab .mud-badge {
    position: static !important;
    transform: none !important;
    inset: auto !important;
    min-width: 0;
    height: auto;
    line-height: 16px;
    background: var(--mono-8) !important;
    color: var(--mono-4) !important;
    font-size: 11px !important;
    font-weight: var(--font-weight-medium, 500);
    border-radius: 10px !important;
    padding: 1px 7px !important;
}
html .mud-tabs .mud-tab.mud-tab-active .mud-badge { background: var(--blue-10) !important; color: var(--blue-3) !important; }

/* ==========================================================================
   FIGMA INLINE BANNERS (Myth tidy-up, 5 Nov 2026) — every MudAlert follows Figma "Inline banner"
   (15:4949): a RAG/9 tinted fill (Orange/8 for warnings, Blue/10 for info, Mono/8 for neutral),
   16px radius, 12px 16px padding, no border, Mono/1 14px text, severity-coloured 20px icon.
   Outlined/text variants are filled like the pills. Toasts below reuse the same severity tokens.
   ========================================================================== */
.mud-alert, .mud-snackbar { --al-bg: var(--mono-8); --al-icon: var(--mono-3); }
html .mud-alert-filled-success, html .mud-alert-outlined-success, html .mud-alert-text-success,
html .mud-snackbar[class*="-success"] { --al-bg: var(--rag-green-9); --al-icon: var(--rag-green-3); }
html .mud-alert-filled-error, html .mud-alert-outlined-error, html .mud-alert-text-error,
html .mud-snackbar[class*="-error"] { --al-bg: var(--rag-red-9); --al-icon: var(--rag-red-4); }
html .mud-alert-filled-warning, html .mud-alert-outlined-warning, html .mud-alert-text-warning,
html .mud-snackbar[class*="-warning"] { --al-bg: var(--rag-orange-8); --al-icon: var(--rag-orange-2); }
html .mud-alert-filled-info, html .mud-alert-outlined-info, html .mud-alert-text-info,
html .mud-snackbar[class*="-info"] { --al-bg: var(--blue-10); --al-icon: var(--blue-3); }

html .mud-alert.mud-alert {
    background: var(--al-bg) !important;
    border: none !important;
    border-radius: 16px !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    padding: 12px 16px !important;
    color: var(--mono-1) !important;
    align-items: flex-start;
}
html .mud-alert.mud-alert.mud-dense { padding: 8px 12px !important; }
html .mud-alert.mud-alert .mud-alert-message {
    color: inherit !important;
    font-family: var(--font-stack);
    font-size: 14px !important;
    line-height: 20px !important;
    padding: 0 !important;
}
html .mud-alert.mud-alert .mud-alert-icon {
    color: var(--al-icon) !important;
    margin: 0 12px 0 0 !important;
    padding: 0 !important;
    align-self: flex-start;
}
html .mud-alert.mud-alert .mud-alert-icon .mud-icon-root { color: inherit !important; width: 20px; height: 20px; font-size: 20px !important; }
html .mud-alert.mud-alert .mud-alert-close .mud-icon-button,
html .mud-alert.mud-alert .mud-alert-close .mud-icon-root { color: var(--al-icon) !important; }
html .mud-alert.mud-alert .mud-alert-close { padding-left: 12px !important; margin: 0 !important; align-self: flex-start; }

/* ==========================================================================
   FIGMA TOASTS (Myth tidy-up, 5 Nov 2026) — every Snackbar follows Figma "Toast" (15:4918):
   Mono/9 surface, Mono/8 border, 16px radius, 12px padding, deep shadow, max 400px wide.
   Severity is carried by the 36px tinted icon circle ("Icon status"), not a coloured edge.
   Message: 14px Medium Mono/0. Position (bottom-right) and timing live in Program.cs.
   ========================================================================== */
html .mud-snackbar.mud-snackbar {
    background: var(--mono-9) !important;
    border: 1px solid var(--mono-8) !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
    backdrop-filter: none !important;
    padding: 12px !important;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    color: var(--mono-0) !important;
    align-items: center;
}
html .mud-snackbar.mud-snackbar .mud-snackbar-icon {
    flex: none;
    width: 36px;
    height: 36px;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 50%;
    background: var(--al-bg);
    color: var(--al-icon) !important;
    display: flex;
    align-items: center;
    justify-content: center;
}
html .mud-snackbar.mud-snackbar .mud-snackbar-icon .mud-icon-root { color: inherit !important; width: 21px; height: 21px; font-size: 21px !important; }
html .mud-snackbar.mud-snackbar .mud-snackbar-content-message {
    font-family: var(--font-stack);
    font-size: 14px;
    font-weight: var(--font-weight-medium, 500);
    line-height: 20px;
    color: var(--mono-0) !important;
    padding: 0 !important;
}
html .mud-snackbar.mud-snackbar .mud-snackbar-content-action { margin: 0 0 0 auto !important; padding: 0 !important; align-self: flex-start; }
html .mud-snackbar.mud-snackbar .mud-snackbar-content-action .mud-icon-button { color: var(--mono-4) !important; padding: 4px !important; }
html .mud-snackbar.mud-snackbar .mud-snackbar-content-action .mud-icon-button:hover { color: var(--mono-0) !important; }
html .mud-snackbar.mud-snackbar .mud-snackbar-content-action .mud-icon-root { width: 16px; height: 16px; font-size: 16px !important; color: inherit !important; }

/* ==========================================================================
   NO CLICK RIPPLE (Myth tidy-up, 5 Nov 2026 — David: "remove it everywhere").
   MudBlazor's Material ripple (the flash on click) isn't in the Figma designs. It is one
   ::after effect on every clickable MudBlazor control (buttons, icon buttons, chips, tabs,
   menu items, checkboxes, switches, radios), so this removes it app-wide. Hover and
   pressed colours are unchanged; keyboard focus outlines are unaffected.
   ========================================================================== */
html .mud-ripple::after,
html .mud-ripple-icon::after,
html .mud-ripple-checkbox::after,
html .mud-ripple-switch::after,
html .mud-ripple-radio::after { display: none !important; }

/* ==========================================================================
   FIGMA FORM CONTROLS (Myth tidy-up, 6 Nov 2026) — Figma "Checkbox" 15:4079, "Radio" 15:4096,
   "Switch" 15:4057, "Select" 15:3840 (dropdown panel + menu items). Showcase: /style-guide § 4b.
   Labels: 14px Regular Mono/3 (disabled Mono/6), 10px from the control.
   ========================================================================== */
:root {
    --ctl-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
    --ctl-minus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E");
    --ctl-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* Shared label text — set on the control too, so text passed as child content (the repo's way of
   labelling, DESIGN_SYSTEM.md Global 4) gets it as well as MudBlazor's own label element. */
html .mud-checkbox,
html .mud-switch,
html .mud-checkbox > .mud-typography,
html .mud-radio > .mud-radio-content,
html .mud-switch > .mud-typography {
    font-family: var(--font-stack);
    font-size: 14px !important;
    font-weight: var(--font-weight-regular, 400);
    line-height: 20px;
    color: var(--mono-3) !important;
}

/* --- Checkbox: 20px box, 6px radius. Off = Mono/9 + 1.5px Mono/7 border; on/indeterminate = Blue/6
       with a white tick/dash; disabled = Mono/10 + Mono/8 (checked: Blue/6 at 45%). The box is drawn on
       the button (24px target), MudBlazor's Material icon is hidden. --- */
html .mud-checkbox > .mud-icon-button.mud-icon-button {
    width: 24px;
    height: 24px;
    padding: 0 !important;
    margin: 0 8px 0 0;
    flex: none;
    background: transparent !important;
    overflow: visible;
}
html .mud-checkbox > .mud-icon-button > svg { display: none; }
html .mud-checkbox > .mud-icon-button::before {
    content: "";
    position: absolute;
    inset: 2px;
    box-sizing: border-box;
    border-radius: 6px;
    background: var(--mono-9) center / 14px no-repeat;
    border: 1.5px solid var(--mono-7);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
html .mud-checkbox > .mud-icon-button:not(.mud-disabled):hover::before { border-color: var(--mono-6); }
html .mud-checkbox > .mud-icon-button.mud-checkbox-true::before { background-color: var(--blue-6); background-image: var(--ctl-check); border-color: var(--blue-6); }
html .mud-checkbox > .mud-icon-button.mud-checkbox-null::before { background-color: var(--blue-6); background-image: var(--ctl-minus); border-color: var(--blue-6); }
html .mud-checkbox > .mud-icon-button.mud-disabled::before { background-color: var(--mono-10); border-color: var(--mono-8); }
html .mud-checkbox > .mud-icon-button.mud-disabled.mud-checkbox-true::before,
html .mud-checkbox > .mud-icon-button.mud-disabled.mud-checkbox-null::before { background-color: var(--blue-6); border-color: var(--blue-6); opacity: 0.45; }
html .mud-checkbox > .mud-icon-button:focus-visible { outline: 2px solid var(--blue-5); outline-offset: 0; border-radius: 8px; }
/* Clicking a checkbox, radio or switch label toggles it; it shouldn't also highlight the text (David, 6 Nov 2026). */
html .mud-checkbox,
html .mud-radio,
html .mud-switch { -webkit-user-select: none; user-select: none; }
html .mud-checkbox:has(> .mud-disabled),
html .mud-checkbox:has(> .mud-disabled) > .mud-typography { color: var(--mono-6) !important; }

/* --- Radio: 20px circle. Off = Mono/9 + 1.5px Mono/7 ring; on = Blue/6 ring + 10px Blue/6 dot;
       disabled = Mono/10 + Mono/8. --- */
html .mud-radio > .mud-icon-button.mud-icon-button {
    width: 24px;
    height: 24px;
    padding: 0 !important;
    margin: 0 8px 0 0;
    flex: none;
    background: transparent !important;
    overflow: visible;
}
html .mud-radio .mud-radio-icons > svg { display: none; }
html .mud-radio .mud-radio-icons {
    position: relative;
    display: block;
    width: 20px;
    height: 20px;
    box-sizing: border-box;
    border-radius: 50%;
    background: var(--mono-9);
    border: 1.5px solid var(--mono-7);
    transition: border-color 0.15s ease;
}
html .mud-radio > .mud-icon-button:not(.mud-disabled):hover .mud-radio-icons:not(.mud-checked) { border-color: var(--mono-6); }
html .mud-radio .mud-radio-icons.mud-checked { border-color: var(--blue-6); }
html .mud-radio .mud-radio-icons.mud-checked::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--blue-6);
    transform: translate(-50%, -50%);
}
html .mud-radio.mud-disabled .mud-radio-icons,
html .mud-radio .mud-disabled .mud-radio-icons { background: var(--mono-10); border-color: var(--mono-8); }
html .mud-radio.mud-disabled .mud-radio-icons.mud-checked,
html .mud-radio .mud-disabled .mud-radio-icons.mud-checked { opacity: 0.45; border-color: var(--blue-6); }
html .mud-radio.mud-disabled > .mud-radio-content { color: var(--mono-6) !important; }
html .mud-radio > .mud-icon-button:focus-visible { outline: 2px solid var(--blue-5); outline-offset: 0; border-radius: 50%; }
html .mud-radio-group > .mud-radio { margin-right: 24px; }
html .mud-radio.mud-radio-content-placement-end { margin-left: 0; margin-inline-start: 0; }

/* --- Switch: 40×22 pill track, 18px knob, 2px inset. On = Blue/6 track + white knob; off = Mono/7 track +
       Mono/3 knob; disabled = 45% opacity. --- */
html .mud-switch.mud-switch { margin-left: 0; margin-inline-start: 0; margin-right: 16px; margin-inline-end: 16px; }
html .mud-switch .mud-switch-span.mud-switch-span {
    width: 40px;
    height: 22px;
    padding: 0;
    overflow: visible;
    flex: none;
}
html .mud-switch .mud-switch-span .mud-switch-track {
    position: absolute;
    inset: 0;
    width: 40px;
    height: 22px;
    border-radius: 11px;
    opacity: 1 !important;
    background-color: var(--mono-7) !important;
}
html .mud-switch .mud-switch-base.mud-switch-base {
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    padding: 0 !important;
    background: transparent !important;
    color: var(--mono-3) !important;
    transform: none;
}
html .mud-switch .mud-switch-base.mud-switch-base.mud-checked { transform: translateX(18px); color: var(--mono-0) !important; }
html .mud-switch .mud-switch-base.mud-checked + .mud-switch-track { background-color: var(--blue-6) !important; }
html .mud-switch .mud-switch-button .mud-switch-thumb-medium,
html .mud-switch .mud-switch-button [class*="mud-switch-thumb"] {
    width: 18px;
    height: 18px;
    box-shadow: none;
    background-color: currentColor;
}
html .mud-switch .mud-switch-span:has(.mud-switch-disabled) { opacity: 0.45; }
/* Two separate rules: a selector list that mixes a disabled and a non-disabled selector is banned
   (PrimaryButtonCursorPinTests, 9 Sep cursor incident). */
html .mud-switch.mud-disabled,
html .mud-switch.mud-disabled > .mud-typography { color: var(--mono-6) !important; }
html .mud-switch:has(.mud-switch-base.mud-switch-disabled),
html .mud-switch:has(.mud-switch-base.mud-switch-disabled) > .mud-typography { color: var(--mono-6) !important; }
html .mud-switch .mud-switch-base:focus-visible { outline: 2px solid var(--blue-5); outline-offset: 2px; border-radius: 50%; }
html .mud-switch.mud-switch { gap: 10px; }
html .mud-switch > .mud-typography { margin-left: 0; }

/* --- Dropdown panels (select, autocomplete and menu lists): Mono/9, Mono/8 border, 16px radius,
       deep shadow, 6px padding. Items: 10px 12px, 12px radius, 14px Medium Mono/0; hover = raised;
       the selected option shows a Blue/4 tick instead of a tint. Select arrow = Untitled chevron. --- */
html .mud-popover.mud-popover-open.mud-paper:not(.mud-picker-paper):not(:has(.mud-picker)) {
    background: var(--mono-9) !important;
    border: 1px solid var(--mono-8) !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
html .mud-popover .mud-list:not(.mud-navmenu) { padding: 6px !important; display: flex; flex-direction: column; gap: 2px; box-sizing: border-box; }
/* 13 Nov 2026 (Simon, live: MS template picker lines overlapping + two scrollbars). MudBlazor caps the list at the
   popover's height (max-height: inherit) and scrolls it; as a flex column its items then SHRANK to fit, so a two-line
   item was squeezed to one line's height and its lines overlapped. Items keep their natural height (flex-shrink: 0),
   and only the list scrolls — the popover around it no longer adds a second scrollbar. Pinned by
   DropdownListItemsNeverSquashTests13Nov. */
html .mud-popover:has(> .mud-list:not(.mud-navmenu)) { overflow-y: hidden !important; }
html .mud-popover .mud-list:not(.mud-navmenu) > .mud-list-item,
html .mud-popover .mud-list:not(.mud-navmenu) .mud-menu-item {
    flex-shrink: 0;
    margin: 0 !important;
    max-width: 100% !important;
    padding: 10px 12px !important;
    border-radius: 12px !important;
    min-height: 0;
    background: transparent !important;
    color: var(--mono-0) !important;
    transition: background-color 0.15s ease !important;
}
html .mud-popover .mud-list:not(.mud-navmenu) .mud-list-item-text { margin: 0; padding: 0; }
html .mud-popover .mud-list:not(.mud-navmenu) .mud-list-item .mud-typography,
html .mud-popover .mud-list:not(.mud-navmenu) .mud-menu-item .mud-typography {
    font-family: var(--font-stack);
    font-size: 14px !important;
    font-weight: var(--font-weight-medium, 500) !important;
    line-height: 20px !important;
}
html .mud-popover .mud-list:not(.mud-navmenu) > .mud-list-item:hover,
html .mud-popover .mud-list:not(.mud-navmenu) > .mud-list-item:focus-visible,
html .mud-popover .mud-list:not(.mud-navmenu) .mud-menu-item:hover { background: var(--surface-raised) !important; }
html .mud-popover .mud-list:not(.mud-navmenu) > .mud-list-item.mud-selected-item {
    padding-right: 38px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2388B5FC' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 18px !important;
}
html .mud-popover .mud-list:not(.mud-navmenu) > .mud-divider,
html .mud-popover .mud-list:not(.mud-navmenu) > hr { margin: 4px 6px; border-color: var(--mono-8); }
html .mud-popover .mud-list:not(.mud-navmenu) .mud-list-item.mud-disabled .mud-typography { color: var(--mono-6) !important; }

html .mud-select .mud-input-adornment-end.mud-select-input .mud-icon-root {
    color: transparent !important;
    background-color: var(--mono-4);
    -webkit-mask: var(--ctl-chevron) center / 18px no-repeat;
    mask: var(--ctl-chevron) center / 18px no-repeat;
    transition: transform 0.15s ease;
}
html .mud-select .mud-disabled .mud-input-adornment-end .mud-icon-root { background-color: var(--mono-6); }
html .mud-select .mud-input-control.mud-input-disabled .mud-input-adornment-end .mud-icon-root { background-color: var(--mono-6); }
/* Dropdowns and menus don't dim the page (Figma: "Lightweight overlay … no backdrop"). Their invisible
   click-away layer is a bare .mud-overlay; dialogs and DarkBackground overlays draw a scrim and keep the
   72% backdrop from the OVERLAY BACKDROP rule above. */
html .mud-overlay:not(:has(> .mud-overlay-scrim)) { background-color: transparent !important; }
html .mud-popover .mud-list:not(.mud-navmenu) > .mud-divider { width: auto; align-self: stretch; margin: 4px 6px !important; }
/* Dropdowns open below their field (AnchorOrigin="Origin.BottomCenter" on each MudSelect/MudAutocomplete,
   Figma "Select" open state) with a 6px gap; when there's no room below MudBlazor flips the list above. */
html .mud-popover-open[class*="mud-popover-anchor-bottom"]:not([data-mudpopover-flip="flipped"]) { margin-top: 6px; }
html .mud-popover-open[class*="mud-popover-anchor-bottom"][data-mudpopover-flip="flipped"] { margin-top: -6px; }

/* ==========================================================================
   FIGMA TABLE FOOTER + LOADING (Myth tidy-up, 6 Nov 2026) — Figma "Pagination" 15:5065 and
   "Loading" 15:5007. ListFooter is the one list footer (owner ruling R2); TableSkeleton is the
   table loading state. Page loads keep the spinner + text (BrandSpinner ruling, 25 Sep 2026).
   ========================================================================== */
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}

/* Footer: Mono/8 rule, 12px 16px, 13px Mono/4 count; page buttons 36px circles. */
html .list-footer { padding: 12px 16px; gap: 8px 16px; border-top: 1px solid var(--mono-8); }
html .list-footer .list-footer-count { color: var(--mono-4); font-size: 13px; font-variant-numeric: tabular-nums; }
html .mud-pagination { gap: 4px; }
html .mud-pagination .mud-pagination-item { margin: 0 !important; }
html .mud-pagination .mud-pagination-item .mud-button-root {
    min-width: 36px !important;
    width: 36px;
    height: 36px;
    min-height: 36px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--mono-3) !important;
    font-family: var(--font-stack);
    font-size: 13px !important;
    font-weight: var(--font-weight-medium, 500) !important;
    font-variant-numeric: tabular-nums;
}
html .mud-pagination .mud-pagination-item .mud-button-root:hover:not(:disabled) { background: var(--surface-raised) !important; color: var(--mono-0) !important; }
html .mud-pagination .mud-pagination-item.mud-pagination-item-selected .mud-button-root { background: var(--blue-10) !important; color: var(--blue-3) !important; }
html .mud-pagination .mud-pagination-item .mud-button-root:disabled { color: var(--mono-7) !important; background: transparent !important; }
html .mud-pagination .mud-pagination-item .mud-icon-root { width: 18px; height: 18px; font-size: 18px; }
html .mud-pagination .mud-pagination-item:not(:has(.mud-button-root)) { color: var(--mono-6); font-size: 13px; min-width: 36px; text-align: center; }

/* Table skeleton: three rows of Mono/7 bars, Mono/8 dividers, gentle pulse. */
.table-skeleton { padding: 8px 16px; }
.table-skeleton-row { display: flex; align-items: center; gap: 24px; padding: 14px 0; border-bottom: 1px solid var(--mono-8); }
.table-skeleton-row:last-child { border-bottom: none; }
.table-skeleton-bar { display: block; height: 12px; border-radius: 6px; background: var(--mono-7); animation: table-skeleton-pulse 1.4s ease-in-out infinite; }
.table-skeleton-bar.w-ref { flex: 0 1 90px; }
.table-skeleton-bar.w-title { flex: 0 1 200px; }
.table-skeleton-bar.w-client { flex: 0 1 120px; }
.table-skeleton-bar.w-short { flex: 0 1 80px; }
.table-skeleton-bar.w-status { flex: 0 1 100px; }
@keyframes table-skeleton-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) { .table-skeleton-bar { animation: none; } }

/* Page loading: centred spinner + what is loading, 14px Medium Mono/4. */
html .loading-state > span,
html .list-page .loading-state > span { color: var(--mono-4); font-size: 14px; font-weight: var(--font-weight-medium, 500); }

/* ==========================================================================
   FIGMA SETTINGS ROW (Myth tidy-up, 6 Nov 2026) — Figma "Settings row" 15:4068: label + one-line
   description + switch, rows stacked with a Mono/8 divider. Applies to the existing
   .settings-two-col > .settings-toggle-card pattern on the Settings pages (53 cards, 9 files), so no
   markup changes: text on the left, the switch on the right; other fields (number boxes, dropdowns)
   stay under the description.
   ========================================================================== */
html .settings-two-col:has(> .settings-toggle-card) { grid-template-columns: minmax(0, 1fr); gap: 0; }
html .settings-toggle-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 16px;
    row-gap: 4px;
    align-items: center;
    padding: 14px 0;
    background: none;
    border: none;
    border-bottom: 1px solid var(--mono-8);
    border-radius: 0;
}
html .settings-two-col > .settings-toggle-card:last-child { border-bottom: none; }
html .settings-toggle-card > * { grid-column: 1; min-width: 0; }
html .settings-toggle-card > .mud-input-control-boolean-input {
    grid-column: 2;
    grid-row: 1 / span 4;
    align-self: center;
    justify-self: end;
}
html .settings-toggle-card > .mud-input-control-boolean-input .mud-switch { margin-right: 0; margin-inline-end: 0; }
html .settings-toggle-card .form-label-container { margin: 0; }
html .settings-toggle-card .form-label { color: var(--mono-0); font-size: 14px; }
html .settings-toggle-card .option-hint { color: var(--mono-5); font-size: 13px; line-height: 18px; }
html .settings-toggle-card > .mud-input-control:not(.mud-input-control-boolean-input) { margin-top: 8px; max-width: 320px; }

/* ==========================================================================
   FIGMA EMPTY STATE (Myth tidy-up, 6 Nov 2026) — Figma "Empty state" 15:4984 (Page / Filtered).
   Applies to .empty-state (GuidanceEmptyState, 59 uses, plus pages that use the class directly).
   Icon in a 56px Mono/8 circle, 18px Medium Mono/0 title, 14px Mono/4 text (max 360px), action
   button, then a plain Blue/4 "Tell me more" link. No card of its own — it sits inside the table card.
   ========================================================================== */
html .empty-state {
    gap: 16px;
    padding: 40px 24px;
    color: var(--mono-4);
}
html .empty-state > .mud-icon-root:first-child,
html .empty-state > .empty-state-icon {
    box-sizing: content-box;
    width: 32px !important;
    height: 32px !important;
    font-size: 32px !important;
    padding: 12px;
    margin: 0 !important;
    border-radius: 50%;
    background: var(--mono-8);
    color: var(--mono-3);
}
html .empty-state h3,
html .empty-state .empty-state-title {
    margin: 0 0 -10px; /* 6px from the text below (the 16px gap minus 10) */
    color: var(--mono-0);
    font-size: 18px;
    font-weight: var(--font-weight-medium, 500);
    line-height: 24px;
}
html .empty-state p,
html .empty-state .empty-state-description {
    margin: 0;
    max-width: 360px;
    color: var(--mono-4);
    font-size: 14px;
    line-height: 20px;
}
html .empty-state .ts-empty-help-link {
    margin: 0;
    padding: 2px 4px;
    color: var(--blue-4);
    font-size: 14px;
    font-weight: var(--font-weight-medium, 500);
    line-height: 24px;
    background: transparent;
}
html .empty-state .ts-empty-help-link .mud-icon-root { display: none; }
html .empty-state .ts-empty-help-link:hover,
html .empty-state .ts-empty-help-link:focus-visible { color: var(--blue-3); background: transparent; text-decoration: underline; }

/* ==========================================================================
   FIGMA ICON BUTTON (Myth tidy-up, 6 Nov 2026) — Figma "Icon button" 15:4150: round; Small 28 (16px icon)
   · Medium 38 (18px) · Large 44 (20px). Ghost (MudBlazor's default text variant) = Mono/4 icon, raised
   circle + Mono/0 on hover. Red (Color.Error) = Red/4 icon, Red/9 circle on hover (Figma Destructive).
   Green/orange keep their colour. Filled = Primary blue circle. Buttons inside fields, pickers,
   pagination, banners, toasts, chips, tabs and the top bar keep their own styles.
   ========================================================================== */
html button.mud-icon-button:not(:is(.mud-input-adornment, .mud-picker, .mud-pagination, .mud-alert, .mud-snackbar, .mud-chip, .mud-tabs, .cinematic-topbar, .mud-table-pagination) *) {
    width: 38px;
    height: 38px;
    min-width: 38px;
    padding: 0 !important;
    border-radius: 50% !important;
    color: var(--mono-4) !important;
    background-color: transparent;
    transition: background-color 0.15s ease, color 0.15s ease;
}
html button.mud-icon-button:not(:is(.mud-input-adornment, .mud-picker, .mud-pagination, .mud-alert, .mud-snackbar, .mud-chip, .mud-tabs, .cinematic-topbar, .mud-table-pagination) *) .mud-icon-root { width: 18px; height: 18px; font-size: 18px; }
html button.mud-icon-button.mud-icon-button-size-small:not(:is(.mud-input-adornment, .mud-picker, .mud-pagination, .mud-alert, .mud-snackbar, .mud-chip, .mud-tabs, .cinematic-topbar, .mud-table-pagination) *) { width: 28px; height: 28px; min-width: 28px; }
html button.mud-icon-button.mud-icon-button-size-small:not(:is(.mud-input-adornment, .mud-picker, .mud-pagination, .mud-alert, .mud-snackbar, .mud-chip, .mud-tabs, .cinematic-topbar, .mud-table-pagination) *) .mud-icon-root { width: 16px; height: 16px; font-size: 16px; }
html button.mud-icon-button.mud-icon-button-size-large:not(:is(.mud-input-adornment, .mud-picker, .mud-pagination, .mud-alert, .mud-snackbar, .mud-chip, .mud-tabs, .cinematic-topbar, .mud-table-pagination) *) { width: 44px; height: 44px; min-width: 44px; }
html button.mud-icon-button.mud-icon-button-size-large:not(:is(.mud-input-adornment, .mud-picker, .mud-pagination, .mud-alert, .mud-snackbar, .mud-chip, .mud-tabs, .cinematic-topbar, .mud-table-pagination) *) .mud-icon-root { width: 20px; height: 20px; font-size: 20px; }
html button.mud-icon-button:not(:disabled):not(:is(.mud-input-adornment, .mud-picker, .mud-pagination, .mud-alert, .mud-snackbar, .mud-chip, .mud-tabs, .cinematic-topbar, .mud-table-pagination) *):hover { background-color: var(--surface-raised) !important; color: var(--mono-0) !important; }
html button.mud-icon-button.mud-error-text:not(:is(.mud-input-adornment, .mud-picker, .mud-pagination, .mud-alert, .mud-snackbar, .mud-chip, .mud-tabs, .cinematic-topbar, .mud-table-pagination) *) { color: var(--rag-red-4) !important; }
html button.mud-icon-button.mud-error-text:not(:disabled):not(:is(.mud-input-adornment, .mud-picker, .mud-pagination, .mud-alert, .mud-snackbar, .mud-chip, .mud-tabs, .cinematic-topbar, .mud-table-pagination) *):hover { background-color: var(--rag-red-9) !important; color: var(--rag-red-3) !important; }
html button.mud-icon-button.mud-success-text:not(:is(.mud-input-adornment, .mud-picker, .mud-pagination, .mud-alert, .mud-snackbar, .mud-chip, .mud-tabs, .cinematic-topbar, .mud-table-pagination) *) { color: var(--rag-green-4) !important; }
html button.mud-icon-button.mud-warning-text:not(:is(.mud-input-adornment, .mud-picker, .mud-pagination, .mud-alert, .mud-snackbar, .mud-chip, .mud-tabs, .cinematic-topbar, .mud-table-pagination) *) { color: var(--rag-orange-3) !important; }
html button.mud-icon-button[class*="filled"]:not(:is(.mud-input-adornment, .mud-picker, .mud-pagination, .mud-alert, .mud-snackbar, .mud-chip, .mud-tabs, .cinematic-topbar, .mud-table-pagination) *) { background-color: var(--blue-6) !important; color: var(--mono-0) !important; }
html button.mud-icon-button[class*="filled"]:not(:disabled):not(:is(.mud-input-adornment, .mud-picker, .mud-pagination, .mud-alert, .mud-snackbar, .mud-chip, .mud-tabs, .cinematic-topbar, .mud-table-pagination) *):hover { background-color: var(--blue-7) !important; }
html button.mud-icon-button:disabled:not(:is(.mud-input-adornment, .mud-picker, .mud-pagination, .mud-alert, .mud-snackbar, .mud-chip, .mud-tabs, .cinematic-topbar, .mud-table-pagination) *) { color: var(--mono-7) !important; }

/* ==========================================================================
   FIGMA TOOLTIP (Myth tidy-up, 6 Nov 2026) — Figma "Tooltip" 15:5036: Mono/11 bubble, Mono/8 border,
   10px radius, 8px 12px, 13px Medium Mono/0, deep shadow; the arrow matches the bubble.
   ========================================================================== */
html .mud-tooltip.mud-tooltip {
    background: var(--mono-11) !important;
    color: var(--mono-0) !important;
    border: 1px solid var(--mono-8);
    border-radius: 10px !important;
    padding: 8px 12px !important;
    font-family: var(--font-stack);
    font-size: 13px !important;
    font-weight: var(--font-weight-medium, 500) !important;
    line-height: 18px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
}
html .mud-tooltip.mud-tooltip.mud-tooltip-arrow::after { border-color: var(--mono-11) transparent transparent transparent !important; }

/* ==========================================================================
   FIGMA TABLE HEADER SORT (Myth tidy-up, 6 Nov 2026) — Figma "Table header cell" 15:5051: 12px Medium
   Mono/4 label; the sort chevron shows faintly on hover and in Primary blue/4 (with the label) when
   that column is sorted. The Material arrow becomes the Untitled chevron.
   ========================================================================== */
html .mud-table-sort-label { gap: 6px; }
html .mud-table-sort-label .mud-table-sort-label-icon {
    width: 14px;
    height: 14px;
    font-size: 14px;
    margin: 0 !important;
    color: transparent !important;
    background-color: var(--mono-4);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m18 15-6-6-6 6'/%3E%3C/svg%3E") center / 14px no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m18 15-6-6-6 6'/%3E%3C/svg%3E") center / 14px no-repeat;
}
html .mud-table-sort-label:hover .mud-table-sort-label-icon:not(.mud-direction-asc):not(.mud-direction-desc) { opacity: 0.5; }
html .mud-table-sort-label:has(.mud-direction-asc, .mud-direction-desc) { color: var(--blue-4) !important; }
html .mud-table-sort-label .mud-table-sort-label-icon:is(.mud-direction-asc, .mud-direction-desc) { background-color: var(--blue-4); }

/* ==========================================================================
   FIGMA DIALOG (Myth tidy-up, 6 Nov 2026) — Figma "Dialog" 15:4834. Surface/border/shadow come from the
   overlay tokens above. Header: 20px 20px 16px 24px, no rule under it; TsDialogHeader puts the icon in a
   40px tinted circle, 18px Medium Mono/0 title, 13px Mono/5 subtitle. Body: 8px 24px 24px, 14px Mono/3.
   Footer: Mono/8 rule above, 16px 24px 20px, actions on the right.
   ========================================================================== */
html .mud-dialog.mud-dialog { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
html .mud-dialog .mud-dialog-title {
    border-bottom: none !important;
    padding: 20px 20px 16px 24px !important;
    font-weight: var(--font-weight-medium, 500) !important;
}
html .mud-dialog .mud-dialog-content { padding: 8px 24px 24px !important; }
html .mud-dialog .mud-dialog-actions {
    padding: 16px 24px 20px !important;
    border-top: 1px solid var(--mono-8) !important;
    justify-content: flex-end;
}
html .mud-dialog .dialog-subtitle,
html .mud-dialog .mud-dialog-title .dialog-subtitle { color: var(--mono-5) !important; font-size: 13px !important; line-height: 18px !important; }

.ts-dialog-header { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.ts-dialog-heading { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-top: 1px; }
html .mud-dialog .ts-dialog-header .ts-dialog-title { color: var(--mono-0) !important; font-size: 18px !important; font-weight: var(--font-weight-medium, 500) !important; line-height: 24px !important; }
.ts-dialog-icon { flex: none; width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.ts-dialog-icon .mud-icon-root { width: 22px; height: 22px; font-size: 22px; color: inherit !important; }
.ts-dialog-icon-blue { background: var(--blue-10); color: var(--blue-3); }
.ts-dialog-icon-red { background: var(--rag-red-9); color: var(--rag-red-4); }
.ts-dialog-icon-orange { background: var(--rag-orange-8); color: var(--rag-orange-2); }
.ts-dialog-icon-green { background: var(--rag-green-9); color: var(--rag-green-3); }
/* Message boxes (ShowMessageBox, 247 calls) — MudBlazor draws both actions as text buttons. Figma's
   confirm footer is a Secondary Cancel then a filled primary action on the right. Red (destructive)
   confirms need the call to say so, so all confirm buttons are Primary blue here. */
html .mud-message-box .mud-dialog-actions .mud-button-root.mud-button {
    min-height: 40px;
    padding: 8px 14px !important;
    border-radius: 20px !important;
    border: 1px solid var(--btn-secondary-border) !important;
    background: var(--btn-secondary-bg) !important;
    color: var(--btn-secondary-text) !important;
}
html .mud-message-box .mud-dialog-actions .mud-button-root.mud-button:last-child {
    border-color: var(--btn-primary-bg) !important;
    background: var(--btn-primary-bg) !important;
    color: var(--mono-0) !important;
}
html .mud-message-box .mud-dialog-actions .mud-button-root.mud-button:last-child:hover { background: var(--btn-primary-bg-hover) !important; border-color: var(--btn-primary-bg-hover) !important; }
html .mud-message-box .mud-dialog-actions .mud-button-root.mud-button:not(:last-child):hover { background: var(--btn-secondary-bg-hover) !important; border-color: var(--btn-secondary-border-hover) !important; }
html .mud-message-box .mud-dialog-content .mud-typography { color: var(--mono-3) !important; font-size: 14px; line-height: 22px; }
/* MudBlazor wraps message-box buttons in a focus-trap container, so the 12px actions gap didn't reach
   them and Cancel/confirm touched (David, 6 Nov 2026). The wrapper lays its buttons out the same way. */
html .mud-dialog .mud-dialog-actions .mud-focus-trap-child-container { display: flex; align-items: center; gap: 12px; }

/* ==========================================================================
   FIGMA DATE PICKER (Myth tidy-up, 6 Nov 2026) — Figma "Date field" 15:3922 (110 MudDatePickers).
   Calendar panel Mono/9, Mono/8 border, 16px radius, 16px padding, deep shadow; no coloured header band
   (date pickers only — the time picker keeps its toolbar, it shows the time being picked). Month header:
   32px round raised arrows, 14px Medium Mono/0 title. Weekdays 12px Medium Mono/5 (Monday first, from the
   app culture). Days 40×36 pills, 14px Mono/2; today = 1.5px Blue/5 outline; selected = Blue/6 fill,
   white Medium; hover = raised. Field calendar icon is Mono/4.
   ========================================================================== */
html .mud-picker-paper.mud-picker-paper {
    background: var(--mono-9) !important;
    border: 1px solid var(--mono-8) !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    overflow: hidden;
}
html .mud-picker-paper .mud-picker-container { background: transparent !important; border: none !important; box-shadow: none !important; border-radius: 0 !important; }
html .mud-picker-paper .mud-picker-datepicker-toolbar { display: none !important; }
html .mud-picker-paper .mud-picker-calendar-container { padding: 16px; }
html .mud-picker-paper .mud-picker-calendar-header-switch { display: flex; align-items: center; gap: 8px; padding: 0 0 12px; }
html .mud-picker-paper .mud-picker-calendar-header-switch .mud-icon-button {
    width: 32px; height: 32px; min-width: 32px; padding: 0 !important;
    border-radius: 50% !important;
    background: var(--surface-raised) !important;
    color: var(--mono-0) !important;
}
html .mud-picker-paper .mud-picker-calendar-header-switch .mud-icon-button:hover { background: var(--mono-8) !important; }
html .mud-picker-paper .mud-picker-calendar-header-switch .mud-icon-root { width: 16px; height: 16px; font-size: 16px; color: inherit !important; }
html .mud-picker-paper .mud-button-month { flex: 1; border-radius: 12px; }
html .mud-picker-paper .mud-button-month .mud-typography { color: var(--mono-0) !important; font-size: 14px !important; font-weight: var(--font-weight-medium, 500) !important; }
html .mud-picker-paper .mud-picker-calendar-header-day .mud-day-label {
    width: calc(100% / 7 - 2px); margin: 0 1px; /* seven per row: MudBlazor wraps the days in one flex row */
    color: var(--mono-5) !important;
    font-size: 12px !important;
    font-weight: var(--font-weight-medium, 500) !important;
}
html .mud-picker-paper .mud-picker-calendar-day.mud-picker-calendar-day {
    width: calc(100% / 7 - 2px); height: 36px; margin: 1px;
    padding: 0 !important;
    border-radius: 18px !important;
    border: 1.5px solid transparent !important;
    background: transparent !important;
    color: var(--mono-2) !important;
}
html .mud-picker-paper .mud-picker-calendar-day .mud-typography { font-size: 14px !important; color: inherit !important; }
html .mud-picker-paper .mud-picker-calendar-day.mud-picker-calendar-day:hover:not(.mud-selected):not(:disabled) { background: var(--surface-raised) !important; color: var(--mono-0) !important; }
html .mud-picker-paper .mud-picker-calendar-day.mud-picker-calendar-day.mud-current:not(.mud-selected) { border-color: var(--blue-5) !important; background: transparent !important; }
html .mud-picker-paper .mud-picker-calendar-day.mud-picker-calendar-day.mud-selected { background: var(--blue-6) !important; color: var(--mono-0) !important; }
html .mud-picker-paper .mud-picker-calendar-day.mud-selected .mud-typography { font-weight: var(--font-weight-medium, 500) !important; }
html .mud-picker-paper .mud-picker-calendar-day.mud-picker-calendar-day:disabled { color: var(--mono-6) !important; }
html .mud-picker-paper .mud-picker-year.mud-current,
html .mud-picker-paper .mud-picker-month.mud-current { background: var(--blue-6) !important; color: var(--mono-0) !important; border-radius: 18px !important; }
html .mud-picker .mud-input-adornment .mud-icon-root { color: var(--mono-4) !important; }
html .mud-picker-paper .mud-picker-actions .mud-button-text { color: var(--blue-4) !important; }

/* ==========================================================================
   FIGMA FILTERS (Myth tidy-up, 6 Nov 2026) — Figma "Filters" 15:4247 (FilterChipBar, 86 list pages).
   Active filter chip: Mono/10 pill, Mono/8 border, 32px, 12px text — label Mono/3, value Mono/0 Medium —
   close icon Mono/4. "Add filter" carries a Blue/6 count once filters are on.
   ========================================================================== */
html .mud-chip.mud-chip.mud-chip.filter-chip-item {
    background: var(--mono-10) !important;
    border: 1px solid var(--mono-8) !important;
    color: var(--mono-0) !important;
    height: 32px !important;
    min-height: 32px !important;
    padding: 0 8px 0 12px !important;
    font-size: 12px !important;
    font-weight: var(--font-weight-regular, 400) !important;
}
html .filter-chip-item .fc-label { color: var(--mono-3); }
html .filter-chip-item .fc-value { color: var(--mono-0); font-weight: var(--font-weight-medium, 500); }
html .mud-chip.filter-chip-item .mud-chip-close-button { color: var(--mono-4) !important; margin-left: 2px; }
html .mud-chip.filter-chip-item .mud-chip-close-button:hover { color: var(--mono-0) !important; }
html .add-filter-btn .filter-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px; padding: 0 6px; margin-left: 8px;
    border-radius: 10px;
    background: var(--blue-6); color: var(--mono-0);
    font-size: 12px; font-weight: var(--font-weight-medium, 500); line-height: 20px;
}

/* ==========================================================================================
   FIGMA SEGMENTED CONTROL (Myth tidy-up, 6 Nov 2026) — Figma "Tabs / Segment" 15:4198:
   one joined Mono/9 box, Mono/8 border and dividers, 16px corners; 14px Medium Mono/3 labels;
   the chosen segment is Blue/10 with Blue/3 text. Applies to every MudToggleGroup, and to a
   MudButtonGroup used as a switch when it carries class "ts-segmented" (chosen = filled or .active).
   ========================================================================================== */
html .mud-toggle-group.mud-toggle-group,
html .ts-segmented.ts-segmented {
    display: inline-flex !important;
    align-items: stretch;
    max-width: 100%;
    overflow: hidden;
    gap: 0 !important;
    padding: 0 !important;
    background: var(--mono-9) !important;
    border: 1px solid var(--mono-8) !important;
    border-radius: 16px !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}
html .mud-toggle-group.mud-toggle-group > .mud-toggle-item,
html .ts-segmented.ts-segmented .mud-button-root.mud-button-root {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 10px 16px !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: var(--mono-3) !important;
    font-size: 14px !important;
    font-weight: var(--font-weight-medium, 500) !important;
    line-height: 24px !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}
html .mud-toggle-group.mud-toggle-group > .mud-toggle-item + .mud-toggle-item,
html .ts-segmented.ts-segmented .mud-button-root + .mud-button-root {
    border-left: 1px solid var(--mono-8) !important;
}
html .mud-toggle-group.mud-toggle-group > .mud-toggle-item:hover,
html .ts-segmented.ts-segmented .mud-button-root:hover {
    background: var(--mono-8) !important;
    color: var(--mono-0) !important;
}
html .mud-toggle-group.mud-toggle-group > .mud-toggle-item.mud-toggle-item-selected,
html .ts-segmented.ts-segmented .mud-button-root.mud-button-filled,
html .ts-segmented.ts-segmented .mud-button-root.active {
    background: var(--blue-10) !important;
    color: var(--blue-3) !important;
}
html .mud-toggle-group.mud-toggle-group > .mud-toggle-item .mud-button-label,
html .ts-segmented.ts-segmented .mud-button-root .mud-button-label {
    min-height: 0;
    gap: 6px;
    white-space: nowrap;
}
html .mud-toggle-group.mud-toggle-group > .mud-toggle-item .mud-icon-root,
html .ts-segmented.ts-segmented .mud-button-root .mud-icon-root {
    font-size: 18px !important;
    color: inherit !important;
}
/* Small toggle groups (Size.Small) keep the look at 36px high, for toolbars and table headers. */
html .mud-toggle-group.mud-toggle-group > .mud-toggle-item.mud-toggle-item-size-small {
    padding: 6px 14px !important;
    font-size: 13px !important;
}

/* ==========================================================================================
   FIGMA SEGMENTED CHIP (Myth tidy-up, 6 Nov 2026) — Figma "Segmented chip" 15:4109: a row of
   separate pills, one chosen. Chosen = Blue/6 with white text; others = Mono/8 outline, Mono/3 text;
   13px Medium, 20px corners. Used by ReportingPeriodSelector's chip layout (Finance dashboard).
   ========================================================================================== */
html .mud-chip.mud-chip.mud-chip.reporting-period-chip {
    height: auto !important;
    min-height: 32px;
    margin: 0 !important;
    padding: 6px 12px !important;
    border-radius: 20px !important;
    background: transparent !important;
    border: 1px solid var(--mono-8) !important;
    color: var(--mono-3) !important;
    font-size: 13px !important;
    font-weight: var(--font-weight-medium, 500) !important;
    box-shadow: none !important;
}
html .mud-chip.mud-chip.mud-chip.reporting-period-chip:hover {
    background: var(--mono-9) !important;
    color: var(--mono-0) !important;
}
html .mud-chip.mud-chip.mud-chip.reporting-period-chip.mud-chip-color-primary {
    background: var(--blue-6) !important;
    border-color: var(--blue-6) !important;
    color: var(--pure-white) !important;
}
html .mud-chip.mud-chip.mud-chip.reporting-period-chip .chip-range {
    color: var(--mono-4) !important;
}
html .mud-chip.mud-chip.mud-chip.reporting-period-chip.mud-chip-color-primary .chip-range {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* ==========================================================================
   AVATAR + AVATAR GROUP — Figma "Avatar" 247:4320 / "Avatar group" 247:4339 (11 Nov 2026)
   <UserAvatar Name Size> and <AvatarGroup Names Max Size> (Components/Shared).
   ========================================================================== */
.ts-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-sizing: border-box;
    border-radius: 50%;
    background: var(--blue-9);
    color: var(--blue-3);
    font-weight: var(--font-weight-medium);
    letter-spacing: 0.02em;
    line-height: 1;
    user-select: none;
}

.ts-avatar.ts-avatar-icon {
    background: var(--mono-9);
    border: 1px solid var(--border-card);
    color: var(--mono-4);
}

.ts-avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.ts-avatar-md { width: 32px; height: 32px; font-size: 12px; }
.ts-avatar-lg { width: 40px; height: 40px; font-size: 15px; }
.ts-avatar-xl { width: 48px; height: 48px; font-size: 17px; }

.ts-avatar-sm .mud-icon-root { width: 12px; height: 12px; font-size: 12px; }
.ts-avatar-md .mud-icon-root { width: 16px; height: 16px; font-size: 16px; }
.ts-avatar-lg .mud-icon-root { width: 20px; height: 20px; font-size: 20px; }
.ts-avatar-xl .mud-icon-root { width: 24px; height: 24px; font-size: 24px; }

.ts-avatar-group {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

/* Each avatar after the first tucks under the previous by a quarter of its width (Figma: 32px, 24px step). `~` not `+`: Blazor may place other nodes between them. */
.ts-avatar-group > .ts-avatar { box-shadow: 0 0 0 2px var(--mono-8); }
.ts-avatar-group-sm > .ts-avatar ~ .ts-avatar { margin-left: -6px; }
.ts-avatar-group-md > .ts-avatar ~ .ts-avatar { margin-left: -8px; }
.ts-avatar-group-lg > .ts-avatar ~ .ts-avatar { margin-left: -10px; }
.ts-avatar-group-xl > .ts-avatar ~ .ts-avatar { margin-left: -12px; }

/* "+N" — Mono/9 circle, Mono/2 count. */
.ts-avatar.ts-avatar-more {
    background: var(--mono-9);
    color: var(--mono-2);
}

/* Jobs list Engineer column: crew avatars beside the lead's name. */
.description-cell.job-crew-cell { display: flex; flex-direction: row; align-items: center; gap: 8px; }

/* ==========================================================================
   PAGE HEADER — Figma "Jobs" page 85:4244 (11 Nov 2026, David)
   Title 28px Regular white on a 44px line, level with the action buttons on the right (8px apart);
   the subtitle 14px Mono/2, 8px under the title; no rule under the header; 16px down to what follows.
   Covers .page-hero / .page-title / .page-subtitle (~165 pages) and the older .premium-h1 / -subtitle.
   ========================================================================== */
.page-hero,
.layout-header,
.list-page .page-hero {
    align-items: flex-start;
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 16px;
}

.list-page .page-hero-left { gap: 0; }

.page-title,
.premium-h1 {
    font-size: 1.75rem;
    line-height: 44px;
    font-weight: var(--font-weight-medium);   /* David: Regular read too thin against Figma */
    letter-spacing: normal;
    color: var(--mono-0);
}

.page-subtitle,
.premium-subtitle {
    font-size: var(--font-size-sm);
    line-height: 19px;
    color: var(--mono-2);
    margin: 8px 0 0;
}

.page-hero-actions,
.list-page .page-hero-actions {
    gap: 8px;
    min-height: 44px;
}

/* ==========================================================================
   PAGE GUTTERS — Figma "Jobs" page 85:4244 (11 Nov 2026, David: "too much of a gap around the outside")
   Page content starts 12px under the top bar and 16px from each side; on list pages the header, summary
   strip, filter bar and table card all share that one 16px edge (they each added another 24px before),
   with 16px between them.
   ========================================================================== */
.content-scroll-area {
    padding: 12px 16px 16px;
}

.list-page .page-hero {
    padding: 0;
    margin-bottom: 16px;
}

.list-page .summary-bar {
    padding: 0;
    margin-bottom: 16px;
}

.list-page .filter-bar {
    padding-left: 0;
    padding-right: 0;
}

.list-page .glass-table-card {
    margin: 0 0 16px;
}

/* ==========================================================================
   BULK ACTION BAR — Figma "Bulk action bar" 15:5196 (11 Nov 2026)
   The "N selected" bar: Blue/10 fill, Blue/9 border, 16px radius, 64px tall; the count in 14px Blue/3 on
   the left, the actions on the right (secondary buttons; a destructive action last, in red). It sits below
   the table and sticks to the bottom of the screen while the list scrolls. One look for
   the shared WorkBulkBar and every page's own bar. `html` prefix so it beats each page's local rule.
   Bills & receipts shows its bar all the time, so it only turns blue while something is ticked.
   ========================================================================== */
html .work-bulk-bar,
html .bulk-bar,
html .stuck-bulk-bar,
html .err-bulk-bar,
html .fb-bulk-bar,
html .bulk-actions-bar.has-selection {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    min-height: 64px;
    box-sizing: border-box;
    padding: 11px 16px;
    margin: 8px 0;
    background: var(--blue-10);
    border: 1px solid var(--blue-9);
    border-radius: 16px;
    color: var(--blue-3);
    font-size: var(--font-size-sm);
    /* Below the table (David, 11 Nov 2026), stuck to the bottom of the screen while a long list scrolls,
       so the actions stay in reach; it settles under the last row at the end. */
    position: sticky;
    bottom: 16px;
    z-index: 5;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

html .bulk-actions-bar {
    margin-left: 0;
    margin-right: 0;
    border-radius: 16px;
    background: var(--surface-card);
    border: 1px solid var(--border-card);
}

html .work-bulk-count,
html .bulk-count,
html .stuck-bulk-count,
html .bulk-actions-bar.has-selection .bulk-actions-info {
    color: var(--blue-3);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-normal);
}

/* Actions sit on the right. */
html .work-bulk-actions { margin-left: auto; }
html .work-bulk-clear { margin-left: 0; }

/* ==========================================================================
   TABLE CORNERS IN CARDS (11 Nov 2026, David: table top corners poked past the card's rounded corners)
   The list card is overflow: visible (so sticky bars and headers work), which let MudBlazor's square
   table box show at the corners. The table now takes the card's radius (1px less, inside the border)
   and clips to it. Menus in rows open in MudBlazor's popover layer, so nothing is cut off.
   ========================================================================== */
.glass-table-card .mud-table,
.premium-table-card .mud-table,
.glass-table-card .mud-table > .mud-table-container,
.premium-table-card .mud-table > .mud-table-container {
    border-radius: calc(var(--radius-card) - 1px);
}

.glass-table-card .mud-table,
.premium-table-card .mud-table {
    overflow: hidden;
}

/* Table inset (11 Nov 2026, David: tick boxes sat flush against the card edge). Figma sets the table 16px
   inside its card with 12px cell padding, so the first and last columns start 28px from the card edge.
   Our tables run edge to edge in the card, so the outer cells carry the extra 16px — header and rows alike. */
.cinematic-table th:first-child,
.cinematic-table td:first-child {
    padding-left: 28px !important;
}

.cinematic-table th:last-child,
.cinematic-table td:last-child {
    padding-right: 28px !important;
}

/* ==========================================================================
   EXPANDED TABLE ROW — Figma "Expanded detail" 15:5161 (11 Nov 2026)
   A row that opens shows a Mono/10 detail panel beneath it (class ts-row-detail on the child <tr>): fields as
   a 12px Mono/5 label over a 14px white value (.ts-detail-field), laid out across the row. The row's toggle is a
   16px Mono/4 chevron (.ts-row-toggle), down when closed, up when open. Hover does not change the panel.
   ========================================================================== */
html .cinematic-table tr.ts-row-detail > td,
html .cinematic-table tr.ts-row-detail:hover > td {
    background: var(--mono-10) !important;
    padding: 16px 28px !important;
    border-bottom: 1px solid var(--border-card) !important;
}

.ts-detail-fields { display: flex; flex-wrap: wrap; gap: 16px 40px; }
.ts-detail-field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ts-detail-label { font-size: var(--font-size-xs); line-height: 16px; color: var(--mono-5); }
.ts-detail-value { font-size: var(--font-size-sm); line-height: 19px; color: var(--mono-0); }

.ts-row-toggle.mud-icon-root { width: 16px; height: 16px; font-size: 16px; color: var(--mono-4); flex-shrink: 0; }

/* Selected row (Figma Table note: "selected row = Primary blue/10 tint"). MudBlazor marks no class on a ticked
   row, so any body row whose own tick box is checked takes the tint. */
.cinematic-table tbody tr:has(> td .mud-checkbox input:checked) > td,
.cinematic-table tbody tr:has(> td .mud-checkbox input:checked):hover > td {
    background: var(--blue-10) !important;
}

/* ==========================================================================
   HEADER ACTIONS — Figma "Header actions example" 15:4205 (11 Nov 2026)
   The page header's buttons are all 44px (Size Large). Icon actions (Help, ⋯) are 44px round Secondary
   buttons; plain text buttons (Refresh…) take the Secondary look — Figma's header has no bare text buttons.
   Primary / Positive / Destructive fills are unchanged.
   ========================================================================== */
.page-hero-actions .mud-button-root.mud-button {
    min-height: 44px;
    padding: 10px 14px;
}

.page-hero-actions .mud-button-root.mud-button-text {
    background: var(--btn-secondary-bg);
    border: 1px solid var(--btn-secondary-border);
    color: var(--btn-secondary-text);
}
.page-hero-actions .mud-button-root.mud-button-text:hover {
    background: var(--btn-secondary-bg-hover);
    border-color: var(--btn-secondary-border-hover);
}

/* `html … button.` matches the global icon-button rule's weight; this block comes later, so it wins. */
html .page-hero-actions button.mud-icon-button {
    width: 44px;
    height: 44px;
    min-width: 44px;
    background-color: var(--btn-secondary-bg);
    border: 1px solid var(--btn-secondary-border);
    color: var(--mono-4) !important;
}
html .page-hero-actions button.mud-icon-button:not(:disabled):hover {
    background-color: var(--btn-secondary-bg-hover) !important;
    border-color: var(--btn-secondary-border-hover);
    color: var(--mono-0) !important;
}
html .page-hero-actions button.mud-icon-button .mud-icon-root { width: 18px; height: 18px; font-size: 18px; }

/* ==========================================================================
   ROW ACTIONS — Figma "Row actions example" 15:4212 (11 Nov 2026)
   Buttons in a table row are Small (32px): a grey text button is a small Secondary ("Edit"), a blue one stays a
   Ghost link ("Open"), a red one is a small Destructive fill ("Delete"); a red icon button sits in a Red/9 circle.
   ========================================================================== */
.cinematic-table td .mud-button-root.mud-button-text.mud-button-text-default {
    background: var(--btn-secondary-bg);
    border: 1px solid var(--btn-secondary-border);
    color: var(--btn-secondary-text);
}
.cinematic-table td .mud-button-root.mud-button-text.mud-button-text-default:hover {
    background: var(--btn-secondary-bg-hover);
    border-color: var(--btn-secondary-border-hover);
}

.cinematic-table td .mud-button-root.mud-button-text.mud-button-text-error {
    background: var(--btn-destructive-bg);
    color: var(--pure-white);
}
.cinematic-table td .mud-button-root.mud-button-text.mud-button-text-error:hover {
    background: var(--btn-destructive-bg-hover);
}

.cinematic-table td .mud-icon-button.mud-error-text {
    background: var(--rag-red-9);
    color: var(--rag-red-4);
}
.cinematic-table td .mud-icon-button.mud-error-text:hover {
    background: color-mix(in srgb, var(--rag-red-9) 70%, var(--rag-red-6));
}

/* ==========================================================================
   ASSIGNEE ROW — Figma "Assignee row example" 247:4345 (11 Nov 2026) — <AssigneeRow>
   40px avatar · name 14px white over an optional 13px Mono/5 line · pill on the right
   (Lead = Blue/10 with a star and Blue/3 label; others = Mono/8 pill, Mono/2 label).
   ========================================================================== */
.ts-assignee-row { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px 0; }
.ts-assignee-row + .ts-assignee-row { border-top: 1px solid var(--border-card); }
.ts-assignee-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.ts-assignee-name { color: var(--mono-0); font-size: var(--font-size-sm); line-height: 19px; font-weight: var(--font-weight-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-assignee-sub { color: var(--mono-5); font-size: 13px; line-height: 18px; }
.ts-assignee-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ts-assignee-pill {
    display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
    height: 28px; padding: 0 12px; border-radius: 100px;
    background: var(--mono-8); color: var(--mono-2);
    font-size: 13px; font-weight: var(--font-weight-medium);
}
.ts-assignee-pill .mud-icon-root { width: 14px; height: 14px; font-size: 14px; }
.ts-assignee-pill.ts-assignee-pill-lead { background: var(--blue-10); color: var(--blue-3); }
.ts-assignee-pill.ts-assignee-pill-blue { background: var(--blue-10); color: var(--blue-3); }
.ts-assignee-pill.ts-assignee-pill-green { background: var(--rag-green-9); color: var(--rag-green-3); }
.ts-assignee-pill.ts-assignee-pill-orange { background: var(--rag-orange-8); color: var(--rag-orange-2); }

/* ==========================================================================
   TYPE PILL — Figma "Type pill" (Table card 15:5088, 11 Nov 2026)
   Work-type pills (EICR, PAT, PPM…) are one Blue/10 pill with a Blue/3 label; Reactive is the red pill
   (Red/9, Red/3), as in the Figma Jobs table. 28px, 12px Medium, no border. Was ten off-palette tints.
   ========================================================================== */
html .type-chip.type-chip {
    height: 28px;
    padding: 0 12px;
    border: none !important;
    border-radius: 100px !important;
    background: var(--blue-10) !important;
    color: var(--blue-3) !important;
    font-size: var(--font-size-xs) !important;
    font-weight: var(--font-weight-medium);
}
html .type-chip.type-chip.reactive {
    background: var(--rag-red-9) !important;
    color: var(--rag-red-3) !important;
}

/* ==========================================================================
   NUMERIC FIELD — Figma "Numeric field" 15:3819 (11 Nov 2026)
   Value right-aligned; a £ prefix or hrs / % suffix sits inside the field in Mono/4; no spin arrows
   (the keyboard arrows still step the value).
   ========================================================================== */
.mud-input:has(.mud-input-numeric-spin) input.mud-input-root { text-align: right; }
.mud-input-numeric-spin { display: none !important; }
.mud-input-adornment .mud-typography { color: var(--mono-4) !important; }   /* text prefix / suffix (£, hrs, %) */

/* ==========================================================================
   TEXT LINK — Figma "Text link" 15:4177 (11 Nov 2026)
   Inline links are Primary blue/4, underlined on hover (optional trailing ↗ icon). Buttons, chips and
   icon buttons that render as <a> keep their own look.
   ========================================================================== */
a:not(.mud-button-root):not(.mud-icon-button):not(.mud-chip):not(.mud-nav-link) { color: var(--blue-4); }
a:not(.mud-button-root):not(.mud-icon-button):not(.mud-chip):not(.mud-nav-link):hover {
    color: var(--blue-4);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ==========================================================================
   JOB STAGE DONUT — Figma "Operations dashboard" 85:4513, "Jobs by stage" (12 Nov 2026) — <JobStageDonut>
   196px ring, 16px rounded segments with small gaps, the total in the middle (36px Light + "jobs" 18px Mono/2),
   a centred dot legend with every stage's count (13px Mono/2). Segments and legend items open those jobs.
   ========================================================================== */
.ts-stage-donut { display: flex; flex-direction: column; align-items: center; gap: 32px; padding: 16px 0 8px; flex: 1 1 auto; min-height: 0; }
/* 12 Nov 2026 (David: "quite small, a lot of space below"): the ring fills the card's spare height — centred,
   up to 260px — and the legend sits at the bottom, as in Figma. */
.ts-stage-ring { position: relative; width: 100%; max-width: 260px; aspect-ratio: 1; margin: auto 0; }
.ts-stage-ring svg { display: block; width: 100%; height: 100%; }

/* The donut's card stretches with its row (Operations sits it beside Team capacity). */
.ts-sectionpanel:has(.ts-stage-donut) { display: flex; flex-direction: column; }
.ts-sectionpanel:has(.ts-stage-donut) > .tsp-content { flex: 1 1 auto; display: flex; flex-direction: column; }
.chart-card:has(.ts-stage-donut) { display: flex; flex-direction: column; }
.chart-body:has(.ts-stage-donut) { display: flex; flex-direction: column; flex: 1 1 auto; }
.ts-stage-seg { cursor: pointer; transition: stroke-width 0.15s ease; }
.ts-stage-seg:hover { stroke-width: 20; }
.ts-stage-total { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.ts-stage-total-num { font-size: 2.75rem; line-height: 52px; font-weight: 300; color: var(--mono-0); }
.ts-stage-total-label { font-size: 18px; line-height: 24px; color: var(--mono-2); }
.ts-stage-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; max-width: 340px; }
a.ts-stage-legend-item,
a.ts-stage-legend-item:hover { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mono-2); text-decoration: none; }
a.ts-stage-legend-item:hover { color: var(--mono-0); }
.ts-stage-dot { width: 8px; height: 8px; flex-shrink: 0; }

/* Card / tile links (Operations billing tiles, quote blocks, donut legend, engineer names…) are whole blocks,
   not inline text links — no underline on hover. Beats the TEXT LINK rule's weight. (David, 12 Nov 2026) */
html a.ops-bill-tile:hover, html a.ops-quotes-block:hover, html a.ops-quotes-expiring:hover,
html a.ts-stage-legend-item:hover, html a.ops-heat-person:hover,
html a.ops-bill-tile:hover *, html a.ops-quotes-block:hover *, html a.ops-heat-person:hover * {
    text-decoration: none !important;
}

/* ==========================================================================
   PAGE RHYTHM — Figma (12 Nov 2026, David): one spacing for every page.
   16px between the header, the summary strip and each block below (the page gap
   alone — no extra margins stacking on top of it, which gave ~40px); the summary
   strip has no side inset of its own, so it lines up with the header and cards.
   ========================================================================== */
.premium-workspace {
    gap: 16px;
}

.premium-workspace > .page-hero,
.premium-workspace > .layout-header,
.premium-workspace > .summary-bar,
.premium-workspace.list-page > .page-hero,
.premium-workspace.list-page > .summary-bar {
    margin-bottom: 0;
}

.summary-bar {
    padding-left: 0;
    padding-right: 0;
}

/* PAGE EDGE (12 Nov 2026, David: "it should match up with the header's left edge") — every open
   page-level block (header, detail body, hub body, toolbars, filters) starts at the page edge;
   cards keep their own inner padding but sit flush (no side margin). These beat the older
   page-scoped `.detail-container { padding: 24px }`, `.page-hero { padding: 24px 24px 0 }` etc. */
.premium-workspace > .page-hero,
.premium-workspace > .layout-header,
.premium-workspace > .hub-dashboard-body,
.premium-workspace > .list-toolbar,
.premium-workspace > .filter-bar {
    padding-left: 0;
    padding-right: 0;
}

.premium-workspace > .page-hero {
    padding-top: 0;
}

.premium-workspace > .detail-container {
    padding: 0;
}

.premium-workspace > .glass-table-card,
.premium-workspace > .section-card,
.premium-workspace > .mud-alert {
    margin-left: 0;
    margin-right: 0;
}

/* ==========================================================================
   ACTIVITY TILE — Figma "Job example" 85:2483 (12 Nov 2026) — <ActivityTile>
   ========================================================================== */
.ts-activity-tile {
    display: flex; flex-direction: column; justify-content: space-between; gap: 16px;
    min-width: 0; height: 196px; padding: 16px; box-sizing: border-box; text-align: left;
    background: var(--surface-card); border: 1px solid var(--border-card); border-radius: var(--radius-card);
    color: var(--mono-0); font: inherit; cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease;
}
.ts-activity-tile:hover { border-color: var(--glass-border-hover); }
.ts-activity-tile:focus-visible { outline: 2px solid var(--blue-5); outline-offset: 2px; }
.ts-activity-tile.selected { border-color: var(--blue-6); background: color-mix(in srgb, var(--blue-10) 40%, var(--surface-card)); }
/* A <button> centres its contents by default (and MudBlazor's button rules add to it): pin the layout to the
   left edge and full width so the ↗ sits at the far right and the text reads left-aligned, as in Figma. */
.ts-activity-tile { align-items: stretch; justify-content: space-between; text-align: left; }
.ts-activity-tile > .tat-head,
.ts-activity-tile > .tat-body { width: 100%; align-self: stretch; }
.ts-activity-tile .tat-head { display: flex; align-items: center; justify-content: space-between; }
.ts-activity-tile .tat-body { align-items: flex-start; }
.ts-activity-tile .tat-text { align-items: flex-start; width: 100%; }
.ts-activity-tile .tat-icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--mono-8); }
.ts-activity-tile .tat-icon .mud-icon-root,
.ts-activity-tile .tat-open .mud-icon-root { width: 18px; height: 18px; font-size: 18px; }
.ts-activity-tile .tat-open { display: inline-flex; padding: 8px; color: var(--mono-6); }
.ts-activity-tile:hover .tat-open { color: var(--mono-3); }
.ts-activity-tile .tone-amber { color: var(--accent-amber-3); }
.ts-activity-tile .tone-blue { color: var(--blue-3); }
.ts-activity-tile .tone-red { color: var(--rag-red-4); }
.ts-activity-tile .tone-green { color: var(--rag-green-2); }
.ts-activity-tile .tone-mint { color: var(--accent-mint-2); }
.ts-activity-tile .tone-pink { color: var(--accent-pink-2); }
.ts-activity-tile .tone-grey { color: var(--mono-2); }
.ts-activity-tile .tat-body { display: flex; flex-direction: column; justify-content: space-between; gap: 16px; min-width: 0; }
.ts-activity-tile .tat-value { font-size: 36px; line-height: 44px; font-weight: var(--font-weight-medium); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts-activity-tile .tat-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ts-activity-tile .tat-label { font-size: 16px; font-weight: var(--font-weight-bold); }
.ts-activity-tile .tat-sub { font-size: 12px; font-weight: var(--font-weight-medium); color: var(--mono-5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts-activity-tile.blocking { border: 0.5px solid var(--rag-red-4); }
.ts-activity-tile.blocking .tat-icon { background: var(--rag-red-9); color: var(--rag-red-4); }
.ts-activity-tile.blocking .tat-sub { color: var(--rag-red-4); }

/* ==========================================================================
   SIDE CARD — Figma "Job example" right column (Assignees 85:2751, Bookings 85:2783, Latest activity 85:2808),
   12 Nov 2026: 22px title + a Mono/4 count, an outlined 40px pill button or a blue link on the right.
   ========================================================================== */
.ts-side-card { display: flex; flex-direction: column; gap: 16px; }
.ts-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ts-card-title { display: flex; align-items: center; gap: 16px; margin: 0; font-size: 22px; line-height: 30px; font-weight: var(--font-weight-medium); color: var(--mono-0); }
.ts-card-count { font-size: 18px; color: var(--mono-4); }
.ts-card-pill-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; box-sizing: border-box; border: 1px solid var(--border-card); border-radius: 20px; background: var(--surface-card); font: inherit; font-size: 14px; font-weight: var(--font-weight-bold); color: var(--mono-0); cursor: pointer; white-space: nowrap; }
.ts-card-pill-btn:hover { border-color: var(--glass-border-hover); }
.ts-card-pill-btn .mud-icon-root { width: 16px; height: 16px; font-size: 16px; }
.ts-card-link { padding: 0; border: 0; background: none; font: inherit; font-size: 14px; line-height: 24px; font-weight: var(--font-weight-medium); color: var(--blue-4); cursor: pointer; }
.ts-card-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.ts-card-empty { margin: 0; font-size: 14px; color: var(--mono-4); }
.ts-card-hint { margin: 0; font-size: 14px; color: var(--mono-4); }
.ts-latest { display: flex; flex-direction: column; }
.ts-latest-row { display: flex; align-items: center; gap: 16px; padding: 12px 0; }
.ts-latest-row + .ts-latest-row { border-top: 1px solid var(--border-card); }
.ts-latest-icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; background: var(--mono-8); color: var(--mono-3); }
.ts-latest-icon .mud-icon-root { width: 18px; height: 18px; font-size: 18px; }
.ts-latest-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 14px; font-weight: var(--font-weight-medium); color: var(--mono-0); }
.ts-latest-text small { font-size: 14px; color: var(--mono-4); }
/* Bookings */
.ts-booking { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; box-sizing: border-box; border: 0; border-radius: 16px; background: var(--surface-raised); font: inherit; color: inherit; text-align: left; }
button.ts-booking { cursor: pointer; }
button.ts-booking:hover { background: color-mix(in srgb, var(--mono-8) 60%, var(--surface-raised)); }
.ts-booking-date { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 66px; padding: 12px 0; box-sizing: border-box; flex-shrink: 0; border: 1px solid var(--mono-7); border-radius: 20px; background: var(--surface-card); }
.ts-booking-date b { font-size: 14px; font-weight: var(--font-weight-bold); color: var(--mono-4); text-transform: uppercase; }
.ts-booking-date span { font-size: 28px; line-height: 30px; font-weight: var(--font-weight-medium); color: var(--mono-0); }
.ts-booking-date small { font-size: 14px; font-weight: var(--font-weight-bold); color: var(--mono-4); }
.ts-booking-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 14px; }
.ts-booking-text b { font-weight: var(--font-weight-bold); color: var(--mono-0); }
.ts-booking-text span { font-weight: var(--font-weight-medium); color: var(--mono-4); }
.ts-booking-list { display: flex; flex-direction: column; gap: 8px; }

/* UserAvatar Muted (12 Nov 2026): a leaver / no timesheet — grey instead of blue. */
.ts-avatar.ts-avatar-muted { background: var(--mono-8); color: var(--mono-4); }
