/* ShadCN / Tailwind System Inspired Variables */
:root {
    --background: #f8f9fa;
    --foreground: #09090b;
    --card: #ffffff;
    --card-foreground: #09090b;
    --popover: #ffffff;
    --popover-foreground: #09090b;
    --primary: #18181b;
    --primary-foreground: #fafafa;
    --secondary: #f4f4f5;
    --secondary-foreground: #18181b;
    --muted: #f4f4f5;
    --muted-foreground: #71717a;
    --accent: #f4f4f5;
    --accent-foreground: #18181b;
    --destructive: #ef4444;
    --destructive-foreground: #fafafa;
    --border: #e4e4e7;
    --input: #e4e4e7;
    --ring: #18181b;
    --radius: 0.5rem;
}

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

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    min-height: 100vh;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    box-sizing: border-box;
    padding-bottom: 100px; /* Space for bottom nav on mobile */
}

/* Cards */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    height: 40px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-foreground);
}
.btn-primary:hover { opacity: 0.9; }

.btn-destructive {
    background: var(--destructive);
    color: var(--destructive-foreground);
}
.btn-destructive:hover { opacity: 0.9; }

/* Inputs */
.form-input {
    width: 100%;
    height: 40px;
    padding: 8px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--input);
    background-color: transparent;
    font-size: 14px;
    color: var(--foreground);
    box-sizing: border-box;
    margin-top: 6px;
}
.form-input:focus {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 2px rgba(24, 24, 27, 0.1);
}

/* Header Styles (Used by Navbar Component) */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    background: var(--card);
    padding: 16px 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

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

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: var(--primary-foreground);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.logout-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--destructive);
    padding: 8px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}
.logout-btn:hover { background: #fef2f2; border-color: #fee2e2; }

/* Desktop Nav */
.desktop-nav {
    display: flex;
    gap: 8px;
    background: var(--secondary);
    padding: 4px;
    border-radius: var(--radius);
}

.nav-link {
    background: transparent;
    border: none;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted-foreground);
    border-radius: calc(var(--radius) - 2px);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.nav-link:hover { color: var(--foreground); }
.nav-link.active {
    background: var(--background);
    color: var(--foreground);
    box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05);
}

/* Mobile Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--card);
    border-top: 1px solid var(--border);
    display: none;
    justify-content: space-around;
    padding: 12px 0;
    z-index: 50;
}

.nav-item {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--muted-foreground);
    cursor: pointer;
    width: 100%;
    text-decoration: none;
}

.nav-item.active { color: var(--primary); }

/* Mobile Media Queries */
@media (max-width: 768px) {
    .bottom-nav { display: flex; }
    .container { 
        padding-left: 16px; 
        padding-right: 16px; 
        padding-bottom: 90px;
        padding-top: 16px;
    }
    .header { padding: 12px 16px; margin-bottom: 20px; }
    .desktop-nav { display: none; }
    .logout-text { display: none; }
    
    .card { padding: 16px; }
    .car-grid { gap: 16px; }
    
    /* Adjust grid columns for mobile if needed for profile */
    .form-grid-2 { grid-template-columns: 1fr !important; }
}

/* Utilities */
.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    border: 1px solid transparent;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 600;
}
.badge-warning { background: #fef3c7; color: #b45309; border-color: #fcd34d; }
.badge-success { background: #dcfce7; color: #166534; border-color: #bbf7d0; }


/* SweetAlert Custom Overrides */
.swal-popup-custom {
    border-radius: 16px !important;
}

/* ADMIN LAYOUT */
.admin-layout {
    display: flex;
    min-height: 100vh;
    background: var(--background);
}

.admin-sidebar {
    width: 260px;
    background: var(--card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 0 24px 24px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border);
}

.sidebar-menu {
    flex: 1;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: var(--radius);
    color: var(--muted-foreground);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    background: transparent;
    border: none;
    width: 100%;
    cursor: pointer;
    text-align: left;
}
.sidebar-link:hover {
    background: var(--secondary);
    color: var(--foreground);
}
.sidebar-link.active {
    background: var(--primary);
    color: var(--primary-foreground);
}

.admin-main {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
    transition: margin 0.3s ease;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.data-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.data-table th, .data-table td { padding: 16px; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th { background: #f1f5f9; color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.data-table tr:hover { background: #f8fafc; }

/* Grid for Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
}
.stat-icon.blue { background: #dbeafe; color: #2563eb; }
.stat-icon.green { background: #dcfce7; color: #166534; }
.stat-icon.red { background: #fee2e2; color: #dc2626; }

/* Monitoring Grid */
.monitor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.monitor-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

/* Mobile Admin */
@media (max-width: 1024px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.show { transform: translateX(0); }
    .admin-main { margin-left: 0; padding: 20px; }
}
