:root {
    --app-bg: #f4f7fb;
    --sidebar-bg: #111827;
    --sidebar-soft: #1f2937;
    --primary: #3157d5;
    --primary-dark: #2446b5;
}

body {
    background: var(--app-bg);
    color: #172033;
}

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

.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    color: #e5e7eb;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
}

.brand-title {
    font-weight: 700;
    line-height: 1.15;
}

.sidebar .nav {
    padding: 1rem;
    flex: 1;
}

.sidebar .nav-link {
    color: #cbd5e1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .72rem .85rem;
}

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

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,.08);
}

.content {
    flex: 1;
    padding: 1.5rem;
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.topbar h1 {
    font-size: 1.55rem;
    margin: 0;
    font-weight: 750;
}

.panel {
    background: #fff;
    border: 1px solid #e6eaf2;
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
}

.stat {
    border: 0;
    border-radius: 8px;
    color: #fff;
    overflow: hidden;
}

.stat .icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.18);
}

.btn-primary {
    --bs-btn-bg: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: var(--primary-dark);
    --bs-btn-hover-border-color: var(--primary-dark);
}

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

.action-cell {
    width: 150px;
    white-space: nowrap;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: linear-gradient(135deg, #eef4ff 0%, #f8fafc 55%, #eef8f3 100%);
}

.login-card {
    width: min(100%, 420px);
}

.progress {
    height: .65rem;
}

@media (max-width: 900px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: static;
        width: 100%;
        height: auto;
    }

    .sidebar .nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .content {
        padding: 1rem;
    }
}

@media print {
    .sidebar,
    .topbar,
    .no-print,
    .alert {
        display: none !important;
    }

    .app-shell,
    .content {
        display: block;
        padding: 0;
        min-height: auto;
    }

    body {
        background: #fff;
    }

    .panel {
        box-shadow: none;
        border-color: #d7dce5;
        break-inside: avoid;
    }
}
