:root {
    /* Accent Colors - More Vibrant for SaaS */
    --primary: #4338CA; /* Deep Indigo */
    --primary-hover: #3730A3;
    --secondary: #059669;
    --danger: #E11D48; /* Rose Red */
    --warning: #D97706;
    
    /* Light Theme (Maximum Contrast) */
    --bg-body: #F8FAFC; 
    --bg-nav: rgba(255, 255, 255, 0.98);
    --bg-card: #FFFFFF;
    --bg-card-solid: #FFFFFF;
    --bg-input: #FFFFFF;
    --bg-table-head: #F1F5F9;
    --bg-table-row: #FFFFFF;
    --bg-table-hover: #F8FAFC;
    
    /* Typography (WCAG AAA Optimized) */
    --text-main: #0F172A; /* Slate 900 */
    --text-heading: #000000;
    --text-muted: #475569; /* Slate 600 - Clearly readable */
    
    /* Borders & Shadows */
    --border: #E2E8F0;
    --border-input: #CBD5E1;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    
    /* Badges */
    --badge-bg: #F1F5F9;
    --badge-color: #334155;
}

body.dark-mode {
    /* VIP Automotive Dark Theme (Sharp & Clean) */
    --primary: #FBBF24; /* Amber Gold */
    --primary-hover: #F59E0B;
    --bg-body: #020617; /* Very Dark Slate */
    --bg-nav: rgba(15, 23, 42, 0.98);
    --bg-card: #0F172A;
    --bg-card-solid: #1E293B;
    --bg-input: #1E293B;
    --bg-table-head: #1E293B;
    
    /* Dark Theme Typography (Maximum Contrast) */
    --text-main: #F8FAFC; /* Slate 50 */
    --text-heading: #FFFFFF;
    --text-muted: #94A3B8; /* Slate 400 */
    
    --border: #1E293B;
    --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --badge-bg: rgba(251, 191, 36, 0.15);
    --badge-color: #FBBF24;
}

html { font-size: 16px; } /* Global base size */

body {
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 1rem; /* Precise 16px font for SaaS density */
    background: var(--bg-body);
    background-image: url('../img/automotive_pattern.png');
    background-repeat: repeat;
    background-size: 250px;
    background-blend-mode: soft-light;
    color: var(--text-main);
    line-height: 1.5;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background 0.3s ease;
}

/* Glassmorphism Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-nav);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2.5rem;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.logo {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}
.menu .user-greeting { font-weight: 600; margin-right: 15px; color: var(--text-main); }

.container {
    margin: 2rem auto;
    padding: 1rem;
    max-width: 1200px;
    width: 100%;
}
.auth-content { max-width: 450px; margin-top: 5rem; }

/* Form Elements */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-muted);
}
.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-input);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-input);
    color: var(--text-main);
    transition: all 0.3s ease;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Animations */
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 1.25rem 1.5rem; /* Less padding for compactness */
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2), 0 0 20px rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
}

/* Dashboard Hero */
.dashboard-hero {
    background: linear-gradient(rgba(15, 23, 42, 0.7), rgba(15, 23, 42, 0.9)), url('../img/luxury_car.png');
    background-size: cover;
    background-position: center 30%;
    border-radius: 20px;
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    color: white;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 45px rgba(0,0,0,0.3);
    overflow: hidden;
}
.dashboard-hero h1 { font-size: 2.5rem; margin-bottom: 0.5rem; font-weight: 800; letter-spacing: -1px; }
.dashboard-hero p { opacity: 0.8; font-size: 1.1rem; }

/* Neon Accents */
.neon-border { border: 1px solid var(--primary); box-shadow: 0 0 15px rgba(99, 102, 241, 0.3); }
.neon-text { text-shadow: 0 0 10px rgba(99, 102, 241, 0.5); }


.card h2, h3 { color: var(--text-heading); font-weight: 800; margin-bottom: 0.5rem; }
.card p { color: var(--text-muted); line-height: 1.5; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    text-decoration: none;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
body.dark-mode .btn-primary { color: #111827; }
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}
.btn-success {
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}
.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-danger:hover {
    background: #DC2626;
}
.btn-warning {
    background: var(--warning);
    color: #000;
}
.btn-block { width: 100%; }

/* Tables */
table th {
    background: var(--bg-table-head);
    padding: 0.75rem 1rem;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}
table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    background: var(--bg-table-row);
    font-size: 0.95rem;
}
table tr:last-child td { border-bottom: none; }
table tr:hover td { background: var(--bg-table-hover); }

/* Badges */
.badge {
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    background: var(--badge-bg);
    color: var(--badge-color);
    display: inline-block;
}
.badge-success { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }

.alert { padding: 1rem; border-radius: 8px; margin-bottom: 1rem; font-weight: 500; }
.alert-danger { background: var(--bg-alert-danger); color: var(--danger); border: 1px solid var(--danger); }


.footer { text-align: center; padding: 2rem; margin-top: auto; color: #64748B; font-weight: 500; }

/* Desktop Menu by Default */
.desktop-menu { display: flex; align-items: center; }
.bottom-nav { display: none; } /* Hidden on desktop */

/* Responsive & PWA Enhancements */
@media (max-width: 768px) {
    /* Touch Target Optimization */
    .btn, .form-control, select, input {
        min-height: 44px;
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    .navbar { padding: 15px; justify-content: center; position: fixed; width: 100%; top:0; z-index: 1000; box-sizing: border-box; }
    .logo { margin:0; }
    .desktop-menu { display: none; } /* Hide right side of top nav */
    
    body { padding-top: 60px; /* offset navbar */ }

    /* Bottom Navigation PWA Style */
    .bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: var(--bg-nav);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
        z-index: 1000;
        padding: 5px 0 15px 0; /* extra padding for iPhone indicator */
    }
    .bottom-nav .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        color: var(--text-muted);
        font-size: 0.75rem;
        font-weight: 600;
        padding: 8px 5px;
        flex: 1;
    }
    .bottom-nav .nav-item i {
        font-size: 1.2rem;
        margin-bottom: 4px;
        color: var(--primary);
    }
    .bottom-nav .nav-item.text-danger i { color: var(--danger); }
    
    /* Responsive Card Tables */
    table, thead, tbody, th, td, tr { 
        display: block; 
    }
    thead tr { 
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    tr { border: 1px solid var(--border-table); border-radius: 8px; margin-bottom: 10px; background: var(--bg-card-solid); padding: 10px; display: flex; flex-direction: column; gap: 8px;}
    td { 
        border: none !important;
        border-bottom: 1px dotted var(--border-table) !important; 
        position: relative;
        padding-left: 45% !important; 
        text-align: right;
        min-height: 24px;
        background: transparent !important;
    }
    td:before { 
        content: attr(data-label);
        position: absolute;
        top: 10px;
        left: 10px;
        width: 40%; 
        padding-right: 10px; 
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
        color: var(--text-muted);
    }
    td:last-child { border-bottom: 0 !important; }
    
    /* Global Container Adjustments*/
    .card { padding: 15px; margin-bottom: 15px;}
    .main-content { padding: 10px 10px 80px 10px; margin-top:0; }
}
