/* Updated: 1739285998 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f7fa;
    color: #333;
}

.admin-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
}

.sidebar {
    grid-row: 1 / -1;
    background: #2c3e50;
    color: white;
    padding: 0;
}

.sidebar-header {
    padding: 20px;
    background: #34495e;
    border-bottom: 1px solid #2c3e50;
}

.nav-menu {
    list-style: none;
    padding: 0;
}

.nav-item {
    border-bottom: 1px solid #34495e;
}

.nav-link {
    display: block;
    padding: 15px 20px;
    color: #bdc3c7;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
}

.nav-link:hover {
    background: #34495e;
    color: white;
}

.nav-submenu {
    background: #1a252f;
    display: none;
}

.nav-submenu.show {
    display: block;
}

.nav-submenu .nav-link {
    padding: 12px 20px 12px 52px;
    font-size: 14px;
}

.main-content {
    flex: 1;
    background: #f5f7fa;
    display: flex;
    flex-direction: column;
}

.header {
    background: white;
    padding: 15px 30px;
    border-bottom: 1px solid #e1e8ed;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
    display: block;
}

.content-area {
    padding: 30px;
    grid-column: 2;
    grid-row: 2;
    background: #f5f7fa;
}

.content-section {
    display: none;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    margin: 5px;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.test-area {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 2px dashed #dee2e6;
}

/* Booking Edit Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

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

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 22px;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
}

.modal-body {
    padding: 30px;
}

.edit-section {
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
}

.edit-section h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    border-bottom: 2px solid #f8f9fa;
    padding-bottom: 10px;
}

.edit-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.edit-field {
    display: flex;
    flex-direction: column;
}

.edit-field label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
    font-size: 14px;
}

.edit-field input,
.edit-field select,
.edit-field textarea {
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.edit-field input:focus,
.edit-field select:focus,
.edit-field textarea:focus {
    outline: none;
    border-color: #007bff;
}

.modal-actions {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 0 0 12px 12px;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-btn-primary {
    background: #007bff;
    color: white;
}

.modal-btn-primary:hover {
    background: #0056b3;
}

.modal-btn-success {
    background: #28a745;
    color: white;
}

.modal-btn-success:hover {
    background: #1e7e34;
}

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

/* 🆕 BOOKING OVERVIEW STYLES */
.overview-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #007bff;
}

.overview-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f8f9fa;
}

.overview-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f8f9fa;
}

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

.overview-label {
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

.overview-value {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    text-align: right;
}

.overview-total {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    border: 2px solid #dee2e6;
}

.overview-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    font-size: 16px;
}

.overview-total-row:last-child {
    font-weight: 700;
    font-size: 20px;
    color: #2c3e50;
    border-top: 2px solid #dee2e6;
    padding-top: 15px;
    margin-top: 10px;
}

.modal-btn-danger:hover {
    background: #c82333;
}

.modal-btn-secondary {
    background: #6c757d;
    color: white;
}

.modal-btn-secondary:hover {
    background: #545b62;
}

/* Status Dropdown */
.status-dropdown {
    position: relative;
    display: inline-block;
}

.status-badge {
    background: #ffc107;
    color: #856404;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
}

.status-badge:hover {
    background: #e0a800;
    transform: translateY(-1px);
}

.status-badge.confirmed {
    background: #28a745;
    color: white;
}

.status-badge.confirmed:hover {
    background: #1e7e34;
}

.status-badge.cancelled {
    background: #dc3545;
    color: white;
}

.status-badge.cancelled:hover {
    background: #c82333;
}

.status-dropdown-menu {
    position: fixed;
    min-width: 180px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    display: none;
    max-height: 300px;
    overflow-y: auto;
}

.status-dropdown-menu.show {
    display: block;
}

.status-option {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-option:hover {
    background: #f8f9fa;
}

.status-option:first-child {
    border-radius: 6px 6px 0 0;
}

.status-option:last-child {
    border-radius: 0 0 6px 6px;
}

.status-option.current {
    background: #e3f2fd;
    color: #1976d2;
    font-weight: 600;
}

.status-option .status-icon {
    width: 16px;
    text-align: center;
}

/* Driver Dropdown */
.driver-dropdown {
    position: relative;
    display: inline-block;
}

.driver-badge {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.driver-badge.unassigned {
    background: #6c757d;
    color: white;
}

.driver-badge.unassigned:hover {
    background: #545b62;
}

.driver-badge.assigned {
    background: #28a745;
    color: white;
}

.driver-badge.assigned:hover {
    background: #218838;
}

.driver-badge.pending {                                                                                                       
      background: #ffc107;                                                                                                      
      color: #000;                                                                                                              
  }                                                                                                                             
  .driver-badge.pending:hover {                                                                                                 
      background: #e0a800;                                                                                                      
  } 

.driver-dropdown-menu {
    position: fixed;
    min-width: 200px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    display: none;
    max-height: 300px;
    overflow-y: auto;
}

.driver-dropdown-menu.show {
    display: block;
}

.driver-option {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.driver-option:hover {
    background: #f8f9fa;
    color: #495057;
}

.driver-option.selected {
    background: #28a745;
    color: white;
}

.driver-option.unassign {
    border-top: 1px solid #dee2e6;
    color: #dc3545;
}

.driver-option.unassign:hover {
    background: #f8d7da;
    color: #721c24;
}

/* REUSABLE CLASSES TO REPLACE INLINE STYLES */
.table-cell {
    padding: 12px;
}

.table-header {
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.input-field {
    width: 100%;
    padding: 10px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}

.form-label-alt {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
}

.section-margin {
    margin-bottom: 15px;
}

.section-margin-lg {
    margin-bottom: 20px;
}

.section-padding {
    padding: 15px;
}

.input-field-alt {
    width: 100%;
    padding: 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.text-color {
    color: #2c3e50;
    margin-bottom: 15px;
}

.input-large {
    width: 100%;
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
}

.form-label-gray {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}

.small-text {
    font-size: 12px;
    color: #666;
}

.help-text {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-size: 13px;
}

.card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.margin-left {
    margin-left: 5px;
}

.field-label {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

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

.font-medium {
    font-weight: 500;
}

.form-label-dark {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
}

.input-xlarge {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
}

.table-cell-alt {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.btn-outline {
    background: white;
    border: 1px solid #dee2e6;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
}

.field-value {
    margin-top: 4px;
    font-size: 16px;
    color: #2c3e50;
}

.white-card-12 {
    background: white;
    border-radius: 12px;
}

.padding-15 {
    padding: 15px;
}

.margin-bottom-20 {
    margin-bottom: 20px;
}

/* LAYOUT FIXES */
.page-header {
    background: white;
    padding: 15px 30px;
    border-bottom: 1px solid #e1e8ed;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
    display: block;
    grid-column: 2;
    grid-row: 1;
}

.page-header h1 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 600;
    color: #2c3e50;
}

.page-header p {
    margin: 0;
    color: #6c757d;
    font-size: 16px;
}

.section-header {
    margin-bottom: 20px;
}

.section-toolbar {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.ml-auto {
    margin-left: auto;
}

.text-nowrap {
    white-space: nowrap;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 5px 0;
}

.page-subtitle {
    color: #6c757d;
    font-size: 16px;
    margin: 0 0 20px 0;
}

/* DISPATCH CALENDAR STYLING */
.dispatch-calendar {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #007bff;
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    margin-top: 10px;
    padding: 10px;
}

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

.calendar-nav {
    width: 28px;
    height: 28px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.calendar-nav:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.calendar-month {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-day-header {
    padding: 5px 2px;
    font-size: 10px;
    font-weight: 600;
    color: #666;
    text-align: center;
    text-transform: uppercase;
}

.calendar-day {
    padding: 6px 2px;
    text-align: center;
    cursor: pointer;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-day:hover {
    background: #e3f2fd;
    color: #007bff;
}

.calendar-day.today {
    background: #007bff;
    color: white;
    font-weight: 600;
}

.calendar-day.selected {
    background: #28a745;
    color: white;
    font-weight: 600;
}

.calendar-day.disabled {
    color: #ccc;
    cursor: not-allowed;
}

.calendar-day.disabled:hover {
    background: transparent;
    color: #ccc;
}

/* Toggle Switch Styling */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #28a745;
}

input:checked+.slider:before {
    transform: translateX(26px);
}

/* Table wrapper for mobile scrolling */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {

    /* Admin layout for mobile */
    .admin-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    /* Sidebar as mobile menu */
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for iOS */
        height: -webkit-fill-available; /* Fallback for older iOS */
        display: block;
        z-index: 10000;
        transition: left 0.3s ease;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        padding-bottom: env(safe-area-inset-bottom, 20px); /* Space for iOS home indicator */
    }

    .sidebar.mobile-menu-open {
        left: 0;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    }

    /* Mobile menu overlay */
    .sidebar.mobile-menu-open::after {
        content: '';
        position: fixed;
        top: 0;
        left: 280px;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }

    /* Mobile menu toggle button */
    .mobile-menu-toggle {
        display: block;
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 9999;
        background: #2c3e50;
        color: white;
        border: none;
        padding: 10px 15px;
        border-radius: 5px;
        font-size: 20px;
        cursor: pointer;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
        transition: background 0.3s ease;
    }

    .mobile-menu-toggle:hover {
        background: #34495e;
    }

    /* Header adjustments */
    .header {
        padding: 15px 15px 15px 60px;
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .content-area {
        grid-column: 1;
        padding: 8px;
        margin-top: 0;
        margin-left: 0;
        margin-right: 0;
        width: 100vw !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    /* Content section mobile padding */
    .content-section {
        padding: 5px 5px;
        margin: 0;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    /* Table responsive wrapper */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Table responsive */
    table {
        min-width: 600px;
        font-size: 14px;
    }

    .content-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    /* Stack cards on mobile */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .actions-bar {
        flex-direction: column;
        gap: 10px;
    }

    .search-container {
        width: 100%;
    }

    .action-buttons {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    /* Button adjustments for touch */
    button,
    .nav-link {
        min-height: 44px;
        /* iOS touch target size */
    }

    /* Form adjustments */
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group {
        margin-bottom: 15px;
    }

    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    select,
    textarea {
        width: 100%;
        padding: 12px;
        font-size: 16px;
        /* Prevent zoom on iOS */
    }

    /* Modal adjustments */
    .modal-content {
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
        margin: 2.5% auto;
    }

    .modal-body {
        padding: 20px 15px;
    }

    /* Table button adjustments */
    td button {
        padding: 8px 10px;
        font-size: 12px;
        margin: 2px;
        white-space: nowrap;
    }

    /* Booking cards mobile */
    .booking-card {
        padding: 15px;
        margin-bottom: 15px;
    }

    /* Statistics cards */
    .stat-card {
        padding: 15px;
    }

    /* Hide button text on very small screens */
    @media (max-width: 375px) {
        td button {
            padding: 8px;
            font-size: 16px;
        }

        td button span {
            display: none;
        }

        .header h1 {
            font-size: 20px;
        }
    }
}

/* Desktop-only styles */
@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none;
    }
}

/* Ensure touch targets are adequate - only for mobile */

/* Override for fieldset-based form fields */
fieldset input,
fieldset select,
fieldset textarea {
    min-height: auto;
    height: auto;
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    font-size: 16px;
    padding: 0;
    box-sizing: border-box;
}

fieldset {
    margin: 0;
}

fieldset legend {
    font-size: 13px;
    color: #999;
    padding: 0 8px;
    font-weight: 400;
}

/* Additional mobile enhancements */
@media (max-width: 768px) {

    /* Ensure touch targets are adequate on mobile */
    button,
    a,
    input,
    select,
    textarea {
        min-height: 44px;
    }

    /* But not inside fieldsets */
    fieldset input,
    fieldset select,
    fieldset textarea {
        min-height: auto;
    }

    /* Improve touch targets */
    .btn {
        padding: 12px 20px;
        font-size: 16px;
    }

    /* Mobile-friendly tables */
    .booking-table td,
    .booking-table th {
        padding: 10px 8px;
        font-size: 14px;
    }

    /* Responsive grid for vehicle cards */
    .vehicle-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    /* Mobile-friendly forms */
    .form-row {
        display: block;
        margin-bottom: 15px;
    }

    .form-row>* {
        width: 100%;
        margin-bottom: 10px;
    }

    /* Fix select dropdowns on mobile */
    select {
        background-position: right 10px center;
        padding-right: 30px;
    }

    /* Mobile nav improvements */
    .nav-submenu .nav-link {
        padding-left: 40px;
        border-left: 3px solid transparent;
    }

    .nav-submenu .nav-link:hover {
        border-left-color: #3498db;
    }

    /* Mobile header with menu icon space */
    h1,
    h2 {
        word-break: break-word;
    }

    /* Allow horizontal scroll for tables but not the whole page */
    body {
        overflow-x: hidden;
    }

    .admin-layout {
        overflow-x: hidden;
    }

    /* Exception: allow table containers to scroll horizontally */
    #unconfirmedContainer,
    #next24hBookingsContainer,
    .table-responsive {
        overflow-x: scroll !important;
        -webkit-overflow-scrolling: touch !important;
        max-width: 100vw !important;
    }

    /* Allow content-section to contain scrollable tables */
    .content-section {
        overflow-x: visible !important;
    }
}

/* Landscape mobile adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .sidebar {
        max-width: 50vw;
    }

    .content-section {
        padding: 15px;
    }

    .modal-content {
        max-height: 85vh;
    }
}

/* Improve readability on small screens */
@media (max-width: 768px) {
    body {
        font-size: 16px;
        /* Prevent zoom on iOS */
    }

    input,
    select,
    textarea {
        font-size: 16px;
        /* Prevent zoom on iOS */
    }
}

/* Tablet specific adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .admin-layout {
        grid-template-columns: 220px 1fr;
    }

    .sidebar {
        font-size: 14px;
    }

    .nav-link {
        padding: 12px 15px;
    }

    .content-area {
        padding: 20px;
    }
}





@media only screen and (max-width: 768px) {

    /* Dispatch: verticaal stapelen */
    #dispatch-section {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    #dispatchGrid {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: none !important;
        height: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        gap: 10px !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }

    #dispatchGrid>div {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-bottom: 15px !important;
        box-sizing: border-box !important;
        max-height: none !important;
        height: auto !important;
        overflow-y: visible !important;
        overflow-x: hidden !important;
        padding: 10px !important;
    }

    body, html, .admin-layout {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    /* Alle content secties zelfde als dispatch */
    .content-section {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }

    .content-section > p,
    .content-section > .section-toolbar {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Tabel containers: scrollbaar binnen scherm */
    .content-section > div:not(.section-toolbar) {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: scroll !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .content-section table {
        font-size: 11px !important;
        min-width: 900px !important;
    }

    .content-section table th,
    .content-section table td {
        padding: 6px 4px !important;
        word-break: break-word !important;
    }

    /* Bookings: scrollable tabel binnen container */
    [id$="BookingsContainer"],
    [id$="Container"] {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        box-sizing: border-box !important;
    }

    /* Toolbar knoppen wrappen op mobiel */
    .section-toolbar {
        flex-wrap: wrap !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    .section-toolbar button {
        padding: 6px 10px !important;
        font-size: 12px !important;
    }

    .section-toolbar input[type="text"] {
        width: 100% !important;
        margin-left: 0 !important;
    }

    .section-toolbar > div {
        margin-left: 0 !important;
        width: 100% !important;
        justify-content: flex-start !important;
    }
}
/* ============================================
   STATUS DROPDOWN STYLES
   ============================================ */
.status-dropdown {
    position: relative;
    display: inline-block;
}

.status-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 140px;
    margin-top: 4px;
}

.status-option {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.status-option:hover {
    background: #f8f9fa;
}

.status-option.selected {
    background: #e3f2fd;
    font-weight: 500;
}

.status-option:first-child {
    border-radius: 6px 6px 0 0;
}

.status-option:last-child {
    border-radius: 0 0 6px 6px;
}

/* ============================================
   BOOKING ACTION MENU STYLES
   ============================================ */
.booking-action-dropdown {
    position: relative;
    display: inline-block;
}

.booking-action-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 120px;
    margin-top: 4px;
}

/* ============================================
   TABLE CELL STYLES
   ============================================ */
.table-cell {
    padding: 12px 8px;
    vertical-align: middle;
}

.font-medium {
    font-weight: 500;
}

.small-text {
    font-size: 11px;
    color: #666;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
}

.empty-state h3 {
    color: #6c757d;
    margin: 0 0 10px 0;
}

.empty-state p {
    color: #adb5bd;
    margin: 0;
}

/* ============================================
   MOBILE: BOOKING OVERVIEW MODAL FIX
   Knoppen (Sluiten/Bewerken) moeten ONDER de
   boeking content staan, niet ernaast.
   ============================================ */
@media (max-width: 768px) {
    /* Modal fullscreen op mobiel */
    #bookingOverviewModal {
        padding: 0 !important;
    }

    /* Witte container: fullscreen */
    #bookingOverviewModal > div,
    #bookingOverviewModal > .booking-overview-container {
        max-width: 100% !important;
        width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        box-sizing: border-box !important;
    }

    /* Header */
    #bookingOverviewModal > div > div:first-child {
        border-radius: 0 !important;
    }

    /* Footer knoppen: ONDER elkaar, volle breedte */
    .booking-overview-footer {
        flex-direction: column !important;
        gap: 8px !important;
        padding: 15px !important;
    }

    .booking-overview-footer button {
        width: 100% !important;
        padding: 14px 24px !important;
        font-size: 16px !important;
    }

    /* Edit modal ook fullscreen */
    #bookingEditModal {
        padding: 0 !important;
    }

    #bookingEditModal > div {
        max-width: 100% !important;
        width: 100% !important;
        border-radius: 0 !important;
        max-height: 100vh !important;
    }
}

/* ============================================
   MOBILE: DRIVER DROPDOWN ZICHTBAAR OP SCHERM
   ============================================ */
@media (max-width: 768px) {
    .driver-dropdown-overlay {
        display: none !important;
    }

    /* Zelfde stijl als status dropdown, maar fixed zodat het niet buiten scherm valt */
    .driver-dropdown-menu {
        position: fixed !important;
        max-height: 300px !important;
        overflow-y: auto !important;
        min-width: 200px !important;
        z-index: 99999 !important;
    }
}
