
/* CORRECTO_WMS_DS02A_DASHBOARD_BRIDGE
   Dashboard-only semantic token compatibility.
   Existing business logic is untouched.
*/

html[data-theme="light"] .dashboard-v2,
html[data-theme="dark"] .dashboard-v2 {
  --d-bg: var(--wms-ui-bg);
  --d-card: var(--wms-ui-surface);
  --d-card2: var(--wms-ui-surface-2);
  --d-text: var(--wms-ui-text);
  --d-muted: var(--wms-ui-muted);
  --d-line: var(--wms-ui-border);
  --d-blue: var(--wms-ui-primary);
  --d-green: var(--wms-ui-success);
  --d-amber: var(--wms-ui-warning);
  --d-red: var(--wms-ui-danger);
  --d-shadow: var(--wms-ui-shadow);
}

/* CORRECTO_WMS_DS02B_DASHBOARD_TOKENS
   Map legacy dashboard tokens to central WMS theme.
   Dashboard only. No business logic changes.
*/
html[data-theme="light"] .dashboard-v2,
html[data-theme="dark"] .dashboard-v2 {
  --dash-panel: var(--wms-ui-surface);
  --dash-surface-2: var(--wms-ui-surface-2);
  --dash-muted: var(--wms-ui-muted);
  --dash-line: var(--wms-ui-border);
  --dash-blue: var(--wms-ui-primary);
}

/* CORRECTO_WMS_DS02C_DASHBOARD_CONTRAST
   Scoped to dashboard. Existing data and actions unchanged.
*/

/* Attention cards: readable in both themes */
html[data-theme="light"] .dashboard-v2 .attention-item {
  background: var(--wms-ui-surface-2);
  color: var(--wms-ui-text);
  border-color: var(--wms-ui-border);
}

html[data-theme="dark"] .dashboard-v2 .attention-item {
  background: var(--wms-ui-input);
  color: var(--wms-ui-text);
  border-color: var(--wms-ui-border);
}

/* Warning cards retain their semantic amber appearance */
html[data-theme="light"] .dashboard-v2 .attention-item.warning {
  background: var(--wms-ui-warning-bg, #ffffff) !important;
  color: var(--wms-ui-warning-text, #653900) !important;
  border-color: var(--wms-ui-warning-border, #e9a64b) !important;
}

html[data-theme="dark"] .dashboard-v2 .attention-item.warning {
  background: var(--wms-ui-warning-bg, #624018) !important;
  color: var(--wms-ui-warning-text, #fff2d9);
  border-color: var(--wms-ui-warning-border, #c48a36) !important;
}

/* Text inside attention cards follows its parent contrast */
html[data-theme="light"] .dashboard-v2 .attention-item span,
html[data-theme="light"] .dashboard-v2 .attention-item strong,
html[data-theme="dark"] .dashboard-v2 .attention-item span,
html[data-theme="dark"] .dashboard-v2 .attention-item strong {
  color: inherit;
}

/* Problem counter */
html[data-theme="light"] .dashboard-v2 .attention-total,
html[data-theme="dark"] .dashboard-v2 .attention-total {
  color: var(--wms-ui-text);
  border-color: var(--wms-ui-border);
  background: var(--wms-ui-surface-2);
}

/* Attention section headings */
html:not([data-theme="dark"]) .dashboard-v2 .attention-panel > header,
html[data-theme="dark"] .dashboard-v2 .attention-panel > header {
  background: transparent;
  color: var(--wms-ui-text);
  box-shadow: none;
}

html[data-theme="light"] .dashboard-v2 .attention-panel h2,
html[data-theme="dark"] .dashboard-v2 .attention-panel h2 {
  color: var(--wms-ui-heading);
}

/* Dashboard panel headers */
html[data-theme="light"] .dashboard-v2 .dash-panel > .panel-head,
html[data-theme="dark"] .dashboard-v2 .dash-panel > .panel-head {
  background: transparent;
  color: var(--wms-ui-text);
  border-color: var(--wms-ui-border);
}

html[data-theme="light"] .dashboard-v2 .dash-panel > .panel-head h2,
html[data-theme="dark"] .dashboard-v2 .dash-panel > .panel-head h2 {
  color: var(--wms-ui-heading);
}

html[data-theme="light"] .dashboard-v2 .dash-panel > .panel-head p,
html[data-theme="dark"] .dashboard-v2 .dash-panel > .panel-head p {
  color: var(--wms-ui-muted);
}

/* Maintain visibility during keyboard navigation */
.dashboard-v2 .attention-item:focus-visible,
.dashboard-v2 .shipment-status-card:focus-visible {
  outline: 3px solid var(--wms-ui-primary);
  outline-offset: 2px;
}
