/**
 * Livreur.ch Admin - Styles
 * Interface d'administration
 */

/* =====================================================
   VARIABLES & THEME (Red theme for delivery)
   ===================================================== */
:root {
    --primary: #e11d48;
    --primary-dark: #be123c;
    --primary-light: #fda4af;
    --secondary: #0f172a;
    --secondary-light: #1e293b;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    --bg-primary: #f9fafb;
    --bg-card: #ffffff;
    --border-color: #e5e7eb;

    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

/* =====================================================
   BASE STYLES
   ===================================================== */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.25);
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(225, 29, 72, 0.35);
}

.btn-primary:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background-color: #f3f4f6;
    color: var(--secondary);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-secondary:hover { background-color: #e5e7eb; }

.btn-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-success:hover { filter: brightness(0.95); }

.btn-warning {
    background: var(--warning);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-warning:hover { filter: brightness(0.95); }

.btn-danger {
    background-color: var(--danger);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-danger:hover { background-color: #dc2626; }

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn-icon {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    background: #f3f4f6;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.btn-icon:hover { background: #e5e7eb; color: var(--text-primary); }

/* =====================================================
   SIDEBAR
   ===================================================== */
.sidebar {
    width: 16rem;
    background: var(--secondary);
    border-right: 1px solid var(--secondary-light);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    z-index: 40;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.125rem;
    color: white;
}

.sidebar-logo-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.35);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 1.5rem;
}

.sidebar-section-title {
    font-size: 0.6875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.15s;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.125rem;
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: white;
}

.sidebar-item.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.3);
}

.sidebar-item-icon {
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-item-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    line-height: 1.2;
}

.sidebar-footer {
    padding: 0.875rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--radius-lg);
}

.sidebar-user-name {
    color: white;
    font-weight: 600;
    font-size: 0.8125rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-email {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.6875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-logout {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.sidebar-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* =====================================================
   MAIN CONTENT
   ===================================================== */
.main-content {
    margin-left: 16rem;
    min-height: 100vh;
    background: var(--bg-primary);
    transition: margin-left 0.3s ease;
}

.main-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.875rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 30;
}

.main-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    text-transform: capitalize;
}

.main-body {
    padding: 1.5rem;
}

.mobile-toggle {
    display: none;
    width: 2.25rem;
    height: 2.25rem;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    color: var(--text-secondary);
}

/* =====================================================
   PAGE HEADER
   ===================================================== */
.page-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
    .page-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* =====================================================
   CARDS
   ===================================================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 1.5rem;
}

.card-body-flush {
    padding: 0;
}

/* Stat Cards */
.stat-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(225, 29, 72, 0.2);
}

.stat-card-icon {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.stat-card-icon.red { background: rgba(225, 29, 72, 0.1); color: var(--primary); }
.stat-card-icon.green { background: rgba(34, 197, 94, 0.1); color: var(--success); }
.stat-card-icon.blue { background: rgba(59, 130, 246, 0.1); color: var(--info); }
.stat-card-icon.yellow { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.stat-card-icon.purple { background: rgba(168, 85, 247, 0.1); color: #a855f7; }
.stat-card-icon.gray { background: rgba(107, 114, 128, 0.1); color: var(--text-secondary); }
.stat-card-icon.orange { background: rgba(249, 115, 22, 0.1); color: #f97316; }

.stat-card-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-card-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* =====================================================
   FORMS
   ===================================================== */
.input-field {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    transition: all 0.15s;
    background: white;
    font-family: inherit;
    color: var(--text-primary);
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.1);
}

.input-field::placeholder {
    color: var(--text-muted);
}

.input-field-lg {
    padding: 0.875rem 1.125rem;
    font-size: 1rem;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}

.form-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.form-group {
    margin-bottom: 1rem;
}

.input-search {
    position: relative;
}

.input-search input {
    padding-left: 2.5rem;
}

.input-search i {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.875rem;
    pointer-events: none;
}

/* Toggle switch */
.switch {
    position: relative;
    display: inline-block;
    width: 2.75rem;
    height: 1.5rem;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #d1d5db;
    border-radius: 9999px;
    transition: 0.2s;
}
.switch-slider::before {
    content: '';
    position: absolute;
    height: 1.125rem;
    width: 1.125rem;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
.switch input:checked + .switch-slider {
    background: var(--primary);
}
.switch input:checked + .switch-slider::before {
    transform: translateX(1.25rem);
}

/* =====================================================
   TABLES
   ===================================================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th,
.data-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-weight: 600;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    background: #f9fafb;
    white-space: nowrap;
}

.data-table tbody tr {
    transition: background 0.15s;
}

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

.data-table tbody tr.cursor-pointer {
    cursor: pointer;
}

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

.text-right { text-align: right; }
.text-center { text-align: center; }
.text-mono { font-family: 'SFMono-Regular', Menlo, Consolas, monospace; }

/* =====================================================
   BADGES
   ===================================================== */
.badge {
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.4;
    white-space: nowrap;
}

.badge-green { background: #dcfce7; color: #15803d; }
.badge-yellow { background: #fef3c7; color: #b45309; }
.badge-red { background: #fee2e2; color: #b91c1c; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-gray { background: #f3f4f6; color: #4b5563; }
.badge-purple { background: #f3e8ff; color: #7c3aed; }
.badge-orange { background: #ffedd5; color: #c2410c; }

.badge-dot {
    width: 0.4375rem;
    height: 0.4375rem;
    border-radius: 50%;
    background: currentColor;
}

/* =====================================================
   MODALS
   ===================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(6px);
    animation: fadeIn 0.2s ease-out;
    padding: 1rem;
}

.modal-content {
    background-color: white;
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: scaleIn 0.2s ease-out;
}

.modal-content.modal-lg { max-width: 640px; }
.modal-content.modal-xl { max-width: 800px; }
.modal-content.modal-2xl { max-width: 960px; }

.modal-header {
    padding: 1.125rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.modal-close:hover {
    background: #f3f4f6;
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.625rem;
    background: #f9fafb;
}

/* Detail blocks inside modal */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.5rem;
}

@media (max-width: 600px) {
    .detail-grid { grid-template-columns: 1fr; }
}

.detail-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.detail-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-word;
}

/* =====================================================
   AVATARS
   ===================================================== */
.avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    overflow: hidden;
    flex-shrink: 0;
    text-transform: uppercase;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-sm { width: 2rem; height: 2rem; font-size: 0.75rem; border-radius: var(--radius-md); }
.avatar-lg { width: 3rem; height: 3rem; font-size: 1.125rem; }

.avatar.avatar-navy {
    background: linear-gradient(135deg, var(--secondary-light), var(--secondary));
}

/* =====================================================
   EMPTY STATES
   ===================================================== */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    background: rgba(225, 29, 72, 0.08);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
}

.empty-state-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.empty-state-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* =====================================================
   LOADING
   ===================================================== */
.loading-spinner {
    width: 2.25rem;
    height: 2.25rem;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-spinner-sm {
    width: 1.125rem;
    height: 1.125rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-spinner-lg {
    width: 3rem;
    height: 3rem;
    border-width: 3.5px;
}

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

/* =====================================================
   ANIMATIONS
   ===================================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.3s ease-out both; }
.slide-in-up { animation: slideInUp 0.4s ease-out both; }

/* =====================================================
   TOAST
   ===================================================== */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    padding: 0.875rem 1.125rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.625rem;
    animation: slideInToast 0.25s ease-out;
    border-left: 3px solid;
    min-width: 280px;
    max-width: 380px;
    font-size: 0.875rem;
}

.toast i { font-size: 1rem; }

.toast-success { border-color: var(--success); }
.toast-success i { color: var(--success); }
.toast-error { border-color: var(--danger); }
.toast-error i { color: var(--danger); }
.toast-warning { border-color: var(--warning); }
.toast-warning i { color: var(--warning); }
.toast-info { border-color: var(--info); }
.toast-info i { color: var(--info); }

@keyframes slideInToast {
    from { transform: translateX(110%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* =====================================================
   FILTER PILLS
   ===================================================== */
.filter-pills {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    margin-bottom: 1rem;
}

.filter-pill {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-lg);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.filter-pill:hover {
    background: #f9fafb;
    color: var(--text-primary);
}

.filter-pill.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 6px rgba(225, 29, 72, 0.25);
}

.filter-pill-count {
    background: rgba(255, 255, 255, 0.25);
    padding: 0.0625rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 700;
}

.filter-pill:not(.active) .filter-pill-count {
    background: #f3f4f6;
    color: var(--text-muted);
}

/* =====================================================
   PAGINATION
   ===================================================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    font-size: 0.875rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pagination-info {
    color: var(--text-secondary);
}

.pagination-pages {
    display: flex;
    gap: 0.25rem;
}

.pagination-btn {
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.625rem;
    border-radius: var(--radius-md);
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 500;
    font-size: 0.8125rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover:not(:disabled) {
    background: #f9fafb;
    color: var(--text-primary);
    border-color: #d1d5db;
}

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

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* =====================================================
   MAP
   ===================================================== */
.map-wrapper {
    position: relative;
    background: white;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    overflow: hidden;
    height: calc(100vh - 200px);
    min-height: 500px;
}

.map-wrapper .leaflet-container {
    width: 100%;
    height: 100%;
}

.map-marker-driver {
    background: var(--secondary);
    color: white;
    border-radius: 50%;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.map-marker-driver.online { border: 3px solid var(--success); }
.map-marker-driver.busy { border: 3px solid var(--primary); }

/* =====================================================
   LOGIN PAGE
   ===================================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background:
        radial-gradient(circle at 20% 20%, rgba(225, 29, 72, 0.6), transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(190, 18, 60, 0.5), transparent 40%),
        var(--secondary);
}

.login-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    padding: 2.25rem;
    max-width: 26rem;
    width: 100%;
    animation: slideInUp 0.4s ease-out;
}

.login-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1.25rem;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 8px 20px rgba(225, 29, 72, 0.4);
}

.login-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}

.login-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1.75rem;
}

.login-back {
    display: block;
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: color 0.15s;
}

.login-back:hover { color: var(--text-primary); }

/* =====================================================
   PROGRESS BAR
   ===================================================== */
.progress-bar {
    width: 100%;
    height: 0.5rem;
    background: #f3f4f6;
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: 9999px;
    transition: width 0.3s ease;
}

/* =====================================================
   PRICING CARDS
   ===================================================== */
.pricing-card {
    background: white;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    transition: all 0.2s;
}

.pricing-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
}

.pricing-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.pricing-card-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pricing-card-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--radius-lg);
    background: rgba(225, 29, 72, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
}

.pricing-card-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text-primary);
}

.pricing-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.625rem;
}

.pricing-card-stat {
    background: #f9fafb;
    border-radius: var(--radius-md);
    padding: 0.75rem;
}

.pricing-card-stat-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-bottom: 0.125rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.pricing-card-stat-value {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
}

.pricing-card-stat.full { grid-column: 1 / -1; }

/* =====================================================
   SETTINGS GROUP
   ===================================================== */
.settings-group {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.settings-row {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

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

.settings-row-info {
    flex: 1;
    min-width: 0;
}

.settings-row-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.settings-row-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.settings-row-control {
    flex-shrink: 0;
    min-width: 240px;
}

@media (max-width: 640px) {
    .settings-row {
        flex-direction: column;
        align-items: stretch;
    }
    .settings-row-control {
        min-width: unset;
        width: 100%;
    }
}

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

.input-time-range span {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* =====================================================
   ROW ACTIONS
   ===================================================== */
.row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
}

.row-action {
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
}

.row-action:hover { background: #f3f4f6; color: var(--text-primary); }
.row-action.danger:hover { background: #fee2e2; color: var(--danger); }
.row-action.success:hover { background: #dcfce7; color: var(--success); }
.row-action.info:hover { background: #dbeafe; color: var(--info); }
.row-action.warning:hover { background: #fef3c7; color: #b45309; }

/* =====================================================
   SCROLLBARS
   ===================================================== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* =====================================================
   UTILITIES
   ===================================================== */
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }

.cursor-pointer { cursor: pointer; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    }
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.5);
        backdrop-filter: blur(2px);
        z-index: 39;
    }
    .main-content {
        margin-left: 0;
    }
    .mobile-toggle {
        display: inline-flex;
    }
}

@media (max-width: 640px) {
    .main-body { padding: 1rem; }
    .modal-overlay { padding: 0.5rem; }
    .data-table th, .data-table td { padding: 0.625rem 0.75rem; }
}
