:root {
    --brand: #4f46e5;
    --brand-dark: #4338ca;
    --brand-soft: #eef2ff;
    --ink: #1e293b;
    --muted: #64748b;
    --bg: #f1f5f9;
}

body {
    background-color: var(--bg);
    color: var(--ink);
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* ---------- Auth (login) screen ---------- */
.auth-wrapper {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--brand) 0%, #7c3aed 100%);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    border: none;
    border-radius: 1rem;
    box-shadow: 0 20px 45px rgba(15, 23, 42, .25);
}

.auth-logo {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 1.6rem;
}

/* ---------- Sidebar layout ---------- */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #e2e8f0;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    transition: transform .25s ease;
}

.sidebar .brand {
    font-weight: 700;
    color: var(--brand);
    padding: 1.25rem 1.25rem;
    font-size: 1.15rem;
    border-bottom: 1px solid #eef2f7;
}

.sidebar .nav-link {
    color: var(--muted);
    border-radius: .55rem;
    padding: .6rem .85rem;
    margin: .15rem .75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: .65rem;
}

.sidebar .nav-link:hover {
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.sidebar .nav-link.active {
    background: var(--brand);
    color: #fff;
}

.main-area {
    flex: 1;
    margin-left: 250px;
    min-width: 0;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: .75rem 1.25rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.content {
    padding: 1.5rem;
}

/* Stat cards */
.stat-card {
    border: none;
    border-radius: .85rem;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .06);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.3rem;
}

.card {
    border: none;
    border-radius: .85rem;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .06);
}

.table > :not(caption) > * > * {
    padding: .85rem 1rem;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand);
    display: grid;
    place-items: center;
    font-weight: 600;
    flex-shrink: 0;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    z-index: 1035;
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-area {
        margin-left: 0;
    }
    .sidebar-backdrop.show {
        display: block;
    }
}
