/* Nextwork Data — central theme color registry.
   Phase 1: canonical palette for the current Black / Graphite mode.
   Components can be migrated to these semantic tokens incrementally. */

:root {
    --nw-ui-scrim: rgba(0, 0, 0, .72);
    /* Brand / action */
    --nw-accent: #EF6C35;
    --nw-accent-hover: #F47A45;
    --nw-accent-strong: #D95822;
    --nw-accent-soft: #3A2B25;

    /* Application shell */
    --nw-bg-app: #16181B;
    --nw-bg-workspace: #181A1D;
    --nw-bg-sidebar: #202326;
    --nw-bg-topbar: rgba(24, 26, 29, .97);

    /* Surfaces */
    --nw-surface-1: #191B1E;
    --nw-surface-2: #202327;
    --nw-surface-3: #24272B;
    --nw-surface-4: #272B2F;
    --nw-surface-5: #292D31;
    --nw-surface-hover: #2D3136;

    /* Borders */
    --nw-border-subtle: #303439;
    --nw-border: #34383D;
    --nw-border-strong: #3A3F45;
    --nw-border-emphasis: #454B52;

    /* Text */
    --nw-text-primary: #EEF1F4;
    --nw-text-secondary: #C9CFD6;
    --nw-text-body: #D9DDE1;
    --nw-text-muted: #8B939D;
    --nw-text-dim: #676F79;
    --nw-text-disabled: #59616A;

    /* Inputs */
    --nw-input-bg: #191B1E;
    --nw-input-border: #3B4046;
    --nw-input-text: #E0E4E8;
    --nw-input-placeholder: #78828C;

    /* Tables */
    --nw-table-head-bg: #1B1E21;
    --nw-table-row-bg: #202327;
    --nw-table-row-hover: #24282C;
    --nw-table-border: #303439;

    /* Semantic states */
    --nw-success: #43C17A;
    --nw-success-bg: #18392A;
    --nw-success-text: #89D6AA;

    --nw-warning: #D8AE68;
    --nw-warning-bg: #30271F;
    --nw-warning-text: #D8A77D;

    --nw-danger: #DD6256;
    --nw-danger-bg: #3A211D;
    --nw-danger-text: #F0A395;

    --nw-info: #4D91D9;
    --nw-info-bg: #202F3D;
    --nw-info-text: #91BDE3;

    /* Typography scale (Phase 2 — for NEW and migrated UI only; nothing uses it yet).
       Rule: new code uses these tokens, never a raw px size. Body/data text is never
       smaller than --nw-font-sm (12px); --nw-font-xs (11px) is for badges/captions only. */
    --nw-font-family: "Segoe UI", Arial, sans-serif;
    --nw-font-xs: 11px;
    --nw-font-sm: 12px;
    --nw-font-md: 13px;
    --nw-font-lg: 14px;
    --nw-font-xl: 16px;
    --nw-font-title: 18px;
    --nw-font-heading: 22px;
    --nw-weight-regular: 400;
    --nw-weight-medium: 600;
    --nw-weight-strong: 700;

    /* Spacing scale (4px base) */
    --nw-space-0: 2px;
    --nw-space-1: 4px;
    --nw-space-2: 8px;
    --nw-space-3: 12px;
    --nw-space-4: 16px;
    --nw-space-5: 24px;
    --nw-space-6: 32px;

    /* Radius scale */
    --nw-control-height: 32px;
    --nw-radius-sm: 4px;
    --nw-radius-md: 6px;
    --nw-radius-lg: 8px;
    --nw-radius-xl: 12px;

    /* Application chrome (shell, sidebar, topbar, header controls, settings popover).
       Graphite values; White overrides below. Values equal what the layout used before. */
    --nw-chrome-app-bg: #16181B;
    --nw-chrome-text: #EEF1F4;
    --nw-chrome-sidebar-bg: #202326;
    --nw-chrome-sidebar-border: #34383D;
    --nw-chrome-workspace-bg: #181A1D;
    --nw-chrome-topbar-bg: rgba(24, 26, 29, .97);
    --nw-chrome-topbar-border: #34383D;
    --nw-chrome-topbar-shadow: none;
    --nw-chrome-eyebrow: #7F8791;
    --nw-chrome-control-bg: #24272B;
    --nw-chrome-control-text: #E7E9EC;
    --nw-chrome-control-border: #3A3F45;
    --nw-chrome-control-hover-bg: #2D3136;
    --nw-chrome-control-hover-border: #3A3F45;
    --nw-chrome-clock-text: #F1F3F5;
    --nw-chrome-clock-date: #C9CFD6;
    --nw-chrome-popover-bg: #202327;
    --nw-chrome-popover-text: #EEF1F4;
    --nw-chrome-popover-border: #3A3F45;
    --nw-chrome-popover-shadow: 0 16px 40px rgba(0,0,0,.35);
    --nw-chrome-label-muted: #8C949E;
    --nw-chrome-seg-bg: #191B1E;
    --nw-chrome-seg-text: #AEB5BD;
    --nw-chrome-seg-border: #3A3F45;

    /* Overlays / shadow */
    --nw-overlay: rgba(5, 7, 9, .78);
    --nw-shadow: rgba(0, 0, 0, .35);
    --nw-shadow-strong: rgba(0, 0, 0, .58);
}

/* Explicit alias for the current default dark theme. */
:root,
.app-shell.theme-graphite {
    --nw-theme-accent: var(--nw-accent);
    --nw-theme-bg-app: var(--nw-bg-app);
    --nw-theme-bg-workspace: var(--nw-bg-workspace);
    --nw-theme-bg-sidebar: var(--nw-bg-sidebar);
    --nw-theme-bg-topbar: var(--nw-bg-topbar);
    --nw-theme-surface: var(--nw-surface-2);
    --nw-theme-surface-raised: var(--nw-surface-3);
    --nw-theme-border: var(--nw-border);
    --nw-theme-border-strong: var(--nw-border-strong);
    --nw-theme-text-primary: var(--nw-text-primary);
    --nw-theme-text-secondary: var(--nw-text-secondary);
    --nw-theme-text-muted: var(--nw-text-muted);

    /* Customer card / working-surface tokens (header, tabs, buttons, pills, popovers).
       Graphite here; the White values are in .app-shell.theme-light below. */
    --nw-ui-info-bg: #1D3046;
    --nw-ui-info-text: #77B0EF;
    --nw-ui-info-border: #3A5A80;
    --nw-ui-purple-bg: #39284A;
    --nw-ui-purple-text: #C18AF0;
    --nw-ui-purple-border: #5E4478;
    --nw-ui-surface: #202327;
    --nw-ui-surface-inset: #191B1E;
    --nw-ui-control-bg: #272B2F;
    --nw-ui-border: #34383D;
    --nw-ui-border-subtle: #2E3237;
    --nw-ui-border-strong: #3B4046;
    --nw-ui-border-popover: #454B52;
    --nw-ui-input-border: #393E44;
    --nw-ui-text-strong: #EEF1F4;
    --nw-ui-text: #DCE1E6;
    --nw-ui-control-text: #BBC1C8;
    --nw-ui-text-muted: #8D96A1;
    --nw-ui-text-faint: #747D87;
    --nw-ui-tab-text: #9AA2AC;
    --nw-ui-input-text: #E2E5E8;
    --nw-ui-label: #8F98A2;
    --nw-ui-accent: #EF6C35;
    --nw-ui-accent-hover: #F47A45;
    --nw-ui-on-accent: #FFFFFF;
    --nw-ui-ok-bg: #18392A;
    --nw-ui-ok-text: #BFE6CE;
    --nw-ui-warn-bg: #3D2C13;
    --nw-ui-warn-text: #FFD7A0;
    --nw-ui-warn-hover: #543A17;
    --nw-ui-neutral-text: #BFC5CB;
    --nw-ui-chip-bg: #343941;
    --nw-ui-danger-bg: #3A2420;
    --nw-ui-danger-text: #FFB09A;
    --nw-ui-danger-border: #704238;
    --nw-ui-danger-hover-bg: #4A2A24;
    --nw-ui-danger-hover-border: #A55343;
    --nw-ui-danger-hover-text: #FFD0C4;
    --nw-ui-error-bg: #3B2020;
    --nw-ui-error-text: #FFD6D6;
    --nw-ui-error-border: #8F3B3B;
    --nw-ui-unread: #FF5A36;
    --nw-ui-unread-ring: rgba(255, 90, 54, .14);
    --nw-ui-shadow-popover: 0 16px 42px rgba(0, 0, 0, .45);
    --nw-ui-warn-accent: #E29A36;
    --nw-ui-warn-text-pale: #E8D8C2;
    --nw-ui-danger-text-pale: #FFC0B2;
    --nw-ui-accent-text: #FF9D7A;
    --nw-ui-border-faint: #2E3237;
    --nw-ui-border-hover: #4A5057;
    --nw-ui-ok-bg-deep: #1C3529;
    --nw-ui-ok-bg-strong: #24513C;
    --nw-ui-ok-border: #3F7D5F;
    --nw-ui-ok-text-mid: #79D29D;
    --nw-ui-ok-text-soft: #AEE4C5;
    --nw-ui-text-soft: #AAB1B8;
    --nw-ui-warn-bg-deep: #2A241B;
    --nw-ui-warn-bg-strong: #6A4B1F;
    --nw-ui-warn-border: #6B522D;
    --nw-ui-warn-text-soft: #F2C47D;
}


/* Fifth theme «Moon» (PO decision, 25 October 2026): dark, in the Nextwork logo colours (deep navy + sky blue).
   Generated from the Graphite values by a colour mapping (neutral greys -> navy, orange accent -> sky blue);
   semantic success/warning/danger colours are unchanged. Applied alone (no .theme-light). */
.app-shell.theme-moon {
    --nw-ui-scrim: rgba(0,0,0, .72);
    --nw-accent: #3DB4FF;
    --nw-accent-hover: #5CC2FF;
    --nw-accent-strong: #2A9DE8;
    --nw-accent-soft: #173B63;
    --nw-bg-app: #0D2137;
    --nw-bg-workspace: #0E233B;
    --nw-bg-sidebar: #122C4B;
    --nw-bg-topbar: rgba(14,35,59, .97);
    --nw-surface-1: #0E243D;
    --nw-surface-2: #122D4C;
    --nw-surface-3: #143254;
    --nw-surface-4: #15365A;
    --nw-surface-5: #16385E;
    --nw-surface-hover: #183D67;
    --nw-border-subtle: #19406D;
    --nw-border: #1B4574;
    --nw-border-strong: #1E4D82;
    --nw-border-emphasis: #245A99;
    --nw-text-primary: #EEF1F4;
    --nw-text-secondary: #C5CFDA;
    --nw-text-body: #D6DDE4;
    --nw-text-muted: #7492B4;
    --nw-text-dim: #4E6E92;
    --nw-text-disabled: #2E73C3;
    --nw-input-bg: #0E243D;
    --nw-input-border: #1F4E84;
    --nw-input-text: #DEE4EA;
    --nw-input-placeholder: #5C7FA8;
    --nw-table-head-bg: #0F2742;
    --nw-table-row-bg: #122D4C;
    --nw-table-row-hover: #143255;
    --nw-table-border: #19406D;
    --nw-success: #43C17A;
    --nw-success-bg: #18392A;
    --nw-success-text: #89D6AA;
    --nw-warning: #D8AE68;
    --nw-warning-bg: #143254;
    --nw-warning-text: #D8A77D;
    --nw-danger: #DD6256;
    --nw-danger-bg: #3A211D;
    --nw-danger-text: #F0A395;
    --nw-info: #4D91D9;
    --nw-info-bg: #202F3D;
    --nw-info-text: #91BDE3;
    --nw-chrome-app-bg: #0D2137;
    --nw-chrome-text: #EEF1F4;
    --nw-chrome-sidebar-bg: #122C4B;
    --nw-chrome-sidebar-border: #1B4574;
    --nw-chrome-workspace-bg: #0E233B;
    --nw-chrome-topbar-bg: rgba(14,35,59, .97);
    --nw-chrome-topbar-border: #1B4574;
    --nw-chrome-topbar-shadow: none;
    --nw-chrome-eyebrow: #6486AC;
    --nw-chrome-control-bg: #143254;
    --nw-chrome-control-text: #E5E9EE;
    --nw-chrome-control-border: #1E4D82;
    --nw-chrome-control-hover-bg: #183D67;
    --nw-chrome-control-hover-border: #1E4D82;
    --nw-chrome-clock-text: #F0F3F6;
    --nw-chrome-clock-date: #C5CFDA;
    --nw-chrome-popover-bg: #122D4C;
    --nw-chrome-popover-text: #EEF1F4;
    --nw-chrome-popover-border: #1E4D82;
    --nw-chrome-popover-shadow: 0 16px 40px rgba(0,0,0,.35);
    --nw-chrome-label-muted: #7593B5;
    --nw-chrome-seg-bg: #0E243D;
    --nw-chrome-seg-text: #A5B4C6;
    --nw-chrome-seg-border: #1E4D82;
    --nw-overlay: rgba(5,13,22, .78);
    --nw-shadow: rgba(0,0,0, .35);
    --nw-shadow-strong: rgba(0,0,0, .58);
    --nw-theme-accent: var(--nw-accent);
    --nw-theme-bg-app: var(--nw-bg-app);
    --nw-theme-bg-workspace: var(--nw-bg-workspace);
    --nw-theme-bg-sidebar: var(--nw-bg-sidebar);
    --nw-theme-bg-topbar: var(--nw-bg-topbar);
    --nw-theme-surface: var(--nw-surface-2);
    --nw-theme-surface-raised: var(--nw-surface-3);
    --nw-theme-border: var(--nw-border);
    --nw-theme-border-strong: var(--nw-border-strong);
    --nw-theme-text-primary: var(--nw-text-primary);
    --nw-theme-text-secondary: var(--nw-text-secondary);
    --nw-theme-text-muted: var(--nw-text-muted);
    --nw-ui-info-bg: #1D3046;
    --nw-ui-info-text: #77B0EF;
    --nw-ui-info-border: #3A5A80;
    --nw-ui-purple-bg: #39284A;
    --nw-ui-purple-text: #C18AF0;
    --nw-ui-purple-border: #5E4478;
    --nw-ui-surface: #122D4C;
    --nw-ui-surface-inset: #0E243D;
    --nw-ui-control-bg: #15365A;
    --nw-ui-border: #1B4574;
    --nw-ui-border-subtle: #193E69;
    --nw-ui-border-strong: #1F4E84;
    --nw-ui-border-popover: #245A99;
    --nw-ui-input-border: #1E4C80;
    --nw-ui-text-strong: #EEF1F4;
    --nw-ui-text: #DAE1E8;
    --nw-ui-control-text: #B4C1CF;
    --nw-ui-text-muted: #7895B6;
    --nw-ui-text-faint: #587BA3;
    --nw-ui-tab-text: #87A1BF;
    --nw-ui-input-text: #DFE5EB;
    --nw-ui-label: #7A96B7;
    --nw-ui-accent: #3DB4FF;
    --nw-ui-accent-hover: #5CC2FF;
    --nw-ui-on-accent: #06203F;
    --nw-ui-ok-bg: #18392A;
    --nw-ui-ok-text: #BFE6CE;
    --nw-ui-warn-bg: #3D2C13;
    --nw-ui-warn-text: #FFD7A0;
    --nw-ui-warn-hover: #543A17;
    --nw-ui-neutral-text: #B8C4D2;
    --nw-ui-chip-bg: #1C4778;
    --nw-ui-danger-bg: #3A2420;
    --nw-ui-danger-text: #66C4FF;
    --nw-ui-danger-border: #704238;
    --nw-ui-danger-hover-bg: #4A2A24;
    --nw-ui-danger-hover-border: #A55343;
    --nw-ui-danger-hover-text: #66C4FF;
    --nw-ui-error-bg: #3B2020;
    --nw-ui-error-text: #FFD6D6;
    --nw-ui-error-border: #8F3B3B;
    --nw-ui-unread: #FF5A36;
    --nw-ui-unread-ring: rgba(255,90,54, .14);
    --nw-ui-shadow-popover: 0 16px 42px rgba(0,0,0, .45);
    --nw-ui-warn-accent: #E29A36;
    --nw-ui-warn-text-pale: #E8D8C2;
    --nw-ui-danger-text-pale: #FFC0B2;
    --nw-ui-accent-text: #66C4FF;
    --nw-ui-border-faint: #193E69;
    --nw-ui-border-hover: #2660A2;
    --nw-ui-ok-bg-deep: #1C3529;
    --nw-ui-ok-bg-strong: #24513C;
    --nw-ui-ok-border: #3F7D5F;
    --nw-ui-ok-text-mid: #79D29D;
    --nw-ui-ok-text-soft: #AEE4C5;
    --nw-ui-text-soft: #9AAFC8;
    --nw-ui-warn-bg-deep: #112C4A;
    --nw-ui-warn-bg-strong: #6A4B1F;
    --nw-ui-warn-border: #6B522D;
    --nw-ui-warn-text-soft: #F2C47D;
}

/* Canonical White mode palette.
   Brand/action orange is intentionally replaced by Nextwork blue #2A77A6.
   Semantic success/warning/danger colors remain distinct. */
.app-shell.theme-light {
    --nw-ui-scrim: rgba(70, 60, 50, .34);
    --nw-theme-accent: #2A77A6;
    --nw-theme-accent-hover: #23658E;
    --nw-theme-accent-strong: #1E587C;
    --nw-theme-accent-soft: #E8F3F9;
    --nw-theme-accent-soft-strong: #D8EBF5;

    --nw-theme-bg-app: #F5F7FA;
    --nw-theme-bg-workspace: #F5F7FA;
    --nw-theme-bg-sidebar: #102033;
    --nw-theme-bg-topbar: #FFFFFF;

    --nw-theme-surface: #FFFFFF;
    --nw-theme-surface-soft: #F7F9FB;
    --nw-theme-surface-raised: #EEF2F5;
    --nw-theme-surface-hover: #E8EDF2;

    --nw-theme-border: #D8E0E8;
    --nw-theme-border-strong: #C7D1DC;

    --nw-theme-text-primary: #172033;
    --nw-theme-text-secondary: #475569;
    --nw-theme-text-muted: #6B7788;

    --nw-theme-sidebar-text: #FFFFFF;
    --nw-theme-sidebar-muted: #C3CFDC;
    --nw-theme-sidebar-icon: #D9E4EF;

    --nw-theme-neutral-chip-bg: #E9EEF3;
    --nw-theme-neutral-chip-border: #D3DCE5;
    --nw-theme-neutral-chip-text: #334155;

    /* White-mode contrast roles — shared by sidebar, modals, notes, status pills and toolbars. */
    --nw-theme-sidebar-nav-text: #FFFFFF;
    --nw-theme-sidebar-section-text: #DCE6F1;

    --nw-theme-modal-bg: #FFFFFF;
    --nw-theme-modal-head-bg: #F1F4F7;
    --nw-theme-modal-section-bg: #F8FAFC;
    --nw-theme-modal-field-bg: #FFFFFF;

    --nw-theme-note-bg: #F4F7FA;
    --nw-theme-note-border: #D7E0E8;
    --nw-theme-note-text: #223044;

    --nw-theme-warning-row-bg: #FFF7EA;
    --nw-theme-warning-row-border: #E6C892;
    --nw-theme-warning-row-text: #744A12;
    --nw-theme-warning-row-muted: #936C35;

    --nw-theme-success-pill-bg: #176B45;
    --nw-theme-success-pill-text: #FFFFFF;
    --nw-theme-warning-pill-bg: #8A5A14;
    --nw-theme-warning-pill-text: #FFFFFF;

    /* Application chrome — White (effective values of the former layout rules). */
    --nw-chrome-app-bg: #F5F7FA;
    --nw-chrome-text: #161B22;
    --nw-chrome-sidebar-bg: #102033;
    --nw-chrome-sidebar-border: #203247;
    --nw-chrome-workspace-bg: #F5F7FA;
    --nw-chrome-topbar-bg: rgba(255, 255, 255, .98);
    --nw-chrome-topbar-border: #E0E5EB;
    --nw-chrome-topbar-shadow: 0 1px 0 rgba(16, 24, 40, .02);
    --nw-chrome-eyebrow: #626B76;
    --nw-chrome-control-bg: #FFFFFF;
    --nw-chrome-control-text: #354052;
    --nw-chrome-control-border: #D2D8E0;
    --nw-chrome-control-hover-bg: #F5F7FA;
    --nw-chrome-control-hover-border: #C3CAD4;
    --nw-chrome-clock-text: #354052;
    --nw-chrome-clock-date: #354052;
    --nw-chrome-popover-bg: #FFFFFF;
    --nw-chrome-popover-text: #161B22;
    --nw-chrome-popover-border: #D2D8E0;
    --nw-chrome-popover-shadow: 0 16px 40px rgba(15, 23, 42, .12);
    --nw-chrome-label-muted: #5F6873;
    --nw-chrome-seg-bg: #FFFFFF;
    --nw-chrome-seg-text: #475467;
    --nw-chrome-seg-border: #D2D8E0;

    --nw-theme-count-chip-bg: #E9EEF3;
    --nw-theme-count-chip-text: #172033;

    --nw-theme-toolbar-bg: #F2F5F8;
    --nw-theme-toolbar-control-bg: #FFFFFF;
    --nw-theme-toolbar-text: #172033;

    /* Global grid / column-filter contrast. */
    --nw-theme-grid-head-bg: #F1F4F7;
    --nw-theme-grid-head-text: #405166;
    --nw-theme-grid-cell-bg: #FFFFFF;
    --nw-theme-grid-cell-text: #172033;
    --nw-theme-grid-border: #D8E0E8;
    --nw-theme-grid-filter-icon: #566578;
    --nw-theme-grid-filter-active: #2A77A6;
    --nw-theme-grid-filter-bg: #FFFFFF;
    --nw-theme-grid-filter-hover: #EDF3F7;

    /* Legacy operational surfaces that must become light in White mode. */
    --nw-theme-operational-panel-bg: #F7F9FB;
    --nw-theme-operational-panel-head-bg: #EEF2F5;
    --nw-theme-operational-panel-border: #D6DFE7;
    --nw-theme-operational-panel-text: #172033;
    --nw-theme-operational-panel-muted: #68778A;

    /* Floating customer note / notification card. */
    --nw-theme-notification-bg: #FFFFFF;
    --nw-theme-notification-head-bg: #F2F5F8;
    --nw-theme-notification-border: #D6DFE7;
    --nw-theme-notification-accent: #2A77A6;
    --nw-theme-notification-text: #223044;
    --nw-theme-notification-muted: #6C7A8C;

    /* Global White-mode controls. */
    --nw-control-bg: #FFFFFF;
    --nw-control-bg-hover: #F3F7FA;
    --nw-control-border: #C9D4DE;
    --nw-control-border-hover: #9DB7C9;
    --nw-control-text: #223044;
    --nw-control-muted: #69788A;
    --nw-control-disabled-bg: #F2F4F6;
    --nw-control-disabled-text: #9AA5B1;

    --nw-control-primary-bg: #2A77A6;
    --nw-control-primary-hover: #23658E;
    --nw-control-primary-text: #FFFFFF;

    --nw-control-danger-bg: #FFF1EF;
    --nw-control-danger-border: #E4B4AE;
    --nw-control-danger-text: #9C352E;

    --nw-control-success-bg: #EAF7F0;
    --nw-control-success-border: #A9D7BE;
    --nw-control-success-text: #176B45;

    --nw-status-neutral-bg: #EEF2F5;
    --nw-status-neutral-border: #D1DAE3;
    --nw-status-neutral-text: #344559;

    --nw-status-new-bg: #E8F3F9;
    --nw-status-new-text: #1F648D;
    --nw-status-processing-bg: #FFF4DE;
    --nw-status-processing-text: #875A12;
    --nw-status-finalized-bg: #EAF7F0;
    --nw-status-finalized-text: #176B45;
    --nw-status-cancelled-bg: #FFF1EF;
    --nw-status-cancelled-text: #9C352E;
    --nw-status-pending-bg: #FFF7EA;
    --nw-status-pending-text: #744A12;
    --nw-ui-info-bg: #EAF3FC;
    --nw-ui-info-text: #1E5FA8;
    --nw-ui-info-border: #B7D2EE;
    --nw-ui-purple-bg: #F3EAFB;
    --nw-ui-purple-text: #7A3FB0;
    --nw-ui-purple-border: #D8C2EE;
    --nw-ui-surface: #FFFFFF;
    --nw-ui-surface-inset: #FFFFFF;
    --nw-ui-control-bg: #FFFFFF;
    --nw-ui-border: #C8CED6;
    --nw-ui-border-subtle: #E0E5EB;
    --nw-ui-border-strong: #C9D4DE;
    --nw-ui-border-popover: #C8CED6;
    --nw-ui-input-border: #C9D4DE;
    --nw-ui-text-strong: #182230;
    --nw-ui-text: #223044;
    --nw-ui-control-text: #223044;
    --nw-ui-text-muted: #8D96A1;
    --nw-ui-text-faint: #7A8494;
    --nw-ui-tab-text: #475467;
    --nw-ui-input-text: #223044;
    --nw-ui-label: #5F6873;
    --nw-ui-accent: #2A77A6;
    --nw-ui-accent-hover: #23658E;
    --nw-ui-on-accent: #FFFFFF;
    --nw-ui-ok-bg: #176B45;
    --nw-ui-ok-text: #FFFFFF;
    --nw-ui-warn-bg: #8A5A14;
    --nw-ui-warn-text: #FFFFFF;
    --nw-ui-warn-hover: #7A4F11;
    --nw-ui-neutral-text: #334155;
    --nw-ui-chip-bg: #E9EEF3;
    --nw-ui-danger-bg: #FEF3F2;
    --nw-ui-danger-text: #B42318;
    --nw-ui-danger-border: #F1B5AD;
    --nw-ui-danger-hover-bg: #FBD9D5;
    --nw-ui-danger-hover-border: #E08A80;
    --nw-ui-danger-hover-text: #912018;
    --nw-ui-error-bg: #FEF3F2;
    --nw-ui-error-text: #B42318;
    --nw-ui-error-border: #F1B5AD;
    --nw-ui-unread: #E5484D;
    --nw-ui-unread-ring: rgba(229, 72, 77, .14);
    --nw-ui-shadow-popover: 0 16px 42px rgba(16, 24, 40, .18);
    --nw-ui-warn-accent: #B7791F;
    --nw-ui-warn-text-pale: #8A5A14;
    --nw-ui-danger-text-pale: #B42318;
    --nw-ui-accent-text: #1E6A99;
    --nw-ui-border-faint: #E0E5EB;
    --nw-ui-border-hover: #AEB8C4;
    --nw-ui-ok-bg-deep: #ECFDF3;
    --nw-ui-ok-bg-strong: #D1FADF;
    --nw-ui-ok-border: #8FD1AB;
    --nw-ui-ok-text-mid: #1F7A4D;
    --nw-ui-ok-text-soft: #176B45;
    --nw-ui-text-soft: #475467;
    --nw-ui-warn-bg-deep: #FFFAF2;
    --nw-ui-warn-bg-strong: #FEF0C7;
    --nw-ui-warn-border: #DFC9A7;
    --nw-ui-warn-text-soft: #8A5A14;

}

/* Density: "Normal" (Settings -> Compact/Normal) enlarges the whole type scale at once.
   Compact keeps the base values defined in :root. Components must use var(--nw-font-*). */
.app-shell.font-normal {
    --nw-font-xs: 12px;
    --nw-font-sm: 13px;
    --nw-font-md: 14px;
    --nw-font-lg: 15px;
    --nw-font-xl: 17px;
    --nw-font-title: 19px;
    --nw-font-heading: 23px;
}

/* Cream theme (PO decision, 22 October 2026): the White roles with warm off-white surfaces, a light
   warm sidebar and peach/orange accents (dark text on them). It is applied together with
   .theme-light (class "theme-cream theme-light"), so every White rule still applies; this block only
   changes values. */
.app-shell.theme-cream.theme-light {
    --nw-theme-accent: #F4A06A;
    --nw-theme-accent-hover: #EE9054;
    --nw-theme-accent-strong: #E5823F;
    --nw-theme-accent-soft: #FDE6D6;
    --nw-theme-accent-soft-strong: #FBD9C0;

    --nw-theme-bg-app: #FBF8F3;
    --nw-theme-bg-workspace: #FBF8F3;
    --nw-theme-bg-sidebar: #F3EEE5;
    --nw-theme-bg-topbar: #FFFFFF;

    --nw-theme-surface: #FFFFFF;
    --nw-theme-surface-soft: #F7F3EC;
    --nw-theme-surface-raised: #F2EDE3;
    --nw-theme-surface-hover: #EFE9DD;

    --nw-theme-border: #EBE5DA;
    --nw-theme-border-strong: #DDD5C6;

    --nw-theme-text-primary: #1E1B16;
    --nw-theme-text-secondary: #5E5849;
    --nw-theme-text-muted: #7A7262;

    --nw-theme-sidebar-text: #5E5849;
    --nw-theme-sidebar-muted: #8C8474;
    --nw-theme-sidebar-icon: #8C8474;

    --nw-theme-neutral-chip-bg: #F0EADF;
    --nw-theme-neutral-chip-border: #E2DACA;
    --nw-theme-neutral-chip-text: #4A4437;

    /* White-mode contrast roles — shared by sidebar, modals, notes, status pills and toolbars. */
    --nw-theme-sidebar-nav-text: #5E5849;
    --nw-theme-sidebar-section-text: #8C8474;

    --nw-theme-modal-bg: #FFFFFF;
    --nw-theme-modal-head-bg: #F4EFE4;
    --nw-theme-modal-section-bg: #FAF7F1;
    --nw-theme-modal-field-bg: #FFFFFF;

    --nw-theme-note-bg: #F7F3EC;
    --nw-theme-note-border: #E6DFD0;
    --nw-theme-note-text: #2B261D;

    --nw-theme-warning-row-bg: #FFF7EA;
    --nw-theme-warning-row-border: #E6C892;
    --nw-theme-warning-row-text: #744A12;
    --nw-theme-warning-row-muted: #936C35;

    --nw-theme-success-pill-bg: #176B45;
    --nw-theme-success-pill-text: #FFFFFF;
    --nw-theme-warning-pill-bg: #8A5A14;
    --nw-theme-warning-pill-text: #FFFFFF;

    /* Application chrome — White (effective values of the former layout rules). */
    --nw-chrome-app-bg: #FBF8F3;
    --nw-chrome-text: #1E1B16;
    --nw-chrome-sidebar-bg: #F3EEE5;
    --nw-chrome-sidebar-border: #E7E0D2;
    --nw-chrome-workspace-bg: #FBF8F3;
    --nw-chrome-topbar-bg: rgba(255, 255, 255, .98);
    --nw-chrome-topbar-border: #EBE5DA;
    --nw-chrome-topbar-shadow: 0 1px 0 rgba(16, 24, 40, .02);
    --nw-chrome-eyebrow: #6F6757;
    --nw-chrome-control-bg: #FFFFFF;
    --nw-chrome-control-text: #4A4437;
    --nw-chrome-control-border: #DDD5C6;
    --nw-chrome-control-hover-bg: #FBF8F3;
    --nw-chrome-control-hover-border: #CDBFA6;
    --nw-chrome-clock-text: #4A4437;
    --nw-chrome-clock-date: #4A4437;
    --nw-chrome-popover-bg: #FFFFFF;
    --nw-chrome-popover-text: #1E1B16;
    --nw-chrome-popover-border: #DDD5C6;
    --nw-chrome-popover-shadow: 0 16px 40px rgba(15, 23, 42, .12);
    --nw-chrome-label-muted: #6F6757;
    --nw-chrome-seg-bg: #FFFFFF;
    --nw-chrome-seg-text: #5E5849;
    --nw-chrome-seg-border: #DDD5C6;

    --nw-theme-count-chip-bg: #F0EADF;
    --nw-theme-count-chip-text: #1E1B16;

    --nw-theme-toolbar-bg: #F7F3EC;
    --nw-theme-toolbar-control-bg: #FFFFFF;
    --nw-theme-toolbar-text: #1E1B16;

    /* Global grid / column-filter contrast. */
    --nw-theme-grid-head-bg: #F4EFE4;
    --nw-theme-grid-head-text: #5E5849;
    --nw-theme-grid-cell-bg: #FFFFFF;
    --nw-theme-grid-cell-text: #1E1B16;
    --nw-theme-grid-border: #EBE5DA;
    --nw-theme-grid-filter-icon: #7A7262;
    --nw-theme-grid-filter-active: #F4A06A;
    --nw-theme-grid-filter-bg: #FFFFFF;
    --nw-theme-grid-filter-hover: #F3EEE3;

    /* Legacy operational surfaces that must become light in White mode. */
    --nw-theme-operational-panel-bg: #F7F3EC;
    --nw-theme-operational-panel-head-bg: #F2EDE3;
    --nw-theme-operational-panel-border: #E6DFD0;
    --nw-theme-operational-panel-text: #1E1B16;
    --nw-theme-operational-panel-muted: #7A7262;

    /* Floating customer note / notification card. */
    --nw-theme-notification-bg: #FFFFFF;
    --nw-theme-notification-head-bg: #F7F3EC;
    --nw-theme-notification-border: #E6DFD0;
    --nw-theme-notification-accent: #F4A06A;
    --nw-theme-notification-text: #2B261D;
    --nw-theme-notification-muted: #7A7262;

    /* Global White-mode controls. */
    --nw-control-bg: #FFFFFF;
    --nw-control-bg-hover: #F5F0E6;
    --nw-control-border: #DDD5C6;
    --nw-control-border-hover: #CDBFA6;
    --nw-control-text: #2B261D;
    --nw-control-muted: #7A7262;
    --nw-control-disabled-bg: #F3EFE6;
    --nw-control-disabled-text: #B0A894;

    --nw-control-primary-bg: #F4A06A;
    --nw-control-primary-hover: #EE9054;
    --nw-control-primary-text: #2A1B10;

    --nw-control-danger-bg: #FFF1EF;
    --nw-control-danger-border: #E4B4AE;
    --nw-control-danger-text: #9C352E;

    --nw-control-success-bg: #EAF7F0;
    --nw-control-success-border: #A9D7BE;
    --nw-control-success-text: #176B45;

    --nw-status-neutral-bg: #F2EDE3;
    --nw-status-neutral-border: #E2DACA;
    --nw-status-neutral-text: #4A4437;

    --nw-status-new-bg: #FDE6D6;
    --nw-status-new-text: #B4501A;
    --nw-status-processing-bg: #FFF4DE;
    --nw-status-processing-text: #875A12;
    --nw-status-finalized-bg: #EAF7F0;
    --nw-status-finalized-text: #176B45;
    --nw-status-cancelled-bg: #FFF1EF;
    --nw-status-cancelled-text: #9C352E;
    --nw-status-pending-bg: #FFF7EA;
    --nw-status-pending-text: #744A12;
    --nw-ui-info-bg: #EAF3FC;
    --nw-ui-info-text: #1E5FA8;
    --nw-ui-info-border: #B7D2EE;
    --nw-ui-purple-bg: #F3EAFB;
    --nw-ui-purple-text: #7A3FB0;
    --nw-ui-purple-border: #D8C2EE;
    --nw-ui-scrim: rgba(70, 55, 35, .30);
    --nw-ui-surface: #FFFFFF;
    --nw-ui-surface-inset: #FFFFFF;
    --nw-ui-control-bg: #FFFFFF;
    --nw-ui-border: #DDD5C6;
    --nw-ui-border-subtle: #EBE5DA;
    --nw-ui-border-strong: #DDD5C6;
    --nw-ui-border-popover: #DDD5C6;
    --nw-ui-input-border: #DDD5C6;
    --nw-ui-text-strong: #1E1B16;
    --nw-ui-text: #2B261D;
    --nw-ui-control-text: #2B261D;
    --nw-ui-text-muted: #8C8474;
    --nw-ui-text-faint: #8C8474;
    --nw-ui-tab-text: #5E5849;
    --nw-ui-input-text: #2B261D;
    --nw-ui-label: #6F6757;
    --nw-ui-accent: #F4A06A;
    --nw-ui-accent-hover: #EE9054;
    --nw-ui-on-accent: #2A1B10;
    --nw-ui-ok-bg: #176B45;
    --nw-ui-ok-text: #FFFFFF;
    --nw-ui-warn-bg: #8A5A14;
    --nw-ui-warn-text: #FFFFFF;
    --nw-ui-warn-hover: #7A4F11;
    --nw-ui-neutral-text: #4A4437;
    --nw-ui-chip-bg: #F0EADF;
    --nw-ui-danger-bg: #FEF3F2;
    --nw-ui-danger-text: #B42318;
    --nw-ui-danger-border: #F1B5AD;
    --nw-ui-danger-hover-bg: #FBD9D5;
    --nw-ui-danger-hover-border: #E08A80;
    --nw-ui-danger-hover-text: #912018;
    --nw-ui-error-bg: #FEF3F2;
    --nw-ui-error-text: #B42318;
    --nw-ui-error-border: #F1B5AD;
    --nw-ui-unread: #E5484D;
    --nw-ui-unread-ring: rgba(229, 72, 77, .14);
    --nw-ui-shadow-popover: 0 16px 42px rgba(16, 24, 40, .18);
    --nw-ui-warn-accent: #B7791F;
    --nw-ui-warn-text-pale: #8A5A14;
    --nw-ui-danger-text-pale: #B42318;
    --nw-ui-accent-text: #B4501A;
    --nw-ui-border-faint: #EBE5DA;
    --nw-ui-border-hover: #CDBFA6;
    --nw-ui-ok-bg-deep: #ECFDF3;
    --nw-ui-ok-bg-strong: #D1FADF;
    --nw-ui-ok-border: #8FD1AB;
    --nw-ui-ok-text-mid: #1F7A4D;
    --nw-ui-ok-text-soft: #176B45;
    --nw-ui-text-soft: #5E5849;
    --nw-ui-warn-bg-deep: #FFFAF2;
    --nw-ui-warn-bg-strong: #FEF0C7;
    --nw-ui-warn-border: #DFC9A7;
    --nw-ui-warn-text-soft: #8A5A14;

}

/* Cream: variables the legacy .theme-light rules in MainLayout read. */
.app-shell.theme-cream.theme-light {
    --nw-light-canvas: #FBF8F3;
    --nw-light-surface: #FFFFFF;
    --nw-light-soft: #F7F3EC;
    --nw-light-border: #EBE5DA;
    --nw-light-border-strong: #DDD5C6;
    --nw-light-text: #1E1B16;
    --nw-light-muted: #7A7262;
    --nw-light-sidebar: #F3EEE5;
    --nw-light-sidebar-border: #E7E0D2;
}

/* Cream: light warm sidebar (White has a dark one). */
.app-shell.theme-cream.theme-light .sidebar .brand-wrap,
.app-shell.theme-cream.theme-light .sidebar .sidebar-footer { border-color: #E7E0D2 !important; }
.app-shell.theme-cream.theme-light .sidebar .brand-name,
.app-shell.theme-cream.theme-light .sidebar .status-title { color: #1E1B16 !important; }
.app-shell.theme-cream.theme-light .sidebar :is(.brand-subtitle, .nav-section, .status-copy) { color: #8C8474 !important; }
.app-shell.theme-cream.theme-light .sidebar :is(.nav-link, .nav-link span:last-child) { color: #5E5849 !important; }
.app-shell.theme-cream.theme-light .sidebar .nav-icon { color: #8C8474 !important; }
.app-shell.theme-cream.theme-light .sidebar .nav-link.nav-link:hover { background: #ECE5D8 !important; color: #1E1B16 !important; }
.app-shell.theme-cream.theme-light .sidebar .nav-link.nav-link.active {
    background: #FDE6D6 !important;
    color: #B4501A !important;
    border-color: #F6CBAE !important;
    box-shadow: inset 3px 0 0 #F07A3C !important;
}
.app-shell.theme-cream.theme-light .sidebar .nav-link.nav-link.active span:last-child { color: #B4501A !important; }
.app-shell.theme-cream.theme-light .sidebar .nav-link.nav-link.active .nav-icon { color: #D95822 !important; }


/* City theme (PO decision, 23 October 2026): the same structure as Cream with soft Manchester City
   colours: pale sky-blue surfaces, a light blue sidebar, sky-blue accents (navy text on them). It is
   applied together with .theme-light (class "theme-city theme-light"); this block only changes values. */
.app-shell.theme-city.theme-light {
    --nw-theme-accent: #6CABDD;
    --nw-theme-accent-hover: #5A9BD0;
    --nw-theme-accent-strong: #4A8CC4;
    --nw-theme-accent-soft: #DCEBF7;
    --nw-theme-accent-soft-strong: #CFE4F5;

    --nw-theme-bg-app: #F3F8FC;
    --nw-theme-bg-workspace: #F3F8FC;
    --nw-theme-bg-sidebar: #E8F1F8;
    --nw-theme-bg-topbar: #FFFFFF;

    --nw-theme-surface: #FFFFFF;
    --nw-theme-surface-soft: #EAF3FA;
    --nw-theme-surface-raised: #E1EDF7;
    --nw-theme-surface-hover: #D9E8F4;

    --nw-theme-border: #DCE8F2;
    --nw-theme-border-strong: #C5D6E6;

    --nw-theme-text-primary: #14213D;
    --nw-theme-text-secondary: #4B5D78;
    --nw-theme-text-muted: #6A7D97;

    --nw-theme-sidebar-text: #4B5D78;
    --nw-theme-sidebar-muted: #8497B0;
    --nw-theme-sidebar-icon: #8497B0;

    --nw-theme-neutral-chip-bg: #E4EEF7;
    --nw-theme-neutral-chip-border: #CCDAE8;
    --nw-theme-neutral-chip-text: #33445F;

    /* White-mode contrast roles — shared by sidebar, modals, notes, status pills and toolbars. */
    --nw-theme-sidebar-nav-text: #4B5D78;
    --nw-theme-sidebar-section-text: #8497B0;

    --nw-theme-modal-bg: #FFFFFF;
    --nw-theme-modal-head-bg: #E9F1F8;
    --nw-theme-modal-section-bg: #F6FAFD;
    --nw-theme-modal-field-bg: #FFFFFF;

    --nw-theme-note-bg: #EAF3FA;
    --nw-theme-note-border: #D3E1EE;
    --nw-theme-note-text: #1C2C5B;

    --nw-theme-warning-row-bg: #FFF7EA;
    --nw-theme-warning-row-border: #E6C892;
    --nw-theme-warning-row-text: #744A12;
    --nw-theme-warning-row-muted: #936C35;

    --nw-theme-success-pill-bg: #176B45;
    --nw-theme-success-pill-text: #FFFFFF;
    --nw-theme-warning-pill-bg: #8A5A14;
    --nw-theme-warning-pill-text: #FFFFFF;

    /* Application chrome — White (effective values of the former layout rules). */
    --nw-chrome-app-bg: #F3F8FC;
    --nw-chrome-text: #14213D;
    --nw-chrome-sidebar-bg: #E8F1F8;
    --nw-chrome-sidebar-border: #D3E1EE;
    --nw-chrome-workspace-bg: #F3F8FC;
    --nw-chrome-topbar-bg: rgba(255, 255, 255, .98);
    --nw-chrome-topbar-border: #DCE8F2;
    --nw-chrome-topbar-shadow: 0 1px 0 rgba(16, 24, 40, .02);
    --nw-chrome-eyebrow: #5B6D88;
    --nw-chrome-control-bg: #FFFFFF;
    --nw-chrome-control-text: #33445F;
    --nw-chrome-control-border: #C5D6E6;
    --nw-chrome-control-hover-bg: #F3F8FC;
    --nw-chrome-control-hover-border: #B4C8DB;
    --nw-chrome-clock-text: #33445F;
    --nw-chrome-clock-date: #33445F;
    --nw-chrome-popover-bg: #FFFFFF;
    --nw-chrome-popover-text: #14213D;
    --nw-chrome-popover-border: #C5D6E6;
    --nw-chrome-popover-shadow: 0 16px 40px rgba(15, 23, 42, .12);
    --nw-chrome-label-muted: #5B6D88;
    --nw-chrome-seg-bg: #FFFFFF;
    --nw-chrome-seg-text: #4B5D78;
    --nw-chrome-seg-border: #C5D6E6;

    --nw-theme-count-chip-bg: #E4EEF7;
    --nw-theme-count-chip-text: #14213D;

    --nw-theme-toolbar-bg: #EAF3FA;
    --nw-theme-toolbar-control-bg: #FFFFFF;
    --nw-theme-toolbar-text: #14213D;

    /* Global grid / column-filter contrast. */
    --nw-theme-grid-head-bg: #E9F1F8;
    --nw-theme-grid-head-text: #4B5D78;
    --nw-theme-grid-cell-bg: #FFFFFF;
    --nw-theme-grid-cell-text: #14213D;
    --nw-theme-grid-border: #DCE8F2;
    --nw-theme-grid-filter-icon: #6A7D97;
    --nw-theme-grid-filter-active: #6CABDD;
    --nw-theme-grid-filter-bg: #FFFFFF;
    --nw-theme-grid-filter-hover: #E8F0F7;

    /* Legacy operational surfaces that must become light in White mode. */
    --nw-theme-operational-panel-bg: #EAF3FA;
    --nw-theme-operational-panel-head-bg: #E1EDF7;
    --nw-theme-operational-panel-border: #D3E1EE;
    --nw-theme-operational-panel-text: #14213D;
    --nw-theme-operational-panel-muted: #6A7D97;

    /* Floating customer note / notification card. */
    --nw-theme-notification-bg: #FFFFFF;
    --nw-theme-notification-head-bg: #EAF3FA;
    --nw-theme-notification-border: #D3E1EE;
    --nw-theme-notification-accent: #6CABDD;
    --nw-theme-notification-text: #1C2C5B;
    --nw-theme-notification-muted: #6A7D97;

    /* Global White-mode controls. */
    --nw-control-bg: #FFFFFF;
    --nw-control-bg-hover: #ECF3F9;
    --nw-control-border: #C5D6E6;
    --nw-control-border-hover: #B4C8DB;
    --nw-control-text: #1C2C5B;
    --nw-control-muted: #6A7D97;
    --nw-control-disabled-bg: #EAF1F8;
    --nw-control-disabled-text: #9DB0C6;

    --nw-control-primary-bg: #6CABDD;
    --nw-control-primary-hover: #5A9BD0;
    --nw-control-primary-text: #10203F;

    --nw-control-danger-bg: #FFF1EF;
    --nw-control-danger-border: #E4B4AE;
    --nw-control-danger-text: #9C352E;

    --nw-control-success-bg: #EAF7F0;
    --nw-control-success-border: #A9D7BE;
    --nw-control-success-text: #176B45;

    --nw-status-neutral-bg: #E1EDF7;
    --nw-status-neutral-border: #CCDAE8;
    --nw-status-neutral-text: #33445F;

    --nw-status-new-bg: #DCEBF7;
    --nw-status-new-text: #1C5C99;
    --nw-status-processing-bg: #FFF4DE;
    --nw-status-processing-text: #875A12;
    --nw-status-finalized-bg: #EAF7F0;
    --nw-status-finalized-text: #176B45;
    --nw-status-cancelled-bg: #FFF1EF;
    --nw-status-cancelled-text: #9C352E;
    --nw-status-pending-bg: #FFF7EA;
    --nw-status-pending-text: #744A12;
    --nw-ui-info-bg: #EAF3FC;
    --nw-ui-info-text: #1E5FA8;
    --nw-ui-info-border: #B7D2EE;
    --nw-ui-purple-bg: #F3EAFB;
    --nw-ui-purple-text: #7A3FB0;
    --nw-ui-purple-border: #D8C2EE;
    --nw-ui-scrim: rgba(40, 70, 110, .30);
    --nw-ui-surface: #FFFFFF;
    --nw-ui-surface-inset: #FFFFFF;
    --nw-ui-control-bg: #FFFFFF;
    --nw-ui-border: #C5D6E6;
    --nw-ui-border-subtle: #DCE8F2;
    --nw-ui-border-strong: #C5D6E6;
    --nw-ui-border-popover: #C5D6E6;
    --nw-ui-input-border: #C5D6E6;
    --nw-ui-text-strong: #14213D;
    --nw-ui-text: #1C2C5B;
    --nw-ui-control-text: #1C2C5B;
    --nw-ui-text-muted: #8497B0;
    --nw-ui-text-faint: #8497B0;
    --nw-ui-tab-text: #4B5D78;
    --nw-ui-input-text: #1C2C5B;
    --nw-ui-label: #5B6D88;
    --nw-ui-accent: #6CABDD;
    --nw-ui-accent-hover: #5A9BD0;
    --nw-ui-on-accent: #10203F;
    --nw-ui-ok-bg: #176B45;
    --nw-ui-ok-text: #FFFFFF;
    --nw-ui-warn-bg: #8A5A14;
    --nw-ui-warn-text: #FFFFFF;
    --nw-ui-warn-hover: #7A4F11;
    --nw-ui-neutral-text: #33445F;
    --nw-ui-chip-bg: #E4EEF7;
    --nw-ui-danger-bg: #FEF3F2;
    --nw-ui-danger-text: #B42318;
    --nw-ui-danger-border: #F1B5AD;
    --nw-ui-danger-hover-bg: #FBD9D5;
    --nw-ui-danger-hover-border: #E08A80;
    --nw-ui-danger-hover-text: #912018;
    --nw-ui-error-bg: #FEF3F2;
    --nw-ui-error-text: #B42318;
    --nw-ui-error-border: #F1B5AD;
    --nw-ui-unread: #E5484D;
    --nw-ui-unread-ring: rgba(229, 72, 77, .14);
    --nw-ui-shadow-popover: 0 16px 42px rgba(16, 24, 40, .18);
    --nw-ui-warn-accent: #B7791F;
    --nw-ui-warn-text-pale: #8A5A14;
    --nw-ui-danger-text-pale: #B42318;
    --nw-ui-accent-text: #1C5C99;
    --nw-ui-border-faint: #DCE8F2;
    --nw-ui-border-hover: #B4C8DB;
    --nw-ui-ok-bg-deep: #ECFDF3;
    --nw-ui-ok-bg-strong: #D1FADF;
    --nw-ui-ok-border: #8FD1AB;
    --nw-ui-ok-text-mid: #1F7A4D;
    --nw-ui-ok-text-soft: #176B45;
    --nw-ui-text-soft: #4B5D78;
    --nw-ui-warn-bg-deep: #FFFAF2;
    --nw-ui-warn-bg-strong: #FEF0C7;
    --nw-ui-warn-border: #DFC9A7;
    --nw-ui-warn-text-soft: #8A5A14;

}

/* City: variables the legacy .theme-light rules in MainLayout read. */
.app-shell.theme-city.theme-light {
    --nw-light-canvas: #F3F8FC;
    --nw-light-surface: #FFFFFF;
    --nw-light-soft: #EAF3FA;
    --nw-light-border: #DCE8F2;
    --nw-light-border-strong: #C5D6E6;
    --nw-light-text: #14213D;
    --nw-light-muted: #6A7D97;
    --nw-light-sidebar: #E8F1F8;
    --nw-light-sidebar-border: #D3E1EE;
}

/* City: light warm sidebar (White has a dark one). */
.app-shell.theme-city.theme-light .sidebar .brand-wrap,
.app-shell.theme-city.theme-light .sidebar .sidebar-footer { border-color: #D3E1EE !important; }
.app-shell.theme-city.theme-light .sidebar .brand-name,
.app-shell.theme-city.theme-light .sidebar .status-title { color: #14213D !important; }
.app-shell.theme-city.theme-light .sidebar :is(.brand-subtitle, .nav-section, .status-copy) { color: #8497B0 !important; }
.app-shell.theme-city.theme-light .sidebar :is(.nav-link, .nav-link span:last-child) { color: #4B5D78 !important; }
.app-shell.theme-city.theme-light .sidebar .nav-icon { color: #8497B0 !important; }
.app-shell.theme-city.theme-light .sidebar .nav-link.nav-link:hover { background: #D6E6F3 !important; color: #14213D !important; }
.app-shell.theme-city.theme-light .sidebar .nav-link.nav-link.active {
    background: #DCEBF7 !important;
    color: #1C5C99 !important;
    border-color: #B9D6EE !important;
    box-shadow: inset 3px 0 0 #4A8CC4 !important;
}
.app-shell.theme-city.theme-light .sidebar .nav-link.nav-link.active span:last-child { color: #1C5C99 !important; }
.app-shell.theme-city.theme-light .sidebar .nav-link.nav-link.active .nav-icon { color: #2F78B5 !important; }


/* Font choice (owner's test, 23 October 2026): the whole UI reads --nw-font-family, so one rule switches it.
   Segoe UI stays the default; Noto Sans is hosted in wwwroot/fonts. */
.app-shell.font-family-noto {
    --nw-font-family: "Noto Sans", "Segoe UI", Arial, sans-serif;
}
.app-shell.font-family-rcond {
    --nw-font-family: "Roboto Condensed", "Segoe UI", Arial, sans-serif;
}

/* Cream/City have a light sidebar: the sidebar collapse button must follow it
   (White keeps the dark navy button from white-theme-overrides.css). */
.app-shell.theme-cream.theme-light .sidebar .desktop-sidebar-toggle,
.app-shell.theme-city.theme-light .sidebar .desktop-sidebar-toggle {
    background: var(--nw-ui-control-bg) !important;
    border-color: var(--nw-ui-border-strong) !important;
    color: var(--nw-ui-text-muted) !important;
}
.app-shell.theme-cream.theme-light .sidebar .desktop-sidebar-toggle:hover,
.app-shell.theme-city.theme-light .sidebar .desktop-sidebar-toggle:hover {
    border-color: var(--nw-ui-accent) !important;
    color: var(--nw-ui-accent-text) !important;
}

/* Sand theme (PO decision, 25 October 2026): the same structure as Cream in warm sand colours from the
   owner's palette (#E9A24F, #F6D2A1, #FFF3E4, #D3C6B2, #6A5A4B): canvas #FFF3E4 (never plain white),
   sand borders, brown text, honey accent. Applied together with .theme-light (class "theme-sand theme-light"). */
.app-shell.theme-sand.theme-light {
    --nw-theme-accent: #E9A24F;
    --nw-theme-accent-hover: #DE9440;
    --nw-theme-accent-strong: #D98F34;
    --nw-theme-accent-soft: #F6D2A1;
    --nw-theme-accent-soft-strong: #F6D2A1;

    --nw-theme-bg-app: #FFF3E4;
    --nw-theme-bg-workspace: #FFF3E4;
    --nw-theme-bg-sidebar: #F4DFC0;
    --nw-theme-bg-topbar: #FFF9EF;

    --nw-theme-surface: #FFF9EF;
    --nw-theme-surface-soft: #FCE9D2;
    --nw-theme-surface-raised: #F5E6CF;
    --nw-theme-surface-hover: #F4E4CB;

    --nw-theme-border: #E6D7BE;
    --nw-theme-border-strong: #D3C6B2;

    --nw-theme-text-primary: #3A2F25;
    --nw-theme-text-secondary: #5A4A3B;
    --nw-theme-text-muted: #6A5A4B;

    --nw-theme-sidebar-text: #5A4A3B;
    --nw-theme-sidebar-muted: #8B7A66;
    --nw-theme-sidebar-icon: #8B7A66;

    --nw-theme-neutral-chip-bg: #F3E2C8;
    --nw-theme-neutral-chip-border: #DFCDB0;
    --nw-theme-neutral-chip-text: #4A3C30;

    /* White-mode contrast roles — shared by sidebar, modals, notes, status pills and toolbars. */
    --nw-theme-sidebar-nav-text: #5A4A3B;
    --nw-theme-sidebar-section-text: #8B7A66;

    --nw-theme-modal-bg: #FFF9EF;
    --nw-theme-modal-head-bg: #F8EBD6;
    --nw-theme-modal-section-bg: #FFF6EA;
    --nw-theme-modal-field-bg: #FFF9EF;

    --nw-theme-note-bg: #FCE9D2;
    --nw-theme-note-border: #E4D3B9;
    --nw-theme-note-text: #33291F;

    --nw-theme-warning-row-bg: #FFF1DD;
    --nw-theme-warning-row-border: #E6C892;
    --nw-theme-warning-row-text: #744A12;
    --nw-theme-warning-row-muted: #936C35;

    --nw-theme-success-pill-bg: #176B45;
    --nw-theme-success-pill-text: #FFF9EF;
    --nw-theme-warning-pill-bg: #8A5A14;
    --nw-theme-warning-pill-text: #FFF9EF;

    /* Application chrome — White (effective values of the former layout rules). */
    --nw-chrome-app-bg: #FFF3E4;
    --nw-chrome-text: #3A2F25;
    --nw-chrome-sidebar-bg: #F4DFC0;
    --nw-chrome-sidebar-border: #E6D6BC;
    --nw-chrome-workspace-bg: #FFF3E4;
    --nw-chrome-topbar-bg: rgba(255, 255, 255, .98);
    --nw-chrome-topbar-border: #E6D7BE;
    --nw-chrome-topbar-shadow: 0 1px 0 rgba(16, 24, 40, .02);
    --nw-chrome-eyebrow: #6A5A4B;
    --nw-chrome-control-bg: #FFF9EF;
    --nw-chrome-control-text: #4A3C30;
    --nw-chrome-control-border: #D3C6B2;
    --nw-chrome-control-hover-bg: #FFF3E4;
    --nw-chrome-control-hover-border: #CDB898;
    --nw-chrome-clock-text: #4A3C30;
    --nw-chrome-clock-date: #4A3C30;
    --nw-chrome-popover-bg: #FFF9EF;
    --nw-chrome-popover-text: #3A2F25;
    --nw-chrome-popover-border: #D3C6B2;
    --nw-chrome-popover-shadow: 0 16px 40px rgba(15, 23, 42, .12);
    --nw-chrome-label-muted: #6A5A4B;
    --nw-chrome-seg-bg: #FFF9EF;
    --nw-chrome-seg-text: #5A4A3B;
    --nw-chrome-seg-border: #D3C6B2;

    --nw-theme-count-chip-bg: #F3E2C8;
    --nw-theme-count-chip-text: #3A2F25;

    --nw-theme-toolbar-bg: #FCE9D2;
    --nw-theme-toolbar-control-bg: #FFF9EF;
    --nw-theme-toolbar-text: #3A2F25;

    /* Global grid / column-filter contrast. */
    --nw-theme-grid-head-bg: #F8EBD6;
    --nw-theme-grid-head-text: #5A4A3B;
    --nw-theme-grid-cell-bg: #FFF9EF;
    --nw-theme-grid-cell-text: #3A2F25;
    --nw-theme-grid-border: #E6D7BE;
    --nw-theme-grid-filter-icon: #6A5A4B;
    --nw-theme-grid-filter-active: #E9A24F;
    --nw-theme-grid-filter-bg: #FFF9EF;
    --nw-theme-grid-filter-hover: #F7E8D2;

    /* Legacy operational surfaces that must become light in White mode. */
    --nw-theme-operational-panel-bg: #FCE9D2;
    --nw-theme-operational-panel-head-bg: #F5E6CF;
    --nw-theme-operational-panel-border: #E4D3B9;
    --nw-theme-operational-panel-text: #3A2F25;
    --nw-theme-operational-panel-muted: #6A5A4B;

    /* Floating customer note / notification card. */
    --nw-theme-notification-bg: #FFF9EF;
    --nw-theme-notification-head-bg: #FCE9D2;
    --nw-theme-notification-border: #E4D3B9;
    --nw-theme-notification-accent: #E9A24F;
    --nw-theme-notification-text: #33291F;
    --nw-theme-notification-muted: #6A5A4B;

    /* Global White-mode controls. */
    --nw-control-bg: #FFF9EF;
    --nw-control-bg-hover: #F7E8D2;
    --nw-control-border: #D3C6B2;
    --nw-control-border-hover: #CDB898;
    --nw-control-text: #33291F;
    --nw-control-muted: #6A5A4B;
    --nw-control-disabled-bg: #F7E8D2;
    --nw-control-disabled-text: #A9987F;

    --nw-control-primary-bg: #E9A24F;
    --nw-control-primary-hover: #DE9440;
    --nw-control-primary-text: #2A1B10;

    --nw-control-danger-bg: #FFF1EF;
    --nw-control-danger-border: #E4B4AE;
    --nw-control-danger-text: #9C352E;

    --nw-control-success-bg: #EAF7F0;
    --nw-control-success-border: #A9D7BE;
    --nw-control-success-text: #176B45;

    --nw-status-neutral-bg: #F5E6CF;
    --nw-status-neutral-border: #DFCDB0;
    --nw-status-neutral-text: #4A3C30;

    --nw-status-new-bg: #F6D2A1;
    --nw-status-new-text: #8A5410;
    --nw-status-processing-bg: #FFF4DE;
    --nw-status-processing-text: #875A12;
    --nw-status-finalized-bg: #EAF7F0;
    --nw-status-finalized-text: #176B45;
    --nw-status-cancelled-bg: #FFF1EF;
    --nw-status-cancelled-text: #9C352E;
    --nw-status-pending-bg: #FFF1DD;
    --nw-status-pending-text: #744A12;
    --nw-ui-info-bg: #EAF3FC;
    --nw-ui-info-text: #1E5FA8;
    --nw-ui-info-border: #B7D2EE;
    --nw-ui-purple-bg: #F3EAFB;
    --nw-ui-purple-text: #7A3FB0;
    --nw-ui-purple-border: #D8C2EE;
    --nw-ui-scrim: rgba(70, 55, 35, .30);
    --nw-ui-surface: #FFF9EF;
    --nw-ui-surface-inset: #FFF9EF;
    --nw-ui-control-bg: #FFF9EF;
    --nw-ui-border: #D3C6B2;
    --nw-ui-border-subtle: #E6D7BE;
    --nw-ui-border-strong: #D3C6B2;
    --nw-ui-border-popover: #D3C6B2;
    --nw-ui-input-border: #D3C6B2;
    --nw-ui-text-strong: #3A2F25;
    --nw-ui-text: #33291F;
    --nw-ui-control-text: #33291F;
    --nw-ui-text-muted: #8B7A66;
    --nw-ui-text-faint: #8B7A66;
    --nw-ui-tab-text: #5A4A3B;
    --nw-ui-input-text: #33291F;
    --nw-ui-label: #6A5A4B;
    --nw-ui-accent: #E9A24F;
    --nw-ui-accent-hover: #DE9440;
    --nw-ui-on-accent: #2A1B10;
    --nw-ui-ok-bg: #176B45;
    --nw-ui-ok-text: #FFF9EF;
    --nw-ui-warn-bg: #8A5A14;
    --nw-ui-warn-text: #FFF9EF;
    --nw-ui-warn-hover: #7A4F11;
    --nw-ui-neutral-text: #4A3C30;
    --nw-ui-chip-bg: #F3E2C8;
    --nw-ui-danger-bg: #FEF3F2;
    --nw-ui-danger-text: #B42318;
    --nw-ui-danger-border: #F1B5AD;
    --nw-ui-danger-hover-bg: #FBD9D5;
    --nw-ui-danger-hover-border: #E08A80;
    --nw-ui-danger-hover-text: #912018;
    --nw-ui-error-bg: #FEF3F2;
    --nw-ui-error-text: #B42318;
    --nw-ui-error-border: #F1B5AD;
    --nw-ui-unread: #E5484D;
    --nw-ui-unread-ring: rgba(229, 72, 77, .14);
    --nw-ui-shadow-popover: 0 16px 42px rgba(16, 24, 40, .18);
    --nw-ui-warn-accent: #B7791F;
    --nw-ui-warn-text-pale: #8A5A14;
    --nw-ui-danger-text-pale: #B42318;
    --nw-ui-accent-text: #8A5410;
    --nw-ui-border-faint: #E6D7BE;
    --nw-ui-border-hover: #CDB898;
    --nw-ui-ok-bg-deep: #ECFDF3;
    --nw-ui-ok-bg-strong: #D1FADF;
    --nw-ui-ok-border: #8FD1AB;
    --nw-ui-ok-text-mid: #1F7A4D;
    --nw-ui-ok-text-soft: #176B45;
    --nw-ui-text-soft: #5A4A3B;
    --nw-ui-warn-bg-deep: #FFFAF2;
    --nw-ui-warn-bg-strong: #FEF0C7;
    --nw-ui-warn-border: #DFC9A7;
    --nw-ui-warn-text-soft: #8A5A14;

}

.app-shell.theme-sand.theme-light {
    --nw-light-canvas: #FFF3E4;
    --nw-light-surface: #FFF9EF;
    --nw-light-soft: #FCE9D2;
    --nw-light-border: #E6D7BE;
    --nw-light-border-strong: #D3C6B2;
    --nw-light-text: #3A2F25;
    --nw-light-muted: #6A5A4B;
    --nw-light-sidebar: #F4DFC0;
    --nw-light-sidebar-border: #E6D6BC;
}

/* Sand: light sand sidebar. */
.app-shell.theme-sand.theme-light .sidebar .brand-wrap,
.app-shell.theme-sand.theme-light .sidebar .sidebar-footer { border-color: #E6D6BC !important; }
.app-shell.theme-sand.theme-light .sidebar .brand-name,
.app-shell.theme-sand.theme-light .sidebar .status-title { color: #3A2F25 !important; }
.app-shell.theme-sand.theme-light .sidebar :is(.brand-subtitle, .nav-section, .status-copy) { color: #8B7A66 !important; }
.app-shell.theme-sand.theme-light .sidebar :is(.nav-link, .nav-link span:last-child) { color: #5A4A3B !important; }
.app-shell.theme-sand.theme-light .sidebar .nav-icon { color: #8B7A66 !important; }
.app-shell.theme-sand.theme-light .sidebar .nav-link.nav-link:hover { background: #F0DDBF !important; color: #3A2F25 !important; }
.app-shell.theme-sand.theme-light .sidebar .nav-link.nav-link.active {
    background: #F6D2A1 !important;
    color: #8A5410 !important;
    border-color: #E9BE82 !important;
    box-shadow: inset 3px 0 0 #E9A24F !important;
}
.app-shell.theme-sand.theme-light .sidebar .nav-link.nav-link.active span:last-child { color: #8A5410 !important; }
.app-shell.theme-sand.theme-light .sidebar .nav-link.nav-link.active .nav-icon { color: #C27D2A !important; }

.app-shell.theme-sand.theme-light .sidebar .desktop-sidebar-toggle {
    background: var(--nw-ui-control-bg) !important;
    border-color: var(--nw-ui-border-strong) !important;
    color: var(--nw-ui-text-muted) !important;
}
.app-shell.theme-sand.theme-light .sidebar .desktop-sidebar-toggle:hover {
    border-color: var(--nw-ui-accent) !important;
    color: var(--nw-ui-accent-text) !important;
}
