:root {
    --sidebar-width: 268px;
    --sidebar-background: #0b1628;
    --sidebar-border: rgba(255, 255, 255, 0.07);
    --sidebar-text: #aebbd0;
    --sidebar-text-muted: #74849c;
    --portal-primary: #2563eb;
    --portal-brand: #d76316;
    --portal-primary-soft: rgba(37, 99, 235, 0.15);
    --portal-background: #fff;
    --portal-border: #e5eaf1;
    --portal-text: #182235;
}

.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-y: auto;
    color: var(--sidebar-text);
    background: radial-gradient( circle at top left, rgba(59, 103, 175, 0.2), transparent 30% ), var(--sidebar-background);
    border-right: 1px solid var(--sidebar-border);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
    padding: 0 20px;
    border-bottom: 1px solid var(--sidebar-border);
}

.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: var(--portal-brand);
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.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;
    }

.sidebar-close {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    color: #ffffff;
    background: transparent;
    border: 0;
    border-radius: 8px;
}

    .sidebar-close:hover {
        background: rgba(255, 255, 255, 0.08);
    }

.sidebar-navigation {
    flex: 1;
    padding: 24px 14px;
}

.navigation-section + .navigation-section {
    margin-top: 30px;
}

.management-section {
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.navigation-heading {
    display: block;
    margin: 0 12px 10px;
    color: var(--sidebar-text-muted);
    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: 36px;
    margin: 3px 0;
    padding: 0 12px;
    color: var(--sidebar-text);
    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;
        font-size: 1rem;
        text-align: center;
    }

    .sidebar-link:hover {
        color: #ffffff;
        background: rgba(255, 255, 255, 0.055);
    }

    .sidebar-link.active {
        color: #ffffff;
        background: var(--portal-primary-soft);
        border-color: rgba(91, 141, 239, 0.18);
    }

        .sidebar-link.active::before {
            position: absolute;
            top: 9px;
            bottom: 9px;
            left: -14px;
            width: 3px;
            content: "";
            background: #5b8def;
            border-radius: 0 4px 4px 0;
        }

.new-case-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 42px;
    margin-top: 18px;
    padding: 0 14px;
    color: #ffffff;
    font-size: 0.84rem;
    font-weight: 650;
    text-decoration: none;
    background: var(--portal-primary);
    border: 1px solid var(--portal-primary);
    border-radius: 9px;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.2);
    transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

    .new-case-button:hover {
        color: #ffffff;
        background: #1d4ed8;
        border-color: #1d4ed8;
        transform: translateY(-1px);
    }

.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: #dbeafe;
    font-size: 0.75rem;
    font-weight: 750;
    background: #1e3a5f;
    border: 1px solid rgba(147, 197, 253, 0.2);
    border-radius: 50%;
}

.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: #95a5bd;
    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;
    }
}
