﻿.portal-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
    padding: 24px;
}

.portal-sidebar {
    position: sticky;
    top: 24px;
    height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: 22px;
    background: rgba(255,255,255,.86);
    border: 1px solid rgba(15,23,42,.08);
    box-shadow: 0 16px 40px rgba(15,23,42,.08);
}

.portal-brand-icon {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4f46e5, #0ea5e9);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 14px 30px rgba(79,70,229,.20);
}

.portal-brand h1 {
    margin: 0;
    font-size: 18px;
    color: var(--text);
}

.portal-brand p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.portal-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

    .portal-nav a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 16px;
        border-radius: 18px;
        background: rgba(255,255,255,.74);
        border: 1px solid rgba(15,23,42,.08);
        color: var(--text);
        transition: .2s ease;
        box-shadow: 0 8px 24px rgba(15,23,42,.04);
    }

        .portal-nav a:hover {
            transform: translateY(-2px);
            background: rgba(255,255,255,.96);
        }

        .portal-nav a.active {
            background: linear-gradient(135deg, rgba(79,70,229,.12), rgba(14,165,233,.10));
            border-color: rgba(79,70,229,.18);
            color: #312e81;
        }

.portal-nav-text {
    font-weight: 700;
}

.portal-nav-icon {
    font-size: 18px;
}

.portal-side-note {
    margin-top: auto;
}

.portal-main-wrap {
    min-width: 0;
}

.portal-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
    padding: 20px 22px;
    border-radius: 24px;
    background: rgba(255,255,255,.80);
    border: 1px solid rgba(15,23,42,.08);
    box-shadow: 0 16px 40px rgba(15,23,42,.06);
}

    .portal-topbar h2 {
        margin: 0;
        font-size: 24px;
        color: var(--text);
    }

    .portal-topbar p {
        margin: 6px 0 0;
        color: var(--muted);
        font-size: 13px;
    }

.portal-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.portal-main {
    max-width: 1280px;
}

.portal-mobile-nav {
    display: none;
    position: fixed;
    bottom: 14px;
    inset-inline: 14px;
    z-index: 50;
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(15,23,42,.08);
    box-shadow: 0 18px 40px rgba(15,23,42,.10);
    border-radius: 22px;
    padding: 10px;
    backdrop-filter: blur(12px);
}

    .portal-mobile-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 10px 8px;
        border-radius: 16px;
        color: var(--muted);
        min-width: 0;
        flex: 1;
    }

        .portal-mobile-nav a.active {
            background: rgba(79,70,229,.10);
            color: var(--brand);
        }

    .portal-mobile-nav small {
        font-size: 11px;
        font-weight: 700;
    }

@media (max-width: 1100px) {
    .portal-shell {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .portal-sidebar {
        display: none;
    }

    .portal-topbar {
        padding: 16px;
        border-radius: 20px;
    }

        .portal-topbar h2 {
            font-size: 20px;
        }

    .portal-topbar-actions {
        display: none;
    }

    .portal-mobile-nav {
        display: flex;
    }

    .portal-main {
        padding-bottom: 88px;
    }
}


.pwa-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99999;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 20px;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.pwa-modal-backdrop.show {
    display: flex;
}

.pwa-modal {
    width: min(420px, 100%);
    background: #ffffff;
    border-radius: 24px;
    padding: 28px 24px;
    text-align: center;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
    animation: pwaModalIn 0.25s ease both;
}

.pwa-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 16px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    font-size: 34px;
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #0ea5e9);
    box-shadow: 0 16px 34px rgba(79, 70, 229, 0.28);
}

.pwa-modal h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
}

.pwa-modal p {
    margin: 12px 0 24px;
    color: #64748b;
    line-height: 1.8;
    font-size: 15px;
}

.pwa-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@keyframes pwaModalIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.94);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 480px) {
    .pwa-modal {
        padding: 24px 18px;
        border-radius: 20px;
    }

    .pwa-actions {
        grid-template-columns: 1fr;
    }
}