/* ============================================================
   Purplle Outbound Operations — Modern Design System (styles.css)
   ============================================================ */

:root {
  --bg-base: #0b0f19;
  --bg-surface: #111827;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(31, 41, 55, 0.85);
  --bg-elevated: #1f2937;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #38bdf8;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-sub: #64748b;
  
  --primary: #38bdf8;
  --primary-glow: rgba(56, 189, 248, 0.25);
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.2);
  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.2);
  --danger: #ef4444;
  --purple: #8b5cf6;
  
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', 'Inter', sans-serif;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px var(--primary-glow);
}

/* ============================================================
   Day-to-Night Dynamic Color Palettes (Morning -> Night)
   ============================================================ */

/* 1. 🌅 Morning Light (06:00 – 11:59): Crisp sunrise daylight, pure white cards, high-contrast typography */
body[data-theme="morning"],
:root[data-theme="morning"] {
  --bg-base: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-elevated: #e2e8f0;
  --bg-header: rgba(255, 255, 255, 0.94);
  
  --border-subtle: #cbd5e1;
  --border-focus: #0284c7;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-sub: #64748b;
  
  --primary: #0284c7;
  --primary-glow: rgba(2, 132, 199, 0.16);
  --accent: #d97706;
  --accent-glow: rgba(217, 119, 6, 0.16);

  --shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --table-header-bg: #f1f5f9;
  --table-header-color: #0f172a;
  --table-total-bg: #e2e8f0;
}

body[data-theme="morning"] .dashboard-container {
  background: radial-gradient(circle at 10% 0%, rgba(245, 158, 11, 0.08) 0%, transparent 45%),
              radial-gradient(circle at 90% 10%, rgba(2, 132, 199, 0.08) 0%, transparent 45%),
              var(--bg-base);
}

/* 2. ☀️ Afternoon Light (12:00 – 17:59): Bright vivid daylight, pure white cards, crisp royal blue */
body[data-theme="afternoon"],
:root[data-theme="afternoon"] {
  --bg-base: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-elevated: #e2e8f0;
  --bg-header: rgba(255, 255, 255, 0.95);
  
  --border-subtle: #cbd5e1;
  --border-focus: #2563eb;
  
  --text-main: #0f172a;
  --text-muted: #334155;
  --text-sub: #64748b;
  
  --primary: #2563eb;
  --primary-glow: rgba(37, 99, 235, 0.16);
  --accent: #0d9488;
  --accent-glow: rgba(13, 148, 136, 0.16);

  --shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --table-header-bg: #f1f5f9;
  --table-header-color: #0f172a;
  --table-total-bg: #e2e8f0;
}

body[data-theme="afternoon"] .dashboard-container {
  background: radial-gradient(circle at 12% 0%, rgba(37, 99, 235, 0.07) 0%, transparent 45%),
              radial-gradient(circle at 88% 12%, rgba(13, 148, 136, 0.07) 0%, transparent 45%),
              var(--bg-base);
}

/* 3. 🌇 Evening Twilight (18:00 – 20:59): Warm dusk twilight, amber coral & amethyst violet */
body[data-theme="evening"],
:root[data-theme="evening"] {
  --bg-base: #120d22;
  --bg-surface: #19122e;
  --bg-card: rgba(27, 19, 50, 0.84);
  --bg-card-hover: rgba(38, 28, 68, 0.94);
  --bg-elevated: #251a42;
  --bg-header: rgba(18, 13, 34, 0.90);
  
  --border-subtle: rgba(192, 132, 252, 0.16);
  --border-focus: #a855f7;
  
  --text-main: #faf5ff;
  --text-muted: #d8b4fe;
  --text-sub: #c084fc;
  
  --primary: #a855f7;
  --primary-glow: rgba(168, 85, 247, 0.30);
  --accent: #f97316;
  --accent-glow: rgba(249, 115, 22, 0.25);

  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --table-header-bg: #1e1335;
  --table-header-color: #faf5ff;
  --table-total-bg: #251a42;
}

body[data-theme="evening"] .dashboard-container {
  background: radial-gradient(circle at 12% 0%, rgba(249, 115, 22, 0.12) 0%, transparent 45%),
              radial-gradient(circle at 88% 8%, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
              var(--bg-base);
}

/* 4. 🌙 Midnight OLED (21:00 – 05:59): Deep obsidian, moonlit neon cyan & low-strain starlight */
body[data-theme="night"],
:root[data-theme="night"] {
  --bg-base: #050811;
  --bg-surface: #090e1c;
  --bg-card: rgba(10, 15, 29, 0.86);
  --bg-card-hover: rgba(17, 24, 44, 0.94);
  --bg-elevated: #141c33;
  --bg-header: rgba(7, 11, 22, 0.92);
  
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-focus: #22d3ee;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-sub: #64748b;
  
  --primary: #22d3ee;
  --primary-glow: rgba(34, 211, 238, 0.28);
  --accent: #818cf8;
  --accent-glow: rgba(129, 140, 248, 0.22);

  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --table-header-bg: #0f172a;
  --table-header-color: #f1f5f9;
  --table-total-bg: #1e293b;
}

body[data-theme="night"] .dashboard-container {
  background: radial-gradient(circle at 10% 0%, rgba(34, 211, 238, 0.07) 0%, transparent 45%),
              radial-gradient(circle at 90% 10%, rgba(99, 102, 241, 0.08) 0%, transparent 45%),
              var(--bg-base);
}

/* ============================================================
   Light Mode Comprehensive Component Overrides (Day Shifts)
   ============================================================ */
body[data-color-scheme="light"],
body[data-theme="morning"],
body[data-theme="afternoon"] {
  color-scheme: light;
}

/* Light Mode: Typography & Headings */
body[data-color-scheme="light"] .brand-info h1,
body[data-color-scheme="light"] .header-titles h2,
body[data-color-scheme="light"] .filter-heading h3,
body[data-color-scheme="light"] .table-title-group h3,
body[data-color-scheme="light"] .picker-title-row h3,
body[data-color-scheme="light"] .kpi-value,
body[data-color-scheme="light"] .countdown-timer,
body[data-color-scheme="light"] .modal-header h3,
body[data-color-scheme="light"] .auth-brand h2,
body[data-color-scheme="light"] .account-name strong,
body[data-color-scheme="light"] .user-name {
  color: #0f172a !important;
}

/* Light Mode: Top Navigation & Header Controls */
body[data-color-scheme="light"] .top-nav {
  background: rgba(255, 255, 255, 0.98) !important;
  border-bottom: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
}

body[data-color-scheme="light"] .tab-btn:not(.active) {
  color: #64748b;
  background: transparent;
}

body[data-color-scheme="light"] .tab-btn:not(.active):hover {
  background: #f1f5f9;
  color: #0f172a;
}

body[data-color-scheme="light"] .btn-theme-toggle {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

body[data-color-scheme="light"] .theme-dropdown-menu {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04) !important;
}

body[data-color-scheme="light"] .theme-menu-header {
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
}

body[data-color-scheme="light"] .theme-option:hover {
  background: #f1f5f9;
}

body[data-color-scheme="light"] .theme-option.active {
  background: #e0f2fe;
}

/* Light Mode: Sleek User Profile Pill */
body[data-color-scheme="light"] .user-profile-pill {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
  padding: 4px 10px 4px 6px !important;
  border-radius: 20px !important;
}

body[data-color-scheme="light"] .user-profile-pill:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}

body[data-color-scheme="light"] .user-name {
  color: #0f172a !important;
  font-weight: 600 !important;
}

body[data-color-scheme="light"] .user-email {
  color: #64748b !important;
}

/* Light Mode: Countdown Widget & Sheet Link */
body[data-color-scheme="light"] .countdown-widget {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

body[data-color-scheme="light"] .countdown-label {
  color: #0284c7 !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
}

body[data-color-scheme="light"] .countdown-timer {
  color: #0f172a !important;
  font-weight: 700 !important;
}

body[data-color-scheme="light"] .btn-sheet-link {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
  font-weight: 500 !important;
}

body[data-color-scheme="light"] .btn-sheet-link:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
}

/* Light Mode: Unified Metadata Ribbon (Telemetry Strip) */
body[data-color-scheme="light"] .telemetry-bar {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  color: #64748b !important;
  font-size: 11.5px !important;
  padding: 7px 24px !important;
}

body[data-color-scheme="light"] .telemetry-item {
  background: transparent !important;
  border: none !important;
  color: #475569 !important;
  padding: 0 !important;
}

body[data-color-scheme="light"] .telemetry-label {
  color: #64748b !important;
  font-size: 11px !important;
  font-weight: 500 !important;
}

body[data-color-scheme="light"] .telemetry-value {
  color: #0f172a !important;
  font-weight: 600 !important;
}

body[data-color-scheme="light"] .badge-latency {
  background: #f0f9ff !important;
  color: #0284c7 !important;
  border: 1px solid #e0f2fe !important;
  font-weight: 600 !important;
  padding: 2px 7px !important;
  border-radius: 6px !important;
}

body[data-color-scheme="light"] .badge-alert {
  background: #fffbeb !important;
  color: #b45309 !important;
  border: 1px solid #fef3c7 !important;
  font-weight: 600 !important;
  padding: 2px 8px !important;
  border-radius: 6px !important;
}

body[data-color-scheme="light"] .badge-source {
  background: #f8fafc !important;
  color: #64748b !important;
  border: 1px solid #e2e8f0 !important;
  padding: 2px 7px !important;
  border-radius: 6px !important;
}

body[data-color-scheme="light"] .badge-shift {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border: 1px solid #dbeafe !important;
  padding: 2px 10px !important;
  border-radius: 9999px !important;
  font-weight: 600 !important;
}

/* Light Mode: Executive KPI Scorecards */
body[data-color-scheme="light"] .card,
body[data-color-scheme="light"] .kpi-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.03), 0 1px 2px -1px rgba(0, 0, 0, 0.02) !important;
  padding: 16px 20px !important;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease !important;
}

body[data-color-scheme="light"] .kpi-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 10px 24px -4px rgba(15, 23, 42, 0.08) !important;
  border-color: #cbd5e1 !important;
}

/* Clean up 4th card alert state: remove harsh yellow outline */
body[data-color-scheme="light"] .kpi-card.alert-card {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

body[data-color-scheme="light"] .kpi-title {
  font-size: 11px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  color: #64748b !important;
}

body[data-color-scheme="light"] .kpi-value {
  font-size: 28px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  font-family: var(--font-display) !important;
  letter-spacing: -0.02em !important;
}

body[data-color-scheme="light"] .kpi-sub {
  font-size: 11.5px !important;
  color: #94a3b8 !important;
}

/* Light Mode: Parallel Dual Panels */
body[data-color-scheme="light"] .cpt-parallel-left,
body[data-color-scheme="light"] .picker-cpt-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.03), 0 1px 2px -1px rgba(0, 0, 0, 0.02) !important;
  overflow: hidden !important;
}

body[data-color-scheme="light"] .cpt-parallel-left .section-header,
body[data-color-scheme="light"] .picker-cpt-header {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  padding: 12px 16px !important;
}

body[data-color-scheme="light"] .cpt-parallel-left .section-header h2,
body[data-color-scheme="light"] .picker-cpt-header h3 {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  letter-spacing: -0.01em !important;
}

body[data-color-scheme="light"] .cpt-parallel-left .section-header .subtitle,
body[data-color-scheme="light"] .picker-cpt-header .column-hint {
  font-size: 11.5px !important;
  color: #64748b !important;
  font-weight: 400 !important;
}

body[data-color-scheme="light"] .cpt-parallel-left .view-filter-control select {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
  border-radius: 6px !important;
  padding: 5px 10px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  outline: none !important;
}

body[data-color-scheme="light"] .btn-group-toggle {
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  padding: 2px !important;
}

body[data-color-scheme="light"] .btn-group-toggle .btn-toggle {
  color: #64748b !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  border-radius: 6px !important;
  padding: 4px 10px !important;
}

body[data-color-scheme="light"] .btn-group-toggle .btn-toggle.active {
  background: #ffffff !important;
  color: #0f172a !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
  font-weight: 600 !important;
}

body[data-color-scheme="light"] .picker-search-wrapper input {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
  border-radius: 6px !important;
  padding: 5px 10px 5px 28px !important;
  font-size: 11.5px !important;
  width: 150px !important;
  outline: none !important;
}

body[data-color-scheme="light"] .picker-search-wrapper input:focus {
  border-color: #0284c7 !important;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15) !important;
  width: 175px !important;
}

/* Light Mode: Filter Bar & Form Inputs */
body[data-color-scheme="light"] .search-input-wrapper input,
body[data-color-scheme="light"] .pagination-controls select,
body[data-color-scheme="light"] .view-filter-control select,
body[data-color-scheme="light"] .picker-mode-select,
body[data-color-scheme="light"] .filter-group select,
body[data-color-scheme="light"] .form-group input,
body[data-color-scheme="light"] .nav-btn,
body[data-color-scheme="light"] .ms-btn {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
}

body[data-color-scheme="light"] .search-input-wrapper input:focus,
body[data-color-scheme="light"] .ms-btn.active {
  border-color: #0284c7 !important;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2) !important;
}

body[data-color-scheme="light"] .clear-btn:hover {
  color: #0f172a !important;
}

body[data-color-scheme="light"] .ms-dropdown {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.15) !important;
}

body[data-color-scheme="light"] .ms-search-input {
  background: #f8fafc !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
}

body[data-color-scheme="light"] .ms-actions {
  border-bottom: 1px solid #e2e8f0 !important;
}

body[data-color-scheme="light"] .ms-option-label {
  color: #1e293b !important;
}

body[data-color-scheme="light"] .ms-option-label:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

/* Light Mode: High-Precision Data Tables */
body[data-color-scheme="light"] .table-scroll-container,
body[data-color-scheme="light"] .picker-table-scroll {
  border-color: #e2e8f0 !important;
  background: #ffffff !important;
}

body[data-color-scheme="light"] .modern-table th,
body[data-color-scheme="light"] .summary-table th,
body[data-color-scheme="light"] .picker-cpt-data-table th {
  background: #f8fafc !important;
  color: #475569 !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
  padding: 9px 12px !important;
  border-bottom: 1px solid #e2e8f0 !important;
  white-space: nowrap !important;
}

body[data-color-scheme="light"] .picker-cpt-data-table th.sortable:hover {
  background: #f1f5f9 !important;
  color: #0284c7 !important;
}

body[data-color-scheme="light"] .modern-table td,
body[data-color-scheme="light"] .summary-table td,
body[data-color-scheme="light"] .picker-cpt-data-table td {
  border-bottom: 1px solid #f1f5f9 !important;
  color: #1e293b !important;
  padding: 8px 12px !important;
  font-size: 12px !important;
}

/* Left Table Specifics */
body[data-color-scheme="light"] .summary-table td.col-hub {
  color: #0f172a !important;
  font-weight: 600 !important;
  background: transparent !important;
}

/* Fix raw green text: CPT time is always clean slate */
body[data-color-scheme="light"] .summary-table td:nth-child(2) {
  color: #0f172a !important;
  font-weight: 600 !important;
  font-variant-numeric: tabular-nums !important;
}

body[data-color-scheme="light"] .summary-table tr.row-past {
  background: rgba(16, 185, 129, 0.05) !important;
  border-left: 3px solid #10b981 !important;
}

body[data-color-scheme="light"] .summary-table tr.row-near {
  background: rgba(2, 132, 199, 0.06) !important;
  border-left: 3px solid #0284c7 !important;
}

/* Light Mode: Operations CPT Matrix Columns */
body[data-color-scheme="light"] .summary-table td.col-stat-processing {
  color: #1d4ed8 !important;
  font-weight: 600 !important;
  font-variant-numeric: tabular-nums !important;
}
body[data-color-scheme="light"] .summary-table td.col-stat-prepared {
  color: #b45309 !important;
  font-weight: 600 !important;
  font-variant-numeric: tabular-nums !important;
}
body[data-color-scheme="light"] .summary-table td.col-stat-dispatched {
  color: #15803d !important;
  font-weight: 600 !important;
  font-variant-numeric: tabular-nums !important;
}
body[data-color-scheme="light"] .summary-table td.col-stat-pending.has-pending {
  color: #dc2626 !important;
  font-weight: 700 !important;
  font-variant-numeric: tabular-nums !important;
}
body[data-color-scheme="light"] .summary-table td.col-stat-pending.zero-pending {
  color: #94a3b8 !important;
  font-weight: 400 !important;
  font-variant-numeric: tabular-nums !important;
}
body[data-color-scheme="light"] .summary-table td.col-stat-total {
  color: #0f172a !important;
  font-weight: 700 !important;
  font-variant-numeric: tabular-nums !important;
}

body[data-color-scheme="light"] .summary-table tr.grand-total-row {
  background: #f1f5f9 !important;
  border-top: 2px solid #cbd5e1 !important;
}

body[data-color-scheme="light"] .summary-table tr.grand-total-row td {
  color: #0f172a !important;
  font-weight: 700 !important;
}

/* Right Table: Picker Operations Queue */
body[data-color-scheme="light"] .row-cpt-normal {
  background: #ffffff !important;
}

body[data-color-scheme="light"] .picker-cpt-data-table tbody tr.row-cpt-normal:nth-child(even) {
  background: #fafbfc !important;
}

body[data-color-scheme="light"] .picker-cpt-data-table tbody tr:hover {
  background: #f0f9ff !important;
}

body[data-color-scheme="light"] .col-cpt-time {
  color: #0f172a !important;
  font-weight: 600 !important;
  font-variant-numeric: tabular-nums !important;
}

body[data-color-scheme="light"] .col-picker-name {
  color: #0f172a !important;
  font-weight: 600 !important;
}

body[data-color-scheme="light"] .code-picklist-id {
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  color: #334155 !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  font-size: 11px !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  font-weight: 500 !important;
}

/* Status Pills */
body[data-color-scheme="light"] .pill-processing {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border: 1px solid #dbeafe !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  padding: 2px 8px !important;
  border-radius: 9999px !important;
}

body[data-color-scheme="light"] .pill-prepared {
  background: #f0fdf4 !important;
  color: #15803d !important;
  border: 1px solid #dcfce7 !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  padding: 2px 8px !important;
  border-radius: 9999px !important;
}

/* Urgency Chips in Light Mode */
body[data-color-scheme="light"] .chip-urgency {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 500;
  border-radius: 6px;
}

body[data-color-scheme="light"] .chip-urgency-safe {
  color: #475569 !important;
}

body[data-color-scheme="light"] .chip-urgency-upcoming {
  color: #0369a1 !important;
}

body[data-color-scheme="light"] .chip-urgency-urgent {
  background: #fffbeb !important;
  color: #b45309 !important;
  border: 1px solid #fef3c7 !important;
  padding: 2px 7px !important;
  font-weight: 600 !important;
}

body[data-color-scheme="light"] .chip-urgency-critical {
  background: #fef2f2 !important;
  color: #b91c1c !important;
  border: 1px solid #fecaca !important;
  padding: 2px 7px !important;
  font-weight: 700 !important;
}

body[data-color-scheme="light"] .chip-urgency-overdue {
  background: #fff1f2 !important;
  color: #991b1b !important;
  border: 1px solid #fda4af !important;
  padding: 2px 7px !important;
  font-weight: 700 !important;
}

/* Duration chips in Light Mode */
body[data-color-scheme="light"] .text-dur-normal {
  color: #475569 !important;
  font-size: 11.5px !important;
}

body[data-color-scheme="light"] .badge-dur-warning {
  background: #fffbeb !important;
  color: #b45309 !important;
  border: 1px solid #fef3c7 !important;
  font-weight: 600 !important;
  padding: 2px 7px !important;
  border-radius: 6px !important;
  font-size: 11px !important;
}

body[data-color-scheme="light"] .badge-dur-alert {
  background: #fef2f2 !important;
  color: #b91c1c !important;
  border: 1px solid #fecaca !important;
  font-weight: 600 !important;
  padding: 2px 7px !important;
  border-radius: 6px !important;
  font-size: 11px !important;
}

body[data-color-scheme="light"] .badge-dur-critical {
  background: #fff1f2 !important;
  color: #991b1b !important;
  border: 1px solid #fecdd3 !important;
  font-weight: 700 !important;
  padding: 2px 7px !important;
  border-radius: 6px !important;
  font-size: 11px !important;
}

body[data-color-scheme="light"] .badge-dur-unstarted {
  background: #f8fafc !important;
  color: #94a3b8 !important;
  border: 1px solid #e2e8f0 !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  font-size: 10.5px !important;
}

/* Metric Chips (Items & Ships) */
body[data-color-scheme="light"] .metric-chip {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #334155 !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  padding: 2px 7px !important;
  border-radius: 6px !important;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

body[data-color-scheme="light"] .metric-chip-num {
  min-width: 28px;
  justify-content: center;
}

/* Row-level urgency accents (Delicate, not flooding the whole row) */
body[data-color-scheme="light"] .row-cpt-overdue {
  background: #fff1f2 !important;
  border-left: 3px solid #ef4444 !important;
}

body[data-color-scheme="light"] .row-cpt-critical {
  background: #fff7ed !important;
  border-left: 3px solid #f97316 !important;
}

body[data-color-scheme="light"] .row-cpt-urgent {
  background: #fffbeb !important;
  border-left: 3px solid #f59e0b !important;
}

/* Status dots */
.dot-sky {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0ea5e9;
  display: inline-block;
  margin-right: 4px;
}

.dot-green {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  margin-right: 4px;
}

/* Compact Header Legend */
.picker-legend-compact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
}

.legend-pill.pill-past {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.legend-pill.pill-near {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.legend-pill.pill-scheduled {
  background: var(--bg-elevated);
  color: var(--text-sub);
  border: 1px solid var(--border-subtle);
}

body[data-color-scheme="light"] .legend-pill.pill-past {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #dcfce7;
}

body[data-color-scheme="light"] .legend-pill.pill-near {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

body[data-color-scheme="light"] .legend-pill.pill-scheduled {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

body[data-color-scheme="light"] .legend-pill.pill-overdue {
  background: #fff1f2;
  color: #991b1b;
  border: 1px solid #fecdd3;
}

body[data-color-scheme="light"] .legend-pill.pill-critical {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #ffedd5;
}

body[data-color-scheme="light"] .legend-pill.pill-urgent {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fef3c7;
}

body[data-color-scheme="light"] .legend-pill.pill-safe {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #dcfce7;
}

/* Light Mode: Whole-Row Heatmap Highlighting (CPT & Dispatch Tables) */
body[data-color-scheme="light"] .row-cpt-heatmap-warning,
body[data-color-scheme="light"] .row-cpt-heatmap-warning td,
body[data-color-scheme="light"] .row-heatmap-warning,
body[data-color-scheme="light"] .row-heatmap-warning td {
  background-color: #fef9c3 !important; /* Soft yellow-amber */
}
body[data-color-scheme="light"] .row-cpt-heatmap-warning td:first-child,
body[data-color-scheme="light"] .row-heatmap-warning td:first-child {
  border-left: 4px solid #f59e0b !important;
}
body[data-color-scheme="light"] .row-cpt-heatmap-warning:hover,
body[data-color-scheme="light"] .row-cpt-heatmap-warning:hover td,
body[data-color-scheme="light"] .row-heatmap-warning:hover,
body[data-color-scheme="light"] .row-heatmap-warning:hover td {
  background-color: #fef08a !important;
}

body[data-color-scheme="light"] .row-cpt-heatmap-alert,
body[data-color-scheme="light"] .row-cpt-heatmap-alert td,
body[data-color-scheme="light"] .row-heatmap-alert,
body[data-color-scheme="light"] .row-heatmap-alert td {
  background-color: #ffedd5 !important; /* Warm orange-peach */
}
body[data-color-scheme="light"] .row-cpt-heatmap-alert td:first-child,
body[data-color-scheme="light"] .row-heatmap-alert td:first-child {
  border-left: 4px solid #f97316 !important;
}
body[data-color-scheme="light"] .row-cpt-heatmap-alert:hover,
body[data-color-scheme="light"] .row-cpt-heatmap-alert:hover td,
body[data-color-scheme="light"] .row-heatmap-alert:hover,
body[data-color-scheme="light"] .row-heatmap-alert:hover td {
  background-color: #fed7aa !important;
}

body[data-color-scheme="light"] .row-cpt-heatmap-critical,
body[data-color-scheme="light"] .row-cpt-heatmap-critical td,
body[data-color-scheme="light"] .row-heatmap-critical,
body[data-color-scheme="light"] .row-heatmap-critical td {
  background-color: #fee2e2 !important; /* Soft rose-red */
}
body[data-color-scheme="light"] .row-cpt-heatmap-critical td:first-child,
body[data-color-scheme="light"] .row-heatmap-critical td:first-child {
  border-left: 4px solid #dc2626 !important;
}
body[data-color-scheme="light"] .row-cpt-heatmap-critical:hover,
body[data-color-scheme="light"] .row-cpt-heatmap-critical:hover td,
body[data-color-scheme="light"] .row-heatmap-critical:hover,
body[data-color-scheme="light"] .row-heatmap-critical:hover td {
  background-color: #fecaca !important;
}

/* Light Mode: SLA Duration Badges */
body[data-color-scheme="light"] .badge-heatmap-warning {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border: 1px solid #fde68a !important;
}
body[data-color-scheme="light"] .badge-heatmap-alert {
  background: #ffedd5 !important;
  color: #c2410c !important;
  border: 1px solid #fed7aa !important;
}
body[data-color-scheme="light"] .badge-heatmap-critical {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border: 1px solid #fca5a5 !important;
}

/* Light Mode: Contextual Column Elements */
body[data-color-scheme="light"] .cell-order-id {
  color: #475569 !important;
}
body[data-color-scheme="light"] .cell-shipment-id {
  color: #0f172a !important;
}
body[data-color-scheme="light"] .chip-code-master {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border-color: #cbd5e1 !important;
}
body[data-color-scheme="light"] .chip-code-picklist {
  background: #e0f2fe !important;
  color: #0284c7 !important;
  border-color: #bae6fd !important;
}
body[data-color-scheme="light"] .chip-code-crate {
  background: #f5f3ff !important;
  color: #6d28d9 !important;
  border-color: #ddd6fe !important;
}
body[data-color-scheme="light"] .cell-hub-name {
  color: #0f172a !important;
}
body[data-color-scheme="light"] .pill-pl-closed {
  background: #dcfce7 !important;
  color: #15803d !important;
  border-color: #86efac !important;
}
body[data-color-scheme="light"] .pill-pl-processing {
  background: #e0f2fe !important;
  color: #0284c7 !important;
  border-color: #7dd3fc !important;
}
body[data-color-scheme="light"] .pill-pl-picked {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border-color: #fde68a !important;
}
body[data-color-scheme="light"] .pill-pl-unstarted {
  background: #ffedd5 !important;
  color: #c2410c !important;
  border-color: #fed7aa !important;
}
body[data-color-scheme="light"] .pill-pl-muted {
  background: #f1f5f9 !important;
  color: #64748b !important;
  border-color: #e2e8f0 !important;
}
body[data-color-scheme="light"] .chip-picker {
  background: #eff6ff !important;
  color: #1e40af !important;
  border-color: #bfdbfe !important;
}
body[data-color-scheme="light"] .chip-packer {
  background: #f5f3ff !important;
  color: #6d28d9 !important;
  border-color: #ddd6fe !important;
}
body[data-color-scheme="light"] .chip-station {
  background: #f0fdfa !important;
  color: #0f766e !important;
  border-color: #99f6e4 !important;
}
body[data-color-scheme="light"] .chip-predicted {
  background: #fdf4ff !important;
  color: #a21caf !important;
  border-color: #f0abfc !important;
}
body[data-color-scheme="light"] .chip-unassigned {
  color: #94a3b8 !important;
}
body[data-color-scheme="light"] .pill-fmt-rts {
  background: #ecfeff !important;
  color: #0e7490 !important;
  border-color: #a5f3fc !important;
}
body[data-color-scheme="light"] .pill-fmt-std {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border-color: #e2e8f0 !important;
}
body[data-color-scheme="light"] .pill-ret-yes {
  background: #f3e8ff !important;
  color: #6b21a8 !important;
  border-color: #d8b4fe !important;
}
body[data-color-scheme="light"] .pill-ret-no {
  background: #f8fafc !important;
  color: #64748b !important;
  border-color: #e2e8f0 !important;
}
body[data-color-scheme="light"] .badge-duration-safe {
  background: #f0fdf4 !important;
  color: #15803d !important;
  border-color: #dcfce7 !important;
}
body[data-color-scheme="light"] .badge-duration-unstarted {
  background: #fffbeb !important;
  color: #b45309 !important;
  border-color: #fef3c7 !important;
}
body[data-color-scheme="light"] .cell-carrier-name {
  color: #0f172a !important;
}
body[data-color-scheme="light"] .chip-hub-id {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border-color: #cbd5e1 !important;
}
body[data-color-scheme="light"] .chip-box-size {
  background: #eff6ff !important;
  color: #1e40af !important;
  border-color: #bfdbfe !important;
}
body[data-color-scheme="light"] .cell-awb {
  color: #0284c7 !important;
}

/* Light Mode: Dispatch Date Range Inputs (Crisp White Surface & High Contrast Text) */
body[data-color-scheme="light"] .date-input-wrapper {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05) !important;
}

body[data-color-scheme="light"] .date-input-wrapper:hover {
  border-color: #94a3b8 !important;
}

body[data-color-scheme="light"] .date-input-wrapper:focus-within {
  border-color: #0284c7 !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.18) !important;
}

body[data-color-scheme="light"] .date-input-tag {
  color: #0284c7 !important;
}

body[data-color-scheme="light"] .dispatch-date-controls input[type="datetime-local"] {
  background: transparent !important;
  color: #0f172a !important;
  color-scheme: light !important;
  font-weight: 600 !important;
}

body[data-color-scheme="light"] .dispatch-date-controls input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: none !important;
  opacity: 0.75 !important;
}

body[data-color-scheme="light"] .dispatch-date-controls input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1 !important;
}

body[data-color-scheme="light"] .date-separator,
body[data-color-scheme="light"] .dispatch-date-controls span {
  color: #475569 !important;
  font-weight: 600 !important;
}

/* Light Mode: Modals */
body[data-color-scheme="light"] .modal-overlay {
  background: rgba(15, 23, 42, 0.4);
}

body[data-color-scheme="light"] .modal-card {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25) !important;
}

body[data-color-scheme="light"] .modal-header {
  border-bottom: 1px solid #e2e8f0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-base);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              color 0.4s ease;
}

/* Base Layout */
.dashboard-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: radial-gradient(circle at 10% 0%, rgba(56, 189, 248, 0.08) 0%, transparent 40%),
              radial-gradient(circle at 90% 10%, rgba(139, 92, 246, 0.08) 0%, transparent 40%),
              var(--bg-base);
  transition: background 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Top Navigation Bar */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--bg-header, rgba(15, 23, 42, 0.95)) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 1000 !important;
  gap: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  transition: background 0.6s ease, border-color 0.4s ease, box-shadow 0.3s ease;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-mark {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.brand-info h1 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.system-status {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Navigation Tabs */
.view-switcher {
  display: flex;
  background: rgba(0, 0, 0, 0.25);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  gap: 4px;
}

.tab-btn {
  padding: 7px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

/* Live CPT Countdown Widget */
.countdown-widget {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  text-align: center;
  min-width: 170px;
}

.countdown-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
}

.countdown-timer {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

/* Header Action Buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0369a1, #075985);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-icon-only {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  padding: 8px 10px;
  font-size: 15px;
  cursor: pointer;
}

.btn-icon-only:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
}

/* Telemetry Strip */
.telemetry-bar {
  display: flex;
  align-items: center;
  padding: 8px 24px;
  background: rgba(15, 23, 42, 0.7);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12px;
  gap: 20px;
  flex-wrap: wrap;
}

.telemetry-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.telemetry-label {
  color: var(--text-sub);
}

.telemetry-value {
  color: var(--text-main);
  font-weight: 600;
}

.telemetry-spacer {
  flex: 1;
}

.badge-latency {
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--primary);
}

.badge-alert {
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  font-weight: 700;
}

.badge-source {
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(139, 92, 246, 0.18);
  color: #c084fc;
}

.badge-autosync {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.badge-autosync:hover {
  background: rgba(16, 185, 129, 0.25);
  transform: translateY(-1px);
}
.badge-autosync.off {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-secondary);
}
.badge-autosync.syncing {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
}
.autosync-pulse {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.8);
  transition: all 0.2s ease;
}
.badge-autosync.off .autosync-pulse {
  background: #94a3b8;
  box-shadow: none;
}
.badge-autosync.syncing .autosync-pulse {
  background: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.9);
  animation: autosync-spin 1.2s infinite ease-in-out;
}
@keyframes autosync-spin {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.4); opacity: 1; }
}

body[data-color-scheme="light"] .badge-autosync {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}
body[data-color-scheme="light"] .badge-autosync.off {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}
body[data-color-scheme="light"] .badge-autosync.syncing {
  background: #f0f9ff;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

/* Main Content Area */
.main-content {
  padding: 20px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
}

.view-panel {
  display: none;
  flex-direction: column;
  gap: 20px;
}

.view-panel.active {
  display: flex;
}

/* Card Container */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
}

/* KPI Scorecard Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.3);
}

.kpi-card.alert-card {
  border-color: rgba(245, 158, 11, 0.3);
  background: radial-gradient(circle at top right, rgba(245, 158, 11, 0.08), transparent 70%), var(--bg-card);
}

.kpi-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.kpi-icon {
  font-size: 18px;
}

.kpi-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
  margin-bottom: 4px;
}

.kpi-sub {
  font-size: 11px;
  color: var(--text-sub);
}

.text-amber {
  color: #fbbf24 !important;
}

/* Summary Table Section */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.header-titles h2 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
}

.subtitle {
  font-size: 12px;
  color: var(--text-sub);
}

.view-filter-control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.view-filter-control select,
.filter-group select,
.form-group select,
.form-group input {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.2s ease;
}

.view-filter-control select:focus,
.filter-group select:focus,
.form-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

/* Tables Base Styling */
.table-scroll-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.modern-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  text-align: left;
}

.modern-table th {
  background: #1e293b;
  color: #f1f5f9;
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
  position: relative;
  user-select: none;
}

.modern-table th.sortable-th {
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.modern-table th.sortable-th:hover {
  background: #334155;
  color: #38bdf8;
}

body[data-color-scheme="light"] .modern-table th.sortable-th:hover {
  background: #e2e8f0;
  color: #0284c7;
}

.modern-table th .sort-arrow {
  display: inline-block;
  font-size: 10px;
  margin-left: 4px;
  color: #64748b;
  transition: color 0.15s ease, transform 0.15s ease;
  vertical-align: middle;
}

.modern-table th .sort-arrow.active {
  color: #38bdf8;
  font-weight: bold;
}

body[data-color-scheme="light"] .modern-table th .sort-arrow.active {
  color: #0284c7;
}

.modern-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  white-space: nowrap;
  color: var(--text-main);
}

.modern-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Summary Table Specifics */
.summary-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

.summary-table th {
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 20;
  background: #1e293b;
  color: #f1f5f9;
  border-bottom: 2px solid var(--border-subtle, #334155);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.summary-table th.col-hub {
  text-align: left;
}

.summary-table tr.selected-hub-row {
  background: rgba(56, 189, 248, 0.15) !important;
  outline: 1px solid rgba(56, 189, 248, 0.4);
  border-left: 4px solid #38bdf8 !important;
}

body[data-color-scheme="light"] .summary-table th {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

body[data-color-scheme="light"] .summary-table tr.selected-hub-row {
  background: rgba(2, 132, 199, 0.12) !important;
  outline: 1px solid rgba(2, 132, 199, 0.35);
  border-left: 4px solid #0284c7 !important;
}

.summary-table td {
  text-align: center;
}

.summary-table td.col-hub {
  text-align: left;
  font-weight: 600;
  /* Immune from color effects per user rule */
  background: transparent !important;
  color: #f8fafc;
}

.summary-table tr.row-past {
  background: rgba(16, 185, 129, 0.08);
  border-left: 3px solid #10b981;
}

.summary-table tr.row-near {
  background: rgba(56, 189, 248, 0.12);
  border-left: 3px solid #38bdf8;
}

/* Dark Mode / Base: Operations CPT Matrix Columns */
.summary-table td.col-stat-processing {
  color: #60a5fa;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.summary-table td.col-stat-prepared {
  color: #fbbf24;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.summary-table td.col-stat-dispatched {
  color: #34d399;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.summary-table td.col-stat-pending.has-pending {
  color: #f87171;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.summary-table td.col-stat-pending.zero-pending {
  color: #64748b;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.summary-table td.col-stat-total {
  color: #f8fafc;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.summary-table tr.grand-total-row {
  background: #1e293b;
  font-weight: 700;
  border-top: 2px solid var(--border-subtle);
}

.summary-table tr.grand-total-row td {
  color: #ffffff;
}

/* Stacking Context Management for Cards & Filter Bars */
#summarySection,
#cptMatrixSection,
#detailedFiltersSection,
#shipmentTableSection,
#dispatchSection,
.card {
  scroll-margin-top: 90px;
}

.filter-bar-card,
.card.filter-bar-card {
  position: relative;
  z-index: 30;
  overflow: visible !important;
}

.table-card,
.card.table-card {
  position: relative;
  z-index: 10;
}

.summary-section,
.card.summary-section {
  position: relative;
  z-index: 20;
}

/* Filter Controls Bar */
.filter-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.filter-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-heading h3 {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.filter-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--primary);
  font-weight: 600;
}

.filter-controls-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  position: relative;
  z-index: 35;
  overflow: visible !important;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: visible !important;
}

.filter-group:focus-within,
.filter-group:has(.open) {
  position: relative;
  z-index: 120;
}

.filter-group.full-width {
  grid-column: 1 / -1;
}

.filter-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-sub);
  pointer-events: none;
}

.search-input-wrapper input {
  width: 100%;
  padding: 10px 36px 10px 36px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 13.5px;
  outline: none;
  transition: all 0.2s ease;
}

.search-input-wrapper input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.clear-btn {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-sub);
  cursor: pointer;
  padding: 4px;
}

.clear-btn:hover {
  color: #ffffff;
}

/* Custom Multi-Select Dropdowns */
.custom-multiselect {
  position: relative;
  width: 100%;
}

.custom-multiselect.open {
  z-index: 1000;
}

.ms-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface-elevated, #161c28);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  border-radius: var(--radius-md, 8px);
  color: var(--text-main, #f8fafc);
  font-family: inherit;
  font-size: 13px;
  padding: 8px 12px;
  cursor: pointer;
  outline: none;
  text-align: left;
  transition: all 0.15s ease;
  min-height: 38px;
  box-sizing: border-box;
}

.ms-btn:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.ms-btn.active, .ms-btn:focus {
  border-color: var(--primary, #3b82f6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.ms-btn.has-selection {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(59, 130, 246, 0.08);
}

.ms-btn-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 8px;
  flex: 1;
}

.ms-badge-count {
  background: rgba(59, 130, 246, 0.25);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 6px;
  flex-shrink: 0;
}

.ms-chevron {
  font-size: 10px;
  color: var(--text-muted, #94a3b8);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.ms-btn.active .ms-chevron {
  transform: rotate(180deg);
}

.ms-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 220px;
  max-width: 300px;
  max-height: 320px;
  background: #0b1329;
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: var(--radius-md, 8px);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.92), 0 0 0 1px rgba(255, 255, 255, 0.12);
  z-index: 99999;
  display: none;
  flex-direction: column;
  padding: 8px;
  backdrop-filter: blur(20px);
  box-sizing: border-box;
}

.ms-dropdown.open {
  display: flex;
}

/* Align rightmost dropdowns to right edge to avoid screen-overflow */
.filter-group:nth-child(n+6) .ms-dropdown,
.filter-group:last-child .ms-dropdown {
  left: auto;
  right: 0;
}

.ms-search-input {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #f8fafc;
  font-size: 12px;
  padding: 6px 10px;
  margin-bottom: 6px;
  width: 100%;
  outline: none;
  box-sizing: border-box;
}

.ms-search-input:focus {
  border-color: #3b82f6;
}

.ms-actions {
  display: flex;
  justify-content: space-between;
  padding: 2px 4px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 4px;
}

.ms-action-link {
  background: none;
  border: none;
  color: #38bdf8;
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
  font-weight: 500;
}

.ms-action-link:hover {
  text-decoration: underline;
  color: #7dd3fc;
}

.ms-options-list {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ms-option-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  color: #cbd5e1;
  cursor: pointer;
  user-select: none;
  transition: background 0.1s ease;
}

.ms-option-label:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.ms-option-label input[type="checkbox"] {
  cursor: pointer;
  width: 14px;
  height: 14px;
  accent-color: #3b82f6;
  flex-shrink: 0;
}

.ms-option-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Detailed Shipment Table Section */
.table-actions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 12px;
}

.table-title-group h3 {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.column-hint {
  font-size: 11px;
  color: var(--text-sub);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.pagination-controls select {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 4px;
}

.page-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
}

.nav-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
}

.nav-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
}

.nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ============================================================ */
/* CPT Shipment Data Table: 100% Single Screen Fit (No H-Scroll) */
/* ============================================================ */
#shipmentDataTable {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

#shipmentDataTable th,
#shipmentDataTable td {
  padding: 6px 4px;
  font-size: 11px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.015em;
  box-sizing: border-box;
}

#shipmentDataTable th {
  padding: 8px 4px;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  user-select: none;
}

/* Precise proportional column widths summing to 100.0% */
#shipmentDataTable th[data-col="order_id"] { width: 7.5%; }
#shipmentDataTable th[data-col="shipment_id"] { width: 7.5%; }
#shipmentDataTable th[data-col="master_shipment_id"] { width: 5.5%; }
#shipmentDataTable th[data-col="picklist_id"] { width: 7.0%; }
#shipmentDataTable th[data-col="crate_id"] { width: 6.0%; }
#shipmentDataTable th[data-col="hub_name"] { width: 8.5%; }
#shipmentDataTable th[data-col="ship_status"] { width: 7.0%; }
#shipmentDataTable th[data-col="picklist_status"] { width: 6.5%; }
#shipmentDataTable th[data-col="picker_name"] { width: 8.5%; }
#shipmentDataTable th[data-col="qty_duration"] { width: 8.0%; }
#shipmentDataTable th[data-col="fulfillment_type"] { width: 6.5%; }
#shipmentDataTable th[data-col="is_retailer"] { width: 4.5%; }
#shipmentDataTable th[data-col="packer_name"] { width: 9.0%; }
#shipmentDataTable th[data-col="pack_station"] { width: 8.0%; }

/* ============================================================ */
/* Dispatch Operations Table: 100% Single Screen Fit            */
/* ============================================================ */
#dispatchTable {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

#dispatchTable th,
#dispatchTable td {
  padding: 6px 5px;
  font-size: 11px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.015em;
  box-sizing: border-box;
}

#dispatchTable th {
  padding: 8px 5px;
  font-size: 11px;
  font-weight: 700;
}

#dispatchTable th:nth-child(1) { width: 9.0%; }  /* Carrier */
#dispatchTable th:nth-child(2) { width: 5.0%; }  /* Hub ID */
#dispatchTable th:nth-child(3) { width: 8.0%; }  /* Order ID */
#dispatchTable th:nth-child(4) { width: 8.0%; }  /* Shipment ID */
#dispatchTable th:nth-child(5) { width: 7.5%; }  /* Status */
#dispatchTable th:nth-child(6) { width: 6.5%; }  /* Box Size */
#dispatchTable th:nth-child(7) { width: 11.0%; } /* AWB */
#dispatchTable th:nth-child(8) { width: 10.0%; } /* Packer Name */
#dispatchTable th:nth-child(9) { width: 9.0%; }  /* Pack Station */
#dispatchTable th:nth-child(10) { width: 6.0%; } /* Pin Code */
#dispatchTable th:nth-child(11) { width: 10.0%; }/* Prepared Time */
#dispatchTable th:nth-child(12) { width: 10.0%; }/* Dispatched Time */

.btn-fit-screen {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 6px;
  transition: all 0.15s ease;
}

.btn-fit-screen:hover {
  background: #38bdf8;
  color: #0b0f19;
}

/* Resizable Column Dividers */
.resizable-table th {
  position: relative;
}

.resizer {
  position: absolute;
  right: 0;
  top: 0;
  width: 5px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
}

.resizer:hover,
.resizing {
  background-color: var(--primary);
}

.col-highlight {
  background: #c2410c !important;
  color: #ffffff !important;
}

/* Status Badges */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

#shipmentDataTable .pill,
#dispatchTable .pill {
  padding: 1px 5px;
  font-size: 10px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#shipmentDataTable .badge-unstarted,
#shipmentDataTable .badge-duration,
#shipmentDataTable .badge-predicted,
#dispatchTable .elapsed-badge {
  font-size: 10px;
  padding: 1px 4px;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pill-processing {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.pill-prepared {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.pill-dispatched {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.pill-pending {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.badge-unstarted {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  padding: 2px 6px;
  border-radius: 4px;
}

.badge-duration {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  padding: 2px 6px;
  border-radius: 4px;
}

.badge-predicted {
  background: rgba(139, 92, 246, 0.18);
  color: #c084fc;
  padding: 2px 6px;
  border-radius: 4px;
  font-style: italic;
}

/* ============================================================ */
/* High-Context Visual Hierarchy: Shipment & Dispatch Cells    */
/* ============================================================ */

/* Order ID */
.cell-order-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  color: var(--text-muted);
}

/* Shipment ID */
.cell-shipment-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

/* Master Shipment ID Chip */
.chip-code-master {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

/* Picklist ID Chip: Dedicated Sky Blue */
.chip-code-picklist {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.14);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

/* Crate ID Chip: Dedicated Violet/Purple */
.chip-code-crate {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(168, 85, 247, 0.14);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

/* Hub Name Cell */
.cell-hub-name {
  font-weight: 600;
  color: var(--text-main);
}

/* Picklist Status Pills */
.pill-pl {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.pill-pl-closed {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.pill-pl-processing {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}
.pill-pl-picked {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}
.pill-pl-unstarted {
  background: rgba(249, 115, 22, 0.22);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.5);
}
.pill-pl-muted {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

/* Person Chips (Picker & Packer) */
.chip-person {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 500;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip-picker {
  background: rgba(59, 130, 246, 0.14);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}
.chip-packer {
  background: rgba(139, 92, 246, 0.14);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.3);
}
.chip-station {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 500;
  background: rgba(20, 184, 166, 0.14);
  color: #2dd4bf;
  border: 1px solid rgba(20, 184, 166, 0.3);
}
.chip-predicted {
  background: rgba(217, 70, 239, 0.14);
  color: #f472b6;
  border: 1px dashed rgba(217, 70, 239, 0.5);
  font-style: italic;
}
.chip-unassigned {
  color: var(--text-sub);
  font-size: 11px;
}

/* Fulfillment Type Pills */
.pill-fmt {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
}
.pill-fmt-rts {
  background: rgba(34, 211, 238, 0.18);
  color: #22d3ee;
  border: 1px solid rgba(34, 211, 238, 0.4);
  font-weight: 700;
}
.pill-fmt-std {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

/* Retailer Pills */
.pill-ret {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
}
.pill-ret-yes {
  background: rgba(168, 85, 247, 0.22);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.5);
  font-weight: 700;
}
.pill-ret-no {
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-sub);
  border: 1px solid transparent;
}

/* Duration Normal Badges */
.badge-duration-safe {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 1px 5px;
  border-radius: 4px;
}
.badge-duration-unstarted {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 1px 5px;
  border-radius: 4px;
}

/* Dispatch Table Specific Components */
.cell-carrier-name {
  font-weight: 700;
  color: var(--text-main);
}
.chip-hub-id {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}
.chip-box-size {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}
.cell-awb {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10.5px;
  color: var(--primary);
  font-weight: 500;
}
.cell-pincode {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10.5px;
  color: var(--text-muted);
}

/* Dispatch Date Range Controls Bar */
.dispatch-date-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.date-input-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1e293b;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md, 8px);
  padding: 4px 10px;
  transition: all var(--transition-fast, 0.15s ease);
}

.date-input-wrapper:hover {
  border-color: rgba(56, 189, 248, 0.4);
}

.date-input-wrapper:focus-within {
  border-color: var(--primary, #38bdf8);
  box-shadow: 0 0 0 3px var(--primary-glow, rgba(56, 189, 248, 0.25));
}

.date-input-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--primary, #38bdf8);
  text-transform: uppercase;
  user-select: none;
}

.dispatch-date-controls input[type="datetime-local"] {
  background: transparent;
  border: none;
  color: var(--text-main, #f8fafc);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 2px;
  outline: none;
  color-scheme: dark;
  transition: all var(--transition-fast, 0.15s ease);
}

.dispatch-date-controls input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: invert(0.85);
  opacity: 0.85;
  transition: opacity 0.15s ease;
}

.dispatch-date-controls input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

.date-separator,
.dispatch-date-controls span {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ============================================================ */
/* CPT Outbound Tracker Pick Duration Heatmap (> 10 min)        */
/* Matching Google Sheets CPT Tracker Heatmap Rules             */
/* ============================================================ */
/* Dark Mode: Whole-Row Heatmap Highlighting (CPT & Dispatch Tables) */
.row-cpt-heatmap-warning,
.row-cpt-heatmap-warning td,
.row-heatmap-warning,
.row-heatmap-warning td {
  background-color: rgba(245, 158, 11, 0.18) !important;
}
.row-cpt-heatmap-warning td:first-child,
.row-heatmap-warning td:first-child {
  border-left: 4px solid #f59e0b !important;
}
.row-cpt-heatmap-warning:hover,
.row-cpt-heatmap-warning:hover td,
.row-heatmap-warning:hover,
.row-heatmap-warning:hover td {
  background-color: rgba(245, 158, 11, 0.28) !important;
}

.row-cpt-heatmap-alert,
.row-cpt-heatmap-alert td,
.row-heatmap-alert,
.row-heatmap-alert td {
  background-color: rgba(249, 115, 22, 0.22) !important;
}
.row-cpt-heatmap-alert td:first-child,
.row-heatmap-alert td:first-child {
  border-left: 4px solid #f97316 !important;
}
.row-cpt-heatmap-alert:hover,
.row-cpt-heatmap-alert:hover td,
.row-heatmap-alert:hover,
.row-heatmap-alert:hover td {
  background-color: rgba(249, 115, 22, 0.32) !important;
}

.row-cpt-heatmap-critical,
.row-cpt-heatmap-critical td,
.row-heatmap-critical,
.row-heatmap-critical td {
  background-color: rgba(239, 68, 68, 0.28) !important;
}
.row-cpt-heatmap-critical td:first-child,
.row-heatmap-critical td:first-child {
  border-left: 4px solid #dc2626 !important;
}
.row-cpt-heatmap-critical:hover,
.row-cpt-heatmap-critical:hover td,
.row-heatmap-critical:hover,
.row-heatmap-critical:hover td {
  background-color: rgba(239, 68, 68, 0.38) !important;
}

.badge-heatmap-warning {
  background: rgba(245, 158, 11, 0.20) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(245, 158, 11, 0.45) !important;
  font-weight: 600;
}

.badge-heatmap-alert {
  background: rgba(239, 68, 68, 0.22) !important;
  color: #fca5a5 !important;
  border: 1px solid rgba(239, 68, 68, 0.5) !important;
  font-weight: 700;
}

.badge-heatmap-critical {
  background: rgba(220, 38, 38, 0.32) !important;
  color: #fecaca !important;
  border: 1px solid rgba(239, 68, 68, 0.7) !important;
  font-weight: 700;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}

.heatmap-legend-strip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-sub);
  margin-left: 8px;
  vertical-align: middle;
}

.heatmap-legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}

.btn-heatmap-filter.active {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: #ef4444 !important;
  color: #fca5a5 !important;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.35);
}

.elapsed-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  margin-left: 6px;
  vertical-align: middle;
}

.elapsed-normal {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.elapsed-warning {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.elapsed-alert {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.45);
}

.elapsed-critical {
  background: rgba(220, 38, 38, 0.28);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.6);
  animation: pulseHeatmap 2s infinite ease-in-out;
}

@keyframes pulseHeatmap {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 8px 2px rgba(239, 68, 68, 0.5); }
}

/* Empty & Loading States */
.empty-state-cell {
  text-align: center;
  padding: 40px !important;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.empty-icon {
  font-size: 36px;
}

.empty-text {
  font-size: 14px;
  color: var(--text-muted);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2500 !important;
  padding: 16px;
  overflow-y: auto;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 520px;
  max-width: 90vw;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-sub);
  font-size: 18px;
  cursor: pointer;
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-hint {
  font-size: 11px;
  color: var(--text-sub);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  gap: 10px;
}

.connection-test-result {
  font-size: 12px;
  margin-top: 4px;
}

.connection-test-result.success {
  color: var(--success);
}

.connection-test-result.error {
  color: var(--danger);
}

/* ============================================================
   Google Authentication Portal & User Profile Pill Styling
   ============================================================ */

/* Fullscreen Auth Portal Overlay */
.auth-portal-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 20%, rgba(56, 189, 248, 0.12) 0%, rgba(11, 15, 25, 0.95) 75%),
              rgba(11, 15, 25, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.auth-portal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-portal-card {
  background: rgba(17, 24, 39, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  width: 480px;
  max-width: 95vw;
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.85),
              0 0 40px rgba(56, 189, 248, 0.15);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  overflow: hidden;
  animation: authCardPop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authCardPop {
  0% { transform: scale(0.92) translateY(10px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.auth-portal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #38bdf8, #818cf8, #ec4899);
}

.auth-brand {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.auth-logo-badge {
  width: 58px;
  height: 58px;
  background: linear-gradient(135deg, #0284c7, #6366f1);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(2, 132, 199, 0.4);
  margin-bottom: 4px;
}

.auth-brand h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.auth-desc {
  font-size: 12.5px;
  color: var(--text-muted);
}

.google-logo-wrapper {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  margin-bottom: 4px;
}

/* Primary Official Google SSO Button */
.btn-google-sso {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #ffffff;
  color: #1f2937;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 12px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transition: all 0.2s ease;
  width: 100%;
}

.btn-google-sso:hover {
  background: #f8fafc;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-sub);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin: 2px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.auth-divider span {
  padding: 0 10px;
}

/* Direct Email Sign-In Box */
.auth-manual-input-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-input-group {
  display: flex;
  gap: 8px;
}

.auth-input-group input {
  flex: 1;
  background: rgba(31, 41, 55, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 9px 14px;
  color: #ffffff;
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.auth-input-group input:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.auth-input-group .btn {
  padding: 9px 16px;
  font-size: 12.5px;
  white-space: nowrap;
}

/* Multi-User Fast Selection Grid */
.auth-field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 6px;
}

.known-users-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.known-users-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}

.known-user-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #f1f5f9;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  width: 100%;
}

.known-user-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}

.known-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #6366f1);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.known-user-info {
  flex: 1;
  min-width: 0;
}

.known-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.known-user-email {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.known-user-arrow {
  color: #64748b;
  font-size: 14px;
  transition: transform 0.2s ease;
}

.known-user-btn:hover .known-user-arrow {
  color: #38bdf8;
  transform: translateX(3px);
}

/* Metabase Token Accordion */
.auth-token-accordion {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 12px;
  margin-top: 4px;
}

.token-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 4px 0;
  transition: color 0.15s ease;
}

.token-toggle-btn:hover {
  color: #38bdf8;
}

.token-collapse-content {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.token-hint {
  font-size: 11px;
  color: var(--text-sub);
  line-height: 1.4;
}

.token-hint code {
  color: #38bdf8;
}

.token-input-row {
  display: flex;
  gap: 8px;
}

.token-input-row input {
  flex: 1;
  background: rgba(17, 24, 39, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 6px 10px;
  color: #ffffff;
  font-size: 12px;
  font-family: inherit;
}

.token-input-row input:focus {
  outline: none;
  border-color: #38bdf8;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 11.5px;
  border-radius: 6px;
}

/* Accounts List */
.auth-accounts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.account-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: rgba(31, 41, 55, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  width: 100%;
  color: var(--text-main);
}

.account-card:hover {
  background: rgba(55, 65, 81, 0.85);
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.account-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13.5px;
  flex-shrink: 0;
}

.avatar-purplle {
  background: linear-gradient(135deg, #9333ea, #c084fc);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(147, 51, 234, 0.4);
}

.avatar-google {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

.account-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.account-name {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-name strong {
  font-size: 13px;
  color: #ffffff;
}

.account-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 20px;
}

.badge-primary {
  background: rgba(147, 51, 234, 0.2);
  color: #c084fc;
  border: 1px solid rgba(147, 51, 234, 0.4);
}

.badge-secondary {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.account-email {
  font-size: 11.5px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-action {
  flex-shrink: 0;
}

.btn-select-account {
  font-size: 12px;
  font-weight: 600;
  color: #38bdf8;
  padding: 6px 12px;
  background: rgba(56, 189, 248, 0.1);
  border-radius: 6px;
  transition: all 0.15s ease;
}

.account-card:hover .btn-select-account {
  background: #38bdf8;
  color: #0b0f19;
}

/* Auth Status Box */
.auth-status-box {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #34d399;
  font-size: 12px;
  font-weight: 500;
}

.status-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(52, 211, 153, 0.3);
  border-top-color: #34d399;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.auth-footer-info {
  text-align: center;
  font-size: 11px;
  color: var(--text-sub);
}

/* Header Dedicated Sheet Link Button */
.btn-sheet-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.btn-sheet-link:hover {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Header User Profile Pill */
.user-profile-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(31, 41, 55, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 8px 4px 6px;
  border-radius: 24px;
  transition: all 0.2s ease;
}

.user-profile-pill:hover {
  background: rgba(45, 55, 72, 0.9);
  border-color: rgba(56, 189, 248, 0.3);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #818cf8);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.user-details {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
}

.user-email {
  font-size: 10px;
  color: var(--text-muted);
}

.btn-logout {
  background: transparent;
  border: none;
  color: var(--text-sub);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-logout:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* ============================================================ */
/* Status Alert Banner (Non-Blocking Top Notification)          */
/* ============================================================ */
.status-alert-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  margin: 12px 24px 0 24px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

@keyframes slideDown {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.status-alert-banner.banner-warning {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.18), rgba(217, 119, 6, 0.12));
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fef3c7;
}

.status-alert-banner.banner-danger {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.18), rgba(220, 38, 38, 0.12));
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fee2e2;
}

.status-alert-banner.banner-success {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.18), rgba(5, 150, 105, 0.12));
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #d1fae5;
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.banner-icon {
  font-size: 16px;
}

.banner-text {
  line-height: 1.4;
}

.banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.banner-close-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.banner-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* ============================================================ */
/* Floating Toast Notifications                                 */
/* ============================================================ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 10px;
  background: #1e293b;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08);
  transform: translateX(40px);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 420px;
}

.toast.visible {
  transform: translateX(0);
  opacity: 1;
}

.toast-warning {
  border-left: 4px solid #f59e0b;
}

.toast-danger {
  border-left: 4px solid #ef4444;
}

.toast-success {
  border-left: 4px solid #10b981;
}

.toast-info {
  border-left: 4px solid #38bdf8;
}

.toast-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.toast-msg {
  line-height: 1.4;
}

/* ============================================================ */
/* Quick Token Refresh Modal                                    */
/* ============================================================ */
.token-modal-card {
  max-width: 540px;
}

.modal-title-with-icon {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-header-icon {
  font-size: 20px;
}

.modal-subtext {
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 16px;
  line-height: 1.5;
}

.token-helper-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.helper-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  color: #cbd5e1;
  line-height: 1.5;
}

.step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.copy-snippet-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #090d16;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 8px;
  padding: 8px 12px;
  gap: 10px;
}

.copy-snippet-bar code {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 11.5px;
  color: #7dd3fc;
  overflow-x: auto;
  white-space: nowrap;
}

.input-with-action {
  display: flex;
  gap: 8px;
}

.input-with-action input {
  flex: 1;
}

.btn-success {
  background: #10b981 !important;
  color: #ffffff !important;
  border-color: #10b981 !important;
}

.token-accordion-toggle {
  margin-top: 18px;
  font-size: 12px;
  color: var(--text-sub);
  cursor: pointer;
  user-select: none;
  display: inline-block;
  transition: color 0.15s ease;
}

.token-accordion-toggle:hover {
  color: #38bdf8;
}

.metabase-password-box {
  margin-top: 12px;
  padding: 12px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.metabase-password-box.hidden {
  display: none;
}

/* Empty State Box inside CPT Table */
.empty-state-token-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 30px 20px;
  text-align: center;
}

.empty-state-token-box .empty-state-icon {
  font-size: 32px;
  margin-bottom: 4px;
}

.empty-state-token-box h4 {
  font-size: 16px;
  color: #f8fafc;
  margin: 0;
  font-weight: 700;
}

.empty-state-token-box p {
  font-size: 13px;
  color: var(--text-sub);
  margin: 0;
  max-width: 460px;
  line-height: 1.5;
}

/* ============================================================ */
/* Top Global Nano-Progress Line                                */
/* ============================================================ */
.global-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #38bdf8 0%, #818cf8 50%, #ec4899 100%);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.9), 0 0 6px rgba(129, 140, 248, 0.8);
  z-index: 9999999;
  pointer-events: none;
  opacity: 0;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.global-progress-bar.active {
  opacity: 1;
}

.global-progress-bar.completed {
  background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.9);
}

.global-progress-bar.error {
  background: linear-gradient(90deg, #ef4444 0%, #f59e0b 100%);
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.9);
}

/* ============================================================ */
/* Dedicated Live Fetch Progress Bar Card                       */
/* ============================================================ */
.fetch-progress-card {
  margin: 12px 24px 0 24px;
  padding: 14px 20px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: slideDownProgress 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(8px);
}

@keyframes slideDownProgress {
  from { transform: translateY(-12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.fetch-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.fetch-progress-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fetch-pulse-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  font-size: 16px;
}

.fetch-pulse-icon.spinning {
  animation: spinSlow 1.5s linear infinite;
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.fetch-text-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fetch-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.01em;
}

.fetch-subtext {
  font-size: 11.5px;
  color: var(--text-sub);
  letter-spacing: 0.01em;
}

.fetch-progress-stats {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fetch-timer {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 12px;
  color: #94a3b8;
  background: rgba(0, 0, 0, 0.35);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.fetch-percentage {
  font-size: 14px;
  font-weight: 800;
  color: #38bdf8;
  min-width: 44px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.fetch-progress-track {
  width: 100%;
  height: 7px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.fetch-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0284c7 0%, #38bdf8 40%, #818cf8 75%, #ec4899 100%);
  border-radius: 999px;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease;
  position: relative;
}

.fetch-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.35) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: shimmerProgress 1.4s infinite;
}

@keyframes shimmerProgress {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.fetch-progress-fill.success {
  background: linear-gradient(90deg, #059669 0%, #10b981 100%);
}

.fetch-progress-fill.error {
  background: linear-gradient(90deg, #dc2626 0%, #f59e0b 100%);
}

/* ============================================================ */
/* Parallel CPT Operations Layout (Matrix + Picker Side-by-Side)*/
/* ============================================================ */
.cpt-parallel-container {
  display: grid;
  grid-template-columns: minmax(390px, 42%) minmax(490px, 58%);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 20px;
}

@media (max-width: 1200px) {
  .cpt-parallel-container {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.cpt-parallel-left,
.cpt-parallel-right {
  margin-bottom: 0 !important;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.cpt-parallel-left .section-header {
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.cpt-parallel-left .section-header h2 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
  color: var(--text-main);
}

.cpt-parallel-left .section-header .subtitle {
  font-size: 11px;
  color: var(--text-sub);
}

.cpt-parallel-left .view-filter-control {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-sub);
}

.cpt-parallel-left .view-filter-control select {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 4px;
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.cpt-parallel-left .summary-table-wrapper,
.cpt-parallel-right .picker-table-scroll {
  flex: 1;
  min-height: 0;
  max-height: 485px;
  overflow-y: auto;
}

.summary-table td,
.summary-table th {
  padding: 8px 12px;
  font-size: 11.5px;
}

.picker-cpt-card {
  margin-bottom: 0;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  border-radius: 12px;
  overflow: hidden;
}

.picker-cpt-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.picker-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.picker-title-row h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.picker-cpt-header .column-hint {
  font-size: 11px;
  color: var(--text-sub);
}

.picker-icon {
  font-size: 15px;
  color: #38bdf8;
}

.picker-cpt-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-group-toggle {
  display: inline-flex;
  background: var(--bg-elevated);
  border-radius: 6px;
  padding: 2px;
  border: 1px solid var(--border-subtle);
}

.btn-group-toggle .btn-toggle {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-group-toggle .btn-toggle.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
}

.picker-cpt-mode-control {
  display: inline-flex;
  align-items: center;
}

.picker-mode-select {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.picker-mode-select:hover {
  border-color: var(--border-hover, #475569);
}

.picker-mode-select:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

.picker-search-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.picker-search-wrapper .search-icon {
  position: absolute;
  left: 7px;
  font-size: 10px;
  opacity: 0.6;
  pointer-events: none;
}

.picker-search-wrapper input {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 4px 22px 4px 24px;
  font-size: 11px;
  color: var(--text-main);
  width: 140px;
  transition: all 0.2s;
}

.picker-search-wrapper input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
  width: 170px;
}

.picker-search-wrapper .clear-btn {
  position: absolute;
  right: 5px;
  background: none;
  border: none;
  color: var(--text-sub);
  cursor: pointer;
  font-size: 10px;
  padding: 2px;
}

.picker-table-scroll {
  max-height: 485px;
  overflow-y: auto;
  border-radius: 0;
}

.picker-cpt-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.picker-cpt-data-table th {
  position: sticky;
  top: 0;
  background: var(--table-header-bg, #0f172a);
  color: var(--table-header-color, #f1f5f9);
  z-index: 5;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.picker-cpt-data-table th.sortable {
  cursor: pointer;
  user-select: none;
}

.picker-cpt-data-table th.sortable:hover {
  background: var(--bg-card-hover);
  color: var(--primary);
}

.picker-cpt-data-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
  vertical-align: middle;
}

/* Row Highlights: ONLY for Urgent & Overdue (Normal is clean white/slate) */
.row-cpt-normal {
  background: transparent;
}

.row-cpt-overdue {
  background: rgba(239, 68, 68, 0.12) !important;
  border-left: 3px solid #ef4444 !important;
}

.row-cpt-critical {
  background: rgba(249, 115, 22, 0.12) !important;
  border-left: 3px solid #f97316 !important;
}

.row-cpt-urgent {
  background: rgba(245, 158, 11, 0.10) !important;
  border-left: 3px solid #f59e0b !important;
}

/* ============================================================
   Time-of-Day Theme Selector Dropdown & Shift Badges
   ============================================================ */
.theme-selector-wrapper {
  position: relative;
  display: inline-block;
}

.btn-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 6px 12px;
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-theme-toggle:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

.theme-icon {
  font-size: 14px;
}

.theme-chevron {
  font-size: 10px;
  color: var(--text-sub);
  transition: transform 0.2s ease;
}

.theme-selector-wrapper.active .theme-chevron {
  transform: rotate(180deg);
}

.theme-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06);
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 1000;
  animation: themeMenuFade 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes themeMenuFade {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.theme-dropdown-menu.show {
  display: flex;
}

.theme-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-sub);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 4px;
}

.theme-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: themePulse 1.8s infinite;
}

@keyframes themePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
}

.theme-option:hover {
  background: rgba(255, 255, 255, 0.08);
}

.theme-option.active {
  background: rgba(56, 189, 248, 0.14);
  border-left: 3px solid var(--primary);
}

.theme-option .opt-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.theme-option .opt-details {
  display: flex;
  flex-direction: column;
}

.theme-option .opt-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.theme-option .opt-sub {
  font-size: 10px;
  color: var(--text-sub);
}

.badge-shift {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--primary);
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-weight: 600;
  font-size: 11px;
}

/* ============================================================ */
/* Project Owner Branding & Header Styles                       */
/* ============================================================ */
.brand-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-project-owner {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(217, 119, 6, 0.28));
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 1px 4px rgba(245, 158, 11, 0.15);
  white-space: nowrap;
}

body[data-color-scheme="light"] .badge-project-owner {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #b45309;
  border-color: #fcd34d;
  box-shadow: 0 1px 3px rgba(180, 83, 9, 0.12);
}

.user-name-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-owner-pill {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 5px;
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 4px;
  letter-spacing: 0.5px;
}

body[data-color-scheme="light"] .badge-owner-pill {
  background: #fef3c7;
  color: #b45309;
  border-color: #fcd34d;
}

/* Login Screen Project Owner Signature */
.auth-project-owner-badge {
  margin-top: 20px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

body[data-color-scheme="light"] .auth-project-owner-badge {
  background: #fffbeb;
  border-color: #fde68a;
}

.owner-badge-icon {
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.owner-badge-details {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.owner-badge-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.owner-badge-role {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #f59e0b;
  text-transform: uppercase;
}

body[data-color-scheme="light"] .owner-badge-role {
  color: #d97706;
}

.owner-verified-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
}

.owner-badge-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main, #f8fafc);
}

body[data-color-scheme="light"] .owner-badge-name {
  color: #0f172a;
}

.owner-badge-email {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
}

body[data-color-scheme="light"] .owner-badge-email {
  color: #64748b;
}

/* ============================================================ */
/* Custom Multi-Select Keyboard Navigation Highlight            */
/* ============================================================ */
.ms-option-label.keyboard-focused {
  background: rgba(56, 189, 248, 0.22) !important;
  color: #ffffff !important;
  outline: 1px solid rgba(56, 189, 248, 0.6) !important;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.25) inset;
}

body[data-color-scheme="light"] .ms-option-label.keyboard-focused {
  background: rgba(2, 132, 199, 0.15) !important;
  color: #0284c7 !important;
  outline: 1px solid rgba(2, 132, 199, 0.45) !important;
}

/* ============================================================ */
/* Hub-Wise Unstarted Picklists Section Styles                  */
/* ============================================================ */
.unstarted-matrix-card {
  margin-top: 18px;
  margin-bottom: 20px;
  background: var(--bg-card, #1e293b);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.unstarted-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.unstarted-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.unstarted-mode-control {
  display: inline-flex;
  align-items: center;
}

.title-with-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.title-with-badge h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  color: var(--text-main, #f8fafc);
}

.badge-unstarted-total {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 9999px;
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

body[data-color-scheme="light"] .badge-unstarted-total {
  background: #fef3c7;
  color: #b45309;
  border-color: #fcd34d;
}

.unstarted-table-wrapper {
  max-height: 380px;
  overflow-y: auto;
  border-radius: 8px;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.unstarted-table {
  width: 100%;
  border-collapse: collapse;
}

.unstarted-table th {
  position: sticky;
  top: 0;
  background: var(--bg-header, #0f172a);
  z-index: 2;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.unstarted-table td {
  padding: 10px 14px;
  font-size: 12px;
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.05));
  color: var(--text-main, #f8fafc);
}

.unstarted-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

body[data-color-scheme="light"] .unstarted-table tbody tr:hover {
  background: #f8fafc;
}

.badge-unstarted-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 10px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 12px;
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

body[data-color-scheme="light"] .badge-unstarted-count {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.badge-unstarted-zero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
}

.pill-init-pending {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

body[data-color-scheme="light"] .pill-init-pending {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}

.pill-init-clear {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

body[data-color-scheme="light"] .pill-init-clear {
  background: #d1fae5;
  color: #047857;
  border-color: #6ee7b7;
}

.unstarted-total-row {
  background: rgba(59, 130, 246, 0.08) !important;
  font-weight: 700;
  border-top: 2px solid rgba(59, 130, 246, 0.3) !important;
}

body[data-color-scheme="light"] .unstarted-total-row {
  background: #f0f9ff !important;
  border-top-color: #bae6fd !important;
}

/* ============================================================ */
/* Filtered Shipment Table Top Metrics Strip                    */
/* ============================================================ */
.table-metrics-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 14px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: 8px;
}

body[data-color-scheme="light"] .table-metrics-strip {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.table-metric-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--bg-card, #1e293b);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  font-size: 12px;
  color: var(--text-main, #f8fafc);
  transition: all 0.15s ease;
}

body[data-color-scheme="light"] .table-metric-chip {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

.table-metric-chip .chip-icon {
  font-size: 13px;
}

.table-metric-chip .chip-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted, #94a3b8);
}

body[data-color-scheme="light"] .table-metric-chip .chip-label {
  color: #64748b;
}

.table-metric-chip .chip-value {
  font-weight: 700;
  font-size: 13px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  color: var(--primary, #38bdf8);
}

body[data-color-scheme="light"] .table-metric-chip .chip-value {
  color: #0284c7;
}

.table-metric-chip.chip-unstarted {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
}

body[data-color-scheme="light"] .table-metric-chip.chip-unstarted {
  background: #fffbeb;
  border-color: #fde68a;
}

.table-metric-chip.chip-unstarted .chip-value {
  color: #f59e0b;
}

body[data-color-scheme="light"] .table-metric-chip.chip-unstarted .chip-value {
  color: #b45309;
}

/* ============================================================ */
/* Dispatch SLA Cut-off & Carrier Matrix Table                   */
/* ============================================================ */
.dispatch-summary-card {
  margin-bottom: 20px;
}

.dispatch-matrix-wrapper {
  max-height: 480px;
  overflow-y: auto;
}

.dispatch-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.dispatch-matrix-table th {
  position: sticky;
  top: 0;
  background: var(--table-header-bg, #0f172a);
  color: var(--table-header-color, #f1f5f9);
  padding: 8px 12px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-subtle);
  z-index: 5;
}

.dispatch-matrix-table th.col-carrier,
.dispatch-matrix-table th.col-hub-ids {
  text-align: left;
}

.dispatch-matrix-table th.col-cutoff,
.dispatch-matrix-table th.col-count {
  text-align: center;
}

.dispatch-matrix-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.dispatch-matrix-table th.sortable:hover {
  background: rgba(56, 189, 248, 0.12) !important;
}

.dispatch-matrix-table th .sort-arrow {
  display: inline-block;
  font-size: 10px;
  margin-left: 4px;
  opacity: 0.7;
  transition: transform 0.15s ease, color 0.15s ease;
}

.dispatch-matrix-table td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.dispatch-matrix-table td:first-child {
  border-left: 3.5px solid transparent;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.dispatch-matrix-table td.col-carrier {
  font-weight: 600;
  color: var(--text-main);
  text-align: left;
}

.dispatch-matrix-table td.col-hub-ids {
  text-align: left;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: var(--text-sub);
}

.dispatch-matrix-table td.col-cutoff {
  text-align: center;
}

.dispatch-matrix-table td.col-count {
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.dispatch-matrix-table td.col-dispatched {
  color: #34d399; /* emerald */
}

.dispatch-matrix-table td.col-prepared {
  color: #fbbf24; /* amber */
}

.dispatch-matrix-table td.col-total {
  color: #f8fafc;
  font-weight: 700;
}

/* Cutoff semantic badges */
.dispatch-cutoff-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.dispatch-cutoff-badge.badge-cutoff-orange {
  background: rgba(249, 115, 22, 0.15);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.35);
}

.dispatch-cutoff-badge.badge-cutoff-blue {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.dispatch-cutoff-badge.badge-cutoff-red {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.dispatch-cutoff-badge.badge-cutoff-green {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.dispatch-cutoff-badge.badge-cutoff-muted {
  background: var(--bg-elevated);
  color: var(--text-sub);
  border: 1px solid var(--border-subtle);
}

/* Interactive click-to-filter row hover */
.dispatch-matrix-table tbody tr {
  cursor: pointer;
  transition: background 0.15s ease;
}

.dispatch-matrix-table tbody tr:hover {
  background: rgba(56, 189, 248, 0.08);
}

/* Row color mapping matching Operations CPT Matrix */
.dispatch-matrix-table tr.row-past {
  background: rgba(16, 185, 129, 0.08) !important;
}

.dispatch-matrix-table tr.row-past td:first-child {
  border-left-color: #10b981 !important;
}

.dispatch-matrix-table tr.row-past:hover {
  background: rgba(16, 185, 129, 0.14) !important;
}

.dispatch-matrix-table tr.row-near {
  background: rgba(56, 189, 248, 0.12) !important;
}

.dispatch-matrix-table tr.row-near td:first-child {
  border-left-color: #38bdf8 !important;
}

.dispatch-matrix-table tr.row-near:hover {
  background: rgba(56, 189, 248, 0.18) !important;
}

.dispatch-matrix-table tr.row-matrix-active {
  background: rgba(56, 189, 248, 0.22) !important;
  outline: 1.5px solid #38bdf8 !important;
}

.dispatch-matrix-table tbody tr.row-carrier-group-start {
  border-top: 1.5px solid var(--border-subtle);
}

/* Total summary footer row */
.dispatch-matrix-table tfoot .matrix-total-row td {
  background: #090d16;
  color: #ffffff;
  font-weight: 700;
  font-size: 12.5px;
  border-top: 2px solid var(--border-subtle);
  padding: 9px 12px;
}

.dispatch-matrix-table tfoot .matrix-total-row td.col-total-label {
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #f8fafc;
}

.dispatch-matrix-table tfoot .matrix-total-row td.col-dispatched-total {
  color: #4ade80;
  text-align: center;
}

.dispatch-matrix-table tfoot .matrix-total-row td.col-prepared-total {
  color: #fbbf24;
  text-align: center;
}

.dispatch-matrix-table tfoot .matrix-total-row td.col-grand-total {
  color: #38bdf8;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

/* Light mode overrides for Dispatch Matrix */
body[data-color-scheme="light"] .dispatch-matrix-table th {
  background: #0f172a !important;
  color: #f8fafc !important;
  border-bottom: 1px solid #334155 !important;
}

body[data-color-scheme="light"] .dispatch-matrix-table td {
  border-bottom: 1px solid #e2e8f0 !important;
  color: #0f172a;
}

body[data-color-scheme="light"] .dispatch-matrix-table td.col-carrier {
  color: #0f172a !important;
}

body[data-color-scheme="light"] .dispatch-matrix-table td.col-hub-ids {
  color: #475569 !important;
}

body[data-color-scheme="light"] .dispatch-matrix-table td.col-dispatched {
  color: #15803d !important; /* emerald dark */
}

body[data-color-scheme="light"] .dispatch-matrix-table td.col-prepared {
  color: #b45309 !important; /* warm amber dark */
}

body[data-color-scheme="light"] .dispatch-matrix-table td.col-total {
  color: #0f172a !important;
}

body[data-color-scheme="light"] .dispatch-matrix-table tbody tr:hover {
  background: #f0f9ff !important;
}

/* Light mode row color mapping matching Operations CPT Matrix */
body[data-color-scheme="light"] .dispatch-matrix-table tr.row-past {
  background: rgba(16, 185, 129, 0.05) !important;
}

body[data-color-scheme="light"] .dispatch-matrix-table tr.row-past td:first-child {
  border-left-color: #10b981 !important;
}

body[data-color-scheme="light"] .dispatch-matrix-table tr.row-past:hover {
  background: rgba(16, 185, 129, 0.10) !important;
}

body[data-color-scheme="light"] .dispatch-matrix-table tr.row-near {
  background: rgba(2, 132, 199, 0.06) !important;
}

body[data-color-scheme="light"] .dispatch-matrix-table tr.row-near td:first-child {
  border-left-color: #0284c7 !important;
}

body[data-color-scheme="light"] .dispatch-matrix-table tr.row-near:hover {
  background: rgba(2, 132, 199, 0.12) !important;
}

body[data-color-scheme="light"] .dispatch-matrix-table tr.row-matrix-active {
  background: #e0f2fe !important;
  outline: 1.5px solid #0284c7 !important;
}

body[data-color-scheme="light"] .dispatch-cutoff-badge.badge-cutoff-orange {
  background: #ffedd5 !important;
  color: #c2410c !important;
  border-color: #fdba74 !important;
}

body[data-color-scheme="light"] .dispatch-cutoff-badge.badge-cutoff-blue {
  background: #e0f2fe !important;
  color: #0369a1 !important;
  border-color: #7dd3fc !important;
}

body[data-color-scheme="light"] .dispatch-cutoff-badge.badge-cutoff-red {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border-color: #fca5a5 !important;
}

body[data-color-scheme="light"] .dispatch-cutoff-badge.badge-cutoff-green {
  background: #dcfce7 !important;
  color: #15803d !important;
  border-color: #86efac !important;
}

body[data-color-scheme="light"] .dispatch-cutoff-badge.badge-cutoff-muted {
  background: #f1f5f9 !important;
  color: #64748b !important;
  border-color: #cbd5e1 !important;
}

body[data-color-scheme="light"] .dispatch-matrix-table tfoot .matrix-total-row td {
  background: #0f172a !important;
  color: #ffffff !important;
}

body[data-color-scheme="light"] .dispatch-matrix-table tfoot .matrix-total-row td.col-dispatched-total {
  color: #86efac !important;
}

body[data-color-scheme="light"] .dispatch-matrix-table tfoot .matrix-total-row td.col-prepared-total {
  color: #fde047 !important;
}

body[data-color-scheme="light"] .dispatch-matrix-table tfoot .matrix-total-row td.col-grand-total {
  color: #7dd3fc !important;
}

/* ============================================================
   Mobile & Anywhere Access Modal Styles
   ============================================================ */
.mobile-share-card {
  max-width: 460px;
  width: 94vw;
  max-height: calc(100vh - 40px);
  margin: auto;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.mobile-share-card .modal-header {
  flex-shrink: 0;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.mobile-share-card .modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mobile-share-card .modal-footer {
  flex-shrink: 0;
  padding: 10px 18px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
}

.share-url-box {
  background: rgba(56, 189, 248, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 0;
}

.copy-input-row {
  display: flex;
  gap: 8px;
  margin: 4px 0;
}

.copy-input-row input {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-family: var(--font-mono, monospace);
  font-size: 11.5px;
  color: var(--text-main);
}

.qr-scan-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 10px 14px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-bottom: 0;
}

.qr-code-wrapper {
  background: #ffffff;
  padding: 6px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  margin-bottom: 8px;
}

.qr-code-wrapper img {
  display: block;
  width: 130px;
  height: 130px;
}

.qr-instruction strong {
  display: block;
  font-size: 12.5px;
  color: var(--text-main);
  margin-bottom: 2px;
}

.qr-instruction p {
  font-size: 11px;
  color: var(--text-sub);
  margin: 0;
}

.network-alternatives {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
}

.network-alternatives .alt-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.network-alternatives code {
  color: #38bdf8;
  font-weight: 600;
  font-size: 10.5px;
}

/* Light Mode Overrides for Mobile Share Modal */
body[data-color-scheme="light"] .mobile-share-card {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
}

body[data-color-scheme="light"] .share-url-box {
  background: #f0fdf4 !important;
  border-color: #bbf7d0 !important;
}

body[data-color-scheme="light"] .copy-input-row input {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

body[data-color-scheme="light"] .qr-scan-container {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

body[data-color-scheme="light"] .qr-instruction strong {
  color: #0f172a !important;
}

body[data-color-scheme="light"] .network-alternatives .alt-item {
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
}

body[data-color-scheme="light"] .network-alternatives code {
  color: #0284c7 !important;
}

/* ============================================================
   Comprehensive Mobile & Tablet Responsiveness (Phone & Anywhere)
   ============================================================ */

/* Tablet & Mobile Landscape (max-width: 992px) */
@media (max-width: 992px) {
  .dashboard-container {
    padding-bottom: 50px;
  }

  .top-nav {
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 16px;
  }

  .brand-section {
    flex: 1 1 auto;
  }

  .header-actions {
    flex-wrap: wrap;
    gap: 8px;
  }

  .cpt-parallel-container {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .filter-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
    gap: 10px !important;
  }

  .dispatch-hero-controls {
    flex-direction: column;
    align-items: stretch !important;
    gap: 12px;
  }

  .date-range-group {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }
}

/* Smartphone & Small Devices (max-width: 768px) */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
  }

  .dashboard-container {
    padding-bottom: 60px;
  }

  /* Compact Touch-Friendly Top Navigation */
  .top-nav {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 12px;
    gap: 10px;
  }

  .brand-section {
    justify-content: space-between;
    width: 100%;
  }

  .brand-info h1 {
    font-size: 15px;
  }

  .badge-project-owner {
    display: none !important; /* Hide long badge on mobile to prevent overflow */
  }

  .system-status {
    font-size: 10px;
  }

  /* Full-width View Switcher */
  .view-switcher {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }

  .tab-btn {
    justify-content: center;
    padding: 9px 8px;
    font-size: 12px;
  }

  /* Countdown Widget */
  .countdown-widget {
    width: 100%;
    min-width: unset;
    padding: 6px 10px;
    text-align: center;
  }

  /* Action buttons row */
  .header-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .header-actions .btn {
    flex: 1 1 calc(50% - 6px);
    justify-content: center;
    padding: 8px 10px;
    font-size: 12px;
    min-height: 38px;
  }

  .btn-mobile-share {
    flex: 1 1 100% !important;
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border: none !important;
  }

  .header-actions .btn-theme-toggle {
    flex: 1 1 calc(50% - 6px);
  }

  .header-actions .user-profile-pill {
    flex: 1 1 100%;
    justify-content: center;
  }

  /* Cards & Sections */
  .card {
    border-radius: 8px;
    margin-bottom: 14px;
  }

  .section-header {
    padding: 10px 12px;
    flex-direction: column;
    align-items: flex-start !important;
    gap: 8px;
  }

  .header-titles h2 {
    font-size: 14px;
  }

  .header-titles .subtitle {
    font-size: 11px;
  }

  /* Tables: Smooth native horizontal swipe */
  .table-scroll-container,
  .summary-table-wrapper,
  .picker-table-scroll,
  .dispatch-matrix-wrapper,
  .data-table-wrapper {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-height: 420px;
    width: 100%;
  }

  /* Matrix Table Mobile Adjustments */
  .dispatch-matrix-table th,
  .dispatch-matrix-table td {
    padding: 7px 8px !important;
    font-size: 11px !important;
    white-space: nowrap;
  }

  .matrix-carrier-name {
    font-size: 11.5px;
  }

  .dispatch-cutoff-badge {
    font-size: 10px;
    padding: 1px 5px;
  }

  .matrix-legend-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    width: 100%;
  }

  .matrix-legend-compact .legend-pill {
    font-size: 9.5px;
    padding: 2px 6px;
  }

  /* KPI Grid */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .kpi-card {
    padding: 10px 12px !important;
  }

  .kpi-value {
    font-size: 18px !important;
  }

  .kpi-label {
    font-size: 10px !important;
  }

  /* Filters */
  .filter-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .filter-controls {
    padding: 10px 12px;
  }

  /* Dispatch Header & Date Inputs */
  .dispatch-date-controls {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  .date-input-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .date-input-wrapper input {
    width: 72% !important;
    font-size: 12px;
  }

  .date-separator {
    display: none;
  }

  .dispatch-date-controls .btn-primary {
    width: 100%;
    min-height: 40px;
    font-size: 13px;
    justify-content: center;
  }

  /* Modals */
  .modal-card,
  .config-modal-card {
    width: 95vw !important;
    max-width: 95vw !important;
    padding: 16px !important;
    max-height: 90vh;
    overflow-y: auto;
  }
}

/* Extra Small Phones (max-width: 480px) */
@media (max-width: 480px) {
  .brand-info h1 {
    font-size: 14px;
  }

  .logo-mark {
    width: 32px;
    height: 32px;
  }

  .tab-btn {
    font-size: 11px;
    padding: 7px 4px;
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  .dispatch-matrix-table th,
  .dispatch-matrix-table td {
    padding: 6px 7px !important;
    font-size: 10.5px !important;
  }
}

/* ============================================================
   ADMIN INTELLIGENCE & TELEMETRY MONITOR (PROSENJIT DEY ONLY)
   ============================================================ */

/* Top Navigation Admin Trigger Button */
.btn-admin-console {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.25), rgba(217, 119, 6, 0.25));
  border: 1.5px solid rgba(245, 158, 11, 0.6);
  color: #fef08a;
  font-weight: 700;
  padding: 6px 13px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}

.btn-admin-console:hover {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.4), rgba(217, 119, 6, 0.4));
  border-color: #f59e0b;
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.35);
}

.admin-crown-icon {
  font-size: 15px;
  filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.6));
}

.admin-live-badge {
  background: #10b981;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 2px;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

/* Admin Console Modal Layout */
.admin-modal-card {
  width: 1060px !important;
  max-width: 96vw !important;
  max-height: 90vh;
  background: rgba(15, 23, 42, 0.95) !important;
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1.5px solid rgba(245, 158, 11, 0.35) !important;
  border-radius: 20px;
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.8), 0 0 35px rgba(245, 158, 11, 0.15);
  display: flex;
  flex-direction: column;
}

body[data-color-scheme="light"] .admin-modal-card {
  background: rgba(255, 255, 255, 0.97) !important;
  border-color: rgba(217, 119, 6, 0.4) !important;
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.2), 0 0 35px rgba(217, 119, 6, 0.1);
}

.admin-modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px 24px;
}

body[data-color-scheme="light"] .admin-modal-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.admin-badge-tag {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 5px;
  letter-spacing: 0.04em;
}

body[data-color-scheme="light"] .admin-badge-tag {
  background: rgba(217, 119, 6, 0.1);
  border-color: rgba(217, 119, 6, 0.3);
  color: #b45309;
}

.admin-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* KPI Cards Grid */
.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

@media (max-width: 768px) {
  .admin-kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.admin-kpi-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
}

body[data-color-scheme="light"] .admin-kpi-card {
  background: #f8fafc;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.admin-kpi-header {
  display: flex;
  align-items: center;
  gap: 7px;
}

.admin-kpi-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-kpi-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.admin-kpi-sub {
  font-size: 11px;
  color: var(--text-sub);
}

/* Admin Table & Sections */
.admin-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-section-header h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.admin-section-hint {
  font-size: 11px;
  color: var(--text-sub);
}

.admin-table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.5);
}

body[data-color-scheme="light"] .admin-table-wrapper {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  text-align: left;
}

.admin-table th {
  background: rgba(30, 41, 59, 0.8);
  color: var(--text-sub);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

body[data-color-scheme="light"] .admin-table th {
  background: #f1f5f9;
  color: #475569;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.admin-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  vertical-align: middle;
}

body[data-color-scheme="light"] .admin-table td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

body[data-color-scheme="light"] .admin-table tr:hover td {
  background: rgba(0, 0, 0, 0.02);
}

/* Online/Offline Status Badges */
.status-pill-online {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-size: 11px;
  font-weight: 700;
}

.status-pill-offline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
}

.status-dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: pulseGreen 1.8s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.operator-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.operator-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.operator-meta {
  display: flex;
  flex-direction: column;
}

.operator-name {
  font-weight: 700;
  color: var(--text-primary);
}

.operator-email {
  font-size: 11px;
  color: var(--text-muted);
}

/* Audit Log Stream Feed */
.admin-audit-container {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  max-height: 220px;
  overflow-y: auto;
  padding: 8px 12px;
}

body[data-color-scheme="light"] .admin-audit-container {
  background: #f8fafc;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.admin-audit-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 12px;
}

body[data-color-scheme="light"] .admin-audit-item {
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.admin-audit-item:last-child {
  border-bottom: none;
}

.audit-time {
  font-family: var(--font-mono);
  color: #64748b;
  font-size: 11px;
  white-space: nowrap;
}

.audit-user-tag {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  padding: 2px 7px;
  border-radius: 5px;
  font-weight: 600;
  font-size: 11px;
  white-space: nowrap;
}

.audit-action-text {
  flex: 1;
  color: var(--text-primary);
}

.audit-meta-tag {
  font-size: 10.5px;
  color: var(--text-sub);
  white-space: nowrap;
}

.admin-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

body[data-color-scheme="light"] .admin-modal-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.admin-footer-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* ============================================================
   DEVELOPER ENVIRONMENT & PROMOTION STYLING
   ============================================================ */

/* Top Developer Status Banner */
.dev-banner {
  display: none !important;
  align-items: center;
  justify-content: space-between;
  padding: 8px 24px;
  background: linear-gradient(90deg, #1e1b4b 0%, #311042 50%, #1e1b4b 100%);
  border-bottom: 1px solid rgba(168, 85, 247, 0.35);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  z-index: 100;
  position: relative;
}

body.is-dev-env .dev-banner {
  display: flex !important;
}

body[data-color-scheme="light"] .dev-banner {
  background: linear-gradient(90deg, #f5f3ff 0%, #fae8ff 50%, #f5f3ff 100%);
  border-bottom: 1px solid rgba(168, 85, 247, 0.25);
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.08);
}

.dev-banner-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dev-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(168, 85, 247, 0.22);
  border: 1px solid rgba(192, 132, 252, 0.45);
  color: #e9d5ff;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
}

body[data-color-scheme="light"] .dev-badge {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: #6b21a8;
}

.dev-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c084fc;
  box-shadow: 0 0 10px #c084fc;
  animation: devPulse 2s infinite ease-in-out;
}

@keyframes devPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 14px #e879f9; }
}

.dev-banner-subtext {
  font-size: 12.5px;
  color: #cbd5e1;
}

body[data-color-scheme="light"] .dev-banner-subtext {
  color: #475569;
}

.dev-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-dev-action {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f8fafc;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-dev-action:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

body[data-color-scheme="light"] .btn-dev-action {
  background: white;
  border-color: #cbd5e1;
  color: #334155;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

body[data-color-scheme="light"] .btn-dev-action:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.btn-dev-promote {
  background: linear-gradient(135deg, #7c3aed 0%, #c026d3 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(192, 38, 211, 0.35);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-dev-promote:hover {
  transform: translateY(-1.5px) scale(1.02);
  box-shadow: 0 6px 20px rgba(192, 38, 211, 0.5);
  filter: brightness(1.1);
}

.btn-dev-view-stable {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #94a3b8;
  padding: 6px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-dev-view-stable:hover {
  color: #f8fafc;
  border-color: #cbd5e1;
  background: rgba(255, 255, 255, 0.05);
}

body[data-color-scheme="light"] .btn-dev-view-stable {
  color: #64748b;
  border-color: #cbd5e1;
}

body[data-color-scheme="light"] .btn-dev-view-stable:hover {
  color: #0f172a;
  background: #f1f5f9;
}

/* Sticky Bottom Promotion Toolbar */
.dev-bottom-bar {
  display: none !important;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 48px);
  max-width: 860px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(168, 85, 247, 0.45);
  border-radius: 16px;
  padding: 12px 24px;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55), 0 0 20px rgba(168, 85, 247, 0.2);
  z-index: 999;
  animation: slideUpBottomBar 0.4s ease-out;
}

body.is-dev-env .dev-bottom-bar {
  display: flex !important;
}

@keyframes slideUpBottomBar {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

body[data-color-scheme="light"] .dev-bottom-bar {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(168, 85, 247, 0.35);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12), 0 0 15px rgba(168, 85, 247, 0.1);
}

.dev-bottom-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dev-pill-icon {
  font-size: 24px;
}

.dev-bottom-title {
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
}

body[data-color-scheme="light"] .dev-bottom-title {
  color: #0f172a;
}

.dev-bottom-desc {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

body[data-color-scheme="light"] .dev-bottom-desc {
  color: #64748b;
}

.dev-bottom-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-dev-action-bottom {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f8fafc;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-dev-action-bottom:hover {
  background: rgba(255, 255, 255, 0.16);
}

body[data-color-scheme="light"] .btn-dev-action-bottom {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1e293b;
}

.btn-dev-promote-bottom {
  background: linear-gradient(135deg, #7c3aed 0%, #db2777 100%);
  border: none;
  color: white;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(219, 39, 119, 0.4);
  transition: all 0.2s ease;
}

.btn-dev-promote-bottom:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(219, 39, 119, 0.55);
}

/* Developer Whitelist Modal Styling */
.dev-whitelist-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 10px;
  font-size: 13px;
  color: #93c5fd;
  line-height: 1.5;
  margin-bottom: 20px;
}

body[data-color-scheme="light"] .dev-whitelist-note {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

.dev-add-form {
  margin-bottom: 24px;
}

.dev-input-row {
  display: flex;
  gap: 10px;
}

.dev-email-input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}

.dev-email-input:focus {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.btn-add-dev {
  white-space: nowrap;
  padding: 10px 18px;
}

.dev-whitelist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.whitelist-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dev-whitelist-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}

.whitelist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  transition: all 0.15s ease;
}

body[data-color-scheme="light"] .whitelist-item {
  background: #f8fafc;
}

.whitelist-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.whitelist-user-icon {
  font-size: 16px;
}

.whitelist-email {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.whitelist-tag-owner {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(234, 179, 8, 0.2);
  color: #fde047;
  border: 1px solid rgba(234, 179, 8, 0.35);
  padding: 2px 8px;
  border-radius: 12px;
}

body[data-color-scheme="light"] .whitelist-tag-owner {
  background: #fef9c3;
  color: #854d0e;
  border-color: #fde047;
}

.btn-remove-dev {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 13px;
  transition: background 0.15s ease;
}

.btn-remove-dev:hover {
  background: rgba(239, 68, 68, 0.12);
}

/* Promote Modal Styling */
.promote-summary-card {
  text-align: center;
  padding: 10px 0;
}

.promote-icon-banner {
  font-size: 38px;
  margin-bottom: 12px;
}

.promote-checklist {
  margin-top: 20px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px;
}

body[data-color-scheme="light"] .promote-checklist {
  background: #f8fafc;
}

.promote-check-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.promote-check-item .check-icon {
  font-size: 18px;
  margin-top: 2px;
}

.btn-confirm-promote {
  background: linear-gradient(135deg, #7c3aed 0%, #db2777 100%) !important;
  border: none !important;
  box-shadow: 0 4px 15px rgba(219, 39, 119, 0.35) !important;
}

/* ============================================================
   Site-Wide Floating Navigation Dock & Quick Action Bar
   ============================================================ */
.site-nav-dock {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(15, 23, 42, 0.90);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 40px;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.55), 0 0 20px rgba(56, 189, 248, 0.18);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

body[data-color-scheme="light"] .site-nav-dock,
body[data-theme="morning"] .site-nav-dock,
body[data-theme="day"] .site-nav-dock {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(0, 0, 0, 0.14);
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.16), 0 0 15px rgba(2, 132, 199, 0.12);
}

.dock-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 20px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted, #94a3b8);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.dock-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main, #ffffff);
  transform: translateY(-2px);
}

body[data-color-scheme="light"] .dock-btn:hover,
body[data-theme="morning"] .dock-btn:hover,
body[data-theme="day"] .dock-btn:hover {
  background: rgba(0, 0, 0, 0.07);
  color: #0f172a;
}

.dock-btn.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(99, 102, 241, 0.25));
  border-color: rgba(56, 189, 248, 0.45);
  color: #38bdf8 !important;
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.25);
}

body[data-color-scheme="light"] .dock-btn.active,
body[data-theme="morning"] .dock-btn.active,
body[data-theme="day"] .dock-btn.active {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.18), rgba(79, 70, 229, 0.18));
  border-color: rgba(2, 132, 199, 0.45);
  color: #0284c7 !important;
}

.dock-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 3px;
}

body[data-color-scheme="light"] .dock-divider,
body[data-theme="morning"] .dock-divider,
body[data-theme="day"] .dock-divider {
  background: rgba(0, 0, 0, 0.12);
}

.dock-btn-export {
  background: linear-gradient(135deg, #0284c7, #6366f1) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35) !important;
}

.dock-btn-export:hover {
  background: linear-gradient(135deg, #0369a1, #4f46e5) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.45) !important;
}

/* ============================================================
   Excel-Style Spreadsheet Grid Navigation & Ctrl+C Copy System
   ============================================================ */
table.modern-table tbody td,
table.resizable-table tbody td,
table.admin-table tbody td,
table.summary-table tbody td,
table.dispatch-matrix-table tbody td {
  cursor: cell;
  position: relative;
  transition: background-color 0.1s ease;
  user-select: text;
  -webkit-user-select: text;
}

/* Active Excel Cell Selection (Emerald Green Ring + Fill Handle) */
.excel-selected-cell,
td.copyable-cell.cell-copied {
  outline: 2px solid #10b981 !important;
  outline-offset: -2px !important;
  background: rgba(16, 185, 129, 0.18) !important;
  position: relative;
  z-index: 5;
}

body[data-color-scheme="light"] .excel-selected-cell,
body[data-theme="morning"] .excel-selected-cell,
body[data-theme="day"] .excel-selected-cell {
  background: rgba(16, 185, 129, 0.22) !important;
  outline-color: #059669 !important;
}

/* Bottom-right Excel handle square */
.excel-selected-cell::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 6px;
  height: 6px;
  background: #10b981;
  border: 1px solid #ffffff;
  border-radius: 1px;
  pointer-events: none;
  z-index: 6;
}

body[data-color-scheme="light"] .excel-selected-cell::after,
body[data-theme="morning"] .excel-selected-cell::after,
body[data-theme="day"] .excel-selected-cell::after {
  background: #059669;
}

/* Multi-Cell Range Selection Highlight */
.excel-range-selected {
  background: rgba(16, 185, 129, 0.14) !important;
  outline: 1px solid rgba(16, 185, 129, 0.45) !important;
}

/* Ctrl+C Copy Flash Animation (Marching ants / flashing glow) */
.cell-copy-flashing {
  animation: excelCopyDash 0.75s ease;
}

@keyframes excelCopyDash {
  0% { outline: 2px dashed #10b981 !important; background: rgba(16, 185, 129, 0.45) !important; }
  50% { outline: 2px dashed #38bdf8 !important; background: rgba(56, 189, 248, 0.35) !important; }
  100% { outline: 2px solid #10b981 !important; background: rgba(16, 185, 129, 0.18) !important; }
}

.excel-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.excel-copy-btn:hover {
  background: rgba(16, 185, 129, 0.28);
  border-color: #10b981;
  color: #ffffff;
  transform: translateY(-1px);
}

body[data-color-scheme="light"] .excel-copy-btn {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #059669;
}

body[data-color-scheme="light"] .excel-copy-btn:hover {
  background: #059669;
  color: #ffffff;
}

/* Floating copy feedback tooltip */
.excel-copy-tooltip {
  position: fixed;
  z-index: 3000;
  padding: 6px 12px;
  background: #0f172a;
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.5);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  gap: 6px;
  transform: translate(-50%, -100%);
  animation: tooltipPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tooltipPop {
  0% { opacity: 0; transform: translate(-50%, -80%) scale(0.9); }
  100% { opacity: 1; transform: translate(-50%, -100%) scale(1); }
}

/* ============================================================
   Export Hub & Metabase Multi-Format Modal
   ============================================================ */
.export-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 2200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.export-modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.export-modal-card {
  background: var(--bg-surface, #111827);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  border-radius: 18px;
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.7);
  transform: scale(0.96);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.export-modal-backdrop.open .export-modal-card {
  transform: scale(1);
}

.export-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  background: rgba(255, 255, 255, 0.02);
}

.export-modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main, #ffffff);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.export-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}

.export-modal-close:hover {
  color: var(--text-main, #ffffff);
  background: rgba(255, 255, 255, 0.08);
}

.export-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  padding: 0 24px;
  background: rgba(0, 0, 0, 0.18);
  gap: 8px;
}

.export-tab-btn {
  padding: 13px 18px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted, #94a3b8);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.export-tab-btn:hover {
  color: var(--text-main, #ffffff);
}

.export-tab-btn.active {
  color: var(--primary, #38bdf8);
  border-bottom-color: var(--primary, #38bdf8);
}

.export-modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.export-section-desc {
  font-size: 13px;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 12px;
  line-height: 1.5;
}

.export-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.export-tile {
  background: var(--bg-elevated, #1f2937);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.export-tile:hover {
  border-color: var(--primary, #38bdf8);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.export-tile-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main, #ffffff);
  display: flex;
  align-items: center;
  gap: 8px;
}

.export-tile-desc {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
  line-height: 1.4;
}

.export-query-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.export-query-row {
  background: var(--bg-elevated, #1f2937);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.export-query-info h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main, #ffffff);
  margin: 0 0 4px 0;
}

.export-query-info p {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
  margin: 0;
}

.export-btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.raw-dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main, #ffffff);
  cursor: pointer;
  transition: all 0.18s ease;
}

.raw-dl-btn:hover {
  background: var(--primary, #38bdf8);
  color: #0b0f19;
  border-color: var(--primary, #38bdf8);
  transform: translateY(-1px);
}

.raw-dl-btn.btn-xlsx:hover {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
}

.raw-dl-btn.btn-json:hover {
  background: #8b5cf6;
  color: #ffffff;
  border-color: #8b5cf6;
}








