/* FECLOG Visual Experience 4.0
   A semantic layer over the legacy domain styles. */

:root {
  color-scheme: light;
  --fec-bg: #f4f7fa;
  --fec-bg-subtle: #edf3f6;
  --fec-surface: #ffffff;
  --fec-surface-raised: #ffffff;
  --fec-surface-overlay: #ffffff;
  --fec-surface-strong: #e4edf1;
  --fec-text: #092536;
  --fec-text-muted: #566c79;
  --fec-text-subtle: #718590;
  --fec-text-inverse: #f4f8fa;
  --fec-border: #cfdae0;
  --fec-border-strong: #aebfc7;
  --fec-primary: #075d72;
  --fec-primary-hover: #064f61;
  --fec-primary-active: #043e4d;
  --fec-cyan: #0a8396;
  --fec-accent: #e94309;
  --fec-accent-hover: #cf3700;
  --fec-success: #187458;
  --fec-warning: #946000;
  --fec-danger: #aa352c;
  --fec-info: #236b82;
  --fec-focus: #087c91;
  --fec-chart-grid: rgba(9, 37, 54, .13);
  --fec-shadow-sm: 0 2px 8px rgba(7, 56, 75, .06);
  --fec-shadow-md: 0 12px 30px rgba(7, 56, 75, .1);
  --fec-shadow-lg: 0 24px 52px rgba(7, 56, 75, .16);
  --fec-radius-sm: 4px;
  --fec-radius-md: 6px;
  --fec-radius-lg: 8px;
  --fec-radius-xl: 8px;
  --fec-space-1: 4px;
  --fec-space-2: 8px;
  --fec-space-3: 12px;
  --fec-space-4: 16px;
  --fec-space-5: 20px;
  --fec-space-6: 24px;
  --fec-space-8: 32px;
  --fec-space-10: 40px;
  --fec-motion-fast: 120ms;
  --fec-motion-normal: 210ms;
  --fec-motion-slow: 320ms;
  --fec-ease: cubic-bezier(.22, 1, .36, 1);
  --fec-sidebar-width: 264px;
  --fec-sidebar-collapsed: 76px;
  --fec-topbar-height: 66px;
  --module-accent: var(--fec-primary);

  /* Compatibility contract for the current domain styles. */
  --fec-orange: var(--fec-accent);
  --fec-orange-hover: var(--fec-accent-hover);
  --fec-orange-soft: color-mix(in srgb, var(--fec-accent) 9%, var(--fec-surface));
  --fec-cream: #fff1d4;
  --fec-teal: var(--fec-cyan);
  --fec-teal-dark: var(--fec-primary);
  --fec-teal-soft: color-mix(in srgb, var(--fec-cyan) 9%, var(--fec-surface));
  --fec-blue-dark: var(--fec-text);
  --fec-blue-soft: var(--fec-bg-subtle);
  --fec-white: var(--fec-surface);
  --fec-muted: var(--fec-text-muted);
  --fec-shadow: var(--fec-shadow-md);
  --fec-shadow-subtle: var(--fec-shadow-sm);
  --ink: var(--fec-text);
  --muted: var(--fec-text-muted);
  --line: var(--fec-border);
  --surface: var(--fec-surface);
  --surface-raised: var(--fec-surface-raised);
  --surface-subtle: var(--fec-bg-subtle);
  --surface-muted: var(--fec-surface-strong);
  --background: var(--fec-bg);
  --border-strong: var(--fec-border-strong);
  --text-primary: var(--fec-text);
  --text-secondary: var(--fec-text-muted);
  --text-tertiary: var(--fec-text-subtle);
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--fec-focus) 20%, transparent);
  --vx-shell: #07384b;
  --vx-shell-deep: #062f40;
  --vx-shell-muted: #a6bdc7;
  --vx-canvas: var(--fec-bg);
  --vx-surface: var(--fec-surface);
  --vx-surface-muted: var(--fec-bg-subtle);
  --vx-surface-strong: var(--fec-surface-strong);
  --vx-ink: var(--fec-text);
  --vx-ink-muted: var(--fec-text-muted);
  --vx-border: var(--fec-border);
  --vx-border-strong: var(--fec-border-strong);
  --vx-accent: var(--fec-accent);
  --vx-teal: var(--fec-cyan);
  --vx-success: var(--fec-success);
  --vx-warning: var(--fec-warning);
  --vx-danger: var(--fec-danger);
  --vx-info: var(--fec-info);
  --vx-focus: var(--fec-focus);
  --vx-sidebar-width: var(--fec-sidebar-width);
  --vx-topbar-height: var(--fec-topbar-height);
  --vx-radius-sm: var(--fec-radius-sm);
  --vx-radius-md: var(--fec-radius-lg);
  --vx-shadow-card: none;
  --vx-shadow-raised: var(--fec-shadow-md);
  --vx-fast: var(--fec-motion-fast);
  --vx-normal: var(--fec-motion-normal);
  --fec-form-surface: var(--fec-surface);
  --fec-form-subtle: var(--fec-bg-subtle);
  --fec-form-border: var(--fec-border-strong);
  --fec-form-border-hover: var(--fec-primary);
  --fec-form-border-focus: var(--fec-focus);
  --fec-form-border-error: var(--fec-danger);
  --fec-form-radius: var(--fec-radius-md);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --fec-bg: #06141d;
  --fec-bg-subtle: #0d202b;
  --fec-surface: #0b1c27;
  --fec-surface-raised: #102632;
  --fec-surface-overlay: #142d39;
  --fec-surface-strong: #183440;
  --fec-text: #f4f8fa;
  --fec-text-muted: #afc1c9;
  --fec-text-subtle: #86a0ab;
  --fec-text-inverse: #071922;
  --fec-border: #27434f;
  --fec-border-strong: #3a5865;
  --fec-primary: #38a9bd;
  --fec-primary-hover: #55b8c9;
  --fec-primary-active: #70c4d2;
  --fec-cyan: #31afc2;
  --fec-accent: #ff632b;
  --fec-accent-hover: #ff7a4c;
  --fec-success: #58bd91;
  --fec-warning: #e0ad4d;
  --fec-danger: #ee756b;
  --fec-info: #68b6cf;
  --fec-focus: #69c8d8;
  --fec-chart-grid: rgba(175, 193, 201, .18);
  --fec-shadow-sm: 0 3px 10px rgba(0, 0, 0, .2);
  --fec-shadow-md: 0 14px 34px rgba(0, 0, 0, .28);
  --fec-shadow-lg: 0 26px 56px rgba(0, 0, 0, .38);
  --fec-cream: #4a3b22;
  --vx-shell: #071923;
  --vx-shell-deep: #041118;
  --vx-shell-muted: #9cb5bf;
}

* { scrollbar-color: var(--fec-border-strong) transparent; }
html { min-width: 320px; background: var(--fec-bg); scroll-behavior: smooth; }
body {
  min-width: 320px;
  overflow-x: clip;
  background: var(--fec-bg);
  color: var(--fec-text);
  font-size: 14px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}
body::before {
  position: fixed;
  z-index: 1000;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, var(--fec-primary), var(--fec-cyan) 58%, var(--fec-accent));
  content: "";
  pointer-events: none;
}
::selection { background: color-mix(in srgb, var(--fec-cyan) 28%, transparent); color: var(--fec-text); }
a { text-underline-offset: 3px; }
button, input, select, textarea { caret-color: var(--fec-accent); }
button, a, input, select, textarea, summary { touch-action: manipulation; }
h1, h2, h3, h4, h5, h6 { color: var(--fec-text); letter-spacing: 0; text-wrap: balance; }
p { text-wrap: pretty; }
code, .hash-value { color: var(--fec-text-muted); font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Application shell */
.app-shell { grid-template-columns: var(--fec-sidebar-width) minmax(0, 1fr); background: var(--fec-bg); transition: grid-template-columns var(--fec-motion-slow) var(--fec-ease); }
.workspace { min-width: 0; }
.sidebar {
  width: var(--fec-sidebar-width);
  padding: 14px 12px 12px;
  border-right: 1px solid rgba(255, 255, 255, .08);
  background: var(--vx-shell);
  transition: transform var(--fec-motion-normal) var(--fec-ease);
}
.sidebar-brand {
  min-height: 76px;
  margin: -14px -12px 10px;
  padding: 14px 14px 12px 18px;
  background: var(--vx-shell-deep);
}
.brand { width: 160px; min-width: 0; }
.brand-full { display: block; }
.brand-mark { display: none; width: 36px; height: 36px; object-fit: contain; }
.sidebar-brand-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.sidebar-collapse, .sidebar-close { color: #d9e6eb; }
.sidebar-collapse:hover, .sidebar-close:hover { background: rgba(255, 255, 255, .1); color: white; }
.main-nav { gap: 17px; padding: 0 2px 80px; }
.nav-section-toggle { min-height: 34px; padding-inline: 9px; color: #9fb9c4; letter-spacing: 0; }
.main-nav a, .main-nav .nav-disabled {
  min-height: 42px;
  gap: 11px;
  border-radius: var(--fec-radius-md);
  color: #dbe7eb;
  font-size: 12px;
}
.main-nav a > svg { color: #a7c4cd; }
.main-nav a:hover { background: rgba(255, 255, 255, .08); translate: 2px 0; }
.main-nav a.active {
  border-color: rgba(255, 255, 255, .1);
  background: color-mix(in srgb, var(--module-accent) 34%, var(--vx-shell));
  box-shadow: inset 2px 0 var(--fec-accent);
}
.main-nav a.active::after { background: #ffc0a8; }
.sidebar-user { border-color: rgba(255, 255, 255, .1); background: var(--vx-shell-deep); }
.sidebar-user .user-avatar, .topbar-user .user-avatar { background: var(--fec-accent); color: #fff; }
.sidebar-backdrop { backdrop-filter: blur(2px); }

.sidebar-collapsed .app-shell { grid-template-columns: var(--fec-sidebar-collapsed) minmax(0, 1fr); }
.sidebar-collapsed .sidebar { width: var(--fec-sidebar-collapsed); }
.sidebar-collapsed .sidebar-brand { justify-content: center; padding-inline: 10px; }
.sidebar-collapsed .brand { width: 38px; }
.sidebar-collapsed .brand-full { display: none; }
.sidebar-collapsed .brand-mark { display: block; }
.sidebar-collapsed .sidebar-brand-actions { position: absolute; top: 82px; left: 20px; }
.sidebar-collapsed .sidebar-collapse svg { rotate: 180deg; }
.sidebar-collapsed .main-nav { margin-top: 54px; }
.sidebar-collapsed .nav-section-toggle { display: none; }
.sidebar-collapsed .nav-section-content { display: grid !important; gap: 5px; }
.sidebar-collapsed .main-nav a,
.sidebar-collapsed .main-nav .nav-disabled { display: grid; grid-template-columns: 1fr; place-items: center; padding: 9px; }
.sidebar-collapsed .main-nav a span,
.sidebar-collapsed .main-nav a small,
.sidebar-collapsed .nav-disabled span,
.sidebar-collapsed .main-nav a.active::after { display: none; }
.sidebar-collapsed .sidebar-user { grid-template-columns: 1fr; justify-items: center; padding: 8px; }
.sidebar-collapsed .sidebar-user > span:nth-child(2),
.sidebar-collapsed .sidebar-user > a { display: none; }

.topbar {
  height: var(--fec-topbar-height);
  padding-inline: 24px 28px;
  border-color: var(--fec-border);
  background: color-mix(in srgb, var(--fec-surface) 96%, transparent);
  box-shadow: var(--fec-shadow-sm);
  backdrop-filter: blur(12px);
}
.topbar-product, .scope strong { color: var(--fec-text); }
.scope-label { color: var(--fec-text-muted); }
.topbar-divider { background: var(--fec-border); }
.topbar-actions { gap: 8px; }
.environment-badge { border-color: var(--fec-border); background: var(--fec-bg-subtle); color: var(--fec-text-muted); }
.topbar-user { border-color: var(--fec-border); }
.topbar-user:hover, .icon-button:hover { background: var(--fec-bg-subtle); }
.icon-button { min-width: 40px; min-height: 40px; color: var(--fec-text); }

.theme-switcher {
  display: inline-grid;
  grid-template-columns: repeat(3, 34px);
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--fec-border);
  border-radius: var(--fec-radius-md);
  background: var(--fec-bg-subtle);
}
.theme-switcher button {
  display: grid;
  width: 34px;
  height: 32px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--fec-radius-sm);
  background: transparent;
  color: var(--fec-text-muted);
  cursor: pointer;
  transition: background var(--fec-motion-fast), color var(--fec-motion-fast), box-shadow var(--fec-motion-fast);
}
.theme-switcher button svg { width: 16px; height: 16px; }
.theme-switcher button:hover { color: var(--fec-text); }
.theme-switcher button[aria-pressed="true"] { background: var(--fec-surface-raised); box-shadow: var(--fec-shadow-sm); color: var(--fec-primary); }

.content { min-height: calc(100vh - var(--fec-topbar-height)); padding: 32px 34px 72px; background: var(--fec-bg); }
.page-frame { width: min(100%, 1520px); margin-inline: auto; }
.experience-mounted .page-frame { animation: fec-page-arrive var(--fec-motion-slow) var(--fec-ease) both; }

/* Page hierarchy and module accents */
body[data-module="receiving"], .module-view--receiving { --module-accent: #087f78; }
body[data-module="shipping"], .module-view--shipping { --module-accent: #087f78; }
body[data-module="planning"], .module-view--planning { --module-accent: #075d72; }
body[data-module="hr"], .module-view--workflow { --module-accent: #7557a5; }
body[data-module="master-data"], .module-view--master-data { --module-accent: #326eaa; }
body[data-module="finance"], .module-view--finance { --module-accent: #267a5b; }
body[data-module="fiscal"], .module-view--fiscal { --module-accent: #a66a08; }
body[data-module="ssw"], .module-view--ssw { --module-accent: #0a8396; }
body[data-module="administration"] { --module-accent: #657783; }

.page-header, .executive-header, .receiving-dashboard-header {
  margin-bottom: 26px;
  padding-bottom: 22px;
  border-color: var(--fec-border);
}
.page-header::after, .module-view .page-header::after { width: 64px; height: 2px; background: var(--module-accent); }
.page-header-row { align-items: end; gap: 32px; }
.page-header h1, .executive-header h1, .receiving-dashboard-header h1 {
  max-width: 28ch;
  margin: 5px 0 7px;
  color: var(--fec-text);
  font-size: 31px;
  font-weight: 780;
  line-height: 1.16;
  letter-spacing: 0;
}
.page-header p:last-child, .executive-header > div > p:not(.eyebrow), .receiving-dashboard-header > div > p:not(.eyebrow) {
  max-width: 72ch;
  color: var(--fec-text-muted);
  font-size: 13px;
  line-height: 1.65;
}
.eyebrow, .section-label { color: var(--module-accent); font-size: 10px; font-weight: 800; letter-spacing: 0; }
.page-header-meta {
  min-width: 184px;
  padding: 11px 14px;
  border: 1px solid var(--fec-border);
  border-left: 1px solid var(--module-accent);
  border-radius: var(--fec-radius-md);
  background: var(--fec-surface);
}
.page-header-meta span { color: var(--fec-text-subtle); }
.page-header-meta strong { color: var(--fec-text); }
.section-heading { min-height: 0; margin-bottom: 14px; }
.section-heading h2 { color: var(--fec-text); font-size: 20px; font-weight: 760; }
.period-label { color: var(--fec-text-muted); }
.dashboard-section { margin-bottom: 36px; }

/* Buttons and feedback */
.primary-button, .secondary-button, .neutral-button, .danger-button, .btn {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--fec-radius-md);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0;
  transition: background var(--fec-motion-fast), border-color var(--fec-motion-fast), color var(--fec-motion-fast), box-shadow var(--fec-motion-fast), translate var(--fec-motion-fast);
}
.primary-button { border: 1px solid var(--fec-accent); background: var(--fec-accent); color: #fff; }
.primary-button:hover { border-color: var(--fec-accent-hover); background: var(--fec-accent-hover); box-shadow: 0 6px 16px color-mix(in srgb, var(--fec-accent) 22%, transparent); translate: 0 -1px; }
.secondary-button { border: 1px solid var(--fec-primary); background: transparent; color: var(--fec-primary); }
.secondary-button:hover { background: color-mix(in srgb, var(--fec-primary) 9%, transparent); }
.neutral-button { border: 1px solid var(--fec-border-strong); background: var(--fec-surface); color: var(--fec-text); }
.neutral-button:hover { border-color: var(--fec-primary); background: var(--fec-bg-subtle); }
.danger-button { border: 1px solid var(--fec-danger); background: var(--fec-danger); color: #fff; }
.primary-button:active, .secondary-button:active, .neutral-button:active, .danger-button:active { box-shadow: none; translate: 0 1px; }
button[aria-busy="true"] { gap: 10px; }
button[aria-busy="true"]::after { animation-duration: 720ms; }
.page-actions, .actions { gap: 10px; }
.text-link { color: var(--fec-primary); text-decoration-thickness: 1px; }
.text-link:hover { text-decoration: underline; }

.messages { top: calc(var(--fec-topbar-height) + 14px); right: 18px; width: min(400px, calc(100vw - 28px)); }
.message {
  border: 1px solid var(--fec-border);
  border-radius: var(--fec-radius-md);
  background: var(--fec-surface-overlay);
  box-shadow: var(--fec-shadow-lg);
  color: var(--fec-text);
}
.message.success { border-left-color: var(--fec-success); }
.message.info { border-left-color: var(--fec-info); }
.message.warning { border-left-color: var(--fec-warning); }
.message.error { border-left-color: var(--fec-danger); }
.message-dismiss { color: var(--fec-text-muted); }

/* Cards, metrics and states */
.fec-card, .panel, .status-card, .navigation-card, .form-section, .content-form,
.fec-form-surface, .fec-filter-panel, .workflow-rail, .approval-item,
.entity-hero, .table-wrap, .table-shell {
  border-color: var(--fec-border);
  border-radius: var(--fec-radius-lg);
  background: var(--fec-surface);
  box-shadow: none;
}
.kpi-grid { gap: 14px; }
.fec-kpi-card {
  min-height: 140px;
  padding: 18px;
  border: 1px solid var(--fec-border);
  border-left: 2px solid var(--module-accent);
  background: var(--fec-surface);
}
.fec-kpi-card::after { background: var(--fec-border); }
.fec-kpi-card.tone-orange { border-left-color: var(--fec-accent); }
.fec-kpi-card.tone-teal { border-left-color: var(--fec-success); }
.fec-kpi-card.tone-blue { border-left-color: var(--fec-info); }
.kpi-heading span { color: var(--fec-text-muted); font-size: 10px; }
.kpi-heading svg { width: 32px; height: 32px; padding: 7px; border-radius: var(--fec-radius-md); background: var(--fec-bg-subtle); color: var(--module-accent); }
.fec-kpi-card > strong { color: var(--fec-text); font-size: 32px; }
.fec-kpi-card > small, .kpi-context { color: var(--fec-text-muted); }
.fec-kpi-card.is-actionable:hover, .navigation-card:hover { border-color: var(--module-accent); box-shadow: var(--fec-shadow-md); translate: 0 -2px; }
.status-card { min-height: 118px; border-top: 2px solid var(--module-accent); }
.status-card > strong { color: var(--fec-text); }
.status-card > small { color: var(--fec-text-muted); }
.navigation-card { border: 1px solid var(--fec-border); }
.navigation-card > svg:first-child { background: var(--fec-bg-subtle); color: var(--module-accent); }
.navigation-card strong, .navigation-card b { color: var(--fec-text); }
.navigation-card small, .navigation-card > svg:last-child { color: var(--fec-text-muted); }
.performance-grid, .metric-band, .status-strip { border-color: var(--fec-border); background: var(--fec-surface); }
.performance-grid article { border-color: var(--fec-border); }
.metric-band div { border-left-width: 1px; border-left-color: var(--module-accent); }
.scope-note, .notice, .policy-note {
  border-color: color-mix(in srgb, var(--module-accent) 28%, var(--fec-border));
  border-left-width: 2px;
  background: color-mix(in srgb, var(--module-accent) 7%, var(--fec-surface));
  color: var(--fec-text-muted);
}
.scope-note p, .scope-note strong { color: inherit; }

.fec-badge, .status-badge {
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 9px;
  line-height: 1.25;
  letter-spacing: 0;
}
.fec-badge.neutral, .status-badge.neutral { border-color: var(--fec-border); background: var(--fec-bg-subtle); color: var(--fec-text-muted); }
.fec-badge.info, .fec-badge.processing, .status-badge.processing { border-color: color-mix(in srgb, var(--fec-info) 38%, var(--fec-border)); background: color-mix(in srgb, var(--fec-info) 12%, var(--fec-surface)); color: var(--fec-info); }
.fec-badge.success, .status-badge.approved, .status-badge.success { border-color: color-mix(in srgb, var(--fec-success) 38%, var(--fec-border)); background: color-mix(in srgb, var(--fec-success) 12%, var(--fec-surface)); color: var(--fec-success); }
.fec-badge.pending, .fec-badge.warning, .status-badge.pending, .status-badge.warning { border-color: color-mix(in srgb, var(--fec-warning) 42%, var(--fec-border)); background: color-mix(in srgb, var(--fec-warning) 12%, var(--fec-surface)); color: var(--fec-warning); }
.fec-badge.error, .fec-badge.danger, .status-badge.error { border-color: color-mix(in srgb, var(--fec-danger) 40%, var(--fec-border)); background: color-mix(in srgb, var(--fec-danger) 12%, var(--fec-surface)); color: var(--fec-danger); }

/* Forms */
.fec-form-surface, .fec-form, .content-form, .admin-form { background: var(--fec-surface); }
.fec-form-surface { padding: 26px; }
.fec-form-section + .fec-form-section { border-color: var(--fec-border); }
.fec-form-section-header h2, .fec-form-section-header h3 { color: var(--fec-text); }
.fec-form-section-header p { color: var(--fec-text-muted); }
.fec-form-grid { gap: 18px; }
.fec-form-field { gap: 7px; }
.fec-form-label { gap: 5px; color: var(--fec-text); font-size: 12px; font-weight: 740; }
.fec-field-required {
  display: inline-grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--fec-accent) 10%, transparent);
  color: var(--fec-accent);
  font-size: 12px;
  line-height: 1;
}
.fec-field-optional { color: var(--fec-text-subtle); font-size: 9px; }
.fec-control, input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--fec-border-strong) !important;
  border-radius: var(--fec-radius-md) !important;
  background: var(--fec-surface-raised) !important;
  box-shadow: none !important;
  color: var(--fec-text) !important;
}
input[type="date"] { min-inline-size: 0; }
input::placeholder, textarea::placeholder { color: var(--fec-text-subtle); opacity: 1; }
.fec-control:hover:not(:disabled):not([readonly]), input:hover, select:hover, textarea:hover { border-color: var(--fec-primary) !important; }
.fec-control:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  border-color: var(--fec-focus) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--fec-focus) 20%, transparent) !important;
  outline: none;
}
.fec-control:disabled, input:disabled, select:disabled, textarea:disabled { background: var(--fec-surface-strong) !important; color: var(--fec-text-subtle) !important; }
.fec-control[readonly], input[readonly], textarea[readonly] { background: var(--fec-bg-subtle) !important; }
.fec-field-help, label > small, .helptext { color: var(--fec-text-muted); }
.fec-field-error, .field-error, .errorlist, .form-error { color: var(--fec-danger); }
.form-error { padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--fec-danger) 36%, var(--fec-border)); border-radius: var(--fec-radius-md); background: color-mix(in srgb, var(--fec-danger) 9%, var(--fec-surface)); }
.form-grid, .evidence-form-grid, .scheduling-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.form-grid > label, .evidence-form-grid > label, .scheduling-form-grid > label, .content-form > label, .content-form > p {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 7px;
  color: var(--fec-text);
  font-size: 12px;
  font-weight: 740;
}
.form-grid .wide, .evidence-form-grid .wide, .scheduling-form-grid .wide { grid-column: 1 / -1; }
.filter-bar, .operational-filter-panel, .operational-table-tools, .fec-filter-panel {
  border: 1px solid var(--fec-border);
  border-top: 2px solid var(--module-accent);
  background: var(--fec-surface);
}
.filter-bar label, .operational-table-tools label { color: var(--fec-text-muted); }
.fec-filter-panel > summary, details.fec-filter-panel > summary { color: var(--fec-text); }
details.fec-filter-panel[open] > summary { border-color: var(--fec-border); background: var(--fec-bg-subtle); }
.fec-filter-meta, .fec-action-copy { color: var(--fec-text-muted); }
.fec-filter-actions, .fec-action-bar { border-color: var(--fec-border); }
.operational-report-form { grid-column: 1 / -1; }
.operational-report-form .fec-form-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.operational-report-form .fec-action-bar { justify-content: flex-start; }
.fec-readonly-field, .fec-change-state, .fec-two-column-sections > div { border-color: var(--fec-border); background: var(--fec-bg-subtle); }
.fec-readonly-field { border-left-width: 2px; border-left-color: var(--module-accent); }
.fec-readonly-field span, .fec-change-state span { color: var(--fec-text-muted); }
.fec-readonly-field strong, .fec-change-state strong { color: var(--fec-text); }
.fec-sensitive-note, .fec-protected-strip, .fec-operational-effective-note {
  border-color: var(--fec-border);
  border-left-width: 2px;
  background: color-mix(in srgb, var(--fec-info) 8%, var(--fec-surface));
  color: var(--fec-text-muted);
}
.fec-sensitive-note strong, .fec-protected-strip strong, .fec-operational-effective-note strong { color: var(--fec-text); }
.choice-card, .segmented-control span { border-color: var(--fec-border); background: var(--fec-surface-raised); color: var(--fec-text); }
.segmented-control input:checked + span { border-color: var(--fec-primary); background: color-mix(in srgb, var(--fec-primary) 11%, var(--fec-surface)); color: var(--fec-text); }

/* Tables and data density */
.table-wrap, .table-shell {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  border: 1px solid var(--fec-border);
  background: var(--fec-surface);
  scrollbar-gutter: stable;
  overscroll-behavior-inline: contain;
}
.table-wrap table, .table-shell table { width: 100%; min-width: 720px; font-variant-numeric: tabular-nums; }
.table-wrap th, .table-shell th {
  padding: 12px 14px;
  border-color: var(--fec-border-strong);
  background: var(--fec-bg-subtle);
  color: var(--fec-text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
}
.table-wrap td, .table-shell td { padding: 13px 14px; border-color: var(--fec-border); color: var(--fec-text); font-size: 11px; }
.table-wrap tbody tr:nth-child(even), .table-shell tbody tr:nth-child(even) { background: color-mix(in srgb, var(--fec-bg-subtle) 48%, transparent); }
.table-wrap tbody tr:hover, .table-shell tbody tr:hover { background: color-mix(in srgb, var(--module-accent) 8%, var(--fec-surface)); }
.table-wrap td > small, .table-shell td > small { color: var(--fec-text-muted); }
.table-wrap :is(td, th).money, .table-wrap :is(td, th)[data-type="number"] { text-align: right; }
.pagination { flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 36px; min-height: 36px; padding: 7px 10px; border: 1px solid var(--fec-border); background: var(--fec-surface); }

/* Workflows, timelines and overlays */
.workflow-rail, .approval-item, .fec-workflow-gate, .fec-workflow-checklist__item, .fec-workflow-intro { border-color: var(--fec-border); background: var(--fec-surface); }
.workflow-node::after, .event-timeline::before, .fec-workflow-progress__step::before { background: var(--fec-border); }
.workflow-node::before { border-color: var(--fec-surface); box-shadow: 0 0 0 1px var(--fec-border-strong); }
.event-timeline li::before { border-color: var(--fec-bg); background: var(--module-accent); }
.module-view--ssw .event-timeline { border-color: var(--fec-border); background: var(--fec-surface); }
.module-view--ssw .event-timeline li::before { border-color: var(--fec-surface); }
.event-timeline time, .event-timeline p { color: var(--fec-text-muted); }
.fec-workflow-progress { border-color: var(--fec-border); background: var(--fec-surface); }
.fec-workflow-progress__marker { border-color: var(--fec-border-strong); background: var(--fec-surface-raised); color: var(--fec-text-muted); }
.fec-workflow-progress__copy strong { color: var(--fec-text); }
.fec-workflow-state, .fec-workflow-justification, .fec-workflow-outcome, .fec-workflow-related, .fec-workflow-blockers {
  border-left-width: 2px;
  background: color-mix(in srgb, var(--module-accent) 7%, var(--fec-surface));
}
.fec-workflow-state h2, .fec-workflow-justification h2, .fec-workflow-outcome h2, .fec-workflow-related h2, .fec-workflow-blockers h2 { color: var(--fec-text); }
.fec-workflow-state p, .fec-workflow-justification > p:last-child, .fec-workflow-outcome p, .fec-workflow-related p, .fec-workflow-blockers p { color: var(--fec-text-muted); }
.fec-workflow-blockers li { border-color: color-mix(in srgb, var(--fec-warning) 34%, var(--fec-border)); background: var(--fec-surface-raised); }
.fec-accordion { border-color: var(--fec-border); background: var(--fec-surface); box-shadow: none; }
.fec-accordion summary, .fec-accordion > div { color: var(--fec-text); }
.fec-tabs { border-color: var(--fec-border); background: var(--fec-bg-subtle); }
.fec-tabs [role="tab"] { color: var(--fec-text-muted); }
.fec-tabs [role="tab"]:hover { background: var(--fec-surface-raised); color: var(--fec-text); }
.fec-tabs [role="tab"][aria-selected="true"] { background: var(--fec-surface-raised); color: var(--fec-text); box-shadow: var(--fec-shadow-sm); }

/* Empty, error and authentication states */
.fec-empty-state {
  min-height: 180px;
  border: 1px dashed var(--fec-border-strong);
  border-radius: var(--fec-radius-lg);
  background: color-mix(in srgb, var(--fec-bg-subtle) 62%, transparent);
  color: var(--fec-text-muted);
}
.fec-empty-state > svg, .fec-empty-state svg { background: var(--fec-surface); color: var(--module-accent); }
.fec-empty-state h2, .fec-empty-state strong { color: var(--fec-text); }
.error-page {
  display: grid;
  max-width: 660px;
  min-height: calc(100vh - 210px);
  place-content: center;
  justify-items: start;
  padding: 48px 0;
}
.error-icon { display: grid; width: 52px; height: 52px; place-items: center; border: 1px solid var(--fec-border); border-radius: var(--fec-radius-lg); background: var(--fec-surface); color: var(--fec-accent); }
.error-icon svg { width: 24px; height: 24px; }
.error-code { margin: 24px 0 0; color: var(--fec-accent); font-size: 15px; font-weight: 800; }
.error-page h1 { margin: 5px 0 10px; font-size: 32px; }
.error-page p:not(.error-code) { max-width: 58ch; margin-bottom: 24px; color: var(--fec-text-muted); line-height: 1.65; }

.auth-page {
  --auth-scene-bg: #d7e8ed;
  --auth-scene-bg-deep: #a9cbd4;
  --auth-scene-text: #082d3a;
  --auth-scene-muted: #355d69;
  --auth-grid: rgba(16, 90, 108, .14);
  --auth-horizon: rgba(18, 141, 162, .42);
  --auth-road-near: #082f3e;
  --auth-road-far: #1b5665;
  --auth-road-shadow: rgba(3, 27, 36, .28);
  --auth-road-edge: #68b8c7;
  --auth-lane: rgba(226, 244, 247, .72);
  --auth-route: #0da7bc;
  --auth-route-bright: #70d8e3;
  --auth-route-soft: rgba(13, 167, 188, .26);
  --auth-signal-bg: rgba(245, 251, 252, .84);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--fec-bg);
}
:root[data-theme="dark"] .auth-page {
  --auth-scene-bg: #041b25;
  --auth-scene-bg-deep: #073241;
  --auth-scene-text: #f3f8fa;
  --auth-scene-muted: #a8c0c9;
  --auth-grid: rgba(91, 190, 207, .12);
  --auth-horizon: rgba(75, 189, 206, .34);
  --auth-road-near: #020f16;
  --auth-road-far: #0b3441;
  --auth-road-shadow: rgba(0, 7, 11, .64);
  --auth-road-edge: #2b7b8b;
  --auth-lane: rgba(179, 216, 224, .52);
  --auth-route: #4bbdce;
  --auth-route-bright: #9ce9ef;
  --auth-route-soft: rgba(75, 189, 206, .24);
  --auth-signal-bg: rgba(6, 38, 49, .9);
}
.auth-theme-control { position: fixed; z-index: 4; top: 18px; right: 20px; }
.auth-theme-control .theme-switcher { box-shadow: var(--fec-shadow-sm); }
.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 13fr) minmax(420px, 7fr);
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--fec-bg);
}
.auth-intro {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(330px, 1fr) auto;
  gap: 14px;
  overflow: hidden;
  min-width: 0;
  padding: 30px clamp(36px, 3.8vw, 64px) 24px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--auth-scene-bg) 88%, white) 0%, var(--auth-scene-bg) 38%, var(--auth-scene-bg-deep) 100%);
  color: var(--auth-scene-text);
  isolation: isolate;
}
.auth-intro::after { content: none; }
:root[data-theme="dark"] .auth-intro {
  background: linear-gradient(180deg, var(--auth-scene-bg) 0%, #052733 44%, var(--auth-scene-bg-deep) 100%);
}
.auth-brand-lockup { display: flex; align-items: center; gap: 16px; min-height: 48px; }
.auth-brand-lockup img { width: 190px; height: auto; object-fit: contain; }
:root[data-theme="dark"] .auth-brand-lockup img { content: url("../img/fec-logo-dark-background.e2a4e0506c3e.png"); }
.auth-brand-lockup span {
  padding-left: 16px;
  border-left: 1px solid color-mix(in srgb, var(--auth-scene-text) 20%, transparent);
  color: var(--auth-scene-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.auth-route-copy { align-self: end; padding-top: 4px; }
.auth-route-copy .eyebrow { margin-bottom: 8px; color: color-mix(in srgb, var(--auth-route) 72%, var(--auth-scene-text)); }
.auth-route-copy h1 { max-width: 15ch; margin: 0 0 10px; color: var(--auth-scene-text); font-size: 46px; line-height: 1.04; }
.auth-route-copy h1 span { color: var(--fec-accent); }
.auth-route-copy > p:not(.eyebrow) { max-width: 48ch; margin: 0; color: var(--auth-scene-muted); font-size: 15px; line-height: 1.55; }
.auth-corridor { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; }
.auth-corridor-status { display: flex; justify-content: flex-end; gap: 18px; color: var(--auth-scene-muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.auth-corridor-status span { display: inline-flex; align-items: center; gap: 7px; }
.auth-corridor-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--auth-route); box-shadow: 0 0 0 4px var(--auth-route-soft); }
.auth-route-scene { align-self: end; width: 100%; min-height: 300px; }
.auth-route-map { display: block; width: 100%; height: 100%; min-height: 300px; overflow: visible; }
.auth-route-grid { fill: none; stroke: var(--auth-grid); stroke-width: 1; }
.auth-horizon { fill: none; stroke: var(--auth-horizon); stroke-width: 2; }
.auth-road-stop--near { stop-color: var(--auth-road-near); }
.auth-road-stop--far { stop-color: var(--auth-road-far); }
.auth-route-stop--start { stop-color: var(--auth-route); }
.auth-route-stop--end { stop-color: var(--auth-route-bright); }
.auth-road-shadow { fill: var(--auth-road-shadow); }
.auth-road-surface { fill: url("#auth-road-surface"); }
.auth-road-edge, .auth-route-lane, .auth-route-progress { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.auth-road-edge { stroke: var(--auth-road-edge); stroke-width: 5; }
.auth-route-lane { stroke: var(--auth-lane); stroke-width: 3; stroke-dasharray: 12 22; }
.auth-route-progress {
  stroke: url("#auth-route-light");
  stroke-width: 9;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: auth-route-draw 18s linear infinite;
  filter: drop-shadow(0 0 7px var(--auth-route-soft));
}
.auth-road-lights circle { fill: var(--auth-route-bright); filter: drop-shadow(0 0 4px var(--auth-route)); }
.auth-route-node-ring {
  fill: var(--auth-route-soft);
  stroke: var(--auth-route);
  stroke-width: 3;
  transform-box: fill-box;
  transform-origin: center;
  animation: auth-node-pulse 18s linear infinite;
}
.auth-route-node-core {
  fill: var(--auth-road-near);
  stroke: var(--auth-route-bright);
  stroke-width: 5;
  animation: auth-node-core 18s linear infinite;
}
.auth-route-node--collection :is(.auth-route-node-ring, .auth-route-node-core) { animation-delay: 4.5s; }
.auth-route-node--transfer :is(.auth-route-node-ring, .auth-route-node-core) { animation-delay: 9s; }
.auth-route-node--destination :is(.auth-route-node-ring, .auth-route-node-core) { animation-delay: 13.5s; }
.auth-data-signal { animation: auth-signal-float 6s ease-in-out infinite; }
.auth-data-signal--ctrb { animation-delay: -2s; }
.auth-data-signal--ssw { animation-delay: -4s; }
.auth-data-signal rect { fill: var(--auth-signal-bg); stroke: color-mix(in srgb, var(--auth-route) 62%, transparent); stroke-width: 1; }
.auth-data-signal text { fill: var(--auth-scene-text); font-family: inherit; font-size: 12px; font-weight: 800; }
.auth-route-packet { fill: var(--auth-route-bright); opacity: .8; filter: drop-shadow(0 0 5px var(--auth-route)); }
.auth-route-packet--two { opacity: .56; }
.auth-route-vehicle, .auth-route-vehicle-static { filter: drop-shadow(0 5px 9px rgba(2, 21, 28, .4)); }
.auth-route-vehicle-static { display: none; }
.auth-route-vehicle-disc { fill: var(--fec-accent); stroke: color-mix(in srgb, var(--auth-scene-text) 86%, transparent); stroke-width: 3; }
.auth-route-truck-body { fill: var(--auth-scene-text); }
.auth-route-truck-window { fill: var(--auth-route-bright); }
.auth-route-truck-wheel { fill: var(--auth-road-near); stroke: var(--auth-scene-text); stroke-width: 2; }
.auth-route-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: -2px 0 0;
  padding: 0;
  list-style: none;
}
.auth-route-steps li { display: grid; gap: 2px; min-width: 0; color: var(--auth-scene-muted); }
.auth-route-steps span { color: var(--auth-route); font-size: 11px; font-weight: 800; }
.auth-route-steps strong { overflow: hidden; color: var(--auth-scene-text); font-size: 12px; text-overflow: ellipsis; text-transform: uppercase; }
.auth-route-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--auth-scene-muted); font-size: 11px; }
.auth-route-footer span { display: inline-flex; align-items: center; gap: 8px; }
.auth-route-footer svg { width: 16px; height: 16px; color: var(--auth-route); }

.auth-panel { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; place-items: center; padding: 72px clamp(42px, 4.5vw, 78px); background: var(--fec-surface); }
.auth-login-shell { width: 100%; max-width: 470px; }
.auth-form-header .eyebrow { margin-bottom: 9px; }
.auth-form-header h2 { margin: 0 0 10px; color: var(--fec-text); font-size: 34px; line-height: 1.16; }
.auth-form-header > p:not(.eyebrow) { max-width: 42ch; margin: 0; color: var(--fec-text-muted); line-height: 1.6; }
.auth-form { gap: 20px; margin-top: 36px; }
.auth-field { display: grid; gap: 7px; }
.auth-field label { color: var(--fec-text); font-size: 13px; font-weight: 760; }
.auth-field input { width: 100%; min-height: 56px; padding-inline: 15px; background: var(--fec-surface-raised); }
.auth-field input:focus { background: var(--fec-surface); }
.auth-form .field-error { margin: 0; }
.auth-form-error {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin: 0;
  padding: 12px 13px;
  border: 1px solid color-mix(in srgb, var(--fec-danger) 44%, var(--fec-border));
  border-radius: var(--fec-radius-md);
  background: color-mix(in srgb, var(--fec-danger) 8%, var(--fec-surface));
  color: var(--fec-danger);
  animation: auth-error-enter var(--fec-motion-normal) var(--fec-ease) both;
}
.auth-form-error svg { width: 18px; height: 18px; margin-top: 1px; }
.auth-submit { min-height: 56px; margin-top: 2px; }
.auth-submit[aria-busy="true"] > svg { opacity: 0; }
.auth-security-note { display: flex; align-items: center; gap: 9px; margin-top: 22px; color: var(--fec-text-muted); font-size: 12px; }
.auth-security-note svg { width: 16px; height: 16px; color: var(--fec-primary); }
.auth-support { margin: 24px 0 0; color: var(--fec-text-muted); font-size: 12px; text-align: center; }
.auth-page:has(#id_username:focus) .auth-route-progress { stroke-width: 12; filter: drop-shadow(0 0 11px var(--auth-route-soft)); }
.auth-page:has(#id_password:focus) .auth-route-node--destination .auth-route-node-core { fill: var(--fec-accent); stroke: var(--auth-scene-bg); }
.auth-page:has(.auth-submit[aria-busy="true"]) .auth-route-progress { animation: none; stroke-dashoffset: 0; }
.auth-page:has(.auth-submit[aria-busy="true"]) .auth-route-node--destination .auth-route-node-core { fill: var(--fec-accent); }
.auth-page:has(.auth-submit[aria-busy="true"]) .auth-route-vehicle { display: none; }
.auth-page:has(.auth-submit[aria-busy="true"]) .auth-route-vehicle-static { display: block; }

@keyframes auth-route-draw {
  0%, 5% { stroke-dashoffset: 1; opacity: .64; }
  84%, 96% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: .24; }
}
@keyframes auth-node-pulse {
  0%, 4% { opacity: .72; transform: scale(.92); }
  9% { opacity: 1; transform: scale(1.38); }
  18% { opacity: .58; transform: scale(1); }
  22%, 100% { opacity: .34; transform: scale(1); }
}
@keyframes auth-node-core {
  0%, 16% { fill: var(--fec-accent); stroke: var(--auth-scene-text); }
  22%, 100% { fill: var(--auth-road-near); stroke: var(--auth-route-bright); }
}
@keyframes auth-signal-float {
  0%, 100% { opacity: .64; }
  50% { opacity: 1; }
}
@keyframes auth-error-enter {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Design system */
.logo-sample, .color-grid > div, .component-demo { border-color: var(--fec-border); background: var(--fec-surface); }
.logo-sample.light { background: #fff; }
.logo-sample.dark { background: #07384b; }
.color-grid i { border-color: var(--fec-border); }
.color-grid small { color: var(--fec-text-muted); }
.swatch-primary { background: var(--fec-primary); }
.swatch-petrol { background: #075d72; }
.swatch-cyan { background: var(--fec-cyan); }
.swatch-accent { background: var(--fec-accent); }
.swatch-surface { background: var(--fec-surface); }
.design-foundation-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 16px; }
.type-showcase, .theme-showcase { display: grid; align-content: center; gap: 10px; min-height: 230px; padding: 24px; }
.type-showcase h2, .theme-showcase h3 { margin: 0; }
.type-showcase p, .theme-showcase p { max-width: 62ch; margin: 0; color: var(--fec-text-muted); }
.metric-sample { margin-top: 14px; color: var(--fec-text); font-size: 34px; font-variant-numeric: tabular-nums; }
.metric-sample small { color: var(--fec-text-muted); font-size: 13px; }
.theme-showcase .theme-switcher { justify-self: start; margin-top: 8px; }

/* Dark theme repairs for legacy literals. */
:root[data-theme="dark"] :is(.fec-card, .panel, .table-wrap, .table-shell, .filter-bar, .status-strip, .metric-band,
  .status-card, .navigation-card, .workflow-rail, .approval-item, .entity-hero, .fec-form, .fec-form-surface,
  .fec-filter-panel, .form-section, .content-form, .admin-form, .fec-accordion, .fec-tabs [role="tab"][aria-selected="true"],
  .fec-workflow-gate, .fec-workflow-checklist__item, .fec-workflow-intro, .module-view--ssw .event-timeline,
  .finance-summary-strip, .ranking-grid > div, .receiving-operational-table tr) { background: var(--fec-surface); color: var(--fec-text); }
:root[data-theme="dark"] :is(.fec-kpi-card, .module-view--ssw .fec-kpi-card) { background: var(--fec-surface); }
:root[data-theme="dark"] :is(.table-wrap th, .table-shell th) { background: var(--fec-bg-subtle); color: var(--fec-text-muted); }
:root[data-theme="dark"] :is(.table-wrap tbody tr:nth-child(even), .table-shell tbody tr:nth-child(even)) { background: color-mix(in srgb, var(--fec-surface-raised) 52%, transparent); }
:root[data-theme="dark"] :is(.fec-sensitive-note, .fec-protected-strip, .fec-operational-effective-note, .scope-note, .notice,
  .fec-workflow-state, .fec-workflow-justification, .fec-workflow-outcome, .fec-workflow-related, .fec-workflow-blockers,
  .fec-change-state--proposed) { background: color-mix(in srgb, var(--module-accent) 10%, var(--fec-surface)); }
:root[data-theme="dark"] .topbar { background: color-mix(in srgb, var(--fec-surface) 96%, transparent); }
:root[data-theme="dark"] .kpi-heading svg,
:root[data-theme="dark"] .navigation-card > svg:first-child,
:root[data-theme="dark"] .entity-avatar,
:root[data-theme="dark"] .fec-workflow-checklist__icon { background: var(--fec-bg-subtle); }
:root[data-theme="dark"] .chart-loading { color: var(--fec-text-muted); }

@keyframes fec-page-arrive {
  from { opacity: .4; translate: 0 6px; }
  to { opacity: 1; translate: 0 0; }
}
@keyframes fec-spin { to { rotate: 360deg; } }

@supports (view-transition-name: none) {
  .topbar { view-transition-name: fec-topbar; }
  .sidebar { view-transition-name: fec-sidebar; }
  .page-frame { view-transition-name: fec-content; }
  ::view-transition-old(fec-content), ::view-transition-new(fec-content) { animation-duration: var(--fec-motion-normal); }
}

@media (max-width: 1180px) {
  :root { --fec-sidebar-width: 238px; }
  .content { padding-inline: 24px; }
  .executive-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .erp-launchpad { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .approval-item { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fec-workflow-checklist__item { grid-template-columns: minmax(220px, 1fr) minmax(150px, .7fr); }
  .fec-workflow-checklist__action { grid-column: 1 / -1; }
  .auth-layout { grid-template-columns: minmax(0, 1.55fr) minmax(400px, 1fr); }
  .auth-intro { padding-inline: 34px; }
  .auth-route-copy h1 { font-size: 40px; }
  .auth-panel { padding-inline: 38px; }
}

@media (max-height: 780px) and (min-width: 821px) {
  .auth-intro { grid-template-rows: auto auto minmax(260px, 1fr) auto; gap: 8px; padding-block: 22px 18px; }
  .auth-brand-lockup img { width: 150px; }
  .auth-route-copy h1 { margin-bottom: 6px; font-size: 35px; }
  .auth-route-copy > p:not(.eyebrow) { display: none; }
  .auth-route-scene, .auth-route-map { min-height: 250px; }
  .auth-panel { padding-block: 48px; }
  .auth-form { margin-top: 24px; }
}

@media (max-width: 820px) {
  .app-shell, .sidebar-collapsed .app-shell { display: block; }
  .sidebar, .sidebar-collapsed .sidebar { width: min(304px, 88vw); }
  .sidebar-collapsed .brand-full { display: block; }
  .sidebar-collapsed .brand-mark { display: none; }
  .sidebar-collapsed .brand { width: 160px; }
  .sidebar-collapsed .sidebar-brand { justify-content: flex-start; padding-inline: 18px 14px; }
  .sidebar-collapsed .sidebar-brand-actions { position: static; }
  .sidebar-collapse { display: none; }
  .sidebar-close { display: inline-grid; }
  .sidebar-collapsed .main-nav { margin-top: 24px; }
  .sidebar-collapsed .nav-section-toggle { display: flex; }
  .sidebar-collapsed .nav-section-content { gap: 2px; }
  .sidebar-collapsed .main-nav a, .sidebar-collapsed .main-nav .nav-disabled { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; place-items: initial; padding: 8px 10px; }
  .sidebar-collapsed .main-nav a span, .sidebar-collapsed .main-nav a small, .sidebar-collapsed .nav-disabled span { display: inline; }
  .sidebar-collapsed .sidebar-user { grid-template-columns: 36px minmax(0, 1fr) 32px; justify-items: initial; }
  .sidebar-collapsed .sidebar-user > span:nth-child(2), .sidebar-collapsed .sidebar-user > a { display: grid; }
  .menu-open { overflow: hidden; }
  .sidebar-backdrop { background: rgba(3, 17, 24, .62); }
  .topbar { height: 62px; padding-inline: 12px 14px; }
  .topbar-product, .topbar-divider, .scope > span:last-child, .environment-badge, .topbar-user > span:last-child { display: none; }
  .topbar-user { min-width: 0; padding: 3px; border: 0; }
  .content { min-height: calc(100vh - 62px); padding: 24px 18px 56px; }
  .page-header h1, .executive-header h1, .receiving-dashboard-header h1 { font-size: 27px; }
  .page-header-row, .executive-header, .receiving-dashboard-header { display: grid; align-items: start; }
  .page-header-meta { min-width: 0; width: fit-content; }
  .kpi-grid, .executive-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .erp-launchpad, .navigation-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fec-form-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .fec-form-field--third, .fec-form-field--quarter { grid-column: span 3; }
  .fec-inline-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workflow-rail { grid-template-columns: 1fr; }
  .event-timeline li { grid-template-columns: 1fr; }
  .design-foundation-grid { grid-template-columns: 1fr; }
  .auth-layout { grid-template-columns: 1fr; overflow: visible; }
  .auth-intro {
    grid-template-rows: auto auto minmax(155px, 1fr);
    gap: 8px;
    min-height: 410px;
    padding: 20px 28px 15px;
  }
  .auth-brand-lockup img { width: 144px; }
  .auth-route-copy { align-self: center; }
  .auth-route-copy .eyebrow { margin-bottom: 5px; }
  .auth-route-copy h1 { margin-bottom: 0; font-size: 29px; }
  .auth-route-copy > p:not(.eyebrow), .auth-route-footer { display: none; }
  .auth-corridor-status { display: none; }
  .auth-route-scene, .auth-route-map { min-height: 155px; }
  .auth-route-steps { margin-top: 0; }
  .auth-panel { min-height: 0; padding: 46px 28px 52px; }
}

@media (max-width: 600px) {
  .content { padding: 20px 14px 48px; }
  .topbar-actions { gap: 4px; }
  .theme-switcher { grid-template-columns: repeat(3, 32px); }
  .theme-switcher button { width: 32px; }
  .topbar-user { display: none; }
  .page-header, .executive-header, .receiving-dashboard-header { margin-bottom: 22px; padding-bottom: 18px; }
  .page-header h1, .executive-header h1, .receiving-dashboard-header h1 { max-width: 100%; font-size: 25px; }
  .page-header-meta { width: 100%; }
  .section-heading { align-items: flex-start; gap: 8px; }
  .section-heading h2 { font-size: 18px; }
  .kpi-grid, .executive-kpis, .erp-launchpad, .navigation-card-grid, .status-card-grid,
  .module-view--ssw .status-card-grid, .module-view--finance .kpi-grid { grid-template-columns: 1fr; }
  .fec-kpi-card { min-height: 122px; }
  .page-actions, .actions { display: grid; grid-template-columns: 1fr; }
  .page-actions > *, .actions > *, .primary-button, .secondary-button, .neutral-button, .danger-button { max-width: 100%; }
  .fec-form-surface { padding: 20px 14px; }
  .fec-form-grid, .form-grid, .evidence-form-grid, .scheduling-form-grid, .operational-report-form .fec-form-grid { grid-template-columns: 1fr; gap: 15px; }
  .fec-form-field, .fec-form-field--full, .fec-form-field--third, .fec-form-field--quarter { grid-column: 1; }
  .fec-filter-actions, .fec-action-bar, .fec-inline-form { display: grid; grid-template-columns: 1fr; }
  .fec-filter-actions > *, .fec-action-bar > *, .fec-inline-form > * { width: 100%; }
  .filter-bar, .operational-table-tools { display: grid; grid-template-columns: 1fr; }
  .filter-bar > *, .operational-table-tools > * { width: 100%; }
  .table-wrap, .table-shell { width: 100%; max-width: calc(100vw - 28px); }
  .table-wrap table, .table-shell table { min-width: 680px; }
  .fec-empty-state { min-height: 150px; padding: 22px 16px; }
  .fec-workflow-decision, .fec-workflow-blockers, .fec-workflow-gates, .fec-workflow-checklist__item,
  .fec-workflow-business-grid, .fec-workflow-summary { grid-template-columns: 1fr; }
  .fec-workflow-business-grid article, .fec-workflow-summary > div { border-left: 0 !important; }
  .entity-hero, .entity-hero-main { display: grid; }
  .entity-hero-status { justify-items: start; }
  .auth-intro { grid-template-rows: auto auto minmax(120px, 1fr); min-height: 280px; padding: 16px 20px 12px; }
  .auth-brand-lockup { min-height: 38px; }
  .auth-brand-lockup img { width: 124px; }
  .auth-brand-lockup span { display: none; }
  .auth-route-copy .eyebrow { font-size: 9px; }
  .auth-route-copy h1 { max-width: 100%; font-size: 24px; }
  .auth-route-scene { height: 120px; min-height: 120px; overflow: hidden; }
  .auth-route-map { height: auto; min-height: 0; transform: translateY(-40px); }
  .auth-data-signal { display: none; }
  .auth-road-lights circle:nth-child(even) { display: none; }
  .auth-route-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-route-steps li:nth-child(2), .auth-route-steps li:nth-child(3) { display: none; }
  .auth-route-steps li:last-child { justify-items: end; text-align: right; }
  .auth-panel { padding: 36px 20px 40px; }
  .auth-login-shell { width: 100%; }
  .auth-form-header h2 { font-size: 28px; }
  .auth-form { gap: 15px; margin-top: 25px; }
  .auth-field input, .auth-submit { min-height: 52px; }
  .auth-theme-control { top: 14px; right: 14px; }
  .logo-showcase, .color-grid, .distribution-grid { grid-template-columns: 1fr; }
  .type-showcase, .theme-showcase { min-height: 0; padding: 20px; }
  .messages { right: 14px; }
}

@media (max-width: 390px) {
  .content { padding-inline: 12px; }
  .scope { display: none; }
  .topbar { justify-content: space-between; }
  .theme-switcher { grid-template-columns: repeat(3, 30px); }
  .theme-switcher button { width: 30px; }
  .fec-kpi-card > strong { font-size: 29px; }
  .table-wrap, .table-shell { max-width: calc(100vw - 24px); }
  .auth-intro { min-height: 274px; padding-inline: 16px; }
  .auth-route-copy h1 { font-size: 23px; }
  .auth-route-scene { height: 116px; min-height: 116px; }
  .auth-panel { padding: 30px 16px 34px; }
  .auth-form-header h2 { font-size: 27px; }
  .auth-security-note { margin-top: 18px; }
  .auth-support { margin-top: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .experience-mounted .page-frame { animation: none; }
  .auth-route-progress { animation: none; stroke-dashoffset: 0; opacity: 1; }
  .auth-route-node-ring { animation: none; opacity: .72; transform: none; }
  .auth-route-node-core { animation: none; fill: var(--auth-route-bright); }
  .auth-route-node--destination .auth-route-node-core { fill: var(--fec-accent); }
  .auth-data-signal { animation: none; opacity: .88; }
  .auth-route-packet, .auth-route-vehicle { display: none; }
  .auth-route-vehicle-static { display: block; }
  .auth-form-error { animation: none; }
}
