/* Fresh Xiaofu neutral dual visual system. This file intentionally loads after legacy module styles. */
:root,
html[data-theme="day"] {
  color-scheme: light;
  --theme-canvas: #f3f3f1;
  --theme-canvas-strong: #e9e9e6;
  --theme-surface: #ffffff;
  --theme-surface-raised: #ffffff;
  --theme-surface-soft: #f7f7f5;
  --theme-surface-sunken: #ececea;
  --theme-sidebar: #f7f7f5;
  --theme-sidebar-soft: #ececea;
  --theme-sidebar-ink: #242422;
  --theme-sidebar-muted: #73736f;
  --theme-sidebar-line: #e1e1de;
  --theme-sidebar-hover: #eeeeeb;
  --theme-sidebar-active: #e6e6e2;
  --theme-sidebar-icon: #e9e9e6;
  --theme-sidebar-indicator: #181817;
  --theme-ink: #292927;
  --theme-ink-strong: #111110;
  --theme-muted: #666662;
  --theme-subtle: #8e8e89;
  --theme-line: #dededb;
  --theme-line-strong: #c8c8c3;
  --theme-accent: #147a58;
  --theme-accent-strong: #0e5d43;
  --theme-accent-soft: #e0f0e8;
  --theme-positive: #08764b;
  --theme-positive-soft: #dcf2e7;
  --theme-warning: #8b5d08;
  --theme-warning-soft: #fff0c7;
  --theme-danger: #b83c35;
  --theme-danger-soft: #fae5e2;
  --theme-info: #215f91;
  --theme-info-soft: #e2edf7;
  --theme-shadow-1: 0 1px 2px rgba(24, 24, 23, 0.06), 0 5px 16px rgba(24, 24, 23, 0.04);
  --theme-shadow-2: 0 2px 5px rgba(24, 24, 23, 0.08), 0 18px 42px rgba(24, 24, 23, 0.08);
  --theme-shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.74);
  --theme-focus: 0 0 0 3px rgba(11, 122, 82, 0.22);
  --bg: var(--theme-canvas);
  --surface: var(--theme-surface);
  --surface-2: var(--theme-surface-soft);
  --surface-3: var(--theme-surface-sunken);
  --ink: var(--theme-ink);
  --ink-2: #454541;
  --muted: var(--theme-muted);
  --subtle: var(--theme-subtle);
  --line: var(--theme-line);
  --line-strong: var(--theme-line-strong);
  --green: var(--theme-accent);
  --green-deep: var(--theme-accent-strong);
  --green-2: var(--theme-accent-soft);
  --gold: var(--theme-warning);
  --gold-2: var(--theme-warning-soft);
  --blue: var(--theme-info);
  --blue-2: var(--theme-info-soft);
  --red: var(--theme-danger);
  --red-2: var(--theme-danger-soft);
  --shadow: var(--theme-shadow-2);
  --shadow-soft: var(--theme-shadow-1);
  --focus-ring: var(--theme-focus);
}

html[data-theme="night"] {
  color-scheme: dark;
  --theme-canvas: #151515;
  --theme-canvas-strong: #0e0e0e;
  --theme-surface: #1f1f1f;
  --theme-surface-raised: #242424;
  --theme-surface-soft: #1a1a1a;
  --theme-surface-sunken: #101010;
  --theme-sidebar: #101010;
  --theme-sidebar-soft: #181818;
  --theme-sidebar-ink: #e8e8e6;
  --theme-sidebar-muted: #8d8d89;
  --theme-sidebar-line: #282828;
  --theme-sidebar-hover: #1c1c1c;
  --theme-sidebar-active: #262626;
  --theme-sidebar-icon: #202020;
  --theme-sidebar-indicator: #f5f5f4;
  --theme-ink: #e7e7e5;
  --theme-ink-strong: #fafaf9;
  --theme-muted: #a2a29e;
  --theme-subtle: #777773;
  --theme-line: #333333;
  --theme-line-strong: #484848;
  --theme-accent: #62c498;
  --theme-accent-strong: #83d8b2;
  --theme-accent-soft: #183528;
  --theme-positive: #66d7a1;
  --theme-positive-soft: #173526;
  --theme-warning: #e4ba62;
  --theme-warning-soft: #392c12;
  --theme-danger: #ff918b;
  --theme-danger-soft: #3c1d1d;
  --theme-info: #7ab9e9;
  --theme-info-soft: #172c3b;
  --theme-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.34), 0 6px 18px rgba(0, 0, 0, 0.2);
  --theme-shadow-2: 0 2px 6px rgba(0, 0, 0, 0.42), 0 22px 52px rgba(0, 0, 0, 0.28);
  --theme-shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  --theme-focus: 0 0 0 3px rgba(85, 201, 145, 0.28);
  --bg: var(--theme-canvas);
  --surface: var(--theme-surface);
  --surface-2: var(--theme-surface-soft);
  --surface-3: var(--theme-surface-sunken);
  --ink: var(--theme-ink);
  --ink-2: #c8c8c4;
  --muted: var(--theme-muted);
  --subtle: var(--theme-subtle);
  --line: var(--theme-line);
  --line-strong: var(--theme-line-strong);
  --green: var(--theme-accent);
  --green-deep: var(--theme-accent-strong);
  --green-2: var(--theme-accent-soft);
  --gold: var(--theme-warning);
  --gold-2: var(--theme-warning-soft);
  --blue: var(--theme-info);
  --blue-2: var(--theme-info-soft);
  --red: var(--theme-danger);
  --red-2: var(--theme-danger-soft);
  --shadow: var(--theme-shadow-2);
  --shadow-soft: var(--theme-shadow-1);
  --focus-ring: var(--theme-focus);
}

html,
body {
  background-color: var(--theme-canvas) !important;
  background-image: none !important;
  color: var(--theme-ink) !important;
  font-family: "MiSans", "HarmonyOS Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0 !important;
}

body,
.app-shell,
.main,
.sidebar,
.topbar,
.panel,
.metric,
.module-card,
.task-card,
.recipe-card,
.flow-step,
.chart-card,
.customer-card,
.preset-card,
.meal-box-card,
.drawer-panel,
.table,
.table-wrap,
input,
select,
textarea,
button,
a {
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.app-shell {
  background: transparent !important;
}

@media (min-width: 1101px) {
  .app-shell {
    grid-template-columns: 260px minmax(0, 1fr) !important;
  }
}

.main {
  background: var(--theme-canvas) !important;
}

.content {
  isolation: isolate;
}

.sidebar {
  padding: 16px 12px !important;
  border-right: 1px solid var(--theme-sidebar-line) !important;
  background: var(--theme-sidebar) !important;
  box-shadow: none !important;
}

.sidebar > .logo-lockup {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  min-height: 70px !important;
  padding: 2px 8px 16px !important;
  border-color: var(--theme-sidebar-line) !important;
}

.brand-lockup {
  display: block !important;
  width: min(100%, 220px) !important;
  height: auto !important;
  aspect-ratio: 1075 / 248;
  margin: 0 !important;
  object-fit: contain;
  object-position: left center;
}

.sidebar .nav-domain {
  gap: 3px !important;
  margin: 0 !important;
  padding: 5px 0 !important;
  border-top: 1px solid var(--theme-sidebar-line) !important;
  border-bottom: 0 !important;
}

.sidebar .nav-domain-toggle,
.sidebar .nav-button {
  border-color: transparent !important;
  border-radius: 5px !important;
  background: transparent !important;
  color: var(--theme-sidebar-muted) !important;
  box-shadow: none !important;
  letter-spacing: 0 !important;
}

.sidebar .nav-domain-toggle {
  min-height: 46px !important;
  padding: 7px 8px !important;
}

.sidebar .nav-domain-copy strong {
  color: var(--theme-sidebar-ink) !important;
  font-size: 12.5px !important;
  font-weight: 650 !important;
}

.sidebar .nav-domain-copy small,
.sidebar .nav-section-title {
  color: var(--theme-sidebar-muted) !important;
  font-weight: 500 !important;
}

.sidebar .nav-domain-toggle:hover,
.sidebar .nav-button:hover {
  border-color: transparent !important;
  background: var(--theme-sidebar-hover) !important;
  color: var(--theme-sidebar-ink) !important;
  transform: none !important;
}

.sidebar .nav-domain.active .nav-domain-toggle {
  border-color: transparent !important;
  background: transparent !important;
  color: var(--theme-sidebar-ink) !important;
  box-shadow: none !important;
}

.sidebar .nav-button.active {
  border-color: transparent !important;
  background: var(--theme-sidebar-active) !important;
  color: var(--theme-sidebar-ink) !important;
  box-shadow: inset 2px 0 0 var(--theme-sidebar-indicator) !important;
}

.sidebar .nav-icon {
  border: 0 !important;
  border-radius: 4px !important;
  background: var(--theme-sidebar-icon) !important;
  color: currentColor !important;
}

.sidebar .nav-domain-chevron {
  background: transparent !important;
}

.sidebar .nav-domain-chevron::before {
  border-color: var(--theme-sidebar-muted) !important;
}

.sidebar .nav-domain-items {
  gap: 2px !important;
  padding-left: 4px !important;
}

.sidebar .nav-domain-items .nav-button {
  min-height: 35px !important;
  margin-left: 4px !important;
  padding: 0 8px !important;
  font-weight: 600 !important;
}

.sidebar .nav-domain-items .nav-button::after {
  left: -5px !important;
  background: var(--theme-sidebar-line) !important;
}

.sidebar-current-subnav {
  gap: 4px !important;
  margin: 2px 0 8px 34px !important;
  padding: 5px 0 5px 9px !important;
  border-color: var(--theme-sidebar-line) !important;
}

.sidebar-subnav-label {
  color: var(--theme-sidebar-muted) !important;
  font-weight: 600 !important;
}

.sidebar-subnav-item {
  min-height: 32px !important;
  padding: 5px 8px !important;
  border-color: transparent !important;
  border-radius: 4px !important;
  background: transparent !important;
  color: var(--theme-sidebar-muted) !important;
}

.sidebar-subnav-item:hover {
  border-color: transparent !important;
  background: var(--theme-sidebar-hover) !important;
  color: var(--theme-sidebar-ink) !important;
}

.sidebar-subnav-item.active {
  border-color: transparent !important;
  background: var(--theme-sidebar-active) !important;
  color: var(--theme-sidebar-ink) !important;
}

.sidebar-subnav-item span {
  font-weight: 650 !important;
}

.sidebar-subnav-item small,
.sidebar-subnav-item.active small {
  color: var(--theme-sidebar-muted) !important;
  opacity: 1 !important;
}

.sidebar .sidebar-card {
  margin: 10px 4px 0 !important;
  padding: 12px 6px 2px !important;
  border: 0 !important;
  border-top: 1px solid var(--theme-sidebar-line) !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--theme-sidebar-muted) !important;
  box-shadow: none !important;
}

.sidebar .sidebar-card strong {
  color: var(--theme-positive) !important;
}

.sidebar .sidebar-card div,
.sidebar .sidebar-card small {
  color: var(--theme-sidebar-muted) !important;
}

.topbar {
  margin-bottom: 20px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--theme-line) !important;
  border-radius: 0 !important;
  background: color-mix(in srgb, var(--theme-surface) 94%, transparent) !important;
  box-shadow: none !important;
  backdrop-filter: blur(18px) !important;
}

html[data-theme="night"] .topbar {
  box-shadow: none !important;
}

.topbar .topbar-actions .admin-user {
  border-color: var(--theme-line) !important;
  background: var(--theme-surface-soft) !important;
  color: var(--theme-ink) !important;
  box-shadow: var(--theme-shadow-inset) !important;
}

.topbar .topbar-actions .admin-user strong {
  color: var(--theme-ink-strong) !important;
}

.topbar .topbar-actions .admin-user span,
.topbar .topbar-actions .admin-user small {
  color: var(--theme-muted) !important;
}

.topbar .topbar-actions .topbar-search,
.topbar .topbar-actions .topbar-search input {
  border-color: var(--theme-line-strong) !important;
  background: var(--theme-surface-raised) !important;
  color: var(--theme-ink) !important;
}

.topbar .topbar-actions .topbar-search input::placeholder,
.topbar .topbar-actions .topbar-search-icon {
  color: var(--theme-subtle) !important;
}

.topbar .mobile-nav-toggle {
  border-color: var(--theme-line-strong) !important;
  background: var(--theme-surface-raised) !important;
  color: var(--theme-ink) !important;
  box-shadow: var(--theme-shadow-1) !important;
}

.topbar h1,
.topbar-title strong,
.topbar-breadcrumb-page {
  color: var(--theme-ink-strong) !important;
  letter-spacing: 0 !important;
}

.topbar #pageKicker,
.topbar .eyebrow,
.topbar-breadcrumb-summary,
.topbar-breadcrumb-divider {
  color: var(--theme-muted) !important;
}

.topbar-breadcrumb-domain {
  color: var(--theme-muted) !important;
}

.theme-segment {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  min-width: 116px;
  height: 36px;
  padding: 3px;
  border: 1px solid var(--theme-line);
  border-radius: 8px;
  background: var(--theme-surface-sunken);
  box-shadow: var(--theme-shadow-inset);
}

.theme-segment-compact {
  min-width: 76px;
  width: 76px;
}

.theme-segment button {
  min-width: 0;
  padding: 0 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--theme-muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.theme-segment button:hover {
  color: var(--theme-ink);
}

.theme-segment button[aria-pressed="true"] {
  background: var(--theme-surface-raised);
  color: var(--theme-ink-strong);
  box-shadow: 0 1px 2px rgba(9, 25, 17, 0.12), 0 4px 10px rgba(9, 25, 17, 0.08);
}

html[data-theme="night"] .theme-segment button[aria-pressed="true"] {
  color: var(--theme-ink-strong);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
}

.login-card {
  position: relative;
}

.login-copy .logo-lockup.large {
  display: flex !important;
  align-items: center !important;
  width: min(100%, 440px) !important;
  height: auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.login-copy .logo-lockup.large .brand-lockup {
  width: 100% !important;
  max-width: 440px !important;
}

.login-theme-control {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
}

.login-screen {
  background: var(--theme-canvas) !important;
}

.login-card {
  border: 1px solid var(--theme-line) !important;
  border-radius: 8px !important;
  background: var(--theme-surface) !important;
  box-shadow: var(--theme-shadow-2) !important;
}

.login-copy,
.login-form {
  border-radius: 6px !important;
  background: var(--theme-surface-soft) !important;
  color: var(--theme-ink) !important;
}

.login-copy h1,
.login-form .form-title,
.logo-text strong {
  color: var(--theme-ink-strong) !important;
  letter-spacing: 0 !important;
}

.login-copy p,
.login-form span,
.logo-text small {
  color: var(--theme-muted) !important;
}

.panel,
.metric,
.module-card,
.task-card,
.recipe-card,
.flow-step,
.chart-card,
.customer-card,
.preset-card,
.meal-box-card,
.qms-card,
.settings-impact-card,
.access-role-card,
.order-command-card,
.confirmed-menu-order-card,
.fulfillment-stage-card,
.smart-map-head,
.smart-condition-console,
.smart-condition-fact,
.smart-condition-flow-step,
.smart-condition-mode-card,
.smart-condition-rules div,
.smart-condition-gate,
.menu-publish-hero,
.menu-publish-preview,
.menu-publish-step-card,
.smart-event-project-sheets,
.smart-event-sheet,
.weekly-editor-overview,
.weekly-editor-card,
.weekly-editor-excel-brief,
.weekly-editor-item,
.weekly-editor-candidate,
.weekly-menu-preflight,
.weekly-preflight-metrics span,
.weekly-preflight-risk,
.menu-item-editor-guide,
.smart-review-card,
.smart-review-summary,
.smart-review-meal-card,
.smart-customer-menu-card,
.smart-result-card,
.menu-export-card,
.smart-review-work-order,
.smart-review-confirm-sheet,
.smart-review-excel-pack,
.smart-review-readable-week,
.smart-review-hero-card,
.smart-review-week-table-wrap,
.smart-customer-review-cockpit,
.smart-customer-package-board,
.smart-customer-package-card {
  border-color: var(--theme-line) !important;
  border-radius: 8px !important;
  background: var(--theme-surface) !important;
  color: var(--theme-ink) !important;
  box-shadow: var(--theme-shadow-1) !important;
}

.panel {
  box-shadow: var(--theme-shadow-1) !important;
}

.panel-head,
.customer-card-head,
.customer-card-foot,
.meal-box-head,
.drawer-head,
.drawer-actions {
  border-color: var(--theme-line) !important;
}

.panel-head {
  background: var(--theme-surface-soft);
}

.metric {
  border-top: 1px solid var(--theme-line-strong) !important;
  background: var(--theme-surface-raised) !important;
}

.metric::after {
  display: none !important;
}

.metric.warn {
  border-color: var(--theme-warning) !important;
  background: var(--theme-warning-soft) !important;
}

.metric.red {
  border-color: var(--theme-danger) !important;
  background: var(--theme-danger-soft) !important;
}

.metric.blue {
  border-color: var(--theme-info) !important;
  background: var(--theme-info-soft) !important;
}

.master-data-template-card,
.master-data-template-copy,
.master-data-template-actions > div,
.master-data-template-steps span,
.resource-add-record-rail,
.bom-flow-card,
.bom-layer-boundary,
.ingredient-sku-hero {
  border-color: var(--theme-line) !important;
  background: var(--theme-surface) !important;
  color: var(--theme-ink) !important;
  box-shadow: var(--theme-shadow-1) !important;
}

.master-data-template-copy,
.master-data-template-actions > div,
.bom-flow-card,
.ingredient-sku-hero {
  background: var(--theme-surface-soft) !important;
}

.master-data-template-steps span,
.bom-flow-ledger span,
.bom-package-rules span {
  border-color: var(--theme-line) !important;
  background: var(--theme-surface-raised) !important;
  color: var(--theme-ink) !important;
}

.bom-layer-list {
  background: var(--theme-info-soft) !important;
}

.bom-layer-list.muted {
  background: var(--theme-warning-soft) !important;
}

.bom-flow-card strong,
.bom-layer-title strong,
.bom-layer-list b,
.bom-package-rules b,
.recipe-card-head strong {
  color: var(--theme-ink-strong) !important;
}

.bom-flow-card em,
.bom-flow-card b,
.bom-flow-card p,
.bom-layer-title span,
.bom-layer-title p,
.bom-layer-list ul,
.recipe-card-head small {
  color: var(--theme-muted) !important;
}

.operational-alert {
  border-color: var(--theme-line) !important;
  border-radius: 8px !important;
  background: var(--theme-surface-raised) !important;
  color: var(--theme-ink) !important;
  box-shadow: var(--theme-shadow-1) !important;
}

.operational-alert.warn {
  border-color: color-mix(in srgb, var(--theme-warning) 42%, var(--theme-line)) !important;
  background: var(--theme-warning-soft) !important;
}

.operational-alert.critical {
  border-color: color-mix(in srgb, var(--theme-danger) 42%, var(--theme-line)) !important;
  background: var(--theme-danger-soft) !important;
}

.operational-alert .alert-copy strong {
  color: var(--theme-ink-strong) !important;
}

.operational-alert .alert-copy p {
  color: var(--theme-muted) !important;
}

.operational-alert .alert-items .alert-item {
  border-color: var(--theme-line) !important;
  background: var(--theme-surface) !important;
  color: var(--theme-ink) !important;
  box-shadow: var(--theme-shadow-inset) !important;
}

.operational-alert .alert-items .alert-item span {
  color: var(--theme-muted) !important;
}

.operational-alert .alert-items .alert-item.warn {
  border-color: color-mix(in srgb, var(--theme-warning) 44%, var(--theme-line)) !important;
  background: var(--theme-warning-soft) !important;
}

.operational-alert .alert-items .alert-item.red {
  border-color: color-mix(in srgb, var(--theme-danger) 44%, var(--theme-line)) !important;
  background: var(--theme-danger-soft) !important;
}

.metric-value,
.row-title,
.panel-title,
.section-title h3,
.customer-card-head strong,
.meal-box-head strong,
.drawer-head h2,
.smart-customer-package-main > strong {
  color: var(--theme-ink-strong) !important;
  letter-spacing: 0 !important;
}

.metric-label,
.metric-note,
.row-sub,
.panel-sub,
.section-title p,
.module-note,
.customer-card-head span,
.customer-card-foot span,
.smart-customer-package-main > p,
.smart-customer-package-main > em {
  color: var(--theme-muted) !important;
}

.table,
.table-wrap,
.scroll-table,
table {
  border-color: var(--theme-line) !important;
  border-radius: 6px !important;
  background: var(--theme-surface) !important;
  color: var(--theme-ink) !important;
  box-shadow: none !important;
}

.table th,
table th,
.smart-review-week-table thead th {
  border-color: var(--theme-line) !important;
  background: var(--theme-surface-sunken) !important;
  color: var(--theme-muted) !important;
  font-weight: 850;
  letter-spacing: 0 !important;
}

.table td,
table td,
.smart-review-week-table td {
  border-color: var(--theme-line) !important;
  color: var(--theme-ink) !important;
}

.table tbody tr,
table tbody tr,
.smart-review-week-table tbody tr {
  background: var(--theme-surface) !important;
}

.table tbody tr:nth-child(even),
table tbody tr:nth-child(even) {
  background: var(--theme-surface-soft) !important;
}

.table tbody tr:hover,
table tbody tr:hover,
.smart-review-week-table tbody tr:hover {
  background: var(--theme-accent-soft) !important;
}

input,
select,
textarea,
.login-form input,
.form-field input,
.form-field select,
.form-field textarea,
.panel-head select,
.panel-actions select,
.panel-actions input,
.topbar-search,
.topbar-search input {
  border-color: var(--theme-line-strong) !important;
  border-radius: 6px !important;
  background: var(--theme-surface-raised) !important;
  color: var(--theme-ink) !important;
  box-shadow: var(--theme-shadow-inset) !important;
}

input::placeholder,
textarea::placeholder,
.topbar-search input::placeholder {
  color: var(--theme-subtle) !important;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: none !important;
  border-color: var(--theme-accent) !important;
  box-shadow: var(--theme-focus) !important;
}

.primary-action,
.mini-action.primary-mini {
  border: 1px solid transparent !important;
  border-radius: 6px !important;
  background: var(--theme-accent) !important;
  color: #ffffff !important;
  box-shadow: 0 7px 16px rgba(7, 88, 61, 0.2) !important;
}

html[data-theme="night"] .primary-action,
html[data-theme="night"] .mini-action.primary-mini {
  color: #07110c !important;
}

.ghost-action,
.mini-action {
  border: 1px solid var(--theme-line-strong) !important;
  border-radius: 6px !important;
  background: var(--theme-surface-raised) !important;
  color: var(--theme-ink) !important;
  box-shadow: none !important;
}

.primary-action:hover,
.ghost-action:hover,
.mini-action:hover {
  border-color: var(--theme-accent) !important;
  transform: translateY(-1px);
  box-shadow: var(--theme-shadow-1) !important;
}

.primary-action:active,
.ghost-action:active,
.mini-action:active,
.theme-segment button:active {
  transform: translateY(1px) scale(0.985);
}

.tag,
.badge,
.pill,
.status-pill,
.smart-review-meal .status {
  border-color: color-mix(in srgb, var(--theme-positive) 32%, var(--theme-line)) !important;
  background: var(--theme-positive-soft) !important;
  color: var(--theme-positive) !important;
}

.tag.warn,
.badge.warn,
.pill.warn,
.status-pill.warn,
.smart-condition-mode-card.yellow,
.weekly-menu-preflight.warn,
.menu-publish-hero.draft,
.weekly-editor-card.candidate,
.smart-review-hero-card.warn,
.smart-review-meal.warn {
  border-color: color-mix(in srgb, var(--theme-warning) 46%, var(--theme-line)) !important;
  background: var(--theme-warning-soft) !important;
  color: var(--theme-warning) !important;
}

.tag.red,
.badge.red,
.pill.red,
.status-pill.red,
.smart-condition-mode-card.red,
.weekly-menu-preflight.red,
.weekly-editor-item.disabled,
.weekly-editor-candidate.missing,
.smart-review-hero-card.red,
.smart-review-meal.red,
.row-critical,
.row-red {
  border-color: color-mix(in srgb, var(--theme-danger) 44%, var(--theme-line)) !important;
  background: var(--theme-danger-soft) !important;
  color: var(--theme-danger) !important;
}

.tag.blue,
.badge.blue,
.pill.blue,
.status-pill.blue,
.metric.blue {
  border-color: color-mix(in srgb, var(--theme-info) 42%, var(--theme-line)) !important;
  background: var(--theme-info-soft) !important;
  color: var(--theme-info) !important;
}

.drawer-backdrop {
  background: rgba(3, 8, 6, 0.58) !important;
  backdrop-filter: blur(6px) !important;
}

.drawer-panel,
.modal-panel,
.dialog-panel {
  border-color: var(--theme-line) !important;
  background: var(--theme-surface) !important;
  color: var(--theme-ink) !important;
  box-shadow: var(--theme-shadow-2) !important;
}

.toast {
  border: 1px solid var(--theme-line-strong) !important;
  background: var(--theme-ink-strong) !important;
  color: var(--theme-surface) !important;
  box-shadow: var(--theme-shadow-2) !important;
}

.empty,
.empty-state,
.empty-state.compact,
.smart-event-empty,
.weekly-editor-empty {
  border-color: var(--theme-line-strong) !important;
  background: var(--theme-surface-soft) !important;
  color: var(--theme-muted) !important;
}

.workspace-subnav,
.smart-use-navigator,
.refined-action-rail {
  border-color: var(--theme-line) !important;
  background: var(--theme-surface-soft) !important;
  box-shadow: var(--theme-shadow-inset) !important;
}

.workspace-subnav button,
.smart-use-navigator button {
  border-radius: 6px !important;
  color: var(--theme-muted) !important;
}

.workspace-subnav button[aria-pressed="true"],
.smart-use-navigator button.active {
  border-color: var(--theme-line-strong) !important;
  background: var(--theme-surface-raised) !important;
  color: var(--theme-accent) !important;
  box-shadow: var(--theme-shadow-1) !important;
}

.meal-time-alert {
  border-color: var(--theme-danger) !important;
  background: #a92d2d !important;
  color: #ffffff !important;
}

.meal-go-hero,
.meal-risk-group,
.meal-my-todos,
.meal-business-review,
.meal-core-facts b,
.meal-go-side,
.meal-kpi,
.meal-risk-row,
.meal-empty-line {
  border-color: var(--theme-line) !important;
  background: var(--theme-surface) !important;
  color: var(--theme-ink) !important;
  box-shadow: var(--theme-shadow-1);
}

.meal-go-hero.go {
  border-color: var(--theme-positive) !important;
  background: var(--theme-positive-soft) !important;
}

.meal-go-hero.no-go,
.meal-risk-row.critical,
.meal-kpi.critical {
  border-color: var(--theme-danger) !important;
  background: var(--theme-danger-soft) !important;
}

.meal-risk-row.warning,
.meal-kpi.warn {
  border-color: var(--theme-warning) !important;
  background: var(--theme-warning-soft) !important;
}

.meal-go-main h2,
.meal-core-facts strong,
.meal-group-head strong,
.meal-section-title strong,
.meal-risk-row strong,
.meal-kpi {
  color: var(--theme-ink-strong) !important;
  letter-spacing: 0 !important;
}

.meal-go-main p,
.meal-go-main span,
.meal-section-title span,
.meal-group-head span,
.meal-core-facts b,
.meal-risk-row em,
.meal-risk-row small,
.meal-kpi span,
.meal-kpi small,
.meal-other-risks summary,
.meal-business-review summary {
  color: var(--theme-muted) !important;
}

.special-traceability-table,
.special-monitor-map-panel,
.special-monitor-card,
.special-monitor-facts div,
.special-monitor-map-summary span,
.special-mobile-phone,
.phone-line,
.special-mobile-copy {
  border-color: var(--theme-line) !important;
  background: var(--theme-surface) !important;
  color: var(--theme-ink) !important;
  box-shadow: var(--theme-shadow-1) !important;
}

.special-monitor-map,
.special-monitor-card p,
.special-monitor-map-summary span,
.phone-line {
  border-color: var(--theme-line) !important;
  background: var(--theme-surface-soft) !important;
}

.special-monitor-head strong,
.special-monitor-facts dd,
.special-mobile-copy h4,
.special-mobile-copy dd,
.phone-line span {
  color: var(--theme-ink-strong) !important;
}

.special-monitor-head span,
.special-monitor-facts dt,
.special-monitor-card p,
.special-mobile-copy p,
.special-mobile-copy dt,
.phone-line strong {
  color: var(--theme-muted) !important;
}

.smart-customer-package-cost-grid span,
.smart-customer-package-card .smart-customer-package-cost-grid span {
  border-color: var(--theme-line) !important;
  background: var(--theme-surface-soft) !important;
}

body.foundation-import-page {
  background: var(--theme-canvas) !important;
  color: var(--theme-ink) !important;
}

.foundation-import-hero,
.foundation-single-import-drawer,
.foundation-delivery-drawer,
.foundation-import-panel,
.foundation-workflow-step,
.foundation-access-summary > *,
.foundation-evidence-item,
.foundation-evidence-helper,
.foundation-open-gates,
.foundation-copy-fallback {
  border-color: var(--theme-line) !important;
  border-radius: 8px !important;
  background: var(--theme-surface) !important;
  color: var(--theme-ink) !important;
  box-shadow: var(--theme-shadow-1) !important;
}

.foundation-workflow-step {
  border-top: 3px solid var(--theme-accent) !important;
}

.foundation-access-summary > div,
.foundation-template-card,
.foundation-import-next-step,
.foundation-import-summary > div,
.foundation-evidence-task,
.foundation-evidence-check,
.foundation-evidence-validation,
.foundation-evidence-summary-card,
.foundation-evidence-closure-head,
.foundation-evidence-path-hint,
.foundation-evidence-task-guide,
.foundation-evidence-deeplink,
.foundation-import-confirm-list > div {
  border-color: var(--theme-line) !important;
  background: var(--theme-surface-soft) !important;
  color: var(--theme-ink) !important;
  box-shadow: var(--theme-shadow-inset) !important;
}

.foundation-import-next-step {
  border-left-color: var(--theme-accent) !important;
  background: var(--theme-accent-soft) !important;
}

.foundation-import-next-step.error,
.foundation-evidence-validation.error,
.foundation-open-gates,
.foundation-evidence-summary-card.is-blocked,
.foundation-evidence-closure-card {
  border-color: color-mix(in srgb, var(--theme-danger) 42%, var(--theme-line)) !important;
  background: var(--theme-danger-soft) !important;
}

.foundation-evidence-validation.ok,
.foundation-evidence-summary-card.is-ready,
.foundation-evidence-closure-card.is-ready {
  border-color: color-mix(in srgb, var(--theme-positive) 42%, var(--theme-line)) !important;
  background: var(--theme-positive-soft) !important;
}

.foundation-open-gate-list > li,
.foundation-import-confirm {
  border-color: var(--theme-line) !important;
  background: var(--theme-surface-raised) !important;
  color: var(--theme-ink) !important;
  box-shadow: var(--theme-shadow-2) !important;
}

.foundation-single-import-drawer summary,
.foundation-delivery-drawer summary,
.foundation-access-summary strong,
.foundation-template-card strong,
.foundation-import-next-step strong,
.foundation-evidence-task strong,
.foundation-evidence-check strong,
.foundation-evidence-validation strong,
.foundation-evidence-summary-card strong,
.foundation-evidence-closure-head strong,
.foundation-evidence-closure-card strong,
.foundation-evidence-path-hint code,
.foundation-evidence-task-guide strong,
.foundation-import-summary strong,
.foundation-import-confirm h3,
.foundation-import-confirm-list strong {
  color: var(--theme-ink-strong) !important;
}

.foundation-workflow-step span,
.foundation-access-summary span,
.foundation-template-card small,
.foundation-import-next-step span,
.foundation-import-field > span,
.foundation-import-status,
.foundation-single-import-drawer summary span,
.foundation-delivery-drawer summary span,
.foundation-single-import-drawer summary::after,
.foundation-delivery-drawer summary::after,
.foundation-evidence-helper-head p,
.foundation-evidence-task small,
.foundation-evidence-task span,
.foundation-evidence-summary-card span,
.foundation-evidence-summary-card small,
.foundation-evidence-closure-head span,
.foundation-evidence-closure-card span,
.foundation-evidence-closure-card small,
.foundation-evidence-path-hint span,
.foundation-evidence-path-hint small,
.foundation-evidence-task-guide span,
.foundation-evidence-task-guide ol,
.foundation-import-confirm p,
.foundation-import-confirm-list span,
.foundation-import-confirm-check {
  color: var(--theme-muted) !important;
}

.foundation-import-status,
.foundation-optional-badge {
  background: var(--theme-surface-sunken) !important;
  color: var(--theme-muted) !important;
}

.foundation-import-status.ok,
.foundation-evidence-status.ready {
  background: var(--theme-positive-soft) !important;
  color: var(--theme-positive) !important;
}

.foundation-import-status.error,
.foundation-required-badge,
.foundation-evidence-status.negative {
  background: var(--theme-danger-soft) !important;
  color: var(--theme-danger) !important;
}

.foundation-evidence-status.pending {
  background: var(--theme-warning-soft) !important;
  color: var(--theme-warning) !important;
}

.foundation-evidence-tab {
  border-color: var(--theme-line-strong) !important;
  background: var(--theme-surface-raised) !important;
  color: var(--theme-ink) !important;
}

.foundation-evidence-tab.is-active {
  border-color: var(--theme-accent) !important;
  background: var(--theme-accent-soft) !important;
  color: var(--theme-accent) !important;
}

.foundation-evidence-task code,
.foundation-evidence-deeplink code {
  background: var(--theme-surface-sunken) !important;
  color: var(--theme-accent) !important;
}

.foundation-import-table-wrap,
.foundation-import-table th,
.foundation-import-table td {
  border-color: var(--theme-line) !important;
}

.foundation-import-table th {
  background: var(--theme-surface-sunken) !important;
  color: var(--theme-muted) !important;
}

.foundation-import-table td {
  background: var(--theme-surface) !important;
  color: var(--theme-ink) !important;
}

.foundation-import-hero h1,
.foundation-import-panel h2,
.foundation-import-panel h3,
.foundation-bulk-head h2,
.foundation-workflow-step strong {
  color: var(--theme-ink-strong) !important;
  letter-spacing: 0 !important;
}

.foundation-import-hero p,
.foundation-bulk-head p,
.foundation-workflow-step em,
.foundation-import-empty,
.foundation-template-meta,
.foundation-template-note {
  color: var(--theme-muted) !important;
}

.foundation-import-actions {
  align-items: center;
}

@media (max-width: 1180px) {
  .theme-segment-compact {
    order: -1;
  }
}

@media (max-width: 760px) {
  .app-shell.nav-open .sidebar {
    z-index: 40 !important;
  }

  .app-shell.nav-open .nav-backdrop {
    z-index: 35 !important;
  }

  .topbar-actions .theme-segment-compact {
    display: inline-grid !important;
    min-width: 72px !important;
    width: 72px !important;
    height: 34px !important;
  }

  .login-theme-control {
    position: static;
    z-index: auto;
    display: flex;
    grid-column: 1 / -1;
    justify-content: flex-end;
    width: 100%;
    margin: 0;
    padding: 0 0 2px;
  }

  .login-theme-control .theme-segment {
    min-width: 104px;
    height: 34px;
  }

  .panel,
  .metric,
  .customer-card,
  .preset-card,
  .meal-box-card {
    border-radius: 7px !important;
  }
}

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