:root {
    --primary: #635bff;
    --primary-hover: #5851e8;
    --text-dark: #1a1f36;
    --text-gray: #6b7280;
    --text-light: #9ca3af;
    --border: #e5e7eb;
    --bg-light: #f9fafb;
    --white: #ffffff;
    --success: #0d9488;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --info-dark: #2563eb;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--white);
    color: var(--text-dark);
    margin: 0;
    padding: 0;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: var(--white);
    border-right: 1px solid var(--border);
    z-index: 1030;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.57rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    text-decoration: none;
}

.sidebar-brand i {
    font-size: 1.5rem;
    color: var(--primary);
}

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

.nav-item {
    margin: 0.25rem 1rem;
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-gray);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.15s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

.nav-link:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

.nav-link.active {
    background: var(--primary);
    color: var(--white);
}

.nav-link i {
    font-size: 1rem;
    width: 1.25rem;
    text-align: center;
}

.badge {
    background: var(--danger);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    margin-left: auto;
}

.badge-warning {
    background: var(--warning);
}

/* Main Content */
.main-content {
    margin-left: 280px;
    min-height: 100vh;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    z-index: 1020;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-gray);
    font-size: 1.25rem;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.sidebar-toggle:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

.page-title h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.page-title p {
    color: var(--text-gray);
    margin: 0.25rem 0 0 0;
    font-size: 0.875rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-container {
    position: relative;
    width: 300px;
}

.search-input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
    background: var(--white);
    transition: all 0.15s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.1);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 0.875rem;
}

.notification-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--text-gray);
    font-size: 1rem;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.notification-btn:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--danger);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 500;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--white);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Content Section */
.content-section {
    padding: 2rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.section-actions {
    display: flex;
    gap: 0.5rem;
}

/* Filter Bar */
.filter-bar {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filter-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.filter-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    background: var(--white);
    color: var(--text-dark);
    min-width: 150px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.1);
}

/* .form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    transition: all 0.15s ease;
} */

.date-range {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    background: var(--white);
    color: var(--text-dark);
}

.date-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.1);
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    border: 1px solid var(--primary);
    color: var(--white);
    /* padding: 0.625rem 1rem; */
    /* font-size: 0.875rem; */
    /* font-weight: 500; */
    border-radius: 8px;
    transition: all 0.15s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:focus,
.btn-primary:active,
.btn-primary:hover {
    background: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    color: var(--white) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(99, 91, 255, 0.3) !important;
}

.btn-outline {
    border: 1px solid var(--border);
    color: var(--text-dark);
    background: var(--white);
    /* padding: 0.500rem 1rem; */
    /* font-size: 0.875rem; */
    /* font-weight: 500; */
    border-radius: 8px;
    transition: all 0.15s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-outline:hover {
    background: var(--bg-light);
    /* border-color: var(--text-light); */
    border-color: var(--primary);
    color: var(--text-dark);
}

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

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

/* Table */
.table-container {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.table {
    margin: 0;
}

.table th {
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    text-align: left;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--text-dark);
    vertical-align: middle;
}

.table tbody tr:hover {
    background: var(--bg-light);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Alerts */
.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.alert-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.15s ease;
    position: relative;
}

.alert-item:hover {
    border-color: var(--primary);
}

.alert-item.error {
    border-left: 4px solid var(--danger);
}

.alert-item.warning {
    border-left: 4px solid var(--warning);
}

.alert-item.info {
    border-left: 4px solid var(--info);
}

.alert-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--white);
    flex-shrink: 0;
}

.alert-item.error .alert-icon {
    background: var(--danger);
}

.alert-item.warning .alert-icon {
    background: var(--warning);
}

.alert-item.info .alert-icon {
    background: var(--info);
}

.alert-content h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 0.25rem 0;
}

.alert-content p {
    font-size: 0.75rem;
    color: var(--text-gray);
    margin: 0 0 0.25rem 0;
    line-height: 1.4;
}

.alert-time {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
}

.alert-close {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.15s ease;
    font-size: 0.875rem;
}

.alert-close:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-active {
    background: rgba(13, 148, 136, 0.1);
    color: var(--success);
}

.status-pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.status-completed {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.status-cancelled {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* Route Details */
.route-details {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.route-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1rem;
}

.route-info h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 0.25rem 0;
}

.route-info p {
    font-size: 0.75rem;
    color: var(--text-gray);
    margin: 0;
}

/* Progress Bar */
.progress-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.progress-bar {
    width: 100px;
    height: 6px;
    background: var(--bg-light);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.75rem;
    color: var(--text-gray);
    font-weight: 500;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Avatar */
.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}


/* Cards */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.15s ease;
}

.card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(99, 91, 255, 0.1);
}

.card-header {
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.card-body {
    padding: 1.5rem;
}

/* Responsive */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .search-container {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .header {
        padding: 1rem;
    }
    
    .content-section {
        padding: 1rem;
    }
    
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-select,
    .date-input {
        width: 100%;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .section-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .table-responsive {
        font-size: 0.75rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}

/* ===== FLASH MESSAGES ===== */
.flash-messages-container {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 500px;
    margin: 0 auto;
}

.flash-messages-container .alert {
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: none;
    border-radius: 8px;
}

.flash-messages-container .alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.flash-messages-container .alert-success {
    background-color: #d1edff;
    color: #0c5460;
    border-left: 4px solid #28a745;
}

.flash-messages-container .alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.flash-messages-container .alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

@media (max-width: 768px) {
    .flash-messages-container {
        left: 10px;
        right: 10px;
        top: 10px;
    }
}
