:root {
    --sidebar-width: 290px;
    --topbar-height: 72px;
    --app-bg: #f3f6fb;
    --app-surface: #ffffff;
    --app-border: rgba(15, 23, 42, .09);
    --app-muted: #64748b;
    --sidebar-bg: #111827;
    --sidebar-bg-2: #1f2937;
}

[data-bs-theme="dark"] {
    --app-bg: #0f172a;
    --app-surface: #111827;
    --app-border: rgba(148, 163, 184, .18);
    --app-muted: #94a3b8;
    --sidebar-bg: #020617;
    --sidebar-bg-2: #111827;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background: var(--app-bg);
}

.app-body {
    color: var(--bs-body-color);
}

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

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-bg-2));
    color: #fff;
    padding: 1.15rem;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
    overflow-y: auto;
    box-shadow: 20px 0 60px rgba(15, 23, 42, .2);
}

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

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: .8rem;
    color: #fff;
    text-decoration: none;
}

.brand-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 1rem;
    display: inline-grid;
    place-items: center;
    background: linear-gradient(135deg, #0d6efd, #7c3aed);
    color: #fff;
    font-size: 1.35rem;
    flex: 0 0 auto;
}

.brand-title {
    display: block;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.1;
}

.brand-subtitle {
    display: block;
    font-size: .78rem;
    color: rgba(255, 255, 255, .58);
}

.btn-sidebar-close {
    color: rgba(255, 255, 255, .85);
    border-color: rgba(255, 255, 255, .16);
}

.avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    background: #0d6efd;
    color: #fff;
    font-weight: 700;
    flex: 0 0 auto;
}

.avatar-sm {
    width: 1.75rem;
    height: 1.75rem;
    font-size: .85rem;
}

.sidebar-nav {
    gap: .25rem;
}

.sidebar-module {
    position: relative;
}

.sidebar-module > summary {
    list-style: none;
    cursor: pointer;
}

.sidebar-module > summary::-webkit-details-marker {
    display: none;
}

.sidebar-module-chevron {
    margin-left: auto;
    transition: transform .18s ease;
}

.sidebar-module[open] > .sidebar-module-toggle .sidebar-module-chevron {
    transform: rotate(90deg);
}

.sidebar-subnav {
    display: none;
    flex-direction: column;
    gap: .15rem;
    margin: .2rem 0 .4rem 1.05rem;
    padding-left: .45rem;
    border-left: 1px solid rgba(255, 255, 255, .14);
}

.sidebar-module[open] > .sidebar-subnav,
.sidebar-module:focus-within > .sidebar-subnav {
    display: flex;
}

@media (hover: hover) {
    .sidebar-module:hover > .sidebar-subnav {
        display: flex;
    }

    .sidebar-module:hover > .sidebar-module-toggle .sidebar-module-chevron {
        transform: rotate(90deg);
    }
}

.sidebar-subnav .nav-link {
    padding: .6rem .75rem;
    font-size: .92rem;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: rgba(255, 255, 255, .78);
    border-radius: .9rem;
    padding: .72rem .9rem;
    font-weight: 500;
}

.sidebar .nav-link:hover,
.sidebar .nav-link:focus,
.sidebar .nav-link.active {
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

.sidebar .nav-link.active {
    box-shadow: inset 3px 0 0 #60a5fa;
}

.sidebar .nav-link i {
    width: 1.35rem;
    text-align: center;
}

.sidebar .nav-link.disabled {
    opacity: .45;
}

.content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    min-height: var(--topbar-height);
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--app-border);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1020;
}

[data-bs-theme="dark"] .topbar {
    background: rgba(15, 23, 42, .86);
}

.breadcrumb-line {
    color: var(--app-muted);
    font-size: .82rem;
    font-weight: 600;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: .65rem;
}

.user-menu {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    border-color: var(--app-border);
    background: var(--app-surface);
}

[data-bs-theme="dark"] .user-menu,
[data-bs-theme="dark"] .user-menu:hover,
[data-bs-theme="dark"] .user-menu:focus,
[data-bs-theme="dark"] .user-menu.show {
    color: #fff;
    background: var(--app-surface);
    border-color: var(--app-border);
}

.page-body {
    padding: 1.5rem;
    flex: 1;
}

.app-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--app-border);
    color: var(--app-muted);
    font-size: .9rem;
}

.card {
    background: var(--app-surface);
}

.stat-card {
    border-radius: 1.25rem;
}

.stat-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 1rem;
    display: inline-grid;
    place-items: center;
    background: rgba(13, 110, 253, .1);
    color: #0d6efd;
    margin-bottom: .75rem;
}

.login-page {
    min-height: 100vh;
    display: grid;
    background:
        radial-gradient(circle at top left, rgba(13, 110, 253, .26), transparent 32%),
        radial-gradient(circle at bottom right, rgba(124, 58, 237, .2), transparent 30%),
        var(--app-bg);
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(420px, 520px);
}

.login-hero {
    align-items: center;
    padding: 4rem;
    color: #fff;
    background: linear-gradient(135deg, #0f172a, #1e3a8a 55%, #312e81);
}

.login-feature {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .55rem 0;
    color: rgba(255, 255, 255, .82);
}

.login-feature i {
    color: #93c5fd;
}

.login-panel {
    display: grid;
    place-items: center;
    padding: 2rem;
}

.login-card {
    width: min(100%, 440px);
    border-radius: 1.5rem;
}

.login-logo {
    width: 4rem;
    height: 4rem;
    border-radius: 1.25rem;
    display: inline-grid;
    place-items: center;
    background: linear-gradient(135deg, #0d6efd, #7c3aed);
    color: #fff;
    font-size: 2rem;
}

.app-overlay {
    display: none;
}

.min-w-0 {
    min-width: 0;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-105%);
        transition: transform .2s ease;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .app-overlay {
        position: fixed;
        inset: 0;
        z-index: 1030;
        background: rgba(15, 23, 42, .48);
    }

    body.sidebar-open .app-overlay {
        display: block;
    }

    .content {
        margin-left: 0;
    }

    .topbar {
        align-items: center;
        gap: 1rem;
    }
}

@media (max-width: 767.98px) {
    .topbar {
        padding: .85rem 1rem;
    }

    .topbar-actions {
        gap: .4rem;
    }

    .page-body {
        padding: 1rem;
    }

    .app-footer {
        flex-direction: column;
        padding: 1rem;
    }

    .login-shell {
        display: block;
    }

    .login-panel {
        min-height: 100vh;
        padding: 1rem;
    }
}
.notification-count-badge { font-size: .62rem; }
.setup-container { max-width: 720px; }
.branding-logo-preview { max-height: 90px; }
.account-notification-table { min-width: 310px; }
.maintenance-page { font: 16px system-ui; max-width: 720px; margin: 10vh auto; padding: 2rem; }
.password-progress-0 { width: 0; }
.password-progress-20 { width: 20%; }
.password-progress-40 { width: 40%; }
.password-progress-60 { width: 60%; }
.password-progress-80 { width: 80%; }
.password-progress-100 { width: 100%; }
