.portal-body {
    margin: 0;
    min-height: 100vh;
    background: #f3f5f9;
    color: #0f172a;
}

.portal-skip-link {
    position: absolute;
    left: -9999px;
    top: 8px;
    z-index: 1000;
    background: #0a2c8b;
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
}

.portal-skip-link:focus {
    left: 8px;
}

.portal-layout {
    display: flex;
    min-height: 100vh;
}

.portal-layout--guest {
    display: block;
}

.portal-sidebar {
    width: 280px;
    flex: 0 0 280px;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    background: linear-gradient(180deg, #061433 0%, #0b1f4c 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    padding: 20px 16px;
    z-index: 60;
}

.portal-sidebar__brand {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.portal-brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #f8fafc;
    font-weight: 700;
    text-decoration: none;
}

.portal-brand-link img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.portal-nav__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.portal-nav__link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #dbe6ff;
    text-decoration: none;
    padding: 11px 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 14px;
    line-height: 1.35;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.portal-nav__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 22px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
}

.portal-nav__link:hover,
.portal-nav__link:focus-visible {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.portal-nav__link.is-active {
    background: #ffffff;
    border-color: #ffffff;
    color: #0a2c8b;
    font-weight: 600;
}

.portal-nav__link.is-active .portal-nav__icon {
    background: rgba(10, 44, 139, 0.12);
}

.portal-main {
    width: 100%;
    margin-left: 280px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.portal-main--guest {
    margin-left: 0;
}

.portal-topbar {
    min-height: 76px;
    background: #ffffff;
    border-bottom: 1px solid #dbe3f1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 24px;
    position: sticky;
    top: 0;
    z-index: 40;
}

.portal-topbar__left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.portal-topbar__eyebrow {
    margin: 0 0 2px;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: 11px;
    color: #59667f;
}

.portal-topbar__title {
    margin: 0;
    font-size: 24px;
    color: #0f172a;
}

.portal-topbar__right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.portal-topbar__identity {
    text-align: right;
    min-width: 0;
}

.portal-topbar__user,
.portal-topbar__company {
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: min(30vw, 320px);
}

.portal-topbar__user {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
}

.portal-topbar__company {
    font-size: 12px;
    color: #5c6a82;
}

.portal-nav-toggle {
    display: none;
    border: 1px solid #cad4e3;
    background: #ffffff;
    color: #0f172a;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    cursor: pointer;
}

.portal-content {
    width: 100%;
    max-width: none;
    padding: 24px;
}

.portal-content .portal-shell {
    width: 100%;
    max-width: none;
    margin: 0;
}

.portal-sidebar-backdrop {
    display: none;
}

.portal-guestbar {
    background: #ffffff;
    border-bottom: 1px solid #dbe3f1;
}

.portal-guestbar__inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.portal-guestbar .portal-brand-link {
    color: #0f172a;
}

.portal-guestbar__title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
}

.portal-content--guest {
    max-width: 1120px;
    margin: 0 auto;
    width: 100%;
    padding: 32px 24px;
}

.portal-shell--guest-login {
    max-width: 560px;
    margin: 0 auto;
    width: 100%;
}

.portal-shell--guest-login .portal-header {
    margin-bottom: 16px;
}

@media (max-width: 1279px) {
    .portal-sidebar {
        width: 250px;
        flex-basis: 250px;
    }

    .portal-main {
        margin-left: 250px;
    }
}

@media (max-width: 1023px) {
    .portal-nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .portal-sidebar {
        transform: translateX(-100%);
        transition: transform .2s ease;
    }

    .portal-main {
        margin-left: 0;
    }

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

    .portal-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        border: 0;
        background: rgba(4, 11, 26, 0.46);
        opacity: 0;
        visibility: hidden;
        z-index: 50;
        transition: opacity .2s ease;
    }

    .portal-body.portal-nav-open .portal-sidebar-backdrop {
        opacity: 1;
        visibility: visible;
    }

    .portal-topbar {
        padding: 12px 16px;
    }

    .portal-content {
        padding: 16px;
    }
}

@media (max-width: 767px) {
    .portal-topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .portal-topbar__right {
        justify-content: space-between;
    }

    .portal-topbar__identity {
        text-align: left;
    }

    .portal-topbar__title {
        font-size: 20px;
    }

    .portal-guestbar__inner {
        padding: 12px 16px;
        flex-direction: column;
        align-items: flex-start;
    }

    .portal-content--guest {
        padding: 16px;
    }
}

.portal-grid--kpi {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.portal-grid--kpi .portal-card h3 {
    margin: 0 0 6px;
    font-size: 28px;
}

.portal-actions {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.portal-inline-form {
    display: inline;
}

.no-margin {
    margin: 0;
}
