.portal-body {
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    background: linear-gradient(180deg, #f0f4ff 0%, #f7f8fb 40%);
    min-height: 100vh;
    color: #0f1419;
    -webkit-font-smoothing: antialiased;
}

.portal-nav {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(15, 20, 25, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.portal-nav-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: inherit;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.portal-brand-logo {
    height: 36px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    border-radius: 8px;
}

.portal-brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #818cf8, #4f46e5);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.portal-brand-text {
    font-size: 1rem;
}

.portal-nav-links {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.portal-nav-links a {
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    color: #5c6570;
}

.portal-nav-links a:hover {
    background: rgba(99, 102, 241, 0.08);
    color: #4338ca;
}

.portal-nav-links a.active {
    background: linear-gradient(180deg, #818cf8, #6366f1);
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.portal-menu-toggle {
    border: none;
    background: rgba(99, 102, 241, 0.1);
    color: #4338ca;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.portal-menu-toggle:hover {
    background: rgba(99, 102, 241, 0.18);
    color: #3730a3;
}

.portal-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(15, 20, 25, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.portal-sidebar-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
}

.portal-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(288px, 86vw);
    z-index: 1050;
    background: #fff;
    border-right: 1px solid rgba(15, 20, 25, 0.08);
    box-shadow: 8px 0 32px rgba(15, 20, 25, 0.12);
    transform: translateX(-100%);
    transition: transform 0.24s ease;
    display: flex;
    flex-direction: column;
    padding: 0.85rem 0 1.25rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

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

.portal-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0 1rem 0.75rem;
    border-bottom: 1px solid rgba(15, 20, 25, 0.06);
    margin-bottom: 0.5rem;
}

.portal-sidebar-close {
    border: none;
    background: rgba(15, 20, 25, 0.06);
    color: #5c6570;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.portal-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.35rem 0.75rem 0;
}

.portal-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #374151;
    transition: background 0.15s, color 0.15s;
}

.portal-sidebar-link i {
    font-size: 1.15rem;
    color: #6366f1;
    width: 1.35rem;
    text-align: center;
}

.portal-sidebar-link:hover {
    background: rgba(99, 102, 241, 0.08);
    color: #4338ca;
}

.portal-sidebar-link.active {
    background: linear-gradient(180deg, #818cf8, #6366f1);
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.portal-sidebar-link.active i {
    color: #fff;
}

.portal-sidebar-link-danger {
    color: #dc2626 !important;
    margin-top: 0.35rem;
}

.portal-sidebar-link-danger i {
    color: #dc2626;
}

.portal-sidebar-link-danger:hover {
    background: rgba(220, 38, 38, 0.08);
    color: #b91c1c !important;
}

body.portal-sidebar-open {
    overflow: hidden;
}

@media (min-width: 992px) {
    .portal-sidebar,
    .portal-sidebar-backdrop {
        display: none !important;
    }
}

@media (max-width: 991.98px) {
    .portal-nav-links {
        display: none !important;
    }

    .portal-brand-text {
        font-size: 0.9375rem;
        max-width: 12rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

.portal-main {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}

.portal-card {
    background: #fff;
    border: 1px solid rgba(15, 20, 25, 0.08);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(15, 20, 25, 0.06);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}

.portal-dash-panel {
    margin-bottom: 0;
}

.portal-dash-notice:last-child {
    border-bottom: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.portal-dash-faq .accordion-button {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f1419;
}

.portal-dash-faq .accordion-button:not(.collapsed) {
    color: #4338ca;
}

.portal-dash-faq .accordion-button:focus {
    box-shadow: none;
}

.portal-stat {
    border-radius: 14px;
    padding: 1.15rem 1.25rem;
    background: #fff;
    border: 1px solid rgba(15, 20, 25, 0.06);
    height: 100%;
}

.portal-stat .lbl {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8b949e;
}

.portal-stat .val {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-top: 0.25rem;
}

.btn-portal-primary {
    background: linear-gradient(180deg, #818cf8, #6366f1);
    border: none;
    color: #fff !important;
    font-weight: 600;
    padding: 0.5rem 1.1rem;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-portal-primary:hover {
    filter: brightness(1.05);
    color: #fff !important;
}

.portal-table thead th {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #8b949e;
    font-weight: 700;
    border-bottom: 1px solid rgba(15, 20, 25, 0.08);
}

.portal-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(160deg, #1e1b4b 0%, #312e81 40%, #0f172a 100%);
}

.portal-login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

/* ===== Dashboard redesign ===== */

/* Hero */
.portal-hero {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 60%, #6d28d9 100%);
    border-radius: 20px;
    padding: 1.75rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.portal-hero::after {
    content: '';
    position: absolute;
    right: -50px;
    top: -50px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    pointer-events: none;
}
.portal-hero-inner {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.portal-hero-greet {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.72;
    margin-bottom: 0.2rem;
}
.portal-hero-name {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin: 0 0 0.5rem;
    line-height: 1.1;
}
.portal-hero-meta {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    font-size: 0.8125rem;
    opacity: 0.8;
}
.portal-hero-meta-sep { opacity: 0.4; }
.portal-hero-badge {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 16px;
    padding: 0.8rem 1.25rem;
    text-align: center;
    min-width: 80px;
    backdrop-filter: blur(8px);
    flex-shrink: 0;
}
.portal-hero-badge-num {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1;
}
.portal-hero-badge-lbl {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    opacity: 0.8;
    margin-top: 0.2rem;
}
.portal-hero-clear {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 16px;
    padding: 0.8rem 1.25rem;
    text-align: center;
    font-size: 0.8125rem;
    font-weight: 700;
    flex-shrink: 0;
}
.portal-hero-clear i {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.25rem;
    color: #6ee7b7;
}

/* Stat icon */
.portal-stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-bottom: 0.65rem;
}

/* Next due card */
.portal-due-card {
    border-radius: 16px;
    padding: 1.1rem 1.35rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.portal-due-card.overdue {
    background: #fff7ed;
    border: 1px solid #fdba74;
}
.portal-due-card.upcoming {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

/* Invoice items (card-style list rows) */
.portal-invoice-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid rgba(15, 20, 25, 0.06);
    flex-wrap: wrap;
}
.portal-invoice-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.portal-invoice-item:first-child {
    padding-top: 0;
}

/* Quick action tiles */
.portal-action-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
}
.portal-action-tile {
    background: #f5f6ff;
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: 14px;
    padding: 0.9rem 1rem;
    text-decoration: none !important;
    color: #0f1419;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    transition: background 0.15s, box-shadow 0.15s, color 0.15s;
    font-weight: 600;
    font-size: 0.8125rem;
}
.portal-action-tile:hover {
    background: #eef0ff;
    color: #4338ca;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.12);
}
.portal-action-tile i {
    font-size: 1.35rem;
    color: #6366f1;
}

.portal-profile-deposit {
    padding-top: 0.85rem;
    border-top: 1px solid rgba(15, 20, 25, 0.08);
}
