:root {
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 72px;
}

html,
body {
    width: 100%;
    overflow-x: hidden;
}

.portal-body {
    margin: 0;
    background: #e9edf2;
}

.portal-shell {
    min-height: 100vh;
}

.portal-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #223457 0%, #2f456f 100%);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width 0.2s ease;
    z-index: 1030;
}

.portal-main {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    transition: margin-left 0.2s ease;
    overflow-x: hidden;
}

.portal-topbar {
    padding: 0.9rem 1.2rem;
}

.portal-content {
    padding: 0;
}

.portal-content > section {
    background: #f8fafc;
    border-bottom: 1px solid #d8dee8;
    padding: 1.25rem;
}

.module-surface {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
}

.module-inline-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 0.9rem;
}

.module-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.portal-logo-circle {
    width: 58px;
    height: 58px;
    border-radius: 0;
    display: grid;
    place-items: center;
    background: transparent;
    border: 0;
    overflow: hidden;
}

.portal-logo-sm {
    width: 42px;
    height: 42px;
    border-color: rgba(33, 52, 87, 0.18);
}

.portal-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.portal-top-path {
    font-size: 1rem;
    font-weight: 500;
    color: #6b7280;
}

.portal-nav-link {
    color: #e9eff9;
    border-radius: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.portal-nav-link i {
    font-size: 1.1rem;
    min-width: 1.25rem;
}

.portal-nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.portal-nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border-left: 3px solid #4db1ff;
}

.portal-badge {
    width: 56px;
    height: 56px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    flex: 0 0 auto;
}

.sidebar-collapsed .portal-sidebar {
    width: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .portal-main {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
}

.sidebar-collapsed .sidebar-label,
.sidebar-collapsed .sidebar-external {
    display: none;
}

.sidebar-collapsed .portal-brand {
    padding-bottom: 1rem !important;
}

.sidebar-collapsed .portal-logo-circle {
    width: 44px;
    height: 44px;
}

.sidebar-collapsed .portal-nav-link {
    justify-content: center;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
}

.sidebar-collapsed .portal-nav-link i {
    margin: 0;
}

@media (max-width: 991.98px) {
    .portal-sidebar {
        position: static;
        width: 100%;
        min-height: auto;
    }

    .portal-main {
        margin-left: 0;
        width: 100%;
    }

    .portal-topbar {
        padding: 0.9rem 1rem;
    }

    .portal-top-path {
        font-size: 0.92rem;
    }

    #sidebarToggle {
        display: none;
    }

    .portal-content > section {
        padding: 1rem;
    }
}
