:root {
    --sidebar-width: 260px;
    --header-height: 70px;

    /* Color Palette */
    --color-bg-main: #f8f9fa;
    --color-bg-sidebar: #1f2937;
    --color-bg-card: #ffffff;
    --color-primary: #4f46e5;
    --color-primary-hover: #4338ca;
    --color-text-light: #f9fafb;
    --color-text-dark: #111827;
    --color-text-muted: #6b7280;
    --color-border: #e5e7eb;

    /* Sizing & Effects */
    --border-radius-md: 8px;
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --transition-speed: 0.3s ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background-color: var(--color-bg-main);
    color: var(--color-text-dark);
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

/* --- 2. Main Layout Structure --- */
.admin-layout {
    display: flex;
}

.admin-main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--transition-speed);
}

.page-content {
    padding: 2rem;
    flex-grow: 1;
}

/* --- Gen-Z Premium Sidebar Upgrade --- */
#admin-sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    /* Deep Navy Gradient */
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    overflow-y: auto;
    scrollbar-width: none;
}

#admin-sidebar::-webkit-scrollbar {
    display: none;
}

/* Rounded "Bento" Header */
.sidebar-header {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    margin: 10px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-dropdown {
    list-style: none !important;
    padding-left: 0 !important;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.nav-dropdown li a {
    text-decoration: none !important; /* Kill the line */
    padding: 8px 16px 8px 48px !important; /* Indent for icons */
    font-size: 0.85rem;
    opacity: 0.8;
}

.nav-dropdown li a:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.05);
}
/* Remove bullet points and underlines globally for nav */
.nav-links,
.nav-dropdown {
    list-style: none;
    /* Removes those dots */
    padding: 0;
    margin: 0;
}

.nav-links a {
    text-decoration: none !important;
    /* Removes the wired underlines */
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    /* Slightly tighter for better mobile fit */
    font-size: 0.95rem;
    color: #94a3b8;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.nav-links a.active {
    background: rgba(99, 102, 241, 0.15);
    /* Soft transparent glow */
    color: #818cf8 !important;
    border-left: 4px solid #6366f1;
    /* Strong side indicator */
    font-weight: 600;
    box-shadow: inset 10px 0 20px rgba(99, 102, 241, 0.05);
}

/* Mobile-friendly Button Scaling */
.btn-primary,
.logout-btn,
.action-btn {
    padding: 8px 16px;
    /* Reduced from bulky sizes */
    font-size: 0.9rem;
    /* Smaller, more premium text */
    border-radius: 10px;
    width: auto;
    /* Prevents buttons from being too wide */
}

/* Sidebar Footer (Logout) Fix */
.sidebar-footer {
    padding: 1rem;
    margin-top: auto;
}

.nav-logout-btn {
    text-decoration: none;
    justify-content: flex-start;
    padding: 10px 16px;
    font-size: 0.9rem;
    background: rgba(239, 68, 68, 0.1);
    /* Subtle red tint */
}

/* Dropdown Sub-menu spacing fix */
.nav-dropdown li a {
    padding-left: 45px;
    /* Aligns text with the icons above */
    font-size: 0.85rem;
}

.chevron-icon {
    margin-left: auto;
    font-size: 0.8rem;
    transition: transform 0.3s;
}

.open .chevron-icon {
    transform: rotate(180deg);
}

/* --- 4. Component Styling: Header & Footer --- */
.admin-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    background-color: var(--color-bg-card);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 900;
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    transition: margin-left var(--transition-speed), width var(--transition-speed);
}

.header-title {
    font-size: 1.5rem;
    margin: 0;
    flex-grow: 1;
}

.admin-footer {
    padding: 1.5rem 2rem;
    text-align: center;
    background-color: var(--color-bg-card);
    border-top: 1px solid var(--color-border);
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    transition: margin-left var(--transition-speed), width var(--transition-speed);
}

/* --- 5. Content Styling: Cards, Titles, etc. --- */
.page-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title-bar h1 {
    margin: 0;
    font-size: 1.8rem;
}

.content-card {
    background-color: var(--color-bg-card);
    padding: 2rem;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
}

/* --- 6. Utility & Form Element Styling --- */
.btn-primary,
.logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.2rem;
    border-radius: var(--border-radius-md);
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed);
    font-size: 1rem;
    background-color: var(--color-primary);
    color: white;
}

.btn-primary:hover,
.logout-btn:hover {
    background-color: var(--color-primary-hover);
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
    transform: translateY(-2px);
}

/* --- 7. Mobile Responsiveness --- */
.sidebar-toggle {
    display: block;
    /* Hidden on desktop */
    background: none;
    border: none;
    color: var(--color-text-dark);
    font-size: 1.5rem;
    cursor: pointer;
    margin-right: 1.5rem;
}

/* ================================================= */
/* --- 7. Responsive Sidebar (Premium Upgrade) --- */
/* ================================================= */

/* --- A. DESKTOP: Collapsed Mini-Bar (NEW) --- */
@media (min-width: 993px) {
    body.sidebar-collapsed #admin-sidebar {
        /* MODIFIED */
        width: 80px;
        /* New "mini-bar" width */
    }

    body.sidebar-collapsed .admin-main-content {
        /* MODIFIED */
        margin-left: 80px;
        width: calc(100% - 80px);
        /* ADDED */
    }

    /* --- ADDED THIS BLOCK --- */
    body.sidebar-collapsed .admin-header,
    body.sidebar-collapsed .admin-footer {
        margin-left: 80px;
        width: calc(100% - 80px);
    }

    /* Hide text, keep icons */
    body.sidebar-collapsed .sidebar-header h3,
    /* MODIFIED */
    body.sidebar-collapsed .sidebar-header .app-version,
    /* MODIFIED */
    body.sidebar-collapsed .nav-links a span,
    /* MODIFIED */
    body.sidebar-collapsed .sidebar-footer .nav-logout-btn span {
        /* MODIFIED */
        display: none;
    }

    /* Center logo and icons */
    body.sidebar-collapsed .sidebar-header {
        /* MODIFIED */
        padding: 1.5rem 0.5rem;
    }

    body.sidebar-collapsed .sidebar-logo {
        /* MODIFIED */
        max-width: 40px;
    }

    body.sidebar-collapsed .nav-links a {
        /* MODIFIED */
        justify-content: center;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    body.sidebar-collapsed .nav-logout-btn {
        /* MODIFIED */
        justify-content: center;
    }
}

/* --- B. MOBILE: Fly-out Menu (EXISTING, but cleaned up) --- */
@media (max-width: 992px) {
    #admin-sidebar {
        transform: translateX(-100%);
        z-index: 1000;
        width: var(--sidebar-width);
    }

    .admin-main-content {
        margin-left: 0;
        width: 100%;
    }

    /* --- ADDED THIS BLOCK --- */
    /* Reset header/footer for mobile view */
    .admin-header,
    .admin-footer {
        margin-left: 0;
        width: 100%;
    }

    body.sidebar-collapsed #admin-sidebar {
        /* MODIFIED */
        transform: translateX(0);
        /* Show sidebar */
    }

    /* The overlay for mobile focus */
    body.sidebar-collapsed::after {
        /* MODIFIED */
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
}

/**
 * ===================================
 * Search Bar Component
 * ===================================
 */

.search-bar {
    position: relative;
    width: 100%;
    max-width: 320px;
    /* Adjust as needed */
}

.search-bar .fa-search {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: var(--text-color-light);
    /* Using variables from previous style */
    font-size: 0.9rem;
    pointer-events: none;
    /* Allows clicking through the icon to the input */
    transition: color 0.2s ease-in-out;
}

.search-bar input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    /* Left padding makes space for the icon */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-color-dark);
    background-color: var(--background-white);
    outline: none;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

/* Style for the placeholder text */
.search-bar input::placeholder {
    color: var(--text-color-light);
    opacity: 0.8;
}

/* --- Focus State --- */
/* When the input inside the search bar is focused */
.search-bar input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.search-bar input:focus+.fa-search,
.search-bar:focus-within .fa-search {
    color: var(--primary-color);
}

.sidebar-header .app-version {
    margin: 0;
    font-size: 0.7rem;
    /* CHANGED */
    color: var(--color-primary);
    /* CHANGED: Use variable */
    font-weight: 500;
    line-height: 1;
    /* ADDED */
}

/* NEW rule for the sidebar title wrapper */
.sidebar-title-group {
    display: flex;
    flex-direction: column;
}

.sidebar-footer {
    margin-top: auto;
    /* Push to the bottom */
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-logout-btn {
    width: 100%;
    background: none;
    border: none;
    color: #fca5a5;
    /* Light red/danger color */
    text-align: left;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.7rem 1rem;
    cursor: pointer;
    border-radius: var(--border-radius-md);
    transition: background-color 0.2s ease;
}

.nav-logout-btn:hover {
    background-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    /* Stronger red */
}


/* --- 5. Content Styling: Cards, Titles, etc. (ADDITIONS FOR DASHBOARD) --- */

.stat-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--color-bg-card);
    padding: 1.5rem;
    border-radius: var(--border-radius-md);
    border-left: 5px solid var(--color-border);
    /* Subtle accent */
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    /* Remove underline */
    color: var(--color-text-dark);
    /* Inherit text color */
    display: flex;
    /* Ensure the flex layout remains */
}

.stat-card:hover {
    transform: translateY(-3px);
    /* LIFTING effect on hover */
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    /* Increase border color opacity slightly for a premium feel */
    border-left-width: 8px;
    /* Slight increase for visual impact */
}

/* Ensure children colors are maintained on hover */
.stat-card:hover .stat-info p {
    color: var(--color-text-dark);
}

.stat-card i {
    font-size: 2rem;
    color: var(--color-primary);
}

.stat-card .stat-info h3 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card .stat-info p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* Custom colors for stats */
.stat-critical {
    border-left-color: #ef4444;
}

.stat-critical i {
    color: #ef4444;
}

.stat-secondary {
    border-left-color: #facc15;
}

.stat-secondary i {
    color: #facc15;
}

.stat-success {
    border-left-color: #10b981;
}

.stat-success i {
    color: #10b981;
}

/* Quick Actions Card */
.quick-actions-card {
    margin-top: 2rem;
}

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

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    text-decoration: none;
    background-color: var(--color-bg-main);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    color: var(--color-text-dark);
    font-weight: 600;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background-color: rgba(79, 70, 229, 0.1);
    border-color: var(--color-primary);
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.05);
}

.action-btn i {
    font-size: 2rem;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}


/* Trip List Styles */
.trip-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-top: 1rem;
}

.trip-item {
    display: flex;
    align-items: center;
    background-color: #fcfcfc;
    border: 1px solid var(--color-border);
    padding: 1rem;
    border-radius: var(--border-radius-md);
    transition: box-shadow 0.2s ease;
}

.trip-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.trip-date {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    background-color: var(--color-primary);
    color: white;
    border-radius: var(--border-radius-md);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    margin-right: 1.5rem;
}

.trip-date .day-of-month {
    font-size: 1.5rem;
    line-height: 1;
}

.trip-date .month {
    font-size: 0.8rem;
    text-transform: uppercase;
    line-height: 1;
}

.trip-details {
    flex-grow: 1;
}

.trip-details .guest-name {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    color: var(--color-text-dark);
    display: flex;
    align-items: center;
}

.trip-details .ds-no {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-primary);
    background-color: rgba(79, 70, 229, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 10px;
}

.trip-details .time-address,
.trip-details .driver-info {
    margin: 0;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.trip-details i {
    margin-right: 5px;
    font-size: 0.9em;
}

.trip-item .btn-sm-primary-outline {
    /* Define a smaller button style here, or use existing .btn-primary */
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    text-decoration: none;
    background-color: white;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    border-radius: var(--border-radius-md);
    font-weight: 600;
    transition: all 0.2s;
}

.trip-item .btn-sm-primary-outline:hover {
    background-color: var(--color-primary);
    color: white;
}

/* =========================================
   WEBSITE MANAGEMENT STYLES (Bookings & Routes)
   ========================================= */

/* --- 1. TABS (For Bookings Page) --- */
.tabs-container {
    display: flex;
    gap: 10px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 25px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--primary);
    background: rgba(0, 0, 0, 0.02);
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* --- 2. BADGES (Status Indicators) --- */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-secondary {
    background: #e2e8f0;
    color: #475569;
}

/* Default */
.badge-success {
    background: #dcfce7;
    color: #166534;
}

/* New Booking / Yes */
.badge-warning {
    background: #fef9c3;
    color: #854d0e;
}

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

/* Cancelled */

/* --- 3. TABLE ACTIONS & ICONS --- */
.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: white;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    margin-right: 5px;
}

.btn-icon:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

/* WhatsApp Specific Button */
.btn-icon.success {
    color: #10B981;
    border-color: #10B981;
    background: #ecfdf5;
}

.btn-icon.success:hover {
    background: #10B981;
    color: white;
}

/* --- 4. TEXT TYPOGRAPHY --- */
.journey-info {
    line-height: 1.5;
    font-size: 0.9rem;
}

.text-muted {
    color: #94a3b8 !important;
    font-size: 0.85rem;
}

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

.text-danger {
    color: #ef4444;
}

/* --- 5. MODAL STYLES (Moves inline styles to CSS) --- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    /* Darker backdrop */
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

.modal.active {
    display: flex;
    animation: fadeIn 0.2s;
}

.modal-box {
    background: white;
    padding: 30px;
    border-radius: 12px;
    width: 600px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

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

.modal-header h2 {
    font-size: 1.25rem;
    color: var(--primary);
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #94a3b8;
    cursor: pointer;
}

.close-btn:hover {
    color: #ef4444;
}

/* Form inside Modal */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.full-width {
    grid-column: 1 / -1;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}

.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
}

.input-group input:focus,
.input-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-actions {
    margin-top: 30px;
    text-align: right;
    border-top: 1px solid var(--border);
    padding-top: 20px;
}