/* Modern CSS Variables */
:root {
  --primary-color: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary-color: #64748b;
  --accent-color: #f59e0b;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --navbar-height: 50px;
}

/* Base Styles */
html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  margin: 0;
  padding: 0;
  font-size: 15px;
}

/* Desktop page containers - maintain container spacing */
@media (min-width: 768px) {

  /* Default containers get standard spacing, but not inside fixed header */
  .container:not(.fixed-header .container),
  .container-fluid:not(.fixed-header .container-fluid) {
    padding-top: 1rem;
    /* Additional space below fixed header */
  }
}

/* Fixed Header Styling */
.fixed-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  background: #0d2240;
  box-shadow: none;
  border-bottom: 1px solid rgba(71, 85, 105, 0.3);
}

.modern-header {
  padding: 0.5rem 0;
  border: none;
  margin-bottom: 0;
}

/* Ensure fixed header container has consistent padding */
.fixed-header .container-fluid {
  padding: 0 1rem !important;
}

.modern-header .navbar-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: #f1f5f9 !important;
  /* Light grey to match sidebar header */
  text-decoration: none;
}

.modern-header .navbar-brand:hover {
  color: #cbd5e1 !important;
  /* Slightly muted on hover */
}

/* Header Logo Styling */
.header-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
  vertical-align: middle;
}

.navbar-toggler {
  border: 1px solid rgba(203, 213, 225, 0.3);
  /* Light slate border */
  padding: 0.375rem;
  background: rgba(71, 85, 105, 0.3);
  /* Semi-transparent slate background */
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  min-width: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.navbar-toggler:hover {
  background: rgba(71, 85, 105, 0.5);
  /* Darker slate on hover */
  border-color: rgba(203, 213, 225, 0.5);
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 2px rgba(203, 213, 225, 0.3);
  /* Light slate focus ring */
  outline: none;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28241, 245, 249, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='m4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  /* Light grey hamburger lines */
  width: 1.125rem;
  height: 1.125rem;
}

/* Ensure hamburger is always visible */
.navbar-toggler {
  display: block !important;
}

@media (min-width: 576px) {
  .navbar-toggler {
    display: block !important;
  }
}

/* Fixed Header Dropdown Overlay */
.fixed-header .dropdown-menu {
  position: absolute !important;
  z-index: 1040;
  top: 100% !important;
  transform: none !important;
  margin-top: 0.5rem;
  max-height: none !important;
  overflow-y: visible !important;
}

.fixed-header .nav-item.dropdown {
  position: relative;
}

.fixed-header .dropdown-menu.show {
  display: block;
  position: absolute !important;
  top: 100%;
  right: 0;
  left: auto;
}

/* Collapsible Sidebar Navigation */
.sidebar {
  position: fixed;
  top: 0;
  left: -320px;
  width: 320px;
  height: 100vh;
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
  /* Modern dark slate grey gradient */
  box-shadow: var(--shadow-xl);
  z-index: 1040;
  transition: left 0.3s ease-in-out;
  overflow-y: auto;
}



.sidebar.open {
  left: 0;
}

.sidebar-content {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem 0.9rem 1.5rem;
  background: #0d2240;
  color: #f1f5f9;
  border-bottom: 1px solid rgba(71, 85, 105, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sidebar-header h5 {
  color: #f1f5f9;
  /* Light grey for header text */
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
}

/* Close button updated for dark theme */
.sidebar-close {
  color: #cbd5e1;
  /* Light slate grey for button */
  padding: 0.45rem 0.55rem;
  background: rgba(71, 85, 105, 0.3);
  /* Semi-transparent slate background */
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.sidebar-close:hover {
  background: #ef4444;
  /* Red hover for close action */
  color: #ffffff;
  border-color: #dc2626;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* Improve icon alignment inside header */
.sidebar-header i {
  opacity: 0.9;
  margin-right: 4px;
}

.sidebar-body {
  flex: 1;
  padding: 2rem 0;
  overflow-y: auto;
}

.sidebar-heading {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  /* Light slate grey for section headings */
  padding: 0 1.5rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
}

.sidebar .nav {
  padding: 0 1rem;
}

.sidebar .nav-link {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #e2e8f0;
  /* Light grey for nav links */
  text-decoration: none;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
  position: relative;
}

.sidebar .nav-link i {
  margin-right: 1rem;
  font-size: 1.25rem;
  width: 24px;
  text-align: center;
  color: #cbd5e1;
  /* Slightly muted for icons */
}

.sidebar .nav-link:hover {
  color: #ffffff;
  background-color: rgba(59, 130, 246, 0.15);
  /* Blue tint on hover */
  transform: translateX(4px);
}

.sidebar .nav-link:hover i {
  color: #60a5fa;
  /* Brighter blue for icons on hover */
}

.sidebar .nav-link.active {
  color: #ffffff;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  /* Blue gradient for active */
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.sidebar .nav-link.active i {
  color: #ffffff;
}

.sidebar .nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 60%;
  background: #fbbf24;
  /* Amber accent strip */
  border-radius: 0 2px 2px 0;
}

/* Sidebar Overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1035;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Body states */
body.sidebar-open {
  overflow: hidden;
}

/* Remove the problematic filter: blur() from main-content that breaks fixed positioning */
/* Instead, we'll use a backdrop-filter overlay approach */

/* Backdrop blur overlay - positioned above content but below sidebar */
.sidebar-backdrop-blur {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  backdrop-filter: blur(2px);
  z-index: 1037;
  /* Above content (1000-1030) but below sidebar overlay (1035) and sidebar (1040) */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
  /* Allow clicks to pass through */
}

.sidebar-backdrop-blur.active {
  opacity: 1;
  visibility: visible;
}

/* Main Content Area */
.main-content {
  margin-left: 0;
  margin-top: var(--navbar-height);
  min-height: calc(100vh - 38px - 60px);
  /* Account for header (38px) and fixed footer (60px) */
  background-color: var(--bg-secondary);
  transition: filter 0.3s ease;
  overflow-x: hidden;
  padding-bottom: 20px;
  /* Reduced from 80px to minimize unnecessary scrolling */
}

.card-header {
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, white 100%);
  border-bottom: 1px solid var(--border-color);
  padding: 1.0rem;
  font-weight: 500;
  font-size: 0.6rem;
  color: #6c757d;
}

.card-header .badge.bg-primary {
  background-color: #198754 !important;
  padding: 0.5rem 0.8rem !important;
  /* Increased padding to make badge larger */
  border-radius: 0.375rem !important;
  /* Slightly more rounded corners */
  font-size: 0.9rem !important;
  /* Increased font size for the badge number */
  font-weight: 600 !important;
  /* Make the number slightly bolder */
}

.card-header .card-title {
  font-size: 0.875rem;
}

.card-body {
  padding: 1.5rem;
}

/* Modern List Groups */
.list-group-item {
  border: none;
  border-left: 4px solid transparent;
  background-color: transparent;
  padding: 1rem 1.5rem;
  transition: all 0.2s ease;
}

.list-group-item:hover {
  background-color: var(--bg-tertiary);
  border-left-color: var(--primary-color);
  transform: translateX(4px);
}

/* Modern Buttons */
.btn {
  font-weight: 500;
  font-size: 0.87em;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline-secondary {
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  background: white;
}

.btn-outline-secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* Modern Typography */
.h1,
.h2,
.h3,
.h4,
.h5,
.h6,
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
}

.display-4 {
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}



/* Responsive Improvements */
@media (max-width: 767.98px) {
  .container-fluid:not(.fixed-header .container-fluid) {
    padding: 0 0.5rem;
  }

  .card {
    margin-bottom: 1rem;
  }

  .sidebar-heading {
    display: none;
  }
}

/* Focus States */
.btn:focus,
.btn:active:focus,
.form-control:focus,
.form-select:focus {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  border-color: var(--primary-color);
  outline: none;
}

/* Form Control Height Matching */
.form-control-sm {
  padding: 0.5rem 0.75rem;
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Animation Classes */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.5s ease-out;
}

/* Fixed Scrollable Table Container */
.table-container {
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 0;
  position: relative;
  flex: 1;
  height: 100%;
}

.table-container table {
  margin-bottom: 0;
}

.table-container .sticky-top {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #f8f9fa !important;
  /* Light gray header */
}

/* Override table-dark headers to light style */
.table-dark,
.table-dark th,
.table-dark thead,
.table-dark thead th,
thead.table-dark {
  --bs-table-bg: #f8f9fa !important;
  --bs-table-color: #212529 !important;
  --bs-table-border-color: #dee2e6 !important;
  --bs-table-striped-bg: #ecedee !important;
  --bs-table-striped-color: #212529 !important;
  --bs-table-hover-bg: #e5e6e7 !important;
  --bs-table-hover-color: #212529 !important;
  background-color: #f8f9fa !important;
  color: #212529 !important;
  border-bottom: 2px solid #dee2e6 !important;
}

/* Pagination Styling */
.pagination-info {
  font-weight: 500;
}

.pagination-controls .btn-group .btn {
  border-radius: 0.375rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
}

.pagination-controls .btn-group .btn:first-child {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.pagination-controls .btn-group .btn:last-child {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.pagination-controls .btn-group .btn:not(:first-child):not(:last-child) {
  border-radius: 0;
}

/* Table Enhancements */
.table thead th {
  border-bottom: none !important;
  /* Remove blue border */
  font-weight: 400;
  text-transform: none;
  font-size: 0.8rem;
  letter-spacing: 0.025em;
  padding-left: 20px !important;
  /* Add left padding for first column spacing */
}

.table tbody td {
  font-size: 0.8rem;
  vertical-align: middle;
  padding-left: 20px !important;
  /* Add left padding for first column spacing */
}

.card-footer {
  background-color: var(--bg-tertiary);
  border-top: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
}

/* Custom Scrollbar */
.table-container::-webkit-scrollbar {
  width: 8px;
}

.table-container::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* Viewport optimization */
.brokerage-content {
  max-height: calc(100vh - 200px - 60px);
  /* Account for header, filters, and footer (60px) */
  display: flex;
  flex-direction: column;
  padding-top: 0.5rem;
  margin-bottom: 20px;
  /* Extra margin to ensure separation from footer */
}

.table-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  border: none !important;
  border-radius: 0;
  /* Remove all rounded corners */
}

.table-card .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  height: 100%;
  border: none !important;
}

.table-container {
  flex: 1;
  overflow-y: auto;
  max-height: calc(100vh - 300px);
  /* Ensure table doesn't extend behind footer */
  min-height: 200px;
  height: calc(100% - 60px);
  /* Account for card header */
  border: none !important;
  border-radius: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .table-container {
    max-height: calc(100vh - 350px);
    /* Account for smaller screens */
    min-height: 250px;
  }

  .pagination-info {
    font-size: 0.875rem;
    text-align: center;
    margin-bottom: 1rem;
  }

  .pagination-controls {
    text-align: center;
  }

  .brokerage-content {
    max-height: calc(100vh - 250px);
    /* Adjust for mobile */
    margin-bottom: 80px;
    /* Extra space on mobile */
  }

  .table-card {
    max-height: calc(100vh - 400px);
    /* Account for mobile layout */
  }

  .main-content {
    padding-bottom: 80px;
    /* Extra padding on mobile for footer */
  }
}

/* Footer */
.footer {
  background: white;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Fixed Footer Pagination */
.pagination-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 2px solid var(--border-color);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  padding: 0.75rem 1rem;
  /* Slightly more padding for better spacing */
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  /* Fixed height for consistent calculations */
  min-height: 60px;
  /* Ensure minimum height */
}

.pagination-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  flex: 1;
}

.pagination-timestamp {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: transparent;
  border: 1px solid var(--text-primary);
  border-radius: 3px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.7rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.pagination-btn:hover {
  background: var(--text-primary);
  color: white;
  transform: translateY(-1px);
}

.pagination-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  border-color: var(--text-muted);
  color: var(--text-muted);
}

.pagination-btn.disabled:hover {
  background: transparent;
  color: var(--text-muted);
  transform: none;
}

.pagination-info {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0 0.5rem;
  min-width: 50px;
  text-align: center;
}

/* Filter container styling */
.filter-content {
  position: relative;
  padding: 15px;
  margin-bottom: 0;
  background-color: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  min-height: auto;
}

.filter-content .card {
  border: none;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.filter-content .card-header {
  background-color: white;
  border-bottom: 1px solid #dee2e6;
  padding: 0.75rem 1rem;
}

.filter-content .card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #495057;
}

/* Autocomplete dropdown styling */
.dropdown-menu {
  position: fixed !important;
  /* Use fixed positioning to avoid container clipping */
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  z-index: 9999 !important;
  /* Very high z-index to appear above everything */
  background-color: white;
  margin-top: 1px;
}

.dropdown-item {
  padding: 0.5rem 1rem;
  cursor: pointer;
}

.dropdown-item:hover,
.dropdown-item.active {
  background-color: #e9ecef;
  color: #495057;
}

.dropdown-item small {
  font-size: 0.75rem;
}

/* Ensure the parent container allows overflow */
.filter-content {
  position: relative;
  padding: 15px;
  margin-bottom: 0;
  background-color: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  min-height: auto;
}

.filter-content .card {
  border: none;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Ensure the position-relative container for autocomplete allows overflow */
.position-relative {
  overflow: visible !important;
}

/* Layout adjustments for bottom-positioned card */
.brokerage-content {
  height: calc(60vh - 60px);
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
  /* Remove padding to extend to footer */
  padding-left: 0 !important;
  /* Remove left padding */
  padding-right: 0 !important;
  /* Remove right padding */
  margin-left: 0 !important;
  /* Remove left margin */
  margin-right: 0 !important;
  /* Remove right margin */
  position: fixed;
  bottom: 0;
  /* Extend all the way to bottom */
  left: 0;
  right: 0;
}

.brokerage-content .row {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-left: 0 !important;
  /* Remove Bootstrap row margins */
  margin-right: 0 !important;
  /* Remove Bootstrap row margins */
}

.brokerage-content .col-12 {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-left: 0 !important;
  /* Remove Bootstrap column padding */
  padding-right: 0 !important;
  /* Remove Bootstrap column padding */
}

.brokerage-content .card {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.brokerage-content .card-body {
  flex: 1;
  overflow: hidden;
  padding: 0;
}

/* Remove body padding since we're using fixed height layout */
body {
  padding-bottom: 0;
  overflow-x: hidden;
  /* Prevent horizontal scroll */
  overflow-y: auto;
  /* Allow vertical scroll */
}

/* Hide number input spinner buttons */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Sortable Table Header Styles */
.sort-header {
  color: #ffffff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sort-header:hover {
  color: #e0e0e0;
  text-decoration: none;
}

.sort-icon {
  font-size: 0.75rem;
  opacity: 0.5;
  color: white;
  margin-left: 0.25rem;
}

.sort-icon.active {
  opacity: 1;
  color: #ff8c00;
}

.sort-icon-inactive {
  font-size: 0.7rem;
  opacity: 0.5;
  color: white;
  transition: opacity 0.2s ease;
  margin-left: 0.25rem;
}

.sort-header:hover .sort-icon-inactive {
  opacity: 0.8;
}

/* View Details Link Styling for Load Board */
.view-details-link {
  color: #3b82f6 !important;
  /* Blue link color */
  text-decoration: none !important;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.view-details-link:hover {
  color: #1d4ed8 !important;
  /* Darker blue on hover */
  background-color: rgba(59, 130, 246, 0.1);
  text-decoration: none !important;
}

.view-details-link:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.actions-column {
  width: 100px;
  /* Fixed width for Actions column */
  text-align: center;
  padding: 0.5rem !important;
}

/* Order Details Modal Styling */
#orderDetailsModal .modal-dialog {
  max-width: 1200px;
}

#orderDetailsModal .modal-content {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
}

#orderDetailsModal .modal-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 25%, #334155 75%, #475569 100%);
  color: white !important;
  border-bottom: 1px solid rgba(71, 85, 105, 0.3);
}

#orderDetailsModal .modal-title {
  font-weight: 600;
  font-size: 1.25rem;
  color: white !important;
}

#orderDetailsModal .btn-close {
  filter: brightness(0) invert(1);
}

#orderDetailsModal .card {
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#orderDetailsModal .card-header {
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, white 100%);
  border-bottom: 1px solid var(--border-color);
  font-weight: 500;
}

#orderDetailsModal .card-body {
  background: white;
}

#orderDetailsModal .row.mb-3 {
  border-bottom: 1px solid #f8f9fa;
  padding-bottom: 0.5rem;
}

#orderDetailsModal .row.mb-3:last-child {
  border-bottom: none;
}

#order-map {
  border-radius: 0 0 0.375rem 0.375rem;
}

#map-error {
  margin: 1rem !important;
}

.spinner-border {
  width: 2rem;
  height: 2rem;
}

/* Mobile responsive adjustments for Rate Quote card */
@media (max-width: 768px) {
  .quote-row .col-6 {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
  }

  .quote-row .col-3 {
    text-align: center !important;
    margin-bottom: 0.25rem;
  }

  .quote-row .badge {
    font-size: 0.85rem;
    padding: 8px 12px;
    display: block;
    margin: 0 auto 0.25rem auto;
    max-width: 100%;
    word-break: break-word;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .quote-row .fw-semibold {
    font-size: 0.85rem;
  }

  /* Journey line adjustments for mobile */
  .journey-line {
    display: none;
    /* Hide dotted line on mobile since elements stack vertically */
  }

  /* Route header adjustments for mobile */
  .route-header .d-flex {
    flex-direction: column;
    gap: 0.5rem;
  }

  .route-header .badge {
    font-size: 0.8rem;
    padding: 8px 14px;
  }

  .metric-card {
    padding: 12px;
    margin: 0.5rem 0;
  }

  .metric-value {
    font-size: 1rem;
  }

  .metric-label {
    font-size: 0.7rem;
  }
}

/* Stack badges vertically on very small screens */
@media (max-width: 576px) {
  .quote-row .row {
    flex-direction: column;
    text-align: center;
  }

  .quote-row .col-3 {
    margin-bottom: 0.5rem;
    width: 100%;
  }

  .quote-row .badge {
    font-size: 0.8rem;
    padding: 7px 10px;
    display: inline-block;
    margin: 0.1rem;
  }

  .quote-row .col-6 {
    text-align: center;
    margin-bottom: 0.75rem;
  }

  /* Make badges wrap instead of overflow */
  .quote-row .text-end {
    text-align: center !important;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
  }
}