/* ApexAlt enterprise visual layer. Existing behavior selectors remain in styles.css. */

:root,
html[data-theme="light"] {
  color-scheme: light;
  --alt-canvas: #f4f7fb;
  --alt-canvas-strong: #edf2f7;
  --alt-surface: #ffffff;
  --alt-surface-subtle: #f8fafc;
  --alt-surface-muted: #eef3f8;
  --alt-surface-hover: #f3f7fc;
  --alt-text: #0b1220;
  --alt-text-soft: #334155;
  --alt-muted: #64748b;
  --alt-border: #dce4ee;
  --alt-border-strong: #c8d3e0;
  --alt-primary: #2563eb;
  --alt-primary-hover: #1d4ed8;
  --alt-primary-solid: #2563eb;
  --alt-primary-solid-hover: #1d4ed8;
  --alt-primary-soft: #eaf2ff;
  --alt-primary-border: #b9d2ff;
  --alt-cyan: #0e7490;
  --alt-success: #0f766e;
  --alt-success-soft: #ecfdf8;
  --alt-success-border: #9ee5d1;
  --alt-warning: #a95c08;
  --alt-warning-soft: #fff8e8;
  --alt-warning-border: #efd28d;
  --alt-danger: #be123c;
  --alt-danger-soft: #fff1f4;
  --alt-danger-border: #f7b8c7;
  --alt-sidebar: #0b1426;
  --alt-sidebar-raised: #111d34;
  --alt-sidebar-text: #dce7f7;
  --alt-sidebar-muted: #8fa1b9;
  --alt-sidebar-border: rgba(255, 255, 255, 0.09);
  --alt-overlay: rgba(4, 10, 21, 0.58);
  --alt-focus: rgba(37, 99, 235, 0.24);
  --alt-shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --alt-shadow-sm: 0 8px 22px rgba(15, 23, 42, 0.06);
  --alt-shadow-md: 0 24px 60px rgba(15, 23, 42, 0.16);
  --alt-radius-sm: 5px;
  --alt-radius: 7px;
  --alt-radius-lg: 8px;

  --background: var(--alt-canvas);
  --foreground: var(--alt-text);
  --card: var(--alt-surface);
  --card-foreground: var(--alt-text);
  --primary: var(--alt-primary);
  --primary-foreground: #ffffff;
  --secondary: var(--alt-surface-muted);
  --secondary-foreground: var(--alt-text);
  --card-subtle: var(--alt-surface-subtle);
  --muted-surface: var(--alt-surface-muted);
  --muted-foreground: var(--alt-muted);
  --accent-surface: var(--alt-primary-soft);
  --accent-foreground: var(--alt-primary-hover);
  --border: var(--alt-border);
  --input: var(--alt-border-strong);
  --ring: var(--alt-primary);
  --navy: var(--alt-sidebar);
  --navy-2: var(--alt-sidebar-raised);
  --success: var(--alt-success);
  --success-surface: var(--alt-success-soft);
  --warning: var(--alt-warning);
  --warning-surface: var(--alt-warning-soft);
  --destructive: var(--alt-danger);
  --bg: var(--alt-canvas);
  --surface: var(--alt-surface);
  --surface-2: var(--alt-surface-subtle);
  --ink: var(--alt-text);
  --muted: var(--alt-muted);
  --line: var(--alt-border);
  --brand: var(--alt-primary);
  --brand-2: var(--alt-sidebar);
  --accent: var(--alt-primary);
  --danger: var(--alt-danger);
  --ok: var(--alt-success);
  --row-risk: var(--alt-danger);
  --row-watch: var(--alt-warning);
  --row-steady: var(--alt-success);
  --ice: var(--alt-primary-soft);

  --apex-app-navy: var(--alt-text);
  --apex-app-blue: var(--alt-primary);
  --apex-app-blue-dark: var(--alt-primary-hover);
  --apex-app-ice: var(--alt-primary-soft);
  --apex-app-cyan: var(--alt-cyan);
  --apex-app-border: var(--alt-border);
  --apex-app-muted: var(--alt-muted);
  --apex-app-soft-blue: var(--alt-primary-soft);
  --apex-app-shadow: var(--alt-shadow-sm);
  --apex-app-panel-shadow: var(--alt-shadow-sm);
  --apex-app-table-shadow: var(--alt-shadow-xs);

  --ui-background: var(--alt-canvas);
  --ui-foreground: var(--alt-text);
  --ui-card: var(--alt-surface);
  --ui-card-foreground: var(--alt-text);
  --ui-popover: var(--alt-surface);
  --ui-popover-foreground: var(--alt-text);
  --ui-primary: var(--alt-primary);
  --ui-primary-hover: var(--alt-primary-hover);
  --ui-primary-foreground: #ffffff;
  --ui-secondary: var(--alt-surface-muted);
  --ui-secondary-foreground: var(--alt-text);
  --ui-muted: var(--alt-surface-muted);
  --ui-muted-foreground: var(--alt-muted);
  --ui-accent: var(--alt-primary-soft);
  --ui-accent-foreground: var(--alt-primary-hover);
  --ui-destructive: var(--alt-danger);
  --ui-warning: var(--alt-warning);
  --ui-success: var(--alt-success);
  --ui-border: var(--alt-border);
  --ui-input: var(--alt-border-strong);
  --ui-ring: var(--alt-focus);
  --ui-radius-sm: var(--alt-radius-sm);
  --ui-radius-md: var(--alt-radius);
  --ui-radius-lg: var(--alt-radius-lg);
  --ui-radius-xl: var(--alt-radius-lg);
  --ui-shadow-sm: var(--alt-shadow-xs);
  --ui-shadow-md: var(--alt-shadow-sm);
  --ui-shadow-lg: var(--alt-shadow-md);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --alt-canvas: #0a0f1a;
  --alt-canvas-strong: #080d16;
  --alt-surface: #111827;
  --alt-surface-subtle: #0f1726;
  --alt-surface-muted: #172033;
  --alt-surface-hover: #19243a;
  --alt-text: #f1f5f9;
  --alt-text-soft: #cbd5e1;
  --alt-muted: #98a7ba;
  --alt-border: #273449;
  --alt-border-strong: #3a4a62;
  --alt-primary: #3b82f6;
  --alt-primary-hover: #60a5fa;
  --alt-primary-solid: #2563eb;
  --alt-primary-solid-hover: #1d4ed8;
  --alt-primary-soft: rgba(59, 130, 246, 0.14);
  --alt-primary-border: rgba(96, 165, 250, 0.38);
  --alt-cyan: #67e8f9;
  --alt-success: #5eead4;
  --alt-success-soft: rgba(20, 184, 166, 0.12);
  --alt-success-border: rgba(94, 234, 212, 0.34);
  --alt-warning: #fbbf24;
  --alt-warning-soft: rgba(245, 158, 11, 0.12);
  --alt-warning-border: rgba(251, 191, 36, 0.34);
  --alt-danger: #fb7185;
  --alt-danger-soft: rgba(244, 63, 94, 0.12);
  --alt-danger-border: rgba(251, 113, 133, 0.34);
  --alt-sidebar: #070b12;
  --alt-sidebar-raised: #0d1421;
  --alt-sidebar-text: #e5edf8;
  --alt-sidebar-muted: #8290a4;
  --alt-sidebar-border: rgba(255, 255, 255, 0.08);
  --alt-overlay: rgba(0, 0, 0, 0.68);
  --alt-focus: rgba(96, 165, 250, 0.3);
  --alt-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
  --alt-shadow-sm: 0 12px 28px rgba(0, 0, 0, 0.22);
  --alt-shadow-md: 0 28px 72px rgba(0, 0, 0, 0.42);
}

* {
  scrollbar-color: var(--alt-border-strong) transparent;
}

html {
  background: var(--alt-canvas);
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--alt-canvas) !important;
  color: var(--alt-text);
  font-family: Inter, "SF Pro Text", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  transition: background-color 180ms ease, color 180ms ease;
}

::selection {
  background: var(--alt-primary-soft);
  color: var(--alt-text);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

h1,
h2,
h3,
h4,
strong {
  color: var(--alt-text);
}

p,
small,
.cell-sub,
.field-hint,
.muted-copy {
  color: var(--alt-muted);
}

button,
a,
input,
select,
textarea,
summary {
  touch-action: manipulation;
}

button,
.clickable-row,
.bucket,
.mini-record-row,
.related-load-option,
summary {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
.ui-button:focus-visible {
  outline: 2px solid var(--alt-primary) !important;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--alt-focus) !important;
}

/* Application shell */
.app-shell,
.ui-app-shell {
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100dvh;
  background: var(--alt-canvas);
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 76px minmax(0, 1fr);
}

.sidebar,
.ui-sidebar {
  height: 100dvh;
  padding: 14px 12px;
  border-right: 1px solid var(--alt-sidebar-border);
  background: var(--alt-sidebar);
  color: var(--alt-sidebar-text);
  box-shadow: none;
}

.brand {
  min-height: 54px;
  justify-content: flex-start;
  padding: 2px 8px 12px;
  border-bottom: 1px solid var(--alt-sidebar-border);
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 7px;
  background: #ffffff;
  padding: 5px;
  box-shadow: none;
}

.nav-list,
.ui-sidebar-menu {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  margin: 14px 0;
}

.nav-item,
.ui-sidebar-menu-button {
  position: relative;
  min-height: 40px;
  padding: 8px 10px;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--alt-sidebar-muted);
  font-size: 13px;
  font-weight: 550;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.nav-item::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 9px;
  bottom: 9px;
  width: 2px;
  border-radius: 2px;
  background: transparent;
}

.nav-item .nav-icon {
  width: 22px;
  height: 22px;
  flex-basis: 22px;
  border-radius: 5px;
  background: transparent;
  color: currentColor;
}

.nav-item .nav-icon svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.75;
}

.nav-item:hover,
.nav-item.active {
  border-color: rgba(96, 165, 250, 0.12);
  background: rgba(59, 130, 246, 0.12);
  color: #f8fbff;
}

.nav-item.active::before {
  background: #60a5fa;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
  background: rgba(96, 165, 250, 0.14);
  color: #bfdbfe;
}

.sidebar-toggle {
  min-height: 40px;
  margin-top: auto;
  padding: 8px 10px;
  border: 1px solid var(--alt-sidebar-border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--alt-sidebar-muted);
  font-size: 12px;
  box-shadow: none;
}

.sidebar-toggle:hover {
  border-color: rgba(96, 165, 250, 0.2);
  background: rgba(59, 130, 246, 0.1);
  color: #ffffff;
}

.app-shell.sidebar-collapsed .sidebar {
  padding-inline: 10px;
}

.app-shell.sidebar-collapsed .brand {
  justify-content: center;
  padding-inline: 0;
}

.app-shell.sidebar-collapsed .nav-item {
  padding: 8px;
}

.main,
.ui-main {
  min-width: 0;
  padding: 0 20px 24px;
  background: var(--alt-canvas);
}

.topbar,
.ui-topbar {
  min-height: 58px;
  margin: 0 0 14px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--alt-border);
  background: var(--alt-canvas);
  box-shadow: none;
  backdrop-filter: none;
}

.topbar-actions {
  width: 100%;
  justify-content: flex-end;
  gap: 8px;
  padding: 0;
}

.topbar .search,
.topbar .ui-select,
.topbar .reminder-button,
.topbar .theme-toggle {
  min-height: 40px;
  border: 1px solid var(--alt-border-strong);
  border-radius: 6px;
  background: var(--alt-surface);
  color: var(--alt-text-soft);
  box-shadow: var(--alt-shadow-xs);
}

.topbar .search {
  width: min(360px, 36vw);
  padding: 0 10px;
  gap: 8px;
}

.search-icon,
.theme-icon,
.icon-button svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  color: var(--alt-muted);
}

.topbar .search input {
  width: 100%;
  min-height: 38px;
  padding: 0;
  color: var(--alt-text);
  font-size: 13px;
}

.topbar .ui-select-wrap {
  width: 148px;
}

.topbar .ui-select {
  padding-inline: 10px 28px;
  font-size: 13px;
  font-weight: 600;
}

.topbar .reminder-button,
.topbar .theme-toggle {
  width: 40px;
  min-width: 40px;
  padding: 0;
}

.topbar .reminder-button:hover,
.topbar .theme-toggle:hover {
  border-color: var(--alt-primary-border);
  background: var(--alt-primary-soft);
  color: var(--alt-primary);
}

.theme-icon {
  width: 18px;
  height: 18px;
}

html[data-theme="light"] .theme-icon-sun,
html[data-theme="dark"] .theme-icon-moon {
  display: none;
}

/* Controls */
.ui-button,
.primary-action,
.secondary-action,
.compact-action,
.text-button,
.icon-button {
  min-height: 40px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
  box-shadow: none;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.ui-button-primary,
.primary-action,
.view > .section-heading .primary-action,
.board-command .primary-action {
  border: 1px solid var(--alt-primary-solid);
  background: var(--alt-primary-solid);
  color: #ffffff;
  box-shadow: 0 5px 14px rgba(37, 99, 235, 0.16);
}

.ui-button-primary:hover,
.primary-action:hover,
.board-command .primary-action:hover {
  border-color: var(--alt-primary-solid-hover);
  background: var(--alt-primary-solid-hover);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.2);
  transform: none;
}

.ui-button-outline,
.secondary-action,
.compact-action,
.text-button,
.icon-button {
  border: 1px solid var(--alt-border-strong);
  background: var(--alt-surface);
  color: var(--alt-text-soft);
  box-shadow: none;
}

.ui-button-outline:hover,
.secondary-action:hover,
.compact-action:hover,
.text-button:hover,
.icon-button:hover {
  border-color: var(--alt-primary-border);
  background: var(--alt-primary-soft);
  color: var(--alt-primary);
  transform: none;
}

button:disabled,
.ui-button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

input,
textarea,
.ui-input-shell,
.ui-form input,
.ui-form textarea,
.ui-select,
.table-search,
.search,
.filters-modal input,
.modal input,
.modal textarea {
  border: 1px solid var(--alt-border-strong);
  border-radius: 6px;
  background: var(--alt-surface);
  color: var(--alt-text);
  box-shadow: none;
}

input,
.ui-select {
  min-height: 40px;
}

input::placeholder,
textarea::placeholder {
  color: var(--alt-muted);
  opacity: 0.84;
}

.ui-input-shell:focus-within,
.search:focus-within,
.table-search:focus-within,
.ui-form input:focus,
.ui-form textarea:focus,
.filters-modal input:focus,
.modal input:focus,
.ui-select:focus,
.modal textarea:focus {
  border-color: var(--alt-primary);
  box-shadow: 0 0 0 3px var(--alt-focus);
}

/* Page hierarchy */
.view,
.ui-page {
  color: var(--alt-text);
}

.section-heading,
.ui-page-header,
.board-command,
.ui-command-header,
#dashboard-view .board-command,
#load-board-view .board-command,
.view:not(#load-board-view) > .section-heading {
  overflow: hidden;
  border: 1px solid var(--alt-border);
  border-top: 1px solid var(--alt-border);
  border-radius: 8px;
  background: var(--alt-surface);
  color: var(--alt-text);
  box-shadow: var(--alt-shadow-xs);
}

.section-heading,
.ui-page-header {
  min-height: 88px;
  padding: 16px 18px;
}

.board-command-main,
#dashboard-view .board-command-main,
#load-board-view .board-command-main {
  gap: 12px;
  padding: 17px 18px 18px;
}

.board-command-title,
#load-board-view .board-command-title {
  align-items: flex-start;
  gap: 16px;
}

.board-command-title h2,
#dashboard-view .board-command-title h2,
#load-board-view .board-command-title h2,
.view:not(#load-board-view) > .section-heading h2 {
  margin-bottom: 4px;
  color: var(--alt-text);
  font-size: 24px;
  font-weight: 720;
  line-height: 1.18;
  letter-spacing: 0;
}

.board-command-title p,
#dashboard-view .board-command-title p,
#load-board-view .board-command-title p,
.view:not(#load-board-view) > .section-heading p {
  max-width: 900px;
  margin-bottom: 0;
  color: var(--alt-muted);
  font-size: 13px;
  line-height: 1.45;
}

.board-kicker,
#dashboard-view .board-kicker,
#load-board-view .board-kicker,
.eyebrow {
  margin-bottom: 2px;
  border: 0;
  background: transparent;
  color: var(--alt-cyan);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.board-signal-grid,
.ui-metric-grid,
#dashboard-view .board-signal-grid,
#load-board-view .board-signal-grid.balanced-stats {
  gap: 8px;
}

.metric-card,
.board-signal,
.board-focus-card,
.summary-item,
.report-stat-card,
.info-tile {
  position: relative;
  min-height: 88px;
  overflow: hidden;
  border: 1px solid var(--alt-border);
  border-radius: 7px;
  background: var(--alt-surface-subtle);
  color: var(--alt-text);
  box-shadow: none;
}

.board-signal,
#dashboard-view .board-signal,
#load-board-view .board-signal {
  display: grid;
  align-content: center;
  gap: 2px;
  min-height: 88px;
  padding: 12px 14px;
  text-align: left;
}

.board-signal::before,
#load-board-view .board-signal::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  height: auto;
  border: 0;
  border-radius: 0;
  background: var(--alt-primary);
}

.board-signal::after,
#load-board-view .board-signal::after {
  display: none;
}

.board-signal.critical::before {
  background: var(--alt-danger);
}

.board-signal.watch::before {
  background: var(--alt-warning);
}

.board-signal.ready::before {
  background: var(--alt-success);
}

.board-signal:hover,
#dashboard-view .board-signal:hover,
#load-board-view .board-signal:hover,
.board-focus-card:hover {
  border-color: var(--alt-border-strong);
  background: var(--alt-surface-hover);
  box-shadow: none;
  transform: none;
}

.board-signal.critical,
#load-board-view .board-signal.critical {
  border-color: var(--alt-danger-border);
  background: var(--alt-danger-soft);
}

.board-signal.watch,
#load-board-view .board-signal.watch {
  border-color: var(--alt-warning-border);
  background: var(--alt-warning-soft);
}

.board-signal.ready,
#load-board-view .board-signal.ready {
  border-color: var(--alt-success-border);
  background: var(--alt-success-soft);
}

.board-signal span,
#dashboard-view .board-signal span,
#load-board-view .board-signal span,
.board-focus-card span,
.summary-item span,
.report-stat-card span {
  color: var(--alt-muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.board-signal strong,
#dashboard-view .board-signal strong,
#load-board-view .board-signal strong {
  color: var(--alt-text);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.board-signal small,
#dashboard-view .board-signal small,
#load-board-view .board-signal small,
.board-focus-card small {
  color: var(--alt-muted);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.35;
}

.board-focus-card,
#load-board-view .board-focus-card {
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 88px;
  padding: 12px 14px;
}

.board-focus-card strong,
#load-board-view .board-focus-card strong {
  color: var(--alt-text);
  font-size: 14px;
  line-height: 1.3;
}

.board-work-strip,
.ui-work-cue-grid,
#dashboard-view .board-work-strip,
#load-board-view .board-work-strip {
  gap: 8px;
  margin-top: 8px;
}

.work-item,
.work-cue-card,
#dashboard-view .work-item,
#load-board-view .board-work-strip .work-item {
  min-height: 70px;
  padding: 10px 12px;
  border: 1px solid var(--alt-border);
  border-left: 3px solid var(--alt-primary);
  border-radius: 7px;
  background: var(--alt-surface);
  color: var(--alt-text);
  box-shadow: none;
}

.work-item.attention {
  border-left-color: var(--alt-danger);
}

.work-item.money {
  border-left-color: var(--alt-success);
}

.work-item span,
#dashboard-view .work-item span,
#load-board-view .work-item span {
  color: var(--alt-muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.work-item strong,
#dashboard-view .work-item strong,
#load-board-view .work-item strong {
  color: var(--alt-text);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
}

.work-item small,
#dashboard-view .work-item small,
#load-board-view .work-item small {
  color: var(--alt-muted);
  font-size: 11.5px;
  line-height: 1.25;
}

.work-grid {
  gap: 10px;
  margin-top: 10px;
}

.panel,
.settings-section,
.report-panel,
.form-section,
.ui-form-section,
.detail-tabs .panel,
.billing-detail-grid .panel,
.filter-sections section,
.config-content section,
.fit-check-panel,
.movement-card,
.mini-record-row,
.timeline-item,
.copy-field-row,
.related-load-option,
.mini-card,
.check-option,
.column-order-list li,
.bol-drop-zone,
.ui-card {
  border: 1px solid var(--alt-border);
  border-radius: 7px;
  background: var(--alt-surface);
  color: var(--alt-text);
  box-shadow: var(--alt-shadow-xs);
}

.panel-header,
.ui-card-header {
  border-color: var(--alt-border);
}

.panel-header h3,
.modal .panel-header h3,
.detail-tabs .panel-header h3,
.billing-detail-grid .panel-header h3,
.report-panel .panel-header h3,
.form-section h4,
.filter-sections h4,
.config-content h4 {
  color: var(--alt-text);
  font-weight: 680;
}

.bucket,
.reminder-item {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--alt-text-soft);
}

.bucket:hover,
.reminder-item:hover {
  border-color: var(--alt-border);
  background: var(--alt-surface-hover);
}

/* Data tables */
.table-toolbar,
.data-table-toolbar,
#load-board-view .table-toolbar {
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--alt-border);
  border-radius: 8px 8px 0 0;
  background: var(--alt-surface);
  color: var(--alt-text);
  box-shadow: var(--alt-shadow-xs);
}

.view-switch,
#load-board-view .view-switch {
  padding: 3px;
  border: 1px solid var(--alt-border);
  border-radius: 6px;
  background: var(--alt-surface-muted);
}

.view-switch .filter-chip,
#load-board-view .view-switch .filter-chip,
.ui-tabs-trigger,
.filter-chip {
  min-height: 34px;
  padding-inline: 11px;
  border-radius: 4px;
  color: var(--alt-muted);
  font-size: 12px;
  font-weight: 650;
}

.view-switch .filter-chip.active,
#load-board-view .view-switch .filter-chip.active,
.ui-tabs-trigger.active,
.filter-chip.active {
  background: var(--alt-surface);
  color: var(--alt-text);
  box-shadow: var(--alt-shadow-xs);
}

.table-search,
#load-board-view .table-search {
  min-height: 40px;
  border-color: var(--alt-border-strong);
  border-radius: 6px;
  background: var(--alt-surface);
}

.selection-action-bar,
.data-table-selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--enterprise-primary-line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: var(--enterprise-primary-soft);
  color: var(--enterprise-text);
}

.selection-action-bar[hidden],
.data-table-selection-bar[hidden] {
  display: none;
}

.selection-action-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.selection-action-copy strong {
  color: var(--enterprise-text);
  font-size: 13px;
  font-weight: 750;
}

.selection-action-copy span {
  color: var(--enterprise-muted);
  font-size: 12px;
}

.selection-action-buttons {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.selection-action-bar:not([hidden]) + .table-shell,
.data-table-selection-bar:not([hidden]) + .data-table-shell {
  border-top-color: var(--enterprise-primary-line);
  border-radius: 0 0 8px 8px;
}

.table-shell,
.data-table-shell,
#load-board-view .table-shell {
  overflow: auto;
  border: 1px solid var(--alt-border);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: var(--alt-surface);
  box-shadow: var(--alt-shadow-xs);
}

.table-shell table,
.data-table,
.load-table,
.billing-table,
.customer-table,
.carrier-table,
#load-board-view .load-table {
  border-collapse: separate;
  border-spacing: 0;
  background: var(--alt-surface);
  color: var(--alt-text);
}

.table-shell thead th,
.data-table thead th,
.data-table-head,
#load-board-view .load-table thead th,
.billing-copy-table th {
  height: 38px;
  border-bottom: 1px solid var(--alt-border);
  background: var(--alt-surface-muted);
  color: var(--alt-muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sortable-header {
  color: var(--alt-muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.table-shell tbody td,
.data-table tbody td,
.data-table-cell,
#load-board-view .load-table tbody td {
  min-height: 48px;
  padding-block: 10px;
  border-bottom: 1px solid var(--alt-border);
  background: var(--alt-surface);
  color: var(--alt-text-soft);
  font-size: 12.5px;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}

.table-shell tbody tr:last-child td,
.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.table-shell tbody tr:hover td,
.data-table tbody tr:hover td,
.data-table-row:hover .data-table-cell,
#load-board-view .load-table tbody tr:hover td {
  border-color: var(--alt-border);
  background: var(--alt-surface-hover);
  box-shadow: none;
}

.load-table tbody tr.selected td,
#load-board-view .load-table tbody tr.selected td {
  background: var(--alt-primary-soft);
}

.cell-sub {
  font-size: 11px;
  line-height: 1.35;
}

.table-footer,
.data-table-footer,
#load-board-view .table-footer {
  min-height: 44px;
  margin-top: 8px;
  padding: 7px 10px;
  border: 1px solid var(--alt-border);
  border-radius: 7px;
  background: var(--alt-surface);
  color: var(--alt-muted);
  box-shadow: var(--alt-shadow-xs);
  font-size: 12px;
}

.table-footer .ui-select {
  min-height: 32px;
}

.table-footer,
.data-table-footer,
#load-board-view .table-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: nowrap;
}

.table-footer > span,
.data-table-footer > span,
#load-board-view .table-footer > span {
  margin-right: auto;
  white-space: nowrap;
}

.table-footer label,
.data-table-footer label,
#load-board-view .table-footer label {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  min-width: max-content;
  margin: 0;
  white-space: nowrap;
}

.table-footer .ui-select-wrap,
.data-table-footer .ui-select-wrap,
#load-board-view .table-footer .ui-select-wrap,
.table-footer .ui-select,
.data-table-footer .ui-select,
#load-board-view .table-footer .ui-select {
  flex: 0 0 92px;
  width: 92px;
  min-width: 92px;
  max-width: 92px;
  padding-right: 24px;
}

.pagination-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.pill,
.status-pill,
.priority-pill,
.risk-pill,
.readiness-badge,
.status-badge,
#load-board-view .pill,
#load-board-view .status-pill,
#load-board-view .priority-pill,
#load-board-view .risk-pill {
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid var(--alt-border);
  border-radius: 999px;
  background: var(--alt-surface-muted);
  color: var(--alt-text-soft);
  font-size: 10.5px;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: 0;
  box-shadow: none;
}

.pill.move,
.status-pill.active,
.status-badge.move,
#load-board-view .pill.move {
  border-color: var(--alt-primary-border);
  background: var(--alt-primary-soft);
  color: var(--alt-primary);
}

.pill.attention,
.pill.issue,
.risk-pill.high,
.priority-pill.high,
.readiness-badge.needed,
.status-badge.issue,
.status-badge.attention,
#load-board-view .pill.issue,
#load-board-view .risk-pill.high,
#load-board-view .priority-pill.high {
  border-color: var(--alt-danger-border);
  background: var(--alt-danger-soft);
  color: var(--alt-danger);
}

.pill.warn,
.pill.billing,
.risk-pill.medium,
.priority-pill.medium,
.readiness-badge.review,
.status-badge.warn,
.status-badge.billing,
#load-board-view .pill.warn,
#load-board-view .risk-pill.medium,
#load-board-view .priority-pill.medium {
  border-color: var(--alt-warning-border);
  background: var(--alt-warning-soft);
  color: var(--alt-warning);
}

.pill.ok,
.pill.ready,
.risk-pill.low,
.priority-pill.low,
.readiness-badge.ready,
.readiness-badge.not-blocking,
.status-badge.ok,
.status-badge.ready,
#load-board-view .pill.ready,
#load-board-view .risk-pill.low,
#load-board-view .priority-pill.low {
  border-color: var(--alt-success-border);
  background: var(--alt-success-soft);
  color: var(--alt-success);
}

/* Dialogs and secondary surfaces */
.modal-backdrop,
.ui-dialog-overlay {
  background: var(--alt-overlay);
  backdrop-filter: blur(3px);
}

.modal,
.wide-modal,
.detail-modal,
.billing-detail-modal,
.ui-dialog-content,
#load-contact-modal-backdrop .modal,
#load-document-modal-backdrop .modal,
#location-modal-backdrop .modal {
  border: 1px solid var(--alt-border);
  border-top: 1px solid var(--alt-border);
  border-radius: 8px;
  background: var(--alt-surface);
  color: var(--alt-text);
  box-shadow: var(--alt-shadow-md);
}

.modal > .panel-header:first-child,
.detail-modal > .panel-header:first-child,
.wide-modal > .panel-header:first-child {
  border-bottom: 1px solid var(--alt-border);
  border-radius: 8px 8px 0 0;
  background: var(--alt-surface);
}

.detail-header,
.ui-detail-header {
  border: 1px solid var(--alt-border);
  border-top: 1px solid var(--alt-border);
  border-radius: 8px;
  background: var(--alt-surface);
  color: var(--alt-text);
  box-shadow: var(--alt-shadow-xs);
}

.row-context-menu,
.row-action-popover,
.ui-dropdown-content,
.column-menu,
.popover,
.drawer {
  border: 1px solid var(--alt-border);
  border-radius: 7px;
  background: var(--alt-surface);
  color: var(--alt-text);
  box-shadow: var(--alt-shadow-sm);
}

.row-context-menu button,
.row-action-popover button,
.column-menu button {
  color: var(--alt-text-soft);
}

.row-context-menu button:hover,
.row-action-popover button:hover,
.column-menu button:hover {
  background: var(--alt-surface-hover);
  color: var(--alt-text);
}

.config-sidebar,
.wizard-sidebar,
.detail-tabs {
  border-color: var(--alt-border);
  background: var(--alt-surface-subtle);
  color: var(--alt-text);
}

.trend-chart {
  border: 1px solid var(--alt-border);
  border-radius: 7px;
  background: var(--alt-surface);
  box-shadow: none;
}

.trend-chart span {
  border-radius: 3px 3px 0 0;
  background: var(--alt-primary);
  box-shadow: none;
}

/* Dark mode needs explicit overrides for legacy hard-coded surfaces. */
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .ui-sidebar {
  background: var(--alt-sidebar);
}

html[data-theme="dark"] #load-board-view {
  --lb-background: var(--alt-canvas);
  --lb-foreground: var(--alt-text);
  --lb-card: var(--alt-surface);
  --lb-card-foreground: var(--alt-text);
  --lb-muted: var(--alt-muted);
  --lb-muted-foreground: var(--alt-muted);
  --lb-primary: var(--alt-primary);
  --lb-primary-hover: var(--alt-primary-hover);
  --lb-primary-foreground: #ffffff;
  --lb-border: var(--alt-border);
  --lb-input: var(--alt-border-strong);
  --lb-ring: var(--alt-focus);
  --lb-accent: var(--alt-surface-muted);
  --lb-accent-foreground: var(--alt-text);
  --lb-destructive: var(--alt-danger);
  --lb-warning: var(--alt-warning);
  --lb-success: var(--alt-success);
}

html[data-theme="dark"] .topbar .search,
html[data-theme="dark"] .topbar .ui-select,
html[data-theme="dark"] .topbar .reminder-button,
html[data-theme="dark"] .topbar .theme-toggle,
html[data-theme="dark"] .section-heading,
html[data-theme="dark"] .ui-page-header,
html[data-theme="dark"] .board-command,
html[data-theme="dark"] .ui-command-header,
html[data-theme="dark"] #dashboard-view .board-command,
html[data-theme="dark"] #load-board-view .board-command,
html[data-theme="dark"] .view:not(#load-board-view) > .section-heading,
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .board-signal,
html[data-theme="dark"] .board-focus-card,
html[data-theme="dark"] .summary-item,
html[data-theme="dark"] .report-stat-card,
html[data-theme="dark"] .info-tile,
html[data-theme="dark"] .work-item,
html[data-theme="dark"] .work-cue-card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .settings-section,
html[data-theme="dark"] .report-panel,
html[data-theme="dark"] .form-section,
html[data-theme="dark"] .ui-form-section,
html[data-theme="dark"] .detail-tabs .panel,
html[data-theme="dark"] .billing-detail-grid .panel,
html[data-theme="dark"] .filter-sections section,
html[data-theme="dark"] .config-content section,
html[data-theme="dark"] .fit-check-panel,
html[data-theme="dark"] .movement-card,
html[data-theme="dark"] .mini-record-row,
html[data-theme="dark"] .timeline-item,
html[data-theme="dark"] .copy-field-row,
html[data-theme="dark"] .related-load-option,
html[data-theme="dark"] .mini-card,
html[data-theme="dark"] .check-option,
html[data-theme="dark"] .column-order-list li,
html[data-theme="dark"] .bol-drop-zone,
html[data-theme="dark"] .ui-card,
html[data-theme="dark"] .table-toolbar,
html[data-theme="dark"] .data-table-toolbar,
html[data-theme="dark"] #load-board-view .table-toolbar,
html[data-theme="dark"] .table-shell,
html[data-theme="dark"] .data-table-shell,
html[data-theme="dark"] #load-board-view .table-shell,
html[data-theme="dark"] .table-footer,
html[data-theme="dark"] .data-table-footer,
html[data-theme="dark"] #load-board-view .table-footer,
html[data-theme="dark"] .modal,
html[data-theme="dark"] .wide-modal,
html[data-theme="dark"] .detail-modal,
html[data-theme="dark"] .billing-detail-modal,
html[data-theme="dark"] .ui-dialog-content,
html[data-theme="dark"] .modal > .panel-header:first-child,
html[data-theme="dark"] .detail-modal > .panel-header:first-child,
html[data-theme="dark"] .wide-modal > .panel-header:first-child,
html[data-theme="dark"] .detail-header,
html[data-theme="dark"] .ui-detail-header,
html[data-theme="dark"] .row-context-menu,
html[data-theme="dark"] .row-action-popover,
html[data-theme="dark"] .ui-dropdown-content,
html[data-theme="dark"] .column-menu,
html[data-theme="dark"] .popover,
html[data-theme="dark"] .drawer,
html[data-theme="dark"] .trend-chart {
  border-color: var(--alt-border);
  background: var(--alt-surface);
  color: var(--alt-text);
}

html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .board-signal,
html[data-theme="dark"] .board-focus-card,
html[data-theme="dark"] .summary-item,
html[data-theme="dark"] .report-stat-card,
html[data-theme="dark"] .info-tile,
html[data-theme="dark"] .config-sidebar,
html[data-theme="dark"] .wizard-sidebar,
html[data-theme="dark"] .detail-tabs {
  background: var(--alt-surface-subtle);
}

html[data-theme="dark"] .board-signal.critical,
html[data-theme="dark"] #load-board-view .board-signal.critical {
  border-color: var(--alt-danger-border);
  background: var(--alt-danger-soft);
}

html[data-theme="dark"] .board-signal.watch,
html[data-theme="dark"] #load-board-view .board-signal.watch {
  border-color: var(--alt-warning-border);
  background: var(--alt-warning-soft);
}

html[data-theme="dark"] .board-signal.ready,
html[data-theme="dark"] #load-board-view .board-signal.ready {
  border-color: var(--alt-success-border);
  background: var(--alt-success-soft);
}

html[data-theme="dark"] .table-shell table,
html[data-theme="dark"] .data-table,
html[data-theme="dark"] .load-table,
html[data-theme="dark"] .billing-table,
html[data-theme="dark"] .customer-table,
html[data-theme="dark"] .carrier-table,
html[data-theme="dark"] #load-board-view .load-table,
html[data-theme="dark"] .table-shell tbody td,
html[data-theme="dark"] .data-table tbody td,
html[data-theme="dark"] .data-table-cell,
html[data-theme="dark"] #load-board-view .load-table tbody td {
  background: var(--alt-surface);
  color: var(--alt-text-soft);
}

html[data-theme="dark"] .table-shell thead th,
html[data-theme="dark"] .data-table thead th,
html[data-theme="dark"] .data-table-head,
html[data-theme="dark"] #load-board-view .load-table thead th,
html[data-theme="dark"] .billing-copy-table th {
  border-color: var(--alt-border);
  background: var(--alt-surface-muted);
  color: var(--alt-muted);
}

html[data-theme="dark"] .table-shell tbody tr:hover td,
html[data-theme="dark"] .data-table tbody tr:hover td,
html[data-theme="dark"] .data-table-row:hover .data-table-cell,
html[data-theme="dark"] #load-board-view .load-table tbody tr:hover td {
  background: var(--alt-surface-hover);
}

html[data-theme="dark"] .load-table tbody tr.selected td,
html[data-theme="dark"] #load-board-view .load-table tbody tr.selected td {
  background: var(--alt-primary-soft);
}

html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .ui-select,
html[data-theme="dark"] .ui-input-shell,
html[data-theme="dark"] .table-search,
html[data-theme="dark"] .search,
html[data-theme="dark"] .view-switch,
html[data-theme="dark"] #load-board-view .view-switch {
  border-color: var(--alt-border-strong);
  background: var(--alt-surface);
  color: var(--alt-text);
}

html[data-theme="dark"] .view-switch,
html[data-theme="dark"] #load-board-view .view-switch {
  background: var(--alt-surface-muted);
}

html[data-theme="dark"] .view-switch .filter-chip.active,
html[data-theme="dark"] #load-board-view .view-switch .filter-chip.active,
html[data-theme="dark"] .ui-tabs-trigger.active,
html[data-theme="dark"] .filter-chip.active {
  background: var(--alt-surface);
  color: var(--alt-text);
}

html[data-theme="dark"] #dashboard-view .board-signal,
html[data-theme="dark"] #dashboard-view .metric-card,
html[data-theme="dark"] #dashboard-view .panel,
html[data-theme="dark"] #dashboard-view .bucket,
html[data-theme="dark"] #dashboard-view .reminder-item,
html[data-theme="dark"] #load-board-view .board-signal,
html[data-theme="dark"] #load-board-view .board-focus-card {
  border-color: var(--alt-border) !important;
  background: var(--alt-surface-subtle) !important;
  background-image: none !important;
  color: var(--alt-text) !important;
}

html[data-theme="dark"] #dashboard-view .board-signal.critical,
html[data-theme="dark"] #load-board-view .board-signal.critical {
  border-color: var(--alt-danger-border) !important;
  background: var(--alt-danger-soft) !important;
}

html[data-theme="dark"] #dashboard-view .board-signal.watch,
html[data-theme="dark"] #load-board-view .board-signal.watch {
  border-color: var(--alt-warning-border) !important;
  background: var(--alt-warning-soft) !important;
}

html[data-theme="dark"] #dashboard-view .board-signal.ready,
html[data-theme="dark"] #load-board-view .board-signal.ready {
  border-color: var(--alt-success-border) !important;
  background: var(--alt-success-soft) !important;
}

html[data-theme="dark"] #dashboard-view .panel h3,
html[data-theme="dark"] #dashboard-view .bucket,
html[data-theme="dark"] #dashboard-view .bucket span,
html[data-theme="dark"] #dashboard-view .bucket strong,
html[data-theme="dark"] #dashboard-view .reminder-item,
html[data-theme="dark"] #dashboard-view .reminder-item strong {
  color: var(--alt-text) !important;
}

html[data-theme="dark"] #dashboard-view .reminder-item small,
html[data-theme="dark"] #dashboard-view .reminder-meta {
  color: var(--alt-muted) !important;
}

html[data-theme="dark"] .ui-button-primary,
html[data-theme="dark"] .primary-action,
html[data-theme="dark"] .view > .section-heading .primary-action,
html[data-theme="dark"] .board-command .primary-action,
html[data-theme="dark"] #dashboard-view .board-command .primary-action,
html[data-theme="dark"] #load-board-view .board-command .primary-action {
  border-color: var(--alt-primary-solid);
  background: var(--alt-primary-solid);
  color: #ffffff;
}

html[data-theme="dark"] .ui-button-primary:hover,
html[data-theme="dark"] .primary-action:hover,
html[data-theme="dark"] .board-command .primary-action:hover,
html[data-theme="dark"] #dashboard-view .board-command .primary-action:hover,
html[data-theme="dark"] #load-board-view .board-command .primary-action:hover {
  border-color: var(--alt-primary-solid-hover);
  background: var(--alt-primary-solid-hover);
  color: #ffffff;
}

html[data-theme="dark"] #load-board-view .cell-main,
html[data-theme="dark"] #load-board-view .identity-copy strong,
html[data-theme="dark"] #load-board-view .inline-cell-input,
html[data-theme="dark"] #load-board-view .load-table tbody td strong,
html[data-theme="dark"] .data-table tbody td strong,
html[data-theme="dark"] .data-table .cell-main {
  color: var(--alt-text) !important;
  -webkit-text-fill-color: var(--alt-text) !important;
}

html[data-theme="dark"] #load-board-view .cell-sub,
html[data-theme="dark"] #load-board-view .identity-copy span,
html[data-theme="dark"] #load-board-view .identity-copy small,
html[data-theme="dark"] .data-table .cell-sub {
  color: var(--alt-muted) !important;
  -webkit-text-fill-color: var(--alt-muted) !important;
}

html[data-theme="dark"] #load-board-view .inline-cell-input:hover,
html[data-theme="dark"] #load-board-view .inline-cell-input:focus {
  border-color: var(--alt-primary-border);
  background: var(--alt-surface-hover);
}

html[data-theme="dark"] #load-board-view .identity-chip,
html[data-theme="dark"] #load-board-view .identity-chip.blue,
html[data-theme="dark"] #load-board-view .identity-chip.green,
html[data-theme="dark"] #load-board-view .identity-chip.slate,
html[data-theme="dark"] #load-board-view .identity-chip.amber,
html[data-theme="dark"] #load-board-view .identity-chip.violet,
html[data-theme="dark"] .copy-icon-button {
  border-color: var(--alt-border-strong);
  background: var(--alt-surface-muted);
  color: var(--alt-text-soft);
  box-shadow: none;
}

@media (max-width: 1180px) {
  .main,
  .ui-main {
    padding-inline: 16px;
  }

  .topbar .search {
    width: min(300px, 34vw);
  }

  .board-signal-grid,
  .ui-metric-grid,
  #dashboard-view .board-signal-grid,
  #load-board-view .board-signal-grid.balanced-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1000px) {
  .app-shell,
  .ui-app-shell,
  .app-shell.sidebar-collapsed {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .sidebar,
  .ui-sidebar {
    position: sticky;
    top: 0;
    height: 100dvh;
    padding: 14px 10px;
  }

  .brand {
    justify-content: center;
    padding-inline: 0;
  }

  .nav-list,
  .ui-sidebar-menu {
    grid-template-columns: 1fr;
  }

  .nav-item,
  .app-shell.sidebar-collapsed .nav-item {
    justify-content: center;
    padding: 8px;
  }

  .nav-label,
  .sidebar-toggle .nav-label {
    display: none;
  }

  .sidebar-toggle {
    width: 42px;
    align-self: center;
    justify-content: center;
    padding: 8px;
  }

  .board-command-title {
    display: grid;
  }

  .board-command,
  #dashboard-view .board-command,
  #load-board-view .board-command {
    grid-template-columns: minmax(0, 1fr);
  }

  .board-work-strip,
  .ui-work-cue-grid,
  #dashboard-view .board-work-strip,
  #load-board-view .board-work-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-layout,
  .work-grid,
  .detail-grid,
  .billing-detail-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell,
  .ui-app-shell,
  .app-shell.sidebar-collapsed {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar,
  .ui-sidebar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 60px;
    padding: 8px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--alt-sidebar-border);
  }

  .brand,
  .app-shell.sidebar-collapsed .brand {
    min-height: 0;
    padding: 0;
    border: 0;
  }

  .brand-logo,
  .app-shell.sidebar-collapsed .brand-logo {
    width: 38px;
    height: 38px;
  }

  .nav-list,
  .ui-sidebar-menu {
    display: flex;
    gap: 4px;
    min-width: 0;
    margin: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav-list::-webkit-scrollbar {
    display: none;
  }

  .nav-item,
  .app-shell.sidebar-collapsed .nav-item {
    flex: 0 0 44px;
    width: 44px;
    min-height: 44px;
    padding: 8px;
  }

  .nav-item::before {
    inset: auto 8px -1px;
    width: auto;
    height: 2px;
  }

  .sidebar-toggle {
    display: none;
  }

  .main,
  .ui-main {
    padding: 0 12px 20px;
  }

  .topbar,
  .ui-topbar {
    top: 60px;
    min-height: 60px;
    margin-bottom: 10px;
    padding: 7px 0;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: minmax(108px, 1fr) 112px 44px 44px;
    gap: 6px;
  }

  .topbar .search {
    width: 100%;
    min-width: 0;
    min-height: 44px;
  }

  .topbar .ui-select-wrap {
    width: 112px;
  }

  .topbar .ui-select {
    min-height: 44px;
    padding-inline: 8px 24px;
    font-size: 12px;
  }

  .topbar .reminder-button,
  .topbar .theme-toggle {
    width: 44px;
    min-width: 44px;
    height: 44px;
  }

  .section-heading,
  .ui-page-header,
  .board-command-main,
  #dashboard-view .board-command-main,
  #load-board-view .board-command-main {
    padding: 14px;
  }

  .board-command-title h2,
  #dashboard-view .board-command-title h2,
  #load-board-view .board-command-title h2,
  .view:not(#load-board-view) > .section-heading h2 {
    font-size: 22px;
  }

  .table-toolbar,
  .data-table-toolbar,
  #load-board-view .table-toolbar {
    align-items: stretch;
    padding: 8px;
  }

  .table-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 560px) {
  .topbar-actions {
    grid-template-columns: minmax(96px, 1fr) 44px 44px;
  }

  .topbar .ui-select-wrap {
    display: none;
  }

  .board-signal-grid,
  .ui-metric-grid,
  #dashboard-view .board-signal-grid,
  #load-board-view .board-signal-grid.balanced-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #load-board-view .board-focus-card {
    grid-column: 1 / -1;
  }

  .board-work-strip,
  .ui-work-cue-grid,
  #dashboard-view .board-work-strip,
  #load-board-view .board-work-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .button-row,
  .button-row.end {
    align-items: stretch;
  }

  .button-row:not(.end) {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button-row button,
  .button-row.end button {
    min-height: 44px;
  }

  .table-toolbar,
  .data-table-toolbar,
  #load-board-view .table-toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .view-switch,
  .table-filter-bar {
    display: flex;
    overflow-x: auto;
  }

  .view-switch .filter-chip,
  .table-filter-bar .filter-chip {
    flex: 1 0 auto;
  }
}

@media (max-width: 360px) {
  .board-signal-grid,
  .ui-metric-grid,
  #dashboard-view .board-signal-grid,
  #load-board-view .board-signal-grid.balanced-stats,
  .board-work-strip,
  .ui-work-cue-grid,
  #dashboard-view .board-work-strip,
  #load-board-view .board-work-strip {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/*
 * Enterprise correction layer.
 *
 * The legacy mockup stylesheet contains several late, high-specificity visual
 * themes. These rules are the canonical ApexAlt contract for shared surfaces,
 * fluid sizing, and light/dark parity.
 */

:root,
html[data-theme="light"] {
  --enterprise-canvas: #f3f6fa;
  --enterprise-canvas-raised: #eef2f7;
  --enterprise-surface: #ffffff;
  --enterprise-surface-subtle: #f8fafc;
  --enterprise-surface-muted: #f1f5f9;
  --enterprise-surface-hover: #f6f9fc;
  --enterprise-text: #111827;
  --enterprise-text-soft: #334155;
  --enterprise-muted: #64748b;
  --enterprise-faint: #94a3b8;
  --enterprise-border: #d9e2ec;
  --enterprise-border-strong: #cbd5e1;
  --enterprise-primary: #1d4ed8;
  --enterprise-primary-hover: #1e40af;
  --enterprise-primary-soft: #eff6ff;
  --enterprise-primary-line: #bfdbfe;
  --enterprise-success: #0f766e;
  --enterprise-success-soft: #ecfdf5;
  --enterprise-success-line: #a7f3d0;
  --enterprise-warning: #a16207;
  --enterprise-warning-soft: #fffbeb;
  --enterprise-warning-line: #fde68a;
  --enterprise-danger: #be123c;
  --enterprise-danger-soft: #fff1f2;
  --enterprise-danger-line: #fecdd3;
  --enterprise-rail: #ffffff;
  --enterprise-rail-raised: #f8fafc;
  --enterprise-rail-text: #1e293b;
  --enterprise-rail-muted: #64748b;
  --enterprise-rail-border: #dfe7f0;
  --enterprise-shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --enterprise-shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.06);
  --enterprise-shadow-md: 0 24px 64px rgba(15, 23, 42, 0.16);

  --alt-canvas: var(--enterprise-canvas);
  --alt-canvas-strong: var(--enterprise-canvas-raised);
  --alt-surface: var(--enterprise-surface);
  --alt-surface-subtle: var(--enterprise-surface-subtle);
  --alt-surface-muted: var(--enterprise-surface-muted);
  --alt-surface-hover: var(--enterprise-surface-hover);
  --alt-text: var(--enterprise-text);
  --alt-text-soft: var(--enterprise-text-soft);
  --alt-muted: var(--enterprise-muted);
  --alt-border: var(--enterprise-border);
  --alt-border-strong: var(--enterprise-border-strong);
  --alt-primary: var(--enterprise-primary);
  --alt-primary-hover: var(--enterprise-primary-hover);
  --alt-primary-solid: var(--enterprise-primary);
  --alt-primary-solid-hover: var(--enterprise-primary-hover);
  --alt-primary-soft: var(--enterprise-primary-soft);
  --alt-primary-border: var(--enterprise-primary-line);
  --alt-success: var(--enterprise-success);
  --alt-success-soft: var(--enterprise-success-soft);
  --alt-success-border: var(--enterprise-success-line);
  --alt-warning: var(--enterprise-warning);
  --alt-warning-soft: var(--enterprise-warning-soft);
  --alt-warning-border: var(--enterprise-warning-line);
  --alt-danger: var(--enterprise-danger);
  --alt-danger-soft: var(--enterprise-danger-soft);
  --alt-danger-border: var(--enterprise-danger-line);
  --alt-sidebar: var(--enterprise-rail);
  --alt-sidebar-raised: var(--enterprise-rail-raised);
  --alt-sidebar-text: var(--enterprise-rail-text);
  --alt-sidebar-muted: var(--enterprise-rail-muted);
  --alt-sidebar-border: var(--enterprise-rail-border);
}

html[data-theme="dark"] {
  --enterprise-canvas: #080d16;
  --enterprise-canvas-raised: #0b111d;
  --enterprise-surface: #101827;
  --enterprise-surface-subtle: #0d1522;
  --enterprise-surface-muted: #162033;
  --enterprise-surface-hover: #182438;
  --enterprise-text: #f1f5f9;
  --enterprise-text-soft: #cbd5e1;
  --enterprise-muted: #94a3b8;
  --enterprise-faint: #718096;
  --enterprise-border: #26344a;
  --enterprise-border-strong: #394a63;
  --enterprise-primary: #60a5fa;
  --enterprise-primary-hover: #93c5fd;
  --enterprise-primary-soft: rgba(59, 130, 246, 0.13);
  --enterprise-primary-line: rgba(96, 165, 250, 0.34);
  --enterprise-success: #5eead4;
  --enterprise-success-soft: rgba(20, 184, 166, 0.1);
  --enterprise-success-line: rgba(94, 234, 212, 0.3);
  --enterprise-warning: #fbbf24;
  --enterprise-warning-soft: rgba(245, 158, 11, 0.1);
  --enterprise-warning-line: rgba(251, 191, 36, 0.3);
  --enterprise-danger: #fb7185;
  --enterprise-danger-soft: rgba(244, 63, 94, 0.1);
  --enterprise-danger-line: rgba(251, 113, 133, 0.3);
  --enterprise-rail: #060a11;
  --enterprise-rail-raised: #0c1320;
  --enterprise-rail-text: #e5edf8;
  --enterprise-rail-muted: #8b9bb0;
  --enterprise-rail-border: #1d293a;
  --enterprise-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.24);
  --enterprise-shadow-sm: 0 10px 26px rgba(0, 0, 0, 0.22);
  --enterprise-shadow-md: 0 28px 72px rgba(0, 0, 0, 0.44);

  --alt-canvas: var(--enterprise-canvas);
  --alt-canvas-strong: var(--enterprise-canvas-raised);
  --alt-surface: var(--enterprise-surface);
  --alt-surface-subtle: var(--enterprise-surface-subtle);
  --alt-surface-muted: var(--enterprise-surface-muted);
  --alt-surface-hover: var(--enterprise-surface-hover);
  --alt-text: var(--enterprise-text);
  --alt-text-soft: var(--enterprise-text-soft);
  --alt-muted: var(--enterprise-muted);
  --alt-border: var(--enterprise-border);
  --alt-border-strong: var(--enterprise-border-strong);
  --alt-primary: var(--enterprise-primary);
  --alt-primary-hover: var(--enterprise-primary-hover);
  --alt-primary-soft: var(--enterprise-primary-soft);
  --alt-primary-border: var(--enterprise-primary-line);
  --alt-success: var(--enterprise-success);
  --alt-success-soft: var(--enterprise-success-soft);
  --alt-success-border: var(--enterprise-success-line);
  --alt-warning: var(--enterprise-warning);
  --alt-warning-soft: var(--enterprise-warning-soft);
  --alt-warning-border: var(--enterprise-warning-line);
  --alt-danger: var(--enterprise-danger);
  --alt-danger-soft: var(--enterprise-danger-soft);
  --alt-danger-border: var(--enterprise-danger-line);
  --alt-sidebar: var(--enterprise-rail);
  --alt-sidebar-raised: var(--enterprise-rail-raised);
  --alt-sidebar-text: var(--enterprise-rail-text);
  --alt-sidebar-muted: var(--enterprise-rail-muted);
  --alt-sidebar-border: var(--enterprise-rail-border);
}

html,
body {
  width: 100%;
  max-width: none;
  min-height: 100%;
  background: var(--enterprise-canvas) !important;
  color: var(--enterprise-text);
}

body {
  overflow-x: clip;
}

/* Fluid application frame */
.app-shell.ui-app-shell {
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  grid-template-columns: 220px minmax(0, 1fr);
  background: var(--enterprise-canvas);
}

.app-shell.ui-app-shell.sidebar-collapsed {
  grid-template-columns: 72px minmax(0, 1fr);
}

.main.ui-main {
  width: 100%;
  max-width: none;
  min-width: 0;
  padding: 0 clamp(16px, 1.8vw, 30px) 30px;
  overflow-x: clip;
  background: var(--enterprise-canvas);
}

.main.ui-main > .view,
.main.ui-main > .view.active {
  width: 100%;
  max-width: none;
  min-width: 0;
  margin-inline: 0;
}

.sidebar.ui-sidebar {
  width: auto;
  padding: 14px 12px;
  border-right: 1px solid var(--enterprise-rail-border);
  background: var(--enterprise-rail);
  color: var(--enterprise-rail-text);
}

.brand.ui-sidebar-header {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 2px 8px 12px;
  border-bottom: 1px solid var(--enterprise-rail-border);
}

.brand-logo {
  flex: 0 0 38px;
}

.brand-copy {
  display: grid;
  min-width: 0;
  line-height: 1.05;
}

.brand-copy strong {
  color: var(--enterprise-rail-text);
  font-size: 14px;
  font-weight: 760;
}

.brand-copy span {
  color: var(--enterprise-rail-muted);
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
}

.app-shell.sidebar-collapsed .brand-copy {
  display: none;
}

.nav-item.ui-sidebar-menu-button {
  min-height: 40px;
  color: var(--enterprise-rail-muted);
}

.nav-item.ui-sidebar-menu-button:hover {
  border-color: var(--enterprise-primary-line);
  background: var(--enterprise-primary-soft);
  color: var(--enterprise-rail-text);
}

.nav-item.ui-sidebar-menu-button.active {
  border-color: var(--enterprise-primary-line);
  background: var(--enterprise-primary-soft);
  color: var(--enterprise-primary);
}

.nav-item.ui-sidebar-menu-button:hover .nav-icon,
.nav-item.ui-sidebar-menu-button.active .nav-icon {
  background: var(--enterprise-primary-soft);
  color: var(--enterprise-primary);
}

.sidebar-toggle.ui-button {
  border-color: var(--enterprise-rail-border);
  background: var(--enterprise-rail-raised);
  color: var(--enterprise-rail-muted);
}

.sidebar-toggle.ui-button:hover {
  border-color: var(--enterprise-primary-line);
  background: var(--enterprise-primary-soft);
  color: var(--enterprise-primary);
}

.topbar.ui-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  width: 100%;
  min-height: 60px;
  margin: 0 0 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--enterprise-border);
  background: var(--enterprise-canvas);
}

.topbar .search,
.topbar .ui-select,
.topbar .theme-toggle,
.topbar .reminder-button {
  border-color: var(--enterprise-border-strong);
  background: var(--enterprise-surface);
  color: var(--enterprise-text-soft);
  box-shadow: var(--enterprise-shadow-xs);
}

.topbar .search {
  width: clamp(260px, 32vw, 440px);
}

/* Compact, consistent command hierarchy */
#dashboard-view .board-command,
#load-board-view .board-command,
.view:not(#dashboard-view):not(#load-board-view) > .section-heading {
  width: 100%;
  max-width: none;
  overflow: hidden;
  border: 1px solid var(--enterprise-border) !important;
  border-radius: 8px;
  background: var(--enterprise-surface) !important;
  color: var(--enterprise-text);
  box-shadow: var(--enterprise-shadow-xs);
}

#dashboard-view .board-command,
#load-board-view .board-command {
  display: block;
  padding: 0 !important;
}

#dashboard-view .board-command::before,
#dashboard-view .board-command::after,
#load-board-view .board-command::before,
#load-board-view .board-command::after,
.view:not(#dashboard-view):not(#load-board-view) > .section-heading::before,
.view:not(#dashboard-view):not(#load-board-view) > .section-heading::after {
  display: none !important;
}

.view:not(#dashboard-view):not(#load-board-view) > .section-heading {
  display: flex;
  min-height: 84px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
  padding: 16px 18px;
}

#dashboard-view .board-command-main,
#load-board-view .board-command-main {
  gap: 12px;
  padding: 18px;
}

#dashboard-view .board-command-title,
#load-board-view .board-command-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

#dashboard-view .board-command-title h2,
#load-board-view .board-command-title h2,
.view:not(#dashboard-view):not(#load-board-view) > .section-heading h2 {
  margin: 0 0 4px;
  color: var(--enterprise-text) !important;
  font-size: 24px;
  font-weight: 740;
  line-height: 1.2;
}

#dashboard-view .board-command-title p,
#load-board-view .board-command-title p,
.view:not(#dashboard-view):not(#load-board-view) > .section-heading p {
  max-width: 820px;
  margin: 0;
  color: var(--enterprise-muted) !important;
  font-size: 13px;
  line-height: 1.45;
}

#dashboard-view .board-kicker,
#load-board-view .board-kicker {
  color: var(--enterprise-primary);
}

.view > .section-heading .primary-action,
.board-command .primary-action,
.primary-action.ui-button-primary {
  width: auto;
  min-width: 0;
  min-height: 40px;
  flex: 0 0 auto;
  padding: 0 16px;
  border: 1px solid #1d4ed8;
  border-radius: 6px;
  background: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(29, 78, 216, 0.18);
}

.view > .section-heading .primary-action:hover,
.board-command .primary-action:hover,
.primary-action.ui-button-primary:hover {
  border-color: #1e40af;
  background: #1e40af;
  color: #ffffff;
}

/* Neutral KPI system: color carries meaning only at the edge. */
#dashboard-view .board-signal-grid,
#load-board-view .board-signal-grid,
.compact-summary,
.report-stat-grid {
  width: 100%;
  max-width: none;
  gap: 10px;
}

#dashboard-view .board-signal-grid,
#load-board-view .board-signal-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.compact-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  margin-bottom: 12px;
}

#dashboard-view .board-signal,
#load-board-view .board-signal,
.compact-summary .summary-item,
.report-stat-card {
  min-width: 0;
  min-height: 82px;
  border: 1px solid var(--enterprise-border) !important;
  border-left: 3px solid var(--enterprise-primary) !important;
  border-radius: 7px;
  background: var(--enterprise-surface-subtle) !important;
  color: var(--enterprise-text);
  box-shadow: none;
}

#dashboard-view .board-signal,
#load-board-view .board-signal {
  padding: 12px 14px;
}

#dashboard-view .board-signal::before,
#load-board-view .board-signal::before,
.compact-summary .summary-item::before,
.report-stat-card::before {
  display: none !important;
}

#dashboard-view .board-signal.critical,
#load-board-view .board-signal.critical,
.compact-summary .summary-item.attention {
  border-left-color: var(--enterprise-danger) !important;
}

#dashboard-view .board-signal.watch,
#load-board-view .board-signal.watch,
.report-stat-card.watch {
  border-left-color: var(--enterprise-warning) !important;
}

#dashboard-view .board-signal.ready,
#load-board-view .board-signal.ready {
  border-left-color: var(--enterprise-success) !important;
}

html[data-theme="dark"] #dashboard-view .board-signal.critical,
html[data-theme="dark"] #load-board-view .board-signal.critical {
  border-color: var(--enterprise-border) !important;
  border-left-color: var(--enterprise-danger) !important;
  background: var(--enterprise-surface-subtle) !important;
}

html[data-theme="dark"] #dashboard-view .board-signal.watch,
html[data-theme="dark"] #load-board-view .board-signal.watch {
  border-color: var(--enterprise-border) !important;
  border-left-color: var(--enterprise-warning) !important;
  background: var(--enterprise-surface-subtle) !important;
}

html[data-theme="dark"] #dashboard-view .board-signal.ready,
html[data-theme="dark"] #load-board-view .board-signal.ready {
  border-color: var(--enterprise-border) !important;
  border-left-color: var(--enterprise-success) !important;
  background: var(--enterprise-surface-subtle) !important;
}

#dashboard-view .board-signal:hover,
#load-board-view .board-signal:hover {
  border-color: var(--enterprise-border-strong) !important;
  background: var(--enterprise-surface-hover) !important;
}

#dashboard-view .board-signal span,
#load-board-view .board-signal span,
.compact-summary .summary-item span,
.report-stat-card span {
  color: var(--enterprise-muted) !important;
  font-size: 10px;
  font-weight: 760;
}

#dashboard-view .board-signal strong,
#load-board-view .board-signal strong,
.compact-summary .summary-item strong,
.report-stat-card strong {
  color: var(--enterprise-text) !important;
  font-variant-numeric: tabular-nums;
}

.compact-summary .summary-item {
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 12px 14px;
}

.compact-summary .summary-item strong {
  margin: 0;
  font-size: 23px;
  line-height: 1;
}

#dashboard-view .board-work-strip,
#load-board-view .board-work-strip {
  width: 100%;
  max-width: none;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

#dashboard-view .work-item,
#load-board-view .board-work-strip .work-item {
  min-width: 0;
  min-height: 68px;
  border: 1px solid var(--enterprise-border);
  border-left: 3px solid var(--enterprise-primary);
  background: var(--enterprise-surface);
}

#dashboard-view .work-item.attention,
#load-board-view .work-item.attention {
  border-left-color: var(--enterprise-warning);
}

#dashboard-view .work-item.money,
#load-board-view .work-item.money {
  border-left-color: var(--enterprise-success);
}

/* Shared panels and nested work surfaces */
.panel.ui-card,
.settings-section,
.report-panel,
.form-section,
.ui-form-section,
.filter-sections section,
.config-content section,
.fit-check-panel,
.movement-card,
.mini-card,
.mini-record-row,
.copy-field-row,
.related-load-option,
.check-option,
.column-order-list li,
.bol-drop-zone,
.wizard-panel {
  border-color: var(--enterprise-border) !important;
  border-radius: 7px;
  background: var(--enterprise-surface) !important;
  color: var(--enterprise-text);
  box-shadow: var(--enterprise-shadow-xs);
}

.panel-header,
.ui-card-header,
.section-title-row {
  border-color: var(--enterprise-border) !important;
}

.panel-header h3,
.panel-header h4,
.form-section h4,
.config-content h4,
.filter-sections h4,
.mini-record-row strong,
.bucket strong,
.reminder-item strong {
  color: var(--enterprise-text) !important;
}

.panel-header p,
.mini-record-row small,
.reminder-meta,
.field-hint {
  color: var(--enterprise-muted) !important;
}

#dashboard-view .bucket,
#dashboard-view .reminder-item,
.bucket,
.reminder-item {
  border-color: var(--enterprise-border);
  background: var(--enterprise-surface-subtle) !important;
  color: var(--enterprise-text-soft) !important;
}

#dashboard-view .bucket:hover,
#dashboard-view .reminder-item:hover,
.bucket:hover,
.reminder-item:hover {
  background: var(--enterprise-surface-hover) !important;
}

/* Table frame, sizing, and color parity */
.view:not(#dashboard-view) > .table-toolbar,
.view:not(#dashboard-view) > .table-shell,
.view:not(#dashboard-view) > .table-footer,
#load-board-view .table-toolbar,
#load-board-view .table-shell,
#load-board-view .table-footer {
  width: 100%;
  max-width: none;
  min-width: 0;
  border-color: var(--enterprise-border) !important;
  background: var(--enterprise-surface) !important;
  color: var(--enterprise-text-soft);
  box-shadow: var(--enterprise-shadow-xs);
}

.view:not(#dashboard-view) > .table-toolbar,
#load-board-view .table-toolbar {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px 8px 0 0;
}

.view:not(#dashboard-view) > .table-shell,
#load-board-view .table-shell {
  overflow: auto;
  overscroll-behavior-inline: contain;
  border-top: 0;
  border-radius: 0 0 8px 8px;
  scrollbar-gutter: stable;
}

.view:not(#dashboard-view) > .table-footer,
#load-board-view .table-footer {
  min-height: 46px;
  margin-top: 8px;
  border-radius: 7px;
}

.view-switch.table-filter-bar,
#load-board-view .view-switch {
  min-width: 0;
  padding: 3px;
  border-color: var(--enterprise-border);
  background: var(--enterprise-surface-muted) !important;
}

.view-switch .filter-chip,
.table-filter-bar .filter-chip,
#load-board-view .view-switch .filter-chip {
  color: var(--enterprise-muted) !important;
}

.view-switch .filter-chip.active,
.table-filter-bar .filter-chip.active,
#load-board-view .view-switch .filter-chip.active {
  background: var(--enterprise-surface) !important;
  color: var(--enterprise-text) !important;
  box-shadow: var(--enterprise-shadow-xs);
}

.table-actions {
  min-width: 0;
}

.table-shell table,
.data-table,
.load-table,
.billing-table,
.customer-table,
.carrier-table,
#load-board-view .load-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--enterprise-surface) !important;
  color: var(--enterprise-text-soft);
}

#load-board-view .load-table {
  min-width: 1520px;
}

#billing-view .billing-table {
  min-width: 1040px;
}

#customers-view .customer-table {
  min-width: 1100px;
}

#carriers-view .carrier-table {
  min-width: 1120px;
}

.table-shell thead th,
.data-table thead th,
#load-board-view .load-table thead th,
.billing-copy-table th {
  height: 40px;
  padding: 8px 12px;
  border-color: var(--enterprise-border) !important;
  background: var(--enterprise-surface-muted) !important;
  color: var(--enterprise-muted) !important;
  font-size: 10px;
  font-weight: 760;
}

.sortable-header,
.table-shell thead th button,
.data-table thead th button {
  color: var(--enterprise-muted) !important;
}

.table-shell tbody td,
.data-table tbody td,
.data-table-cell,
#load-board-view .load-table tbody td {
  padding: 10px 12px;
  border-color: var(--enterprise-border) !important;
  background: var(--enterprise-surface) !important;
  color: var(--enterprise-text-soft) !important;
  font-size: 12px;
  line-height: 1.35;
}

.table-shell tbody td strong,
.data-table tbody td strong,
.table-shell .cell-main,
.data-table .cell-main,
.identity-copy strong,
.inline-cell-input {
  color: var(--enterprise-text) !important;
}

.table-shell .cell-sub,
.data-table .cell-sub,
.identity-copy span,
.identity-copy small {
  color: var(--enterprise-muted) !important;
}

.table-shell tbody tr:hover td,
.data-table tbody tr:hover td,
#load-board-view .load-table tbody tr:hover td {
  background: var(--enterprise-surface-hover) !important;
}

#load-board-view .load-table tbody tr.selected td,
.load-table tbody tr.selected td {
  background: var(--enterprise-primary-soft) !important;
}

.table-shell th.pin,
.table-shell td.pin {
  background: var(--enterprise-surface) !important;
  box-shadow: 1px 0 0 var(--enterprise-border);
}

.table-shell thead th.pin {
  background: var(--enterprise-surface-muted) !important;
}

/* Status is compact and semantic without recoloring entire cards. */
.pill,
.status-pill,
.priority-pill,
.risk-pill,
.readiness-badge,
.status-badge {
  border-color: var(--enterprise-border) !important;
  background: var(--enterprise-surface-muted) !important;
  color: var(--enterprise-text-soft) !important;
}

.pill.move,
.status-pill.active,
.status-badge.move {
  border-color: var(--enterprise-primary-line) !important;
  background: var(--enterprise-primary-soft) !important;
  color: var(--enterprise-primary) !important;
}

.pill.issue,
.pill.attention,
.risk-pill.high,
.priority-pill.high,
.readiness-badge.needed,
.status-badge.issue,
.status-badge.attention {
  border-color: var(--enterprise-danger-line) !important;
  background: var(--enterprise-danger-soft) !important;
  color: var(--enterprise-danger) !important;
}

.pill.warn,
.pill.billing,
.risk-pill.medium,
.priority-pill.medium,
.readiness-badge.review,
.status-badge.warn,
.status-badge.billing {
  border-color: var(--enterprise-warning-line) !important;
  background: var(--enterprise-warning-soft) !important;
  color: var(--enterprise-warning) !important;
}

.pill.ok,
.pill.ready,
.risk-pill.low,
.priority-pill.low,
.readiness-badge.ready,
.readiness-badge.not-blocking,
.status-badge.ok,
.status-badge.ready {
  border-color: var(--enterprise-success-line) !important;
  background: var(--enterprise-success-soft) !important;
  color: var(--enterprise-success) !important;
}

/* Forms, menus, drawers, and dialogs follow the same surface contract. */
input,
textarea,
.search,
.table-search,
.ui-input-shell,
.ui-form input,
.ui-form textarea,
.ui-select {
  border-color: var(--enterprise-border-strong) !important;
  background: var(--enterprise-surface) !important;
  color: var(--enterprise-text) !important;
}

.modal,
.wide-modal,
.detail-modal,
.billing-detail-modal,
.ui-dialog-content,
.drawer,
.row-context-menu,
.row-action-popover,
.column-menu,
.popover,
.ui-dropdown-content {
  border-color: var(--enterprise-border) !important;
  background: var(--enterprise-surface) !important;
  color: var(--enterprise-text);
  box-shadow: var(--enterprise-shadow-md);
}

.modal > .panel-header:first-child,
.wide-modal > .panel-header:first-child,
.detail-modal > .panel-header:first-child,
.detail-header,
.ui-detail-header {
  border-color: var(--enterprise-border) !important;
  background: var(--enterprise-surface) !important;
  color: var(--enterprise-text);
}

.row-context-menu button,
.row-action-popover button,
.column-menu button {
  color: var(--enterprise-text-soft) !important;
}

.row-context-menu button:hover,
.row-action-popover button:hover,
.column-menu button:hover {
  background: var(--enterprise-surface-hover) !important;
  color: var(--enterprise-text) !important;
}

.config-sidebar,
.wizard-steps,
.detail-tabs {
  border-color: var(--enterprise-border) !important;
  background: var(--enterprise-surface-subtle) !important;
  color: var(--enterprise-text-soft);
}

.trend-chart {
  border-color: var(--enterprise-border) !important;
  background: var(--enterprise-surface-subtle) !important;
}

.trend-chart span {
  background: var(--enterprise-primary) !important;
}

/* Load-board variables were previously scoped to the page and bypassed themes. */
#load-board-view {
  --lb-background: var(--enterprise-canvas);
  --lb-card: var(--enterprise-surface);
  --lb-card-muted: var(--enterprise-surface-subtle);
  --lb-muted: var(--enterprise-muted);
  --lb-muted-foreground: var(--enterprise-muted);
  --lb-foreground: var(--enterprise-text);
  --lb-border: var(--enterprise-border);
  --lb-primary: var(--enterprise-primary);
  --lb-primary-soft: var(--enterprise-primary-soft);
  --lb-ring: var(--enterprise-primary-soft);
}

/* Responsive density: the shell changes shape, not just scale. */
@media (max-width: 1180px) {
  .app-shell.ui-app-shell,
  .app-shell.ui-app-shell.sidebar-collapsed {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .sidebar.ui-sidebar {
    padding-inline: 10px;
  }

  .brand.ui-sidebar-header {
    justify-content: center;
    padding-inline: 0;
  }

  .brand-copy,
  .nav-label,
  .sidebar-toggle .nav-label {
    display: none;
  }

  .nav-item.ui-sidebar-menu-button {
    justify-content: center;
    padding-inline: 8px;
  }

  .sidebar-toggle.ui-button {
    width: 42px;
    align-self: center;
    justify-content: center;
    padding-inline: 8px;
  }

  #dashboard-view .board-signal-grid,
  #load-board-view .board-signal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-grid,
  .report-layout,
  .detail-grid,
  .billing-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell.ui-app-shell,
  .app-shell.ui-app-shell.sidebar-collapsed {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar.ui-sidebar {
    position: sticky;
    top: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    width: 100%;
    height: 60px;
    padding: 8px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--enterprise-rail-border);
  }

  .brand.ui-sidebar-header {
    min-height: 0;
    padding: 0;
    border: 0;
  }

  .brand-logo {
    width: 38px;
    height: 38px;
  }

  .nav-list.ui-sidebar-menu {
    display: flex;
    min-width: 0;
    margin: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav-item.ui-sidebar-menu-button {
    flex: 0 0 44px;
    width: 44px;
    min-height: 44px;
    padding: 8px;
  }

  .sidebar-toggle.ui-button {
    display: none;
  }

  .main.ui-main {
    padding: 0 12px 22px;
  }

  .topbar.ui-topbar {
    top: 60px;
    min-height: 60px;
    margin-bottom: 10px;
    padding-block: 7px;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) 118px 44px 44px;
    gap: 6px;
  }

  .topbar .search {
    width: 100%;
    min-width: 0;
    min-height: 44px;
  }

  .topbar .ui-select-wrap {
    width: 118px;
  }

  .topbar .ui-select {
    min-height: 44px;
  }

  .topbar .theme-toggle,
  .topbar .reminder-button {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  #dashboard-view .board-command-main,
  #load-board-view .board-command-main,
  .view:not(#dashboard-view):not(#load-board-view) > .section-heading {
    padding: 14px;
  }

  #dashboard-view .board-command-title,
  #load-board-view .board-command-title {
    gap: 14px;
  }

  #dashboard-view .board-command-title h2,
  #load-board-view .board-command-title h2,
  .view:not(#dashboard-view):not(#load-board-view) > .section-heading h2 {
    font-size: 21px;
  }

  #dashboard-view .board-work-strip,
  #load-board-view .board-work-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .view:not(#dashboard-view) > .table-toolbar,
  #load-board-view .table-toolbar {
    align-items: stretch;
  }

  .table-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

@media (max-width: 620px) {
  .topbar-actions {
    grid-template-columns: minmax(100px, 1fr) 44px 44px;
  }

  .topbar .ui-select-wrap {
    display: none;
  }

  #dashboard-view .board-command-title,
  #load-board-view .board-command-title,
  .view:not(#dashboard-view):not(#load-board-view) > .section-heading {
    flex-direction: column;
    align-items: stretch;
  }

  .view > .section-heading .primary-action,
  .board-command .primary-action,
  .primary-action.ui-button-primary {
    width: 100%;
  }

  .compact-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .view:not(#dashboard-view) > .table-toolbar,
  #load-board-view .table-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .view-switch.table-filter-bar {
    display: flex;
    max-width: 100%;
    overflow-x: auto;
  }

  .table-actions {
    justify-content: flex-start;
  }

  .table-actions .secondary-action {
    flex: 1 1 auto;
  }

  .table-footer,
  .data-table-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
    justify-content: stretch;
  }

  .table-footer > span,
  .data-table-footer > span {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .table-footer label,
  .data-table-footer label {
    justify-self: end;
    white-space: nowrap;
  }

  .table-footer .pagination-actions,
  .data-table-footer .pagination-actions {
    justify-self: end;
  }
}

@media (max-width: 440px) {
  .table-footer,
  .data-table-footer {
    grid-template-columns: minmax(0, 1fr);
  }

  .table-footer > span,
  .data-table-footer > span,
  .table-footer label,
  .data-table-footer label,
  .table-footer .pagination-actions,
  .data-table-footer .pagination-actions {
    justify-self: end;
  }
}

@media (max-width: 440px) {
  #dashboard-view .board-work-strip,
  #load-board-view .board-work-strip {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 340px) {
  #dashboard-view .board-signal-grid,
  #load-board-view .board-signal-grid,
  .compact-summary {
    grid-template-columns: minmax(0, 1fr);
  }
}

/*
 * Fluid viewport contract.
 *
 * This final layer protects the enterprise skin from older fixed-width page
 * rules and browser-cached layout states. Every primary workspace surface fills
 * the usable viewport width; only tables may scroll internally when their
 * columns exceed the visible board width.
 */

:root {
  --apex-page-gutter: 8px;
}

html,
body,
.app-shell.ui-app-shell {
  inline-size: 100% !important;
  max-inline-size: none !important;
}

body {
  margin: 0 !important;
}

.app-shell.ui-app-shell {
  display: grid !important;
  grid-template-columns: 220px minmax(0, 1fr) !important;
  min-inline-size: 0 !important;
  inline-size: 100vw !important;
  max-inline-size: none !important;
  overflow-x: clip;
}

.app-shell.ui-app-shell.sidebar-collapsed {
  grid-template-columns: 72px minmax(0, 1fr) !important;
}

.main.ui-main {
  box-sizing: border-box;
  min-inline-size: 0 !important;
  inline-size: 100% !important;
  max-inline-size: none !important;
  margin-inline: 0 !important;
  padding-inline: var(--apex-page-gutter) !important;
  overflow-x: clip;
}

.main.ui-main > .topbar.ui-topbar,
.main.ui-main > .view,
.main.ui-main > .view.active,
.main.ui-main > .ui-page,
.main.ui-main > .ui-page.active {
  box-sizing: border-box;
  min-inline-size: 0 !important;
  inline-size: 100% !important;
  max-inline-size: none !important;
  margin-inline: 0 !important;
}

#dashboard-view .board-command,
#load-board-view .board-command,
#dashboard-view .board-work-strip,
#load-board-view .board-work-strip,
.view:not(#dashboard-view):not(#load-board-view) > .section-heading,
.view:not(#dashboard-view) > .board-summary-strip,
.view:not(#dashboard-view) > .table-toolbar,
.view:not(#dashboard-view) > .table-shell,
#load-board-view .table-toolbar,
#load-board-view .table-shell,
.report-layout,
.work-grid,
.settings-grid {
  box-sizing: border-box;
  min-inline-size: 0 !important;
  inline-size: 100% !important;
  max-inline-size: none !important;
  margin-inline: 0 !important;
}

#dashboard-view .board-command-main,
#load-board-view .board-command-main {
  box-sizing: border-box;
  min-inline-size: 0 !important;
  inline-size: 100% !important;
  max-inline-size: none !important;
}

.table-shell,
.data-table-shell,
#load-board-view .table-shell {
  overflow-x: auto !important;
  overflow-y: visible;
}

@media (max-width: 1180px) {
  .app-shell.ui-app-shell,
  .app-shell.ui-app-shell.sidebar-collapsed {
    grid-template-columns: 72px minmax(0, 1fr) !important;
  }
}

@media (max-width: 760px) {
  :root {
    --apex-page-gutter: 8px;
  }

  .app-shell.ui-app-shell,
  .app-shell.ui-app-shell.sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .main.ui-main {
    padding-inline: var(--apex-page-gutter) !important;
  }
}

/* Dashboard cockpit */
.dashboard-cockpit {
  display: grid;
  gap: 10px;
  min-width: 0;
  width: 100%;
}

.dashboard-hero {
  position: relative;
  display: flex;
  min-height: 112px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--enterprise-border) !important;
  border-radius: 8px;
  background: var(--enterprise-surface) !important;
  color: var(--enterprise-text);
  box-shadow: var(--enterprise-shadow-xs);
}

.dashboard-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--enterprise-primary);
}

.dashboard-hero-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.dashboard-hero .board-kicker {
  margin: 0;
  letter-spacing: 0;
}

.dashboard-hero h2 {
  margin: 0;
  color: var(--enterprise-text);
  font-size: 24px;
  font-weight: 760;
  line-height: 1.16;
}

.dashboard-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--enterprise-muted);
  font-size: 13px;
  line-height: 1.45;
}

.dashboard-hero-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(145px, 1fr));
  gap: 10px;
  min-width: 0;
}

.dashboard-kpi-card {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 104px;
  align-content: space-between;
  gap: 8px;
  padding: 13px 14px;
  overflow: hidden;
  border: 1px solid var(--enterprise-border);
  border-left: 3px solid var(--enterprise-primary);
  border-radius: 7px;
  background: var(--enterprise-surface-subtle);
  color: var(--enterprise-text);
  text-align: left;
  box-shadow: none;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.dashboard-kpi-card:hover {
  border-color: var(--enterprise-border-strong);
  background: var(--enterprise-surface-hover);
  transform: translateY(-1px);
}

.dashboard-kpi-card:focus-visible,
.dashboard-action-row:focus-visible,
.dashboard-reminder-row:focus-visible,
.dashboard-mini-row:focus-visible,
.dashboard-risk-card:focus-visible {
  outline: 2px solid var(--enterprise-primary);
  outline-offset: 2px;
}

.dashboard-kpi-card span,
.dashboard-panel-header span,
.dashboard-risk-card span {
  color: var(--enterprise-muted);
  font-size: 10px;
  font-weight: 760;
  line-height: 1.2;
  text-transform: uppercase;
}

.dashboard-kpi-card strong {
  color: var(--enterprise-text);
  font-size: 28px;
  font-weight: 780;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.dashboard-kpi-card small,
.dashboard-risk-card small,
.dashboard-action-row small,
.dashboard-reminder-row small,
.dashboard-mini-row small {
  min-width: 0;
  color: var(--enterprise-muted);
  font-size: 11px;
  line-height: 1.35;
}

.dashboard-kpi-card.critical {
  border-left-color: var(--enterprise-danger);
  color: var(--enterprise-danger);
}

.dashboard-kpi-card.watch,
.dashboard-kpi-card.billing {
  border-left-color: var(--enterprise-warning);
  color: var(--enterprise-warning);
}

.dashboard-kpi-card.ready {
  border-left-color: var(--enterprise-success);
  color: var(--enterprise-success);
}

.dashboard-layout {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-areas:
    "priority priority priority priority priority priority risk risk risk risk risk risk"
    "priority priority priority priority priority priority flow flow flow reminders reminders reminders"
    "windows windows windows windows windows windows billing billing billing billing billing billing";
  gap: 10px;
  min-width: 0;
  align-items: stretch;
}

.dashboard-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--enterprise-border) !important;
  border-radius: 8px;
  background: var(--enterprise-surface) !important;
  color: var(--enterprise-text);
  box-shadow: var(--enterprise-shadow-xs);
}

.dashboard-priority-panel {
  grid-area: priority;
}

.dashboard-flow-panel {
  grid-area: flow;
}

.dashboard-reminder-panel {
  grid-area: reminders;
}

.dashboard-windows-panel {
  grid-area: windows;
}

.dashboard-risk-panel {
  grid-area: risk;
}

.dashboard-billing-panel {
  grid-area: billing;
}

.dashboard-panel-header {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--enterprise-border);
  background: var(--enterprise-surface-subtle);
}

.dashboard-panel-header h3 {
  margin: 2px 0 0;
  color: var(--enterprise-text);
  font-size: 15px;
  font-weight: 740;
  line-height: 1.2;
}

.dashboard-panel-count {
  flex: 0 0 auto;
  color: var(--enterprise-muted);
  font-size: 11px;
  font-weight: 700;
}

.dashboard-action-queue,
.dashboard-reminder-list,
.dashboard-mini-list,
.dashboard-status-flow,
.dashboard-risk-grid {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
}

.dashboard-action-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) minmax(140px, 0.42fr);
  gap: 10px;
  min-width: 0;
  min-height: 68px;
  align-items: center;
  padding: 10px 12px;
  border: 0;
  border-top: 1px solid var(--enterprise-border);
  background: transparent;
  color: var(--enterprise-text);
  text-align: left;
  cursor: pointer;
}

.dashboard-action-row:first-child,
.dashboard-reminder-row:first-child,
.dashboard-mini-row:first-child,
.dashboard-flow-row:first-child {
  border-top: 0;
}

.dashboard-action-row:hover,
.dashboard-reminder-row:hover,
.dashboard-mini-row:hover,
.dashboard-risk-card:hover {
  background: var(--enterprise-surface-hover);
}

.dashboard-action-rank {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--enterprise-border-strong);
  border-radius: 999px;
  background: var(--enterprise-surface);
  color: var(--enterprise-muted);
  font-size: 11px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.dashboard-action-main,
.dashboard-action-meta,
.dashboard-reminder-row > span,
.dashboard-mini-row > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.dashboard-action-main strong,
.dashboard-action-meta strong,
.dashboard-reminder-row strong,
.dashboard-mini-row strong {
  min-width: 0;
  color: var(--enterprise-text);
  font-size: 12px;
  font-weight: 740;
  line-height: 1.25;
}

.dashboard-action-row.critical .dashboard-action-rank,
.dashboard-reminder-row.overdue .dashboard-reminder-status {
  border-color: var(--enterprise-danger-line);
  background: var(--enterprise-danger-soft);
  color: var(--enterprise-danger);
}

.dashboard-action-row.watch .dashboard-action-rank,
.dashboard-action-row.billing .dashboard-action-rank {
  border-color: var(--enterprise-warning-line);
  background: var(--enterprise-warning-soft);
  color: var(--enterprise-warning);
}

.dashboard-action-row.steady .dashboard-action-rank {
  border-color: var(--enterprise-success-line);
  background: var(--enterprise-success-soft);
  color: var(--enterprise-success);
}

.dashboard-flow-row {
  display: grid;
  gap: 7px;
  padding: 11px 14px;
  border-top: 1px solid var(--enterprise-border);
}

.dashboard-flow-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--enterprise-text);
  font-size: 12px;
  font-weight: 720;
}

.dashboard-flow-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--enterprise-surface-muted);
}

.dashboard-flow-track span {
  display: block;
  height: 100%;
  min-width: 8px;
  border-radius: inherit;
  background: var(--enterprise-primary);
}

.dashboard-flow-row:nth-child(2) .dashboard-flow-track span {
  background: var(--enterprise-success);
}

.dashboard-flow-row:nth-child(3) .dashboard-flow-track span {
  background: var(--enterprise-warning);
}

.dashboard-flow-row:nth-child(4) .dashboard-flow-track span {
  background: var(--enterprise-danger);
}

.dashboard-reminder-row,
.dashboard-mini-row {
  display: grid;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-top: 1px solid var(--enterprise-border);
  background: transparent;
  color: var(--enterprise-text);
  text-align: left;
  cursor: pointer;
}

.dashboard-reminder-row {
  grid-template-columns: 26px minmax(0, 1fr) minmax(96px, 0.42fr);
}

.dashboard-mini-row {
  grid-template-columns: minmax(0, 1fr) minmax(112px, 0.48fr);
}

.dashboard-reminder-status {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid var(--enterprise-primary-line);
  border-radius: 999px;
  background: var(--enterprise-primary-soft);
  color: var(--enterprise-primary);
  font-size: 11px;
  font-weight: 800;
}

.dashboard-risk-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-risk-card {
  display: grid;
  min-width: 0;
  min-height: 94px;
  align-content: center;
  gap: 5px;
  padding: 12px 14px;
  border: 0;
  border-left: 1px solid var(--enterprise-border);
  background: transparent;
  color: var(--enterprise-text);
  text-align: left;
  cursor: pointer;
}

.dashboard-risk-card:first-child {
  border-left: 0;
}

.dashboard-risk-card strong {
  color: var(--enterprise-text);
  font-size: 24px;
  line-height: 1;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
}

.dashboard-risk-card.critical strong {
  color: var(--enterprise-danger);
}

.dashboard-risk-card.watch strong {
  color: var(--enterprise-warning);
}

.dashboard-risk-card.steady strong {
  color: var(--enterprise-primary);
}

.dashboard-empty-state {
  padding: 14px;
  color: var(--enterprise-muted);
  font-size: 12px;
}

html[data-theme="dark"] .dashboard-hero,
html[data-theme="dark"] .dashboard-panel,
html[data-theme="dark"] .dashboard-kpi-card {
  background: var(--enterprise-surface) !important;
}

html[data-theme="dark"] .dashboard-panel-header,
html[data-theme="dark"] .dashboard-kpi-card,
html[data-theme="dark"] .dashboard-flow-track {
  background: var(--enterprise-surface-subtle) !important;
}

@media (max-width: 1320px) {
  .dashboard-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "priority priority"
      "risk risk"
      "flow reminders"
      "windows billing";
  }
}

@media (max-width: 760px) {
  .dashboard-hero {
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 14px;
  }

  .dashboard-hero-actions {
    justify-content: stretch;
  }

  .dashboard-hero-actions .ui-button {
    flex: 1 1 0;
  }

  .dashboard-kpi-grid,
  .dashboard-risk-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "priority"
      "risk"
      "flow"
      "reminders"
      "windows"
      "billing";
  }

  .dashboard-action-row,
  .dashboard-reminder-row,
  .dashboard-mini-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-action-rank,
  .dashboard-reminder-status {
    display: none;
  }
}

@media (max-width: 340px) {
  .dashboard-kpi-grid,
  .dashboard-risk-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-hero-actions {
    flex-direction: column;
  }

  .dashboard-hero-actions .ui-button {
    width: 100%;
  }
}

/* Cross-page dashboard language */
#load-board-view .board-command,
.view:not(#dashboard-view):not(#load-board-view) > .section-heading {
  position: relative;
  min-height: 112px;
  align-items: center;
  border-radius: 8px;
  background: var(--enterprise-surface) !important;
}

#load-board-view .board-command::before,
.view:not(#dashboard-view):not(#load-board-view) > .section-heading::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  display: block !important;
  height: 3px;
  background: var(--enterprise-primary);
}

#load-board-view .board-command-main,
.view:not(#dashboard-view):not(#load-board-view) > .section-heading {
  padding: 18px !important;
}

.view:not(#dashboard-view):not(#load-board-view) > .section-heading > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

#load-board-view .board-kicker,
.view:not(#dashboard-view):not(#load-board-view) > .section-heading > div::before {
  color: var(--enterprise-primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: uppercase;
}

#billing-view > .section-heading > div::before {
  content: "Cash cycle";
}

#quotes-view > .section-heading > div::before {
  content: "Quote desk";
}

#billing-view .billing-kpi-grid {
  margin-top: -2px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#billing-view .billing-kpi-card {
  min-height: 104px;
  border-color: var(--enterprise-border) !important;
  background: var(--enterprise-surface) !important;
}

#billing-view .billing-kpi-card strong {
  font-size: 28px;
  line-height: 1;
}

#billing-view .billing-kpi-card small {
  max-width: 24ch;
}

#billing-view .billing-kpi-card.ready {
  border-color: var(--enterprise-success-border, var(--enterprise-border)) !important;
  background: var(--enterprise-success-soft, var(--enterprise-surface)) !important;
}

#billing-view .billing-kpi-card.watch {
  border-color: var(--enterprise-warning-border, var(--enterprise-border)) !important;
  background: var(--enterprise-warning-soft, var(--enterprise-surface)) !important;
}

#billing-view .billing-kpi-card.attention {
  border-color: var(--enterprise-danger-border, var(--enterprise-border)) !important;
  background: var(--enterprise-danger-soft, var(--enterprise-surface)) !important;
}

#customers-view > .section-heading > div::before {
  content: "Customer desk";
}

#carriers-view > .section-heading > div::before {
  content: "Carrier network";
}

#reports-view > .section-heading > div::before {
  content: "Performance intelligence";
}

#settings-view > .section-heading > div::before {
  content: "Admin controls";
}

.compact-summary,
.report-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.compact-summary .summary-item,
.report-stat-card,
#load-board-view .board-signal,
#load-board-view .board-focus-card {
  display: grid;
  min-height: 104px;
  align-content: space-between;
  gap: 8px;
  padding: 13px 14px;
  overflow: hidden;
  border: 1px solid var(--enterprise-border) !important;
  border-left: 3px solid var(--enterprise-primary) !important;
  border-radius: 7px;
  background: var(--enterprise-surface-subtle) !important;
  color: var(--enterprise-text);
  box-shadow: none;
}

.compact-summary .summary-item.attention,
.report-stat-card.watch,
#load-board-view .board-signal.critical {
  border-left-color: var(--enterprise-danger) !important;
}

#load-board-view .board-signal.watch {
  border-left-color: var(--enterprise-warning) !important;
}

#load-board-view .board-signal.ready,
#load-board-view .board-focus-card,
.compact-summary .summary-item:nth-child(4),
.compact-summary .summary-item:nth-child(5) {
  border-left-color: var(--enterprise-success) !important;
}

.compact-summary .summary-item span,
.report-stat-card span,
#load-board-view .board-signal span,
#load-board-view .board-focus-card span {
  color: var(--enterprise-muted) !important;
  font-size: 10px;
  font-weight: 760;
  line-height: 1.2;
  text-transform: uppercase;
}

.compact-summary .summary-item strong,
.report-stat-card strong,
#load-board-view .board-signal strong,
#load-board-view .board-focus-card strong {
  color: var(--enterprise-text) !important;
  font-size: 28px;
  font-weight: 780;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

#load-board-view .board-focus-card strong {
  font-size: 15px;
  line-height: 1.25;
}

.report-stat-card small,
#load-board-view .board-signal small,
#load-board-view .board-focus-card small {
  color: var(--enterprise-muted) !important;
  font-size: 11px;
  line-height: 1.35;
}

#load-board-view .board-work-strip .work-item {
  display: grid;
  position: relative;
  align-content: center;
  gap: 5px;
  min-height: 76px;
  padding: 12px 14px;
  overflow: hidden;
  border: 1px solid var(--enterprise-border) !important;
  border-left: 3px solid var(--enterprise-primary) !important;
  border-radius: 8px;
  background: var(--enterprise-surface) !important;
  box-shadow: var(--enterprise-shadow-xs);
}

#load-board-view .board-work-strip .work-item::before {
  display: none !important;
  content: none !important;
}

#load-board-view .board-work-strip .work-item.attention {
  border-left-color: var(--enterprise-danger) !important;
}

#load-board-view .board-work-strip .work-item.money {
  border-left-color: var(--enterprise-success) !important;
}

.view:not(#dashboard-view) > .table-toolbar,
#load-board-view .table-toolbar,
.panel.ui-card,
.settings-section,
.report-panel {
  border-radius: 8px;
}

.view:not(#dashboard-view) > .table-toolbar,
#load-board-view .table-toolbar {
  margin-top: 10px;
  border-bottom-color: var(--enterprise-border) !important;
  background: var(--enterprise-surface) !important;
}

.view:not(#dashboard-view) > .table-shell,
#load-board-view .table-shell {
  border-radius: 8px;
}

.view:not(#dashboard-view) > .table-toolbar + .table-shell,
#load-board-view .table-toolbar + .table-shell {
  margin-top: 8px !important;
}

.table-shell thead th,
.data-table thead th,
#load-board-view .load-table thead th {
  height: 42px;
  background: var(--enterprise-surface-muted) !important;
  letter-spacing: 0;
  text-transform: uppercase;
}

.table-shell tbody td,
.data-table tbody td,
.data-table-cell,
#load-board-view .load-table tbody td {
  height: 56px;
}

.panel.ui-card,
.settings-section,
.report-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header,
.ui-card-header {
  min-height: 56px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--enterprise-border) !important;
  background: var(--enterprise-surface-subtle) !important;
}

.panel-header h3,
.panel-header h4,
.report-panel .panel-header h3,
.settings-section .panel-header h3 {
  margin: 2px 0 0;
  color: var(--enterprise-text) !important;
  font-size: 15px;
  font-weight: 740;
  line-height: 1.2;
}

.panel-header p,
.report-panel .panel-header p,
.settings-section .panel-header p {
  margin: 4px 0 0;
  color: var(--enterprise-muted) !important;
  font-size: 12px;
  line-height: 1.35;
}

.report-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  grid-auto-flow: dense;
  gap: 10px;
}

.report-layout .report-panel:first-child {
  min-height: 0;
  grid-row: auto;
}

.report-layout .report-panel:nth-child(3) {
  grid-column: 1 / -1;
}

.trend-chart {
  display: flex;
  min-height: 228px;
  align-items: end;
  gap: 10px;
  margin: 14px;
  padding: 16px;
  border-radius: 8px;
}

.trend-chart span {
  flex: 1 1 0;
  min-width: 14px;
  border-radius: 5px 5px 0 0;
  background: var(--enterprise-primary) !important;
}

.chart-legend,
.mini-record-list {
  padding: 0 14px 14px;
}

.mini-record-row {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border: 0 !important;
  border-top: 1px solid var(--enterprise-border) !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none;
}

.mini-record-row:first-child {
  border-top: 0 !important;
}

.form-section,
.ui-form-section,
.fit-check-panel,
.movement-card,
.bol-drop-zone,
.wizard-panel {
  border-radius: 8px;
}

.form-section h4,
.ui-form-section h4 {
  color: var(--enterprise-text) !important;
  font-size: 14px;
  font-weight: 740;
}

.ui-form label,
.filters-modal label,
.load-form label {
  color: var(--enterprise-text-soft);
  font-size: 12px;
  font-weight: 680;
}

.ui-form input,
.ui-form textarea,
.filters-modal input,
.modal input,
.modal textarea,
.ui-select {
  min-height: 42px;
  border-radius: 7px;
  box-shadow: none;
}

.ui-form textarea,
.modal textarea {
  min-height: 96px;
}

.modal-backdrop,
.ui-dialog-overlay {
  background: rgba(8, 13, 22, 0.46) !important;
  backdrop-filter: blur(8px);
}

.modal,
.wide-modal,
.detail-modal,
.billing-detail-modal,
.ui-dialog-content {
  overflow: hidden;
  border-radius: 10px;
}

.notification-panel {
  top: max(12px, env(safe-area-inset-top)) !important;
  right: max(12px, env(safe-area-inset-right)) !important;
  bottom: max(12px, env(safe-area-inset-bottom)) !important;
  display: flex;
  width: min(390px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  height: auto !important;
  max-height: calc(100dvh - 24px);
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid var(--enterprise-border);
  border: 1px solid var(--enterprise-border);
  border-radius: 10px;
  background: var(--enterprise-surface) !important;
  color: var(--enterprise-text);
}

.notification-panel > .panel-header {
  flex: 0 0 auto;
  margin: 0;
  padding: 16px;
  border-bottom: 1px solid var(--enterprise-border);
  background: var(--enterprise-surface) !important;
}

.notification-panel > .reminder-list {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 16px 16px;
}

#carrier-modal-backdrop {
  align-items: center;
  padding: 16px;
}

#carrier-modal-backdrop .wide-modal {
  display: flex;
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  flex-direction: column;
  overflow: hidden;
}

#carrier-modal-backdrop .wide-modal > .panel-header {
  flex: 0 0 auto;
}

#carrier-modal-backdrop #carrier-form {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px;
}

#carrier-modal-backdrop #carrier-form .ui-dialog-footer {
  position: sticky;
  bottom: -14px;
  z-index: 2;
  margin: 4px -14px -14px;
  padding: 12px 14px;
  border-top: 1px solid var(--app-modal-border, var(--enterprise-border));
  background: var(--app-modal-frame-surface, var(--enterprise-surface)) !important;
}

#customer-modal-backdrop {
  align-items: center;
  padding: 16px;
}

#customer-modal-backdrop .wide-modal {
  display: flex;
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  flex-direction: column;
  overflow: hidden;
}

#customer-modal-backdrop .wide-modal > .panel-header {
  flex: 0 0 auto;
}

#customer-modal-backdrop #customer-form {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px;
}

#customer-modal-backdrop #customer-form .ui-dialog-footer {
  position: sticky;
  bottom: -14px;
  z-index: 2;
  margin: 4px -14px -14px;
  padding: 12px 14px;
  border-top: 1px solid var(--app-modal-border, var(--enterprise-border));
  background: var(--app-modal-frame-surface, var(--enterprise-surface)) !important;
}

#quote-modal-backdrop {
  align-items: center;
  padding: 16px;
}

#quote-modal-backdrop .wide-modal {
  display: flex;
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  flex-direction: column;
  overflow: hidden;
}

#quote-modal-backdrop .wide-modal > .panel-header {
  flex: 0 0 auto;
}

#quote-modal-backdrop #quote-form {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px;
}

#quote-modal-backdrop #quote-form .ui-dialog-footer {
  position: sticky;
  bottom: -14px;
  z-index: 2;
  margin: 4px -14px -14px;
  padding: 12px 14px;
  border-top: 1px solid var(--app-modal-border, var(--enterprise-border));
  background: var(--app-modal-frame-surface, var(--enterprise-surface)) !important;
}

#detail-modal-backdrop {
  align-items: center;
  padding: 16px;
}

#detail-modal-backdrop .detail-modal {
  display: flex;
  width: min(1120px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  flex-direction: column;
  overflow: hidden;
}

#detail-modal-backdrop .detail-modal > .panel-header {
  flex: 0 0 auto;
}

#detail-modal-content {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px;
}

#detail-modal-backdrop .detail-header {
  margin-bottom: 14px;
}

#detail-modal-backdrop .detail-title-row {
  gap: 18px;
}

#detail-modal-backdrop .detail-title-row .button-row {
  flex-wrap: wrap;
  justify-content: flex-end;
}

#detail-modal-backdrop .detail-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

#detail-modal-backdrop .detail-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 12px;
  border: 0 !important;
  background: transparent !important;
  color: var(--enterprise-text);
}

#detail-modal-backdrop .detail-tabs .panel {
  min-width: 0;
  border: 1px solid var(--enterprise-border) !important;
  border-radius: 8px !important;
  background: var(--enterprise-surface) !important;
  box-shadow: var(--alt-shadow-xs);
}

#detail-modal-backdrop .detail-tabs .panel-header {
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin: -16px -16px 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--enterprise-border) !important;
  border-radius: 8px 8px 0 0;
  background: var(--enterprise-surface-subtle);
}

#detail-modal-backdrop .detail-tabs .panel-header h3 {
  color: var(--enterprise-text) !important;
  font-size: 14px;
}

#detail-modal-backdrop .detail-tabs .text-button {
  min-height: 32px;
  border-radius: 6px;
  color: var(--enterprise-primary) !important;
}

#detail-modal-backdrop .detail-tabs .mini-record-list,
#detail-modal-backdrop .detail-tabs .bucket-list,
#detail-modal-backdrop .detail-tabs .detail-timeline-list,
#detail-modal-backdrop .detail-tabs .compact-readiness {
  padding: 0;
}

#detail-modal-backdrop .detail-tabs .mini-record-row,
#detail-modal-backdrop .detail-tabs .timeline-item,
#detail-modal-backdrop .detail-tabs .bucket,
#detail-modal-backdrop .detail-tabs .readiness-badge {
  border-color: var(--enterprise-border) !important;
  background: var(--enterprise-surface-subtle) !important;
  box-shadow: none;
}

#detail-modal-backdrop .detail-tabs .timeline-item + .timeline-item {
  margin-top: 8px;
}

html[data-theme="dark"] #detail-modal-backdrop .detail-tabs {
  background: transparent !important;
  color: var(--enterprise-text);
}

html[data-theme="dark"] #detail-modal-backdrop .detail-tabs .panel {
  border-color: var(--enterprise-border) !important;
  background: var(--enterprise-surface) !important;
  box-shadow: none;
}

html[data-theme="dark"] #detail-modal-backdrop .detail-tabs .panel-header {
  border-bottom-color: var(--enterprise-border) !important;
  background: var(--enterprise-surface-muted);
}

html[data-theme="dark"] #detail-modal-backdrop .detail-tabs .mini-record-row,
html[data-theme="dark"] #detail-modal-backdrop .detail-tabs .timeline-item,
html[data-theme="dark"] #detail-modal-backdrop .detail-tabs .bucket,
html[data-theme="dark"] #detail-modal-backdrop .detail-tabs .readiness-badge {
  border-color: var(--enterprise-border) !important;
  background: var(--enterprise-surface-muted) !important;
}

@media (max-width: 960px) {
  #detail-modal-backdrop .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #detail-modal-backdrop .detail-title-row {
    flex-direction: column;
  }

  #detail-modal-backdrop .detail-title-row .button-row {
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  #detail-modal-content {
    padding: 12px;
  }

  #detail-modal-backdrop .detail-grid,
  #detail-modal-backdrop .detail-tabs {
    grid-template-columns: 1fr;
  }
}

#billing-detail-modal-backdrop {
  align-items: center;
  padding: 16px;
}

#billing-detail-modal-backdrop .billing-detail-modal {
  display: flex;
  width: min(1120px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  flex-direction: column;
  overflow: hidden;
}

#billing-detail-modal-backdrop .billing-detail-modal > .panel-header {
  flex: 0 0 auto;
}

#billing-detail-modal-content {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px;
}

.wizard {
  gap: 12px;
}

.wizard-steps {
  border-radius: 8px;
}

#settings-view .wizard-steps button {
  border: 1px solid var(--enterprise-border-strong) !important;
  background: var(--enterprise-surface) !important;
  color: var(--enterprise-text-soft) !important;
  box-shadow: var(--enterprise-shadow-xs);
}

#settings-view .wizard-steps button:hover {
  border-color: var(--enterprise-primary-line) !important;
  background: var(--enterprise-primary-soft) !important;
  color: var(--enterprise-primary) !important;
}

#settings-view .wizard-steps button:focus-visible {
  outline: 2px solid var(--enterprise-primary);
  outline-offset: 2px;
}

#settings-view .wizard-steps button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

#settings-view .wizard-steps button {
  min-height: 42px;
  border-radius: 7px;
}

#settings-view .wizard-steps button.active {
  border-color: var(--enterprise-primary) !important;
  background: var(--enterprise-primary-soft) !important;
  color: var(--enterprise-primary) !important;
  box-shadow: inset 0 0 0 1px var(--enterprise-primary);
}

html[data-theme="dark"] .compact-summary .summary-item,
html[data-theme="dark"] .report-stat-card,
html[data-theme="dark"] #load-board-view .board-signal,
html[data-theme="dark"] #load-board-view .board-focus-card,
html[data-theme="dark"] .panel.ui-card,
html[data-theme="dark"] .settings-section,
html[data-theme="dark"] .report-panel,
html[data-theme="dark"] .form-section,
html[data-theme="dark"] .ui-form-section,
html[data-theme="dark"] .fit-check-panel,
html[data-theme="dark"] .movement-card,
html[data-theme="dark"] .bol-drop-zone,
html[data-theme="dark"] .wizard-panel {
  background: var(--enterprise-surface) !important;
  color: var(--enterprise-text);
}

html[data-theme="dark"] .compact-summary .summary-item,
html[data-theme="dark"] .report-stat-card,
html[data-theme="dark"] #load-board-view .board-signal,
html[data-theme="dark"] #load-board-view .board-focus-card {
  background: var(--enterprise-surface-subtle) !important;
}

#load-board-view .action-snapshot .board-signal.billing {
  border-left-color: var(--enterprise-primary) !important;
}

#load-board-view .action-snapshot .board-signal.action-card strong,
#load-board-next-action {
  font-size: 15px !important;
  line-height: 1.25 !important;
  white-space: normal;
}

#load-board-view .action-snapshot .board-signal.active,
#load-board-view .action-snapshot .board-signal[aria-pressed="true"] {
  border-color: var(--enterprise-primary) !important;
  box-shadow: inset 0 0 0 1px var(--enterprise-primary);
}

html[data-theme="dark"] #load-board-view .action-snapshot .board-signal {
  border-color: var(--enterprise-border-strong) !important;
  background:
    linear-gradient(180deg, rgba(96, 165, 250, 0.08), rgba(96, 165, 250, 0) 58%),
    var(--enterprise-surface-muted) !important;
  color: var(--enterprise-text) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 12px 26px rgba(0, 0, 0, 0.18);
}

html[data-theme="dark"] #load-board-view .action-snapshot .board-signal.critical {
  border-left-color: var(--enterprise-danger) !important;
}

html[data-theme="dark"] #load-board-view .action-snapshot .board-signal.watch {
  border-left-color: var(--enterprise-warning) !important;
}

html[data-theme="dark"] #load-board-view .action-snapshot .board-signal.billing {
  border-left-color: var(--enterprise-primary) !important;
}

html[data-theme="dark"] #load-board-view .action-snapshot .board-signal.ready {
  border-left-color: var(--enterprise-success) !important;
}

html[data-theme="dark"] #load-board-view .action-snapshot .board-signal span {
  color: #e2e8f0 !important;
  letter-spacing: 0;
}

html[data-theme="dark"] #load-board-view .action-snapshot .board-signal strong {
  color: #ffffff !important;
}

html[data-theme="dark"] #load-board-view .action-snapshot .board-signal small {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] #load-board-view .action-snapshot .board-signal:hover,
html[data-theme="dark"] #load-board-view .action-snapshot .board-signal:focus-visible {
  border-color: var(--enterprise-primary-line) !important;
  background:
    linear-gradient(180deg, rgba(96, 165, 250, 0.14), rgba(96, 165, 250, 0.03) 64%),
    var(--enterprise-surface-muted) !important;
}

html[data-theme="dark"] #load-board-view .action-snapshot .board-signal.active,
html[data-theme="dark"] #load-board-view .action-snapshot .board-signal[aria-pressed="true"] {
  border-color: var(--enterprise-primary) !important;
  box-shadow:
    inset 0 0 0 1px var(--enterprise-primary),
    0 12px 26px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .panel-header,
html[data-theme="dark"] .ui-card-header,
html[data-theme="dark"] .trend-chart,
html[data-theme="dark"] .wizard-steps {
  background: var(--enterprise-surface-subtle) !important;
}

@media (max-width: 1180px) {
  .report-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .report-layout .report-panel:first-child {
    grid-row: auto;
  }

  .report-layout .report-panel:nth-child(3) {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  #load-board-view .board-command,
  .view:not(#dashboard-view):not(#load-board-view) > .section-heading {
    min-height: 0;
  }

  .view:not(#dashboard-view):not(#load-board-view) > .section-heading {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .compact-summary,
  .report-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-actions {
    width: 100%;
  }

  .table-actions .ui-button {
    min-width: 0;
  }
}

@media (max-width: 340px) {
  .compact-summary,
  .report-stat-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Load Board v2: grouped rows prioritize fast operational scanning. */
#load-board-view .grouped-load-table {
  min-width: 1040px;
  table-layout: fixed;
}

#load-board-view .grouped-load-table .select-header,
#load-board-view .grouped-load-table .select-cell {
  width: 44px;
}

#load-board-view .grouped-load-table .actions-header,
#load-board-view .grouped-load-table .actions-cell {
  width: 58px;
}

#load-board-view .grouped-load-table [data-group-column="priority"] {
  width: 160px;
}

#load-board-view .grouped-load-table [data-group-column="load"] {
  width: 142px;
}

#load-board-view .grouped-load-table [data-group-column="laneSchedule"] {
  width: 214px;
}

#load-board-view .grouped-load-table [data-group-column="statusAction"] {
  width: 150px;
}

#load-board-view .grouped-load-table [data-group-column="carrierTeam"] {
  width: 141px;
}

#load-board-view .grouped-load-table [data-group-column="moneyBilling"] {
  width: 136px;
}

#load-board-view .load-summary-row {
  cursor: pointer;
}

#load-board-view .load-summary-row > td {
  height: 90px !important;
  vertical-align: middle;
}

#load-board-view .load-summary-row.is-expanded > td {
  border-bottom-color: transparent !important;
}

#load-board-view .operational-focus-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--enterprise-border);
  border-radius: 8px;
  background: var(--enterprise-surface);
  color: var(--enterprise-muted);
  font-size: 11.5px;
}

#load-board-view .legend-title {
  color: var(--enterprise-text);
  font-weight: 780;
}

#load-board-view .legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 9px;
  border: 1px solid var(--enterprise-border);
  border-radius: 999px;
  background: var(--enterprise-surface-subtle);
  color: var(--enterprise-muted);
  font-weight: 700;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

#load-board-view .legend-item:hover,
#load-board-view .legend-item:focus-visible,
#load-board-view .legend-item.active {
  border-color: var(--enterprise-primary);
  background: var(--enterprise-primary-soft);
  color: var(--enterprise-text) !important;
  outline: none;
}

#load-board-view .legend-item.active {
  box-shadow: inset 0 0 0 1px var(--enterprise-primary);
}

#load-board-view .legend-item strong {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--enterprise-surface);
  color: var(--enterprise-text);
  font-size: 10px;
  font-weight: 820;
  font-variant-numeric: tabular-nums;
}

#load-board-view .legend-item i {
  flex: 0 0 auto;
  width: 7px;
  height: 14px;
  border-radius: 999px;
  background: var(--enterprise-primary);
}

#load-board-view .legend-item.critical i {
  background: var(--enterprise-danger);
}

#load-board-view .legend-item.watch i {
  background: var(--enterprise-warning);
}

#load-board-view .legend-item.steady i {
  background: var(--enterprise-success);
}

#load-board-view .load-group-cell {
  overflow: hidden;
}

#load-board-view .scan-stack {
  display: grid;
  gap: 5px;
  min-width: 0;
}

#load-board-view .scan-line,
#load-board-view .route-line,
#load-board-view .money-line,
#load-board-view .priority-copy small,
#load-board-view .load-card-grid strong,
#load-board-view .load-card-grid small {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#load-board-view .scan-line > *,
#load-board-view .route-line > *,
#load-board-view .money-line > *,
#load-board-view .load-card-grid strong,
#load-board-view .load-card-grid small {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#load-board-view .scan-line-strong,
#load-board-view .route-line strong,
#load-board-view .money-line strong {
  color: var(--enterprise-text) !important;
  font-weight: 780;
}

#load-board-view .scan-muted {
  color: var(--enterprise-muted) !important;
}

#load-board-view .scan-dot {
  position: relative;
  flex: 0 1 auto;
  color: var(--enterprise-muted);
}

#load-board-view .scan-dot::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 3px;
  margin: 0 6px 2px 0;
  border-radius: 999px;
  background: var(--enterprise-border-strong);
}

#load-board-view .scan-tag {
  flex: 0 0 auto;
  padding: 2px 6px;
  border: 1px solid var(--enterprise-border);
  border-radius: 999px;
  background: var(--enterprise-surface-subtle);
  color: var(--enterprise-muted);
  font-size: 10px;
  font-weight: 760;
  line-height: 1.1;
}

#load-board-view .scan-tag.subtle {
  border-color: transparent;
  background: var(--enterprise-primary-soft);
  color: var(--enterprise-primary);
}

#load-board-view .priority-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

#load-board-view .row-expand-button {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--enterprise-border);
  border-radius: 7px;
  background: var(--enterprise-surface);
  color: var(--enterprise-muted);
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

#load-board-view .row-expand-button:hover,
#load-board-view .row-expand-button:focus-visible {
  border-color: var(--enterprise-primary);
  background: var(--enterprise-primary-soft);
  color: var(--enterprise-primary);
  outline: none;
}

#load-board-view .row-expand-button[aria-expanded="true"] svg {
  transform: rotate(90deg);
}

#load-board-view .row-expand-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 180ms ease;
}

#load-board-view .row-actions-button,
#load-board-view .row-actions-button.ui-button,
#load-board-view .row-actions-button.icon-button {
  display: grid;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  place-items: center;
  border: 1px solid transparent !important;
  border-radius: 8px;
  background: transparent !important;
  color: var(--enterprise-text-soft) !important;
  box-shadow: none !important;
}

#load-board-view .data-table-row:hover .row-actions-button,
#load-board-view .row-actions-button:hover,
#load-board-view .row-actions-button:focus-visible,
#load-board-view .row-action-menu[open] .row-actions-button {
  border-color: var(--enterprise-primary-line) !important;
  background: var(--enterprise-primary-soft) !important;
  color: var(--enterprise-primary-hover) !important;
  outline: none;
}

#load-board-view .row-actions-button span::before {
  background: currentColor;
  box-shadow: 0 7px 0 currentColor, 0 14px 0 currentColor;
}

#load-board-view .priority-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

#load-board-view .priority-label {
  display: block;
  min-width: 0;
  overflow: visible;
  color: var(--enterprise-text);
  font-weight: 780;
  line-height: 1.22;
  white-space: normal;
  text-overflow: clip;
  overflow-wrap: normal;
}

#load-board-view .priority-label.row-risk {
  color: var(--enterprise-danger);
}

#load-board-view .priority-label.row-watch {
  color: var(--enterprise-warning);
}

#load-board-view .priority-label.row-steady {
  color: var(--enterprise-success);
}

#load-board-view .route-line svg {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--enterprise-muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#load-board-view .schedule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

#load-board-view .date-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  height: 25px;
  padding: 2px 6px;
  border: 1px solid var(--enterprise-border);
  border-radius: 6px;
  background: var(--enterprise-surface-subtle);
}

#load-board-view .date-chip span {
  flex: 0 0 auto;
  color: var(--enterprise-muted);
  font-size: 9.5px;
  font-weight: 800;
}

#load-board-view .chip-date-input {
  min-width: 0 !important;
  width: 100% !important;
  height: 19px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--enterprise-text) !important;
  font-size: 11px !important;
  font-weight: 720;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

#load-board-view .doc-chip-row {
  display: flex;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
}

#load-board-view .doc-chip {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--enterprise-surface-subtle);
  color: var(--enterprise-muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#load-board-view .doc-chip.ready {
  background: var(--enterprise-success-soft);
  color: var(--enterprise-success);
}

#load-board-view .doc-chip.critical {
  background: var(--enterprise-danger-soft);
  color: var(--enterprise-danger);
}

#load-board-view .doc-chip.attention {
  background: var(--enterprise-warning-soft);
  color: var(--enterprise-warning);
}

#load-board-view .money-line {
  justify-content: space-between;
}

#load-board-view .money-line span {
  flex: 0 0 auto;
  color: var(--enterprise-muted);
  font-size: 10.5px;
  font-weight: 760;
  text-transform: uppercase;
}

#load-board-view .load-detail-row > td {
  height: auto !important;
  padding: 12px 10px !important;
  background: var(--enterprise-surface) !important;
}

#load-board-view .load-drilldown-panel {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr 1fr 1.25fr;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--enterprise-border);
  border-radius: 8px;
  background: var(--enterprise-surface-subtle);
}

#load-board-view .drilldown-section {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--enterprise-border);
  border-radius: 7px;
  background: var(--enterprise-surface);
}

#load-board-view .drilldown-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

#load-board-view .drilldown-section-head span,
#load-board-view .drilldown-mini-list span,
#load-board-view .drilldown-timeline span {
  color: var(--enterprise-muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

#load-board-view .drilldown-section-head strong,
#load-board-view .drilldown-mini-list strong,
#load-board-view .drilldown-timeline strong {
  min-width: 0;
  overflow: hidden;
  color: var(--enterprise-text);
  white-space: nowrap;
  text-overflow: ellipsis;
}

#load-board-view .drilldown-mini-list,
#load-board-view .drilldown-timeline {
  display: grid;
  gap: 7px;
}

#load-board-view .drilldown-mini-list > div,
#load-board-view .drilldown-timeline > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

#load-board-view .drilldown-mini-list small,
#load-board-view .drilldown-timeline small {
  min-width: 0;
  overflow: hidden;
  color: var(--enterprise-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

#load-board-view .drilldown-timeline .drilldown-address {
  white-space: normal;
  line-height: 1.35;
}

#load-board-view .load-card-list {
  display: none;
}

#load-board-view .load-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--enterprise-border);
  border-radius: 8px;
  background: var(--enterprise-surface);
}

#load-board-view .load-card.selected {
  border-color: var(--enterprise-primary-line);
  background: var(--enterprise-primary-soft);
}

#load-board-view .load-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--enterprise-primary);
  content: "";
}

#load-board-view .load-card.row-risk::before {
  background: var(--enterprise-danger);
}

#load-board-view .load-card.row-watch::before {
  background: var(--enterprise-warning);
}

#load-board-view .load-card.row-steady::before {
  background: var(--enterprise-success);
}

#load-board-view .load-card-top,
#load-board-view .load-card-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 10px 14px;
}

#load-board-view .load-card-top > div {
  min-width: 0;
  flex: 1 1 auto;
}

#load-board-view .mobile-select {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
}

#load-board-view .load-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 12px 10px 14px;
}

#load-board-view .load-card-grid > div {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 8px;
  border: 1px solid var(--enterprise-border);
  border-radius: 7px;
  background: var(--enterprise-surface-subtle);
}

#load-board-view .load-card-grid span {
  color: var(--enterprise-muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

#load-board-view .load-card-grid strong {
  color: var(--enterprise-text);
}

#load-board-view .load-card-grid small {
  color: var(--enterprise-muted);
}

#load-board-view .load-card-footer {
  justify-content: space-between;
  border-top: 1px solid var(--enterprise-border);
}

@media (max-width: 1180px) {
  #load-board-view .load-drilldown-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #load-board-view .drilldown-notes {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  #load-board-view .selection-action-bar {
    align-items: stretch;
    flex-direction: column;
  }

  #load-board-view .selection-action-buttons {
    justify-content: flex-end;
  }

  #load-board-view .table-shell {
    display: none;
  }

  #load-board-view .load-card-list {
    display: grid;
    gap: 10px;
    margin-top: 8px;
  }

  #load-board-view .load-card .load-drilldown-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 12px 12px 14px;
    padding: 8px;
  }

  #load-board-view .load-card .drilldown-section {
    padding: 8px;
  }

  #load-board-view .load-card .drilldown-timeline > div:nth-child(n + 3),
  #load-board-view .load-card .drilldown-mini-list > div:nth-child(n + 3) {
    display: none;
  }

  #load-board-view .load-card .drilldown-notes {
    grid-column: 1 / -1;
  }

  #load-board-view .load-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  #load-board-view .row-expand-button,
  #load-board-view .row-expand-button svg {
    transition: none;
  }
}

@media (max-width: 340px) {
  #load-board-view .load-card-grid,
  #load-board-view .load-card .load-drilldown-panel {
    grid-template-columns: 1fr;
  }
}

#columns-modal-backdrop .wide-modal {
  display: flex;
  flex-direction: column;
  width: min(1040px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: hidden;
}

#columns-modal-backdrop .wide-modal > .panel-header {
  flex: 0 0 auto;
}

#columns-modal-backdrop .advanced-config-layout {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

#columns-modal-backdrop .config-sidebar {
  align-self: start;
  position: sticky;
  top: 0;
  border: 1px solid var(--enterprise-border-strong) !important;
  background: var(--enterprise-surface-muted) !important;
  color: var(--enterprise-text-soft) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

#columns-modal-backdrop .config-nav-item {
  border: 1px solid transparent;
  background: transparent !important;
  color: var(--enterprise-text-soft) !important;
  cursor: pointer;
}

#columns-modal-backdrop .config-nav-item:hover,
#columns-modal-backdrop .config-nav-item:focus-visible {
  border-color: var(--enterprise-primary-line);
  background: var(--enterprise-primary-soft) !important;
  color: var(--enterprise-primary) !important;
  outline: none;
}

#columns-modal-backdrop .config-nav-item.active {
  border-color: var(--enterprise-primary-line);
  background: var(--enterprise-surface) !important;
  color: var(--enterprise-text) !important;
  box-shadow: 0 8px 18px rgba(29, 78, 216, 0.08);
}

#columns-modal-backdrop .config-nav-item:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

#columns-modal-backdrop .config-content {
  min-width: 0;
}

#columns-modal-backdrop .config-content section {
  scroll-margin-top: 12px;
}

#columns-modal-backdrop .config-content section:focus {
  outline: none;
}

#columns-modal-backdrop .ui-dialog-footer {
  flex: 0 0 auto;
  border-top: 1px solid var(--enterprise-border);
  background: var(--enterprise-surface);
}

html[data-theme="dark"] #columns-modal-backdrop .config-sidebar {
  border-color: var(--enterprise-border-strong) !important;
  background: var(--enterprise-surface-muted) !important;
  color: var(--enterprise-text-soft) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] #columns-modal-backdrop .config-nav-item {
  color: var(--enterprise-text-soft) !important;
}

html[data-theme="dark"] #columns-modal-backdrop .config-nav-item:hover,
html[data-theme="dark"] #columns-modal-backdrop .config-nav-item:focus-visible {
  border-color: var(--enterprise-primary-line);
  background: var(--enterprise-primary-soft) !important;
  color: var(--enterprise-primary-hover) !important;
}

html[data-theme="dark"] #columns-modal-backdrop .config-nav-item.active {
  border-color: var(--enterprise-primary-line);
  background: var(--enterprise-surface) !important;
  color: var(--enterprise-text) !important;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] #columns-modal-backdrop .ui-dialog-footer {
  border-top-color: var(--enterprise-border);
  background: var(--enterprise-surface);
}

@media (max-width: 720px) {
  #billing-view .billing-kpi-grid {
    grid-template-columns: 1fr;
  }

  #columns-modal-backdrop .advanced-config-layout {
    grid-template-columns: 1fr;
  }

  #columns-modal-backdrop .config-sidebar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  #columns-modal-backdrop .config-nav-item {
    text-align: center;
  }
}

#load-modal-backdrop {
  align-items: center;
  padding: 16px;
}

#load-modal-backdrop .wide-modal {
  display: flex;
  flex-direction: column;
  width: min(1120px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: hidden;
}

#load-modal-backdrop .wide-modal > .panel-header {
  flex: 0 0 auto;
}

#load-form {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px;
}

#load-form .bol-drop-zone,
#load-form .form-section,
#load-form .fit-check-panel {
  flex: 0 0 auto;
}

#load-form > .ui-dialog-footer {
  position: sticky;
  bottom: -14px;
  z-index: 2;
  margin: 0 -14px -14px;
  padding: 12px 14px;
  border-top: 1px solid var(--app-modal-border, var(--enterprise-border));
  background: var(--app-modal-frame-surface, var(--enterprise-surface)) !important;
  box-shadow: 0 -12px 24px rgba(15, 23, 42, 0.06);
}

html[data-theme="dark"] #load-form > .ui-dialog-footer {
  border-top-color: var(--app-modal-border, var(--enterprise-border));
  background: var(--app-modal-frame-surface, var(--enterprise-surface)) !important;
  box-shadow: 0 -12px 24px rgba(0, 0, 0, 0.22);
}

.searchable-select.dismissed .searchable-select-menu {
  display: none !important;
}

.search,
.table-search,
.ui-input-shell {
  border: 1px solid var(--enterprise-border-strong) !important;
  background: var(--enterprise-surface) !important;
  color: var(--enterprise-text) !important;
  box-shadow: none !important;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.search input,
.table-search input,
.ui-input-shell input {
  border: 0 !important;
  background: transparent !important;
  color: inherit !important;
  box-shadow: none !important;
  outline: 0 !important;
}

.search input:focus,
.table-search input:focus,
.ui-input-shell input:focus {
  border: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
}

.search:focus-within,
.table-search:focus-within,
.ui-input-shell:focus-within,
.topbar .search:focus-within {
  border-color: var(--enterprise-primary) !important;
  background: var(--enterprise-surface) !important;
  box-shadow: 0 0 0 3px var(--enterprise-primary-soft) !important;
  outline: none !important;
}

html[data-theme="dark"] .search,
html[data-theme="dark"] .table-search,
html[data-theme="dark"] .ui-input-shell {
  border-color: var(--enterprise-border-strong) !important;
  background: var(--enterprise-surface-muted) !important;
  color: var(--enterprise-text) !important;
}

html[data-theme="dark"] .search:focus-within,
html[data-theme="dark"] .table-search:focus-within,
html[data-theme="dark"] .ui-input-shell:focus-within,
html[data-theme="dark"] .topbar .search:focus-within {
  border-color: var(--enterprise-primary) !important;
  background: var(--enterprise-surface) !important;
  box-shadow: 0 0 0 3px var(--enterprise-primary-soft) !important;
}

@media (max-width: 720px) {
  #load-modal-backdrop {
    padding: 10px;
  }

  #load-modal-backdrop .wide-modal {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
  }

  #load-form {
    padding: 12px;
  }

  #load-form > .ui-dialog-footer {
    bottom: -12px;
    margin: 0 -12px -12px;
    padding: 12px;
  }
}

/* App-wide table toolbar actions should read as active outline buttons in both themes. */
.table-actions .secondary-action,
.table-actions .compact-action,
.table-actions .ui-button-outline,
.table-toolbar .secondary-action,
.table-toolbar .compact-action,
.table-toolbar .ui-button-outline,
.data-table-toolbar .secondary-action,
.data-table-toolbar .compact-action,
.data-table-toolbar .ui-button-outline {
  border-color: var(--enterprise-border-strong) !important;
  background: var(--enterprise-surface) !important;
  color: var(--enterprise-text) !important;
  box-shadow: none !important;
}

.table-actions .secondary-action svg,
.table-actions .compact-action svg,
.table-actions .ui-button-outline svg,
.table-toolbar .secondary-action svg,
.table-toolbar .compact-action svg,
.table-toolbar .ui-button-outline svg,
.data-table-toolbar .secondary-action svg,
.data-table-toolbar .compact-action svg,
.data-table-toolbar .ui-button-outline svg {
  color: currentColor !important;
  stroke: currentColor !important;
}

.table-actions .secondary-action:hover,
.table-actions .compact-action:hover,
.table-actions .ui-button-outline:hover,
.table-actions .secondary-action:focus-visible,
.table-actions .compact-action:focus-visible,
.table-actions .ui-button-outline:focus-visible,
.table-toolbar .secondary-action:hover,
.table-toolbar .compact-action:hover,
.table-toolbar .ui-button-outline:hover,
.table-toolbar .secondary-action:focus-visible,
.table-toolbar .compact-action:focus-visible,
.table-toolbar .ui-button-outline:focus-visible,
.data-table-toolbar .secondary-action:hover,
.data-table-toolbar .compact-action:hover,
.data-table-toolbar .ui-button-outline:hover,
.data-table-toolbar .secondary-action:focus-visible,
.data-table-toolbar .compact-action:focus-visible,
.data-table-toolbar .ui-button-outline:focus-visible {
  border-color: var(--enterprise-primary-line) !important;
  background: var(--enterprise-primary-soft) !important;
  color: var(--enterprise-primary) !important;
}

html[data-theme="dark"] .table-actions .secondary-action,
html[data-theme="dark"] .table-actions .compact-action,
html[data-theme="dark"] .table-actions .ui-button-outline,
html[data-theme="dark"] .table-toolbar .secondary-action,
html[data-theme="dark"] .table-toolbar .compact-action,
html[data-theme="dark"] .table-toolbar .ui-button-outline,
html[data-theme="dark"] .data-table-toolbar .secondary-action,
html[data-theme="dark"] .data-table-toolbar .compact-action,
html[data-theme="dark"] .data-table-toolbar .ui-button-outline {
  border-color: var(--enterprise-border-strong) !important;
  background: var(--enterprise-surface-muted) !important;
  color: var(--enterprise-text) !important;
}

html[data-theme="dark"] .table-actions .secondary-action:hover,
html[data-theme="dark"] .table-actions .compact-action:hover,
html[data-theme="dark"] .table-actions .ui-button-outline:hover,
html[data-theme="dark"] .table-actions .secondary-action:focus-visible,
html[data-theme="dark"] .table-actions .compact-action:focus-visible,
html[data-theme="dark"] .table-actions .ui-button-outline:focus-visible,
html[data-theme="dark"] .table-toolbar .secondary-action:hover,
html[data-theme="dark"] .table-toolbar .compact-action:hover,
html[data-theme="dark"] .table-toolbar .ui-button-outline:hover,
html[data-theme="dark"] .table-toolbar .secondary-action:focus-visible,
html[data-theme="dark"] .table-toolbar .compact-action:focus-visible,
html[data-theme="dark"] .table-toolbar .ui-button-outline:focus-visible,
html[data-theme="dark"] .data-table-toolbar .secondary-action:hover,
html[data-theme="dark"] .data-table-toolbar .compact-action:hover,
html[data-theme="dark"] .data-table-toolbar .ui-button-outline:hover,
html[data-theme="dark"] .data-table-toolbar .secondary-action:focus-visible,
html[data-theme="dark"] .data-table-toolbar .compact-action:focus-visible,
html[data-theme="dark"] .data-table-toolbar .ui-button-outline:focus-visible {
  border-color: var(--enterprise-primary-line) !important;
  background: var(--enterprise-primary-soft) !important;
  color: var(--enterprise-primary-hover) !important;
}

/* Quote detail modal should use the same scrollable, theme-aware modal standard. */
#quote-detail-backdrop {
  align-items: flex-start;
  padding: 24px;
  overflow: auto;
}

#quote-detail-backdrop .quote-detail-modal {
  display: flex;
  flex-direction: column;
  width: min(1180px, calc(100vw - 48px));
  max-height: calc(100dvh - 48px);
  overflow: hidden;
}

#quote-detail-backdrop .quote-detail-modal > .panel-header {
  flex: 0 0 auto;
}

#quote-detail-backdrop .quote-detail-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
}

#quote-detail-backdrop .quote-detail-hero,
#quote-detail-backdrop .panel,
#quote-detail-backdrop .quote-copy-card,
#quote-detail-backdrop .quote-response-card,
#quote-detail-backdrop .quote-rate-grid > div,
#quote-detail-backdrop .quote-accessorial-row {
  border-color: var(--enterprise-border) !important;
  background: var(--enterprise-surface) !important;
  color: var(--enterprise-text) !important;
}

#quote-detail-backdrop .quote-detail-hero {
  border-top-color: var(--enterprise-primary) !important;
  border-radius: 8px;
}

#quote-detail-backdrop .quote-copy-card {
  background: var(--enterprise-surface-subtle) !important;
}

#quote-detail-backdrop .quote-copy-table,
#quote-detail-backdrop .quote-copy-table tbody,
#quote-detail-backdrop .quote-copy-table tr,
#quote-detail-backdrop .quote-copy-table td {
  background: transparent !important;
}

#quote-detail-backdrop .quote-copy-table td {
  border-color: var(--enterprise-border) !important;
  color: var(--enterprise-text) !important;
}

#quote-detail-backdrop .quote-copy-table .cell-sub,
#quote-detail-backdrop .quote-copy-header span,
#quote-detail-backdrop .quote-response-card span,
#quote-detail-backdrop .quote-rate-grid span,
#quote-detail-backdrop .quote-accessorial-row span,
#quote-detail-backdrop .quote-response-head p,
#quote-detail-backdrop .quote-response-note {
  color: var(--enterprise-text-soft) !important;
}

#quote-detail-backdrop .quote-copy-header strong,
#quote-detail-backdrop .quote-detail-hero h2,
#quote-detail-backdrop .quote-detail-hero p,
#quote-detail-backdrop .quote-response-head h4,
#quote-detail-backdrop .quote-rate-grid strong,
#quote-detail-backdrop .quote-accessorial-row strong {
  color: var(--enterprise-text) !important;
}

#quote-detail-backdrop .quote-response-card.winner {
  border-color: var(--enterprise-success-border, var(--enterprise-primary-line)) !important;
  background: var(--enterprise-success-soft, var(--enterprise-surface-subtle)) !important;
}

html[data-theme="dark"] #quote-detail-backdrop .quote-detail-hero,
html[data-theme="dark"] #quote-detail-backdrop .panel,
html[data-theme="dark"] #quote-detail-backdrop .quote-response-card,
html[data-theme="dark"] #quote-detail-backdrop .quote-rate-grid > div,
html[data-theme="dark"] #quote-detail-backdrop .quote-accessorial-row {
  background: var(--enterprise-surface) !important;
}

html[data-theme="dark"] #quote-detail-backdrop .quote-copy-card {
  background: var(--enterprise-surface-muted) !important;
}

/* Reminder drawer sits above sticky app chrome and remains fully clickable. */
.notification-panel {
  top: max(16px, env(safe-area-inset-top)) !important;
  right: max(16px, env(safe-area-inset-right)) !important;
  bottom: max(16px, env(safe-area-inset-bottom)) !important;
  z-index: 80 !important;
  pointer-events: auto;
  transform: translateX(calc(100% + 24px));
}

.notification-panel.open {
  transform: translateX(0) !important;
}

.notification-panel > .panel-header {
  position: relative;
  z-index: 2;
}

.notification-panel #close-reminders {
  position: relative;
  z-index: 3;
}

/* Load detail notes timeline uses the compact dark list standard, not global light activity cards. */
#detail-modal-backdrop .detail-timeline-list {
  display: grid;
  gap: 0;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--enterprise-border) !important;
  border-radius: 8px;
  background: var(--enterprise-surface-subtle) !important;
}

#detail-modal-backdrop .detail-timeline-list .activity-list-item {
  display: grid;
  grid-template-columns: minmax(150px, 0.36fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin: 0;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--enterprise-border) !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
}

#detail-modal-backdrop .detail-timeline-list .activity-list-item:last-child {
  border-bottom: 0 !important;
}

#detail-modal-backdrop .detail-timeline-list .activity-meta {
  display: grid;
  gap: 3px;
  color: var(--enterprise-text-soft) !important;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
}

#detail-modal-backdrop .detail-timeline-list .activity-list-item strong {
  color: var(--enterprise-text) !important;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

html[data-theme="dark"] #detail-modal-backdrop .detail-timeline-list {
  background: var(--enterprise-surface-muted) !important;
}

/* Top load-detail latest updates should match the modal surface, not the global light activity list. */
#detail-modal-backdrop .detail-grid {
  background: transparent !important;
}

#detail-modal-backdrop .tracking-note-rollup {
  border: 1px solid var(--enterprise-border) !important;
  border-radius: 8px;
  background: var(--enterprise-surface) !important;
  overflow: hidden;
}

#detail-modal-backdrop .tracking-note-rollup .compact-panel-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--enterprise-border) !important;
  background: var(--enterprise-surface-subtle) !important;
}

#detail-modal-backdrop .tracking-note-rollup .compact-panel-header h5 {
  margin: 0 0 4px;
  color: var(--enterprise-text) !important;
}

#detail-modal-backdrop .tracking-note-rollup .compact-panel-header p {
  margin: 0;
  color: var(--enterprise-text-soft) !important;
}

#detail-modal-backdrop .tracking-note-rollup .activity-list {
  gap: 0;
  max-height: 180px;
  overflow-y: auto;
  border: 0 !important;
  border-radius: 0;
  background: var(--enterprise-surface-subtle) !important;
}

#detail-modal-backdrop .tracking-note-rollup .activity-list-item {
  margin: 0;
  padding: 10px 14px;
  border-bottom: 1px solid var(--enterprise-border) !important;
  background: transparent !important;
  box-shadow: none !important;
}

#detail-modal-backdrop .tracking-note-rollup .activity-list-item:last-child {
  border-bottom: 0 !important;
}

#detail-modal-backdrop .tracking-note-rollup .activity-meta {
  color: var(--enterprise-text-soft) !important;
}

#detail-modal-backdrop .tracking-note-rollup .activity-list-item strong {
  color: var(--enterprise-text) !important;
}

html[data-theme="dark"] #detail-modal-backdrop .tracking-note-rollup,
html[data-theme="dark"] #detail-modal-backdrop .tracking-note-rollup .compact-panel-header,
html[data-theme="dark"] #detail-modal-backdrop .tracking-note-rollup .activity-list {
  background: var(--enterprise-surface-muted) !important;
}

/*
 * Enterprise Graphite refinement.
 *
 * 21st.dev references synthesized:
 * - Sapphire Dawn: crisp enterprise foundation, desaturated for premium tech.
 * - Cobalt Mist: cyan/teal operational accent, kept away from primary controls.
 * - Azure Flow: bright, clean light surfaces with calm contrast.
 *
 * This layer intentionally avoids broad decorative glassmorphism. Frosted
 * effects are limited to command surfaces and priority cards where elevation
 * helps hierarchy.
 */

:root,
html[data-theme="light"] {
  --enterprise-canvas: #f7f8fa;
  --enterprise-canvas-raised: #eef1f5;
  --enterprise-surface: #ffffff;
  --enterprise-surface-subtle: #fbfcfd;
  --enterprise-surface-muted: #f2f5f8;
  --enterprise-surface-hover: #edf2f7;
  --enterprise-text: #07111f;
  --enterprise-text-soft: #26384f;
  --enterprise-muted: #596b83;
  --enterprise-faint: #8493a8;
  --enterprise-border: #d7dde6;
  --enterprise-border-strong: #bbc6d3;
  --enterprise-primary: #111827;
  --enterprise-primary-hover: #030712;
  --enterprise-primary-soft: #eef2f6;
  --enterprise-primary-line: #c3ccd8;
  --enterprise-accent: #0891b2;
  --enterprise-accent-hover: #0e7490;
  --enterprise-accent-soft: #e7fafe;
  --enterprise-accent-line: #9de7f2;
  --enterprise-success: #0f766e;
  --enterprise-success-soft: #e9fbf7;
  --enterprise-success-line: #94e2d1;
  --enterprise-warning: #a76609;
  --enterprise-warning-soft: #fff7e6;
  --enterprise-warning-line: #e8ca78;
  --enterprise-danger: #be123c;
  --enterprise-danger-soft: #fff0f4;
  --enterprise-danger-line: #f4adbf;
  --enterprise-rail: #080b12;
  --enterprise-rail-raised: #111827;
  --enterprise-rail-text: #eef5ff;
  --enterprise-rail-muted: #9aa6b8;
  --enterprise-rail-border: rgba(255, 255, 255, 0.1);
  --enterprise-glass: rgba(255, 255, 255, 0.86);
  --enterprise-shadow-xs: 0 1px 2px rgba(7, 17, 31, 0.06);
  --enterprise-shadow-sm: 0 10px 28px rgba(19, 49, 93, 0.1);
  --enterprise-shadow-md: 0 28px 80px rgba(19, 49, 93, 0.18);
  --enterprise-shadow-focus: 0 0 0 3px rgba(15, 23, 42, 0.16);

  --alt-canvas: var(--enterprise-canvas);
  --alt-canvas-strong: var(--enterprise-canvas-raised);
  --alt-surface: var(--enterprise-surface);
  --alt-surface-subtle: var(--enterprise-surface-subtle);
  --alt-surface-muted: var(--enterprise-surface-muted);
  --alt-surface-hover: var(--enterprise-surface-hover);
  --alt-text: var(--enterprise-text);
  --alt-text-soft: var(--enterprise-text-soft);
  --alt-muted: var(--enterprise-muted);
  --alt-border: var(--enterprise-border);
  --alt-border-strong: var(--enterprise-border-strong);
  --alt-primary: var(--enterprise-primary);
  --alt-primary-hover: var(--enterprise-primary-hover);
  --alt-primary-solid: var(--enterprise-primary);
  --alt-primary-solid-hover: var(--enterprise-primary-hover);
  --alt-primary-soft: var(--enterprise-primary-soft);
  --alt-primary-border: var(--enterprise-primary-line);
  --alt-cyan: var(--enterprise-accent);
  --alt-success: var(--enterprise-success);
  --alt-success-soft: var(--enterprise-success-soft);
  --alt-success-border: var(--enterprise-success-line);
  --alt-warning: var(--enterprise-warning);
  --alt-warning-soft: var(--enterprise-warning-soft);
  --alt-warning-border: var(--enterprise-warning-line);
  --alt-danger: var(--enterprise-danger);
  --alt-danger-soft: var(--enterprise-danger-soft);
  --alt-danger-border: var(--enterprise-danger-line);
  --alt-sidebar: var(--enterprise-rail);
  --alt-sidebar-raised: var(--enterprise-rail-raised);
  --alt-sidebar-text: var(--enterprise-rail-text);
  --alt-sidebar-muted: var(--enterprise-rail-muted);
  --alt-sidebar-border: var(--enterprise-rail-border);
  --alt-focus: rgba(15, 23, 42, 0.18);
  --alt-shadow-xs: var(--enterprise-shadow-xs);
  --alt-shadow-sm: var(--enterprise-shadow-sm);
  --alt-shadow-md: var(--enterprise-shadow-md);
}

html[data-theme="dark"] {
  --enterprise-canvas: #070c14;
  --enterprise-canvas-raised: #0b121f;
  --enterprise-surface: #101827;
  --enterprise-surface-subtle: #0d1522;
  --enterprise-surface-muted: #162033;
  --enterprise-surface-hover: #1b2940;
  --enterprise-text: #f4f8ff;
  --enterprise-text-soft: #d5dfec;
  --enterprise-muted: #9aabc1;
  --enterprise-faint: #738198;
  --enterprise-border: #25344a;
  --enterprise-border-strong: #3a4d67;
  --enterprise-primary: #64748b;
  --enterprise-primary-hover: #475569;
  --enterprise-primary-soft: rgba(148, 163, 184, 0.16);
  --enterprise-primary-line: rgba(148, 163, 184, 0.38);
  --enterprise-accent: #67e8f9;
  --enterprise-accent-hover: #a5f3fc;
  --enterprise-accent-soft: rgba(8, 145, 178, 0.13);
  --enterprise-accent-line: rgba(103, 232, 249, 0.3);
  --enterprise-success: #5eead4;
  --enterprise-success-soft: rgba(20, 184, 166, 0.12);
  --enterprise-success-line: rgba(94, 234, 212, 0.32);
  --enterprise-warning: #fbbf24;
  --enterprise-warning-soft: rgba(245, 158, 11, 0.12);
  --enterprise-warning-line: rgba(251, 191, 36, 0.32);
  --enterprise-danger: #fb7185;
  --enterprise-danger-soft: rgba(244, 63, 94, 0.12);
  --enterprise-danger-line: rgba(251, 113, 133, 0.32);
  --enterprise-rail: #050912;
  --enterprise-rail-raised: #0c1422;
  --enterprise-rail-text: #eef5ff;
  --enterprise-rail-muted: #8fa0b6;
  --enterprise-rail-border: rgba(255, 255, 255, 0.08);
  --enterprise-glass: rgba(16, 24, 39, 0.88);
  --enterprise-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.26);
  --enterprise-shadow-sm: 0 12px 30px rgba(0, 0, 0, 0.24);
  --enterprise-shadow-md: 0 28px 82px rgba(0, 0, 0, 0.46);
  --enterprise-shadow-focus: 0 0 0 3px rgba(148, 163, 184, 0.22);
}

html,
body,
.app-shell.ui-app-shell,
.main.ui-main {
  background:
    linear-gradient(180deg, var(--enterprise-canvas) 0%, var(--enterprise-canvas-raised) 100%) !important;
}

body {
  color: var(--enterprise-text);
}

.sidebar.ui-sidebar {
  border-right-color: var(--enterprise-rail-border);
  background:
    linear-gradient(180deg, #121826 0%, var(--enterprise-rail) 46%, #05070c 100%) !important;
  color: var(--enterprise-rail-text);
  box-shadow: 10px 0 34px rgba(15, 26, 47, 0.12);
}

html[data-theme="dark"] .sidebar.ui-sidebar {
  background:
    linear-gradient(180deg, #0b1220 0%, var(--enterprise-rail) 52%, #030711 100%) !important;
  box-shadow: 10px 0 34px rgba(0, 0, 0, 0.24);
}

.brand.ui-sidebar-header {
  border-bottom-color: var(--enterprise-rail-border);
}

.brand-logo {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.brand-copy strong {
  color: var(--enterprise-rail-text);
}

.brand-copy span {
  color: var(--enterprise-rail-muted);
}

.nav-item.ui-sidebar-menu-button {
  border-radius: 8px;
  color: var(--enterprise-rail-muted);
}

.nav-item.ui-sidebar-menu-button:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}

.nav-item.ui-sidebar-menu-button.active {
  border-color: rgba(255, 255, 255, 0.22);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.12), rgba(8, 145, 178, 0.16));
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.nav-item.ui-sidebar-menu-button.active::before {
  width: 3px;
  background: #22d3ee;
}

.nav-item.ui-sidebar-menu-button .nav-icon {
  color: currentColor;
}

.nav-item.ui-sidebar-menu-button:hover .nav-icon,
.nav-item.ui-sidebar-menu-button.active .nav-icon {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

.sidebar-toggle.ui-button {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--enterprise-rail-muted);
}

.sidebar-toggle.ui-button:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.topbar.ui-topbar {
  border-bottom-color: rgba(187, 198, 211, 0.75);
  background: rgba(247, 248, 250, 0.88) !important;
  backdrop-filter: blur(14px) saturate(1.25);
}

html[data-theme="dark"] .topbar.ui-topbar {
  border-bottom-color: rgba(58, 77, 103, 0.75);
  background: rgba(7, 12, 20, 0.84) !important;
}

.topbar .search,
.topbar .ui-select,
.topbar .ui-select-wrap.is-searchable-select .searchable-select input,
.topbar .theme-toggle,
.topbar .reminder-button,
.search,
.table-search,
.ui-input-shell {
  border-color: var(--enterprise-border-strong) !important;
  background: var(--enterprise-glass) !important;
  color: var(--enterprise-text-soft) !important;
  box-shadow: var(--enterprise-shadow-xs);
}

.search:focus-within,
.table-search:focus-within,
.ui-input-shell:focus-within,
.topbar .ui-select-wrap.is-searchable-select .searchable-select:focus-within input,
.topbar .search:focus-within {
  border-color: var(--enterprise-primary) !important;
  box-shadow: var(--enterprise-shadow-focus) !important;
}

.primary-action,
.ui-button-primary,
.board-command .primary-action,
.view > .section-heading .primary-action,
.primary-action.ui-button-primary {
  border-color: var(--enterprise-primary) !important;
  background: linear-gradient(180deg, var(--enterprise-primary), var(--enterprise-primary-hover)) !important;
  color: #ffffff !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.2);
}

.primary-action:hover,
.ui-button-primary:hover,
.board-command .primary-action:hover,
.view > .section-heading .primary-action:hover,
.primary-action.ui-button-primary:hover {
  border-color: var(--enterprise-primary-hover) !important;
  background: linear-gradient(180deg, #1f2937, var(--enterprise-primary-hover)) !important;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.26);
}

.secondary-action,
.ui-button-outline,
.compact-action,
.text-button,
.icon-button {
  border-color: var(--enterprise-border-strong) !important;
  background: var(--enterprise-surface) !important;
  color: var(--enterprise-text-soft) !important;
}

.secondary-action:hover,
.ui-button-outline:hover,
.compact-action:hover,
.text-button:hover,
.icon-button:hover {
  border-color: var(--enterprise-primary-line) !important;
  background: var(--enterprise-primary-soft) !important;
  color: var(--enterprise-primary) !important;
}

.dashboard-hero,
#load-board-view .board-command,
.view:not(#dashboard-view):not(#load-board-view) > .section-heading {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--enterprise-border) !important;
  border-radius: 10px !important;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(242, 245, 248, 0.86)),
    var(--enterprise-surface) !important;
  box-shadow: var(--enterprise-shadow-sm) !important;
}

html[data-theme="dark"] .dashboard-hero,
html[data-theme="dark"] #load-board-view .board-command,
html[data-theme="dark"] .view:not(#dashboard-view):not(#load-board-view) > .section-heading {
  background:
    linear-gradient(135deg, rgba(16, 24, 39, 0.95), rgba(22, 32, 51, 0.82)),
    var(--enterprise-surface) !important;
}

.dashboard-hero::before,
#load-board-view .board-command::before,
.view:not(#dashboard-view):not(#load-board-view) > .section-heading::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  display: block !important;
  height: 4px;
  background: linear-gradient(90deg, var(--enterprise-primary), var(--enterprise-accent));
}

.dashboard-hero h2,
#load-board-view .board-command-title h2,
.view > .section-heading h2 {
  color: var(--enterprise-text) !important;
  letter-spacing: 0;
}

.board-kicker,
#dashboard-view .board-kicker,
#load-board-view .board-kicker,
.dashboard-panel-header span,
.dashboard-kpi-card span,
.metric-card span,
.board-signal span {
  color: var(--enterprise-primary) !important;
  font-weight: 820;
  letter-spacing: 0.01em;
}

html[data-theme="dark"] .board-kicker,
html[data-theme="dark"] #dashboard-view .board-kicker,
html[data-theme="dark"] #load-board-view .board-kicker,
html[data-theme="dark"] .dashboard-panel-header span,
html[data-theme="dark"] .dashboard-kpi-card span,
html[data-theme="dark"] .metric-card span,
html[data-theme="dark"] .board-signal span {
  color: var(--enterprise-muted) !important;
}

.dashboard-hero p,
#load-board-view .board-command-title p,
.view > .section-heading p {
  color: var(--enterprise-muted) !important;
}

.dashboard-kpi-card,
.metric-card,
#load-board-view .board-signal,
#load-board-view .board-focus-card,
.compact-summary .summary-item,
.report-stat-card {
  position: relative;
  min-height: 108px;
  border: 1px solid var(--enterprise-border) !important;
  border-left: 4px solid var(--enterprise-primary) !important;
  border-radius: 9px !important;
  background:
    linear-gradient(180deg, var(--enterprise-surface), var(--enterprise-surface-subtle)) !important;
  color: var(--enterprise-text);
  box-shadow: var(--enterprise-shadow-xs) !important;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background-color 160ms ease;
}

.dashboard-kpi-card:hover,
#load-board-view .board-signal:hover,
#load-board-view .board-focus-card:hover {
  border-color: var(--enterprise-primary-line) !important;
  box-shadow: var(--enterprise-shadow-sm) !important;
  transform: translateY(-1px);
}

.dashboard-kpi-card.critical,
#load-board-view .board-signal.critical,
.compact-summary .summary-item.attention,
.report-stat-card.watch {
  border-left-color: var(--enterprise-danger) !important;
  background:
    linear-gradient(180deg, var(--enterprise-surface), var(--enterprise-danger-soft)) !important;
}

.dashboard-kpi-card.watch,
#load-board-view .board-signal.watch {
  border-left-color: var(--enterprise-warning) !important;
  background:
    linear-gradient(180deg, var(--enterprise-surface), var(--enterprise-warning-soft)) !important;
}

.dashboard-kpi-card.billing,
#load-board-view .board-signal.billing {
  border-left-color: var(--enterprise-primary) !important;
  color: var(--enterprise-primary) !important;
  background:
    linear-gradient(180deg, var(--enterprise-surface), var(--enterprise-primary-soft)) !important;
}

.dashboard-kpi-card.ready,
#load-board-view .board-signal.ready,
#load-board-view .board-focus-card,
.compact-summary .summary-item:nth-child(4),
.compact-summary .summary-item:nth-child(5) {
  border-left-color: var(--enterprise-accent) !important;
  color: var(--enterprise-accent-hover) !important;
  background:
    linear-gradient(180deg, var(--enterprise-surface), var(--enterprise-accent-soft)) !important;
}

.dashboard-kpi-card strong,
#load-board-view .board-signal strong,
.metric-card strong,
.compact-summary .summary-item strong,
.report-stat-card strong {
  color: var(--enterprise-text) !important;
}

.dashboard-kpi-card small,
#load-board-view .board-signal small,
.metric-card small,
.compact-summary .summary-item small,
.report-stat-card small {
  color: var(--enterprise-muted) !important;
}

html[data-theme="dark"] .dashboard-kpi-card,
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] #load-board-view .board-signal,
html[data-theme="dark"] #load-board-view .board-focus-card,
html[data-theme="dark"] .compact-summary .summary-item,
html[data-theme="dark"] .report-stat-card {
  background:
    linear-gradient(180deg, rgba(91, 164, 255, 0.06), rgba(91, 164, 255, 0) 58%),
    var(--enterprise-surface-muted) !important;
  box-shadow: var(--enterprise-shadow-xs) !important;
}

html[data-theme="dark"] .dashboard-kpi-card.critical,
html[data-theme="dark"] #load-board-view .board-signal.critical {
  background:
    linear-gradient(180deg, rgba(251, 113, 133, 0.08), rgba(251, 113, 133, 0.02)),
    var(--enterprise-surface-muted) !important;
}

html[data-theme="dark"] .dashboard-kpi-card.watch,
html[data-theme="dark"] #load-board-view .board-signal.watch {
  background:
    linear-gradient(180deg, rgba(251, 191, 36, 0.08), rgba(251, 191, 36, 0.02)),
    var(--enterprise-surface-muted) !important;
}

html[data-theme="dark"] .dashboard-kpi-card.ready,
html[data-theme="dark"] #load-board-view .board-signal.ready,
html[data-theme="dark"] #load-board-view .board-focus-card {
  background:
    linear-gradient(180deg, rgba(103, 232, 249, 0.08), rgba(103, 232, 249, 0.02)),
    var(--enterprise-surface-muted) !important;
}

.dashboard-panel,
.panel.ui-card,
.table-shell,
.data-table-shell,
.data-table-footer,
.table-toolbar,
.data-table-toolbar,
#load-board-view .table-toolbar,
.modal,
.wide-modal,
.detail-modal,
.billing-detail-modal,
.ui-dialog-content {
  border-color: var(--enterprise-border) !important;
  background: var(--enterprise-surface) !important;
  color: var(--enterprise-text);
  box-shadow: var(--enterprise-shadow-xs) !important;
}

.dashboard-panel-header,
.panel-header,
.ui-card-header,
.table-shell thead th,
.data-table thead th,
.data-table-head {
  border-color: var(--enterprise-border) !important;
  background: linear-gradient(180deg, var(--enterprise-surface-subtle), var(--enterprise-surface-muted)) !important;
  color: var(--enterprise-text-soft) !important;
}

.dashboard-priority-panel {
  border-top: 1px solid var(--enterprise-primary-line) !important;
  box-shadow: var(--enterprise-shadow-sm) !important;
}

.dashboard-risk-card {
  background: transparent;
}

.dashboard-risk-card:hover {
  background: var(--enterprise-surface-hover);
}

.dashboard-action-row,
.dashboard-reminder-row,
.dashboard-mini-row,
.mini-record-row {
  background: var(--enterprise-surface) !important;
}

.dashboard-action-row:hover,
.dashboard-reminder-row:hover,
.dashboard-mini-row:hover,
.mini-record-row:hover {
  background: var(--enterprise-surface-hover) !important;
}

.table-shell,
.data-table-shell,
#load-board-view .table-shell {
  border-radius: 9px;
  overflow: hidden;
}

.table-shell tbody tr:hover td,
.data-table tbody tr:hover td,
.data-table-row:hover .data-table-cell {
  background: var(--enterprise-surface-hover) !important;
}

.pill,
.status-pill,
.priority-pill,
.risk-pill,
.status-badge,
.filter-chip,
.board-tab,
.focus-chip,
#load-board-view .pill,
#load-board-view .status-pill,
#load-board-view .priority-pill,
#load-board-view .risk-pill {
  border-color: var(--enterprise-border-strong) !important;
  background: var(--enterprise-surface-muted) !important;
  color: var(--enterprise-text-soft) !important;
}

.pill.move,
.status-pill.active,
.status-badge.move,
#load-board-view .pill.move,
.filter-chip.active,
.board-tab.active,
.focus-chip.active {
  border-color: var(--enterprise-primary-line) !important;
  background: var(--enterprise-primary-soft) !important;
  color: var(--enterprise-primary) !important;
}

.pill.attention,
.pill.issue,
.risk-pill.high,
.priority-pill.high,
.status-badge.issue,
.status-badge.attention,
#load-board-view .pill.issue,
#load-board-view .risk-pill.high,
#load-board-view .priority-pill.high {
  border-color: var(--enterprise-danger-line) !important;
  background: var(--enterprise-danger-soft) !important;
  color: var(--enterprise-danger) !important;
}

.pill.warn,
.pill.billing,
.risk-pill.medium,
.priority-pill.medium,
.status-badge.warn,
.status-badge.billing,
#load-board-view .pill.warn,
#load-board-view .risk-pill.medium,
#load-board-view .priority-pill.medium {
  border-color: var(--enterprise-warning-line) !important;
  background: var(--enterprise-warning-soft) !important;
  color: var(--enterprise-warning) !important;
}

.pill.ok,
.pill.ready,
.risk-pill.low,
.priority-pill.low,
.status-badge.ok,
.status-badge.ready,
#load-board-view .pill.ready,
#load-board-view .risk-pill.low,
#load-board-view .priority-pill.low {
  border-color: var(--enterprise-success-line) !important;
  background: var(--enterprise-success-soft) !important;
  color: var(--enterprise-success) !important;
}

.date-chip,
#load-board-view .date-chip,
#load-board-view .doc-chip,
.summary-item,
.info-tile {
  border-color: var(--enterprise-border) !important;
  background: var(--enterprise-surface-subtle) !important;
}

html[data-theme="dark"] .dashboard-panel,
html[data-theme="dark"] .panel.ui-card,
html[data-theme="dark"] .table-shell,
html[data-theme="dark"] .data-table-shell,
html[data-theme="dark"] .data-table-footer,
html[data-theme="dark"] .table-toolbar,
html[data-theme="dark"] .data-table-toolbar,
html[data-theme="dark"] #load-board-view .table-toolbar,
html[data-theme="dark"] .modal,
html[data-theme="dark"] .wide-modal,
html[data-theme="dark"] .detail-modal,
html[data-theme="dark"] .billing-detail-modal,
html[data-theme="dark"] .ui-dialog-content {
  background: var(--enterprise-surface) !important;
  box-shadow: var(--enterprise-shadow-xs) !important;
}

html[data-theme="dark"] .dashboard-panel-header,
html[data-theme="dark"] .panel-header,
html[data-theme="dark"] .ui-card-header,
html[data-theme="dark"] .table-shell thead th,
html[data-theme="dark"] .data-table thead th,
html[data-theme="dark"] .data-table-head {
  background: var(--enterprise-surface-muted) !important;
  color: var(--enterprise-text-soft) !important;
}

html[data-theme="dark"] .dashboard-action-row,
html[data-theme="dark"] .dashboard-reminder-row,
html[data-theme="dark"] .dashboard-mini-row,
html[data-theme="dark"] .mini-record-row {
  background: var(--enterprise-surface-subtle) !important;
}

#columns-modal-backdrop .config-nav-item.active {
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

@media (max-width: 760px) {
  .dashboard-hero,
  #load-board-view .board-command {
    border-radius: 9px !important;
  }

  .dashboard-kpi-card,
  #load-board-view .board-signal {
    min-height: 100px;
  }
}

#load-board-view .board-signal.priority-task-card {
  cursor: default;
  position: relative !important;
  padding-right: 160px !important;
}

#load-board-view .board-signal.priority-task-card .priority-task-actions {
  position: absolute !important;
  top: 10px !important;
  right: 10px !important;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  z-index: 1;
}

#load-board-view .board-signal.priority-task-card .priority-task-actions .compact-action {
  min-width: 104px;
  min-height: 32px;
  padding: 0 14px;
  font-size: 12px;
  white-space: nowrap;
}

#load-board-view .board-signal.priority-task-card .priority-task-actions .compact-action:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}
