:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --accent: #f59e0b;
    --background: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --error: #ef4444;
    --success: #22c55e;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--background);
    color: var(--text);
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Auth Pages */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    padding: 1rem;
}

.auth-card {
    background: var(--surface);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 450px;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    transition: all 0.2s;
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 1rem;
    width: 100%;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: #1e293b;
    color: white;
    padding: 1.5rem;
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
    background: #334155;
    color: white;
}

/* Dashboard Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Sidebar Responsive Logic */
@media (max-width: 768px) {
    .dashboard-layout {
        flex-direction: column;
    }
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        z-index: 50;
        width: 250px;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 1rem;
        width: 100%;
    }
    .hamburger {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        color: var(--text);
    }
    .close-sidebar {
        display: block !important;
        position: absolute;
        top: 1rem;
        right: 1rem;
        background: none;
        border: none;
        color: white;
        font-size: 1.25rem;
        cursor: pointer;
    }
}

@media (min-width: 769px) {
    .hamburger {
        display: none;
    }
    .close-sidebar {
        display: none !important;
    }
}

/* Dark Mode Toggle Button */
.dark-mode-toggle {
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    color: #94a3b8;
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}
.dark-mode-toggle:hover {
    background: #334155;
    color: white;
}

/* Dark Mode */
html.dark-mode {
    --primary: #60a5fa;
    --primary-dark: #3b82f6;
    --secondary: #94a3b8;
    --accent: #fbbf24;
    --background: #0f172a;
    --surface: #1e293b;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --error: #f87171;
    --success: #4ade80;
    --border: #334155;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
}

html.dark-mode body {
    background-color: var(--background);
    color: var(--text);
}

html.dark-mode .sidebar {
    background: #0f172a;
    border-right: 1px solid #334155;
}

html.dark-mode .auth-wrapper {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

html.dark-mode .auth-card {
    background: #1e293b;
    border: 1px solid #334155;
}

html.dark-mode .form-control {
    background: #0f172a;
    border-color: #334155;
    color: var(--text);
}

html.dark-mode .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

html.dark-mode table th,
html.dark-mode table td {
    color: var(--text);
}

html.dark-mode select {
    background: #0f172a;
    color: var(--text);
}

html.dark-mode .stat-card,
html.dark-mode div[style*="background: white"],
html.dark-mode div[style*="background:white"] {
    background: var(--surface) !important;
    border: 1px solid var(--border);
}
