:root {
    --sidebar-width: 268px;
    /* MediateHQ brand */
    --sidebar-background: #071b36;
    --sidebar-background-deep: #05152a;
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --sidebar-text: #d5deea;
    --sidebar-text-muted: #6f8fb5;
    --portal-primary: #1473e6;
    --portal-primary-hover: #0f63c9;
    --portal-primary-soft: rgba(20, 115, 230, 0.15);
    --portal-brand: #1688f0;
    --portal-background: #ffffff;
    --portal-border: #e4eaf2;
    --portal-text: #0d2242;
}

.portal-shell {
    min-height: 100vh;
    background: var(--portal-background);
    color: var(--portal-text);
}

.portal-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    height: 100vh;
    overflow: hidden;
    color: var(--sidebar-text);
    background: radial-gradient( circle at 15% 20%, rgba(24, 119, 242, 0.16), transparent 30% ), linear-gradient( 180deg, #071b36 0%, #06172d 55%, #041226 100% );
    border-right: 1px solid var(--sidebar-border);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 88px;
    padding: 0 20px;
    border-bottom: 1px solid var(--sidebar-border);
}

.brand-logo {
    display: block;
    width: auto;
    height: 38px;
    max-width: 190px;
    object-fit: contain;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    text-decoration: none;
}

    .brand-link:hover {
        color: #ffffff;
    }

.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    background: linear-gradient( 135deg, #1688f0, #1267d6 );
    border-radius: 10px;
    box-shadow: 0 8px 22px rgba(20, 115, 230, 0.32);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

    .brand-text strong {
        font-size: 0.96rem;
        letter-spacing: -0.01em;
    }

    .brand-text small {
        margin-top: 3px;
        color: #91a0b7;
        font-size: 0.7rem;
    }

.tenant-name {
    margin-top: 7px;
    color: #7f95b2;
    font-size: 0.7rem;
    font-weight: 500;
}

.sidebar-close {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    color: #ffffff;
    background: transparent;
    border: 0;
    border-radius: 8px;
    margin-right: -12px;
}

    .sidebar-close:hover {
        background: rgba(255, 255, 255, 0.08);
    }

.sidebar-navigation {
    position: relative;
    flex: 1;
    padding: 24px 14px;
    overflow: hidden;
}

.navigation-section + .navigation-section {
    margin-top: 30px;
}


.sidebar-navigation::before {
    position: absolute;
    right: -180px;
    bottom: -230px;
    width: 420px;
    height: 420px;
    content: "";
    background: radial-gradient( circle, rgba(30, 116, 242, 0.18), transparent 65% );
    border-radius: 50%;
    pointer-events: none;
}

.sidebar-navigation::after {
    position: absolute;
    right: -120px;
    bottom: -170px;
    width: 330px;
    height: 330px;
    content: "";
    background: radial-gradient( circle at 30% 30%, rgba(31, 123, 255, 0.30), rgba(10, 71, 160, 0.14) 45%, transparent 70% );
    border-radius: 50%;
    box-shadow: -30px -30px 80px rgba(22, 112, 245, 0.12);
    pointer-events: none;
}

.sidebar-navigation > * {
    position: relative;
    z-index: 1;
}

.management-section {
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.navigation-heading {
    display: block;
    margin: 0 12px 10px;
    color: #2287ea;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 40px;
    margin: 3px 0;
    padding: 0 12px;
    color: #d3deec;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 9px;
    transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

    .sidebar-link i {
        width: 20px;
        color: #c4d4e8;
        font-size: 1rem;
        text-align: center;
    }

    .sidebar-link:hover {
        color: #ffffff;
        background: rgba(255, 255, 255, 0.055);
    }
        .sidebar-link:hover i {
            color: #ffffff;
        }

    .sidebar-link.active {
        color: #ffffff;
        background: rgba(20, 115, 230, 0.18);
        border-color: rgba(49, 137, 235, 0.12);
    }

        .sidebar-link.active i {
            color: #ffffff;
        }
        .sidebar-link.active::before {
            display: none;
        }

.new-case-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 46px;
    margin-top: 18px;
    padding: 0 14px;
    color: #ffffff;
    font-size: 0.84rem;
    font-weight: 650;
    text-decoration: none;
    background: linear-gradient( 135deg, #1473e6, #0f83f5 );
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    box-shadow: 0 8px 22px rgba(20, 115, 230, 0.28);
    transition: background-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

    .new-case-button:hover {
        color: #ffffff;
        transform: translateY(-1px);
        box-shadow: 0 10px 26px rgba(20, 115, 230, 0.36);
    }

.sidebar-user {
    padding: 16px 14px;
    border-top: 1px solid var(--sidebar-border);
}

.user-summary {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 4px 6px 14px;
}

.user-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 750;
    background: linear-gradient( 135deg, #1473e6, #0d8af4 );
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    box-shadow: 0 5px 14px rgba(20, 115, 230, 0.25);
}

.user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}

    .user-details strong {
        overflow: hidden;
        color: #ffffff;
        font-size: 0.82rem;
        font-weight: 650;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .user-details small {
        margin-top: 3px;
        overflow: hidden;
        color: #8190a7;
        font-size: 0.7rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.user-actions {
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

    .user-actions form {
        margin: 0;
    }

.user-action-link {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    min-height: 40px;
    padding: 0 10px;
    color: #afc0d5;
    font-size: 0.8rem;
    text-align: left;
    text-decoration: none;
    background: transparent;
    border: 0;
    border-radius: 8px;
}

    .user-action-link i {
        width: 18px;
        text-align: center;
    }

    .user-action-link:hover {
        color: #ffffff;
        background: rgba(255, 255, 255, 0.055);
    }

.user-action-button {
    cursor: pointer;
}

.sign-in-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 42px;
    color: #ffffff;
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
    background: var(--portal-primary);
    border-radius: 9px;
}

    .sign-in-button:hover {
        color: #ffffff;
        background: #1d4ed8;
    }

.portal-main {
    min-width: 0;
    min-height: 100vh;
    margin-left: var(--sidebar-width);
}

.portal-content {
    min-height: 100vh;
}

.content-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px 5px;
}

.mobile-navigation-button {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 1025;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: #344054;
    font-size: 1.25rem;
    background: #ffffff;
    border: 1px solid var(--portal-border);
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(16, 24, 40, 0.1);
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1035;
    background: rgba(9, 16, 29, 0.52);
    border: 0;
    backdrop-filter: blur(2px);
}

@media (max-width: 991.98px) {
    .portal-main {
        margin-left: 0;
    }

    .portal-sidebar {
        transform: translateX(-100%);
        box-shadow: 20px 0 45px rgba(5, 12, 24, 0.25);
        transition: transform 180ms ease;
    }

        .portal-sidebar.is-open {
            transform: translateX(0);
        }

    .content-container {
        padding: 76px 18px 24px;
    }
}

@media (max-width: 575.98px) {
    .content-container {
        padding-right: 12px;
        padding-bottom: 18px;
        padding-left: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .portal-sidebar,
    .sidebar-link,
    .new-case-button {
        transition: none;
    }
}
