/* TIREQ Soft Navy V1 — approved palette. Colour only; no layout or type rules.
   Keep this stylesheet after shared, page and workspace styles. */
html[data-theme="dark"] {
  --tireq-bg:#071522;
  --tireq-sidebar:#091a2a;
  --tireq-panel:#102438;
  --tireq-panel-raised:#142b41;
  --tireq-line:#29465d;
  --tireq-line-strong:#3b5b73;
  --tireq-text:#eef4f8;
  --tireq-muted:#9fb2c1;
  --tireq-primary:#50c7d6;
  --tireq-positive:#54ce9a;
  --tireq-warning:#e5b356;
  --tireq-negative:#f07878;
  --tireq-info:#6da4ff;
  --tireq-primary-soft:#163949;
  --tireq-positive-soft:#15392f;
  --tireq-warning-soft:#3a3225;
  --tireq-negative-soft:#3d2933;
  --navy:var(--tireq-bg);--navy-2:var(--tireq-sidebar);--navy-3:var(--tireq-panel-raised);
  --canvas:var(--tireq-bg);--surface:var(--tireq-panel);--surface-2:var(--tireq-panel-raised);--surface-3:var(--tireq-panel-raised);
  --panel:var(--tireq-panel);--border:var(--tireq-line);--line:var(--tireq-line);--line-strong:var(--tireq-line-strong);
  --text:var(--tireq-text);--muted:var(--tireq-muted);--text-muted:var(--tireq-muted);--text-secondary:var(--tireq-muted);
  --accent:var(--tireq-primary);--primary:var(--tireq-primary);--blue:var(--tireq-info);--blue-soft:rgba(109,164,255,.10);
  --gold:var(--tireq-warning);--gold-bright:var(--tireq-warning);--gold-soft:rgba(229,179,86,.10);
  --green:var(--tireq-positive);--green-soft:rgba(84,206,154,.10);
  --danger:var(--tireq-negative);--danger-soft:rgba(240,120,120,.10);--warning:var(--tireq-warning);
  --semantic-success:var(--tireq-positive);--semantic-warning:var(--tireq-warning);--semantic-danger:var(--tireq-negative);--semantic-info:var(--tireq-info);
  --tireq-table-head:var(--tireq-panel-raised);--tireq-table-head-text:var(--tireq-text);--tireq-table-head-line:var(--tireq-line-strong);
  background:var(--tireq-bg);color-scheme:dark;scrollbar-color:var(--tireq-line-strong) var(--tireq-bg);
}
html[data-theme="dark"] body {background:var(--tireq-bg);color:var(--tireq-text)}
html[data-theme="dark"] body::before,
html[data-theme="dark"] .sidebar::after,
html[data-theme="dark"] .workspace-glow {background-image:none}
html[data-theme="dark"] ::selection {background:var(--tireq-primary);color:var(--tireq-bg)}

/* Local component tokens share the palette. Explicit saved text colours still win. */
html[data-theme="dark"] :is(.tq-workspace,.tq-workspace-grid) {
  --tq-bg:var(--tireq-bg);--tq-card:var(--tireq-panel);--tq-soft:var(--tireq-panel-raised);
  --tq-text:var(--tireq-text);--tq-muted:var(--tireq-muted);--tq-border:var(--tireq-line);
  --tq-accent:var(--tireq-primary);--tq-success:var(--tireq-positive);--tq-warning:var(--tireq-warning);--tq-danger:var(--tireq-negative);--tq-focus:var(--tireq-primary);
}
html[data-theme="dark"] .object-economics {
  --oe-bg:var(--tireq-panel);--oe-text:var(--tireq-text);--oe-muted:var(--tireq-muted);
  --oe-border:var(--tireq-line);--oe-accent:var(--tireq-primary);--oe-good:var(--tireq-positive);--oe-bad:var(--tireq-negative);--oe-note:var(--tireq-panel-raised);
}
html[data-theme="dark"] :is(.hr-workspace,.vacancy-controls,.vacancy-list-panel) {
  --hr-text:var(--tireq-text);--hr-muted:var(--tireq-muted);--hr-line:var(--tireq-line);
  --hr-bg:var(--tireq-panel);--hr-danger:var(--tireq-negative);--hr-good:var(--tireq-positive);--hr-accent:var(--tireq-primary);
}
html[data-theme="dark"] .wf {
  --wf-line:var(--tireq-line);--wf-muted:var(--tireq-muted);--wf-surface:var(--tireq-panel);
  --wf-blue:var(--tireq-info);--wf-warn:var(--tireq-warning);--wf-good:var(--tireq-positive);
}
html[data-theme="dark"] .page-store_control .executive-control-table {
  --control-surface:var(--tireq-panel);--control-alt:var(--tireq-panel-raised);
  --control-line:var(--tireq-line);--control-text:var(--tireq-text);--control-muted:var(--tireq-muted);
  --control-hover:#19334a;--control-header:var(--tireq-panel-raised);
  --control-bad:var(--tireq-negative);--control-good:var(--tireq-positive);--control-warning:var(--tireq-warning);
}

/* Application shell. */
html[data-theme="dark"] .sidebar {background:var(--tireq-sidebar);border-color:var(--tireq-line)}
html[data-theme="dark"] .topbar {background:var(--tireq-sidebar);border-color:var(--tireq-line)}
html[data-theme="dark"] :is(.nav-item,.nav-caption,.sidebar-version,.product-mark small,.title-wrap p,.user-copy small) {color:var(--tireq-muted)}
html[data-theme="dark"] :is(.product-mark strong,.title-wrap h1,.user-copy strong) {color:var(--tireq-text)}
html[data-theme="dark"] .nav-item:hover {color:var(--tireq-text);background:var(--tireq-panel);border-color:var(--tireq-line)}
html[data-theme="dark"] .nav-item.is-active {color:var(--tireq-text);background:var(--tireq-panel-raised);border-color:var(--tireq-line-strong);box-shadow:inset 3px 0 var(--tireq-primary)}
html[data-theme="dark"] .nav-item.is-active::before {background:var(--tireq-primary);box-shadow:none}
html[data-theme="dark"] :is(.sidebar-collapse,.sidebar-order-toggle,.icon-button,.menu-button,.theme-toggle,.user-avatar) {background:var(--tireq-panel-raised);color:var(--tireq-muted);border-color:var(--tireq-line)}
html[data-theme="dark"] :is(.sidebar-collapse,.icon-button,.menu-button,.theme-toggle):hover {color:var(--tireq-primary);border-color:var(--tireq-primary)}
html[data-theme="dark"] .topbar-ai {color:var(--tireq-primary);background:var(--tireq-primary-soft);border-color:var(--tireq-line-strong)}
html[data-theme="dark"] .topbar-ai:hover {color:var(--tireq-text);background:var(--tireq-primary-soft)}

/* Uniform card surfaces across the original screens. */
html[data-theme="dark"] body :is(
  .panel,.metric-card,.summary-card,.store-card,.store360-card,.management-card,.detail-card,
  .employee-hero,.command-hero,.brief-card-ai,.form-panel,.employee-editor-compact,.hr-operation-card,
  .oe-card,.forecast-card,.executive-card,.ai-command-card,.ai-priority-list,.diagnostic-store,
  .location-directory,.location-intelligence-main,.location-reference-side>section,.location-model-help,
  .location-kpi-strip,.population-card,.location-population-dashboard,.economics-input-v218,
  .economics-target-model,.economics-scenarios-v218,.economics-rent-v218,.economics-decision-v218>section,
  .rev-panel,.revision-store-widget,.compliance-control,.compliance-upload,.security-hero,
  .login-card,.login-panel,.login-visual,.tq-workspace-dialog,.revision-debt-dialog,
  .location-presentation-dialog,.searchable-select-results
) {background:var(--tireq-panel)!important;border-color:var(--tireq-line)!important;color:var(--tireq-text)}
html[data-theme="dark"] body :is(
  .forecast-benchmark,.current-rent-targets article,.target-requirements-grid article,
  .economics-requirements article,.economics-scenario-card,.economics-rent-v218 article,
  .location-model-help p,.analysis-method,.compact-subsection,.compact-extra,.reference-hint,
  .source-letter,.letter-preview,.profile-tabs,.search-row,.inline-form,.pagination,
  .rev-kpis article,.rev-status,.oe-total,.ai-command-summary article,.executive-ai-list article
) {background:var(--tireq-panel-raised)!important;border-color:var(--tireq-line)!important}
html[data-theme="dark"] body :is(.panel-head h3,.management-card h3,.detail-card h3,.store-card h3,.employee-identity h2,.section-heading h3,.page-actions h2,.welcome-row h2,.store360-card-head>span,.location-place-copy>b) {color:var(--tireq-text)!important}
html[data-theme="dark"] body :is(.panel-head p,.subtitle,.muted,.form-help,.table-subtitle,.empty-copy,.empty-state,.metric-card span,.metric-card small,.summary-card span,.summary-card small,.record-item small,.record-item p,.store-card>p,.store-card-head span,.location-place-category,.location-place-source,.fact-list dt,.fact-list dd small,.population-place-line small,.location-field-help) {color:var(--tireq-muted)!important}
html[data-theme="dark"] body :is(.employee-form label,.compact-field label,.location-edit-field label,.oe-field>span,.forecast-field>span) {color:var(--tireq-muted)}

/* Actions and editable values stay legible on the same dark input surface. */
html[data-theme="dark"] body .primary-button {background:var(--tireq-primary)!important;color:var(--tireq-bg)!important;border-color:var(--tireq-primary)!important;box-shadow:none}
html[data-theme="dark"] body .primary-button:hover {background:#74d5e0!important}
html[data-theme="dark"] body .secondary-button {background:var(--tireq-panel-raised)!important;color:var(--tireq-text)!important;border-color:var(--tireq-line-strong)!important}
html[data-theme="dark"] body .secondary-button:hover {border-color:var(--tireq-primary)!important}
html[data-theme="dark"] body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]),select,textarea) {background:var(--tireq-bg)!important;color:var(--tireq-text)!important;border-color:var(--tireq-line-strong)!important}
html[data-theme="dark"] body :is(input,select,textarea):focus {border-color:var(--tireq-primary)!important;outline-color:var(--tireq-primary)}
html[data-theme="dark"] body :is(input,textarea)::placeholder {color:var(--tireq-muted)}
html[data-theme="dark"] body :is(input[type="checkbox"],input[type="radio"],input[type="range"]) {accent-color:var(--tireq-primary)}
html[data-theme="dark"] body .tq-number-display {color:var(--tireq-text)}
/* The formatting overlay owns text outside focus; keep its underlying input hidden. */
html[data-theme="dark"] body .tq-number-field[data-tq-display="true"]:not(:focus-within)>input {color:transparent!important;-webkit-text-fill-color:transparent!important}
html[data-theme="dark"] body :is(.download-link,.row-actions a,.row-action-primary,.source-link-panel a,.store360-card-head a) {color:var(--tireq-info)!important}
html[data-theme="dark"] body :is(.text-button,.oe-link,.forecast-inputs>button) {color:var(--tireq-primary)!important}
html[data-theme="dark"] body :is(.profile-tabs button.is-active,.oe-tabs button[aria-selected="true"]) {color:var(--tireq-primary)!important;background:var(--tireq-primary-soft)!important;border-color:var(--tireq-line-strong)}

/* Opaque headers and sticky cells preserve table readability. */
html[data-theme="dark"] body main.content table :is(th,td) {border-color:var(--tireq-line)!important}
html[data-theme="dark"] body main.content table thead :is(th,td) {background:var(--tireq-panel-raised)!important;color:var(--tireq-text)!important}
html[data-theme="dark"] body main.content table tbody .sticky-store-column {background:var(--tireq-panel)!important}
html[data-theme="dark"] body main.content table tbody tr:hover {background-color:var(--tireq-panel-raised)}
html[data-theme="dark"] .table-wrap {scrollbar-color:var(--tireq-line-strong) var(--tireq-bg)}
html[data-theme="dark"] .table-wrap::-webkit-scrollbar-track {background:var(--tireq-bg)}
html[data-theme="dark"] .table-wrap::-webkit-scrollbar-thumb {background:var(--tireq-line-strong);border-color:var(--tireq-bg)}

/* Calm default badges; colour denotes status rather than decoration. */
html[data-theme="dark"] body :is(.status-pill,.neutral-badge,.environment,.rev-status) {color:var(--tireq-muted);background:var(--tireq-panel-raised)!important;border-color:var(--tireq-line)!important}
html[data-theme="dark"] body :is(.status-active,.signature-success,.is-stable,.is-up,.kpi-ok,.kpi-above,.requirement-above,.rev-success) {color:var(--tireq-positive)!important}
html[data-theme="dark"] body :is(.status-active,.signature-success,.message,.data-environment-badge) {background:var(--tireq-positive-soft)!important;color:var(--tireq-positive)!important;border-color:var(--tireq-positive)!important}
html[data-theme="dark"] body :is(.is-warning,.warning-badge,.signature-warning,.kpi-missing,.data-gap,.rev-warning,.review-flag,.status-onboarding) {color:var(--tireq-warning)!important}
html[data-theme="dark"] body :is(.review-panel,.readonly-banner,.warning-badge,.status-onboarding,.data-environment-badge.is-test,.environment.is-test) {color:var(--tireq-warning)!important;background:var(--tireq-warning-soft)!important;border-color:var(--tireq-warning)!important}
html[data-theme="dark"] body :is(.is-down,.status-sick,.signature-error,.kpi-below,.is-critical,.is-danger,.text-danger,.rev-danger,.requirement-below,.form-error,.wf-error) {color:var(--tireq-negative)!important}
html[data-theme="dark"] body :is(.status-sick,.signature-error,.lease-attention) {color:var(--tireq-negative)!important;background:var(--tireq-negative-soft)!important;border-color:var(--tireq-negative)!important}
html[data-theme="dark"] body main.content .attention-row {background:var(--tireq-warning-soft)!important}
html[data-theme="dark"] body main.content .loss-making-store {background:var(--tireq-negative-soft)!important}

/* Financial meaning is consistent on both forecast screens. */
html[data-theme="dark"] body .forecast-card>header>strong,
html[data-theme="dark"] body .forecast-card [data-col="visitors"],
html[data-theme="dark"] body [data-oe-value="revenue"] {color:var(--tireq-primary)!important}
html[data-theme="dark"] body .forecast-card .forecast-profit dd,
html[data-theme="dark"] body [data-oe-value="profit"] {color:var(--tireq-positive)!important}
html[data-theme="dark"] body .forecast-card [data-col="rent-share"],
html[data-theme="dark"] body :is(.analysis-score,.location-score-value,.command-orbit strong) {color:var(--tireq-warning)!important}
html[data-theme="dark"] body .forecast-card .requirement-above [data-fit-note] {color:var(--tireq-positive)!important}
html[data-theme="dark"] body .forecast-card .requirement-below [data-fit-note] {color:var(--tireq-negative)!important}
html[data-theme="dark"] body .oe-decision[data-decision-state="conditional"] {border-color:var(--tireq-warning)}
html[data-theme="dark"] body .oe-decision[data-decision-state="unknown"] {border-color:var(--tireq-info)}
html[data-theme="dark"] body .oe-decision[data-decision-state="loss"] {border-color:var(--tireq-negative)}
html[data-theme="dark"] body .forecast-card [data-negative="true"],
html[data-theme="dark"] body .object-economics [data-negative="true"],
html[data-theme="dark"] body [data-negative="true"],
html[data-theme="dark"] body [data-error="true"],
html[data-theme="dark"] body :is(.forecast-field>small,.oe-field-error,.funnel-error,.errorlist) {color:var(--tireq-negative)!important}
html[data-theme="dark"] body [aria-invalid="true"] {border-color:var(--tireq-negative)!important}

/* Existing chart series retain their labels and shapes. */
html[data-theme="dark"] body .executive-bar-stage i.actual {background:var(--tireq-primary)}
html[data-theme="dark"] body .executive-bar-stage i.plan {background:var(--tireq-warning)}
html[data-theme="dark"] body .executive-bar-values b {color:var(--tireq-primary)!important}
html[data-theme="dark"] body .executive-bar-values small {color:var(--tireq-warning)!important}

/* TIREQ 2.18.34 — whole-application dark button contrast audit.
   Colour and interaction states only: geometry, typography and layout stay unchanged. */
html[data-theme="dark"] {--tireq-action-ink:var(--tireq-bg)}

/* Give only otherwise unstyled native buttons a safe foreground. Any component
   rule has higher specificity and keeps its approved visual language. */
:where(html[data-theme="dark"]) :where(button) {color:var(--tireq-text)}

/* Filled semantic actions use dark ink; white on the approved coral was 2.74:1. */
html[data-theme="dark"] body .danger-button {
  color:var(--tireq-action-ink)!important;
  background:var(--tireq-negative)!important;
  border-color:var(--tireq-negative)!important;
  box-shadow:none
}
html[data-theme="dark"] body .danger-button:hover {
  color:var(--tireq-action-ink)!important;
  background:#ff9292!important;
  border-color:#ff9292!important
}
html[data-theme="dark"] body .economics-accept {
  color:var(--tireq-action-ink)!important;
  background:var(--tireq-warning)!important;
  border-color:var(--tireq-warning)!important
}
html[data-theme="dark"] body .economics-accept.is-accepted {
  color:var(--tireq-action-ink)!important;
  background:var(--tireq-positive)!important;
  border-color:var(--tireq-positive)!important
}

/* Destructive outline/text actions remain distinct without losing their label. */
html[data-theme="dark"] body .icon-button.danger {
  color:var(--tireq-negative)!important;
  background:var(--tireq-negative-soft)!important;
  border-color:var(--tireq-negative)!important
}
html[data-theme="dark"] body :is(.text-danger,.location-delete-button,.store-photo-menu-remove) {
  color:var(--tireq-negative)!important
}
html[data-theme="dark"] body :is(.text-danger,.location-delete-button,.store-photo-menu-remove):hover {
  color:var(--tireq-negative)!important;
  background:var(--tireq-negative-soft)!important
}

/* Local action menus that previously inherited a browser button palette. */
html[data-theme="dark"] body .hr-row-actions button:not(.text-danger) {
  color:var(--tireq-text);
  background:var(--tireq-panel-raised);
  border-color:var(--tireq-line-strong)
}
html[data-theme="dark"] body :is(.budget-note-proposals,.budget-row-note) .is-approve {
  color:var(--tireq-positive)!important;
  background:var(--tireq-positive-soft)!important;
  border-color:var(--tireq-positive)!important
}
html[data-theme="dark"] body :is(.budget-note-proposals,.budget-row-note) .is-reject {
  color:var(--tireq-warning)!important;
  background:var(--tireq-warning-soft)!important;
  border-color:var(--tireq-warning)!important
}
html[data-theme="dark"] body .budget-note-proposals .is-delete {
  color:var(--tireq-negative)!important;
  background:var(--tireq-negative-soft)!important;
  border-color:var(--tireq-negative)!important
}

/* Keyboard and unavailable states are readable for every button family. */
html[data-theme="dark"] body :is(button,a.primary-button,a.secondary-button,a.danger-button,[role="button"]):focus-visible {
  outline:2px solid var(--tireq-primary)!important;
  outline-offset:2px
}
html[data-theme="dark"] body :is(button,a.primary-button,a.secondary-button,a.danger-button):is(:disabled,[aria-disabled="true"],.is-disabled) {
  color:var(--tireq-muted)!important;
  background:var(--tireq-panel)!important;
  border-color:var(--tireq-line)!important;
  box-shadow:none!important;
  opacity:.72
}
