/**
 * WASHMATE COMMERCIAL FABRIC CARE & LAUNDRY MANAGEMENT SAAS
 * Complete Enterprise Design System
 * 
 * Design Principles:
 * - Apple-level Simplicity + Stripe-level SaaS Clarity + Linear-level Interface Discipline
 * - 8px Spacing System
 * - Semantic Meaningful Colors (Green=Healthy, Amber=Attention, Red=Critical, Blue=Active)
 * - Restrained Subtle Radii (6px / 8px / 10px / 12px)
 * - Zero decorative noise, zero AI gradient blobs, zero glassmorphism
 */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Manrope:wght@400;500;600;700;800&display=swap');

/* ==========================================================================
   1. MASTER DESIGN TOKENS & SYSTEM VARIABLES (LIGHT MODE DEFAULT)
   ========================================================================== */

:root,
[data-theme="light"] {
  /* Typography */
  --font-sans: 'Manrope', 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* 8px Spacing System */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Subtle Radii (Crisp, human-designed enterprise feel) */
  --radius-sm: 5px;   /* Small controls, tags, badges, buttons */
  --radius-md: 7px;   /* Form inputs, selects, normal buttons */
  --radius-lg: 9px;   /* Cards, table containers, panels */
  --radius-xl: 12px;  /* Modals, drawers, command palette */
  --radius-full: 9999px;

  /* Core Layout Dimensions */
  --sidebar-width: 250px;
  --sidebar-collapsed-width: 68px;
  --topbar-height: 60px;
  --bottombar-height: 56px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Primary Brand (WashMate Blue + Secondary Cyan) */
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-active: #1E40AF;
  --primary-soft: #EFF6FF;
  --primary-border: #BFDBFE;
  --secondary-cyan: #06B6D4;

  /* Status Colors */
  --success: #16A34A;
  --success-hover: #15803D;
  --success-light: #DCFCE7;
  --success-soft: #F0FDF4;
  --success-border: #BBF7D0;

  --warning: #F59E0B;
  --warning-hover: #D97706;
  --warning-light: #FEF3C7;
  --warning-soft: #FFFBEB;
  --warning-border: #FDE68A;

  --danger: #EF4444;
  --danger-hover: #DC2626;
  --danger-light: #FEE2E2;
  --danger-soft: #FEF2F2;
  --danger-border: #FECACA;

  --info: #0EA5E9;
  --info-soft: #F0F9FF;
  --info-border: #BAE6FD;

  --indigo: #6366F1;
  --indigo-soft: #EEF2FF;
  --indigo-border: #C7D2FE;

  /* Light Theme Canvas & Surfaces */
  --bg-app: #F5F7FA;
  --bg-sidebar: #FFFFFF;
  --bg-topbar: #FFFFFF;
  --bg-surface: #FFFFFF;
  --bg-surface-elevated: #F8FAFC;
  --bg-surface-hover: #F8FAFC;
  --bg-input: #FFFFFF;

  /* Borders & Dividers */
  --border-subtle: #E2E8F0;
  --border-medium: #CBD5E1;
  --border-focus: #2563EB;
  --border-divider: #E2E8F0;

  /* Typography */
  --text-main: #0F172A;
  --text-muted: #475569;
  --text-dim: #64748B;
  --text-inverse: #FFFFFF;

  /* Sidebar Tokens (Light Mode) */
  --sidebar-bg: #FFFFFF;
  --sidebar-text: #64748B;
  --sidebar-text-hover: #0F172A;
  --sidebar-hover-bg: #F1F5F9;
  --sidebar-active-bg: #EFF6FF;
  --sidebar-active-text: #1D4ED8;
  --sidebar-active-icon: #2563EB;
  --sidebar-section-label: #94A3B8;
  --sidebar-border: #E2E8F0;
  --sidebar-brand-title: #0F172A;
  --sidebar-user-bg: #F8FAFC;
  --sidebar-user-border: #E2E8F0;

  /* Table Specific Tokens */
  --table-header-bg: #F8FAFC;
  --table-header-text: #64748B;
  --table-row-bg: #FFFFFF;
  --table-row-hover: #F8FAFC;
  --table-border: #E2E8F0;

  /* Button Tokens (Light Mode) */
  --btn-secondary-bg: #F1F5F9;
  --btn-secondary-border: #E2E8F0;
  --btn-secondary-text: #334155;
  --btn-secondary-hover: #E2E8F0;

  /* Input Tokens (Light Mode) */
  --input-bg: #FFFFFF;
  --input-border: #CBD5E1;
  --input-text: #0F172A;
  --input-placeholder: #94A3B8;

  /* Alert / Attention Tokens (Light Mode) */
  --alert-high-bg: #FEF2F2;
  --alert-high-border: rgba(239, 68, 68, 0.25);
  --alert-high-text: #EF4444;
  --alert-warning-bg: #FFFBEB;
  --alert-warning-border: rgba(245, 158, 11, 0.25);
  --alert-warning-text: #F59E0B;
  --alert-success-bg: #F0FDF4;
  --alert-success-border: rgba(22, 163, 74, 0.25);
  --alert-success-text: #16A34A;

  /* Shadows (Subtle, Crisp, Non-diffuse) */
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 3px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 8px 16px -3px rgba(15, 23, 42, 0.06), 0 3px 6px -3px rgba(15, 23, 42, 0.03);
  --shadow-overlay: 0 16px 24px -4px rgba(15, 23, 42, 0.12), 0 6px 12px -4px rgba(15, 23, 42, 0.06);
}

/* ==========================================================================
   2. REFINED DARK THEME (Master Palette: Deep Navy & Slate Surfaces)
   ========================================================================== */

[data-theme="dark"] {
  /* Dark Theme Canvas & Surfaces */
  --bg-app: #0B1220;
  --bg-sidebar: #0F172A;
  --bg-topbar: #0F172A;
  --bg-surface: #111C2E;
  --bg-surface-elevated: #162338;
  --bg-surface-hover: #162338;
  --bg-input: #0F172A;

  /* Borders & Dividers */
  --border-subtle: #22304A;
  --border-medium: #334155;
  --border-focus: #2563EB;
  --border-divider: #1E293B;

  /* Typography */
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  --text-inverse: #0F172A;

  /* Sidebar Tokens (Dark Mode) */
  --sidebar-bg: #0F172A;
  --sidebar-text: #94A3B8;
  --sidebar-text-hover: #F8FAFC;
  --sidebar-hover-bg: #162338;
  --sidebar-active-bg: #2563EB;
  --sidebar-active-text: #FFFFFF;
  --sidebar-active-icon: #FFFFFF;
  --sidebar-section-label: #64748B;
  --sidebar-border: #1E293B;
  --sidebar-brand-title: #F8FAFC;
  --sidebar-user-bg: #111C2E;
  --sidebar-user-border: #22304A;

  /* Primary Brand */
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-active: #1E40AF;
  --primary-soft: rgba(37, 99, 235, 0.15);
  --primary-border: rgba(37, 99, 235, 0.35);
  --secondary-cyan: #06B6D4;

  /* Status Colors */
  --success: #16A34A;
  --success-hover: #22C55E;
  --success-light: #DCFCE7;
  --success-soft: rgba(22, 163, 74, 0.14);
  --success-border: rgba(22, 163, 74, 0.3);

  --warning: #F59E0B;
  --warning-hover: #D97706;
  --warning-light: #FEF3C7;
  --warning-soft: rgba(245, 158, 11, 0.14);
  --warning-border: rgba(245, 158, 11, 0.3);

  --danger: #EF4444;
  --danger-hover: #DC2626;
  --danger-light: #FEE2E2;
  --danger-soft: rgba(239, 68, 68, 0.14);
  --danger-border: rgba(239, 68, 68, 0.3);

  --info: #0EA5E9;
  --info-soft: rgba(14, 165, 233, 0.14);
  --info-border: rgba(14, 165, 233, 0.3);

  --indigo: #6366F1;
  --indigo-soft: rgba(99, 102, 241, 0.14);
  --indigo-border: rgba(99, 102, 241, 0.3);

  /* Table Specific Tokens */
  --table-header-bg: #0F172A;
  --table-header-text: #94A3B8;
  --table-row-bg: #111C2E;
  --table-row-hover: #162338;
  --table-border: #22304A;

  /* Button Tokens (Dark Mode) */
  --btn-secondary-bg: #1E293B;
  --btn-secondary-border: #334155;
  --btn-secondary-text: #E2E8F0;
  --btn-secondary-hover: #22304A;

  /* Input Tokens (Dark Mode) */
  --input-bg: #0F172A;
  --input-border: #334155;
  --input-text: #F8FAFC;
  --input-placeholder: #64748B;

  /* Alert / Attention Tokens (Dark Mode) */
  --alert-high-bg: rgba(239, 68, 68, 0.10);
  --alert-high-border: rgba(239, 68, 68, 0.3);
  --alert-high-text: #EF4444;
  --alert-warning-bg: rgba(245, 158, 11, 0.10);
  --alert-warning-border: rgba(245, 158, 11, 0.3);
  --alert-warning-text: #F59E0B;
  --alert-success-bg: rgba(22, 163, 74, 0.10);
  --alert-success-border: rgba(22, 163, 74, 0.3);
  --alert-success-text: #16A34A;

  /* Dark Elevation Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.25);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.35), 0 1px 2px -1px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 3px 6px -1px rgba(0, 0, 0, 0.35), 0 2px 4px -2px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 16px -3px rgba(0, 0, 0, 0.45), 0 3px 6px -3px rgba(0, 0, 0, 0.3);
  --shadow-overlay: 0 16px 24px -4px rgba(0, 0, 0, 0.55), 0 6px 12px -4px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   3. RESET & BASE TYPOGRAPHY
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  font-size: 0.875rem; /* 14px body standard */
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Headings: Restrained Professional Hierarchy */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  margin: 0;
}

h1 {
  font-size: 1.625rem; /* 26px (within 24-28px range) */
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

h2 {
  font-size: 1.0625rem; /* 17px (within 16-18px range) */
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

h3 {
  font-size: 0.9375rem; /* 15px (within 14-16px range) */
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

h4 {
  font-size: 0.875rem; /* 14px */
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.005em;
}

p {
  line-height: 1.5;
  font-weight: 400;
}

/* Text Hierarchy Utilities */
.text-body {
  font-size: 0.875rem; /* 14px */
  font-weight: 400;
  line-height: 1.5;
}

.text-secondary {
  font-size: 0.8125rem; /* 13px */
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.4;
}

.text-meta {
  font-size: 0.75rem; /* 12px */
  font-weight: 400;
  color: var(--text-dim);
  line-height: 1.4;
}

.text-micro {
  font-size: 0.6875rem; /* 11px */
  font-weight: 500;
  letter-spacing: 0.04em;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

/* Tabular figures for operational SaaS precision (revenue, counts, KPIs, tables) */
.mono, .tabular-nums, th, td, .stat-value, .kpi-number, .stage-count, .station-badge-count, .price-display, .currency-amt {
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: var(--font-mono);
}

/* ==========================================================================
   4. APPLICATION LAYOUT SHELL
   ========================================================================== */

.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  position: relative;
}

/* ==========================================================================
   5. SIDEBAR NAVIGATION
   ========================================================================== */

.app-sidebar {
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 40;
  transition: width var(--transition-normal);
  user-select: none;
  box-sizing: border-box;
}

/* Collapsed Sidebar Rail Mode */
.app-sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
  flex: 0 0 var(--sidebar-collapsed-width);
}

.app-sidebar.collapsed .brand-title-wrap,
.app-sidebar.collapsed .nav-section-title,
.app-sidebar.collapsed .nav-label,
.app-sidebar.collapsed .nav-badge,
.app-sidebar.collapsed .user-meta-info,
.app-sidebar.collapsed .brand-logo-expanded,
.app-sidebar.collapsed .sidebar-collapse-btn,
.app-sidebar.collapsed .brand-subtitle {
  display: none !important;
}

.app-sidebar.collapsed .sidebar-header {
  justify-content: center;
  padding: 0 8px;
}

.app-sidebar.collapsed .brand-wrapper {
  justify-content: center;
  width: 100%;
}

.app-sidebar.collapsed .brand-logo-collapsed {
  display: flex !important;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.app-sidebar.collapsed .sidebar-nav {
  padding: 8px 6px;
  gap: 6px;
}

.app-sidebar.collapsed .nav-section {
  gap: 2px;
}

.app-sidebar.collapsed .nav-link {
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0 auto;
  justify-content: center;
  border-radius: 8px;
}

.app-sidebar.collapsed .nav-link svg {
  margin: 0;
  width: 19px;
  height: 19px;
}

.app-sidebar.collapsed .sidebar-footer {
  flex-direction: column;
  padding: 10px 6px;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.app-sidebar.collapsed .user-mini {
  justify-content: center;
  gap: 0;
}

.app-sidebar.collapsed .sidebar-expand-btn {
  display: flex !important;
}

/* Sidebar Header */
.sidebar-header {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--sidebar-border);
  box-sizing: border-box;
  flex-shrink: 0;
}

/* Official WashMate Logo Branding Rules */
.logo-light-variant {
  display: inline-block !important;
}
.logo-dark-variant {
  display: none !important;
}

[data-theme="dark"] .logo-light-variant {
  display: none !important;
}
[data-theme="dark"] .logo-dark-variant {
  display: inline-block !important;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  min-height: 38px;
  min-width: 0;
}

.brand-logo-expanded {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-logo-collapsed {
  display: none;
}

.brand-subtitle {
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--primary);
  background-color: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-full);
  padding: 1px 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: 2px;
  white-space: nowrap;
}

/* Internal Sidebar Navigation Scroll Area (Clean, Subtle, Unobtrusive) */
.sidebar-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  transition: scrollbar-color 0.2s ease;
}

.sidebar-nav:hover {
  scrollbar-color: var(--border-medium) transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 9999px;
  transition: background-color 0.2s ease;
}

.sidebar-nav:hover::-webkit-scrollbar-thumb {
  background: var(--border-medium);
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

.sidebar-nav::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-title {
  font-size: 0.6875rem; /* 11px */
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sidebar-section-label);
  padding: 6px 12px 2px 12px;
  margin-bottom: 2px;
}

.nav-item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--sidebar-text);
  font-size: 0.875rem; /* 14px */
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
  border: 1px solid transparent;
  box-sizing: border-box;
}

.nav-link:hover {
  background-color: var(--sidebar-hover-bg);
  color: var(--sidebar-text-hover);
}

.nav-link.active {
  background-color: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 600;
  border-color: rgba(37, 99, 235, 0.12);
}

[data-theme="dark"] .nav-link.active {
  background-color: rgba(37, 99, 235, 0.18);
  color: #60A5FA;
  border-color: rgba(96, 165, 250, 0.25);
}

.nav-link svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
  flex-shrink: 0;
  color: currentColor;
  opacity: 0.85;
}

.nav-link:hover svg {
  opacity: 1;
  color: var(--sidebar-text-hover);
}

.nav-link.active svg {
  opacity: 1;
  color: var(--sidebar-active-icon);
}

[data-theme="dark"] .nav-link.active svg {
  color: #60A5FA;
}

.nav-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-badge {
  margin-left: auto;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.nav-badge.badge-blue {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
}

/* Sidebar Footer & User Section */
.sidebar-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.user-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  min-width: 0;
}

.user-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background-color: var(--sidebar-user-bg);
  border: 1px solid var(--sidebar-user-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text-main);
  flex-shrink: 0;
}

.user-meta-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-meta-role {
  font-size: 0.6875rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-collapse-btn {
  background: none;
  border: none;
  color: var(--sidebar-text);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.sidebar-collapse-btn:hover {
  background-color: var(--sidebar-hover-bg);
  color: var(--sidebar-text-hover);
}

.sidebar-expand-btn {
  display: none;
  background: none;
  border: none;
  color: var(--sidebar-text);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.sidebar-expand-btn:hover {
  background-color: var(--sidebar-hover-bg);
  color: var(--sidebar-text-hover);
}

.sidebar-logout-btn {
  color: var(--text-dim);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.sidebar-logout-btn:hover {
  background-color: var(--sidebar-hover-bg);
  color: var(--danger);
}

/* ==========================================================================
   6. MAIN WORKSPACE & TOP NAVIGATION
   ========================================================================== */

.app-main {
  flex: 1 1 0%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
}

.app-topbar {
  height: var(--topbar-height);
  background-color: var(--bg-topbar);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 30;
  gap: 16px;
  box-sizing: border-box;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mobile-menu-toggle:hover {
  background-color: var(--bg-surface-elevated);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.8125rem;
  color: var(--text-dim);
}

.breadcrumb-item {
  color: var(--text-muted);
}

.breadcrumb-separator {
  color: var(--border-medium);
}

.topbar-title-wrap {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.page-headline {
  font-size: 1.1875rem; /* 19px, confident topbar page title */
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.page-title {
  font-size: 1.625rem; /* 26px (within 24-28px range) */
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* Quick Search Button / Shortcut */
.btn-global-search {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 6px var(--space-3);
  border-radius: var(--radius-md);
  color: var(--text-dim);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-global-search:hover {
  border-color: var(--border-medium);
  color: var(--text-muted);
  background-color: var(--bg-surface);
}

.kbd-shortcut {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  padding: 1px 5px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: 4px;
  color: var(--text-muted);
}

[data-theme="dark"] .kbd-shortcut {
  background-color: #1E293B;
  border-color: #334155;
}

/* Business Facility Switcher */
.facility-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px var(--space-3);
  border-radius: var(--radius-md);
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.facility-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--success);
}

/* Theme Toggle Button */
.btn-theme-toggle {
  background: none;
  border: 1px solid var(--border-subtle);
  padding: 7px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-theme-toggle:hover {
  background-color: var(--bg-surface-elevated);
  color: var(--text-main);
  border-color: var(--border-medium);
}

/* Topbar Notification Icon */
.topbar-icon-btn {
  background: none;
  border: 1px solid var(--border-subtle);
  padding: 7px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.topbar-icon-btn:hover {
  background-color: var(--bg-surface-elevated);
  color: var(--text-main);
  border-color: var(--border-medium);
}

.notification-badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--primary);
}

/* Page Body Container */
.page-container {
  padding: var(--space-6);
  flex: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

/* ==========================================================================
   7. DASHBOARD SYSTEM (Decision & Operations Driven)
   ========================================================================== */

/* Top Operational Status Bar */
.dashboard-context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5);
}

.context-greeting-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.plant-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--success);
  background-color: var(--success-soft);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--success-border);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--success);
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.6); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

.context-meta-text {
  font-size: 0.8125rem;
  color: var(--text-dim);
}

/* Operations & Dashboard Semantic Responsive Split Layouts */
.operations-split-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-5);
  align-items: start;
}

.dashboard-split-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-4);
  align-items: start;
}

@media (max-width: 900px) {
  .operations-split-layout,
  .dashboard-split-layout {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}

/* Compact 5-KPI Strip */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.kpi-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
  text-decoration: none;
  min-height: 104px;
}

.kpi-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-1px);
}

.kpi-label {
  font-size: 0.6875rem; /* 11px */
  font-weight: 500; /* Card labels: 500 weight */
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: var(--space-1);
}

.kpi-number {
  font-size: 1.875rem; /* 30px (within 28-34px range) */
  font-weight: 700; /* KPI / financial numbers: 700 weight */
  color: var(--text-main);
  letter-spacing: -0.03em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums; /* Crisp number alignment */
}

.kpi-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem; /* 12px */
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  margin-top: var(--space-2);
}

.trend-positive {
  color: var(--success);
}

.trend-neutral {
  color: var(--text-dim);
}

.trend-negative {
  color: var(--danger);
}

/* ==========================================================================
   8. OPERATIONS TODAY: HORIZONTAL WORKFLOW CONTROL CENTER (Signature UI)
   ========================================================================== */

.operations-control-panel {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.section-title {
  font-size: 1.0625rem; /* 17px (within 16-18px range) */
  font-weight: 600; /* Section headings: 600 weight */
  letter-spacing: -0.015em;
  color: var(--text-main);
  line-height: 1.3;
}

.section-subtitle {
  font-size: 0.78125rem; /* 12.5px */
  font-weight: 400;
  color: var(--text-dim);
  line-height: 1.4;
}

/* Operations Flow Horizontal Track */
.operations-workflow-track {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-2);
}

.workflow-stage-card {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  transition: all var(--transition-fast);
  position: relative;
  min-height: 86px;
}

.workflow-stage-card:hover {
  background-color: var(--bg-surface);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.workflow-stage-card.active-stage {
  border-color: var(--primary);
}

.stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stage-number {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.stage-count {
  font-size: 1.375rem; /* 22px */
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.workflow-stage-card:hover .stage-count {
  color: var(--primary);
}

.stage-name {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage-progress-bar {
  height: 3px;
  background-color: var(--border-medium);
  border-radius: 2px;
  margin-top: var(--space-2);
  overflow: hidden;
}

.stage-progress-fill {
  height: 100%;
  background-color: var(--primary);
  border-radius: 2px;
}

/* ==========================================================================
   9. NEEDS ATTENTION: PRIORITY OPERATIONAL ACTION AREA
   ========================================================================== */

.attention-panel {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
}

.attention-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.attention-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  gap: var(--space-4);
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.attention-row:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--border-medium);
}

.attention-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.attention-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.attention-icon-wrap.high {
  background-color: var(--alert-high-bg);
  color: var(--alert-high-text);
  border: 1px solid var(--alert-high-border);
}

.attention-icon-wrap.medium {
  background-color: var(--alert-warning-bg);
  color: var(--alert-warning-text);
  border: 1px solid var(--alert-warning-border);
}

.attention-text-wrap {
  min-width: 0;
}

.attention-title {
  font-size: 0.84375rem; /* 13.5px */
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attention-desc {
  font-size: 0.75rem; /* 12px */
  font-weight: 400;
  color: var(--text-dim);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attention-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* ==========================================================================
   10. CARDS, PANELS & GRIDS
   ========================================================================== */

.card-panel {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
  box-shadow: var(--shadow-xs);
}

.card-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  gap: var(--space-4);
}

.card-panel-title {
  font-size: 0.9375rem; /* 15px (within 14-16px range) */
  font-weight: 600; /* Card title: 600 weight */
  letter-spacing: -0.01em;
  color: var(--text-main);
  line-height: 1.35;
}

/* ==========================================================================
   11. DATA TABLES (High Precision, Tabular Figures, Clean Headers)
   ========================================================================== */

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--table-border);
  border-radius: var(--radius-md);
  background-color: var(--table-row-bg);
}

.app-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.84375rem; /* 13.5px within 13-14px range */
}

.app-table th {
  background-color: var(--table-header-bg);
  color: var(--table-header-text);
  font-size: 0.6875rem; /* 11px (within 11-12px range) */
  font-weight: 600; /* Headers: 500-600 */
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 14px;
  border-bottom: 1px solid var(--table-border);
  white-space: nowrap;
}

.app-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--table-border);
  color: var(--text-muted);
  vertical-align: middle;
  background-color: var(--table-row-bg);
  font-size: 0.84375rem; /* 13.5px within 13-14px range */
  font-weight: 400; /* Rows: 400-500 */
  line-height: 1.45;
  font-variant-numeric: tabular-nums; /* Numbers: tabular-nums */
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.app-table tr:last-child td {
  border-bottom: none;
}

.app-table tr:hover td {
  background-color: var(--table-row-hover);
  color: var(--text-main);
}

.app-table td.strong {
  font-weight: 600;
  color: var(--text-main);
}

/* ==========================================================================
   12. STATUS BADGES (Standardized Adaptive Status Palette)
   ========================================================================== */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2.5px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.6875rem; /* 11px */
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.status-badge::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: currentColor;
}

.badge-slate   { background-color: var(--bg-surface-elevated); color: var(--text-dim); border: 1px solid var(--border-subtle); }
.badge-info    { background-color: var(--info-soft); color: var(--info); border: 1px solid var(--info-border); }
.badge-primary, .badge-blue { background-color: var(--primary-soft); color: var(--primary); border: 1px solid var(--primary-border); }
.badge-cyan    { background-color: rgba(6, 182, 212, 0.12); color: var(--secondary-cyan); border: 1px solid rgba(6, 182, 212, 0.28); }
.badge-indigo, .badge-purple { background-color: var(--indigo-soft); color: var(--indigo); border: 1px solid var(--indigo-border); }
.badge-success, .badge-emerald { background-color: var(--success-soft); color: var(--success); border: 1px solid var(--success-border); }
.badge-warning, .badge-amber   { background-color: var(--warning-soft); color: var(--warning); border: 1px solid var(--warning-border); }
.badge-danger  { background-color: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger-border); }
.badge-dark    { background-color: var(--bg-surface-elevated); color: var(--text-main); border: 1px solid var(--border-subtle); }

/* ==========================================================================
   13. BUTTONS (Restrained, Semantic Hierarchy, 13-14px / 600)
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.84375rem; /* 13.5px within 13-14px range */
  font-weight: 600; /* Buttons: 600 weight */
  letter-spacing: -0.005em;
  line-height: 1;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
  white-space: nowrap;
  user-select: none;
  vertical-align: middle;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background-color: var(--primary);
  color: #FFFFFF;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-primary:active {
  background-color: var(--primary-active);
}

.btn-secondary {
  background-color: var(--btn-secondary-bg);
  border-color: var(--btn-secondary-border);
  color: var(--btn-secondary-text);
}

.btn-secondary:hover {
  background-color: var(--btn-secondary-hover);
  border-color: var(--border-medium);
  color: var(--text-main);
}

.btn-success {
  background-color: var(--success);
  color: #FFFFFF;
}

.btn-success:hover {
  background-color: var(--success-hover);
}

.btn-danger {
  background-color: var(--danger);
  color: #FFFFFF;
}

.btn-danger:hover {
  background-color: var(--danger-hover);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.75rem; /* 12px */
  font-weight: 600;
  border-radius: var(--radius-sm);
}

.btn-icon {
  padding: 8px;
  border-radius: var(--radius-md);
}

/* Topbar Quick POS Action */
.btn-quick-pos {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--primary);
  color: #FFFFFF;
  padding: 6px 14px;
  font-size: 0.84375rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast);
}

.btn-quick-pos:hover {
  background-color: var(--primary-hover);
}

/* ==========================================================================
   14. FORMS & INPUT CONTROLS (Clean Scanning, 12-13px labels, 14px inputs)
   ========================================================================== */

.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-size: 0.78125rem; /* 12.5px within 12-13px range */
  font-weight: 500; /* Labels: 500 weight */
  margin-bottom: 6px;
  color: var(--text-muted);
  line-height: 1.35;
}

.form-control, .form-select {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  font-size: 0.875rem; /* Input text: 14px */
  font-weight: 400; /* 400-500 weight */
  font-family: inherit;
  color: var(--input-text);
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  outline: none;
  line-height: 1.4;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast), color var(--transition-fast);
}

textarea.form-control {
  height: auto;
  min-height: 80px;
  padding: 10px 12px;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-control::placeholder {
  color: var(--input-placeholder);
  font-size: 0.8125rem; /* 13px */
  font-weight: 400;
}

.form-text, .form-helper {
  display: block;
  font-size: 0.75rem; /* 12px helper text */
  font-weight: 400;
  color: var(--text-dim);
  margin-top: 4px;
}

.form-error {
  display: block;
  font-size: 0.75rem; /* 12px error text */
  font-weight: 500; /* Error: 500 weight */
  color: var(--danger);
  margin-top: 4px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
}

/* ==========================================================================
   15. ALERTS & FLASH MESSAGES
   ========================================================================== */

.app-alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  border: 1px solid transparent;
}

.alert-success { background-color: var(--success-soft); border-color: var(--success-border); color: var(--success); }
.alert-danger  { background-color: var(--danger-soft); border-color: var(--danger-border); color: var(--danger); }
.alert-warning { background-color: var(--warning-soft); border-color: var(--warning-border); color: var(--warning); }
.alert-info    { background-color: var(--primary-soft); border-color: var(--primary-border); color: var(--primary); }

/* ==========================================================================
   16. MODALS, COMMAND PALETTE & POPOVERS
   ========================================================================== */

.app-modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(11, 18, 32, 0.7);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  backdrop-filter: blur(2px);
}

.app-modal-dialog {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 580px;
  box-shadow: var(--shadow-overlay);
  overflow: hidden;
  animation: modalIn 0.15s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.97) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1rem; /* 16px */
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-main);
  line-height: 1.35;
}

.modal-body {
  padding: var(--space-5);
  max-height: calc(85vh - 120px);
  overflow-y: auto;
}

.modal-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  background-color: var(--bg-surface-elevated);
}

/* Command Palette (Global Search Modal) */
.command-palette-dialog {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 640px;
  box-shadow: var(--shadow-overlay);
  overflow: hidden;
  animation: modalIn 0.15s ease-out;
}

.command-search-input-wrap {
  display: flex;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  gap: var(--space-3);
}

.command-search-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--text-main);
}

.command-search-input::placeholder {
  color: var(--text-dim);
}

.command-results-list {
  max-height: 380px;
  overflow-y: auto;
  padding: var(--space-2);
}

.command-group-title {
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  padding: var(--space-2) var(--space-3) 4px var(--space-3);
}

.command-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.84375rem; /* 13.5px */
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.command-item:hover, .command-item.selected {
  background-color: var(--bg-surface-elevated);
}

/* Notification Popover Dropdown */
.popover-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-overlay);
  z-index: 50;
  overflow: hidden;
}

.popover-header {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.popover-title {
  font-size: 0.84375rem;
  font-weight: 600;
  color: var(--text-main);
}

.popover-list {
  max-height: 320px;
  overflow-y: auto;
}

.popover-item {
  display: flex;
  flex-direction: column;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color var(--transition-fast);
}

.popover-item:last-child {
  border-bottom: none;
}

.popover-item:hover {
  background-color: var(--bg-surface-elevated);
}

/* ==========================================================================
   17. TIMELINE & STATIONS
   ========================================================================== */

.timeline-list {
  position: relative;
  padding-left: var(--space-6);
  list-style: none;
}

.timeline-list::before {
  content: '';
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 7px;
  width: 2px;
  background-color: var(--border-subtle);
}

.timeline-item {
  position: relative;
  margin-bottom: var(--space-4);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-6) + 3px);
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--primary);
  border: 2px solid var(--bg-surface);
}

.timeline-title {
  font-size: 0.84375rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.35;
}

.timeline-meta {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-dim);
}

.timeline-desc {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Queue Stations Grid */
.queue-stations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

.station-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: all var(--transition-fast);
}

.station-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-sm);
}

.station-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.station-badge-count {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   18. RESPONSIVE DESIGN & MOBILE OPTIMIZATIONS
   ========================================================================== */

/* Mobile Bottom Navigation Bar (<= 768px) */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottombar-height);
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  z-index: 40;
  justify-content: space-around;
  align-items: center;
  padding: 0 4px;
}

.mobile-bottom-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--text-dim);
  font-size: 0.6875rem;
  font-weight: 500;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.mobile-bottom-item.active {
  color: var(--primary);
  font-weight: 600;
}

.mobile-bottom-item svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

/* Laptops / Desktops Narrow (<= 1199px) */
@media (max-width: 1199px) {
  .facility-pill {
    display: none !important;
  }
}

/* Tablet Devices (768px to 1199px) */
@media (min-width: 768px) and (max-width: 1199px) {
  .app-sidebar {
    width: var(--sidebar-collapsed-width) !important;
    flex: 0 0 var(--sidebar-collapsed-width) !important;
  }

  .app-sidebar .brand-title-wrap,
  .app-sidebar .nav-section-title,
  .app-sidebar .nav-label,
  .app-sidebar .nav-badge,
  .app-sidebar .user-meta-info,
  .app-sidebar .brand-logo-expanded,
  .app-sidebar .sidebar-collapse-btn,
  .app-sidebar .brand-subtitle {
    display: none !important;
  }

  .app-sidebar .sidebar-header {
    justify-content: center !important;
    padding: 0 8px !important;
  }

  .app-sidebar .brand-wrapper {
    justify-content: center !important;
    width: 100% !important;
  }

  .app-sidebar .brand-logo-collapsed {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
  }

  .app-sidebar .sidebar-nav {
    padding: 8px 6px !important;
    gap: 6px !important;
  }

  .app-sidebar .nav-section {
    gap: 2px !important;
  }

  .app-sidebar .nav-link {
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    margin: 0 auto !important;
    justify-content: center !important;
    border-radius: 8px !important;
  }

  .app-sidebar .nav-link svg {
    margin: 0 !important;
    width: 19px !important;
    height: 19px !important;
  }

  .app-sidebar .sidebar-footer {
    flex-direction: column !important;
    padding: 10px 6px !important;
    gap: 8px !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .app-sidebar .user-mini {
    justify-content: center !important;
    gap: 0 !important;
  }

  .app-sidebar .sidebar-expand-btn {
    display: none !important;
  }

  .kpi-strip {
    grid-template-columns: repeat(3, 1fr);
  }

  .operations-workflow-track {
    grid-template-columns: repeat(4, 1fr);
  }

  .btn-global-search .search-label,
  .btn-global-search .kbd-shortcut,
  .btn-quick-pos .pos-label {
    display: none !important;
  }

  .btn-global-search {
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    justify-content: center !important;
  }

  .btn-quick-pos {
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    justify-content: center !important;
    gap: 0 !important;
  }
}

/* Mobile Devices (<= 767px) */
@media (max-width: 767px) {
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    flex: none;
    height: 100%;
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
    z-index: 50;
    box-shadow: var(--shadow-xl);
  }

  .app-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: block;
  }

  .app-sidebar.open ~ .sidebar-backdrop,
  body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .app-main {
    width: 100%;
    min-width: 0;
    padding-bottom: calc(var(--bottombar-height) + 16px);
  }

  .mobile-menu-toggle {
    display: inline-flex !important;
  }

  .mobile-bottom-nav {
    display: flex;
  }

  .app-topbar {
    height: 56px;
    padding: 0 14px;
    gap: 8px;
  }

  .topbar-left {
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
  }

  .topbar-title-wrap {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
  }

  .page-headline {
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
  }

  .topbar-right {
    gap: 6px;
    flex-shrink: 0;
  }

  .facility-pill,
  .btn-global-search .search-label,
  .btn-global-search .kbd-shortcut,
  .btn-quick-pos .pos-label {
    display: none !important;
  }

  .btn-quick-pos {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    gap: 0;
  }

  .btn-global-search {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
  }

  .page-container {
    padding: 16px 12px;
  }

  .kpi-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .operations-workflow-track {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .attention-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .attention-right {
    width: 100%;
    justify-content: flex-end;
  }
}

/* Extra Small Phones (<= 480px) */
@media (max-width: 480px) {
  .user-label {
    display: none !important;
  }

  .topbar-right {
    gap: 4px;
  }

  .kpi-strip {
    grid-template-columns: 1fr;
  }

  .operations-workflow-track {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   19. ADAPTIVE THEME TRANSITIONS (Smooth 200ms ease, theme properties only)
   ========================================================================== */

body,
.app-sidebar,
.app-topbar,
.sidebar-header,
.sidebar-footer,
.nav-link,
.card-panel,
.kpi-card,
.operations-control-panel,
.workflow-stage-card,
.attention-panel,
.attention-row,
.table-responsive,
.app-table th,
.app-table td,
.form-control,
.form-select,
.btn,
.status-badge,
.dashboard-context-bar,
.modal-header,
.modal-footer,
.app-modal-dialog,
.popover-menu,
.station-card,
.facility-pill,
.btn-global-search,
.mobile-bottom-nav {
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

