/* ==========================================================================
   ApexDeliver™ Enterprise Logistics Design System & Core CSS
   ========================================================================== */

:root {
  /* Core Color Palette */
  --primary-900: #0f172a;
  --primary-800: #1e293b;
  --primary-700: #334155;
  --primary-600: #475569;
  --primary-500: #64748b;
  --primary-400: #94a3b8;
  --primary-300: #cbd5e1;
  --primary-200: #e2e8f0;
  --primary-100: #f1f5f9;
  --primary-50:  #f8fafc;

  /* Brand Accents */
  --brand-blue: #2563eb;
  --brand-blue-hover: #1d4ed8;
  --brand-blue-light: #eff6ff;
  --brand-cyan: #0284c7;

  /* Semantic Status Colors */
  --status-placed-bg: #f1f5f9;
  --status-placed-text: #475569;
  --status-placed-border: #cbd5e1;

  --status-picked-bg: #eff6ff;
  --status-picked-text: #1d4ed8;
  --status-picked-border: #bfdbfe;

  --status-hub-bg: #f5f3ff;
  --status-hub-text: #6d28d9;
  --status-hub-border: #ddd6fe;

  --status-transit-bg: #fffbeb;
  --status-transit-text: #b45309;
  --status-transit-border: #fde68a;

  --status-delivered-bg: #ecfdf5;
  --status-delivered-text: #047857;
  --status-delivered-border: #a7f3d0;

  --status-failed-bg: #fef2f2;
  --status-failed-text: #b91c1c;
  --status-failed-border: #fecaca;

  --status-rto-bg: #fff1f2;
  --status-rto-text: #be123c;
  --status-rto-border: #fecdd3;

  /* UI Tokens */
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #0f172a;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 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-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

  /* Geometry */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', var(--font-sans);
  --font-mono: 'JetBrains Mono', monospace;
}

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

html, body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.hidden, [hidden] {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

/* Base Layout Structure */
.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
}

/* ==========================================================================
   TOP HEADER NAVIGATION
   ========================================================================== */
.app-header {
  height: 64px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-header-logo-img {
  height: 38px;
  max-width: 140px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.06));
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--primary-900);
  line-height: 1.1;
}

.brand-dot {
  color: var(--brand-blue);
}

.brand-tag {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* Header Center Search */
.header-center {
  flex: 1;
  max-width: 480px;
  margin: 0 24px;
}

.global-search-wrapper {
  position: relative;
  width: 100%;
}

.global-search-wrapper input {
  width: 100%;
  height: 40px;
  padding: 0 40px 0 38px;
  background: var(--primary-100);
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  color: var(--text-main);
  transition: all 0.2s ease;
}

.global-search-wrapper input:focus {
  background: #ffffff;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  outline: none;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-shortcut {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  padding: 2px 6px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.search-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  max-height: 380px;
  overflow-y: auto;
  z-index: 1000;
}

.search-result-item {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.15s ease;
}

.search-result-item:hover {
  background: var(--primary-50);
}

/* Header Right Actions */
.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.role-switcher-container {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.role-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.role-select {
  border: none;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary-900);
  cursor: pointer;
  outline: none;
}

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

.user-profile-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
  background: var(--primary-50);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-800);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

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

.user-name {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.1;
}

.user-role-label {
  font-size: 0.68rem;
  color: var(--brand-blue);
  font-weight: 600;
}

/* ==========================================================================
   APP BODY & SIDEBAR
   ========================================================================== */
.app-body {
  display: flex;
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

.app-sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  color: var(--primary-300);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 90;
}

.app-sidebar.collapsed {
  width: 0;
  transform: translateX(-100%);
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--primary-500);
  padding: 12px 12px 4px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  color: var(--primary-300);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.nav-item.active {
  background: var(--brand-blue);
  color: #ffffff;
  font-weight: 600;
}

.nav-badge {
  margin-left: auto;
  padding: 2px 7px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
}

.nav-badge.pulse-dot {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.nav-badge.alert-bg {
  background: #f59e0b;
  color: #ffffff;
}

.nav-badge.success-bg {
  background: #10b981;
  color: #ffffff;
}

.highlight-nav {
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(37, 99, 235, 0.3);
}

.sidebar-status-card {
  margin-top: auto;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 0.75rem;
}

.status-indicator-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #ffffff;
}

.pulse-green {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.4);
}

.status-meta {
  display: flex;
  justify-content: space-between;
  color: var(--primary-400);
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

/* ==========================================================================
   MAIN CONTENT CONTAINER
   ========================================================================== */
.app-main {
  flex: 1;
  display: block;
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px 32px 40px;
  background: var(--bg-app);
  position: relative;
  -webkit-overflow-scrolling: touch;
}

.content-view {
  display: none;
  width: 100%;
  min-height: min-content;
  animation: fadeIn 0.2s ease-in-out;
}

.content-view.active {
  display: block;
}

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

/* View Header */
.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.view-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--primary-900);
}

.view-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 2px;
}

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

/* ==========================================================================
   BUTTONS & FORM CONTROLS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--brand-blue);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  background: var(--brand-blue-hover);
}

.btn-secondary {
  background: #ffffff;
  border-color: var(--border-color);
  color: var(--primary-800);
}

.btn-secondary:hover {
  background: var(--primary-50);
  border-color: var(--primary-300);
}

.btn-ghost {
  background: transparent;
  color: var(--primary-700);
}

.btn-ghost:hover {
  background: var(--primary-100);
}

.btn-success {
  background: #10b981;
  color: white;
}

.btn-success:hover {
  background: #059669;
}

.btn-danger {
  background: #ef4444;
  color: white;
}

.btn-danger-outline {
  background: transparent;
  border-color: #fca5a5;
  color: #dc2626;
}

.btn-danger-outline:hover {
  background: #fef2f2;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-xs {
  padding: 4px 8px;
  font-size: 0.72rem;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 1rem;
}


.icon-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--primary-700);
  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  background: var(--primary-100);
  color: var(--primary-900);
}

.icon-btn.relative {
  position: relative;
}

.badge-counter {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   FAST SINGLE SCREEN ZERO-SCROLL ORDER BOOKING CONSOLE
   ========================================================================== */
.fast-booking-wrapper {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 14px;
  align-items: stretch;
}

.fast-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fast-card-header {
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fast-card-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-900);
}

.fast-card-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

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

.compact-form-row.cols-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.compact-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.compact-group label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary-700);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.inline-add-link {
  font-size: 0.7rem;
  color: var(--brand-blue);
  font-weight: 700;
  cursor: pointer;
}

.inline-add-link:hover {
  text-decoration: underline;
}

.compact-input {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  background: #ffffff;
  color: var(--primary-900);
  outline: none;
  width: 100%;
}

.compact-input:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.compact-input:disabled {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

.action-hero-panel {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.door-total-badge {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-book-hero {
  height: 44px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transition: all 0.15s ease;
  width: 100%;
}

.btn-book-hero:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
  transform: translateY(-1px);
}

.btn-book-hero:active {
  transform: translateY(1px);
}

@media (max-width: 1100px) {
  .fast-booking-wrapper {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   CARDS & STATS GRID
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

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

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

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  min-width: 0;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon-wrapper {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bg-blue-light { background: #eff6ff; color: #2563eb; }
.bg-amber-light { background: #fffbeb; color: #d97706; }
.bg-indigo-light { background: #eef2ff; color: #4f46e5; }
.bg-emerald-light { background: #ecfdf5; color: #059669; }
.bg-purple-light { background: #faf5ff; color: #7c3aed; }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary-900);
  line-height: 1.2;
  margin: 2px 0;
}

.stat-subtext {
  font-size: 0.72rem;
  font-weight: 500;
}

.stat-subtext.positive { color: #059669; }
.text-warning { color: #d97706; }
.text-indigo { color: #4f46e5; }
.text-purple { color: #7c3aed; }
.text-blue { color: #2563eb; }
.text-success { color: #059669; }

/* ==========================================================================
   AUTHENTICATION & AUTHORIZED LOGIN PORTAL
   ========================================================================== */
.auth-portal-wrapper {
  min-height: 100vh;
  background: radial-gradient(circle at 10% 20%, #0f172a 0%, #020617 90%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: fixed;
  inset: 0;
  z-index: 9999;
  overflow-y: auto;
}

.auth-portal-card {
  width: 100%;
  max-width: 980px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  position: relative;
}

.auth-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.1);
  background: #f1f5f9;
  color: #475569;
  font-size: 1.2rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.15s ease;
}

.auth-close-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.auth-mode-tabs {
  display: flex;
  gap: 8px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 8px;
  margin-bottom: 18px;
}

.auth-mode-tab {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.auth-mode-tab.active {
  background: #ffffff;
  color: var(--brand-blue);
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.auth-form-side {
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.auth-brand-logo {
  width: 40px;
  height: 40px;
  background: var(--brand-blue);
  color: #ffffff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary-900);
}

.auth-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: 24px;
}

.auth-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.auth-input-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-700);
}

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

.auth-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.15s ease;
  background: #f8fafc;
}

.auth-input:focus {
  background: #ffffff;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.auth-eye-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.auth-error-alert {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  margin-bottom: 16px;
  display: none;
  align-items: center;
  gap: 8px;
}

.auth-submit-btn {
  height: 46px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transition: all 0.15s ease;
  margin-top: 6px;
}

.auth-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.auth-submit-btn:active {
  transform: translateY(1px);
}

/* DEMO ROLES CREDENTIALS SIDE */
.auth-demo-side {
  background: #0f172a;
  padding: 40px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-demo-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-demo-desc {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-bottom: 18px;
  line-height: 1.4;
}

.auth-roles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.auth-role-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.auth-role-card:hover {
  background: rgba(37, 99, 235, 0.2);
  border-color: #3b82f6;
  transform: translateY(-1px);
}

.auth-role-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.8rem;
  color: #f8fafc;
  margin-bottom: 4px;
}

.auth-role-email {
  font-size: 0.7rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-role-pass {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: #38bdf8;
  margin-top: 2px;
}

.auth-security-notice {
  font-size: 0.7rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* USER PROFILE DROPDOWN */
.user-profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-profile-menu.hidden {
  display: none;
}

.user-menu-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary-800);
  cursor: pointer;
  transition: all 0.15s ease;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
}

.user-menu-item:hover {
  background: var(--primary-50);
}

.user-menu-item.logout {
  color: #dc2626;
}

.user-menu-item.logout:hover {
  background: #fef2f2;
}

@media (max-width: 768px) {
  .auth-portal-card {
    grid-template-columns: 1fr;
  }
  .auth-demo-side {
    padding: 24px;
  }
  .auth-form-side {
    padding: 24px;
  }
  .auth-roles-grid {
    grid-template-columns: 1fr;
  }
  
  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  
  .form-grid > [class*="col-span-"] {
    grid-column: span 1 !important;
    width: 100% !important;
  }
  
  .modal-dialog {
    width: 95vw !important;
    max-height: 94vh !important;
    margin: 10px auto !important;
  }
  
  .modal-body {
    padding: 16px !important;
  }
}

/* Dashboard Grids */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
}

.col-span-1  { grid-column: span 1;  min-width: 0; }
.col-span-2  { grid-column: span 2;  min-width: 0; }
.col-span-3  { grid-column: span 3;  min-width: 0; }
.col-span-4  { grid-column: span 4;  min-width: 0; }
.col-span-5  { grid-column: span 5;  min-width: 0; }
.col-span-6  { grid-column: span 6;  min-width: 0; }
.col-span-7  { grid-column: span 7;  min-width: 0; }
.col-span-8  { grid-column: span 8;  min-width: 0; }
.col-span-9  { grid-column: span 9;  min-width: 0; }
.col-span-10 { grid-column: span 10; min-width: 0; }
.col-span-11 { grid-column: span 11; min-width: 0; }
.col-span-12 { grid-column: span 12; min-width: 0; }

.dashboard-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dashboard-card.margin-top {
  margin-top: 20px;
}

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

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-900);
}

.card-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.card-body {
  padding: 20px;
}

.card-body.no-padding {
  padding: 0;
}

/* Pipeline Funnel */
.pipeline-funnel-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

@media (max-width: 1200px) {
  .pipeline-funnel-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .pipeline-funnel-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .pipeline-funnel-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.funnel-step-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  text-align: center;
  transition: all 0.15s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.funnel-step-card:hover {
  background: #f8fafc;
  border-color: var(--brand-blue);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.funnel-count {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary-900);
  line-height: 1.1;
  margin: 2px 0;
}

.funnel-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--primary-700);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Chart Simulator */
.chart-container-box {
  background: var(--primary-50);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}

.chart-header-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.chart-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-800);
}

.visual-activity-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
  padding-top: 10px;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 6px;
}

.bar-pill {
  width: 100%;
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
  border-radius: 4px 4px 0 0;
  min-height: 6px;
  transition: height 0.4s ease;
}

.bar-time {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* Activity Feed */
.activity-timeline-feed {
  max-height: 380px;
  overflow-y: auto;
  padding: 8px 16px;
}

.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}

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

.activity-icon-bullet {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.activity-content {
  display: flex;
  flex-direction: column;
}

.activity-text {
  font-size: 0.8rem;
  color: var(--primary-900);
}

.activity-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Driver Strip */
.driver-cards-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.driver-mini-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--primary-50);
}

.driver-mini-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.driver-avatar-badge {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--primary-800);
  color: white;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.driver-cards-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  width: 100%;
}

@media (min-width: 1500px) {
  .driver-cards-strip {
    grid-template-columns: repeat(5, 1fr);
  }
}

.driver-mini-card {
  background: #ffffff;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  box-sizing: border-box;
}

.driver-mini-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.08);
  transform: translateY(-2px);
}

.driver-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.driver-card-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.driver-avatar-badge {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 10px;
  background: #1e293b;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.driver-card-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.driver-card-vehicle {
  font-size: 0.72rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.driver-card-vehicle code {
  font-size: 0.68rem;
  font-family: var(--font-mono, monospace);
  background: #f1f5f9;
  padding: 1px 4px;
  border-radius: 4px;
  color: #334155;
}

.driver-status-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.driver-status-pill.online {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.driver-status-pill.offline {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.driver-capacity-box {
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 12px;
}

.driver-capacity-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.73rem;
  margin-bottom: 6px;
}

.driver-capacity-meta .load-text {
  color: #475569;
  font-weight: 500;
}

.driver-capacity-meta .load-text strong {
  color: #0f172a;
  font-weight: 700;
}

.driver-capacity-meta .pct-text {
  font-weight: 800;
  font-family: var(--font-mono, monospace);
  font-size: 0.76rem;
}

.driver-load-progress {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}

.driver-load-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.driver-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #f1f5f9;
  padding-top: 10px;
  gap: 6px;
}

.driver-hub-tag {
  font-size: 0.72rem;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.driver-hub-tag strong {
  color: #334155;
  font-weight: 600;
}

.driver-actions-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.driver-actions-group .btn-xs {
  padding: 4px 9px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 6px;
}

.dash-analytics-tab.active {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
}

.dash-tab-pane {
  animation: fadeIn 0.2s ease-in-out;
}

.zone-stat-pill {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  transition: all 0.15s ease;
}

.zone-stat-pill:hover {
  border-color: #3b82f6;
  background: #eff6ff;
  transform: translateY(-2px);
}

/* ==========================================================================
   DATA TABLES & FILTER BARS
   ========================================================================== */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.filter-tabs-container {
  margin-bottom: 16px;
  overflow-x: auto;
}

.filter-tabs {
  display: inline-flex;
  background: var(--primary-100);
  padding: 4px;
  border-radius: var(--radius-md);
  gap: 4px;
}

.filter-tab {
  border: none;
  background: transparent;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary-600);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.filter-tab.active {
  background: #ffffff;
  color: var(--brand-blue);
  box-shadow: var(--shadow-sm);
}

.tab-count {
  padding: 1px 6px;
  background: var(--primary-200);
  border-radius: var(--radius-full);
  font-size: 0.7rem;
}

.filter-tab.active .tab-count {
  background: var(--brand-blue-light);
  color: var(--brand-blue);
}

.table-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-box input {
  width: 100%;
  height: 38px;
  padding: 0 14px 0 34px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  background: #ffffff;
  outline: none;
}

.search-box input:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

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

.table-select {
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  background: #ffffff;
  color: var(--primary-800);
  outline: none;
  cursor: pointer;
}

.table-select.sm {
  height: 32px;
  font-size: 0.75rem;
}

.bulk-actions-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 4px 12px;
  border-radius: var(--radius-md);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.data-table thead tr {
  background: var(--primary-50);
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  padding: 12px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary-600);
  white-space: nowrap;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.12s ease;
}

.data-table tbody tr:hover {
  background: #f8fafc;
}

.data-table td {
  padding: 12px 16px;
  color: var(--primary-800);
  vertical-align: middle;
}

.text-right {
  text-align: right;
}

/* Status Badges */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 0.73rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-placed, .status-order_placed, .status-tobepickup { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.status-pickup_assigned { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.status-picked_up { background: #e0e7ff; color: #4338ca; border: 1px solid #c7d2fe; }
.status-at_hub { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.status-in_warehouse { background: #ede9fe; color: #6d28d9; border: 1px solid #ddd6fe; }
.status-customs_hold { background: #ffedd5; color: #c2410c; border: 1px solid #fed7aa; }
.status-out_for_delivery { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }
.status-rescheduled { background: #fef9c3; color: #854d0e; border: 1px solid #fef08a; }
.status-delivered { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.status-failed { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.status-rto { background: #ffe4e6; color: #9f1239; border: 1px solid #fecdd3; }
.status-returned_to_merchant { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.status-cancelled { background: #fee2e2; color: #dc2626; border: 1px solid #fca5a5; font-weight: 700; }

/* Driver Status Badges */
.drv-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}
.drv-status-unassigned { background: #f1f5f9; color: #64748b; border: 1px solid #cbd5e1; }
.drv-status-assigned { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.drv-status-accepted { background: #e0e7ff; color: #4338ca; border: 1px solid #c7d2fe; }
.drv-status-en_route { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.drv-status-arrived { background: #f5f3ff; color: #7c3aed; border: 1px solid #ddd6fe; }
.drv-status-delivered_collected { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.drv-status-delivery_failed { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.drv-status-settled_vault { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

.table-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--primary-50);
}

.table-info {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.pagination-controls {
  display: flex;
  gap: 6px;
}

/* ==========================================================================
   DISPATCH BOARD & FLEET
   ========================================================================== */
.dispatch-board-layout {
  display: grid;
  grid-template-columns: minmax(320px, 390px) 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 1024px) {
  .dispatch-board-layout {
    grid-template-columns: 1fr;
  }
}

.dispatch-column {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.col-title-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.col-title-badge h3 {
  font-size: 0.88rem;
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
}

.status-dot-amber { width: 8px; height: 8px; background: #f59e0b; border-radius: 50%; flex-shrink: 0; }
.status-dot-green { width: 8px; height: 8px; background: #10b981; border-radius: 50%; flex-shrink: 0; }

.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.queue-filter {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.queue-filter select {
  max-width: 130px;
  width: auto;
  box-sizing: border-box;
  font-size: 0.76rem;
  height: 30px;
  padding: 0 6px;
}

.unassigned-orders-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 650px;
  overflow-y: auto;
}

.order-dispatch-card {
  background: var(--primary-50);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.15s ease;
}

.order-dispatch-card:hover {
  border-color: var(--brand-blue);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

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

.awb-code {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--brand-blue);
}

.zone-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  background: #e0e7ff;
  color: #3730a3;
  border-radius: 4px;
}

.driver-roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.driver-capacity-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--primary-50);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.driver-meta-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.driver-load-progress {
  width: 100%;
  height: 6px;
  background: var(--primary-200);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--brand-blue);
  transition: width 0.3s ease;
}

/* ==========================================================================
   DRIVER COMPANION MOBILE SIMULATOR
   ========================================================================== */
.driver-simulator-container {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 32px;
  align-items: start;
}

.mobile-phone-frame {
  width: 360px;
  height: 680px;
  background: #0f172a;
  border-radius: 36px;
  padding: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  border: 4px solid #334155;
  display: flex;
  flex-direction: column;
}

.phone-notch {
  width: 120px;
  height: 18px;
  background: #1e293b;
  border-radius: 0 0 12px 12px;
  margin: 0 auto 6px;
}

.phone-screen {
  flex: 1;
  background: #f8fafc;
  border-radius: 26px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mobile-app-header {
  background: #0f172a;
  color: white;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-driver-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.driver-avatar-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand-blue);
  color: white;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.driver-name-text {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.2;
}

.driver-status-badge {
  font-size: 0.65rem;
  color: #38bdf8;
}

.mobile-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #ffffff;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border-color);
  text-align: center;
}

.m-stat-val {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
}

.m-stat-lbl {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.mobile-tabs {
  display: flex;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
}

.mobile-tab {
  flex: 1;
  padding: 8px;
  border: none;
  background: transparent;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-500);
  cursor: pointer;
}

.mobile-tab.active {
  color: var(--brand-blue);
  border-bottom: 2px solid var(--brand-blue);
}

.mobile-stops-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.m-stop-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}

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

.m-stop-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.driver-guide-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.guide-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 16px 0;
}

.guide-step {
  display: flex;
  gap: 14px;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-blue-light);
  color: var(--brand-blue);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.tip-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 0.82rem;
  color: #166534;
}

/* ==========================================================================
   LIVE MAP & TERRITORY RADAR
   ========================================================================== */
.interactive-map-container {
  position: relative;
  background: #0f172a;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
}

.logistics-map-svg {
  display: block;
  background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
}

.map-sidebar-overlay {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 260px;
}

.overlay-card {
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 14px;
  color: white;
}

.map-legend {
  display: flex;
  align-items: center;
  gap: 14px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 500;
}

.map-pin-icon {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.hub-pin { background: #3b82f6; box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.4); }
.rider-pin { background: #10b981; box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.4); }
.parcel-pin { background: #f59e0b; }
.delivered-pin { background: #64748b; }

/* ==========================================================================
   MODALS, DRAWERS & SIGNATURE CANVAS
   ========================================================================== */
.modal-backdrop, .drawer-backdrop, .modal-wrapper {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-backdrop.hidden, 
.drawer-backdrop.hidden, 
.modal-wrapper.hidden, 
.auth-portal-wrapper.hidden,
.modal-backdrop[style*="display: none"],
.modal-backdrop[style*="display:none"],
.modal-wrapper[style*="display: none"],
.modal-wrapper[style*="display:none"] {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPop 0.2s ease-out;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.status-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.status-card-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  user-select: none;
}

.status-card-option:hover {
  border-color: #3b82f6;
  background: #f0f9ff;
  transform: translateY(-1px);
}

.status-card-option.active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.status-card-option[data-status="cancelled"]:hover {
  border-color: #f87171;
  background: #fef2f2;
}

.status-card-option[data-status="cancelled"].active {
  border-color: #dc2626;
  background: #fee2e2;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.25);
}

.status-card-option[data-status="cancelled"].active .status-label {
  color: #b91c1c;
}

.status-card-option .status-icon {
  font-size: 1.25rem;
  margin-bottom: 4px;
}

.status-card-option .status-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #1e293b;
}

.status-card-option.active .status-label {
  color: #1d4ed8;
}

.modal-md { max-width: 580px; }
.modal-lg { max-width: 900px; width: 92vw; }
.modal-xl { max-width: 1080px; width: 95vw; }

/* Bulk Excel & CSV Upload Styles */
.bulk-instructions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.excel-csv-dropzone {
  border: 2px dashed #94a3b8;
  border-radius: var(--radius-lg);
  background: #f8fafc;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.excel-csv-dropzone:hover, .excel-csv-dropzone.dragover {
  border-color: #10b981;
  background: #f0fdf4;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

.supported-badges {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.file-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.excel-badge {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.csv-badge {
  background: #e0f2fe;
  color: #075985;
  border: 1px solid #7dd3fc;
}

.bulk-preview-box {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bulk-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.bulk-stat-pill {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
}

.bulk-stat-pill .stat-title {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.bulk-stat-pill .stat-num {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-900);
  margin-top: 2px;
}

.file-loaded-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #166534;
}

.bulk-table-wrapper {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.compact-table th, .compact-table td {
  padding: 8px 10px;
  font-size: 0.78rem;
}

/* ==========================================================================
   MODERN EXCEL & CSV BULK UPLOAD STYLING (REDESIGNED)
   ========================================================================== */
.bulk-wizard-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
  margin-bottom: 24px;
}

/* Stepper Workflow */
.bulk-stepper-track {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
  position: relative;
}

.bulk-step-pill {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.bulk-step-pill:hover:not(.disabled) {
  border-color: #cbd5e1;
  background: #f1f5f9;
  transform: translateY(-1px);
}

.bulk-step-pill.active {
  background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 100%);
  border-color: #059669;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.15);
}

.bulk-step-pill.completed {
  background: #f0fdf4;
  border-color: #86efac;
}

.bulk-step-pill.disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.bulk-step-pill .step-circle {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.95rem;
  background: #e2e8f0;
  color: #64748b;
  flex-shrink: 0;
  transition: all 0.25s ease;
}

.bulk-step-pill.active .step-circle {
  background: #059669;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.35);
}

.bulk-step-pill.completed .step-circle {
  background: #10b981;
  color: #ffffff;
}

.bulk-step-pill .step-text-wrap {
  display: flex;
  flex-direction: column;
}

.bulk-step-pill .step-sub {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.bulk-step-pill.active .step-sub {
  color: #047857;
}

.bulk-step-pill .step-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: #1e293b;
  margin-top: 1px;
}

.bulk-step-pill.active .step-title {
  color: #065f46;
}

/* Modern Dropzone */
.bulk-modern-dropzone {
  border: 2px dashed #94a3b8;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 46px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.bulk-modern-dropzone:hover, .bulk-modern-dropzone.dragover {
  border-color: #059669;
  background: linear-gradient(180deg, #f0fdf4 0%, #ecfdf5 100%);
  box-shadow: 0 10px 25px -5px rgba(5, 150, 105, 0.12);
  transform: translateY(-2px);
}

.bulk-dropzone-icon-wrap {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.18);
  transition: transform 0.25s ease;
}

.bulk-modern-dropzone:hover .bulk-dropzone-icon-wrap {
  transform: scale(1.08);
}

.bulk-dropzone-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.01em;
}

.bulk-dropzone-desc {
  font-size: 0.85rem;
  color: #64748b;
  max-width: 540px;
  line-height: 1.5;
  margin: 0;
}

.bulk-format-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}

.bulk-format-tag {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-family: var(--font-mono);
}

.bulk-format-tag.highlight {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

/* Quick Demo Manifest Cards Grid */
.demo-manifest-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 14px;
}

@media (max-width: 1100px) {
  .demo-manifest-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .demo-manifest-grid {
    grid-template-columns: 1fr;
  }
  .bulk-stepper-track {
    grid-template-columns: 1fr;
  }
}

.demo-manifest-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  text-align: left;
}

.demo-manifest-card:hover {
  border-color: #059669;
  background: #fdfefe;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px -4px rgba(5, 150, 105, 0.15);
}

.demo-manifest-card.featured {
  border-color: #86efac;
  background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
}

.demo-card-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.demo-card-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.demo-card-info {
  flex: 1;
}

.demo-card-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.3;
}

.demo-card-meta {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 3px;
}

.demo-card-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
  font-size: 0.75rem;
  font-weight: 800;
  color: #059669;
}

/* System Format Specification Redesign */
.schema-spec-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #059669;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.schema-badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 700;
  transition: all 0.15s ease;
}

.schema-badge-chip.required {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #065f46;
}

.schema-badge-chip.optional {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #475569;
}

.schema-badge-chip:hover {
  transform: translateY(-1px);
}

/* Detected File Banner */
.bulk-detected-banner {
  background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 100%);
  border: 1.5px solid #059669;
  border-radius: 14px;
  padding: 18px 22px;
  box-shadow: 0 6px 18px -2px rgba(5, 150, 105, 0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

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

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-900);
}

.modal-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--primary-400);
  cursor: pointer;
}

.modal-close-btn:hover {
  color: var(--primary-900);
}

/* Modal Body & Forms */
.modal-body {
  padding: 24px;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(88vh - 70px);
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
}

.form-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-blue);
  margin-top: 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--primary-200);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.form-group label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.form-input {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--primary-300);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--primary-900);
  background: #ffffff;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  transition: all 0.15s ease-in-out;
}

.form-input:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Input with Prefix (e.g. +971 or http://) */
.input-prefix-group {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--primary-300);
  border-radius: var(--radius-md);
  background: #ffffff;
  overflow: hidden;
  height: 40px;
  box-sizing: border-box;
  transition: all 0.15s ease-in-out;
}

.input-prefix-group:focus-within {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.input-prefix-box {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  background: #f8fafc;
  color: var(--primary-600);
  font-size: 0.8rem;
  font-weight: 700;
  border-right: 1px solid var(--primary-200);
  user-select: none;
  white-space: nowrap;
}

.input-prefix-group .form-input.prefixed {
  border: none;
  border-radius: 0;
  height: 100%;
  padding: 0 10px;
  box-shadow: none;
  flex: 1;
}

.form-footer-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
}

/* ==========================================================================
   ULTRA-PREMIUM SHIPMENT QUICK INSPECTOR & TRACKING BRIEF MODAL
   ========================================================================== */
.shipment-brief-dialog {
  max-width: 980px !important;
  width: 95vw !important;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(15, 23, 42, 0.08);
  background: #f8fafc;
  border: none;
}

.brief-top-header {
  background: linear-gradient(135deg, #090e1a 0%, #111e38 50%, #1e293b 100%);
  color: #ffffff;
  padding: 20px 24px 0 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}

.brief-header-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.1fr 1.4fr;
  gap: 16px;
  align-items: center;
  padding-bottom: 16px;
}

.brief-header-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brief-header-cell.right-align {
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.brief-header-label {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #94a3b8;
  text-transform: uppercase;
}

.brief-tracking-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.brief-awb-val {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.03em;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 3px 8px;
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.15);
}

.brief-copy-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f1f5f9;
  border-radius: 6px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.brief-copy-btn:hover {
  background: rgba(56, 189, 248, 0.3);
  border-color: #38bdf8;
  color: #ffffff;
  transform: scale(1.05);
}

.brief-ref-line {
  font-size: 0.75rem;
  color: #cbd5e1;
  font-weight: 600;
}

.brief-header-stat {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brief-stat-icon {
  font-size: 1.25rem;
  background: rgba(255, 255, 255, 0.08);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.brief-stat-title {
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 700;
}

.brief-stat-val {
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: #f8fafc;
  font-weight: 700;
}

.brief-driver-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 6px 12px;
  backdrop-filter: blur(8px);
}

.brief-driver-text {
  text-align: right;
}

.brief-driver-label {
  font-size: 0.6rem;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.04em;
}

.brief-driver-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
}

.brief-driver-sub {
  font-size: 0.68rem;
  color: #38bdf8;
  font-weight: 600;
}

.brief-driver-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.brief-modal-close {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 1.4rem;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.brief-modal-close:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
  transform: scale(1.05);
}

/* Nav Strip */
.brief-nav-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 14px;
  gap: 10px;
  position: relative;
  overflow: visible !important;
  background: rgba(15, 23, 42, 0.5);
  flex-wrap: nowrap;
}

.brief-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  flex-shrink: 1;
  min-width: 0;
}

.brief-tabs::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.brief-tab-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  height: 32px;
  min-height: 32px;
  max-height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
  box-sizing: border-box;
  line-height: 1;
}

.brief-tab-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

.brief-tab-btn.active {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  color: #ffffff;
  border-color: #38bdf8;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

.brief-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  flex-shrink: 0;
}

.brief-action-btn {
  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
  font-size: 0.74rem !important;
  font-weight: 700 !important;
  padding: 0 11px !important;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
  line-height: 1 !important;
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.15s ease;
  flex-shrink: 0;
}

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

.brief-dropdown {
  position: relative;
  display: inline-block;
}

.brief-btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  border: 1px solid #60a5fa !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35) !important;
}

.brief-btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%) !important;
  border-color: #93c5fd !important;
  color: #ffffff !important;
}

.brief-btn-undo {
  background: rgba(239, 68, 68, 0.15) !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
  color: #fca5a5 !important;
}

.brief-btn-undo:hover {
  background: #ef4444 !important;
  border-color: #ef4444 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4) !important;
}

.brief-btn-danger {
  background: rgba(220, 38, 38, 0.25) !important;
  border: 1px solid rgba(239, 68, 68, 0.5) !important;
  color: #fecaca !important;
}

.brief-btn-danger:hover {
  background: #dc2626 !important;
  border-color: #b91c1c !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.45) !important;
}

.brief-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 15px 30px -5px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.06);
  min-width: 220px;
  z-index: 999999 !important;
  overflow: hidden;
  padding: 5px;
  animation: fadeInDown 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.brief-dropdown-menu.hidden {
  display: none !important;
}

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

.brief-dropdown-menu .dropdown-item {
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary-900);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.brief-dropdown-menu .dropdown-item:hover {
  background: #eff6ff;
  color: #2563eb;
  transform: translateX(3px);
}

/* Modal Body Panes */
.brief-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  max-height: calc(88vh - 140px);
  background: #f8fafc;
}

.brief-tab-pane {
  display: none;
}

.brief-tab-pane.active {
  display: block;
  animation: fadeInPane 0.25s ease-out;
}

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

/* 2x2 Grid for BRIEF tab */
.brief-grid-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.brief-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.04), 0 4px 6px -1px rgba(0, 0, 0, 0.03);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.brief-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px -2px rgba(15, 23, 42, 0.08);
}

.brief-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.brief-avatar {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.brief-avatar.sender-avatar {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

.brief-avatar.recipient-avatar {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
}

.brief-avatar.sm {
  width: 30px;
  height: 30px;
  font-size: 0.72rem;
  border-radius: 8px;
}

.brief-card-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.brief-card-tag {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--primary-500);
  text-transform: uppercase;
}

.brief-party-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary-900);
  margin: 0;
  line-height: 1.25;
}

.brief-phone-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--brand-blue);
  background: #eff6ff;
  padding: 3px 8px;
  border-radius: 6px;
  width: fit-content;
  border: 1px solid #bfdbfe;
}

.brief-phones-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.brief-alt-phone {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 3px 8px;
  border-radius: 6px;
}

.brief-card-body {
  border-top: 1px solid var(--primary-100);
  padding-top: 12px;
}

.brief-addr-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.brief-addr-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.brief-addr-icon.home-icon {
  background: #fff7ed;
  color: #ea580c;
  border: 1px solid #ffedd5;
}

.brief-addr-icon.work-icon {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #dcfce7;
}

.brief-addr-text {
  font-size: 0.84rem;
  color: var(--primary-800);
  line-height: 1.45;
  font-weight: 500;
}

.brief-zone-tag {
  display: inline-block;
  background: #eff6ff;
  color: var(--brand-blue);
  border: 1px solid #bfdbfe;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  margin-top: 6px;
}

.brief-card-section-title {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--primary-900);
  border-bottom: 1px solid var(--primary-100);
  padding-bottom: 8px;
  text-transform: uppercase;
}

/* Specs Grid */
.brief-specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.brief-spec-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 10px;
}

.brief-spec-badge {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 800;
  flex-shrink: 0;
}

.brief-spec-badge.gift-badge { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.brief-spec-badge.service-badge { background: #dbeafe; color: #1d4ed8; font-size: 0.8rem; border: 1px solid #bfdbfe; }
.brief-spec-badge.origin-badge { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.brief-spec-badge.value-badge { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.brief-spec-badge.pay-badge { background: #d1fae5; color: #047857; border: 1px solid #a7f3d0; }

.brief-spec-lbl {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
}

.brief-spec-val {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--primary-900);
}

.brief-spec-val.service-text {
  color: #16a34a;
}

.brief-desc-footer {
  background: #f1f5f9;
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #cbd5e1;
  margin-top: 4px;
}

.brief-desc-val {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-900);
  margin-top: 2px;
}

.brief-pieces-val {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--brand-blue);
}

/* Payment Info Table */
.brief-payment-header-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--primary-100);
}

.brief-finance-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.brief-fin-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr 1fr;
  align-items: center;
  font-size: 0.78rem;
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.brief-fin-row.cod-highlight-row {
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border: 1.5px solid #c4b5fd;
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.1);
}

.fin-lbl {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--primary-600);
}

.fin-val {
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--primary-900);
}

.fin-val.cod-amount {
  color: #7c3aed;
  font-size: 0.95rem;
}

.fin-tot-lbl {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--primary-700);
  text-align: right;
  padding-right: 8px;
}

.fin-tot-val {
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--primary-900);
  text-align: right;
}

.fin-tot-val.grand-total {
  font-size: 1.15rem;
  font-weight: 900;
  color: #7c3aed;
}

/* Timeline Container */
.brief-timeline-container {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.brief-empty-pane {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 48px;
  text-align: center;
  color: var(--primary-900);
}

@media (max-width: 860px) {
  .brief-header-row {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .brief-grid-2x2 {
    grid-template-columns: 1fr;
  }
  .brief-fin-row {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
}

/* Signature Pad Canvas */
.signature-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.signature-canvas-box {
  position: relative;
  border: 2px dashed var(--primary-300);
  border-radius: var(--radius-md);
  background: #ffffff;
  height: 160px;
  overflow: hidden;
}

#signatureCanvas {
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.canvas-placeholder-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-400);
  font-size: 0.8rem;
  pointer-events: none;
}

.cod-confirm-box {
  background: #faf5ff;
  border: 1px solid #e9d5ff;
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cod-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #6b21a8;
}

.photo-upload-box {
  border: 1px dashed var(--primary-300);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
  cursor: pointer;
  background: var(--primary-50);
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   PRINTABLE AIRWAY BILL (AWB) & SHIPPING LABEL
   ========================================================================== */
.shipping-label-card {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  border: 2px solid #000000;
  padding: 14px;
  background: #ffffff;
  color: #000000;
  font-family: var(--font-sans);
  box-shadow: var(--shadow-sm);
}

.label-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #000000;
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.label-brand {
  font-weight: 800;
  font-size: 1.1rem;
}

.label-service-badge {
  border: 1px solid #000000;
  padding: 2px 6px;
  font-weight: 800;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.label-barcode-section {
  text-align: center;
  padding: 8px 0;
  border-bottom: 2px solid #000000;
}

.barcode-svg-container {
  display: flex;
  justify-content: center;
  margin: 4px 0;
}

.label-grid-blocks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 2px solid #000000;
  font-size: 0.75rem;
}

.label-block h5 {
  font-size: 0.68rem;
  text-transform: uppercase;
  font-weight: 800;
  border-bottom: 1px solid #000000;
  margin-bottom: 4px;
}

.label-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  font-size: 0.75rem;
}

/* A4 Dual Copy (Courier POD + Customer Receipt) */
.a4-sheet-container {
  width: 100%;
  max-width: 840px;
  margin: 0 auto;
  background: #ffffff;
  color: #000000;
  font-family: var(--font-sans);
}

.a4-copy-block {
  border: 2px solid #000000;
  padding: 12px 16px;
  background: #ffffff;
  border-radius: 4px;
}

.a4-tear-separator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 10px 0;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ==========================================================================
   PUBLIC TRACKING PORTAL
   ========================================================================== */
.tracking-portal-wrapper {
  max-width: 780px;
  margin: 0 auto;
  padding: 20px 0;
}

.tracking-hero {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: white;
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.tracking-hero h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
}

.tracking-hero p {
  color: var(--primary-300);
  font-size: 0.9rem;
  margin: 8px 0 20px;
}

.tracking-search-bar {
  display: flex;
  gap: 8px;
  max-width: 540px;
  margin: 0 auto;
}

.tracking-search-bar input {
  flex: 1;
  height: 48px;
  padding: 0 18px;
  border-radius: var(--radius-full);
  border: none;
  font-size: 0.95rem;
  font-family: var(--font-mono);
  outline: none;
}

.sample-awbs {
  margin-top: 16px;
  font-size: 0.75rem;
  color: var(--primary-400);
}

.awb-chips-list {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.awb-chip {
  background: rgba(255, 255, 255, 0.1);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-family: var(--font-mono);
}

.awb-chip:hover {
  background: var(--brand-blue);
  color: white;
}

.tracking-result-box {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  margin-top: 24px;
  padding: 28px;
}

/* Stepper Timeline */
.tracking-stepper {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin: 32px 0;
}

.tracking-stepper::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 30px;
  right: 30px;
  height: 3px;
  background: var(--primary-200);
  z-index: 1;
}

.stepper-step {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 110px;
}

.stepper-node {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--primary-300);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--primary-500);
}

.stepper-step.completed .stepper-node {
  background: #10b981;
  border-color: #10b981;
  color: white;
}

.stepper-step.current .stepper-node {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: white;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

.stepper-label {
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 8px;
  color: var(--primary-700);
}

/* ==========================================================================
   ROLE PERMISSION MATRIX
   ========================================================================== */
.matrix-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.85rem;
}

.matrix-table th, .matrix-table td {
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  text-align: center;
}

.matrix-table th.perm-title-col, .matrix-table td.perm-title-col {
  text-align: left;
  font-weight: 600;
}

.matrix-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}

.toast {
  background: #0f172a;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  animation: slideToast 0.2s ease-out;
}

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

.toast-success { border-left: 4px solid #10b981; }
.toast-error { border-left: 4px solid #ef4444; }
.toast-info { border-left: 4px solid #3b82f6; }

/* ==========================================================================
   AUTHORIZED LOGIN PORTAL & DEMO CREDENTIALS MODAL
   ========================================================================== */
.auth-portal-wrapper {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
  animation: fadeIn 0.25s ease-out;
}

.auth-portal-card {
  position: relative;
  background: #ffffff;
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  width: 100%;
  max-width: 960px;
  max-height: 92vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

@media (max-width: 860px) {
  .auth-portal-card {
    grid-template-columns: 1fr;
    max-height: 94vh;
    overflow-y: auto;
  }
  .auth-demo-side {
    display: none;
  }
}

.auth-close-btn {
  position: absolute;
  top: 14px;
  right: 18px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.auth-close-btn:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: scale(1.08);
}

.auth-form-side {
  padding: 32px 36px;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  overflow-y: auto;
}

.auth-brand-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.auth-brand-logo {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #1e40af, #2563eb);
  color: white;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
  flex-shrink: 0;
}

.auth-mode-tabs {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  gap: 4px;
}

.auth-mode-tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-600);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-mode-tab.active {
  background: #ffffff;
  color: var(--brand-blue);
  box-shadow: var(--shadow-sm);
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--primary-900);
  letter-spacing: -0.02em;
}

.auth-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: 18px;
}

.auth-error-alert {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  animation: shake 0.3s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.auth-input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

.auth-input-group label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary-700);
}

.auth-input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  background: #f8fafc;
  color: var(--primary-900);
  outline: none;
  transition: all 0.15s ease;
}

.auth-input:focus {
  background: #ffffff;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.auth-input-wrapper {
  position: relative;
  width: 100%;
}

.auth-eye-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand-blue);
  cursor: pointer;
  padding: 4px 8px;
}

.auth-submit-btn {
  width: 100%;
  height: 44px;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transition: all 0.15s ease;
}

.auth-submit-btn:hover {
  background: linear-gradient(135deg, #1e40af, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

/* RIGHT DEMO CREDENTIALS SIDEBAR */
.auth-demo-side {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  overflow-y: auto;
}

.auth-demo-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
}

.auth-demo-desc {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 6px;
  margin-bottom: 16px;
  line-height: 1.4;
}

.auth-roles-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-role-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-role-card:hover {
  background: rgba(37, 99, 235, 0.25);
  border-color: #3b82f6;
  transform: translateX(4px);
}

.auth-role-header {
  font-weight: 700;
  font-size: 0.82rem;
  color: #60a5fa;
  margin-bottom: 2px;
}

.auth-role-email {
  font-size: 0.75rem;
  color: #f1f5f9;
  font-family: var(--font-mono);
}

.auth-role-pass {
  font-size: 0.68rem;
  color: #94a3b8;
  margin-top: 2px;
}

.auth-security-notice {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   MERCHANT ACCOUNTS MASTER-DETAIL SPLIT LAYOUT
   ========================================================================== */
.merchant-master-detail-container {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  min-height: calc(100vh - 170px);
  align-items: start;
}

@media (max-width: 1024px) {
  .merchant-master-detail-container {
    grid-template-columns: 1fr;
  }
}

.merchant-sidebar-col {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  max-height: calc(100vh - 165px);
  position: sticky;
  top: 75px;
}

.merchant-sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.merchant-sidebar-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.merchant-sidebar-search {
  position: relative;
  width: 100%;
}

.merchant-sidebar-search input {
  width: 100%;
  height: 34px;
  padding: 0 10px 0 32px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  background: #f8fafc;
  outline: none;
  transition: all 0.15s ease;
}

.merchant-sidebar-search input:focus {
  background: #ffffff;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.merchant-sidebar-search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.merchant-items-list {
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.merchant-list-item {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.merchant-list-item:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.merchant-list-item.active {
  background: #eff6ff;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.merchant-detail-col {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: calc(100vh - 165px);
}

.merchant-detail-header-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.merchant-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

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

.merchant-kpi-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.merchant-info-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 768px) {
  .merchant-info-split-grid {
    grid-template-columns: 1fr;
  }
}

.merchant-info-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.merchant-info-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  padding: 5px 0;
  border-bottom: 1px solid #f1f5f9;
}

.merchant-info-row:last-child {
  border-bottom: none;
}

.merchant-info-label {
  color: var(--text-muted);
  font-weight: 500;
}

.merchant-info-value {
  color: var(--primary-900);
  font-weight: 600;
  text-align: right;
}

/* ==========================================================================
   STAFF & DRIVER ATTENDANCE MODULE
   ========================================================================== */
.attendance-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

@media (max-width: 1024px) {
  .attendance-kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .attendance-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.attendance-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.att-kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.att-kpi-info {
  display: flex;
  flex-direction: column;
}

.att-kpi-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.att-kpi-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary-900);
  line-height: 1.1;
  margin-top: 2px;
}

.att-kpi-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* PUNCH TERMINAL WIDGET */
.attendance-punch-terminal {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.punch-user-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.punch-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #3b82f6;
  color: #ffffff;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.punch-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.punch-status-badge.on-duty {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.punch-status-badge.off-duty {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.punch-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.punch-btn-clockin {
  background: #10b981;
  color: #ffffff;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.punch-btn-clockin:hover {
  background: #059669;
  transform: translateY(-1px);
}

.punch-btn-clockout {
  background: #ef4444;
  color: #ffffff;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.punch-btn-clockout:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

/* ATTENDANCE STATUS PILLS */
.att-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}

.att-status-present {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.att-status-late {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fcd34d;
}

.att-status-leave {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #7dd3fc;
}

.att-status-absent {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.att-status-clockedout {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

/* SHIFT BADGES */
.shift-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: var(--primary-700);
}

/* DRIVER COMPANION SHIFT PUNCH WIDGET */
.mobile-shift-widget {
  background: #1e293b;
  color: #ffffff;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-shift-btn {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   EMPLOYEE SALARY & PAYROLL MANAGEMENT MODULE
   ========================================================================== */
.payroll-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

@media (max-width: 1024px) {
  .payroll-kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .payroll-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.payroll-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.payroll-kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.payroll-kpi-info {
  display: flex;
  flex-direction: column;
}

.payroll-kpi-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.payroll-kpi-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-900);
  line-height: 1.15;
  margin-top: 2px;
}

.payroll-kpi-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* WPS BADGES */
.wps-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}

.wps-badge-settled {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.wps-badge-pending {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fcd34d;
}

.wps-badge-hold {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

/* PRINTABLE PAYSLIP VOUCHER STYLES */
.payslip-card {
  background: #ffffff;
  border: 2px solid #0f172a;
  border-radius: var(--radius-md);
  padding: 24px;
  color: #0f172a;
  font-family: var(--font-sans);
  max-width: 680px;
  margin: 0 auto;
}

.payslip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.payslip-company-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-900);
}

.payslip-company-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.payslip-period-badge {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  text-align: right;
}

.payslip-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 0.8rem;
}

.payslip-info-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
}

.payslip-tables-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

@media (max-width: 600px) {
  .payslip-tables-grid {
    grid-template-columns: 1fr;
  }
}

.payslip-table-box {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.payslip-table-header {
  background: #f1f5f9;
  padding: 8px 12px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-color);
}

.payslip-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.payslip-table td {
  padding: 6px 12px;
  border-bottom: 1px solid #f1f5f9;
}

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

.payslip-net-box {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.payslip-net-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.payslip-net-amount {
  font-size: 1.45rem;
  font-weight: 800;
  color: #34d399;
}

.payslip-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  padding-top: 14px;
  border-top: 1px dashed #cbd5e1;
  font-size: 0.75rem;
}

.payslip-signature-line {
  border-top: 1px solid #0f172a;
  margin-top: 36px;
  padding-top: 4px;
  text-align: center;
  font-weight: 600;
}

/* ==========================================================================
   SHIPMENT AUDIT & QUALITY INSPECTION MODULE
   ========================================================================== */
.audit-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

@media (max-width: 1024px) {
  .audit-kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .audit-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.audit-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.audit-kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.audit-kpi-info {
  display: flex;
  flex-direction: column;
}

.audit-kpi-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.audit-kpi-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-900);
  line-height: 1.15;
  margin-top: 2px;
}

.audit-kpi-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* AUDIT VERDICT BADGES */
.audit-verdict-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}

.verdict-pass {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.verdict-surcharge {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fcd34d;
}

.verdict-defect {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.verdict-investigate {
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #c4b5fd;
}

.spec-delta-tag {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  background: #fee2e2;
  color: #b91c1c;
  margin-left: 4px;
}

/* PRINTABLE AUDIT CERTIFICATE */
.audit-cert-card {
  background: #ffffff;
  border: 2px solid #0f172a;
  border-radius: var(--radius-md);
  padding: 24px;
  color: #0f172a;
  font-family: var(--font-sans);
  max-width: 720px;
  margin: 0 auto;
}

.audit-cert-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.audit-cert-barcode-box {
  text-align: right;
}

.audit-cert-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

@media (max-width: 600px) {
  .audit-cert-grid-2col {
    grid-template-columns: 1fr;
  }
}

.audit-cert-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  margin-bottom: 16px;
}

.audit-cert-table th {
  background: #f1f5f9;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
}

.audit-cert-table td {
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
}

.audit-cert-stamp {
  border: 2px dashed #059669;
  background: #f0fdf4;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* ==========================================================================
   DRIVER DELIVERY & CASH RECONCILIATION REPORT MODULE
   ========================================================================== */
.driver-report-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

@media (max-width: 1024px) {
  .driver-report-kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .driver-report-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.driver-report-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.driver-filter-bar {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.driver-filter-top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.driver-filter-presets {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.driver-preset-btn {
  padding: 5px 12px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-900);
  cursor: pointer;
  transition: all 0.15s ease;
}

.driver-preset-btn:hover {
  background: #e2e8f0;
}

.driver-preset-btn.active {
  background: var(--brand-blue);
  color: #ffffff;
  border-color: var(--brand-blue);
}

.driver-filter-inputs-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr 1.2fr;
  gap: 10px;
  align-items: center;
}

@media (max-width: 1024px) {
  .driver-filter-inputs-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .driver-filter-inputs-grid {
    grid-template-columns: 1fr;
  }
}

.settlement-progress-bar-bg {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}

.settlement-progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.remaining-amount-badge {
  font-weight: 800;
  font-size: 0.95rem;
  font-family: var(--font-sans);
}

.remaining-zero {
  color: #059669;
}

.remaining-pending {
  color: #d97706;
}

.remaining-overdue {
  color: #dc2626;
}

.stops-pill-group {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.stops-pill {
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
  line-height: 1.2;
}

.stops-pill-total {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.stops-pill-del {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.stops-pill-pending {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.stops-pill-rto {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.driver-report-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  white-space: nowrap;
}

.driver-report-actions .btn {
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  line-height: 1.2;
  white-space: nowrap;
}


/* ==========================================================================
   COMPACT SINGLE-VIEW COURIER JOB AGREEMENT MODAL (ZERO SCROLL)
   ========================================================================== */
#agreementModal .modal-dialog {
  max-width: 980px !important;
  width: 95vw !important;
  margin: 1.5vh auto !important;
  max-height: 96vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

#agreementModal .modal-body {
  padding: 12px 18px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  background: #f8fafc !important;
}

.agr-modal-grid-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 800px) {
  .agr-modal-grid-layout {
    grid-template-columns: 1fr;
  }
}

.agr-form-panel {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.agr-panel-title {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--brand-blue);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 4px;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.compact-agr-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.compact-agr-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.compact-agr-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.compact-agr-group label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin: 0;
  line-height: 1.2;
}

.compact-agr-input {
  height: 31px !important;
  padding: 4px 8px !important;
  font-size: 0.78rem !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 5px !important;
  background: #ffffff !important;
  color: #0f172a !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.compact-agr-input:focus {
  border-color: var(--brand-blue) !important;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15) !important;
  outline: none !important;
}

.agr-modal-footer-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
}

/* ==========================================================================
   DRIVER JOB AGREEMENT & EMPLOYMENT CONTRACT STYLES
   ========================================================================== */
.agreement-doc-wrapper {
  background: #ffffff;
  color: #0f172a;
  font-family: var(--font-sans);
  padding: 36px 44px;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  max-width: 900px;
  margin: 0 auto;
  line-height: 1.6;
}

.agr-doc-header {
  border-bottom: 2px solid #0f172a;
  padding-bottom: 20px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.agr-header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.agr-header-logo-badge {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 800;
  box-shadow: 0 4px 6px -1px rgba(2, 132, 199, 0.3);
}

.agr-header-title-box h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.agr-header-title-box p {
  font-size: 0.8rem;
  color: #64748b;
  margin: 4px 0 0;
}

.agr-header-meta {
  text-align: right;
  font-size: 0.78rem;
  color: #475569;
}

.agr-ref-badge {
  display: inline-block;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 4px 10px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.agr-doc-title-banner {
  text-align: center;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 14px 20px;
  margin-bottom: 24px;
}

.agr-doc-title-banner h1 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.agr-doc-title-banner span {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.agr-clause-section {
  margin-bottom: 20px;
}

.agr-clause-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-left: 3px solid #0284c7;
  padding-left: 8px;
  margin-bottom: 8px;
  background: #f8fafc;
  padding-top: 4px;
  padding-bottom: 4px;
}

.agr-parties-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 12px;
}

.agr-party-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 0.8rem;
}

.agr-party-card h4 {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 6px 0;
  text-transform: uppercase;
}

.agr-party-card p {
  margin: 3px 0;
  color: #334155;
}

.agr-terms-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 0.8rem;
}

.agr-terms-table th,
.agr-terms-table td {
  border: 1px solid #cbd5e1;
  padding: 8px 12px;
  text-align: left;
}

.agr-terms-table th {
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 700;
}

.agr-clause-text {
  font-size: 0.8rem;
  color: #334155;
  margin-bottom: 8px;
  text-align: justify;
}

.agr-sub-clause {
  margin-left: 12px;
  margin-bottom: 6px;
  font-size: 0.78rem;
  color: #334155;
  line-height: 1.5;
}

.agr-duty-list {
  list-style: none;
  padding-left: 0;
  margin: 8px 0 12px;
}

.agr-duty-item {
  position: relative;
  padding-left: 20px;
  margin-bottom: 6px;
  font-size: 0.78rem;
  color: #334155;
  line-height: 1.5;
}

.agr-duty-item::before {
  content: "•";
  position: absolute;
  left: 6px;
  color: #0284c7;
  font-weight: 800;
  font-size: 1rem;
}

.agr-highlight-callout {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-left: 4px solid #16a34a;
  border-radius: 6px;
  padding: 10px 14px;
  margin: 10px 0;
  font-size: 0.77rem;
  color: #166534;
  line-height: 1.5;
}

.agr-warning-callout {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-left: 4px solid #ef4444;
  border-radius: 6px;
  padding: 10px 14px;
  margin: 10px 0;
  font-size: 0.77rem;
  color: #991b1b;
  line-height: 1.5;
}

.agr-info-callout {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-left: 4px solid #0284c7;
  border-radius: 6px;
  padding: 10px 14px;
  margin: 10px 0;
  font-size: 0.77rem;
  color: #0369a1;
  line-height: 1.5;
}

.agr-signatures-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 2px dashed #cbd5e1;
}

.agr-signature-box {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
  position: relative;
}

.agr-signature-box h4 {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 12px 0;
  text-transform: uppercase;
}

.agr-sig-canvas-display {
  height: 70px;
  border-bottom: 1px solid #0f172a;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.agr-sig-canvas-display img {
  max-height: 60px;
  max-width: 100%;
}

.agr-sig-meta {
  font-size: 0.75rem;
  color: #475569;
}

.agr-official-seal {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 72px;
  height: 72px;
  border: 2px dashed #059669;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #059669;
  font-size: 0.55rem;
  font-weight: 800;
  text-transform: uppercase;
  text-align: center;
  transform: rotate(-12deg);
  opacity: 0.85;
}

.agr-footer-notice {
  margin-top: 24px;
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  color: #94a3b8;
}

/* ==========================================================================
   AGREEMENT AUDIT TRAIL TIMELINE & MINI BUTTONS
   ========================================================================== */
.agr-history-timeline {
  position: relative;
  padding-left: 20px;
  border-left: 2px solid #cbd5e1;
  margin-left: 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.agr-timeline-node {
  position: relative;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.agr-timeline-node::before {
  content: "";
  position: absolute;
  left: -27px;
  top: 12px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #0284c7;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 2px #0284c7;
}

.agr-timeline-node.node-created::before {
  background: #2563eb;
  box-shadow: 0 0 0 2px #2563eb;
}

.agr-timeline-node.node-signed::before {
  background: #16a34a;
  box-shadow: 0 0 0 2px #16a34a;
}

.agr-timeline-node.node-updated::before {
  background: #d97706;
  box-shadow: 0 0 0 2px #d97706;
}

.agr-timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.agr-timeline-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #0f172a;
}

.agr-timeline-time {
  font-size: 0.7rem;
  color: #64748b;
  font-family: var(--font-mono);
}

.agr-timeline-actor {
  font-size: 0.72rem;
  color: #0284c7;
  font-weight: 600;
  margin-bottom: 4px;
}

.agr-timeline-details {
  font-size: 0.76rem;
  color: #334155;
  line-height: 1.4;
  background: #f8fafc;
  padding: 6px 8px;
  border-radius: 4px;
  border-left: 2px solid #cbd5e1;
}

.btn-2xs {
  padding: 2px 7px !important;
  font-size: 0.68rem !important;
  border-radius: 4px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  font-weight: 600 !important;
}

.btn-outline-info {
  background: #f0f9ff !important;
  border: 1px solid #bae6fd !important;
  color: #0284c7 !important;
}
.btn-outline-info:hover {
  background: #e0f2fe !important;
  border-color: #0284c7 !important;
}

.btn-outline-danger {
  background: #ffffff !important;
  border: 1px solid #fca5a5 !important;
  color: #dc2626 !important;
}
.btn-outline-danger:hover {
  background: #fef2f2 !important;
  border-color: #ef4444 !important;
  color: #b91c1c !important;
}

/* ==========================================================================
   USER-FRIENDLY ATTENDANCE ROSTER & WORKFORCE CARDS STYLES
   ========================================================================== */
.att-date-stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 3px 6px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.att-view-mode-group {
  display: inline-flex;
  background: #e2e8f0;
  padding: 3px;
  border-radius: var(--radius-md);
  gap: 3px;
}

.att-view-mode-btn {
  border: none;
  background: transparent;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.att-view-mode-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.workforce-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
  margin-top: 6px;
}

.workforce-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  overflow: hidden;
}

.workforce-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.workforce-card.card-on-duty {
  border-left: 4px solid #10b981;
}

.workforce-card.card-late {
  border-left: 4px solid #f59e0b;
}

.workforce-card.card-leave {
  border-left: 4px solid #64748b;
  opacity: 0.85;
}

.workforce-card.card-absent {
  border-left: 4px solid #ef4444;
}

.workforce-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.workforce-card-person {
  display: flex;
  align-items: center;
  gap: 10px;
}

.workforce-card-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: #ffffff;
  flex-shrink: 0;
}

.workforce-card-name {
  font-weight: 800;
  font-size: 0.92rem;
  color: #0f172a;
  line-height: 1.2;
}

.workforce-card-role {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.workforce-card-body {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 0.76rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.workforce-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.att-progress-bar-box {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.att-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.workforce-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px dashed #e2e8f0;
}

.quick-preset-chips button {
  white-space: nowrap;
}

/* =============================================================================
   MANUAL AWB BATCH BOOKING & BARCODE PRINTING
   ============================================================================= */
.awb-sticker-grid {
  display: grid;
  gap: 12px;
  background: #ffffff;
  padding: 12px;
  border-radius: 8px;
}

.awb-sticker-grid.layout-3col {
  grid-template-columns: repeat(3, 1fr);
}

.awb-sticker-grid.layout-2col {
  grid-template-columns: repeat(2, 1fr);
}

.awb-sticker-grid.layout-thermal {
  grid-template-columns: 1fr;
  max-width: 420px;
  margin: 0 auto;
}

.awb-sticker-item {
  border: 2px dashed #cbd5e1;
  border-radius: 6px;
  padding: 10px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  page-break-inside: avoid;
}

.awb-sticker-shipper {
  font-size: 0.72rem;
  font-weight: 800;
  color: #0f172a;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.awb-sticker-meta {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 0.65rem;
  color: #64748b;
  margin-top: 4px;
  border-top: 1px solid #f1f5f9;
  padding-top: 4px;
}

.awb-range-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.awb-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 2px 8px;
  font-size: 0.8rem;
  font-weight: 800;
  border-radius: 9999px;
  background: #ede9fe;
  color: #6d28d9;
}

.progress-mini-bar {
  width: 100%;
  height: 5px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 3px;
}

.progress-mini-fill {
  height: 100%;
  background: #0284c7;
  border-radius: 3px;
}

/* =============================================================================
   24EX DOT MATRIX PHYSICAL PRE-PRINTED AWB FORM & PRINT ENGINE
   ============================================================================= */
.dot-matrix-paper-sheet {
  width: 8.5in;
  min-height: 4.25in;
  height: 4.25in;
  padding: 0.12in 0.2in;
  background: #ffffff;
  border: 1.5px solid #0f172a;
  border-radius: 4px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  position: relative;
  font-family: "Courier New", Courier, monospace;
  color: #000000;
  box-sizing: border-box;
  margin: 0 auto 16px auto;
  page-break-after: always;
  page-break-inside: avoid;
  overflow: hidden;
}

.dm-full-form-layout {
  border: 1.5px solid #0f172a;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  background: #ffffff;
}

.dm-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  border-bottom: 2px solid #b91c1c;
  background: #ffffff;
}

.dm-logo-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dm-logo-text {
  font-family: Arial, sans-serif;
  font-weight: 900;
  font-size: 1.35rem;
  color: #dc2626;
  line-height: 1.1;
}

.dm-logo-sub {
  font-size: 0.65rem;
  font-weight: 700;
  color: #1e293b;
}

.dm-header-contacts {
  font-family: Arial, sans-serif;
  font-size: 0.6rem;
  line-height: 1.3;
  color: #1e293b;
}

.dm-header-meta {
  text-align: right;
  font-family: Arial, sans-serif;
  font-size: 0.65rem;
}

.dm-red-banner {
  display: grid;
  grid-template-columns: 31% 44% 25%;
  background: #b91c1c;
  color: #ffffff;
  font-family: Arial, sans-serif;
  font-weight: 800;
  font-size: 0.68rem;
  padding: 3px 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dm-grid-body {
  display: grid;
  grid-template-columns: 31% 44% 25%;
  flex: 1;
  border-bottom: 1.5px solid #0f172a;
}

.dm-col-origin {
  border-right: 1.5px solid #0f172a;
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 0.75rem;
}

.dm-col-destination {
  border-right: 1.5px solid #0f172a;
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 0.75rem;
}

.dm-col-amount {
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 0.75rem;
}

.dm-field-row {
  margin-bottom: 3px;
  line-height: 1.2;
}

.dm-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: #334155;
  font-family: Arial, sans-serif;
}

.dm-val {
  font-family: "Courier New", Courier, monospace;
  font-weight: 800;
  font-size: 0.82rem;
  color: #000000;
  display: block;
}

.dm-val.highlight-bold {
  font-weight: 900;
  color: #000000;
  font-size: 0.88rem;
}

.dm-amount-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.7rem;
}

.dm-amount-table td {
  padding: 2px 0;
  border-bottom: 1px dashed #cbd5e1;
}

.dm-barcode-box {
  text-align: center;
  margin: 2px 0;
}

.dm-form-footer {
  padding: 3px 8px;
  background: #ffffff;
  font-size: 0.6rem;
}

.dm-footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed #cbd5e1;
  padding-bottom: 2px;
  margin-bottom: 2px;
}

.dm-service-checks {
  display: flex;
  justify-content: space-between;
  font-size: 0.62rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.dm-disclaimer-text {
  font-size: 0.46rem;
  line-height: 1.2;
  color: #475569;
  text-align: center;
}

/* Screen Mode: Pre-printed tractor-feed overlay guide (faint guide lines on screen) */
.mode-preprinted-overlay .dm-form-header {
  border-bottom-color: #fca5a5;
  background: #fafafa;
}

.mode-preprinted-overlay .dm-red-banner {
  background: #f87171;
  opacity: 0.7;
}

.mode-preprinted-overlay .dm-label {
  color: #94a3b8;
}

.mode-preprinted-overlay .dm-disclaimer-text {
  opacity: 0.4;
}

.mode-preprinted-overlay .dm-val {
  color: #000000 !important;
  font-weight: 900 !important;
  background: rgba(254, 240, 138, 0.4);
  padding: 1px 2px;
  border-radius: 2px;
}

/* =============================================================================
   UNIFIED BATCH, RUNSHEET, WAYBILL & LABEL PRINT ENGINE
   ============================================================================= */
@page {
  size: auto;
  margin: 5mm;
}

@page dotmatrix {
  size: 8.5in 4.25in;
  margin: 0;
}

/* Modal Screen Styles */
.waybill-modal-scroll-area {
  padding: 18px;
  background: #f8fafc;
  max-height: 82vh;
  overflow-y: auto;
}

@media print {
  /* 1. Global Reset & Print Base */
  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 100% !important;
    overflow: visible !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* 2. Hide all non-printable CRM chrome, headers, sidebars, buttons, toolbars, format tabs, and inactive modals */
  .sidebar,
  .app-sidebar,
  .top-header,
  .app-header,
  .content-view,
  .stats-overview,
  .toast-container,
  .modal-close-btn,
  .modal-close,
  .dm-toolbar,
  .btn,
  .runsheet-toolbar,
  .modal-header-actions,
  .modal-footer,
  .waybill-format-tabs,
  .modal-header,
  .no-print,
  #loginPortalView,
  .auth-portal-wrapper,
  .modal-backdrop.hidden,
  .drawer-backdrop.hidden,
  .modal-backdrop[style*="display: none"],
  .modal-backdrop[style*="display:none"],
  [hidden],
  .hidden {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
  }

  body.printing-runsheet .sidebar,
  body.printing-runsheet .top-header,
  body.printing-runsheet .app-header,
  body.printing-runsheet .runsheet-toolbar,
  body.printing-runsheet .no-print {
    display: none !important;
  }

  /* 3. Force ANY Active (Non-Hidden) Print Modal & Container to be 100% Full Width & Visible */
  .modal-backdrop:not(.hidden),
  .drawer-backdrop:not(.hidden),
  #waybillModal:not(.hidden) {
    display: block !important;
    position: static !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    overflow: visible !important;
    visibility: visible !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    z-index: auto !important;
  }

  .modal-backdrop:not(.hidden) .modal-dialog,
  .modal-backdrop:not(.hidden) .modal-card,
  .modal-backdrop:not(.hidden) .printable-modal,
  .waybill-dialog-wrapper {
    display: block !important;
    position: static !important;
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    overflow: visible !important;
    visibility: visible !important;
    transform: none !important;
  }

  .modal-backdrop:not(.hidden) .modal-body,
  .waybill-modal-scroll-area,
  #waybillPrintContainer,
  .modal-backdrop:not(.hidden) #waybillPrintContainer,
  .modal-backdrop:not(.hidden) #manifestPrintContainer,
  .modal-backdrop:not(.hidden) #driverReportPrintContainer,
  .modal-backdrop:not(.hidden) #payslipPrintContainer,
  .modal-backdrop:not(.hidden) #auditCertPrintContainer,
  .modal-backdrop:not(.hidden) #agreementPrintContainer,
  .modal-backdrop:not(.hidden) #outscanManifestPrintArea,
  .modal-backdrop:not(.hidden) #driverEodPrintArea,
  .modal-backdrop:not(.hidden) #awbPrintableStickersGrid,
  .modal-backdrop:not(.hidden) #dotMatrixSheet {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    visibility: visible !important;
  }

  .modal-backdrop:not(.hidden) * {
    visibility: visible !important;
  }

  /* 4. Thermal Shipping Label (4x6) Formatting */
  .shipping-label-card,
  .ex24-thermal-card {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    margin: 0 auto 16px auto !important;
    background: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #0a1b39 !important;
    box-shadow: none !important;
    max-width: 440px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    display: block !important;
  }

  .ex24-thermal-header {
    background: #0a1b39 !important;
    color: #ffffff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .ex24-thermal-header .brand-title {
    color: #ffffff !important;
  }

  .ex24-thermal-header .service-tag {
    color: #fbbf24 !important;
  }

  .ex24-thermal-route-strip .route-val {
    color: #0284c7 !important;
  }

  .ex24-metric-box.highlight,
  .ex24-cod-box {
    background: #fffbeb !important;
    border: 1.5px solid #f59e0b !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* 5. A4 POD Waybill Sheet Formatting */
  .a4-sheet-container,
  .ex24-a4-sheet {
    page-break-after: always !important;
    break-after: page !important;
    margin: 0 auto !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #000000 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .a4-copy-block,
  .ex24-a4-copy {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    margin-bottom: 14px !important;
    border: 1.5px solid #0a1b39 !important;
    background: #ffffff !important;
  }

  .ex24-a4-header {
    background: #0a1b39 !important;
    color: #ffffff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .ex24-a4-subbar.hub {
    background: #1e3a8a !important;
    color: #ffffff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .ex24-a4-subbar.customer {
    background: #0284c7 !important;
    color: #ffffff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* 6. Pure SVG Barcode & QR Code Print Crispness */
  .barcode-svg-container,
  .ex24-barcode-center,
  .shipping-label-card svg,
  .ex24-thermal-card svg,
  .a4-sheet-container svg,
  .ex24-a4-sheet svg,
  #waybillPrintContainer svg,
  #manifestPrintContainer svg {
    max-width: 100% !important;
    display: block !important;
    visibility: visible !important;
  }

  /* 7. Barcode Sticker Grid Print */
  .awb-sticker-grid {
    display: grid !important;
    padding: 0 !important;
    gap: 8px !important;
  }
  .awb-sticker-item {
    border: 1px solid #000000 !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  /* 8. Dot Matrix Form Sheet Print */
  .dot-matrix-paper-sheet {
    display: block !important;
    width: 8.5in !important;
    height: 4.25in !important;
    min-height: 4.25in !important;
    margin: 0 !important;
    padding: 0.1in 0.15in !important;
    box-sizing: border-box !important;
    page-break-after: always !important;
    page-break-inside: avoid !important;
    break-after: page !important;
    break-inside: avoid !important;
    box-shadow: none !important;
    background: #ffffff !important;
  }

  /* Pre-Printed Dot Matrix Mode: Hide static template borders */
  .print-pure-overlay .dm-form-header .dm-logo-group,
  .print-pure-overlay .dm-form-header .dm-header-contacts,
  .print-pure-overlay .dm-form-header .dm-header-meta .static-lbl,
  .print-pure-overlay .dm-red-banner,
  .print-pure-overlay .dm-label,
  .print-pure-overlay .dm-disclaimer-text,
  .print-pure-overlay .static-lbl {
    visibility: hidden !important;
  }

  .print-pure-overlay .dot-matrix-paper-sheet,
  .print-pure-overlay .dm-full-form-layout,
  .print-pure-overlay .dm-col-origin,
  .print-pure-overlay .dm-col-destination,
  .print-pure-overlay .dm-grid-body,
  .print-pure-overlay .dm-amount-table td,
  .print-pure-overlay .dm-form-header,
  .print-pure-overlay .dm-footer-top {
    border-color: transparent !important;
    background: transparent !important;
  }

  .print-pure-overlay .dm-val {
    background: transparent !important;
    color: #000000 !important;
    font-weight: 900 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

/* ==========================================================================
   DELIVERY DISPUTE & BILLING ADJUSTMENT MODULE (CONSIGNLY OPS)
   ========================================================================== */
.dispute-split-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}

@media (max-width: 1200px) {
  .dispute-split-layout {
    grid-template-columns: 1fr;
  }
}

.dispute-queue-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.dispute-detail-drawer {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 18px;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.dispute-row-selected {
  background: #eff6ff !important;
  border-left: 4px solid var(--brand-blue) !important;
}

.badge-aging-normal {
  background: #f1f5f9;
  color: #475569;
  font-weight: 700;
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.badge-aging-warning {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  font-weight: 800;
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  animation: pulseWarning 2s infinite;
}

.badge-aging-danger {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  font-weight: 900;
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  animation: pulseDanger 1.5s infinite;
}

@keyframes pulseWarning {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

@keyframes pulseDanger {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
  50% { box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15); }
}

.liability-toggle-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.liability-pill-btn {
  padding: 8px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1.5px solid var(--border-color);
  background: var(--bg-app);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: all 0.15s ease;
}

.liability-pill-btn:hover {
  border-color: var(--brand-blue);
  background: #f8fafc;
}

.liability-pill-btn.active-client {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
}

.liability-pill-btn.active-courier {
  background: #fef2f2;
  border-color: #ef4444;
  color: #b91c1c;
}

.liability-pill-btn.active-fraud {
  background: #f5f3ff;
  border-color: #8b5cf6;
  color: #6d28d9;
}

.liability-pill-btn.active-pending {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #b45309;
}

.evidence-preview-box {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.evidence-thumb-img {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.evidence-thumb-img:hover {
  transform: scale(1.02);
}

.esign-pad-canvas {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  cursor: crosshair;
  touch-action: none;
  width: 100%;
  height: 120px;
}

/* =============================================================================
   DRIVER RUN SHEET & DELIVERY MANIFEST A4 LANDSCAPE PRINT STYLING
   ============================================================================= */
.runsheet-modal-dialog {
  max-width: 1240px !important;
  width: 96vw !important;
}

.runsheet-toolbar {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.runsheet-toolbar-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.runsheet-toolbar-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 6px;
}

.runsheet-landscape-container {
  background: #ffffff;
  color: #0f172a;
  font-family: var(--font-sans);
  padding: 16px 20px;
}

.runsheet-header-grid {
  display: grid;
  grid-template-columns: 320px 1fr 300px;
  gap: 14px;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 10px;
  margin-bottom: 12px;
  align-items: center;
}

.runsheet-kpi-ribbon {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 14px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.8rem;
}

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

.runsheet-kpi-item strong {
  color: #0f172a;
  font-weight: 800;
}

.runsheet-landscape-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 8pt;
  line-height: 1.25;
  margin-bottom: 14px;
}

.runsheet-landscape-table th {
  background: #0f172a !important;
  color: #ffffff !important;
  font-weight: 800;
  font-size: 7.5pt;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 7px 6px;
  border: 1px solid #0f172a;
  text-align: left;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.runsheet-landscape-table td {
  border: 1px solid #94a3b8;
  padding: 5px 6px;
  vertical-align: middle;
  background: #ffffff;
}

.runsheet-landscape-table tbody tr:nth-child(even) td {
  background: #f8fafc;
}

.stop-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.76rem;
  background: #0f172a;
  color: #ffffff;
  padding: 3px 7px;
  border-radius: 6px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.stop-badge.express {
  background: #dc2626;
  color: #ffffff;
}

.stop-badge.cod {
  background: #059669;
  color: #ffffff;
}

.runsheet-barcode-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.runsheet-awb-text {
  font-family: var(--font-mono);
  font-size: 8pt;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.03em;
}

.runsheet-sig-box {
  border: 1.5px dashed #64748b;
  background: #ffffff;
  min-height: 46px;
  padding: 3px 5px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.runsheet-sig-prompt {
  font-size: 6.5pt;
  color: #64748b;
  font-weight: 700;
}

.runsheet-sig-baseline {
  border-bottom: 1px dotted #94a3b8;
  margin-top: 12px;
}

.runsheet-otp-box {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 2px;
  font-size: 6.5pt;
  color: #475569;
  font-weight: 700;
}

.otp-cell {
  width: 11px;
  height: 11px;
  border: 1px solid #64748b;
  border-radius: 2px;
  display: inline-block;
  background: #ffffff;
}

.runsheet-notes-lines {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 3px;
}

.runsheet-note-line {
  border-bottom: 1px dotted #cbd5e1;
  height: 10px;
}

.runsheet-signoff-footer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  border-top: 2px solid #0f172a;
  padding-top: 12px;
  margin-top: 12px;
}

.runsheet-signoff-box {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 8px 12px;
  background: #f8fafc;
  font-size: 7.5pt;
}

.runsheet-signoff-title {
  font-weight: 800;
  font-size: 8pt;
  color: #0f172a;
  margin-bottom: 6px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 3px;
}

.sidebar-nav-cluster-title {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  padding: 10px 16px 4px 16px;
  margin-top: 4px;
}

/* ==========================================================================
   DELIVERY & SETTLEMENT ADJUSTMENT MODULE STYLES
   ========================================================================== */
.adj-tab-pane {
  animation: fadeIn 0.15s ease-in-out;
}

#adjSqlCodeDisplay code {
  color: #38bdf8;
  font-family: var(--font-mono, monospace);
  font-size: 0.76rem;
  line-height: 1.45;
}

/* ==========================================================================
   OFFICIAL 24EX PRINT LABEL & WAYBILL DESIGN SYSTEM (PIXEL-PERFECT)
   ========================================================================== */

/* 1. Thermal 4x6 Label Card */
.ex24-thermal-card {
  width: 100%;
  max-width: 440px;
  margin: 0 auto 16px auto;
  background: #ffffff;
  border: 2px solid #0a1b39;
  border-radius: 4px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #0f172a;
  box-sizing: border-box;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.ex24-thermal-header {
  background: #0a1b39;
  color: #ffffff;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ex24-thermal-header .brand-title {
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  color: #ffffff;
  line-height: 1.1;
}

.ex24-thermal-header .brand-sub {
  font-size: 0.62rem;
  color: #94a3b8;
  letter-spacing: 0.02em;
  margin-top: 2px;
}

.ex24-thermal-header .badge-group {
  text-align: right;
}

.ex24-thermal-header .service-tag {
  color: #fbbf24;
  font-weight: 900;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.ex24-thermal-header .awb-tag {
  color: #cbd5e1;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-top: 1px;
}

.ex24-thermal-route-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: #ffffff;
  border-bottom: 1.5px solid #0a1b39;
}

.ex24-thermal-route-strip .lbl {
  font-size: 0.65rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ex24-thermal-route-strip .route-val {
  font-size: 1.25rem;
  font-weight: 900;
  color: #0284c7;
  letter-spacing: 0.02em;
}

.ex24-thermal-route-strip .zone-val {
  font-size: 1.25rem;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: 0.02em;
}

.ex24-section-block {
  padding: 10px 14px;
  border-bottom: 1px solid #e2e8f0;
}

.ex24-section-lbl {
  font-size: 0.65rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}

.ex24-party-name {
  font-size: 1.15rem;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.2;
}

.ex24-party-address {
  font-size: 0.82rem;
  color: #334155;
  margin-top: 2px;
  line-height: 1.3;
}

.ex24-party-phone {
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f172a;
  margin-top: 2px;
}

.ex24-metrics-3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1.5px solid #0a1b39;
  background: #ffffff;
}

.ex24-metric-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 3px;
  padding: 6px 8px;
}

.ex24-metric-box.highlight {
  background: #fffbeb;
  border: 1.5px solid #f59e0b;
}

.ex24-metric-box .m-lbl {
  font-size: 0.62rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ex24-metric-box .m-val {
  font-size: 1.15rem;
  font-weight: 900;
  color: #0f172a;
  margin-top: 2px;
}

.ex24-metric-box.highlight .m-val {
  color: #0a1b39;
}

.ex24-contents-strip {
  padding: 7px 14px;
  font-size: 0.78rem;
  color: #334155;
  border-bottom: 1.5px solid #0a1b39;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ex24-barcode-center {
  padding: 12px 14px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ex24-barcode-center svg {
  max-width: 100%;
  height: auto;
}

.ex24-thermal-footer {
  padding: 10px 14px 14px;
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 12px;
  align-items: center;
}

.ex24-thermal-footer .meta-table {
  font-size: 0.75rem;
  color: #334155;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ex24-thermal-footer .meta-row {
  display: flex;
  gap: 8px;
}

.ex24-thermal-footer .meta-lbl {
  font-weight: 800;
  color: #64748b;
  width: 78px;
  text-transform: uppercase;
  font-size: 0.68rem;
}

.ex24-thermal-footer .meta-val {
  font-weight: 800;
  color: #0f172a;
}

.ex24-thermal-footer .track-cta {
  font-size: 0.68rem;
  color: #0284c7;
  font-weight: 700;
  margin-top: 4px;
}

/* 2. A4 Two-Part Waybill Sheet */
.ex24-a4-sheet {
  width: 100%;
  max-width: 760px;
  margin: 0 auto 20px auto;
  background: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #0f172a;
}

.ex24-a4-copy {
  border: 1.5px solid #0a1b39;
  border-radius: 4px;
  background: #ffffff;
  overflow: hidden;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ex24-a4-header {
  background: #0a1b39;
  color: #ffffff;
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ex24-a4-subbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 14px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ex24-a4-subbar.hub {
  background: #1e3a8a;
  color: #ffffff;
}

.ex24-a4-subbar.customer {
  background: #0284c7;
  color: #ffffff;
}

.ex24-a4-subbar .hint {
  font-weight: 600;
  text-transform: none;
  font-size: 0.68rem;
  opacity: 0.92;
}

.ex24-a4-body-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1.5px solid #0a1b39;
}

.ex24-a4-left-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ex24-a4-right-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border-left: 1px solid #e2e8f0;
  padding-left: 12px;
}

.ex24-a4-bottom-bar {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 12px;
  padding: 8px 14px;
  background: #fafafa;
  align-items: center;
}

.ex24-cod-box {
  background: #fffbeb;
  border: 1.5px solid #f59e0b;
  border-radius: 3px;
  padding: 4px 10px;
  display: flex;
  flex-direction: column;
}

.ex24-cod-box .c-lbl {
  font-size: 0.62rem;
  font-weight: 800;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ex24-cod-box .c-val {
  font-size: 1.3rem;
  font-weight: 900;
  color: #0a1b39;
}

.ex24-signature-box {
  font-size: 0.72rem;
  color: #475569;
  border-left: 1px solid #cbd5e1;
  padding-left: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ex24-cut-line-wrapper {
  text-align: center;
  position: relative;
  margin: 14px 0;
  padding: 6px 0;
}

/* ==========================================================================
   AUTO-RESOLVE SHIPPER ON SCAN ANIMATIONS & BADGES
   ========================================================================== */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spinner-small {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #cbd5e1;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.auto-resolved-pulse {
  animation: pulseGreen 1s ease-in-out;
}

@keyframes pulseGreen {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ==========================================================================
   SHIPPER DIGITAL WALLET & IMMUTABLE LEDGER STYLES
   ========================================================================== */
.ledger-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  font-family: var(--font-mono);
}

.ledger-pill.credit {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.ledger-pill.debit {
  background: #ffe4e6;
  color: #9f1239;
  border: 1px solid #fecdd3;
}

.mp-tab-pane, .admin-fin-pane {
  transition: opacity 0.15s ease-in-out;
}

.mp-tab-pane.hidden, .admin-fin-pane.hidden {
  display: none !important;
}








/* ==========================================================================
   PREMIUM SHIPPER WALLET & FINANCIAL MODALS DESIGN
   ========================================================================== */
.wallet-modal-card {
  background: #ffffff !important;
  border-radius: 16px !important;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(226, 232, 240, 0.8) !important;
  overflow: hidden !important;
  animation: modalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  width: 95vw !important;
  margin: auto !important;
}

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

.wallet-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
}

.wallet-badge-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wallet-modal-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.wallet-modal-subtitle {
  margin: 2px 0 0 0;
  font-size: 0.78rem;
  color: #64748b;
}

.wallet-modal-close {
  border: none;
  background: #f1f5f9;
  color: #64748b;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease-in-out;
}

.wallet-modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
  transform: scale(1.05);
}

.wallet-summary-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.wallet-modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  border-top: 1px solid #f1f5f9;
  padding-top: 16px;
  margin-top: 4px;
}

.wallet-modal-footer .btn {
  height: 40px;
  font-size: 0.88rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.wallet-modal-footer .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

/* ==========================================================================
   ENTERPRISE HUB INBOUND RECEIVING & INWARDING CONSOLE
   ========================================================================== */
.inbound-scanner-card {
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.inbound-kpi-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.inbound-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04) !important;
}

.status-pill-inbound {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.status-pill-inbound.received-hub {
  background: #ECFDF5;
  color: #059669;
  border: 1px solid #A7F3D0;
}

.status-pill-inbound.in-warehouse {
  background: #EFF6FF;
  color: #2563EB;
  border: 1px solid #BFDBFE;
}

.status-pill-inbound.prev-status {
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #E2E8F0;
}
/* ==========================================================================
   DRIVER END-OF-DAY (EOD) CLOSING & CASH RECONCILIATION CONSOLE
   ========================================================================== */
.denom-input:focus {
  border-color: #10b981 !important;
  background: #f0fdf4 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2) !important;
}

.exp-input:focus {
  border-color: #f43f5e !important;
  background: #fff1f2 !important;
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.2) !important;
}

.voucher-a4-sheet {
  background: #ffffff;
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 30px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-family: var(--font-sans, system-ui, -apple-system, sans-serif);
  color: #0f172a;
}

.voucher-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.voucher-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 14px;
  font-size: 0.82rem;
}

.voucher-table th {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 6px 10px;
  font-weight: 800;
  color: #334155;
  text-transform: uppercase;
}

.voucher-table td {
  border: 1px solid #e2e8f0;
  padding: 6px 10px;
}

.voucher-signoff-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 2px dashed #cbd5e1;
}

.voucher-sign-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px;
  text-align: center;
}

.voucher-sign-line {
  height: 40px;
  border-bottom: 1px solid #94a3b8;
  margin: 8px 10px 4px 10px;
}

@media print {
  body * {
    visibility: hidden;
  }
  #driverClosingVoucherModal,
  #driverClosingVoucherModal * {
    visibility: visible;
  }
  #driverClosingVoucherModal {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: auto;
    background: transparent;
    padding: 0;
    margin: 0;
  }
  #driverClosingVoucherModal .modal-dialog {
    max-width: 100% !important;
    width: 100% !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }
  #driverClosingVoucherModal button {
    display: none !important;
  }
}


/* ==========================================================================
   SETTINGS, HUBS & RBAC LAYOUT SYSTEMS
   ========================================================================== */

/* Settings Grid & Cards */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}

.settings-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.settings-card .card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  background: #fafafa;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.settings-card .card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main, #0f172a);
  margin: 0;
}

.settings-card .card-body {
  padding: 20px;
  flex: 1;
}

.settings-card .card-body.no-padding {
  padding: 0;
}

.backup-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.file-upload-label {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

/* Hubs Grid & Card Layout */
.hubs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.hub-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-lg, 12px);
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hub-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.zone-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

/* RBAC Subviews & Matrix */
.rbac-subview {
  display: none !important;
}

.rbac-subview.active {
  display: block !important;
}

.matrix-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.matrix-header {
  padding: 18px 24px;
  background: #fafafa;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.matrix-header h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 4px 0;
}

.matrix-header p {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0;
}

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

.matrix-table th {
  padding: 12px 16px;
  background: #f8fafc;
  color: #475569;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.75rem;
  border-bottom: 2px solid #e2e8f0;
  text-align: center;
}

.matrix-table th.perm-title-col {
  text-align: left;
  width: 280px;
}

.matrix-table td {
  padding: 10px 16px;
  border-bottom: 1px solid #f1f5f9;
  text-align: center;
}

.matrix-table td:first-child {
  text-align: left;
  font-weight: 600;
  color: #1e293b;
}

.matrix-table tr:hover td {
  background: #f8fafc;
}

.matrix-footer {
  padding: 16px 24px;
  background: #fafafa;
  border-top: 1px solid var(--border-color, #e2e8f0);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Notification Drawer */
.notification-item-card {
  padding: 12px 14px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.notification-item-card.alert-urgent {
  background: #fff1f2;
  border-color: #fecdd3;
}

.notification-item-card.alert-info {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.notification-item-card.alert-success {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

/* ==========================================================================
   DRIVER EOD SETTLEMENT VOUCHER STYLES
   ========================================================================== */
#driverEodPrintModal .modal-dialog {
  max-width: 1180px;
  width: 95vw;
}

#driverEodPrintArea {
  color: #0f172a;
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
}

.eod-voucher-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.eod-voucher-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 16px;
  margin-bottom: 18px;
  gap: 16px;
  flex-wrap: wrap;
}

.eod-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

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

.eod-stat-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
}

.eod-table-container {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 20px;
  background: #ffffff;
}

.eod-table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.eod-table th {
  background: #f1f5f9;
  color: #334155;
  font-weight: 700;
  padding: 10px 12px;
  border-bottom: 2px solid #cbd5e1;
  text-align: left;
  white-space: nowrap;
}

.eod-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  color: #1e293b;
  vertical-align: middle;
}

.eod-table tr:hover td {
  background: #f8fafc;
}

.eod-signature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #cbd5e1;
}

@media (max-width: 640px) {
  .eod-signature-grid {
    grid-template-columns: 1fr;
  }
}

.eod-signature-box {
  text-align: center;
  border-top: 1.5px solid #0f172a;
  padding-top: 8px;
  font-size: 0.8rem;
}

/* =============================================================================
   32. REDESIGNED DRIVER DELIVERY STOP STATUS & POD MODAL
   ============================================================================= */
.driver-status-modal-dialog {
  max-width: 640px !important;
  width: 95% !important;
  border-radius: 18px !important;
  overflow: hidden !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.35) !important;
  background: #ffffff !important;
}

.driver-status-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%) !important;
  color: #ffffff !important;
  padding: 18px 24px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  position: relative;
}

.driver-consignee-banner {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.outcome-selector-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

@media (max-width: 540px) {
  .outcome-selector-grid {
    grid-template-columns: 1fr;
  }
}

.outcome-choice-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.outcome-choice-btn:hover {
  border-color: #94a3b8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.outcome-choice-btn.active {
  border-width: 2px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.outcome-choice-btn.outcome-delivered.active {
  border-color: #16a34a;
  background: #f0fdf4;
}

.outcome-choice-btn.outcome-unavailable.active {
  border-color: #f59e0b;
  background: #fffbeb;
}

.outcome-choice-btn.outcome-refused.active {
  border-color: #ef4444;
  background: #fef2f2;
}

.outcome-choice-btn.outcome-address.active {
  border-color: #0284c7;
  background: #f0f9ff;
}

.outcome-choice-btn.outcome-rts.active {
  border-color: #8b5cf6;
  background: #f5f3ff;
}

.outcome-icon-circle {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.outcome-choice-btn:hover .outcome-icon-circle {
  transform: scale(1.08);
}

.outcome-content {
  flex: 1;
  min-width: 0;
}

.outcome-title {
  font-weight: 800;
  font-size: 0.88rem;
  line-height: 1.2;
  color: #0f172a;
}

.outcome-subtitle {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 2px;
  line-height: 1.25;
}

.pod-card-container {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.payment-method-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
}

.payment-method-chip.active {
  border-color: #059669;
  background: #ecfdf5;
  color: #047857;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.pod-mode-tab-bar {
  display: flex;
  gap: 6px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.pod-mode-tab {
  flex: 1;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.pod-mode-tab.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.quick-tender-chip {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
}

.quick-tender-chip:hover {
  background: #f8fafc;
  border-color: #059669;
  color: #059669;
}