﻿/* ============================================
   ClaudeCustomerPortal — Design System
   4EverMomentum Brand | Teal #0EA5A3
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Slate palette */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  /* Teal palette — 4EverMomentum brand */
  --teal-50: #F0FDFD;
  --teal-100: #CCFBFB;
  --teal-200: #99F6F5;
  --teal-300: #5EEBE9;
  --teal-400: #2DD4D2;
  --teal-500: #14B8B6;
  --teal-600: #0EA5A3;
  --teal-700: #0D8F8D;
  --teal-800: #0A7270;
  --teal-900: #0A5553;

  /* Semantic colors */
  --color-primary: var(--teal-600);
  --color-primary-hover: var(--teal-700);
  --color-primary-light: var(--teal-50);
  --color-success: #10b981;
  --color-success-light: #ecfdf5;
  --color-warning: #f59e0b;
  --color-warning-light: #fffbeb;
  --color-danger: #ef4444;
  --color-danger-light: #fef2f2;
  --color-info: #3b82f6;
  --color-info-light: #eff6ff;

  /* Surfaces */
  --bg-body: var(--slate-50);
  --bg-card: #ffffff;
  --bg-nav: #ffffff;
  --bg-nav-hover: var(--teal-50);
  --bg-topbar: #ffffff;
  --bg-section-header: var(--teal-600);

  /* Text */
  --text-primary: var(--slate-800);
  --text-secondary: var(--slate-500);
  --text-muted: var(--slate-400);
  --text-inverse: #ffffff;
  --text-link: var(--teal-600);

  /* Borders */
  --border-light: var(--slate-200);
  --border-medium: var(--slate-300);

  /* Typography */
  --font-heading: 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Spacing scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-body);
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
  color: var(--slate-900);
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-hover);
}

img { max-width: 100%; }

/* ---------- Top Info Bar ---------- */
.top-bar {
  background: var(--bg-topbar);
  color: var(--slate-300);
  font-size: 0.75rem;
  padding: 0.4rem 1.5rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1.25rem;
  letter-spacing: 0.02em;
  font-weight: 500;
}

.top-bar a {
  color: var(--slate-300);
  transition: color var(--transition-fast);
}

.top-bar a:hover {
  color: var(--teal-300);
}

.top-bar-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.top-bar-divider {
  width: 1px;
  height: 12px;
  background: var(--slate-600);
}

/* ---------- Main Navigation ---------- */
.main-nav {
  background: #ffffff;
  border-bottom: 1px solid #E5E7EB;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo .logo-accent {
  color: #2DD4D2;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  height: 100%;
}

.nav-links li {
  height: 100%;
  display: flex;
  align-items: center;
}

.nav-links a {
  color: rgba(255,255,255,0.6);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 0.9rem;
  height: 100%;
  display: flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
}

.nav-links a:hover,
.nav-links a.active {
  color: #FFFFFF;
  border-bottom-color: #14B8B6;
}

.nav-links .dropdown {
  position: relative;
}

.nav-links .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #1E293B;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  min-width: 200px;
  padding: 0.5rem 0;
  z-index: 200;
}

.nav-links .dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-menu a {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.84rem;
  text-transform: none;
  border-bottom: none;
  height: auto;
  color: rgba(255,255,255,0.75);
}

.dropdown-menu a:hover {
  background: rgba(255,255,255,0.08);
  color: #FFFFFF;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.84rem;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
  position: relative;
}

.nav-user:hover {
  background: rgba(255,255,255,0.07);
}

.nav-user .avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #0EA5A3;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
}

.btn-logout {
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.5);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-heading);
  transition: all var(--transition-fast);
}

.btn-logout:hover {
  border-color: var(--color-danger);
  color: var(--color-danger);
}

/* ---------- Page Header / Location Bar ---------- */
.page-header {
  background: var(--teal-700);
  color: white;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
}

.page-header .location-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-change-location {
  background: rgba(255,255,255,0.15);
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 0.35rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-heading);
  transition: all var(--transition-fast);
}

.btn-change-location:hover {
  background: rgba(255,255,255,0.25);
}

/* ---------- Tab Navigation ---------- */
.tab-nav {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0.3rem;
  display: inline-flex;
  gap: 0.2rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.tab-nav::-webkit-scrollbar {
  height: 3px;
}

.tab-nav::-webkit-scrollbar-thumb {
  background: var(--slate-300);
  border-radius: 3px;
}

.tab-nav a {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 500;
  color: #64748b;
  padding: 0.5rem 0.85rem;
  white-space: nowrap;
  border-bottom: none;
  border-radius: 7px;
  transition: all 0.15s ease;
  text-decoration: none;
}

.tab-nav a:hover {
  color: #0d8f8d;
  background: #f0fdfd;
}

.tab-nav a.active {
  color: #ffffff;
  background: linear-gradient(135deg, #0EA5A3, #0D8F8D);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(14,165,163,0.3);
}

/* ---------- Content Area ---------- */
.content {
  padding: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.content-wide {
  padding: 1.5rem;
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
  border: 1px solid rgba(0,0,0,0.06);
  overflow: hidden;
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.07);
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, #fafbfc, #f8f9fb);
}

.card-header h3 {
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-body {
  padding: 1.25rem;
}

/* ---------- Dashboard Grid ---------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.dashboard-grid .card-chart {
  min-height: 320px;
}

.dashboard-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.chart-container {
  position: relative;
  height: 250px;
  padding: 0.5rem;
}

/* ---------- Data Table ---------- */
.table-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-box label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--slate-600);
}

.search-box input {
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-family: var(--font-body);
  width: 280px;
  transition: border-color var(--transition-fast);
  background: var(--bg-card);
}

.search-box input:focus {
  outline: none;
  border-color: #14B8B6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.btn-export {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, #0EA5A3, #0D8F8D);
  color: white;
  border: none;
  padding: 0.5rem 1.15rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font-heading);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(14,165,163,0.3);
}

.btn-export:hover {
  background: linear-gradient(135deg, #0D8F8D, #0A7270);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(14,165,163,0.35);
}

.data-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.data-table thead {
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
  border-bottom: 2px solid var(--border-light);
}

.data-table th {
  padding: 0.7rem 1rem;
  text-align: left;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slate-500);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: color 0.15s;
}

.data-table th:hover {
  background: var(--slate-100);
  color: var(--teal-700);
}

.data-table th .sort-icon {
  margin-left: 0.3rem;
  opacity: 0.3;
  font-size: 0.65rem;
}

.data-table th.sorted .sort-icon {
  opacity: 1;
  color: var(--teal-600);
}

.data-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--slate-700);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: all 0.15s ease;
}

.data-table tbody tr:hover {
  background: #f0fdfd;
  box-shadow: inset 3px 0 0 #0EA5A3;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.status-available {
  background: var(--color-info-light);
  color: #2563eb;
}
.status-available::before { background: #3b82f6; }

.status-dispatched {
  background: var(--color-warning-light);
  color: #d97706;
}
.status-dispatched::before { background: #f59e0b; }

.status-inroute {
  background: #f0fdf4;
  color: #16a34a;
}
.status-inroute::before { background: #22c55e; }

.status-delivered {
  background: var(--color-success-light);
  color: #059669;
}
.status-delivered::before { background: #10b981; }

.status-cancelled {
  background: var(--color-danger-light);
  color: #dc2626;
}
.status-cancelled::before { background: #ef4444; }

.status-new {
  background: #faf5ff;
  color: #7c3aed;
}
.status-new::before { background: #8b5cf6; }

/* Table action buttons */
.btn-view-details {
  background: var(--slate-100);
  color: var(--slate-700);
  border: 1px solid var(--border-medium);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-heading);
  transition: all var(--transition-fast);
}

.btn-view-details:hover {
  background: var(--teal-600);
  color: white;
  border-color: var(--teal-600);
}

.btn-cancel-order {
  background: var(--color-danger);
  color: white;
  border: none;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-heading);
  transition: all var(--transition-fast);
}

.btn-cancel-order:hover {
  background: #dc2626;
}

/* Pagination */
.table-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  font-size: 0.85rem;
  color: var(--slate-500);
}

.pagination-info {
  font-weight: 500;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.pagination-controls button {
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border-medium);
  background: var(--bg-card);
  color: var(--slate-600);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all var(--transition-fast);
}

.pagination-controls button:hover:not(:disabled) {
  border-color: var(--teal-500);
  color: var(--teal-600);
}

.pagination-controls button.active {
  background: var(--teal-600);
  color: white;
  border-color: var(--teal-600);
}

.pagination-controls button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Order details modal */
.details-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 900;
}

.details-modal.open {
  display: block;
}

.details-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
}

.details-modal-panel {
  position: relative;
  margin: 2.5rem auto;
  width: min(1100px, calc(100vw - 2rem));
  max-height: calc(100vh - 5rem);
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.details-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border-light);
  background: linear-gradient(120deg, var(--teal-700), var(--teal-600));
  color: #fff;
}

.details-modal-header h2 {
  color: #fff;
  font-size: 1rem;
  margin: 0;
}

.details-close {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.2rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
}

.details-modal-body {
  overflow: auto;
  padding: 1rem;
  background: #F8FAFC;
}

.details-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
}

.details-hero h3 {
  margin: 0;
  font-size: 1rem;
}

.details-hero p {
  margin: 0.2rem 0 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.details-hero-right {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.details-grid {
  display: grid;
  gap: 0.9rem;
  margin-bottom: 0.9rem;
}

.details-grid.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.details-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 0.85rem;
  margin-bottom: 0.9rem;
}

.details-card h4 {
  margin-bottom: 0.6rem;
  color: var(--teal-700);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- KPI Boxes ---------- */
.kpi-box {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-left: 4px solid #0EA5A3;
  border-radius: 10px;
  padding: 1rem 1.1rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.kpi-box::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 60px; height: 60px;
  background: radial-gradient(circle, rgba(14,165,163,0.06) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(20px, -20px);
}

.kpi-box:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-2px);
  border-left-width: 4px;
}

.kpi-box.kpi-blue { border-left-color: #3b82f6; }
.kpi-box.kpi-green { border-left-color: #10b981; }
.kpi-box.kpi-teal { border-left-color: #0EA5A3; }
.kpi-box.kpi-primary { border-left-color: #7c3aed; }

.kpi-label {
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #94a3b8;
  margin-bottom: 0.45rem;
}

.kpi-value {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
  letter-spacing: -0.02em;
}

.kpi-value small {
  font-size: 0.55em;
  color: var(--slate-400);
  font-weight: 500;
}

.kpi-days {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
  letter-spacing: -0.02em;
}

/* Performance chart containers */
.perf-chart-wrap {
  position: relative;
  width: 100%;
  height: 180px;
}

/* US Map SVG */
.us-map-svg {
  width: 100%;
  height: auto;
  max-height: 420px;
}
.us-map-state {
  transition: opacity 0.15s, stroke-width 0.15s;
  cursor: default;
}
.us-map-state.has-data {
  cursor: pointer;
}
.us-map-state.has-data:hover {
  opacity: 0.8;
  stroke-width: 2;
  stroke: #0f172a;
}
.us-map-abbr {
  font-family: var(--font-heading);
  font-size: 9px;
  font-weight: 600;
  fill: #94a3b8;
  pointer-events: none;
}
.us-map-abbr-active {
  font-size: 11px;
  font-weight: 800;
  fill: #0f172a;
}
.us-map-orig {
  font-size: 8px;
  font-weight: 700;
  fill: #2563EB;
  pointer-events: none;
}
.us-map-dest {
  font-size: 8px;
  font-weight: 700;
  fill: #10B981;
  pointer-events: none;
}
.us-map-tooltip {
  display: none;
  position: absolute;
  background: #1e293b;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.35rem 0.6rem;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Info tooltip icon — hover for explanation */
.info-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  cursor: help;
  position: relative;
  margin-left: 0.35rem;
  vertical-align: middle;
  flex-shrink: 0;
  line-height: 1;
}
.info-tip:hover {
  background: #0EA5A3;
  color: #fff;
}
/* Info tooltip popover (positioned by JS on body) */
.info-tip-popover {
  position: fixed;
  background: #1e293b;
  color: #f1f5f9;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.5;
  padding: 0.55rem 0.8rem;
  border-radius: 7px;
  max-width: 300px;
  z-index: 9999;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  pointer-events: none;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-body);
}

/* Nav alert badge */
.nav-alert-badge {
  position: absolute;
  top: 6px;
  right: 8px;
  background: #ef4444;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

/* Quick action buttons on Home page */
.quick-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
}
.quick-action-btn:hover {
  border-color: #0EA5A3;
  color: #0EA5A3;
  box-shadow: 0 2px 8px rgba(14,165,163,0.12);
  transform: translateY(-1px);
}
.quick-action-btn svg {
  opacity: 0.6;
}
.quick-action-btn:hover svg {
  opacity: 1;
  stroke: #0EA5A3;
}

/* Customer account selector in sidebar */
.sidebar-customer-selector {
  padding: 0 0.75rem;
  margin-bottom: 0.25rem;
}
.customer-select {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  color: #1e293b;
  background: #f8fafc;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  padding-right: 1.6rem;
}
.customer-select:hover {
  border-color: #0EA5A3;
}
.customer-select:focus {
  border-color: #0EA5A3;
  box-shadow: 0 0 0 3px rgba(14,165,163,0.12);
}

/* ---------- End KPI Boxes ---------- */

/* ---------- Filter Panel Styles ---------- */
.filter-group {
  margin-bottom: 0.75rem;
}

.filter-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate-600);
  margin-bottom: 0.35rem;
}

.filter-input, .filter-select {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--slate-700);
  background: #fff;
  transition: all var(--transition-fast);
}

.filter-input:focus, .filter-select:focus {
  outline: none;
  border-color: #14B8B6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.filter-input::placeholder {
  color: var(--slate-400);
  font-size: 0.78rem;
}

.btn-secondary {
  background: var(--slate-100);
  color: var(--slate-700);
  border: 1px solid var(--slate-300);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-heading);
  transition: all var(--transition-fast);
  text-align: center;
}

.btn-secondary:hover {
  background: var(--slate-200);
  border-color: var(--slate-400);
}
/* ---------- End Filter Panel Styles ---------- */

.details-kv {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.34rem 0;
  border-bottom: 1px dashed var(--border-light);
  font-size: 0.84rem;
}

.details-kv:last-child {
  border-bottom: none;
}

.details-kv span {
  color: var(--text-secondary);
}

.details-kv strong {
  color: var(--text-primary);
  text-align: right;
}

.details-doc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px dashed var(--border-light);
  font-size: 0.84rem;
}

.details-doc-item:last-child {
  border-bottom: none;
}

.details-doc-item a {
  color: var(--teal-700);
  font-weight: 700;
}

.metric-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.metric-chip.good {
  background: var(--color-success-light);
  color: #047857;
}

.metric-chip.late {
  background: var(--color-danger-light);
  color: #b91c1c;
}

.metric-chip.neutral {
  background: var(--slate-100);
  color: var(--slate-600);
}

/* Order Detail — SuperDispatch-style layout */
.od-vehicle-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0 0 1rem;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 1rem;
}
.od-vin {
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0EA5A3;
  letter-spacing: 0.02em;
}
.od-ymm {
  font-size: 1.1rem;
  font-weight: 800;
  color: #1e293b;
  margin-top: 0.15rem;
}
.od-order-id {
  font-size: 0.82rem;
  font-weight: 700;
  color: #64748b;
}
.od-miles {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 0.1rem;
}

/* Route points */
.od-route-points {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.od-route-point {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.od-route-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}
.od-route-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #1e293b;
}
.od-route-date {
  font-size: 0.72rem;
  color: #64748b;
}

/* Delivered badge */
.od-delivered-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #10b981;
  margin-bottom: 1rem;
  padding: 0.5rem 0;
  border-top: 1px solid #e2e8f0;
}
.od-status-badge {
  margin-bottom: 1rem;
  padding: 0.5rem 0;
  border-top: 1px solid #e2e8f0;
}

/* Timeline */
.od-timeline {
  display: flex;
  flex-direction: column;
}
.od-timeline-step {
  display: flex;
  gap: 0.75rem;
}
.od-timeline-track {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 20px;
  flex-shrink: 0;
}
.od-timeline-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.od-timeline-line {
  width: 2px;
  flex: 1;
  min-height: 24px;
}
.od-timeline-content {
  padding-bottom: 1rem;
}
.od-timeline-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e293b;
}
.od-timeline-date {
  font-size: 0.78rem;
  color: #374151;
  margin-top: 0.1rem;
}
.od-timeline-time {
  font-size: 0.72rem;
  color: #64748b;
}
.od-timeline-sub {
  font-size: 0.72rem;
  color: #94a3b8;
  font-style: italic;
}
.od-timeline-address {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 0.15rem;
}

/* Photo grid */
.od-photo-grid {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
}

/* Inspection checklist */
.od-check-item {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.82rem;
}
.od-check-item span {
  color: #64748b;
}
.od-check-item strong {
  font-weight: 700;
}

.photo-grid {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

.photo-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fff;
}

.photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.photo-card span {
  font-size: 0.7rem;
  color: var(--text-secondary);
  padding: 0 0.4rem 0.4rem;
}

.details-loading,
.details-error,
.details-empty {
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 1rem;
  text-align: center;
}

.details-error {
  color: var(--color-danger);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: var(--teal-600);
  color: white;
}
.btn-primary:hover {
  background: var(--teal-700);
  color: white;
}

.btn-secondary {
  background: var(--slate-100);
  color: var(--slate-700);
  border: 1px solid var(--border-medium);
}
.btn-secondary:hover {
  background: var(--slate-200);
}

.btn-danger {
  background: var(--color-danger);
  color: white;
}
.btn-danger:hover {
  background: #dc2626;
}

.btn-lg {
  padding: 0.75rem 2rem;
  font-size: 1rem;
}

.btn-sm {
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
}

/* ---------- Forms ---------- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.4rem;
}

.form-label.required::after {
  content: ' *';
  color: var(--color-danger);
}

.form-control {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--bg-card);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: #14B8B6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.form-control::placeholder {
  color: var(--slate-400);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--slate-400);
  margin-top: 0.3rem;
}

/* Checkboxes */
.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.88rem;
}

.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--teal-600);
  cursor: pointer;
}

/* ---------- Wizard / Stepper ---------- */
.wizard-header {
  background: var(--teal-700);
  color: white;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
}

.wizard-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  gap: 0;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--slate-400);
  position: relative;
}

.wizard-step .step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--slate-200);
  color: var(--slate-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.82rem;
  transition: all var(--transition-base);
}

.wizard-step.active .step-number {
  background: #0EA5A3;
  color: white;
  box-shadow: 0 0 0 4px rgba(14, 165, 163, 0.18);
}

.wizard-step.completed .step-number {
  background: var(--color-success);
  color: white;
}

.wizard-step.active .step-label {
  color: var(--teal-700);
  font-weight: 600;
}

.wizard-step.completed .step-label {
  color: var(--color-success);
}

.wizard-connector {
  width: 50px;
  height: 2px;
  background: var(--slate-200);
  margin: 0 0.5rem;
}

.wizard-connector.completed {
  background: var(--color-success);
}

.wizard-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
  margin-top: 1.5rem;
}

/* Move type selection */
.move-type-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.move-type-option {
  display: block;
  padding: 1rem 1.5rem;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  text-align: center;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--slate-700);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.move-type-option:hover {
  border-color: var(--teal-400);
  background: var(--teal-50);
  color: var(--teal-700);
  transform: translateY(-1px);
}

.move-type-option.selected {
  border-color: var(--teal-600);
  background: var(--teal-50);
  color: var(--teal-700);
  box-shadow: 0 0 0 3px rgba(14, 165, 163, 0.12);
}

/* Wizard tabs (Pickup/Delivery location tabs) */
.wizard-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.wizard-tab {
  padding: 0.6rem 1.25rem;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--slate-500);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  transition: all var(--transition-fast);
}

.wizard-tab:hover {
  color: var(--teal-600);
}

.wizard-tab.active {
  color: var(--teal-700);
  border-bottom-color: var(--teal-600);
  font-weight: 600;
}

/* ---------- Vehicle Table (Wizard) ---------- */
.vehicle-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 1rem;
}

.vehicle-table th {
  background: var(--slate-50);
  padding: 0.6rem 0.75rem;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--slate-600);
  text-align: left;
  border-bottom: 2px solid var(--border-light);
}

.vehicle-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

/* ---------- Section Header (blue bars) ---------- */
.section-header {
  background: var(--teal-700);
  color: white;
  padding: 0.65rem 1.25rem;
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.section-body {
  border: 1px solid var(--border-light);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 1.5rem;
  background: var(--bg-card);
}

/* ---------- Order Review ---------- */
.review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.review-block h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate-400);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.review-block p {
  font-size: 0.9rem;
  color: var(--slate-700);
  line-height: 1.7;
}

.review-block .edit-link {
  font-size: 0.78rem;
  color: var(--teal-600);
  cursor: pointer;
  font-weight: 600;
}

.review-total {
  text-align: right;
  padding: 1rem 0;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--slate-900);
}

/* ---------- Get a Quote ---------- */
.quote-container {
  max-width: 700px;
  margin: 0 auto;
}

.quote-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 1.5rem 0;
}

.quote-help {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.82rem;
  color: var(--slate-500);
}

/* ---------- Check Status ---------- */
.status-check-container {
  max-width: 600px;
  margin: 3rem auto;
  text-align: center;
}

.status-check-container h1 {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--slate-800);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.status-check-container .subtitle {
  color: var(--slate-500);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.status-check-container .hint {
  color: var(--slate-400);
  font-size: 0.88rem;
  margin-bottom: 2rem;
}

.vin-input-wrapper {
  margin-bottom: 1.25rem;
}

.vin-input {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1.1rem;
  font-family: var(--font-heading);
  font-weight: 600;
  background: var(--slate-800);
  color: white;
  border: 2px solid var(--slate-700);
  border-radius: var(--radius-lg);
  letter-spacing: 0.05em;
  transition: border-color var(--transition-fast);
}

.vin-input::placeholder {
  color: var(--slate-400);
  font-weight: 400;
}

.vin-input:focus {
  outline: none;
  border-color: #14B8B6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.18);
}

.btn-get-status {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
  font-family: var(--font-heading);
  font-weight: 700;
  background: var(--teal-600);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.btn-get-status:hover {
  background: var(--teal-700);
  transform: translateY(-1px);
}

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.82rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* ---------- Document Notice ---------- */
.notice {
  background: var(--color-warning-light);
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  font-size: 0.85rem;
}

.notice-title {
  font-family: var(--font-heading);
  font-weight: 700;
  color: #b45309;
  margin-bottom: 0.3rem;
}

.notice ul {
  margin-top: 0.5rem;
  padding-left: 1.25rem;
  color: var(--slate-600);
}

.notice li {
  margin-bottom: 0.2rem;
}

/* ---------- Footer ---------- */
.page-footer {
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid var(--border-light);
  margin-top: 2rem;
  font-size: 0.78rem;
  color: var(--slate-400);
}

.page-footer a {
  color: var(--slate-500);
  margin: 0 0.5rem;
}

.page-footer a:hover {
  color: var(--teal-600);
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-in {
  animation: fadeInUp 0.4s ease both;
}

.animate-in-delay-1 { animation-delay: 0.05s; }
.animate-in-delay-2 { animation-delay: 0.1s; }
.animate-in-delay-3 { animation-delay: 0.15s; }
.animate-in-delay-4 { animation-delay: 0.2s; }
.animate-in-delay-5 { animation-delay: 0.25s; }

/* Step content transitions */
.wizard-step-content {
  animation: fadeIn 0.3s ease;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .dashboard-grid,
  .dashboard-grid-2 {
    grid-template-columns: 1fr;
  }

  .main-nav {
    padding: 0 1rem;
  }

  .nav-links a {
    font-size: 0.72rem;
    padding: 0 0.5rem;
  }

  .review-grid {
    grid-template-columns: 1fr;
  }

  .quote-form-grid {
    grid-template-columns: 1fr;
  }

  .details-grid.two-up {
    grid-template-columns: 1fr;
  }

  .details-modal-panel {
    margin: 0.5rem auto;
    max-height: calc(100vh - 1rem);
    width: calc(100vw - 1rem);
  }

  .details-kv {
    flex-direction: column;
    gap: 0.15rem;
  }

  .details-kv strong {
    text-align: left;
  }
}

/* ---------- Tags ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--teal-100);
  color: var(--teal-700);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
}

.tag-remove {
  background: none;
  border: none;
  color: var(--teal-600);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  margin-left: 0.15rem;
  transition: color var(--transition-fast);
}

.tag-remove:hover {
  color: var(--color-danger);
}

/* ---------- Action Buttons ---------- */
.btn-action {
  background: none;
  border: 1px solid var(--border-medium);
  color: var(--slate-500);
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-action:hover {
  border-color: var(--teal-600);
  color: var(--teal-600);
  background: var(--teal-50);
}

/* ---------- Status Badges ---------- */
.status-badge.status-primary {
  background: var(--teal-100);
  color: var(--teal-700);
}

.status-badge.status-inactive {
  background: var(--slate-100);
  color: var(--slate-500);
}

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.125rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--slate-400);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--slate-100);
  color: var(--slate-700);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* ---------- Form Styles ---------- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--slate-700);
  margin-bottom: 0.5rem;
}

.form-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-family: var(--font-body);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: #14B8B6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.btn-secondary {
  background: var(--slate-100);
  color: var(--slate-700);
  border: 1px solid var(--border-medium);
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-heading);
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--slate-200);
}

/* ============================================
   Role Badge & Switcher
   ============================================ */
.role-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 10px;
  border: 1px solid;
  letter-spacing: 0.03em;
  margin-left: 0.35rem;
  vertical-align: middle;
  white-space: nowrap;
}

.role-switcher-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #1E293B;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.4);
  min-width: 200px;
  z-index: 9999;
  overflow: hidden;
  padding: 0.4rem;
}

.role-switcher-menu.open { display: block; }

.role-switcher-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.4);
  padding: 0.35rem 0.5rem 0.25rem;
}

.role-switch-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.45rem 0.65rem;
  background: none;
  border: none;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}

.role-switch-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
.role-switch-btn.active { background: rgba(255,255,255,0.1); color: #fff; }

.role-switch-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============================================
   Sidebar Layout — App Shell (Option A)
   ============================================ */

/* Portal layout body class — added by sidebar.js */
body.portal-layout {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ── App Header (52px white bar) ── */
.app-header {
  height: 56px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  flex-shrink: 0;
  border-bottom: none;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  z-index: 200;
  gap: 1rem;
}

.app-logo {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}
.app-logo > span:first-child { color: #2DD4D2; filter: drop-shadow(0 0 6px rgba(45,212,210,0.4)); }

.header-center { flex: 1; display: flex; justify-content: center; }

.header-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 0.4rem 0.85rem;
  color: rgba(255,255,255,0.5);
  font-size: 0.8rem;
  font-family: inherit;
  width: 320px;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}
.header-search:hover { background: rgba(255,255,255,0.12); border-color: rgba(45,212,210,0.3); color: rgba(255,255,255,0.7); }
.header-search svg { flex-shrink: 0; opacity: 0.6; }

.header-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.header-contact {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.55);
  white-space: nowrap;
  padding-right: 0.6rem;
  border-right: 1px solid rgba(255,255,255,0.1);
}

.header-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}
.header-icon-btn:hover { background: rgba(45,212,210,0.15); color: #2DD4D2; border-color: rgba(45,212,210,0.3); }

.notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  background: #EF4444;
  border-radius: 50%;
  border: 1.5px solid #ffffff;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  color: #374151;
  transition: background 0.15s;
}
.header-user:hover { background: #F0FDFD; }

.header-avatar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #0EA5A3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.header-user-name {
  font-size: 0.8rem;
  color: #374151;
  font-weight: 500;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── App Shell (sidebar + content) ── */
.app-shell {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
  width: 230px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-nav { padding: 0.6rem 0.5rem; flex: 1; }

.nav-section-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #94a3b8;
  padding: 0.75rem 0.75rem 0.35rem;
  margin-top: 0.15rem;
}
.nav-section-label:first-child { margin-top: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  border-left: none;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.15s ease;
  margin: 1px 0;
  position: relative;
}
.nav-item:hover {
  background: #ffffff;
  color: #0d8f8d;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transform: translateX(2px);
}
.nav-item.active {
  background: linear-gradient(135deg, #0EA5A3, #0D8F8D);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(14,165,163,0.3);
}
.nav-item svg { flex-shrink: 0; opacity: 0.55; transition: opacity 0.15s; }
.nav-item.active svg { opacity: 1; }
.nav-item:hover svg { opacity: 0.9; }

.nav-badge {
  margin-left: auto;
  background: #CCFBFB;
  color: #0D8F8D;
  font-size: 0.67rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 10px;
  line-height: 1.4;
}
.nav-badge.red { background: #FEE2E2; color: #DC2626; }

/* ── Sidebar Footer (user card) ── */
.sidebar-footer {
  padding: 0.75rem 0.65rem;
  border-top: 1px solid #e2e8f0;
  margin-top: auto;
  background: rgba(255,255,255,0.5);
}

.sidebar-footer-user {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem;
  border-radius: 8px;
  transition: background 0.15s;
}
.sidebar-footer-user:hover { background: rgba(255,255,255,0.8); }

.sf-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #0EA5A3, #14B8B6);
  border: none;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(14,165,163,0.25);
}

.sf-info { min-width: 0; }
.sf-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sf-role {
  font-size: 0.7rem;
  color: #9CA3AF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sf-logout { display: none; }

.sf-logout-icon {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
}
.sf-logout-icon svg { width: 15px; height: 15px; }
.sf-logout-icon:hover { background: #fef2f2; color: #dc2626; border-color: #fca5a5; }

/* ── Main Content Area ── */
.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  padding: 1.5rem 2rem;
  background: linear-gradient(180deg, #f1f5f9 0%, #e8ecf1 100%);
  min-width: 0;
  animation: fadeInContent 0.3s ease;
}

@keyframes fadeInContent {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Mobile hamburger toggle ── */
.mobile-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.mobile-menu-btn:hover { background: rgba(255,255,255,0.15); }
.mobile-menu-btn svg { pointer-events: none; }

@media (max-width: 768px) {
  .mobile-menu-btn { display: flex; }
  .sidebar {
    position: fixed; left: -240px; top: 56px; bottom: 0; z-index: 300;
    width: 230px; transition: left 0.25s ease; box-shadow: none;
  }
  .sidebar.open { left: 0; box-shadow: 4px 0 24px rgba(0,0,0,0.15); }
  .sidebar-backdrop {
    display: none; position: fixed; inset: 0; top: 56px;
    background: rgba(0,0,0,0.3); z-index: 299;
  }
  .sidebar-backdrop.open { display: block; }
}

/* ── Page Title Bar (inside main-content) ── */
.page-title-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f1f5f9;
}
.page-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.025em;
}
.page-subtitle {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 0.15rem;
  font-weight: 400;
}
.page-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

/* ── Role switcher in sidebar ── */
.sf-role-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  border: 1px solid;
  cursor: pointer;
  background: transparent;
  font-family: inherit;
  margin-top: 0.15rem;
  transition: opacity 0.15s;
}
.sf-role-btn:hover { opacity: 0.8; }

.sf-role-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #1E293B;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 0.4rem 0;
  z-index: 300;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.sf-role-menu.open { display: block; }
.sf-role-menu-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.35);
  padding: 0 0.75rem 0.35rem;
}
.sf-role-menu-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.35rem 0.75rem;
  background: none;
  border: none;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.1s;
}
.sf-role-menu-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sf-role-menu-btn.active { background: rgba(255,255,255,0.1); color: #fff; }
.sf-role-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── VIN Text — consistent across all tables ── */
.vin-text {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #0D8F8D;
}

/* ── Data tables: comfortable padding, no-wrap cells ── */
#scorecardTable th,
#scorecardTable td,
#ordersTable th,
#ordersTable td {
  padding: 0.6rem 0.85rem;
  white-space: nowrap;
}

#scorecardTable,
#ordersTable {
  font-size: 0.85rem;
}

/* ── Card body: proper horizontal scroll container for tables ── */
.card-body-scroll {
  overflow-x: auto;
  overflow-y: visible;
  padding: 0;
  border-top: 1px solid var(--border-light);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  width: 100%;
  box-sizing: border-box;
}

/* ── VIN link & alert bell button ── */
.vin-link { color: var(--teal-600); font-weight: 600; font-family: 'Courier New', monospace; font-size: 0.82rem; text-decoration: none; cursor: pointer; letter-spacing: 0.03em; }
.vin-link:hover { color: var(--teal-700); text-decoration: underline; }
.alert-bell-btn { background: none; border: none; cursor: pointer; font-size: 0.85rem; padding: 0 0 0 4px; color: var(--slate-400); vertical-align: middle; transition: color 0.12s; line-height: 1; }
.alert-bell-btn:hover { color: #7c3aed; }

/* ── Status Timeline ── */
.status-timeline { display: flex; align-items: flex-start; justify-content: space-between; padding: 0.75rem 0.25rem 0.25rem; overflow-x: auto; }
.status-timeline-node { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; min-width: 72px; text-align: center; }
.status-timeline-dot { width: 32px; height: 32px; border-radius: 50%; background: var(--slate-200); color: var(--slate-500); display: flex; align-items: center; justify-content: center; font-size: 0.78rem; font-weight: 700; flex-shrink: 0; }
.status-timeline-node.completed .status-timeline-dot { background: var(--color-success); color: #fff; }
.status-timeline-node.active .status-timeline-dot { background: #0EA5A3; color: #fff; box-shadow: 0 0 0 4px rgba(14,165,163,0.18); }
.status-timeline-label { font-size: 0.7rem; font-weight: 600; color: var(--slate-400); text-transform: uppercase; letter-spacing: 0.04em; }
.status-timeline-node.completed .status-timeline-label { color: var(--color-success); }
.status-timeline-node.active .status-timeline-label { color: #0EA5A3; }
.status-timeline-date { font-size: 0.65rem; color: var(--slate-400); margin-top: 0.1rem; }
.status-timeline-connector { flex: 1; height: 2px; background: var(--slate-200); margin: 0 0.25rem; margin-top: 15px; align-self: flex-start; min-width: 20px; flex-shrink: 1; }
.status-timeline-connector.completed { background: var(--color-success); }

/* ── flatpickr quick range chips ── */
.fp-quick-ranges { display: flex; flex-wrap: wrap; gap: 0.3rem; padding: 0.6rem 0.75rem 0.4rem; border-bottom: 1px solid #e5e7eb; }
.fp-quick-btn { padding: 0.2rem 0.6rem; font-size: 0.75rem; font-weight: 600; border: 1px solid #D1D5DB; border-radius: 999px; background: #f8fafc; color: #374151; cursor: pointer; transition: all 0.1s; font-family: inherit; }
.fp-quick-btn:hover { border-color: #0EA5A3; background: #F0FDFD; color: #0D8F8D; }
.fp-quick-btn.active { border-color: #0EA5A3; background: #0EA5A3; color: #fff; }

/* ── flatpickr trigger input ── */
.fp-trigger-input { background: #fff; border: 1px solid #D1D5DB; border-radius: 6px; padding: 0.35rem 0.75rem 0.35rem 2rem; font-size: 0.82rem; font-family: inherit; font-weight: 600; color: #374151; cursor: pointer; min-width: 180px; background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23374151' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 0.5rem center; }
.fp-trigger-input:hover, .fp-trigger-input:focus { border-color: #0EA5A3; outline: none; }

/* ══════════════════════════════════════════
   Bulk Order Entry (Place Order Redesign)
══════════════════════════════════════════ */
.bulk-step { max-width: 1200px; margin: 0 auto; padding: 1.5rem 0; }
.bulk-step h2 { font-size: 1.35rem; font-weight: 800; color: #111827; margin-bottom: 0.35rem; }
.bulk-step p { font-size: 0.9rem; color: #6B7280; margin-bottom: 1rem; }
.bulk-hint { font-size: 0.78rem; color: #9CA3AF; margin-bottom: 1rem; }
.hidden { display: none !important; }
#bulkVinInput { width: 100%; min-height: 200px; padding: 0.85rem 1rem; border: 1.5px solid #D1D5DB; border-radius: 10px; font-family: 'Courier New', monospace; font-size: 0.88rem; line-height: 1.8; resize: vertical; color: #1F2937; }
#bulkVinInput:focus { border-color: #0EA5A3; outline: none; box-shadow: 0 0 0 3px rgba(14,165,163,0.1); }
.bulk-table-wrap { overflow-x: auto; border: 1px solid #E5E7EB; border-radius: 10px; background: #fff; }
.bulk-order-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.bulk-order-table th { padding: 0.6rem 0.85rem; background: #F8FAFC; text-align: left; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #6B7280; border-bottom: 1px solid #E5E7EB; white-space: nowrap; }
.bulk-order-table td { padding: 0.55rem 0.75rem; border-bottom: 1px solid #F1F5F9; vertical-align: middle; }
.bulk-order-table tr:last-child td { border-bottom: none; }
.bulk-order-table tr:hover td { background: #F8FAFF; }
.bulk-vin-cell { font-family: 'Courier New', monospace; font-weight: 700; color: #0D8F8D; font-size: 0.82rem; white-space: nowrap; }
.bulk-ymm-cell { font-size: 0.82rem; color: #374151; min-width: 140px; }
.bulk-ymm-cell.decoding { color: #9CA3AF; font-style: italic; }
.bulk-select { width: 100%; min-width: 160px; padding: 0.35rem 0.5rem; border: 1px solid #D1D5DB; border-radius: 6px; font-size: 0.82rem; font-family: inherit; cursor: pointer; background: #fff; }
.bulk-select:focus { border-color: #0EA5A3; outline: none; }
.bulk-actions-bar { display: flex; justify-content: space-between; align-items: center; margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid #E5E7EB; }
.bulk-gate-btn { font-size: 0.78rem; padding: 0.3rem 0.7rem; border: 1px solid #D1D5DB; background: #fff; border-radius: 5px; cursor: pointer; color: #374151; white-space: nowrap; transition: all 0.12s; }
.bulk-gate-btn.attached { border-color: #10B981; color: #065F46; background: #ECFDF5; }
.bulk-progress-wrap { margin: 1.5rem 0; }
.bulk-progress-bar { height: 8px; background: #E5E7EB; border-radius: 50px; overflow: hidden; }
.bulk-progress-fill { height: 100%; background: #0EA5A3; border-radius: 50px; transition: width 0.3s ease; }
.bulk-progress-label { font-size: 0.82rem; color: #6B7280; margin-top: 0.4rem; }
.review-bulk-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; margin-bottom: 1.5rem; }
.review-bulk-table th { padding: 0.65rem 1rem; background: #F8FAFC; text-align: left; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #6B7280; border-bottom: 1px solid #E5E7EB; }
.review-bulk-table td { padding: 0.75rem 1rem; border-bottom: 1px solid #F1F5F9; font-size: 0.84rem; }
.order-total-bar { display: flex; justify-content: flex-end; align-items: center; gap: 1rem; padding: 1rem 0; border-top: 2px solid #E5E7EB; margin-bottom: 1.5rem; }
.order-total-label { font-size: 0.9rem; color: #6B7280; font-weight: 600; }
.order-total-amount { font-size: 1.5rem; font-weight: 800; color: #111827; }
.bulk-pstep-bar { display: flex; gap: 0; margin-bottom: 1.5rem; border-radius: 8px; overflow: hidden; border: 1px solid #E5E7EB; }
.bulk-pstep { flex: 1; padding: 0.65rem 1rem; font-size: 0.82rem; font-weight: 600; color: #9CA3AF; background: #F8FAFC; text-align: center; border-right: 1px solid #E5E7EB; }
.bulk-pstep:last-child { border-right: none; }
.bulk-pstep.active { background: #0EA5A3; color: #fff; }
.bulk-pstep.done { background: #ECFDF5; color: #065F46; }

/* ══════════════════════════════════════════
   Executive Dashboard Status Cards & Insights
══════════════════════════════════════════ */
.exec-status-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 1200px) {
  .exec-status-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .exec-status-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.exec-status-card {
  padding: 1.1rem 1rem;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  text-align: center;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.exec-status-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0EA5A3, #14B8B6);
  opacity: 0;
  transition: opacity 0.2s;
}

.exec-status-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.exec-status-card:hover::before {
  opacity: 1;
}

.exec-status-icon {
  font-size: 1.5rem;
  margin-bottom: 0.4rem;
}

.exec-status-count {
  font-size: 2.1rem;
  font-weight: 900;
  line-height: 1;
  margin: 0.3rem 0;
  letter-spacing: -0.02em;
}

.exec-status-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6B7280;
}

.exec-status-card.status-blue .exec-status-count { color: #0D8F8D; }
.exec-status-card.status-blue { border-top: 3px solid #0EA5A3; }

.exec-status-card.status-amber .exec-status-count { color: #B45309; }
.exec-status-card.status-amber { border-top: 3px solid #F59E0B; }

.exec-status-card.status-green .exec-status-count { color: #065F46; }
.exec-status-card.status-green { border-top: 3px solid #10B981; }

.exec-status-card.status-orange .exec-status-count { color: #C2410C; }
.exec-status-card.status-orange { border-top: 3px solid #EA580C; }

.exec-status-card.status-red .exec-status-count { color: #991B1B; }
.exec-status-card.status-red { border-top: 3px solid #DC2626; }

.exec-status-card.status-slate .exec-status-count { color: #374151; }
.exec-status-card.status-slate { border-top: 3px solid #6B7280; }

/* ── Location bar charts ── */
.loc-bar-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.loc-bar-name {
  font-size: 0.82rem;
  color: #374151;
  min-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loc-bar-track {
  flex: 1;
  height: 8px;
  background: #F1F5F9;
  border-radius: 50px;
  overflow: hidden;
}

.loc-bar-fill {
  height: 100%;
  background: #0EA5A3;
  border-radius: 50px;
  transition: width 0.4s ease;
}

.loc-bar-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: #6B7280;
  min-width: 20px;
  text-align: right;
}

/* ── Recent activity feed ── */
.activity-feed-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid #F1F5F9;
}

.activity-feed-item:last-child {
  border-bottom: none;
}

.activity-vin {
  font-family: 'Courier New', monospace;
  font-weight: 700;
  font-size: 0.82rem;
  color: #0D8F8D;
  white-space: nowrap;
  flex-shrink: 0;
}

.activity-meta {
  font-size: 0.8rem;
  color: #6B7280;
}

.activity-route {
  font-size: 0.82rem;
  color: #374151;
  margin-top: 0.1rem;
}

.activity-badge-days {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 50px;
  background: #ECFDF5;
  color: #065F46;
  white-space: nowrap;
  margin-left: auto;
  flex-shrink: 0;
}

/* Real-time pricing in place-order */
.price-calculating {
  color: #9CA3AF !important;
  font-style: italic;
  opacity: 0.75;
}

/* ══════════════════════════════════════════
   HQ Compact Operational Status Bar
══════════════════════════════════════════ */
.ops-bar {
  display: flex;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  overflow: hidden;
}
.ops-bar-item {
  flex: 1;
  padding: 0.9rem 0.75rem;
  text-align: center;
  border-right: 1px solid #F1F5F9;
  transition: background 0.12s;
}
.ops-bar-item:last-child { border-right: none; }
.ops-bar-item:hover { background: #F8FAFC; }
.ops-bar-num {
  font-size: 1.7rem;
  font-weight: 900;
  color: #111827;
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 0.25rem;
}
.ops-bar-lbl {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #9CA3AF;
}
.ops-bar-item.ops-dispatched .ops-bar-num { color: #B45309; }
.ops-bar-item.ops-inroute    .ops-bar-num { color: #0D8F8D; }
.ops-bar-item.ops-delivered  .ops-bar-num { color: #047857; }
.ops-bar-item.ops-onhold     .ops-bar-num { color: #C2410C; }
.ops-bar-item.ops-claims     .ops-bar-num { color: #7F1D1D; }

/* ══════════════════════════════════════════
   Week over Week Comparison Panel
══════════════════════════════════════════ */
.wow-panel {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  overflow: hidden;
}
.wow-panel-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 1.25rem;
  background: #F8FAFC;
  border-bottom: 1px solid #E5E7EB;
}
.wow-panel-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #374151;
}
.wow-period-lbl {
  font-size: 0.78rem;
  color: #6B7280;
}
.wow-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}
.wow-tbl th {
  padding: 0.45rem 1.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9CA3AF;
  border-bottom: 1px solid #F1F5F9;
  text-align: left;
  background: #FAFAFA;
}
.wow-tbl td {
  padding: 0.6rem 1.25rem;
  color: #374151;
  border-bottom: 1px solid #F9FAFB;
  font-variant-numeric: tabular-nums;
}
.wow-tbl tr:last-child td { border-bottom: none; }
.wow-metric-lbl { font-weight: 600; color: #111827; }
.wow-delta { font-weight: 700; font-size: 0.82rem; }
.wow-delta.wow-pos { color: #059669; }
.wow-delta.wow-neg { color: #DC2626; }
.wow-delta.wow-neu { color: #9CA3AF; font-weight: 400; }

.comp-toggle-btn {
  background: none;
  border: 1px solid #E5E7EB;
  border-radius: 5px;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  color: #6B7280;
  cursor: pointer;
  transition: all 0.12s;
  line-height: 1;
}
.comp-toggle-btn:hover { border-color: #9CA3AF; color: #374151; }

/* ─── Mobile Responsive Improvements ─────────────────────────────────────── */
@media (max-width: 768px) {
  .app-header { padding: 0 0.75rem; }
  .app-logo { font-size: 0.82rem; }
  .header-center { display: none; }
  .header-contact { display: none; }
  .page-title-bar { flex-direction: column; gap: 0.75rem; align-items: flex-start; }
  .page-actions { width: 100%; display: flex; gap: 0.5rem; }
  .page-actions .btn-export { flex: 1; font-size: 0.72rem; padding: 0.4rem 0.6rem; }
  .table-controls { flex-direction: column; gap: 0.5rem; }
  .data-table th, .data-table td { padding: 0.4rem 0.5rem; font-size: 0.72rem; white-space: nowrap; }
  .tab-nav { flex-wrap: wrap; }
  .tab-nav a { font-size: 0.7rem; padding: 0.4rem 0.6rem; }
  .main-content { padding: 1rem !important; }
}

/* ─── Skeleton / Shimmer Loading ─────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-row { display: flex; gap: 0.75rem; padding: 0.75rem 1rem; border-bottom: 1px solid #F3F4F6; }
.skeleton-cell { height: 14px; border-radius: 4px; }
.skeleton-cell.w-sm { width: 50px; }
.skeleton-cell.w-md { width: 100px; }
.skeleton-cell.w-lg { width: 160px; }
.skeleton-cell.w-xl { width: 200px; }

/* ─── Empty State ────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: #9CA3AF;
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1rem;
  font-weight: 600;
  color: #6B7280;
  margin-bottom: 0.35rem;
}

.empty-state-text {
  font-size: 0.82rem;
  color: #9CA3AF;
}

/* Toast notification animation */
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ─── Mobile Responsive — New Sections ─────────────────────────────────── */
@media (max-width: 768px) {
  /* Quick actions wrap on small screens */
  .quick-action-btn {
    font-size: 0.75rem;
    padding: 0.4rem 0.7rem;
  }

  /* KPI grids → 2 columns on mobile */
  .card-body > [style*="grid-template-columns: repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .card-body > [style*="grid-template-columns: repeat(5"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Chart grids → single column */
  [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Performance chart height on mobile */
  .perf-chart-wrap {
    height: 160px;
  }

  /* State map reduce height */
  .us-map-svg {
    max-height: 280px;
  }

  /* Order detail timeline on mobile */
  .od-vehicle-header {
    flex-direction: column;
    gap: 0.5rem;
  }
  .od-vehicle-header > div:last-child {
    text-align: left;
  }

  /* Ops bar on mobile */
  .ops-bar {
    flex-wrap: wrap;
  }
  .ops-bar-item {
    min-width: calc(33% - 0.5rem);
  }

  /* Tab nav scroll on mobile */
  .tab-nav {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
}

