/* WhiteTrack appearance system 009
   Loaded after page-specific styles so the selected appearance remains authoritative. */

html{color-scheme:dark}
html[data-theme="light"]{color-scheme:light;
  --bg:#eef2ef;--panel:#ffffff;--panel2:#f5f7f5;--glass:rgba(255,255,255,.92);--line:rgba(24,38,30,.14);
  --text:#17201b;--muted:#68736c;--shadow:0 22px 64px rgba(23,37,29,.12);
}

/* One rendered brand surface: the selected theme swaps the background asset.
   This cannot expose both logos even when page-specific img rules are aggressive. */
html{--wt-brand-logo:url("../images/white-logo-dark.jpg")}
html[data-theme="light"]{--wt-brand-logo:url("../images/white-logo-light.jpg")}
.brand .theme-logo,.auth-brand .theme-logo{display:none!important}
.theme-brand-logo{
  display:block;flex:0 0 auto;width:226px;max-width:100%;height:80px;
  background-image:var(--wt-brand-logo);background-repeat:no-repeat;
  background-position:left center;background-size:contain;
}
.auth-brand .theme-brand-logo{width:248px;max-width:min(62vw,248px);height:82px}

html[data-theme="light"] body{
  background:
    radial-gradient(circle at 90% 12%,rgba(84,200,120,.11),transparent 28%),
    radial-gradient(circle at 10% 92%,rgba(127,183,255,.10),transparent 30%),
    var(--bg);
  color:var(--text);
}
html[data-theme="light"] a{color:inherit}
html[data-theme="light"] .side-nav{
  background:linear-gradient(180deg,rgba(255,255,255,.98),rgba(244,248,245,.96));
  border-right-color:var(--line);
  box-shadow:10px 0 36px rgba(25,45,32,.06);
}
html[data-theme="light"] .side-nav>.brand{border-bottom-color:rgba(24,38,30,.11)}
html[data-theme="light"] .side-nav nav a{color:#47534b}
html[data-theme="light"] .side-nav nav a span{color:#b7780b}
html[data-theme="light"] .side-nav nav a:hover,
html[data-theme="light"] .side-nav nav a.active{
  color:#152019;background:#e9eeea;border-color:rgba(24,38,30,.13);box-shadow:inset 3px 0 0 #17201b;
}
html[data-theme="light"] .side-footer{color:#758079}
html[data-theme="light"] .top-bar{border-bottom-color:var(--line)}
html[data-theme="light"] .user-chip{background:rgba(255,255,255,.86);border-color:var(--line);box-shadow:0 8px 24px rgba(25,45,32,.06)}
html[data-theme="light"] .link-button{color:#956009}
html[data-theme="light"] .eyebrow{color:#a86c08}

html[data-theme="light"] :is(.hero-card,.glass-card,.command-strip,.metric-card,.customer-card,.form-card){
  background:linear-gradient(180deg,rgba(255,255,255,.98),rgba(250,252,250,.94));
  border-color:var(--line);box-shadow:var(--shadow);
}
html[data-theme="light"] .metric-card label{color:#47534b}
html[data-theme="light"] .customer-card:hover{border-color:rgba(168,108,8,.45)}
html[data-theme="light"] .muted,
html[data-theme="light"] .small,
html[data-theme="light"] .field label,
html[data-theme="light"] .user-chip small{color:var(--muted)}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea{
  background:#fff;color:#17201b;border-color:rgba(24,38,30,.18);box-shadow:inset 0 1px 0 rgba(255,255,255,.65);
}
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder{color:#8a948e}
html[data-theme="light"] .btn{background:#17201b;color:#fff}
html[data-theme="light"] .btn.secondary{background:#f2f5f2;color:#1c2821;border-color:rgba(24,38,30,.16)}
html[data-theme="light"] .btn.secondary:hover{background:#e7ece8}
html[data-theme="light"] .btn.is-active,
html[data-theme="light"] .btn.secondary.is-active{background:#e0a400;color:#111;border-color:#ca9300}

html[data-theme="light"] .table-wrap{border-color:var(--line);background:#fff}
html[data-theme="light"] th{color:#526058;background:#eef2ef}
html[data-theme="light"] th,
html[data-theme="light"] td{border-bottom-color:rgba(24,38,30,.10)}
html[data-theme="light"] tr:hover td{background:#f4f7f5}
html[data-theme="light"] .pill.grey{background:#e8ece9;color:#536058}
html[data-theme="light"] .pill.green{background:#dff3e5;color:#1c6c37}
html[data-theme="light"] .pill.red{background:#f8dfdf;color:#9f3030}
html[data-theme="light"] .pill.amber{background:#f8ebd3;color:#8b5b09}
html[data-theme="light"] .toast-success{background:#e0f5e5;color:#1f6334;border-color:#abd9b7}
html[data-theme="light"] .validation-summary-errors{background:#fbe6e6;color:#872f2f;border-color:#efb5b5}
html[data-theme="light"] .alert-critical{background:linear-gradient(90deg,#f9e3e3,#fff3f3);color:#742828;border-color:#e4a6a6}

/* Delivery Tracking */
html[data-theme="light"] .tracking-command-strip{background:linear-gradient(135deg,#fff7db,#fff 48%,#eaf6ee)}
html[data-theme="light"] .tracking-toolbar{background:rgba(255,255,255,.96)}
html[data-theme="light"] .delivery-list-item,
html[data-theme="light"] .journey-workspace-card,
html[data-theme="light"] .manifest-journey-panel{
  background:linear-gradient(150deg,#fff,#f7faf8);border-color:rgba(24,38,30,.15);
}
html[data-theme="light"] .delivery-list-item:hover,
html[data-theme="light"] .delivery-list-item:focus-visible{background:#f5f8f6}
html[data-theme="light"] .delivery-list-item.is-selected{background:linear-gradient(145deg,#fff6d8,#fff);border-color:#c99718}
html[data-theme="light"] .delivery-list-destination,
html[data-theme="light"] .delivery-list-vehicle,
html[data-theme="light"] .manifest-summary-facts>div,
html[data-theme="light"] .delivery-detail-order,
html[data-theme="light"] .delivery-freight-line,
html[data-theme="light"] .delivery-exception-admin-meta span,
html[data-theme="light"] .ops-exception-summary,
html[data-theme="light"] .ops-exception-history article{
  background:#f1f5f2;border-color:rgba(24,38,30,.11);
}
html[data-theme="light"] .delivery-list-forecast>div,
html[data-theme="light"] .customer-detail-card,
html[data-theme="light"] .detail-item,
html[data-theme="light"] .ops-summary,
html[data-theme="light"] .delivery-freight-figures>span{
  background:#f7f9f7;border-color:rgba(24,38,30,.11);
}
html[data-theme="light"] .delivery-forecast-primary{background:linear-gradient(145deg,#edf5ff,#fff)!important}
html[data-theme="light"] .manifest-stop{background:#f8faf8;border-color:rgba(24,38,30,.12)}
html[data-theme="light"] .manifest-stop:hover,
html[data-theme="light"] .manifest-stop:focus-visible{background:#eef3ef}
html[data-theme="light"] .manifest-stop.current{background:#fff5dc}
html[data-theme="light"] .manifest-refresh-status{background:#f1f4f2;color:#5f6963}
html[data-theme="light"] .delivery-detail-hero{background:linear-gradient(145deg,#fff,#f3f6f4)}
html[data-theme="light"] .delivery-detail-hero.green{background:linear-gradient(145deg,#e5f6e9,#fff)}
html[data-theme="light"] .delivery-detail-hero.amber{background:linear-gradient(145deg,#fff0d7,#fff)}
html[data-theme="light"] .delivery-detail-hero.red{background:linear-gradient(145deg,#fae4e4,#fff)}
html[data-theme="light"] .delivery-freight-section,
html[data-theme="light"] .admin-delivery-details,
html[data-theme="light"] .delivery-exception-admin,
html[data-theme="light"] .ops-panel,
html[data-theme="light"] .ops-cause-panel{background:#f7f9f7;border-color:rgba(24,38,30,.12)}
html[data-theme="light"] .delivery-freight-loading,
html[data-theme="light"] .delivery-freight-empty{background:#f1f4f2}
html[data-theme="light"] .wt-modal{background:#fff;color:#17201b;border-color:rgba(24,38,30,.16);box-shadow:0 28px 90px rgba(18,33,24,.22)}
html[data-theme="light"] .wt-modal-close{background:#edf1ee;color:#28342d}
html[data-theme="light"] .leaflet-popup-content-wrapper,
html[data-theme="light"] .leaflet-popup-tip{background:#fff;color:#17201b}
html[data-theme="light"] .map-popup button{color:#111}
html[data-theme="light"] .vehicle-brand-chip.whites,
html[data-theme="light"] .legend-truck.whites{background:#151b17;color:#fff}

/* On-Time Service Performance */
html[data-theme="light"] .service-performance-page{--sp-bg:#eef2ef;--sp-panel:#fff;--sp-panel-2:#f5f8f6;--sp-line:rgba(24,38,30,.14);--sp-text:#17201b;--sp-muted:#68736c}
html[data-theme="light"] .sp-hero{background:radial-gradient(circle at 88% 10%,rgba(109,168,255,.15),transparent 34%),radial-gradient(circle at 4% 100%,rgba(114,214,160,.12),transparent 32%),#fff}
html[data-theme="light"] .sp-hero-score,
html[data-theme="light"] .sp-weekly-insight,
html[data-theme="light"] .sp-period-toggle{background:#f0f4f1}
html[data-theme="light"] .sp-filter-bar,
html[data-theme="light"] .sp-section-nav{background:rgba(255,255,255,.95);border-color:var(--sp-line)}
html[data-theme="light"] .sp-field input,
html[data-theme="light"] .sp-field select,
html[data-theme="light"] .sp-panel-tools input{background:#fff;color:var(--sp-text);border-color:var(--sp-line)}
html[data-theme="light"] .sp-field input:focus,
html[data-theme="light"] .sp-field select:focus,
html[data-theme="light"] .sp-panel-tools input:focus{background:#fff}
html[data-theme="light"] .sp-button,
html[data-theme="light"] .sp-icon-button{background:#eef2ef;color:#253129;border-color:var(--sp-line)}
html[data-theme="light"] .sp-panel,
html[data-theme="light"] .sp-kpi,
html[data-theme="light"] .sp-methodology>div{background:#fff;border-color:var(--sp-line);box-shadow:0 14px 42px rgba(23,37,29,.08)}
html[data-theme="light"] .sp-table th{background:#eef2ef;color:#58655d}
html[data-theme="light"] .sp-table tbody tr:hover{background:#f4f7f5}
html[data-theme="light"] .sp-tag,
html[data-theme="light"] .sp-geo-tile{background:#f1f4f2}

/* Service Exceptions */
html[data-theme="light"] .exceptions-workbench{--ex-bg:#eef2ef;--ex-panel:#fff;--ex-panel-2:#f5f8f6;--ex-line:rgba(24,38,30,.14);--ex-text:#17201b;--ex-muted:#68736c}
html[data-theme="light"] .ex-hero{background:radial-gradient(circle at 93% 13%,rgba(184,156,255,.14),transparent 34%),radial-gradient(circle at 1% 100%,rgba(255,123,120,.09),transparent 34%),#fff}
html[data-theme="light"] .ex-hero-score{background:#f0f3f1}
html[data-theme="light"] .ex-filter-bar{background:rgba(255,255,255,.95)}
html[data-theme="light"] .ex-field input,
html[data-theme="light"] .ex-field select,
html[data-theme="light"] .ex-editor input,
html[data-theme="light"] .ex-editor select,
html[data-theme="light"] .ex-editor textarea{background:#fff;color:var(--ex-text);border-color:var(--ex-line)}
html[data-theme="light"] .ex-list-panel,
html[data-theme="light"] .ex-detail-panel,
html[data-theme="light"] .ex-metrics article{background:#fff;border-color:var(--ex-line);box-shadow:0 14px 42px rgba(23,37,29,.08)}
html[data-theme="light"] .ex-table th{background:#eef2ef;color:#58655d}
html[data-theme="light"] .ex-table tbody tr:hover,
html[data-theme="light"] .ex-table tbody tr:focus,
html[data-theme="light"] .ex-table tbody tr.is-selected{background:#f3f6f4}
html[data-theme="light"] .ex-detail-section,
html[data-theme="light"] .ex-fact{background:#f5f8f6;border-color:var(--ex-line)}
html[data-theme="light"] .ex-detail-close{background:#e9eeea;color:#243028}

/* Late Deliveries */
html[data-theme="light"] .late-ops-page{--late-bg:#eef2ef;--late-panel:#fff;--late-panel-soft:#f5f8f6;--late-line:rgba(24,38,30,.14);--late-text:#17201b;--late-muted:#68736c}
html[data-theme="light"] .late-ops-hero,
html[data-theme="light"] .late-queue-panel,
html[data-theme="light"] .late-action-pane{background:#fff;border-color:var(--late-line);box-shadow:0 14px 42px rgba(23,37,29,.08)}
html[data-theme="light"] .late-risk-list-head,
html[data-theme="light"] .late-queue-table thead,
html[data-theme="light"] .late-risk-group-heading{background:#eef2ef;color:#4f5b54}
html[data-theme="light"] .late-risk-card{background:#fff}
html[data-theme="light"] .late-risk-card:hover,
html[data-theme="light"] .late-risk-card:focus-visible,
html[data-theme="light"] .late-risk-card.selected{background:#f4f7f5}
html[data-theme="light"] .late-review-flag,
html[data-theme="light"] .late-open-button,
html[data-theme="light"] .late-pane-refresh,
html[data-theme="light"] .late-pane-close,
html[data-theme="light"] .late-owner-input button{background:#edf1ee;color:#26332b;border-color:var(--late-line)}
html[data-theme="light"] .late-commitment-grid>div,
html[data-theme="light"] .late-fact-grid>div,
html[data-theme="light"] .late-freight-row,
html[data-theme="light"] .late-action-priority,
html[data-theme="light"] .late-eta-toggle,
html[data-theme="light"] .late-review-banner,
html[data-theme="light"] .late-cause-card,
html[data-theme="light"] .late-classification-fields{background:#f5f8f6;border-color:var(--late-line)}
html[data-theme="light"] .late-classification-fields select,
html[data-theme="light"] .late-classification-fields textarea{background:#fff;color:var(--late-text)}
html[data-theme="light"] .late-map-overlay,
html[data-theme="light"] .late-map-unavailable{background:rgba(255,255,255,.9);color:#26332b}

/* Admin workspace access and settings */
html[data-theme="light"] .workspace-access-hero{background:linear-gradient(135deg,#edf5ff,#ebf7ef,#fff)}
html[data-theme="light"] .workspace-access-hero-stat,
html[data-theme="light"] .workspace-default-note,
html[data-theme="light"] .workspace-feature-card,
html[data-theme="light"] .workspace-feature-state{background:#f3f6f4;color:#26332b;border-color:var(--line)}
html[data-theme="light"] .workspace-install-required{background:linear-gradient(135deg,#fff1d5,#fff)}
html[data-theme="light"] .workspace-install-required code{background:#f2e4c8;color:#573c0a}

/* Authentication */
html[data-theme="light"] .auth-body{background:radial-gradient(circle at 84% 18%,rgba(84,200,120,.11),transparent 28%),radial-gradient(circle at 12% 82%,rgba(127,183,255,.10),transparent 30%),#eef2ef}
html[data-theme="light"] .auth-header{background:rgba(255,255,255,.9);border-bottom-color:var(--line)}
html[data-theme="light"] .auth-product span{color:#17201b}
html[data-theme="light"] .auth-product small,
html[data-theme="light"] .auth-footer{color:#68736c}
html[data-theme="light"] .auth-card-heading>p:last-child,
html[data-theme="light"] .auth-message-card>p,
html[data-theme="light"] .auth-card .field label{color:#68736c}
html[data-theme="light"] .auth-information-panel,
html[data-theme="light"] .auth-account-summary{background:#f3f6f4;border-color:var(--line)}
html[data-theme="light"] .auth-information-panel span,
html[data-theme="light"] .auth-account-summary small{color:#68736c}

/* Appearance settings */
.appearance-settings{max-width:920px}
.appearance-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;margin-bottom:20px}
.appearance-heading h2{margin:4px 0 8px}
.appearance-current{display:inline-flex;align-items:center;gap:8px;padding:8px 11px;border:1px solid var(--line);border-radius:999px;color:var(--muted);font-size:12px;white-space:nowrap}
.appearance-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.appearance-option{display:grid;grid-template-rows:auto auto;gap:14px;width:100%;padding:16px;text-align:left;color:var(--text);background:rgba(255,255,255,.035);border:1px solid var(--line);border-radius:18px;cursor:pointer;transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease,background .16s ease}
.appearance-option:hover{transform:translateY(-1px);border-color:rgba(232,168,63,.46)}
.appearance-option.is-selected{border-color:var(--amber);box-shadow:0 0 0 3px rgba(232,168,63,.12)}
.appearance-preview{display:grid;place-items:center;min-height:116px;padding:18px;border-radius:14px;border:1px solid rgba(255,255,255,.1);overflow:hidden}
.appearance-preview img{width:min(270px,90%);height:auto}
.appearance-preview.dark{background:#000}
.appearance-preview.light{background:#fff;border-color:rgba(24,38,30,.14)}
.appearance-option-copy{display:grid;gap:4px}.appearance-option-copy strong{font-size:16px}.appearance-option-copy span{color:var(--muted);font-size:12px;line-height:1.5}
html[data-theme="light"] .appearance-option{background:#f6f8f6;border-color:var(--line)}
html[data-theme="light"] .appearance-option.is-selected{background:#fff}

/* Customer-neutral delivery presentation. Internal carrier identities remain available to Admin only. */
.delivery-service-neutral{color:var(--text)}
.neutral-service-chip{display:inline-flex;align-items:center;padding:5px 9px;border-radius:999px;border:1px solid var(--line);background:rgba(127,183,255,.09);color:#b9d8ff;font-size:10px;font-weight:800}
html[data-theme="light"] .neutral-service-chip{background:#eaf2fb;color:#315f91}
.legend-truck.neutral{background:#4f5a54;border-color:#fff}
.wt-vehicle-marker.neutral span{background:#37423c;border-color:#dfe6e1;color:#fff}

@media(max-width:720px){.appearance-options{grid-template-columns:1fr}.appearance-heading{display:grid}}

/* Light-mode contrast hardening 011
   Use explicit surfaces and foregrounds where the original dark component styles
   used translucent white or hard-coded white text. */
html[data-theme="light"] :is(
  .delivery-list-card,.journey-workspace-card,.delivery-list-item,.manifest-journey-panel,
  .delivery-detail-modal,.customer-detail-card,.detail-item,.ops-summary,.ops-panel,
  .delivery-freight-section,.admin-delivery-details,.delivery-exception-admin
){color:#17201b}

html[data-theme="light"] .delivery-list-destination,
html[data-theme="light"] .delivery-list-vehicle{
  background:#e8ede9!important;border-color:#cbd4ce!important;color:#17201b!important;
}
html[data-theme="light"] .delivery-list-forecast>div{
  background:#f1f5f2!important;border-color:#cfd7d2!important;color:#17201b!important;
}
html[data-theme="light"] .delivery-forecast-primary{
  background:linear-gradient(145deg,#e9f3ff,#f8fbff)!important;
  border-color:#c6d9ee!important;
}
html[data-theme="light"] :is(
  .eta-window-value,.delivery-list-forecast strong,.delivery-list-destination strong,
  .delivery-list-vehicle strong,.manifest-stop-eta,.delivery-list-item-head h3,
  .customer-detail-card strong,.detail-item strong
){color:#17201b!important}
html[data-theme="light"] .eta-context{color:#48677f!important}
html[data-theme="light"] :is(
  .delivery-list-destination span,.delivery-list-item-head p,.delivery-list-forecast small,
  .delivery-list-forecast .small,.delivery-list-vehicle,.tracking-instruction,
  .manifest-stop-location,.manifest-stop-due,.manifest-stop-consignments
){color:#59675f!important}
html[data-theme="light"] .delivery-list-icon{background:#f7e7bd;color:#805407}
html[data-theme="light"] .delivery-list-actions{border-top-color:#d6ddd8}
html[data-theme="light"] .delivery-list-actions .btn,
html[data-theme="light"] .tracking-toolbar .btn,
html[data-theme="light"] .modal-actions .btn.secondary{
  background:#e7ece8;color:#18231c;border:1px solid #c5cec8;
  box-shadow:0 1px 0 rgba(255,255,255,.85);
}
html[data-theme="light"] .delivery-list-actions .btn:hover,
html[data-theme="light"] .tracking-toolbar .btn:hover,
html[data-theme="light"] .modal-actions .btn.secondary:hover{
  background:#dce4de;border-color:#aebbb2;color:#111a14;
}
html[data-theme="light"] .delivery-list-actions .manifest-action{
  background:#fff1c7;color:#684700;border-color:#d8b34d;
}
html[data-theme="light"] .delivery-list-actions .manifest-action:hover{background:#f8e3a8}
html[data-theme="light"] .telematics-chip.unavailable{
  background:#f8e3e3;color:#962f2f;border-color:#e5b2b2;
}
html[data-theme="light"] .telematics-chip.usable{
  background:#f8ecd5;color:#79500a;border-color:#dfc490;
}
html[data-theme="light"] .telematics-chip.fresh{
  background:#def2e4;color:#1e6b37;border-color:#a9d5b5;
}
html[data-theme="light"] .manifest-mini-label{background:#e8f1fb;color:#315f91;border-color:#c4d7ea}
html[data-theme="light"] .manifest-privacy-note{background:#edf5fb;color:#385b73;border-color:#caddea}
html[data-theme="light"] .manifest-stop-eta{color:#254c68!important}
html[data-theme="light"] .manifest-stop-number{background:#dce3de;color:#17201b}
html[data-theme="light"] .manifest-stop.current .manifest-stop-number{background:#e7c36c;color:#3c2a00}
html[data-theme="light"] .manifest-stop.selected .manifest-stop-number{background:#5b91bf;color:#fff}
html[data-theme="light"] .workspace-feature-card strong,
html[data-theme="light"] .appearance-option-copy strong{color:#17201b}
html[data-theme="light"] .workspace-feature-card small,
html[data-theme="light"] .workspace-feature-card span,
html[data-theme="light"] .appearance-option-copy span{color:#5f6b64}

@media(max-width:1100px){.theme-brand-logo{width:218px}}
@media(max-width:640px){.auth-brand .theme-brand-logo{width:210px;height:72px}}


/* Cross-dashboard button and status contrast in light mode. */
html[data-theme="light"] .btn.secondary{
  background:#e5ebe7;color:#17201b;border-color:#bdc8c1;
}
html[data-theme="light"] .btn.secondary:hover{background:#d9e2dc;color:#111914}
html[data-theme="light"] .metric-explainer{color:#536158}
html[data-theme="light"] .sp-button.primary,
html[data-theme="light"] .ex-button.primary{
  background:#2f9d57;color:#fff;border-color:#287f49;
}
html[data-theme="light"] .sp-button.primary:hover,
html[data-theme="light"] .ex-button.primary:hover{background:#277f48;color:#fff}
html[data-theme="light"] .sp-button.export,
html[data-theme="light"] .ex-button.export{
  background:#e5effa;color:#244f78;border-color:#b9d0e6;
}
html[data-theme="light"] .sp-button.ghost,
html[data-theme="light"] .sp-icon-button,
html[data-theme="light"] .ex-button:not(.primary):not(.export){
  background:#e8edea;color:#26332b;border-color:#c2ccc5;
}
html[data-theme="light"] .workspace-status.enabled,
html[data-theme="light"] .workspace-feature-card.is-enabled .workspace-feature-state{
  background:#dcefe2;color:#1d6a37;border-color:#a8d2b4;
}
html[data-theme="light"] .workspace-status.disabled,
html[data-theme="light"] .workspace-feature-card.is-disabled .workspace-feature-state{
  background:#f6dfdf;color:#963232;border-color:#e4b0b0;
}
html[data-theme="light"] .workspace-status.customised{background:#e4eef9;color:#315f91;border-color:#bdd1e5}
html[data-theme="light"] .workspace-status.inherited{background:#e9eeeb;color:#536159;border-color:#cbd4ce}
