:root {
    --portal-ink: #14213d;
    --portal-muted: #64748b;
    --portal-line: #e2e8f0;
    --portal-soft: #f6f8fb;
    --portal-blue: #1d4ed8;
    --portal-green: #0f8a5f;
    --portal-red: #be123c;
    --portal-gold: #b7791f;
    --portal-shadow: 0 18px 45px rgba(15, 23, 42, .08);
}

.portal-page {
    background:
        linear-gradient(180deg, rgba(244, 247, 251, .98), rgba(238, 242, 247, .98)),
        repeating-linear-gradient(90deg, rgba(29, 78, 216, .03) 0, rgba(29, 78, 216, .03) 1px, transparent 1px, transparent 42px);
    color: var(--portal-ink);
    font-family: Roboto, Arial, sans-serif;
}

.portal-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.portal-sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #111827 54%, #0b1220 100%);
    color: #fff;
    padding: 26px 20px;
    border-right: 1px solid rgba(255, 255, 255, .08);
    position: sticky;
    top: 0;
    height: 100vh;
    box-sizing: border-box;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
}

.portal-brand img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
    padding: 5px;
}

.portal-brand strong {
    display: block;
    font-size: 18px;
    line-height: 1.2;
}

.portal-brand span {
    color: #cbd5e1;
    font-size: 12px;
}

.portal-nav {
    display: grid;
    gap: 8px;
}

.portal-nav a {
    color: #dbeafe;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
}

.portal-nav a:hover,
.portal-nav a.is-active {
    background: rgba(255, 255, 255, .12);
    color: #fff;
}

.portal-main {
    padding: 30px;
    min-width: 0;
}

.portal-top {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-bottom: 22px;
}

.portal-title h1 {
    margin: 0 0 6px;
    font-size: 28px;
    font-weight: 900;
}

.portal-title p {
    color: var(--portal-muted);
    margin: 0;
}

.portal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.portal-btn {
    border: 1px solid var(--portal-line);
    background: #fff;
    color: var(--portal-ink);
    border-radius: 8px;
    padding: 10px 14px;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.portal-btn.primary {
    background: var(--portal-blue);
    color: #fff;
    border-color: var(--portal-blue);
}

.portal-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
}

.portal-card {
    background: #fff;
    border: 1px solid var(--portal-line);
    border-radius: 8px;
    padding: 18px;
    box-shadow: var(--portal-shadow);
}

.portal-card.feature {
    border-color: #bfdbfe;
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
}

.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.metric {
    min-height: 118px;
    position: relative;
    overflow: hidden;
}

.metric:after {
    content: "";
    position: absolute;
    right: -28px;
    top: -28px;
    width: 90px;
    height: 90px;
    border-radius: 999px;
    background: rgba(29, 78, 216, .08);
}

.wallet-metric {
    background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%);
    color: #fff;
}

.wallet-metric span,
.wallet-metric small {
    color: rgba(255, 255, 255, .78);
}

.metric span {
    color: var(--portal-muted);
    display: block;
    font-size: 13px;
    margin-bottom: 10px;
}

.metric strong {
    display: block;
    font-size: 28px;
    line-height: 1.1;
}

.metric small {
    color: var(--portal-muted);
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.section-title h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 900;
}

.section-title.compact {
    margin-top: 18px;
}

.portal-table {
    width: 100%;
    border-collapse: collapse;
}

.portal-table th,
.portal-table td {
    border-bottom: 1px solid var(--portal-line);
    padding: 11px 8px;
    text-align: left;
    vertical-align: top;
}

.portal-table th {
    color: var(--portal-muted);
    font-size: 12px;
    text-transform: uppercase;
}

.portal-table small {
    color: var(--portal-muted);
}

.empty-state {
    border: 1px dashed var(--portal-line);
    color: var(--portal-muted);
    background: #f8fafc;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 12px;
}

.search-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-bottom: 14px;
}

.search-bar input {
    border: 1px solid var(--portal-line);
    border-radius: 8px;
    padding: 12px 13px;
    min-width: 0;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 800;
    background: #e0f2fe;
    color: #075985;
}

.status-pill.green {
    background: #dcfce7;
    color: #166534;
}

.status-pill.gold {
    background: #fef3c7;
    color: #92400e;
}

.wallet-panel {
    padding: 0;
    overflow: hidden;
}

.wallet-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px;
    background: linear-gradient(135deg, #0f172a 0%, #1646a8 58%, #0f8a5f 100%);
    color: #fff;
}

.wallet-hero span,
.wallet-hero small {
    display: block;
    color: rgba(255, 255, 255, .78);
}

.wallet-hero strong {
    display: block;
    margin: 6px 0;
    font-size: 30px;
    line-height: 1.05;
}

.wallet-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 16px 18px 0;
}

.wallet-stats div {
    border: 1px solid var(--portal-line);
    border-radius: 8px;
    padding: 14px;
    background: #f8fafc;
}

.wallet-stats span,
.wallet-item-main span,
.wallet-item-amount small {
    display: block;
    color: var(--portal-muted);
    font-size: 12px;
}

.wallet-stats strong {
    display: block;
    margin-top: 5px;
    font-size: 18px;
}

.wallet-panel .section-title,
.wallet-panel .empty-state,
.wallet-list {
    margin-left: 18px;
    margin-right: 18px;
}

.wallet-list {
    display: grid;
    gap: 10px;
    padding-bottom: 18px;
}

.wallet-item {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    border: 1px solid var(--portal-line);
    border-radius: 8px;
    padding: 12px;
    background: #fff;
}

.wallet-item-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: #dcfce7;
    color: #166534;
}

.wallet-item.debit .wallet-item-icon {
    background: #fee2e2;
    color: #991b1b;
}

.wallet-item-main {
    min-width: 0;
}

.wallet-item-main strong {
    display: block;
    overflow-wrap: anywhere;
}

.wallet-item-amount {
    font-weight: 900;
    text-align: right;
    white-space: nowrap;
}

.profile-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 16px;
    align-items: center;
}

.profile-row img {
    width: 110px;
    height: 130px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--portal-line);
}

.detail-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.detail-list span {
    color: var(--portal-muted);
    display: block;
    font-size: 12px;
}

.detail-list strong {
    display: block;
    overflow-wrap: anywhere;
}

.auth-wrap {
    background: linear-gradient(135deg, #eef6ff 0%, #f8fafc 44%, #edf7ef 100%);
    min-height: 100vh;
    padding: 34px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    width: min(1040px, 100%);
    display: grid;
    grid-template-columns: .95fr 1.05fr;
    background: #fff;
    border: 1px solid var(--portal-line);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .12);
}

.auth-panel {
    background: #101827;
    color: #fff;
    padding: 34px;
}

.auth-panel h1 {
    font-size: 34px;
    font-weight: 900;
    margin: 22px 0 12px;
}

.auth-panel p {
    color: #cbd5e1;
}

.auth-features {
    display: grid;
    gap: 12px;
    margin-top: 28px;
}

.auth-features div {
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 8px;
    padding: 12px;
}

.auth-form {
    padding: 34px;
}

.auth-tabs {
    display: flex;
    border: 1px solid var(--portal-line);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.auth-tabs a {
    flex: 1;
    padding: 11px;
    text-align: center;
    color: var(--portal-ink);
    text-decoration: none;
    font-weight: 800;
}

.auth-tabs a.is-active {
    background: var(--portal-blue);
    color: #fff;
}

.form-grid {
    display: grid;
    gap: 13px;
}

.form-grid label {
    display: grid;
    gap: 6px;
    color: var(--portal-muted);
    font-size: 13px;
    font-weight: 700;
}

.form-grid input,
.form-grid select {
    width: 100%;
    border: 1px solid var(--portal-line);
    border-radius: 8px;
    padding: 12px 13px;
    color: var(--portal-ink);
}

.alert {
    border-radius: 8px;
    padding: 11px 13px;
    margin-bottom: 14px;
    border: 1px solid #fecdd3;
    background: #fff1f2;
    color: #9f1239;
}

.alert.success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

@media (max-width: 980px) {
    .portal-shell,
    .auth-card {
        grid-template-columns: 1fr;
    }
    .portal-sidebar {
        position: static;
        height: auto;
    }
    .portal-brand {
        margin-bottom: 16px;
    }
    .portal-nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .span-3,
    .span-4,
    .span-5,
    .span-6,
    .span-7,
    .span-8 {
        grid-column: span 12;
    }
}

@media (max-width: 640px) {
    .portal-main {
        padding: 16px;
    }
    .portal-sidebar {
        padding: 18px 14px;
    }
    .portal-nav {
        grid-template-columns: 1fr 1fr;
    }
    .portal-nav a {
        padding: 10px;
        font-size: 13px;
    }
    .portal-title h1 {
        font-size: 23px;
    }
    .portal-actions,
    .portal-btn {
        width: 100%;
    }
    .portal-btn {
        justify-content: center;
    }
    .portal-top,
    .section-title {
        align-items: flex-start;
        flex-direction: column;
    }
    .detail-list,
    .profile-row {
        grid-template-columns: 1fr;
    }
    .portal-table {
        font-size: 13px;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    .search-bar {
        grid-template-columns: 1fr;
    }
    .wallet-hero,
    .wallet-item {
        grid-template-columns: 1fr;
        display: grid;
        align-items: start;
    }
    .wallet-hero .portal-btn {
        width: 100%;
    }
    .wallet-stats {
        grid-template-columns: 1fr;
    }
    .wallet-item-amount {
        text-align: left;
        white-space: normal;
    }
}
