/* Smart Wealth Hub — Customer Portal shell */

:root {
    --swh-portal-side: 260px;
    --swh-portal-blue: #0066cc;
    --swh-portal-green: #00a86b;
    --swh-portal-ink: #0b1a30;
    --swh-portal-muted: #64748b;
    --swh-portal-bg: #f3f7fb;
    --swh-portal-line: #e4eef7;
}

body.swh-portal {
    font-family: 'Poppins', sans-serif;
    background: var(--swh-portal-bg);
    color: var(--swh-portal-ink);
    margin: 0;
    min-height: 100vh;
}

body.swh-portal-mode-auth {
    background:
        radial-gradient(900px 420px at 8% -10%, rgba(0, 102, 204, 0.16), transparent 55%),
        radial-gradient(800px 380px at 100% 10%, rgba(0, 168, 107, 0.12), transparent 50%),
        linear-gradient(165deg, #f3f7fb 0%, #eef5f1 45%, #f8fafc 100%);
}

.swh-portal-auth-foot a {
    color: var(--swh-portal-blue);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.swh-portal-auth-foot a:hover {
    text-decoration: underline;
}

/* App shell */
.swh-portal-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--swh-portal-side);
    height: 100vh;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    color: #f8fbff;
    background:
        linear-gradient(165deg, #071c38 0%, #00508c 55%, #00785a 120%);
    box-shadow: 8px 0 28px rgba(7, 28, 56, 0.18);
}

.swh-portal-brand {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 1.25rem 1.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.swh-portal-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #3d9bff, #2ee6a0);
    font-size: 1.15rem;
    flex: 0 0 42px;
}

.swh-portal-brand strong {
    display: block;
    font-size: 0.92rem;
    line-height: 1.2;
}

.swh-portal-brand small {
    opacity: 0.7;
    font-size: 0.75rem;
}

.swh-portal-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 1rem 0.75rem;
    flex: 1;
    overflow: auto;
}

.swh-portal-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
    color: rgba(248, 251, 255, 0.88) !important;
    text-decoration: none !important;
    font-weight: 500;
    font-size: 0.92rem;
    transition: background 0.18s ease;
}

.swh-portal-nav a i {
    width: 1.2rem;
    text-align: center;
    opacity: 0.9;
}

.swh-portal-nav a:hover,
.swh-portal-nav a.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff !important;
}

.swh-portal-side-foot {
    padding: 0.85rem 1rem 1.15rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.swh-portal-user {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 0.75rem;
}

.swh-portal-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.18);
    font-weight: 700;
    font-size: 0.85rem;
    flex: 0 0 36px;
}

.swh-portal-user strong {
    display: block;
    font-size: 0.85rem;
    line-height: 1.2;
}

.swh-portal-user small {
    display: block;
    opacity: 0.7;
    font-size: 0.72rem;
    word-break: break-all;
}

.swh-portal-side-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(248, 251, 255, 0.8) !important;
    text-decoration: none !important;
    font-size: 0.84rem;
    padding: 0.35rem 0;
}

.swh-portal-side-link:hover {
    color: #fff !important;
}

.swh-portal-main {
    margin-left: var(--swh-portal-side);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.swh-portal-topbar {
    height: 64px;
    background: #fff;
    border-bottom: 1px solid var(--swh-portal-line);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 1.25rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.swh-portal-menu-btn {
    display: none;
    border: 1px solid var(--swh-portal-line);
    background: #fff;
    border-radius: 10px;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
}

.swh-portal-topbar-title {
    flex: 1;
    min-width: 0;
}

.swh-portal-topbar-title strong {
    display: block;
    font-size: 0.98rem;
    line-height: 1.2;
}

.swh-portal-topbar-title span {
    display: block;
    color: var(--swh-portal-muted);
    font-size: 0.78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.swh-portal-topbar-actions {
    display: flex;
    gap: 0.45rem;
}

.swh-portal-topbar-actions .btn-primary {
    background: linear-gradient(135deg, var(--swh-portal-blue), var(--swh-portal-green));
    border: 0;
}

.swh-portal-content {
    padding: 1.35rem 1.35rem 2rem;
    flex: 1;
}

/* Reuse dashboard cards inside portal content without outer section padding clash */
.swh-portal-content .swh-ws-dash {
    padding: 0;
    min-height: 0;
    background: transparent;
}

.swh-portal-content .swh-ws-dash > .container {
    max-width: none;
    padding: 0;
}

.swh-portal-content .swh-ws-dash-hero {
    margin-bottom: 1.25rem;
}

.swh-portal-page-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.swh-portal-page-head h1 {
    font-size: clamp(1.35rem, 2vw, 1.7rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0 0 4px;
    color: var(--swh-portal-ink);
}

.swh-portal-page-head p {
    margin: 0;
    color: var(--swh-portal-muted);
    font-size: 0.9rem;
}

.swh-portal-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.swh-portal-narrow {
    max-width: 720px;
}

.swh-portal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(7, 28, 56, 0.45);
    backdrop-filter: blur(3px);
}

@media (max-width: 991px) {
    .swh-portal-sidebar {
        transform: translateX(-105%);
        transition: transform 0.28s ease;
    }

    body.swh-portal-nav-open .swh-portal-sidebar {
        transform: translateX(0);
    }

    .swh-portal-main {
        margin-left: 0;
    }

    .swh-portal-menu-btn {
        display: inline-flex;
    }
}
