/* Theme overrides load after every component so all views share one palette. */
:root{color-scheme:light}
mark.search-highlight,html[data-theme=dark] mark.search-highlight{background:#ffe37a!important;color:#3a2c0b!important;border-radius:3px;padding:0;box-shadow:0 0 0 1px #e9c84c30;box-decoration-break:clone}
.project-status-filter{display:inline-flex}
.project-filter-trigger{gap:12px;min-width:145px;justify-content:space-between;white-space:nowrap}
.project-filter-trigger .ui-icon{width:14px;height:14px;transition:transform .2s}
.project-filter-trigger[aria-expanded=true] .ui-icon{transform:rotate(180deg)}
.project-filter-menu{position:fixed;inset:auto;margin:0;width:240px;box-sizing:border-box;padding:8px;background:#fff;color:#352744;border:1px solid #e8e0ef;border-radius:14px;box-shadow:0 12px 35px #24133022;opacity:0;transform:translateY(-4px);transition:opacity .18s,transform .18s,display .18s allow-discrete,overlay .18s allow-discrete}
.project-filter-menu:popover-open{opacity:1;transform:translateY(0)}
@starting-style{.project-filter-menu:popover-open{opacity:0;transform:translateY(-4px)}}
.project-filter-menu-heading{display:flex;align-items:center;justify-content:space-between;padding:8px 9px 10px;font-size:11px;color:#85778f;border-bottom:1px solid #eee8f4;margin-bottom:4px}
.project-filter-menu-heading button{border:0;background:transparent;padding:0;color:#8462ab;font:inherit;cursor:pointer}
.project-filter-option{display:flex;align-items:center;gap:10px;padding:10px;border-radius:8px;cursor:pointer;font-size:12px;transition:background .18s}
.project-filter-option:hover{background:#f5f1fa}
.project-filter-option input{width:15px;height:15px;margin:0;accent-color:#8b69b2;cursor:pointer;flex-shrink:0}
.project-filter-dot{width:7px;height:7px;flex-shrink:0;border-radius:50%;background:var(--project-status-ink)}
:is(.project-status,.dashboard-project-status,.project-filter-dot)[data-status="Under Review"]{--project-status-ink:#8552bd;--project-status-bg:#f1e8fb}
:is(.project-status,.dashboard-project-status,.project-filter-dot)[data-status="In Progress"]{--project-status-ink:#2376c4;--project-status-bg:#e5f1fc}
:is(.project-status,.dashboard-project-status,.project-filter-dot)[data-status="On Hold"]{--project-status-ink:#ac7314;--project-status-bg:#fff2d9}
:is(.project-status,.dashboard-project-status,.project-filter-dot)[data-status="Completed"]{--project-status-ink:#168759;--project-status-bg:#e2f5eb}
:is(.project-status,.dashboard-project-status,.project-filter-dot)[data-status="Cancelled"]{--project-status-ink:#cc495b;--project-status-bg:#fde9ed}
html .project-gallery-card .project-status[data-status],html .dashboard-project-status[data-status]{color:var(--project-status-ink)!important;background:var(--project-status-bg)!important}
html[data-theme=dark] .project-filter-menu{background:#22212b;color:#eee9f5;border-color:#40374e;box-shadow:0 12px 35px #0006}
html[data-theme=dark] .project-filter-menu-heading{color:#aaa0b5;border-color:#40374e}
html[data-theme=dark] .project-filter-option:hover{background:#302b3b}
html[data-theme=dark] :is(.project-status,.dashboard-project-status,.project-filter-dot)[data-status="Under Review"]{--project-status-ink:#c09aec;--project-status-bg:#382746}
html[data-theme=dark] :is(.project-status,.dashboard-project-status,.project-filter-dot)[data-status="In Progress"]{--project-status-ink:#84baff;--project-status-bg:#22374f}
html[data-theme=dark] :is(.project-status,.dashboard-project-status,.project-filter-dot)[data-status="On Hold"]{--project-status-ink:#edc16f;--project-status-bg:#453721}
html[data-theme=dark] :is(.project-status,.dashboard-project-status,.project-filter-dot)[data-status="Completed"]{--project-status-ink:#75d8aa;--project-status-bg:#213f33}
html[data-theme=dark] :is(.project-status,.dashboard-project-status,.project-filter-dot)[data-status="Cancelled"]{--project-status-ink:#f291a2;--project-status-bg:#472a34}
@media(prefers-reduced-motion:reduce){.project-filter-menu,.project-filter-trigger .ui-icon{transition:none}}
html{zoom:var(--ui-scale,1.1)}
.app-main{min-height:calc(100dvh / var(--ui-scale,1.1))}
.theme-logo{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}
.theme-logo .theme-logo-dark{display:none}
html[data-theme=dark] .theme-logo .theme-logo-light{display:none}
html[data-theme=dark] .theme-logo .theme-logo-dark{display:block}
.sidebar{height:calc(100dvh / var(--ui-scale,1.1))}
dialog{max-height:calc(100dvh / var(--ui-scale,1.1) - 32px)}
.grid-add-field-popover{max-height:calc(100vh / var(--ui-scale,1.1) - 16px)}
body.auth-page{min-height:calc(100dvh / var(--ui-scale,1.1))}
:root[data-theme=dark]{color-scheme:dark;--bg:#101114;--surface:#191a20;--ink:#ececf2;--muted:#a3a5b7;--line:#30323e;--green:#b0a2ee;--green-soft:#302944;--navy:#ddd5fa;--accent:#ad99ee;--shadow:0 8px 30px -18px #0009}
html[data-theme=dark] body{background:var(--bg);color:var(--ink)}
html[data-theme=dark] ::selection{background:#51436f;color:#fff}
/* Cell dropdown triggers are buttons with .grid-input, and share the input palette. */
html[data-theme=dark] :is(input,select,textarea,.grid-input){background:#22232b;border-color:#3b3c4a;color:var(--ink)}
html[data-theme=dark] :is(input,select,textarea,.grid-input):focus{border-color:var(--accent);box-shadow:0 0 0 3px #ad99ee20}
html[data-theme=dark] :is(input,textarea)::placeholder{color:var(--muted);opacity:1}
html[data-theme=dark] select option{background:#22232b;color:var(--ink)}
html[data-theme=dark] :is(label,.settings-grid label,.auth-card label){color:#c0b4d4}
html[data-theme=dark] :is(.sidebar,.card-head,.phase-summary,.dialog-head,.metric-card,.view-gallery .project-gallery-card){background:var(--surface);border-color:var(--line)}
html[data-theme=dark] :is(.brand,.project-navigation,.view-switcher,.status-order-row,.activity-row,.attention-row,.quick-link,.project-card-link .view-meta,.employee-card-details>div,.auth-foot){border-color:var(--line)}
html[data-theme=dark] :is(.brand-name,.breadcrumb strong,.phase-identity strong,.project-card-link strong,.dialog-head h2,.metric-card strong,.attention-row strong,.summary-heading>strong,.summary-group summary strong){color:var(--ink)}
html[data-theme=dark] :is(.sidebar .nav-item,.icon-button,.view-switcher button,.project-view-tabs button,.row-action-menu button,.page-options-menu button,.grid-button,.grid-column-title,.cv-gantt-scales button){color:#b7aec9}
html[data-theme=dark] :is(.sidebar .nav-item:hover,.icon-button:hover,.quick-link:hover,.view-switcher button:hover,.project-view-tabs button:hover,.row-action-menu button:hover,.page-options-menu button:hover,.summary-group summary:hover,.cv-gantt-scales button:hover){background:#292533;color:#dccdfa}
html[data-theme=dark] .sidebar .nav-item.active{color:#baa7ff}
html[data-theme=dark] :is(.avatar,.phase-count,.record-count,.empty-symbol,.view-group-heading small,.project-view-tabs){background:var(--green-soft);border-color:#483b60;color:#c4b4e6}
html[data-theme=dark] .topbar.unified-page-header{background:var(--bg)}
html[data-theme=dark] :is(.unified-page-header .breadcrumb,.header-search-toggle,.button,.gallery-actions,.sidebar-toggle){background:#22232b;border-color:#3b3c4a;color:#d6cfe3}
html[data-theme=dark] .button:hover{background:#302944;border-color:#756096}
html[data-theme=dark] .button.primary{background:linear-gradient(135deg,#7460bf,#594597);border-color:#806ac9;color:white}
html[data-theme=dark] .button.danger{background:#a23e59;border-color:#b6536e;color:white}
html[data-theme=dark] :is(.text-link,.card-head a){color:#c3adff}
html[data-theme=dark] :is(.card,.record-view-card,.summary-group,.calendar-day,.grid-shared-table,.phase-section,.inline-phase-create,.grid-delete-bar,dialog,.row-action-menu,.page-options-menu,.grid-add-field-popover,.task-color-menu,.cv-gantt,.cv-gantt-scales){background:var(--surface);border-color:var(--line);color:var(--ink)}
html[data-theme=dark] :is(.form-actions,.quick-client-editor,.calendar-day.outside,.calendar-event,.gallery-cover,.gallery-initial,.schedule-tools,.schedule-head,.schedule-corner,.cv-gantt-toolbar,.cv-gantt-head,.cv-gantt-label-head){background:#22212b;border-color:var(--line);color:#bfb2cf}
html[data-theme=dark] :is(main table th,.grid-v2 .phase-task-table th){background:#22212b;border-color:var(--line);color:#b9a8cb}
html[data-theme=dark] :is(main table td,.grid-v2 .phase-task-table td){background:var(--surface);border-color:var(--line);color:#c4b6d3}
html[data-theme=dark] :is(main table td strong,.grid-v2 .grid-name-text){color:#e0d2ef}
html[data-theme=dark] :is(main table tbody tr:hover,.grid-v2 .phase-task-table tbody tr:hover td){background:#23212d}
html[data-theme=dark] .grid-v2 .grid-editable:hover{background:#30283c;box-shadow:inset 0 0 0 1px #594369}
html[data-theme=dark] .grid-header-editable:hover{background:#30283c!important}
html[data-theme=dark] .grid-shared-table .phase-task-table .grid-phase-heading th{background:#30283c;border-color:#443650;color:#d0b9e6}
html[data-theme=dark] .grid-shared-table .grid-add-row td{background:var(--surface);border-color:var(--line)}
html[data-theme=dark] :is(.grid-drag-preview,.grid-drag-preview td){background:#24202e;color:#d9c8eb}
html[data-theme=dark] .grid-drag-placeholder td{background:#40314e!important;box-shadow:inset 0 1px #6d507c,inset 0 -1px #6d507c}
html[data-theme=dark] .grid-v2 .grid-field-delete{background:#3b202b;border-color:#714055;color:#f099b3}
html[data-theme=dark] .grid-v2 .grid-field-delete:hover{background:#532635;border-color:#a1546c}
html[data-theme=dark] :is(.view-switcher button[aria-selected=true],.project-view-tabs button[aria-pressed=true]){background:#393044;color:#dfcaff;border-color:#66517e}
html[data-theme=dark] :is(.muted,small,.phase-identity small,.phase-count,.project-card-description,.project-card-client,.project-card-link .view-meta small,.record-view-card p,.settings-grid .form-grid p,.auth-card>.muted,.cv-gantt-identity small,.cv-gantt-heading small,.cv-gantt-phase-count){color:var(--muted)}
html[data-theme=dark] .metric-card:first-child{background:linear-gradient(135deg,#4e408f,#2e285c)}
html[data-theme=dark] .metric-card:first-child strong{color:white}
html[data-theme=dark] .attention-note{background:#22212b!important;color:var(--muted)}
html[data-theme=dark] .badge{background:#302944;border-color:#514163;color:#c9b6e1}
html[data-theme=dark] .project-gallery-card .project-status[data-status=Draft]{background:#30323a;border-color:#484b56;color:#c0c3cf}
html[data-theme=dark] .project-gallery-card .project-status[data-status=Active]{background:#22344f;border-color:#365581;color:#93bafb}
html[data-theme=dark] .project-gallery-card .project-status[data-status=Completed]{background:#203c30;border-color:#37624c;color:#8ad5aa}
html[data-theme=dark] .project-gallery-card .project-status[data-status="On Hold"]{background:#422d20;border-color:#765335;color:#e9b685}
html[data-theme=dark] .project-gallery-card .project-status[data-status=Planned]{background:#3c3421;border-color:#6d5b31;color:#e5c783}
html[data-theme=dark] .project-gallery-card .project-status[data-status=Cancelled]{background:#402531;border-color:#75435a;color:#eda5be}
html[data-theme=dark] .project-gallery-card .project-status[data-status=Archived]{background:#322c3b;border-color:#504359;color:#bfaace}
html[data-theme=dark] .grid-status-cell .grid-status-text{color:#b6bac7}
html[data-theme=dark] .grid-status-holder[data-status="In Progress"] .grid-status-text{color:#87b7ec}
html[data-theme=dark] .grid-status-holder[data-status=Done] .grid-status-text{color:#83d2aa}
html[data-theme=dark] .sidebar-tooltip{background:#29232f;border-color:#584766;color:#efddff}
html[data-theme=dark] .sidebar-tooltip::before{background:#29232f;border-color:#584766}
html[data-theme=dark] :is(.cv-gantt-label,.cv-gantt-row:hover .cv-gantt-label){background:var(--surface);border-color:var(--line)}
html[data-theme=dark] :is(.cv-gantt-toolbar,.cv-gantt-legend,.cv-gantt-head,.cv-gantt-months,.cv-gantt-months>span,.cv-gantt-days>span,.cv-gantt-row){border-color:var(--line)}
html[data-theme=dark] .cv-gantt-grid{background-image:linear-gradient(to right,#30323e 1px,transparent 1px)}
html[data-theme=dark] :is(.cv-gantt-weekend,.cv-gantt-days .is-weekend){background:#24212d}
html[data-theme=dark] .cv-gantt-row.is-phase{background:#33283f66}
html[data-theme=dark] .cv-gantt-row.is-phase .cv-gantt-label{background:#30283c}
html[data-theme=dark] :is(.cv-gantt-identity b,.cv-gantt-heading strong,.cv-gantt-phase-toggle){color:#d5bde9}
html[data-theme=dark] :is(.cv-gantt-date,.cv-gantt-qty,.cv-gantt-date-button,.cv-gantt-months>span,.cv-gantt-days>span){color:#b9a8cb}
html[data-theme=dark] .cv-gantt-date-button:hover{background:#30283c;border-color:#66517e}
html[data-theme=dark] .cv-gantt-days .is-today{background:#452735;color:#f3a5bf}
html[data-theme=dark] .cv-gantt-scroll{scrollbar-color:#55455f var(--surface)}
html[data-theme=dark] body.auth-page{background:radial-gradient(ellipse at 20% 10%,#2a213f,transparent 50%),#101114!important}
html[data-theme=dark] .auth-card{background:#191a20;border-color:var(--line)}
html[data-theme=dark] .auth-brand strong{color:#d8c3f2!important}
html[data-theme=dark] .auth-card h1{color:var(--ink)}
html[data-theme=dark] .site-loader-step{background:var(--bg)}
html[data-theme=dark] .site-loader-content{color:var(--ink)}
html[data-theme=dark] .workspace-banner{background:#20302a;border-color:#365245}
html[data-theme=dark] .workspace-banner p{color:#a5c4b6}
html[data-theme=dark] :is(.notice,#toast){background:#29232f;border-color:#584766;color:#efddff}
html[data-theme=dark] .grid-delete-button{background:#3b202b;color:#f099b3}
html[data-theme=dark] .grid-delete-button::before{background:#532635}
html[data-theme=dark] ::-webkit-scrollbar-track,html[data-theme=dark] ::-webkit-scrollbar-corner{background:#191a20}
html[data-theme=dark] ::-webkit-scrollbar-thumb{background:#55455f;border-color:#191a20}
html[data-theme=dark] ::-webkit-scrollbar-thumb:hover{background:#827094}

html[data-theme=dark] .alternate-view{background:transparent;border-color:var(--line);color:var(--ink)}

/* QA: WCAG AA text colours; keep dark-theme tokens independent. */
html:not([data-theme=dark]){--muted:#656276}
html:not([data-theme=dark]) :is(.view-empty,.project-view-tabs button:not([aria-pressed=true]),.grid-column-title,th,.metric-card small,.interface-size-labels,.breadcrumb b){color:#655771}
html:not([data-theme=dark]) .supply-project-status[data-status="In Progress"]{color:#1d659e;background:#e3effa}
html:not([data-theme=dark]) .supply-project-status{color:#654aa1}
html:not([data-theme=dark]) .supply-project-status[data-status="Completed"]{color:#17683f}
html:not([data-theme=dark]) .supply-project-status[data-status="On Hold"]{color:#80530b}
html:not([data-theme=dark]) .supply-project-status[data-status="Cancelled"]{color:#a73548}
html:not([data-theme=dark]) .dashboard-redesign .dashboard-project-split>span:first-child b{color:#2168a0}
html:not([data-theme=dark]) .dashboard-redesign .dashboard-project-split>span:last-child b{color:#176e4d}
html:not([data-theme=dark]) :is(.cv-gantt-scales button:not([aria-pressed=true]),.grid-field-unavailable){color:#655771}
html:not([data-theme=dark]) .grid-v2 .phase-task-table td{color:#6b587c}
html:not([data-theme=dark]) .cv-gantt :is(.cv-gantt-task-heading,.cv-gantt-label-head .cv-gantt-date,.cv-gantt-days b,.cv-gantt-days small,.cv-gantt-phase-count,.cv-gantt-date-button){color:#655771}
html:not([data-theme=dark]) .cv-gantt-scales button[aria-pressed=true]{color:#fff}
html:not([data-theme=dark]) :is(.project-status,.dashboard-project-status,.project-filter-dot)[data-status="Under Review"]{--project-status-ink:#75408e}
html:not([data-theme=dark]) :is(.project-status,.dashboard-project-status,.project-filter-dot)[data-status="In Progress"]{--project-status-ink:#1d659e}
html:not([data-theme=dark]) :is(.project-status,.dashboard-project-status,.project-filter-dot)[data-status="On Hold"]{--project-status-ink:#81530b}
html:not([data-theme=dark]) :is(.project-status,.dashboard-project-status,.project-filter-dot)[data-status="Completed"]{--project-status-ink:#116c46}
html:not([data-theme=dark]) :is(.project-status,.dashboard-project-status,.project-filter-dot)[data-status="Cancelled"]{--project-status-ink:#a73548}
