:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --bg: #f3f4f6;
    --text: #111827;
    --danger: #dc2626;
    --white: #ffffff;
    --radius: 8px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    background: var(--bg);
    color: var(--text);
}

/* Auth layout */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-container {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    width: 100%;
    max-width: 380px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
}

.auth-container h1 {
    margin-bottom: 1.5rem;
    text-align: center;
}

.auth-form label {
    display: block;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.auth-form input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    margin-top: 0.25rem;
    border-radius: 6px;
    border: 1px solid #d1d5db;
}

.btn-primary {
    width: 100%;
    padding: 0.7rem;
    border: none;
    border-radius: 6px;
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.alert {
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.alert-error {
    background: #fee2e2;
    color: #b91c1c;
}

/* Dashboard layout */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--white);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.logo {
    font-weight: 700;
    color: var(--primary);
}

.user-name {
    margin-right: 1rem;
    font-size: 0.9rem;
}

.btn-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
}

.main-layout {
    display: flex;
    min-height: calc(100vh - 56px);
}

.sidebar {
    width: 220px;
    background: #111827;
    color: #e5e7eb;
    padding: 1rem 0.75rem;
}

.nav-link {
    display: block;
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    color: #e5e7eb;
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.nav-link.active,
.nav-link:hover {
    background: #1f2937;
}

.content {
    flex: 1;
    padding: 1.5rem;
}

/* Responsive tweaks */
@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        display: flex;
        overflow-x: auto;
    }

    .nav-link {
        margin-right: 0.5rem;
        margin-bottom: 0;
        white-space: nowrap;
    }
}
/* --- TOPBAR --- */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    z-index: 1000;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
}

.logo {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.2rem;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* --- SIDEBAR --- */
.sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    width: 240px;
    height: calc(100vh - 56px);
    background: #111827;
    color: #e5e7eb;
    padding: 1rem 0.75rem;
    overflow-y: auto;
    transition: transform 0.25s ease;
}

.sidebar nav a {
    display: block;
    padding: 0.7rem 0.75rem;
    border-radius: 6px;
    color: #e5e7eb;
    text-decoration: none;
    margin-bottom: 0.25rem;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: #1f2937;
}

/* --- MAIN LAYOUT --- */
.main-layout {
    margin-top: 56px;
    margin-left: 240px;
    padding: 1.5rem;
    transition: margin-left 0.25s ease;
}

/* --- MOBILE RESPONSIVE --- */
@media (max-width: 768px) {

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: block;
        color: var(--primary);
    }

    .main-layout {
        margin-left: 0;
    }
}
