:root {
    --bg-body: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --text-main: #111827;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --primary-blue: #2563eb;
    --blue-soft: #eff6ff;
    --green: #059669;
    --green-soft: #ecfdf5;
    --amber: #d97706;
    --sidebar-width: 286px;
    --shadow-soft: 0 18px 42px rgba(15, 23, 42, .08);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, .08), transparent 32%),
        linear-gradient(180deg, #f8fafc 0%, var(--bg-body) 44%, #eef2f7 100%);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: .88rem;
    letter-spacing: 0;
}

a {
    text-decoration: none;
}

body .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1050;
    width: var(--sidebar-width);
    height: 100vh;
    padding: 14px 14px;
    overflow-y: auto;
    background:
        linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.96)),
        var(--surface);
    border-right: 1px solid rgba(226, 232, 240, .9);
    box-shadow: 16px 0 36px rgba(15, 23, 42, .05);
    transition: transform .25s ease, box-shadow .25s ease;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.sidebar::-webkit-scrollbar {
    width: 7px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

body .sidebar .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 60px;
    margin: 0 0 10px;
    padding: 8px 8px 12px;
    color: var(--text-main);
    border-bottom: 1px solid rgba(226, 232, 240, .8);
}

.sidebar-brand-mark {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 50%;
    background: linear-gradient(135deg, #dbeafe, #dcfce7);
    border: 1px solid rgba(37, 99, 235, .16);
    color: var(--primary-blue);
    box-shadow: 0 12px 24px rgba(37, 99, 235, .14);
}

.sidebar-brand-mark img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.sidebar-brand-mark i {
    font-size: 1.45rem;
}

.sidebar-brand-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.sidebar-brand-copy span {
    overflow: hidden;
    color: #0f172a;
    font-size: 1.05rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-brand-copy small {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: .72rem;
    font-weight: 750;
}

.sidebar .nav {
    gap: 2px;
}

.sidebar-section-title {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 18px 12px 7px;
    color: #94a3b8;
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.sidebar-section-title i {
    font-size: .85rem;
}

.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 44px;
    margin: 2px 0;
    padding: 10px 12px;
    border-radius: 8px;
    color: #475569;
    font-size: .88rem;
    font-weight: 720;
    transition: background .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.nav-link i {
    width: 22px;
    margin-right: 10px;
    color: #94a3b8;
    font-size: 1.02rem;
    text-align: center;
    transition: color .18s ease;
}

.nav-link:hover {
    transform: translateX(2px);
    background: #f1f5f9;
    color: #0f172a;
}

.nav-link:hover i {
    color: var(--primary-blue);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--blue-soft), #ecfeff);
    color: #1d4ed8;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .12);
}

.nav-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, #2563eb, #22c55e);
}

.nav-link.active i {
    color: #2563eb;
}

.nav-link.text-danger {
    color: #dc2626 !important;
}

.nav-link.text-danger:hover {
    background: #fef2f2;
}

.badge.rounded-pill {
    min-width: 24px;
    padding: 5px 8px;
    border-radius: 999px !important;
    font-size: .7rem;
    font-weight: 850;
}

.badge.bg-primary {
    background: #2563eb !important;
}

.badge.bg-success {
    background: #059669 !important;
}

.badge.bg-warning {
    background: #fef3c7 !important;
    color: #92400e !important;
}

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

body .topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    min-height: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 10px 28px;
    background: rgba(255, 255, 255, .88);
    border-bottom: 1px solid rgba(226, 232, 240, .86);
    box-shadow: 0 10px 26px rgba(15, 23, 42, .04);
    backdrop-filter: blur(16px);
}

body .topbar-main {
    min-width: 0;
    display: flex !important;
    align-items: center !important;
    gap: 14px;
}

body .topbar-title {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

body .topbar-title span {
    display: block;
    color: #0f172a;
    font-size: .98rem;
    font-weight: 900;
    line-height: 1.2;
}

body .topbar-title small {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
    font-size: .74rem;
    font-weight: 650;
    line-height: 1.2;
}

body .topbar-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: nowrap !important;
    gap: 10px;
    min-width: 0;
    margin-left: auto;
}

body .topbar-metrics {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 8px;
}

body .topbar-metrics span {
    min-height: 36px;
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-size: .78rem;
    font-weight: 820;
    white-space: nowrap;
}

body .topbar-metrics i {
    color: var(--primary-blue);
    line-height: 1;
}

body .topbar-metrics b {
    color: #0f172a;
    font-weight: 900;
}

body .btn-top {
    min-height: 38px;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px;
    padding: 8px 13px;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    font-size: .82rem;
    font-weight: 850;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    white-space: nowrap;
}

body .btn-top:hover {
    transform: translateY(-1px);
    border-color: #93c5fd;
    color: #1d4ed8;
    box-shadow: 0 12px 24px rgba(37, 99, 235, .10);
}

body .btn-top.active-action {
    border-color: rgba(37, 99, 235, .22);
    background: linear-gradient(135deg, #eff6ff, #ecfeff);
    color: #1d4ed8;
}

body button.user-badge {
    appearance: none;
    min-height: 42px;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center;
    gap: 10px;
    padding: 5px 6px 5px 12px;
    border: 1px solid transparent !important;
    border-radius: 999px !important;
    background: #f8fafc !important;
    color: #334155;
    cursor: pointer;
    font: inherit;
    line-height: 1;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

body button.user-badge:hover,
body button.user-badge[aria-expanded="true"] {
    border-color: #bfdbfe;
    background: #fff;
    box-shadow: 0 12px 24px rgba(15, 23, 42, .08);
}

body .user-avatar {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #059669);
    color: #fff;
    font-size: .88rem;
    font-weight: 900;
    box-shadow: 0 9px 18px rgba(37, 99, 235, .20);
}

body .dropdown-menu {
    min-width: 210px;
    margin-top: 10px !important;
    padding: 8px;
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    font-size: .86rem;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 9px;
    border-radius: 8px;
    padding: 9px 10px;
    font-weight: 700;
}

.dropdown-item i {
    width: 18px;
    text-align: center;
}

.content-container {
    width: 100%;
    flex-grow: 1;
    padding: 28px;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 1040;
    display: none;
    background: rgba(15, 23, 42, .46);
    backdrop-filter: blur(2px);
}

.mobile-toggle {
    width: 42px;
    height: 42px;
    display: none;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    cursor: pointer;
    font-size: 1.25rem;
}

.mobile-toggle:hover {
    border-color: #93c5fd;
    color: #1d4ed8;
}

@media (max-width: 1199.98px) {
    :root {
        --sidebar-width: 268px;
    }

    body .topbar {
        padding: 14px 22px;
    }

    .content-container {
        padding: 24px;
    }
}

@media (max-width: 991.98px) {
    body .sidebar {
        transform: translateX(calc(-1 * var(--sidebar-width) - 20px));
        box-shadow: none;
    }

    body .sidebar.active {
        transform: translateX(0);
        box-shadow: 18px 0 46px rgba(15, 23, 42, .20);
    }

    body .main-content {
        margin-left: 0;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .mobile-toggle {
        display: inline-flex;
    }

    body .topbar {
        min-height: 68px;
        height: 68px;
        padding: 12px 16px;
    }

    body .topbar-title small {
        display: none;
    }

    .content-container {
        padding: 18px 14px 22px;
    }
}

@media (max-width: 575.98px) {
    :root {
        --sidebar-width: min(86vw, 314px);
    }

    body {
        font-size: .86rem;
    }

    body .topbar {
        gap: 10px;
        padding: 10px 12px;
    }

    body .topbar-title span {
        max-width: 46vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: .94rem;
    }

    body .topbar-actions {
        gap: 6px;
    }

    body button.user-badge {
        min-height: 40px;
        padding: 4px;
        background: transparent;
    }

    body .user-avatar {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    .mobile-toggle {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    body .sidebar {
        padding: 14px 12px;
    }

    body .sidebar .sidebar-brand {
        min-height: 62px;
        padding: 8px 8px 12px;
    }

    .sidebar-brand-mark {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }

    .nav-link {
        min-height: 46px;
        padding: 11px 12px;
    }

    .content-container {
        padding: 14px 10px 20px;
    }
}
