:root {
    --sidebar-width: 240px;
    --topbar-height: 60px;
    --brand: #4f46e5;
    --brand-dark: #4338ca;
    --bg: #f6f7fb;
    --border: #e5e7eb;
    --text-muted: #6b7280;
}

* { box-sizing: border-box; }

body {
    background: var(--bg);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.9rem;
    color: #111827;
}

.auth-body { background: linear-gradient(135deg, #eef2ff 0%, #f6f7fb 100%); }
.auth-card { width: 380px; border: 1px solid var(--border); border-radius: 12px; }

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

.sidebar {
    width: var(--sidebar-width);
    background: #111827;
    color: #d1d5db;
    flex-shrink: 0;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    overflow-y: auto;
    transition: transform .2s ease;
    z-index: 1030;
}
.sidebar .brand {
    height: var(--topbar-height);
    display: flex; align-items: center;
    padding: 0 1.1rem;
    font-weight: 700;
    color: #fff;
    font-size: 1.05rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar .nav-section-title {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #6b7280;
    padding: .9rem 1.1rem .35rem;
}
.sidebar .nav-link {
    color: #d1d5db;
    padding: .5rem 1.1rem;
    font-size: .86rem;
    display: flex; align-items: center; gap: .6rem;
    border-radius: 0;
}
.sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar .nav-link.active { background: var(--brand); color: #fff; }
.sidebar .nav-link i { width: 18px; text-align: center; opacity: .85; font-size: .85rem; }

.main-wrap {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    position: sticky; top: 0; z-index: 1020;
}

.content { padding: 1.25rem; flex: 1; }

.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1rem;
}
.page-header h1 { font-size: 1.25rem; font-weight: 700; margin: 0; }

/* ---- Cards / KPIs ---- */
.kpi-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.1rem;
}
.kpi-card .kpi-label { font-size: .78rem; color: var(--text-muted); }
.kpi-card .kpi-value { font-size: 1.4rem; font-weight: 700; margin-top: .15rem; }

.card { border: 1px solid var(--border); border-radius: 10px; box-shadow: none; }
.card-header { background: #fff; border-bottom: 1px solid var(--border); font-weight: 600; font-size: .9rem; }

.table { font-size: .86rem; }
.table thead th {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-muted); border-bottom-width: 1px; font-weight: 600;
}

.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }

.badge-status { font-weight: 500; font-size: .72rem; }

@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-wrap { margin-left: 0; }
}

@media print {
    .sidebar, .topbar, .d-print-none, .btn, form button { display: none !important; }
    .main-wrap { margin-left: 0 !important; }
    .content { padding: 0 !important; }
    .card { border: 1px solid #ccc !important; break-inside: avoid; }
    body { background: #fff !important; }
}
