/* HERide Corporate Portal - Official Brand Colors */
:root {
    /* HERide Official Brand Colors */
    --primary: #6f4a9a;
    --primary-dark: #5a3d7a;
    --primary-light: #8b6aaf;
    --secondary: #6f4a9a;
    --accent: #dedeff;
    
    /* Neutrals */
    --dark: #1a1a2e;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    
    /* Status Colors */
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
    
    /* Typography */
    --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Spacing & Sizing */
    --radius: 12px;
    --radius-lg: 16px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

    /* ---- Theme-aware surfaces (Lyft-style console). Light by default. ---- */
    --sb-bg: #ffffff;
    --sb-border: #ececf1;
    --sb-text: #4a4653;
    --sb-strong: #14101c;
    --sb-muted: #9a95a3;
    --sb-hover: #f4f2f7;
    --sb-active-bg: rgba(139,106,175,0.14);
    --sb-active-text: #5a3d7a;
    --sb-active-ring: rgba(139,106,175,0.30);
    --sb-divider: #ededf0;

    --canvas: #f6f6f8;
    --card-bg: #ffffff;
    --card-border: #ececf1;
    --card-shadow: 0 1px 2px rgba(20,16,28,0.04);
    --text-strong: #14101c;
    --text-muted: #6b6675;
}

/* Dark mode — mirrors Lyft's theme-aware behavior (device/browser dark). */
@media (prefers-color-scheme: dark) {
    :root {
        --sb-bg: #17111f;
        --sb-border: rgba(255,255,255,0.07);
        --sb-text: rgba(255,255,255,0.70);
        --sb-strong: #f4f1f8;
        --sb-muted: rgba(255,255,255,0.42);
        --sb-hover: rgba(255,255,255,0.06);
        --sb-active-bg: rgba(139,106,175,0.30);
        --sb-active-text: #ffffff;
        --sb-active-ring: rgba(139,106,175,0.55);
        --sb-divider: rgba(255,255,255,0.08);

        --canvas: #100b18;
        --card-bg: #1a1426;
        --card-border: #2a2136;
        --card-shadow: 0 1px 2px rgba(0,0,0,0.4);
        --text-strong: #f4f1f8;
        --text-muted: #a49db0;
    }
    body { background: var(--canvas); color: var(--text-strong); }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--gray-100);
    color: var(--dark);
    line-height: 1.6;
}

/* ========== LOGIN PAGE ========== */
.login-page {
    min-height: 100vh;
    display: flex;
}

.login-left {
    flex: 1;
    background: linear-gradient(135deg, #5a3d7a 0%, #6f4a9a 50%, #8b6aaf 100%);
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-left::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(222,222,255,0.15) 0%, transparent 70%);
}

.login-left::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -30%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(222,222,255,0.1) 0%, transparent 60%);
}

.login-brand {
    position: relative;
    z-index: 1;
}

.login-logo {
    height: 50px;
    margin-bottom: 40px;
}

.login-brand h1 {
    font-size: 42px;
    font-weight: 700;
    color: white;
    margin-bottom: 16px;
}

.login-brand p {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.85);
    max-width: 400px;
    line-height: 1.7;
}

.login-features {
    margin-top: 50px;
    position: relative;
    z-index: 1;
}

.login-feature {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.login-feature:last-child {
    border-bottom: none;
}

.login-feature-icon {
    font-size: 24px;
}

.login-feature span {
    color: white;
    font-size: 16px;
    font-weight: 500;
}

.login-right {
    flex: 1;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

.login-form-container {
    width: 100%;
    max-width: 420px;
}

.login-form-container h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.login-form-container > p {
    color: var(--gray-600);
    margin-bottom: 40px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 16px;
    font-family: var(--font-family);
    transition: all 0.2s ease;
    background: var(--gray-100);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(111, 74, 154, 0.1);
}

.form-control::placeholder {
    color: var(--gray-500);
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

.form-row.single .form-group {
    flex: 1;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.form-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-700);
    font-size: 14px;
    cursor: pointer;
}

.form-options a {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.form-options a:hover {
    text-decoration: underline;
}

.btn-login {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #5a3d7a 0%, #6f4a9a 50%, #8b6aaf 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(111, 74, 154, 0.4);
}

.btn-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.login-footer {
    text-align: center;
    margin-top: 30px;
    color: var(--gray-600);
    font-size: 14px;
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

/* ========== DASHBOARD LAYOUT ========== */
.dashboard-page {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 256px;
    /* Lyft-Business-style rail: light by default, dark in dark mode. */
    background: var(--sb-bg);
    color: var(--sb-text);
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
    border-right: 1px solid var(--sb-border);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 22px 16px;
    border-bottom: 1px solid var(--sb-divider);
}

.sidebar-logo { height: 30px; }

.sidebar-company h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--sb-strong);
    margin-bottom: 1px;
}

.sidebar-company p {
    font-size: 12px;
    color: var(--sb-muted);
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

/* Shared item shell (single links + group toggles) */
.nav-item {
    display: flex;
    align-items: center;
    gap: 13px;
    width: calc(100% - 24px);
    margin: 1px 12px;
    padding: 10px 14px;
    color: var(--sb-text);
    text-decoration: none;
    font-size: 14.5px;
    font-weight: 500;
    border-radius: 10px;
    background: none;
    border: none;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.nav-item:hover { background: var(--sb-hover); color: var(--sb-strong); }
.nav-item.active {
    background: var(--sb-active-bg);
    color: var(--sb-active-text);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px var(--sb-active-ring);
}
.nav-item svg.nav-ico { width: 20px; height: 20px; flex-shrink: 0; opacity: 0.85; }

/* Collapsible group toggle + chevron */
.nav-group-toggle .nav-label { flex: 1; }
.nav-chevron { width: 16px; height: 16px; opacity: 0.6; transition: transform 0.18s ease; flex-shrink: 0; }
.nav-group.open > .nav-group-toggle .nav-chevron { transform: rotate(180deg); }

/* Sub-items (Overview, Programs, Riders, …) */
.nav-sub { display: none; padding: 2px 0 6px; }
.nav-group.open > .nav-sub { display: block; }
.nav-subitem {
    display: block;
    margin: 1px 12px;
    padding: 8px 14px 8px 47px;
    color: var(--sb-text);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: 8px;
    transition: background 0.15s ease, color 0.15s ease;
}
.nav-subitem:hover { background: var(--sb-hover); color: var(--sb-strong); }
.nav-subitem.active { background: var(--sb-active-bg); color: var(--sb-active-text); font-weight: 600; }

/* Divider between nav groups (Lyft rules between Pass|Insights|People) */
.nav-divider { height: 1px; background: var(--sb-divider); margin: 10px 20px; }

/* "Coming soon" badge on Lyft-mirror sections HERide doesn't have yet */
.nav-badge {
    margin-left: auto;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    padding: 3px 7px;
    border-radius: 20px;
    background: var(--sb-active-bg);
    color: var(--sb-active-text);
}

.sidebar-footer {
    padding: 20px 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #dedeff 0%, #8b6aaf 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: #5a3d7a;
}

.user-details h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.user-details p {
    font-size: 12px;
    opacity: 0.7;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 256px;
    padding: 40px 48px;
    background: var(--canvas);
    min-height: 100vh;
}

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

.page-title h1 {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-strong);
    margin-bottom: 4px;
}

.page-title p {
    color: var(--text-muted);
    font-size: 15px;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #5a3d7a 0%, #6f4a9a 50%, #8b6aaf 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(111, 74, 154, 0.35);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--card-bg);
    color: var(--text-strong);
    border: 2px solid var(--card-border);
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

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

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 22px 24px;
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
}

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.purple { background: rgba(111, 74, 154, 0.15); }
.stat-icon.pink { background: rgba(111, 74, 154, 0.15); }
.stat-icon.green { background: rgba(40, 167, 69, 0.15); }
.stat-icon.blue { background: rgba(23, 162, 184, 0.15); }

.stat-trend {
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.stat-trend.up {
    color: var(--success);
    background: rgba(40, 167, 69, 0.1);
}

.stat-trend.down {
    color: var(--danger);
    background: rgba(220, 53, 69, 0.1);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-strong);
    margin-bottom: 4px;
}

.stat-label {
    color: var(--text-muted);
    font-size: 14px;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--sb-divider);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-strong);
}

.card-body {
    padding: 24px;
}

/* Wallet Card */
.wallet-card {
    background: linear-gradient(135deg, #5a3d7a 0%, #6f4a9a 50%, #8b6aaf 100%);
    border-radius: var(--radius-lg);
    padding: 30px;
    color: white;
    margin-bottom: 30px;
}

.wallet-label {
    font-size: 14px;
    opacity: 0.85;
    margin-bottom: 8px;
}

.wallet-balance {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 25px;
}

.wallet-details {
    display: flex;
    gap: 40px;
}

.wallet-detail {
    display: flex;
    flex-direction: column;
}

.wallet-detail-label {
    font-size: 12px;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.wallet-detail-value {
    font-size: 18px;
    font-weight: 600;
}

/* Quick Actions Grid */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px;
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-strong);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.quick-action-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(111, 74, 154, 0.05);
}

.quick-action-btn.primary {
    background: linear-gradient(135deg, #5a3d7a 0%, #6f4a9a 50%, #8b6aaf 100%);
    border-color: transparent;
    color: white;
}

.quick-action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(111, 74, 154, 0.35);
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.grid-3 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 14px 20px;
    background: var(--gray-100);
    color: var(--gray-600);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--gray-200);
}

.data-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    font-size: 14px;
    color: var(--dark);
}

.data-table tr:hover {
    background: var(--gray-100);
}

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

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge.completed,
.status-badge.active {
    background: rgba(40, 167, 69, 0.15);
    color: var(--success);
}

.status-badge.pending,
.status-badge.scheduled {
    background: rgba(255, 193, 7, 0.15);
    color: #d39e00;
}

.status-badge.cancelled,
.status-badge.inactive {
    background: rgba(220, 53, 69, 0.15);
    color: var(--danger);
}

.status-badge.in-progress {
    background: rgba(111, 74, 154, 0.15);
    color: var(--primary);
}

/* Employee Card */
.employee-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--gray-200);
}

.employee-card:last-child {
    border-bottom: none;
}

.employee-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #dedeff 0%, #8b6aaf 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: #5a3d7a;
}

.employee-info {
    flex: 1;
}

.employee-info h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 2px;
}

.employee-info p {
    font-size: 13px;
    color: var(--gray-600);
}

/* Form Sections */
.form-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gray-200);
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 20px;
}

.form-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 20px;
}

/* Vehicle Type Selection */
.vehicle-types {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.vehicle-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.vehicle-type-card:hover {
    border-color: var(--primary);
}

.vehicle-type-card.selected {
    border-color: var(--primary);
    background: rgba(111, 74, 154, 0.08);
}

.vehicle-type-card input {
    display: none;
}

.vehicle-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.vehicle-name {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 4px;
}

.vehicle-price {
    font-size: 13px;
    color: var(--gray-600);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--gray-500);
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: 60vh;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    min-width: 300px;
}

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

.toast.success {
    border-left: 4px solid var(--success);
}

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

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

.toast-icon {
    font-size: 20px;
}

.toast-message {
    font-size: 14px;
    font-weight: 500;
    color: var(--dark);
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 60px 30px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--gray-600);
    margin-bottom: 20px;
}

/* Loading States */
.loading {
    display: flex;
    justify-content: center;
    padding: 40px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Required Field Indicator */
.required {
    color: var(--danger);
}

/* Book Ride Form Styles */
.book-ride-form textarea {
    resize: vertical;
    min-height: 80px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .login-page {
        flex-direction: column;
    }
    
    .login-left {
        padding: 40px;
        min-height: auto;
    }
    
    .login-right {
        padding: 40px 20px;
    }
    
    .login-brand h1 {
        font-size: 32px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .vehicle-types {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .main-content {
        padding: 20px 15px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .wallet-details {
        flex-direction: column;
        gap: 20px;
    }
}

/* ========== LOGIN CONTAINER FIX ========== */
.login-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.brand-section {
    position: relative;
    z-index: 1;
    margin-bottom: 40px;
}

.brand-section h1 {
    font-size: 42px;
    font-weight: 700;
    color: white;
    margin-bottom: 16px;
}

.brand-section p {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.85);
    max-width: 400px;
    line-height: 1.7;
}

.features-list {
    position: relative;
    z-index: 1;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 16px;
    font-weight: 500;
}

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

.feature-icon {
    font-size: 24px;
}

.login-subtitle {
    color: #6c757d;
    margin-bottom: 40px;
}

.login-form .form-group input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    transition: all 0.2s ease;
    background: #f8f9fa;
}

.login-form .form-group input:focus {
    outline: none;
    border-color: #6f4a9a;
    background: white;
    box-shadow: 0 0 0 4px rgba(111, 74, 154, 0.1);
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #495057;
    font-size: 14px;
    cursor: pointer;
}

.forgot-link {
    color: #6f4a9a;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.forgot-link:hover {
    text-decoration: underline;
}

/* ============================================================================
   MOBILE OPTIMIZATIONS (added 2026-05-22)
   ----------------------------------------------------------------------------
   The existing @media (max-width: 768px) earlier in this file makes the login
   page stack vertically but doesn't tighten copy / hide the marketing column /
   prevent iOS Safari from auto-zooming on input focus. These rules build on
   that foundation. Keep below the original media queries so they take
   precedence on smaller viewports.
   ============================================================================ */

/* iOS Safari auto-zooms when an input has font-size < 16px. Force 16px on
   every form input across breakpoints to suppress the zoom and the resulting
   horizontal-scroll jolt. Desktop visual is unchanged because the base
   declarations are already 16px on .login-form inputs. */
input, select, textarea, .form-control {
    font-size: 16px;
}

/* ===== TABLET / SMALL DESKTOP (≤ 768px) ===== */
@media (max-width: 768px) {
    /* Login page — collapse the marketing column so the form is visible
       above the fold without scrolling. Logo + tagline stay at top; the
       5-item features list is hidden (it's nice-to-have, not essential
       for someone who's there to log in). */
    .login-container {
        flex-direction: column;
        min-height: 100vh;
    }
    .login-left {
        flex: 0 0 auto;
        padding: 20px 20px 24px;
        min-height: auto;
    }
    .login-right {
        flex: 1 1 auto;
        padding: 24px 20px 40px;
        /* .login-right is display:flex; its direct children are .mode-tabs and the
           login/register/join sections. The base rule leaves flex-direction:row, so
           on mobile the tab bar and the visible form render SIDE-BY-SIDE (each ~half
           width → inputs clipped). Stack them vertically and stretch to full width. */
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        max-width: none;
    }
    /* Shrink the brand block so it's a header strip, not a hero section. */
    .brand-section {
        margin-bottom: 0;
    }
    .brand-section h1,
    .login-brand h1 {
        font-size: 22px;
        margin-bottom: 6px;
    }
    .brand-section p {
        font-size: 14px;
        line-height: 1.5;
    }
    .brand-section .logo,
    .login-left img.logo {
        height: 32px !important;
        margin-bottom: 10px !important;
    }
    /* Hide the marketing features list on mobile. Showing 5 line items
       above the login form pushes it below the fold and is a friction
       source for users who just want to sign in. */
    .features-list {
        display: none;
    }

    /* Mode tabs (Sign in / Register company / Join your company) — tighter
       so all 3 labels fit on one row at narrow widths. */
    .mode-tabs {
        margin-bottom: 20px;
    }
    .mode-tab {
        font-size: 12px;
        padding: 10px 6px;
        letter-spacing: 0;
    }

    /* Section title used inside the register form ("Company information"
       etc) — was 14px + 24px top margin which felt heavy on mobile. */
    .section-title {
        margin: 18px 0 10px;
        font-size: 12px;
    }

    /* Helper text under inputs — small footnote feel rather than body copy. */
    .helper-text,
    .password-requirements {
        font-size: 12px;
        line-height: 1.45;
    }

    /* Welcome back / Register your company headers */
    .login-header h2 {
        font-size: 22px;
        margin-bottom: 4px;
    }
    .login-subtitle {
        margin-bottom: 22px;
        font-size: 14px;
        line-height: 1.5;
    }

    /* Primary buttons — taller for touch (44px+ tap target per Apple HIG). */
    .btn-primary.btn-block,
    .login-form .btn-primary,
    button[type="submit"].btn-primary {
        padding: 14px 20px;
        font-size: 15px;
        width: 100%;
        justify-content: center;
    }

    /* Login form inputs already get 16px from the base rules; padding bump
       for thumb-friendly tap targets. */
    .login-form .form-group input,
    .login-form .form-group select,
    .login-form .form-group textarea,
    #industry_type {
        padding: 14px 16px;
        min-height: 48px;
    }

    /* Form rows (2 inputs side-by-side on desktop) stack on mobile —
       the original media query at line 1071 did this for .form-row but
       only inside the 576px breakpoint. Move it up to 768px so iPad
       portrait + small Android also benefit. */
    .login-form .form-row,
    #register-form .form-row,
    #join-form .form-row,
    .book-ride-form .form-row {
        flex-direction: column;
        gap: 0;
    }
    .login-form .form-row .form-group,
    #register-form .form-row .form-group,
    #join-form .form-row .form-group,
    .book-ride-form .form-row .form-group {
        margin-bottom: 16px;
    }

    /* Terms & conditions checkbox row — was awkwardly tall on mobile. */
    .remember-me {
        align-items: flex-start;
        gap: 10px;
        line-height: 1.45;
    }
    .remember-me input[type="checkbox"] {
        margin-top: 3px;
        min-width: 18px;
        min-height: 18px;
    }
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 20px;
    }
}

/* ===== PHONE (≤ 480px) ===== */
@media (max-width: 480px) {
    .login-left {
        padding: 16px 16px 18px;
    }
    .login-right {
        padding: 20px 16px 36px;
    }
    .brand-section h1,
    .login-brand h1 {
        font-size: 20px;
    }
    .brand-section p {
        font-size: 13px;
    }
    /* Even tighter mode tabs at phone width — labels like "Register company"
       are long; use smaller font + minimal padding to keep horizontal. */
    .mode-tab {
        font-size: 11px;
        padding: 9px 4px;
    }
    .login-header h2 {
        font-size: 20px;
    }
    /* Toast container — keep above the keyboard / bottom-bar on mobile. */
    .toast-container {
        left: 12px !important;
        right: 12px !important;
        bottom: 16px !important;
        top: auto !important;
    }
    .toast {
        width: 100% !important;
        max-width: none !important;
    }
}

/* ===== DASHBOARD-PAGE MOBILE TWEAKS ===== */
/* These pages have a sidebar that the existing @media (max-width: 992px)
   hides off-canvas. Adding a top-bar style affordance to open it would be
   a larger refactor; for now ensure the main content + forms are usable
   without the sidebar visible. */
@media (max-width: 768px) {
    /* Industry section on book-ride form — match the same column-stacking
       behavior as the main passenger fields. */
    #industryFields .form-row {
        flex-direction: column;
        gap: 0;
    }
    #industryFields .form-row .form-group {
        margin-bottom: 16px;
    }
    /* Vehicle type cards — single column on mobile, full width. */
    .vehicle-type-card {
        width: 100%;
    }
    /* Page headers — stack the title and the action button. */
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }
    .page-header .btn-primary {
        width: 100%;
        justify-content: center;
    }
    /* Cards — less internal padding on mobile. */
    .card-body {
        padding: 16px;
    }
    /* Data tables — horizontal scroll on small viewports rather than
       breaking the layout. */
    .data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
}

/* ============================================================================
   MOBILE HAMBURGER MENU (added 2026-05-22)
   ----------------------------------------------------------------------------
   On mobile the existing .sidebar slides off-canvas (transform: translateX
   (-100%)) — but there was no UI to bring it back. So Sign Out (which lives
   inside the sidebar footer) was unreachable on phones. This injects a
   hamburger button + backdrop overlay via corporate-app.js's injectMobileMenu().
   ============================================================================ */

/* Hamburger button — hidden on desktop, shown at <=992px (same breakpoint as
   the existing sidebar collapse). Sits fixed in the top-left corner. */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1001;
    width: 44px;
    height: 44px;
    padding: 0;
    background: linear-gradient(135deg, #5a3d7a 0%, #6f4a9a 50%, #8b6aaf 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
}
.mobile-menu-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.2s ease;
    transform-origin: center;
}
/* Animate the 3 bars into an X when open. */
.mobile-menu-btn.open span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.mobile-menu-btn.open span:nth-child(2) {
    opacity: 0;
}
.mobile-menu-btn.open span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Backdrop overlay — only visible when menu is open. Tapping it closes the menu. */
.mobile-menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.mobile-menu-backdrop.open {
    opacity: 1;
    visibility: visible;
}

/* Show button + ensure sidebar wins z-index at mobile breakpoints. */
@media (max-width: 992px) {
    .mobile-menu-btn {
        display: flex;
    }
    .sidebar {
        z-index: 1000; /* above backdrop (999), below button (1001) */
    }
    /* Push main content down a hair so it doesn't peek behind the hamburger
       button on scroll. 56px = 44px button + 12px top margin. */
    body.dashboard-page .main-content {
        padding-top: 64px;
    }
}

/* Sidebar internal scroll on mobile — important because the sidebar is
   100vh tall and on phones the user-info + nav can exceed that. */
@media (max-width: 992px) {
    .sidebar {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ============================================================================
   Lyft-Business-style Home + placeholder pages (full console match, 2026-08-10)
   ============================================================================ */

/* Home header subtitle ("Key metrics, month to date") */
.home-subtitle { color: var(--text-muted); font-size: 15px; margin-top: 2px; }

/* Full-width grouped metric section (Organization totals, Dispatch, etc.) */
.metric-section {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    padding: 24px 26px;
    margin-bottom: 20px;
}
.metric-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.metric-section-head h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-strong);
    display: flex;
    align-items: center;
    gap: 9px;
}
.metric-section-head .view-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary, #6f4a9a);
    text-decoration: none;
}
.metric-section-head .view-link:hover { text-decoration: underline; }

/* Empty state copy inside a metric section */
.metric-empty { color: var(--text-muted); font-size: 15px; padding: 6px 0 4px; }

/* Inline mini-metric row (label + big value), Lyft-style */
.metric-row { display: flex; flex-wrap: wrap; gap: 40px; }
.metric-row .metric { min-width: 140px; }
.metric-row .metric .m-value { font-size: 26px; font-weight: 700; color: var(--text-strong); }
.metric-row .metric .m-label { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* "Coming soon" placeholder pages (Business Profiles, Passes, Billing) */
.coming-soon {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    padding: 72px 32px;
    text-align: center;
}
.coming-soon .cs-icon {
    width: 64px; height: 64px; margin: 0 auto 20px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 18px; font-size: 30px;
    background: rgba(139,106,175,0.12);
}
.coming-soon h2 { font-size: 22px; font-weight: 700; color: var(--text-strong); margin-bottom: 10px; }
.coming-soon p { color: var(--text-muted); font-size: 15px; max-width: 460px; margin: 0 auto; line-height: 1.6; }
.coming-soon .cs-pill {
    display: inline-block; margin-top: 22px; padding: 7px 16px;
    border-radius: 20px; font-size: 13px; font-weight: 600;
    background: rgba(139,106,175,0.12); color: var(--primary, #6f4a9a);
}

/* Sidebar logo swaps with theme; footer picks up theme vars */
.sidebar-logo.logo-dark { display: none; }
.sidebar-footer { border-top-color: var(--sb-divider); }
.user-details h4 { color: var(--sb-strong); }
.user-details p { color: var(--sb-muted); opacity: 1; }
@media (prefers-color-scheme: dark) {
    .sidebar-logo.logo-light { display: none; }
    .sidebar-logo.logo-dark { display: block; }
}

/* ============================================================================
   Dark-mode text/surface fix (2026-08-10): the console reused the fixed neutral
   palette (--dark / --gray-*) for text, borders & subtle backgrounds, so on the
   dark canvas text stayed black. Flip the neutral scale for .dashboard-page only
   (login page keeps its own light treatment). One override → all descendants.
   ============================================================================ */
@media (prefers-color-scheme: dark) {
    .dashboard-page {
        --dark:     #f4f1f8;
        --gray-900: #eee9f4;
        --gray-800: #e0dae9;
        --gray-700: #cdc6da;
        --gray-600: #a8a1b5;
        --gray-500: #8f889b;
        --gray-400: #5f5a6d;
        --gray-300: #3a3348;
        --gray-200: #2a2136;
        --gray-100: #1c1528;
        color: var(--text-strong);
    }
    /* Any element still hardcoded to white bg inside the console → dark surface */
    .dashboard-page .stat-card,
    .dashboard-page .card,
    .dashboard-page table,
    .dashboard-page thead,
    .dashboard-page tbody,
    .dashboard-page tr { background: transparent; }
    .dashboard-page input,
    .dashboard-page select,
    .dashboard-page textarea {
        background: var(--gray-100);
        color: var(--text-strong);
        border-color: var(--gray-300);
    }
    /* Focus state: base rule hardcodes `background:white` — override so the
       field stays a dark surface with light text (not white-on-light) in dark mode. */
    .dashboard-page input:focus,
    .dashboard-page select:focus,
    .dashboard-page textarea:focus,
    .dashboard-page .form-control:focus {
        background: var(--card-bg);
        color: var(--text-strong);
        border-color: var(--primary);
    }
    /* Native <option> popup list also inherits white in some engines */
    .dashboard-page select option {
        background: var(--card-bg);
        color: var(--text-strong);
    }
}
