:root {
    --sidebar-w: 250px;
    --brand: #4f46e5;
}

body { background: #f4f6fb; }
[data-bs-theme="dark"] body { background: #0f1115; }

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

.sidebar {
    width: var(--sidebar-w);
    background: #1e293b;
    color: #cbd5e1;
    position: fixed; top: 0; left: 0; bottom: 0;
    display: flex; flex-direction: column;
    transition: transform .25s ease;
    z-index: 1040;
}
.sidebar-brand {
    font-size: 1.15rem; font-weight: 700; color: #fff;
    padding: 18px 20px; display: flex; align-items: center; gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-nav { padding: 12px 10px; overflow-y: auto; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 10px;
    color: #cbd5e1; text-decoration: none;
    padding: 10px 14px; border-radius: 8px; margin-bottom: 2px;
    font-size: .93rem;
}
.sidebar-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-nav a.active { background: var(--brand); color: #fff; }
.nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em;
    color: #64748b; padding: 14px 14px 4px; }

.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }

.topbar {
    height: 60px; background: #fff; border-bottom: 1px solid #e5e7eb;
    display: flex; align-items: center; padding: 0 18px; position: sticky; top: 0; z-index: 1030;
}
[data-bs-theme="dark"] .topbar { background: #1a1d24; border-color: #2a2f3a; }

.content { padding: 24px; flex: 1; }
.page-title { font-weight: 700; }

.avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--brand); color: #fff; display: inline-flex;
    align-items: center; justify-content: center; font-weight: 600;
}

/* ---------- KPI cards ---------- */
.kpi-card {
    background: #fff; border-radius: 12px; padding: 16px;
    border-left: 4px solid #ccc; box-shadow: 0 1px 3px rgba(0,0,0,.06);
    height: 100%;
}
[data-bs-theme="dark"] .kpi-card { background: #1a1d24; }
.kpi-icon { font-size: 1.4rem; }
.kpi-value { font-size: 1.35rem; font-weight: 700; margin-top: 4px; }
.kpi-label { color: #6b7280; font-size: .8rem; }

.card { border: none; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.card-header { background: transparent; font-weight: 600; border-bottom: 1px solid #eef0f4; }
[data-bs-theme="dark"] .card { background: #1a1d24; }
[data-bs-theme="dark"] .card-header { border-color: #2a2f3a; }

/* ---------- Auth ---------- */
.auth-body {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #4f46e5, #06b6d4);
}
.auth-card {
    background: #fff; padding: 34px; border-radius: 16px;
    width: 100%; max-width: 400px; box-shadow: 0 12px 40px rgba(0,0,0,.2);
}
.auth-logo {
    width: 60px; height: 60px; border-radius: 16px; margin: 0 auto;
    background: var(--brand); color: #fff; font-size: 1.7rem;
    display: flex; align-items: center; justify-content: center;
}
.auth-flash { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 10; width: 90%; max-width: 400px; }

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