/* ============================================
   Zuidplas Logistics - Clean Admin Dashboard
   Pure White, Professional Design
   ============================================ */

/* === Reset & Base Styles === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #ffffff; /* PURE WHITE */
    min-height: 100vh;
    color: #1f2937;
    line-height: 1.6;
    padding: 0;
    margin: 0;
}

/* === Sidebar === */
.sidebar {
    display: none !important; /* Hide sidebar - using top navigation instead */
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar.collapsed .sidebar-logo span,
.sidebar.collapsed .nav-link span:not(.nav-icon),
.sidebar.collapsed .sidebar-footer {
    display: none;
}

.sidebar.collapsed .sidebar-logo {
    justify-content: center;
    padding: 24px 0;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 12px 0;
}

/* === Truck Selector === */
.truck-selector-container {
    background: #f8f9fa;
    padding: 20px;
    margin: 15px 0;
    border-radius: 8px;
    border-left: 4px solid #ff6b00;
}

.truck-selector-hint {
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 10px;
}

.truck-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0;
}

.truck-option {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #ffffff;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.truck-option:hover:not(.disabled) {
    border-color: #ff6b00;
    background: #fff5f0;
}

.truck-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
}

.truck-option input[type="checkbox"] {
    margin-right: 10px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.truck-option.disabled input[type="checkbox"] {
    cursor: not-allowed;
}

.truck-name {
    font-weight: 500;
    flex: 1;
}

.truck-unavailable {
    color: #dc3545;
    font-size: 13px;
    font-style: italic;
}

.selected-trucks-summary {
    margin-top: 15px;
    padding: 12px;
    background: #e7f3ff;
    border-radius: 6px;
    border-left: 4px solid #0066cc;
}

.selected-trucks-summary strong {
    color: #0066cc;
}

.route-truck-allocation {
    margin-top: 20px;
}

.truck-allocation-summary {
    margin-top: 10px;
    text-align: right;
}

/* === Language Selector === */
.language-selector {
    margin-right: 16px;
}

.language-selector select {
    padding: 8px 12px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    background: #ffffff;
    cursor: pointer;
    font-size: 14px;
}

.allocation-summary-content {
    margin: 15px 0;
}

.route-allocation-item {
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
}

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

.sidebar-close {
    display: none;
    position: absolute;
    right: 16px;
    top: 16px;
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.sidebar-close:hover {
    background: #f9fafb;
}

.sidebar-toggle {
    position: absolute;
    right: 12px; /* Inside sidebar, 12px from right edge */
    top: 20px;
    width: 36px;
    height: 36px;
    background: #f97316;
    border: 2px solid #f97316;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
    z-index: 1001;
    transition: all 0.3s ease;
    overflow: visible;
}

.sidebar-toggle:hover {
    background: #ea580c;
    border-color: #ea580c;
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.6);
    transform: scale(1.08);
}

.sidebar-toggle svg {
    width: 20px;
    height: 20px;
    color: white;
    transition: color 0.2s;
    display: block;
    overflow: visible;
    padding: 0;
}

.sidebar-toggle svg line {
    stroke-width: 2;
    stroke-linecap: round;
    stroke: white;
}

.sidebar.collapsed .sidebar-toggle {
    right: 17px; /* Centered when collapsed (70px - 36px button) / 2 ≈ 17px */
}

.sidebar.collapsed .sidebar-toggle svg {
    transform: none;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    position: relative;
    transition: padding 0.3s ease;
    flex-shrink: 0;
    min-height: 60px;
}

.sidebar-logo svg {
    flex-shrink: 0;
}

.sidebar-logo span {
    transition: opacity 0.2s;
    white-space: nowrap;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto; /* Allow scrolling if needed */
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: #6b7280;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    position: relative;
    flex-shrink: 0;
}

.nav-link:hover {
    background: #f9fafb;
    color: #1f2937;
}

.nav-link.active {
    background: #fef3c7;
    color: #f97316;
    border-left-color: #f97316;
    font-weight: 500;
}

.nav-link span:not(.nav-icon) {
    transition: opacity 0.2s;
}

.nav-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 12px 0;
}

/* === Sidebar Footer === */
.sidebar-footer {
    margin-top: auto;
    padding: 12px 20px;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
    position: relative;
    z-index: 1000;
    background: #ffffff;
    min-height: 80px; /* Ensure enough space */
}

.sidebar.collapsed .sidebar-footer {
    padding: 12px 0;
}

/* === Logout Button === */
.logout-btn {
    width: 100% !important;
    padding: 12px 16px !important;
    background: #ef4444 !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    transition: all 0.2s !important;
    position: relative !important;
    z-index: 100 !important;
    pointer-events: auto !important;
    display: block !important;
    text-align: center !important;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2) !important;
}

.logout-btn:hover {
    background: #dc2626 !important;
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3) !important;
    transform: translateY(-1px) !important;
}

.logout-btn:active {
    background: #b91c1c !important;
    transform: translateY(0) !important;
}

.logout-btn:focus {
    outline: 2px solid #ef4444 !important;
    outline-offset: 2px !important;
}

.lang-switcher {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.lang-btn {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    color: #6b7280;
}

.lang-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.lang-btn.active {
    background: #f97316;
    color: white;
    border-color: #f97316;
}

.sidebar.collapsed .lang-switcher {
    flex-direction: column;
    gap: 4px;
}

.sidebar.collapsed .lang-btn {
    padding: 8px;
    font-size: 11px;
}

/* === Mobile Menu Button === */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1002;
    background: white;
    border: 2px solid #f97316;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.25);
    transition: all 0.2s;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
}

.mobile-menu-btn:hover {
    background: #f97316;
    box-shadow: 0 6px 16px rgba(249, 115, 22, 0.35);
}

.mobile-menu-btn:hover svg {
    color: white;
}

.mobile-menu-btn svg {
    width: 24px;
    height: 24px;
    color: #f97316;
    transition: color 0.2s;
}

/* === Main Content === */
.main-content {
    margin-left: 0 !important; /* No sidebar - using top navigation */
    min-height: 100vh;
    background: #ffffff;
    transition: margin-left 0.3s ease;
    padding-left: 24px; /* Proper spacing */
    padding-right: 24px;
    padding-top: 20px;
}

.sidebar.collapsed ~ .main-content {
    margin-left: 0;
    padding-left: 30px; /* Maintain spacing even when collapsed */
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px;
}

/* === Page Header === */
.page-header {
    margin-bottom: 32px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.page-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 28px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.page-subtitle {
    font-size: 14px;
    color: #6b7280;
}

/* Dashboard Controls */
.dashboard-controls {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.date-picker-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.date-picker-label {
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.date-input-group {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #f97316;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(249, 115, 22, 0.1);
}

.date-input-group:focus-within {
    border-color: #ea580c;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
}

.date-input {
    border: none;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    background: transparent;
    outline: none;
    min-width: 160px;
}

.date-input:focus {
    color: #f97316;
}

.date-input::-webkit-calendar-picker-indicator {
    opacity: 0;
    position: absolute;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    background: #fff7ed;
    border: none;
    border-left: 1px solid #f97316;
    color: #f97316;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #f97316;
    color: white;
}

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

.btn-sync,
.btn-refresh,
.btn-demo {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid #f97316;
    border-radius: 8px;
    background: #f97316;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    z-index: 10;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.btn-sync {
    /* Same orange style as other buttons */
}

.btn-demo:focus,
.btn-demo:active {
    outline: none;
    border-color: #ea580c;
    background: #ea580c;
}

.btn-sync:hover {
    background: #ea580c;
    border-color: #ea580c;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.btn-refresh:hover,
.btn-demo:hover {
    background: #ea580c;
    border-color: #ea580c;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.btn-sync:active,
.btn-refresh:active,
.btn-demo:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(249, 115, 22, 0.2);
}

.btn-sync:disabled,
.btn-refresh:disabled,
.btn-demo:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-sync svg,
.btn-refresh svg,
.btn-demo svg {
    flex-shrink: 0;
    transition: transform 0.3s;
}

.btn-sync.refreshing svg,
.btn-refresh.refreshing svg {
    animation: spin 1s linear infinite;
}

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

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

.auto-refresh-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 6px;
    font-size: 13px;
    color: #166534;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    animation: pulse 2s infinite;
}

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

.last-updated {
    font-size: 13px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 4px;
}

.last-updated strong {
    color: #1f2937;
    font-weight: 600;
}

.current-date-time {
    font-size: 13px;
    color: #9ca3af;
    padding: 10px 0;
    white-space: nowrap;
    font-weight: 500;
}

.api-status-message {
    margin-top: 16px;
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: 8px;
    font-size: 14px;
    color: #6b7280;
    text-align: center;
    display: none;
}

.api-status-message.show {
    display: block;
}

.api-status-message.success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.api-status-message.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* === Stats Grid === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 24px;
    transition: box-shadow 0.2s;
}

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

.stat-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: #fff7ed;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon-wrapper svg {
    width: 24px;
    height: 24px;
    color: #f97316;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: #6b7280;
}

/* === Cards === */
.card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    transition: box-shadow 0.2s;
}

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

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

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.card h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 20px;
}

/* === Buttons === */
.btn {
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: #ea580c;
}

.btn-secondary {
    background: white;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

.btn-secondary:hover {
    background: #f9fafb;
}

/* === Tables === */
.table-container {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

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

.data-table thead {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
}

.data-table td {
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
    color: #1f2937;
}

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

/* === Badges === */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge.primary {
    background: #f97316;
    color: white;
}

/* === Route Cards === */
.route-grid {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.route-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.2s;
}

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

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

.route-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1f2937;
}

.route-time {
    background: #f97316;
    color: white;
    padding: 6px 12px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.85rem;
}

.route-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.route-info-item {
    display: flex;
    flex-direction: column;
}

.route-info-label {
    color: #6b7280;
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.route-info-value {
    font-weight: 600;
    font-size: 1rem;
    color: #1f2937;
}

.route-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    margin: 15px 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #f97316;
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* === Info Boxes === */
.info-box {
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.info-box.warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.info-box.info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

.info-box.success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

/* === Forms === */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: #f97316;
}

.form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.form-select:focus {
    outline: none;
    border-color: #f97316;
}

/* === Responsive Design === */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }
    
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        box-shadow: 2px 0 12px rgba(0,0,0,0.1);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar.collapsed {
        width: 280px;
    }
    
    .sidebar-close {
        display: block;
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
        background: #f97316;
        border-radius: 8px;
        z-index: 1002;
    }
    
    .sidebar-close svg {
        color: white;
        width: 20px;
        height: 20px;
    }
    
    .sidebar-toggle {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        padding-top: 0;
    }
    
    .sidebar.collapsed ~ .main-content {
        margin-left: 0;
    }
    
    .container {
        padding: 16px;
        margin-top: 0;
    }
    
    .page-header {
        padding: 16px;
        margin-bottom: 20px;
    }
    
    .page-title {
        font-size: 22px;
        margin-bottom: 8px;
    }
    
    .page-subtitle {
        font-size: 14px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 28px;
    }
    
    .stat-label {
        font-size: 13px;
    }
    
    .card {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    /* Better mobile spacing */
    .page-header > * {
        margin-bottom: 12px;
    }
    
    input[type="date"],
    input[type="text"],
    select {
        width: 100%;
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* === Utility Classes === */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

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

/* === Truck Visualization === */
.truck-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.truck-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease;
}

.truck-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.truck-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f3f4f6;
}

/* Truck Body Visual */
.truck-body {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border: 3px solid #d1d5db;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    position: relative;
    min-height: 200px;
}

.truck-body::before {
    content: '🚛';
    position: absolute;
    top: -15px;
    left: 20px;
    font-size: 32px;
    background: white;
    padding: 4px 8px;
    border-radius: 8px;
    border: 2px solid #d1d5db;
}

.truck-slots {
    display: grid;
    grid-template-columns: repeat(17, 1fr);
    gap: 6px;
    margin-top: 10px;
}

.cart-slot {
    aspect-ratio: 1;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
    border: 2px solid transparent;
    cursor: pointer;
    position: relative;
}

.cart-slot:hover {
    transform: scale(1.1);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.cart-slot.filled-standard {
    background: linear-gradient(135deg, var(--cart-color, #3b82f6) 0%, var(--cart-color-dark, #2563eb) 100%);
    border-color: var(--cart-color, #3b82f6);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cart-slot.filled-danish {
    background: linear-gradient(135deg, var(--cart-color, #8b5cf6) 0%, var(--cart-color-dark, #7c3aed) 100%);
    border-color: var(--cart-color, #8b5cf6);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}

.cart-slot.filled-danish::after {
    content: '🇩🇰';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 8px;
}

.cart-slot.empty {
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    color: #9ca3af;
    font-size: 10px;
}

.cart-slot.overflow {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #ef4444;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Client Legend */
.client-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
}

.client-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #374151;
}

.client-color-box {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid rgba(0,0,0,0.1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Capacity Indicator */
.capacity-indicator {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.capacity-bar {
    width: 100%;
    height: 8px;
    background: #f3f4f6;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

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

.capacity-fill.warning {
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.capacity-fill.danger {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

/* Route Assignment */
.route-assignment {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    font-size: 14px;
}

.route-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #fff7ed;
    color: #f97316;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 8px;
    margin-top: 4px;
}

/* Cart List */
.cart-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f9fafb;
    border-radius: 6px;
    border-left: 4px solid #e5e7eb;
    transition: all 0.2s;
}

.cart-item:hover {
    background: #f3f4f6;
    border-left-color: #f97316;
}

.cart-item.danish {
    border-left-color: #8b5cf6;
}

.cart-item.standard {
    border-left-color: #3b82f6;
}

/* ============================================
   Route Summary Cards Styling
   ============================================ */

.route-summary {
    margin: 2rem 0;
}

.route-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.route-summary-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-left: 6px solid;
    transition: transform 0.2s, box-shadow 0.2s;
}

.route-summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.route-summary-card.rijnsburg {
    border-left-color: #10b981;
}

.route-summary-card.aalsmeer {
    border-left-color: #3b82f6;
}

.route-summary-card.naaldwijk {
    border-left-color: #f59e0b;
}

.route-summary-card.zuidplas {
    border-left-color: #8b5cf6;
}

.route-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.route-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
}

.departure-time {
    background: #f3f4f6;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: bold;
    color: #374151;
    font-size: 0.875rem;
}

.route-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1rem 0;
}

.route-stats .stat {
    text-align: center;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 6px;
}

.route-stats .stat label {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.route-stats .stat span {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #111827;
}

.danish-indicator {
    background: #fee2e2;
    color: #991b1b;
    padding: 0.5rem;
    border-radius: 6px;
    text-align: center;
    font-size: 0.875rem;
    margin: 1rem 0;
    font-weight: 500;
}

.btn-view-details {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 1rem;
}

.btn-view-details:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.btn-view-details:active {
    transform: translateY(0);
}

/* Customer list modal - scrollable popup */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    backdrop-filter: blur(2px);
}

.customer-list-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    max-height: 80vh; /* Maximum 80% of screen height */
    width: 90%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.customer-list-modal h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #1f2937;
    font-size: 1.5rem;
    border-bottom: 2px solid #ff6b00;
    padding-bottom: 10px;
    flex-shrink: 0;
}

.customer-list-modal .modal-stats {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
    flex-shrink: 0;
}

.customer-list-modal .modal-stats p {
    margin: 5px 0;
    font-size: 0.95rem;
    color: #4b5563;
}

.customer-list-modal .customer-list-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    margin-bottom: 20px;
    padding-right: 10px;
}

.customer-list-modal .customer-list-container::-webkit-scrollbar {
    width: 8px;
}

.customer-list-modal .customer-list-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.customer-list-modal .customer-list-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.customer-list-modal .customer-list-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.customer-list-modal ol {
    margin: 0;
    padding-left: 25px;
    list-style: decimal;
}

.customer-list-modal li {
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
    color: #374151;
    font-size: 0.95rem;
}

.customer-list-modal li:last-child {
    border-bottom: none;
}

.customer-list-modal .modal-close-btn {
    margin-top: auto;
    padding: 12px 30px;
    background: #ff6b00;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;
    width: 100%;
}

.customer-list-modal .modal-close-btn:hover {
    background: #e55a00;
    transform: translateY(-1px);
}

.customer-list-modal .modal-close-btn:active {
    transform: translateY(0);
}

/* Mismatch report modal */
.mismatch-report-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    max-height: 85vh;
    width: 95%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mismatch-report-modal h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #ef4444;
    font-size: 1.5rem;
    border-bottom: 2px solid #ef4444;
    padding-bottom: 10px;
    flex-shrink: 0;
}

/* Raw Florinet API export modal */
.raw-api-export-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    max-height: 85vh;
    width: 95%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.raw-api-export-modal h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #10b981; /* green */
    font-size: 1.5rem;
    border-bottom: 2px solid #10b981;
    padding-bottom: 10px;
    flex-shrink: 0;
}

.raw-api-export-modal .modal-stats {
    margin-bottom: 10px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
    flex-shrink: 0;
}

.raw-api-export-modal .modal-stats p {
    margin: 5px 0;
    font-size: 0.95rem;
    color: #4b5563;
}

.mismatch-list-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    margin-bottom: 20px;
}

.mismatch-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.mismatch-table thead {
    background: #f3f4f6;
    position: sticky;
    top: 0;
    z-index: 10;
}

.mismatch-table th {
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #e5e7eb;
    color: #374151;
}

.mismatch-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #e5e7eb;
    color: #4b5563;
}

.mismatch-table tbody tr:hover {
    background: #f9fafb;
}

.mismatch-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.mismatch-table tbody tr:nth-child(even):hover {
    background: #f3f4f6;
}

.modal-download-btn {
    padding: 12px 30px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;
}

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

.modal-download-btn:active {
    transform: translateY(0);
}
