:root {
    --primary: #0d3b66;
    --primary-light: #1a5276;
    --accent: #f7b731;
    --accent-dark: #f5a623;
    --success: #27ae60;
    --danger: #e74c3c;
    --bg-light: #f4f6f9;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-light);
}

.bg-primary {
    background-color: var(--primary) !important;
}

.text-primary {
    color: var(--primary) !important;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-light);
    border-color: var(--primary-light);
}

.btn-accent {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #000;
    font-weight: 600;
}

.btn-accent:hover {
    background-color: var(--accent-dark);
    border-color: var(--accent-dark);
    color: #000;
}

.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, #1a5276 50%, #2e86c1 100%);
    color: #fff;
    padding: 80px 0 60px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: rgba(247, 183, 49, 0.1);
    border-radius: 50%;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.hero-section h1 {
    font-size: 2.8rem;
    font-weight: 800;
}

.hero-section p {
    font-size: 1.15rem;
    opacity: 0.9;
}

.feature-card {
    border: none;
    border-radius: 16px;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.feature-card .icon-box {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.price-badge {
    background: var(--accent);
    color: #000;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
}

/* Seat Map */
.seat-map {
    max-width: 340px;
    margin: 0 auto;
}

.seat-map .car-body {
    border: 3px solid #ccc;
    border-radius: 18px;
    padding: 20px 16px;
    background: #f8f9fa;
    position: relative;
}

.seat-map .car-body::before {
    content: 'FRONT';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #ccc;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 6px;
    letter-spacing: 1px;
}

.seat {
    width: 80px;
    height: 52px;
    border: 2px solid #ccc;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    position: relative;
    flex-direction: column;
    line-height: 1.1;
}

.seat .seat-price {
    font-size: 0.6rem;
    font-weight: 400;
    color: #888;
}

.seat.available {
    border-color: var(--success);
    color: var(--success);
}

.seat.available:hover {
    background: #d4edda;
    border-color: #198754;
    transform: scale(1.05);
}

.seat.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    transform: scale(1.05);
}

.seat.selected .seat-price {
    color: rgba(255,255,255,0.8);
}

.seat.booked {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
    cursor: not-allowed;
    opacity: 0.85;
}

.seat.driver-seat {
    background: #6c757d;
    border-color: #6c757d;
    color: #fff;
    cursor: default;
}

.seat.front-seat {
    width: 100px;
}

.seat-legend {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 16px;
    font-size: 0.85rem;
}

.seat-legend span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.seat-legend .dot {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    display: inline-block;
}

.seat-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

/* Wizard Stepper */
.wizard-stepper {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.wizard-stepper .step {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #aaa;
}

.wizard-stepper .step .step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ddd;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.wizard-stepper .step.active {
    color: var(--primary);
}

.wizard-stepper .step.active .step-num {
    background: var(--primary);
    color: #fff;
}

.wizard-stepper .step.done {
    color: var(--success);
}

.wizard-stepper .step.done .step-num {
    background: var(--success);
    color: #fff;
}

.wizard-step {
    display: none;
}

.wizard-step.active {
    display: block;
}

/* Booking confirmation card */
.booking-confirmation {
    border: 2px solid var(--success);
    border-radius: 16px;
    overflow: hidden;
}

.booking-confirmation .header {
    background: var(--success);
    color: #fff;
    padding: 24px;
    text-align: center;
}

.booking-confirmation .body {
    padding: 24px;
}

/* Route cards */
.route-card {
    border: 2px solid #e9ecef;
    border-radius: 14px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.route-card:hover {
    border-color: var(--primary);
    background: #f0f5ff;
}

.route-card.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

/* Trip cards */
.trip-card {
    border: 2px solid #e9ecef;
    border-radius: 14px;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.trip-card:hover {
    border-color: var(--primary);
    background: #f0f5ff;
}

.trip-card.active {
    border-color: var(--primary);
    background: #e8f0fe;
}

/* Table styling */
.table-modern {
    border-collapse: separate;
    border-spacing: 0;
}

.table-modern thead th {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 12px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.table-modern thead th:first-child {
    border-radius: 10px 0 0 0;
}

.table-modern thead th:last-child {
    border-radius: 0 10px 0 0;
}

.table-modern tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

.table-modern tbody tr:hover {
    background: #f8f9ff;
}

.table-modern tbody tr:last-child td:first-child {
    border-radius: 0 0 0 10px;
}

.table-modern tbody tr:last-child td:last-child {
    border-radius: 0 0 10px 0;
}

.badge-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-confirmed { background: #d4edda; color: #155724; }
.badge-pending   { background: #fff3cd; color: #856404; }
.badge-paid      { background: #cce5ff; color: #004085; }
.badge-cancelled { background: #f8d7da; color: #721c24; }

/* Section headings */
.section-heading {
    font-weight: 700;
    position: relative;
    display: inline-block;
}

.section-heading::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

/* Counter animation */
.stat-card {
    border: none;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    .seat {
        width: 62px;
        height: 44px;
        font-size: 0.75rem;
    }
    .seat.front-seat {
        width: 82px;
    }
    .wizard-stepper .step span.step-label {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .hero-section {
        padding: 52px 0 44px;
    }

    .wizard-step .d-flex.justify-content-between,
    .wizard-step .d-flex.justify-content-end {
        flex-direction: column;
        gap: 0.6rem;
    }

    .wizard-step .d-flex.justify-content-between .btn,
    .wizard-step .d-flex.justify-content-end .btn {
        width: 100%;
    }

    .wizard-step .text-center.mt-4 {
        display: flex;
        flex-direction: column;
        gap: 0.6rem;
    }

    .wizard-step .text-center.mt-4 .btn {
        width: 100%;
    }

    .card-body.p-4 {
        padding: 1.1rem !important;
    }

    .trips-toggle .btn {
        white-space: normal;
        font-size: 0.85rem;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
}

/* ===== Dark Mode ===== */
html[data-theme="dark"] {
    color-scheme: dark;
}
html[data-theme="dark"] body {
    background: #111827;
    color: #e5e7eb;
}
html[data-theme="dark"] .bg-light { background-color: #1f2937 !important; }
html[data-theme="dark"] .bg-white { background-color: #1f2937 !important; }
html[data-theme="dark"] .text-secondary { color: #9ca3af !important; }
html[data-theme="dark"] .text-dark { color: #d1d5db !important; }
html[data-theme="dark"] .text-primary { color: #60a5fa !important; }
html[data-theme="dark"] .border-secondary { border-color: #374151 !important; }
html[data-theme="dark"] hr { border-color: #374151 !important; }

html[data-theme="dark"] .card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .admin-stat { background-color: #1f2937; border-color: #374151; }

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .input-group-text {
    background-color: #111827;
    border-color: #374151;
    color: #e5e7eb;
}
html[data-theme="dark"] .form-control::placeholder { color: #6b7280; }
html[data-theme="dark"] .form-check-input { background-color: #374151; border-color: #4b5563; }
html[data-theme="dark"] .form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }

html[data-theme="dark"] .dropdown-menu { background-color: #1f2937; border-color: #374151; }
html[data-theme="dark"] .dropdown-item { color: #e5e7eb; }
html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item:focus { background-color: #374151; color: #fff; }
html[data-theme="dark"] .dropdown-divider { border-color: #374151; }

html[data-theme="dark"] .modal-content { background-color: #1f2937; color: #e5e7eb; }
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer { border-color: #374151; }
html[data-theme="dark"] .btn-close { filter: invert(1); }

html[data-theme="dark"] .route-card,
html[data-theme="dark"] .trip-card { border-color: #374151; }
html[data-theme="dark"] .route-card:hover,
html[data-theme="dark"] .trip-card:hover { background: #263049; }
html[data-theme="dark"] .route-card.active { background: var(--primary); border-color: var(--primary); }
html[data-theme="dark"] .trip-card.active { background: #1e3a5f; border-color: var(--primary); }

html[data-theme="dark"] .table-modern tbody td { border-color: #374151; }
html[data-theme="dark"] .table-modern tbody tr:hover { background: #1e293b; }

html[data-theme="dark"] .seat-map .car-body { background: #1f2937; border-color: #374151; }
html[data-theme="dark"] .seat-map .car-body::before { background: #4b5563; }
html[data-theme="dark"] .seat { background: #111827; border-color: #4b5563; color: #d1d5db; }
html[data-theme="dark"] .seat.available { border-color: var(--success); color: var(--success); }
html[data-theme="dark"] .seat.available:hover { background: #065f46; border-color: #10b981; }
html[data-theme="dark"] .seat .seat-price { color: #6b7280; }

html[data-theme="dark"] .wizard-stepper .step { color: #6b7280; }
html[data-theme="dark"] .wizard-stepper .step .step-num { background: #374151; color: #6b7280; }

html[data-theme="dark"] .badge-confirmed { background: #064e3b; color: #6ee7b7; }
html[data-theme="dark"] .badge-pending   { background: #78350f; color: #fcd34d; }
html[data-theme="dark"] .badge-paid      { background: #1e3a5f; color: #93c5fd; }
html[data-theme="dark"] .badge-cancelled { background: #7f1d1d; color: #fca5a5; }

html[data-theme="dark"] .booking-confirmation { border-color: #065f46; }

html[data-theme="dark"] .feature-card { background: #1f2937; box-shadow: 0 2px 12px rgba(0,0,0,0.3); }

html[data-theme="dark"] code { background: #374151; color: #93c5fd; }

html[data-theme="dark"] .navbar.bg-primary { background-color: #1e3a5f !important; }

html[data-theme="dark"] .bg-dark { background-color: #0f172a !important; }

html[data-theme="dark"] .quick-book-card { background: #1f2937; border-color: #374151; }
html[data-theme="dark"] .trip-list-item:hover { background: #263049; }

@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) {
        color-scheme: dark;
    }
    html:not([data-theme="light"]) body {
        background: #111827;
        color: #e5e7eb;
    }
}
