:root {
    --primary-color: #6366f1;
    /* Indigo 500 */
    --primary-hover: #4f46e5;
    /* Indigo 600 */

    /* Default is Dark Mode (Slate) */
    --bg-color: #0f172a;
    /* Slate 900 */
    --sidebar-bg: #1e293b;
    /* Slate 800 */
    --card-bg: #1e293b;
    /* Slate 800 */
    --text-main: #f8fafc;
    /* Slate 50 */
    --text-muted: #94a3b8;
    /* Slate 400 */
    --border-color: #334155;
    /* Slate 700 */

    --danger-color: #ef4444;
    --success-color: #22c55e;
    --font-family: 'Inter', sans-serif;
}

/* Light Mode Overrides */
body.light-mode {
    --bg-color: #f1f5f9;
    /* Slate 100 */
    --sidebar-bg: #ffffff;
    /* White */
    --card-bg: #ffffff;
    /* White */
    --text-main: #0f172a;
    /* Slate 900 */
    --text-muted: #64748b;
    /* Slate 500 */
    --border-color: #e2e8f0;
    /* Slate 200 */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

/* Utilities */
.hidden {
    display: none !important;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

.btn-text:hover {
    color: var(--text-main);
}

/* Auth Container */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: radial-gradient(circle at top right, #312e81, var(--bg-color));
}

.auth-box {
    background-color: var(--card-bg);
    padding: 2.5rem;
    border-radius: 1rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.auth-box h1 {
    margin-bottom: 0.5rem;
}

.auth-box .subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.auth-box input {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-main);
}

.auth-switch {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    color: var(--primary-color);
}

.nav-links {
    list-style: none;
    flex: 1;
}

.nav-links li {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-links li:hover,
.nav-links li.active {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.user-profile {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    font-size: 0.9rem;
}

.user-profile span {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background-color: var(--bg-color);
}

/* Content Sections */
.content-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
}

.stat-card h3 {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    background-color: var(--card-bg);
    border-radius: 1rem;
    width: 90%;
    max-width: 500px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body input,
.modal-body select {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-main);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        padding: 1rem;
        justify-content: space-between;
        align-items: center;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .logo {
        margin-bottom: 0;
        font-size: 1rem;
    }

    .nav-links {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background-color: var(--sidebar-bg);
        display: flex;
        justify-content: space-around;
        padding: 0.5rem;
        border-top: 1px solid var(--border-color);
        z-index: 100;
    }

    .nav-links li {
        flex-direction: column;
        font-size: 0.7rem;
        gap: 0.25rem;
        padding: 0.5rem;
        margin: 0;
    }

    .nav-links li .icon {
        font-size: 1.2rem;
    }

    .user-profile {
        display: none;
    }

    /* Hide profile on mobile for simplicity */
    .main-content {
        padding-bottom: 100px;
    }

    /* Space for bottom nav */
}