﻿/* Customer portal — admin-aligned shell + Digital Platform UI kit */

body.user-portal {
    --up-surface: var(--dp-surface, #fff);
    --up-surface-2: var(--dp-surface-2, #f4f7fb);
    --up-text: var(--dp-text, #0f172a);
    --up-muted: var(--dp-text-muted, #64748b);
    --up-border: #e8ecf1;
    --up-accent: var(--dp-accent, #5d3fd3);
    --up-shadow: 0 8px 24px rgba(15, 23, 42, .06);
    --up-sidebar-w: 300px;
    --up-topbar-h: 70px;
    --up-radius: 10px;
    --up-control-h: 42px;
    background: #f4f7fb !important;
    color: var(--up-text);
}

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

body.user-portal .up-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: transparent !important;
}

body.user-portal .up-shell__body {
    display: block;
    position: relative;
    min-height: 0;
}

/* ========== Topbar (admin-style) ========== */
body.user-portal .up-topbar.header-2,
body.user-portal .header-2.up-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--up-topbar-h) !important;
    min-height: var(--up-topbar-h);
    padding: 0 !important;
    display: flex !important;
    align-items: stretch;
    gap: 0;
    background: #fff !important;
    border-bottom: 1px solid var(--up-border);
    box-shadow: none;
    z-index: 120;
    flex-direction: row !important;
}

body.user-portal .up-topbar .header-2__bg,
body.user-portal .up-topbar .logo,
body.user-portal .up-topbar .header-menu,
body.user-portal .up-main .main-content__bg {
    display: none !important;
}

body.user-portal .up-topbar__logo {
    width: var(--up-sidebar-w);
    min-width: var(--up-sidebar-w);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 1.15rem;
    border-right: 1px solid var(--up-border);
    background: #fff;
}

body.user-portal .up-topbar__brand {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    max-width: 100%;
    text-decoration: none !important;
    color: var(--up-text) !important;
    line-height: 1;
}

body.user-portal .up-topbar__brand-chip {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: transparent;
    overflow: hidden;
    box-shadow: none;
    border: 0;
    line-height: 0;
}

body.user-portal .up-topbar__brand-chip img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    display: block;
    border-radius: 10px;
    background: transparent;
}

body.user-portal .up-topbar__brand-name {
    font-size: .95rem;
    font-weight: 800;
    letter-spacing: -.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 12rem;
}

/* Legacy logo classes (safe no-ops if markup still present) */
body.user-portal .up-topbar__logo-link,
body.user-portal .up-topbar__logo-full,
body.user-portal .up-topbar__logo-full--light,
body.user-portal .up-topbar__logo-full--dark,
body.user-portal .up-topbar__logo-mark {
    display: none !important;
}

body.user-portal .up-topbar__nav {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: 0 1.15rem;
}

body.user-portal .up-topbar__nav-left,
body.user-portal .up-topbar__nav-right {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
}

body.user-portal .up-icon-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--up-border);
    border-radius: var(--up-radius);
    background: #fff;
    color: var(--up-text);
    font-size: 1.15rem;
    padding: 0;
    line-height: 1;
}

body.user-portal .up-icon-btn:hover {
    border-color: color-mix(in srgb, var(--up-accent) 30%, var(--up-border));
    color: var(--up-accent);
    background: color-mix(in srgb, var(--up-accent) 6%, #fff);
}

@media (min-width: 1500px) {
    body.user-portal .up-topbar__toggle { display: none; }
}

body.user-portal .up-topbar__account {
    align-items: center;
    gap: .55rem;
    padding: .35rem .75rem;
    border: 1px solid var(--up-border);
    border-radius: var(--up-radius);
    background: var(--up-surface-2);
    color: var(--up-muted);
}

body.user-portal .up-topbar__account > i {
    color: var(--up-accent);
    font-size: 1.05rem;
}

body.user-portal .up-topbar__account-label {
    display: block;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    line-height: 1.1;
}

body.user-portal .up-topbar__account-number {
    display: block;
    font-size: .78rem;
    font-weight: 700;
    color: var(--up-text);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

body.user-portal .up-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 38px;
    padding: 3px;
    border: 1px solid var(--up-border);
    border-radius: var(--up-radius);
    background: var(--up-surface-2);
    box-sizing: border-box;
    vertical-align: middle;
}

body.user-portal .up-theme-btn {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--up-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    margin: 0;
    line-height: 0;
    flex: 0 0 30px;
    appearance: none;
    -webkit-appearance: none;
}

body.user-portal .up-theme-btn i,
body.user-portal .up-theme-btn .ti {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    font-size: 1rem;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    vertical-align: middle;
    transform: none !important;
    position: static !important;
}

body.user-portal .up-theme-btn.is-active,
body.user-portal .up-theme-btn:hover {
    background: color-mix(in srgb, var(--up-accent) 14%, transparent);
    color: var(--up-accent);
}

body.user-portal .up-topbar__user-btn {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .2rem .35rem .2rem .7rem;
    border: 1px solid var(--up-border);
    border-radius: 999px;
    background: var(--up-surface-2);
}

body.user-portal .up-topbar__user-text {
    text-align: right;
    line-height: 1.15;
}

body.user-portal .up-topbar__username {
    display: block;
    font-size: .78rem;
    font-weight: 700;
    color: var(--up-text);
}

body.user-portal .up-topbar__balance {
    display: block;
    font-size: .7rem;
    font-weight: 600;
    color: var(--up-muted);
    font-variant-numeric: tabular-nums;
}

body.user-portal .up-topbar__avatar {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--up-border);
    background: color-mix(in srgb, var(--up-accent) 10%, #fff);
}

body.user-portal .up-topbar__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.user-portal .up-user-menu {
    min-width: 14rem;
    border: 1px solid var(--up-border);
    border-radius: 12px;
    box-shadow: var(--up-shadow);
    padding: .35rem;
    margin-top: .4rem !important;
}

body.user-portal .up-user-menu__head {
    padding: .55rem .7rem .65rem;
    border-bottom: 1px solid var(--up-border);
    margin-bottom: .25rem;
}

body.user-portal .up-user-menu__head strong {
    display: block;
    font-size: .86rem;
    color: var(--up-text);
}

body.user-portal .up-user-menu__head small {
    color: var(--up-muted);
    font-size: .72rem;
}

body.user-portal .up-user-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    border-radius: 8px;
    font-size: .86rem;
    font-weight: 600;
    color: var(--up-text);
    padding: .55rem .7rem;
}

body.user-portal .up-user-menu .dropdown-item i { color: var(--up-muted); }
body.user-portal .up-user-menu .dropdown-item:hover {
    background: color-mix(in srgb, var(--up-accent) 8%, transparent);
    color: var(--up-accent);
}
body.user-portal .up-user-menu .dropdown-item:hover i { color: var(--up-accent); }
body.user-portal .up-user-menu__logout { color: var(--dp-danger, #dc2626) !important; }
body.user-portal .up-user-menu__logout i { color: var(--dp-danger, #dc2626) !important; }

/* ========== Sidebar (admin-style) ========== */
body.user-portal .up-sidebar.main-sidebar {
    position: fixed;
    top: var(--up-topbar-h);
    left: 0;
    bottom: 0;
    width: var(--up-sidebar-w) !important;
    padding: .65rem .65rem 1rem !important;
    display: flex;
    flex-direction: column;
    background: #fff !important;
    border-right: 1px solid var(--up-border);
    box-shadow: none;
    z-index: 110;
    transform: translateX(0);
    transition: transform .25s ease;
}

@media (max-width: 1499px) {
    body.user-portal .up-sidebar.main-sidebar {
        transform: translateX(calc(-1 * var(--up-sidebar-w)));
        box-shadow: var(--up-shadow);
    }
    body.user-portal .up-sidebar.main-sidebar.active {
        transform: translateX(0);
    }
}

body.user-portal .up-sidebar__mobile-user {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .65rem .55rem .85rem;
    margin-bottom: .35rem;
    border-bottom: 1px solid var(--up-border);
}

body.user-portal .up-sidebar__avatar {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--up-border);
    flex-shrink: 0;
}

body.user-portal .up-sidebar__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.user-portal .up-sidebar__username {
    display: block;
    font-size: .82rem;
    font-weight: 700;
    color: var(--up-text);
}

body.user-portal .up-sidebar__balance {
    display: block;
    margin-top: .1rem;
    font-size: .74rem;
    color: var(--up-muted);
}

body.user-portal .up-sidebar__nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

body.user-portal .up-sidebar .sidebar-menu.up-nav {
    height: 100%;
    margin: 0 !important;
    padding: .25rem .35rem 1rem;
    overflow-y: auto;
    overflow-x: hidden;
}

body.user-portal .up-nav .sidebar-item {
    margin-bottom: 3px !important;
}

body.user-portal .up-nav .sidebar-link {
    display: flex !important;
    align-items: center;
    gap: .65rem;
    padding: 10px 14px !important;
    margin: 0 2px;
    border-radius: 10px !important;
    color: rgba(15, 23, 42, .62) !important;
    background: transparent !important;
    backdrop-filter: none !important;
    font-size: .9375rem;
    font-weight: 500;
    transition: background .15s ease, color .15s ease;
}

body.user-portal .up-nav .sidebar-link .nav-icon {
    width: 20px;
    margin-right: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

body.user-portal .up-nav .sidebar-link.has-sub::after {
    right: .75rem !important;
    font-size: .8rem !important;
    color: var(--up-muted);
}

body.user-portal .up-nav .sidebar-link:hover,
body.user-portal .up-nav .sidebar-link:focus-visible {
    color: var(--up-text) !important;
    background: color-mix(in srgb, var(--up-accent) 6%, transparent) !important;
}

body.user-portal .up-nav .sidebar-item.open > .sidebar-link,
body.user-portal .up-nav .sidebar-link.active,
body.user-portal .up-nav .sidebar-link.show {
    color: var(--up-accent) !important;
    background: color-mix(in srgb, var(--up-accent) 10%, transparent) !important;
}

body.user-portal .up-nav .sidebar-dropdown-menu {
    display: none;
    margin: 4px 2px 6px 14px !important;
    padding: 4px 4px 4px 12px !important;
    border-left: 1px dashed color-mix(in srgb, var(--up-accent) 35%, var(--up-border)) !important;
    background: transparent !important;
}

body.user-portal .up-nav .sidebar-dropdown-item .sidebar-link {
    display: flex !important;
    align-items: center;
    gap: .45rem;
    padding: 9px 12px !important;
    margin: 1px 0;
    border-radius: 8px !important;
    font-size: .86rem;
    font-weight: 500;
}

body.user-portal .up-nav .nav-flyout-ico {
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--up-accent) 10%, transparent);
    color: var(--up-accent);
    font-size: .7rem;
    flex-shrink: 0;
}

body.user-portal .up-nav .sidebar-dropdown-item .sidebar-link.active {
    color: var(--up-accent) !important;
    background: color-mix(in srgb, var(--up-accent) 10%, transparent) !important;
    font-weight: 700;
}

body.user-portal .up-nav .sidebar-dropdown-item .sidebar-link.active::before {
    display: none !important;
}

body.user-portal .up-nav-badge {
    display: inline-block;
    margin-left: auto;
    padding: .12rem .45rem;
    border-radius: 999px;
    font-size: .62rem;
    font-weight: 700;
    background: color-mix(in srgb, var(--dp-warning, #d97706) 16%, transparent);
    color: var(--dp-warning, #d97706);
}

/* ========== Main content ========== */
body.user-portal .up-main.main-content {
    margin-left: 0;
    background: transparent !important;
    padding: calc(var(--up-topbar-h) + 1.15rem) 1.35rem 2rem !important;
    min-height: 100vh;
}

@media (min-width: 1500px) {
    body.user-portal .up-main.main-content {
        margin-left: var(--up-sidebar-w);
    }
}

body.user-portal .up-main.main-content::before,
body.user-portal .up-main.main-content::after {
    display: none !important;
}

body.user-portal .up-page-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .35rem;
    padding: 0 0 .85rem;
}

body.user-portal .up-page-bar__title {
    margin: 0;
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--up-accent);
}

body.user-portal .up-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin: 0 0 1.15rem;
}

body.user-portal .up-toolbar__subtitle {
    margin: 0;
    color: var(--up-muted);
    font-size: .9rem;
    max-width: 42rem;
}

body.user-portal .up-toolbar__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

body.user-portal .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease;
    z-index: 105;
}

body.user-portal .sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

@media (min-width: 1500px) {
    body.user-portal .sidebar-overlay { display: none !important; }
}

@media (max-width: 991px) {
    body.user-portal .up-topbar__logo {
        width: auto;
        min-width: 0;
        padding: 0 .85rem;
        border-right: 0;
        background: #fff !important;
    }
    body.user-portal .up-topbar__brand-name {
        display: none !important;
    }
}

/* ========== Form kit (admin-like, kill pill inputs) ========== */
body.user-portal .form--label,
body.user-portal .form-label {
    display: block;
    margin-bottom: .35rem;
    font-size: .78rem;
    font-weight: 700;
    color: var(--up-text);
}

body.user-portal .form--control,
body.user-portal .form-control,
body.user-portal select.form--control,
body.user-portal textarea.form--control,
body.user-portal .nice-select,
body.user-portal .nice-select.form--control {
    width: 100%;
    min-height: var(--up-control-h);
    height: var(--up-control-h);
    padding: .55rem .85rem !important;
    font-size: .9rem !important;
    line-height: 1.4 !important;
    border: 1px solid var(--up-border) !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: var(--up-text) !important;
    box-shadow: none !important;
}

body.user-portal select.form--control.no-nice-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right .75rem center !important;
    background-size: 14px !important;
    padding-right: 2.25rem !important;
    cursor: pointer;
}

body.user-portal textarea.form--control {
    min-height: 7rem;
    height: auto;
}

body.user-portal .form--control:focus,
body.user-portal .form-control:focus,
body.user-portal .nice-select:focus,
body.user-portal .nice-select.open {
    border-color: color-mix(in srgb, var(--up-accent) 55%, var(--up-border)) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--up-accent) 14%, transparent) !important;
}

body.user-portal .input--group,
body.user-portal .input-group {
    border-radius: 8px !important;
    overflow: hidden;
    border: 1px solid var(--up-border);
}

body.user-portal .input--group .form--control,
body.user-portal .input-group .form--control {
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

body.user-portal .input-group-text {
    background: var(--up-surface-2) !important;
    border-color: var(--up-border) !important;
    color: var(--up-muted);
    font-weight: 700;
}

/* Hide native select once nice-select is attached (prevents double UI) */
body.user-portal select.form--control:has(+ .nice-select) {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

body.user-portal .nice-select {
    display: flex !important;
    align-items: center;
    float: none;
    width: 100%;
    height: var(--up-control-h);
    min-height: var(--up-control-h);
    padding: 0 .85rem !important;
    padding-right: 2.25rem !important;
    font-weight: 600;
    cursor: pointer;
    position: relative;
}

body.user-portal .nice-select::after {
    border-color: var(--up-muted);
    right: .9rem;
    margin-top: -3px;
    height: 7px;
    width: 7px;
}

body.user-portal .nice-select .current {
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
    font-size: .9rem;
    color: var(--up-text);
}

body.user-portal .nice-select .list {
    width: 100%;
    left: 0;
    right: 0;
    margin-top: .35rem;
    padding: .35rem !important;
    border: 1px solid var(--up-border) !important;
    border-radius: 12px !important;
    background: #fff !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .12) !important;
    max-height: 16rem;
    overflow-y: auto;
    z-index: 1600 !important;
}

body.user-portal .nice-select .option {
    min-height: 2.35rem;
    line-height: 1.3 !important;
    padding: .55rem .75rem !important;
    border-radius: 8px;
    font-size: .88rem !important;
    font-weight: 600;
    color: var(--up-text) !important;
    background: transparent !important;
}

body.user-portal .nice-select .option:hover,
body.user-portal .nice-select .option.focus {
    background: color-mix(in srgb, var(--up-accent) 10%, #fff) !important;
    color: var(--up-accent) !important;
}

body.user-portal .nice-select .option.selected,
body.user-portal .nice-select .option.selected.focus {
    background: color-mix(in srgb, var(--up-accent) 14%, #fff) !important;
    color: var(--up-accent) !important;
    font-weight: 700;
}

body.user-portal .up-card,
body.user-portal .up-card__body,
body.user-portal .up-filter-form,
body.user-portal .up-filter-bar {
    overflow: visible;
}

/* Compact filter toolbar (statement / reports-style) */
body.user-portal .up-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: .85rem 1rem;
}

body.user-portal .up-filter-bar__fields {
    display: grid;
    grid-template-columns: minmax(12rem, 1.4fr) repeat(3, minmax(8rem, 1fr));
    gap: .85rem;
    flex: 1 1 36rem;
    min-width: 0;
}

body.user-portal .up-filter-field {
    min-width: 0;
}

body.user-portal .up-filter-bar__actions {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
}

body.user-portal .up-filter-bar__submit {
    height: var(--up-control-h) !important;
    min-height: var(--up-control-h) !important;
    padding-inline: 1.15rem !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    white-space: nowrap;
}

@media (max-width: 991px) {
    body.user-portal .up-filter-bar__fields {
        grid-template-columns: 1fr 1fr;
        flex-basis: 100%;
    }
    body.user-portal .up-filter-bar__actions {
        width: 100%;
    }
    body.user-portal .up-filter-bar__submit {
        width: 100%;
    }
}

@media (max-width: 575px) {
    body.user-portal .up-filter-bar__fields {
        grid-template-columns: 1fr;
    }
}

body.user-portal .up-card__body--flush {
    overflow: hidden;
}

body.user-portal .datepicker,
body.user-portal .datepickers-container,
body.user-portal .air-datepicker {
    z-index: 1500 !important;
}

body.user-portal input[type="date"].form--control {
    min-height: var(--up-control-h);
    padding-inline: .75rem !important;
}

/* Portal buttons */
body.user-portal .btn--base,
body.user-portal .btn--sm.btn--base {
    background: var(--up-accent) !important;
    border-color: var(--up-accent) !important;
    color: var(--dp-accent-contrast, #fff) !important;
    border-radius: 10px;
    font-weight: 700;
}
body.user-portal .btn--base:hover,
body.user-portal .btn--base:focus-visible {
    filter: brightness(1.05);
    color: var(--dp-accent-contrast, #fff) !important;
}
body.user-portal .up-btn--ghost,
body.user-portal .btn-outline--base.up-btn--ghost,
body.user-portal .btn.btn--sm.up-btn--ghost {
    background: var(--up-surface) !important;
    border: 1px solid var(--up-border) !important;
    color: var(--up-text) !important;
    border-radius: 10px;
    font-weight: 700;
}
body.user-portal .up-btn--ghost:hover,
body.user-portal .up-btn--ghost:focus-visible {
    border-color: color-mix(in srgb, var(--up-accent) 35%, var(--up-border)) !important;
    color: var(--up-accent) !important;
    background: color-mix(in srgb, var(--up-accent) 6%, var(--up-surface)) !important;
}

/* Section headings */
.up-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 .85rem;
}
.up-section-head__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--up-text);
}
.up-section-head__desc {
    margin: .2rem 0 0;
    font-size: .84rem;
    color: var(--up-muted);
}

/* Form helpers */
.up-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: flex-end;
    padding-top: .35rem;
}
.up-muted { color: var(--up-muted) !important; }

/* Profile page */
.up-profile-form {
    display: grid;
    grid-template-columns: minmax(12.5rem, 15rem) minmax(0, 1fr);
    gap: 1.1rem;
    align-items: start;
}
@media (max-width: 991px) {
    .up-profile-form { grid-template-columns: 1fr; }
}
.up-profile-aside {
    padding-right: .85rem;
    border-right: 1px solid var(--up-border);
}
@media (max-width: 991px) {
    .up-profile-aside {
        padding-right: 0;
        border-right: 0;
        padding-bottom: 1rem;
        border-bottom: 1px solid var(--up-border);
    }
}
.up-profile-upload__frame {
    position: relative;
    width: 7.5rem;
    margin: 0 auto .75rem;
}
.up-profile-upload__preview.upload__img-preview {
    width: 7.5rem !important;
    height: 7.5rem !important;
    margin: 0 !important;
    padding: .15rem;
    border-radius: 999px !important;
    border: 2px dashed var(--up-border) !important;
    background: var(--up-surface-2) !important;
    overflow: hidden;
}
.up-profile-upload__preview img {
    border-radius: 999px !important;
    object-fit: cover;
}
.up-profile-upload__btn {
    position: absolute;
    right: .2rem;
    bottom: .2rem;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--up-accent);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .15);
    z-index: 2;
}
.up-profile-upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 3;
}
.up-profile-meta {
    list-style: none;
    margin: 0;
    padding: 0;
}
.up-profile-meta li {
    display: grid;
    gap: .15rem;
    padding: .55rem 0;
    border-bottom: 1px solid var(--up-border);
}
.up-profile-meta li:last-child { border-bottom: 0; }
.up-profile-meta__label {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--up-muted);
}
.up-profile-meta__value {
    font-size: .86rem;
    font-weight: 600;
    color: var(--up-text);
    word-break: break-word;
}

/* Badges */
.up-badge {
    display: inline-flex;
    align-items: center;
    padding: .15rem .5rem;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 700;
}
.up-badge--success { background: rgba(22, 163, 74, .14); color: #16a34a; }
.up-badge--warning { background: rgba(217, 119, 6, .14); color: #d97706; }
.up-badge--info { background: color-mix(in srgb, var(--up-accent) 14%, transparent); color: var(--up-accent); }

/* Password fields */
.up-field-password {
    position: relative;
}
.up-field-password .form--control {
    padding-right: 2.75rem !important;
}
.up-field-password__toggle {
    position: absolute;
    top: 50%;
    right: .85rem;
    transform: translateY(-50%);
    color: var(--up-muted);
    cursor: pointer;
    z-index: 2;
}
.up-field-password__toggle:hover { color: var(--up-accent); }

/* Spec lists (loan cards) */
.up-spec-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: .84rem;
}
.up-spec-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .45rem 0;
    border-bottom: 1px solid var(--up-border);
}
.up-spec-list li:last-child { border-bottom: 0; }
.up-spec-list li span { color: var(--up-muted); }
.up-spec-list li strong {
    color: var(--up-text);
    font-variant-numeric: tabular-nums;
    text-align: right;
}
.up-plan-card__icon {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: color-mix(in srgb, var(--up-accent) 12%, transparent);
    color: var(--up-accent);
    font-size: 1rem;
    overflow: hidden;
}
.up-plan-card__icon svg,
.up-plan-card__icon img {
    max-width: 1.2rem;
    max-height: 1.2rem;
}

/* Tables */
body.user-portal .up-table {
    margin-bottom: 0;
}
body.user-portal .up-table thead th {
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--up-muted);
    background: var(--up-surface-2);
    border-color: var(--up-border);
    white-space: nowrap;
    padding: .75rem 1rem;
}
body.user-portal .up-table tbody td {
    color: var(--up-text);
    border-color: var(--up-border);
    vertical-align: middle;
    font-size: .86rem;
    padding: .75rem 1rem;
}
body.user-portal .up-table tbody tr:hover {
    background: color-mix(in srgb, var(--up-accent) 4%, transparent);
}
body.user-portal .up-code {
    font-size: .78rem;
    padding: .15rem .4rem;
    border-radius: 6px;
    background: var(--up-surface-2);
    color: var(--up-text);
}
body.user-portal .up-amount {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
body.user-portal .up-amount--credit { color: var(--dp-success, #16a34a); }
body.user-portal .up-amount--debit { color: var(--dp-danger, #dc2626); }

/* Modals */
body.user-portal .up-modal .modal-content,
body.user-portal .custom--modal.up-modal .modal-content {
    border: 1px solid var(--up-border);
    border-radius: 14px;
    background: var(--up-surface) !important;
    box-shadow: var(--up-shadow);
    overflow: hidden;
}
body.user-portal .up-modal .modal-header,
body.user-portal .custom--modal.up-modal .modal-header {
    border-bottom: 1px solid var(--up-border);
    background: linear-gradient(180deg, color-mix(in srgb, var(--up-accent) 6%, var(--up-surface)) 0%, var(--up-surface) 100%);
    padding: .85rem 1rem;
}
body.user-portal .up-modal .modal-title,
body.user-portal .custom--modal.up-modal .modal-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--up-text) !important;
}
body.user-portal .up-modal .modal-body,
body.user-portal .custom--modal.up-modal .modal-body {
    padding: 1rem;
    background: var(--up-surface) !important;
}
body.user-portal .up-modal .input-group-text {
    background: var(--up-surface-2);
    border-color: var(--up-border);
    color: var(--up-muted);
}

/* Datepicker above portal chrome */
body.user-portal .datepicker {
    z-index: 1300 !important;
}

/* Nice select in portal forms */
body.user-portal .nice-select {
    border-radius: 10px !important;
}

html[data-dp-theme="dark"] body.user-portal .nice-select,
html[data-dp-theme="dark"] body.user-portal .nice-select .list {
    background: var(--dp-surface) !important;
    border-color: var(--dp-border) !important;
    color: var(--dp-text) !important;
}
html[data-dp-theme="dark"] body.user-portal .nice-select .current {
    color: var(--dp-text) !important;
}
html[data-dp-theme="dark"] body.user-portal .nice-select .option {
    color: var(--dp-text) !important;
}
html[data-dp-theme="dark"] body.user-portal .nice-select .option:hover,
html[data-dp-theme="dark"] body.user-portal .nice-select .option.focus,
html[data-dp-theme="dark"] body.user-portal .nice-select .option.selected,
html[data-dp-theme="dark"] body.user-portal .nice-select .option.selected.focus {
    background: color-mix(in srgb, var(--dp-accent, var(--up-accent)) 18%, transparent) !important;
    color: var(--dp-accent, var(--up-accent)) !important;
}

/* Pagination */
body.user-portal .up-pagination .pagination {
    gap: .25rem;
}
body.user-portal .up-pagination .page-link {
    border-radius: 8px;
    border-color: var(--up-border);
    color: var(--up-text);
}
body.user-portal .up-pagination .page-item.active .page-link {
    background: var(--up-accent);
    border-color: var(--up-accent);
}

/* KPI grid */
.up-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
    margin-bottom: 1.25rem;
}
@media (max-width: 1199px) { .up-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575px) { .up-kpi-grid { grid-template-columns: 1fr; } }

.up-kpi {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: 1rem 1.05rem;
    border: 1px solid var(--up-border);
    border-radius: 14px;
    background: var(--up-surface);
    box-shadow: 0 2px 10px rgba(15, 23, 42, .04);
    min-height: 5.5rem;
}
.up-kpi__icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--up-accent) 12%, transparent);
    color: var(--up-accent);
    font-size: 1.2rem;
    flex-shrink: 0;
}
.up-kpi__icon--warn { background: rgba(217, 119, 6, .14); color: #d97706; }
.up-kpi__icon--danger { background: rgba(220, 38, 38, .12); color: #dc2626; }
.up-kpi__icon--ok { background: rgba(22, 163, 74, .12); color: #16a34a; }
.up-kpi__label {
    display: block;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--up-muted);
    margin-bottom: .2rem;
}
.up-kpi__value {
    display: block;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--up-text);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}
.up-kpi__hint {
    display: block;
    margin-top: .15rem;
    font-size: .75rem;
    color: var(--up-muted);
}

/* Action tiles */
.up-action-tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
    margin-bottom: 1.25rem;
}
@media (max-width: 991px) { .up-action-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575px) { .up-action-tiles { grid-template-columns: 1fr; } }

.up-action-tile {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: 1rem;
    border: 1px solid var(--up-border);
    border-radius: 14px;
    background: var(--up-surface);
    text-decoration: none !important;
    color: inherit !important;
    transition: border-color .15s, transform .15s, box-shadow .15s;
    min-height: 5.25rem;
}
.up-action-tile:hover {
    border-color: color-mix(in srgb, var(--up-accent) 40%, var(--up-border));
    box-shadow: var(--up-shadow);
    transform: translateY(-1px);
}
.up-action-tile__icon {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--up-accent) 12%, transparent);
    color: var(--up-accent);
    font-size: 1.15rem;
    flex-shrink: 0;
}
.up-action-tile strong {
    display: block;
    font-size: .92rem;
    color: var(--up-text);
    margin-bottom: .15rem;
}
.up-action-tile small {
    color: var(--up-muted);
    line-height: 1.35;
}

/* Section card */
.up-card {
    border: 1px solid var(--up-border);
    border-radius: 14px;
    background: var(--up-surface);
    box-shadow: 0 2px 12px rgba(15, 23, 42, .04);
    overflow: hidden;
    margin-bottom: 1rem;
}
.up-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
    padding: .85rem 1.1rem;
    border-bottom: 1px solid var(--up-border);
    background: linear-gradient(180deg, color-mix(in srgb, var(--up-accent) 6%, var(--up-surface)) 0%, var(--up-surface) 100%);
    font-weight: 700;
    color: var(--up-text);
}
.up-card__body { padding: 1.1rem 1.15rem; }
.up-card__body--flush { padding: 0; }

/* Form shell */
.up-form-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 18rem);
    gap: 1rem;
    align-items: start;
}
@media (max-width: 991px) { .up-form-shell { grid-template-columns: 1fr; } }

.up-side-panel {
    border: 1px solid var(--up-border);
    border-radius: 12px;
    background: #fff;
    padding: 1.15rem;
    position: sticky;
    top: calc(var(--up-topbar-h, 70px) + 1rem);
}
.up-side-panel__title {
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--up-muted);
    margin-bottom: .65rem;
}
.up-side-panel__list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.up-side-panel__list li {
    display: flex;
    gap: .45rem;
    font-size: .82rem;
    color: var(--up-muted);
    margin-bottom: .5rem;
    line-height: 1.35;
}
.up-side-panel__list i { color: var(--up-accent); margin-top: .1rem; }

/* Empty state */
.up-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--up-muted);
}
.up-empty i {
    font-size: 2rem;
    display: block;
    margin-bottom: .5rem;
    color: color-mix(in srgb, var(--up-accent) 70%, var(--up-muted));
}

/* KYC banner */
.up-kyc-banner {
    border: 1px solid color-mix(in srgb, var(--dp-warning, #d97706) 35%, var(--up-border));
    background: color-mix(in srgb, var(--dp-warning, #d97706) 10%, var(--up-surface));
    border-radius: 14px;
    padding: 1rem 1.15rem;
    margin-bottom: 1.25rem;
}
.up-kyc-banner__title {
    font-weight: 800;
    color: var(--up-text);
    margin-bottom: .25rem;
}
.up-kyc-banner__desc {
    margin: 0;
    color: var(--up-muted);
    font-size: .9rem;
}
.up-kyc-banner a { color: var(--up-accent); font-weight: 700; }

/* Tables inside portal */
body.user-portal .up-card table.table th {
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--up-muted);
    background: var(--up-surface-2);
    border-color: var(--up-border);
    white-space: nowrap;
}
body.user-portal .up-card table.table td {
    color: var(--up-text);
    border-color: var(--up-border);
    vertical-align: middle;
    font-size: .86rem;
}

/* Compatibility shims for legacy classes */
body.user-portal .custom--card {
    border: 1px solid var(--up-border) !important;
    border-radius: 14px !important;
    background: var(--up-surface) !important;
    box-shadow: 0 2px 12px rgba(15, 23, 42, .04) !important;
    overflow: hidden;
}
body.user-portal .custom--card .card-header,
body.user-portal .custom--card .card--header {
    background: linear-gradient(180deg, color-mix(in srgb, var(--up-accent) 6%, var(--up-surface)) 0%, var(--up-surface) 100%) !important;
    border-bottom: 1px solid var(--up-border) !important;
    color: var(--up-text) !important;
}
body.user-portal .custom--card .card-header .title,
body.user-portal .custom--card .title {
    color: var(--up-text) !important;
}
body.user-portal .dashboard-card,
body.user-portal .balance-card,
body.user-portal .withdraw__card {
    border: 1px solid var(--up-border) !important;
    border-radius: 14px !important;
    background: var(--up-surface) !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .04) !important;
    overflow: hidden;
}
body.user-portal .dashboard-card::before,
body.user-portal .dashboard-card::after,
body.user-portal .balance-card::before,
body.user-portal .balance-card::after,
body.user-portal .withdraw__card::before,
body.user-portal .withdraw__card::after {
    display: none !important;
}
body.user-portal .dashboard-card__title,
body.user-portal .withdraw__card__title {
    color: var(--up-muted) !important;
}
body.user-portal .dashboard-card__number,
body.user-portal .withdraw__card__number,
body.user-portal .balance-card .dashboard-card__number {
    color: var(--up-text) !important;
}
body.user-portal .form--label,
body.user-portal .form-label {
    color: var(--up-text);
}
body.user-portal .btn-outline--base {
    background: var(--up-surface) !important;
    border: 1px solid var(--up-border) !important;
    color: var(--up-text) !important;
    border-radius: 10px;
    font-weight: 700;
}
body.user-portal .btn-outline--base:hover {
    border-color: color-mix(in srgb, var(--up-accent) 35%, var(--up-border)) !important;
    color: var(--up-accent) !important;
    background: color-mix(in srgb, var(--up-accent) 6%, var(--up-surface)) !important;
}
body.user-portal .alert {
    border-radius: 12px;
}
body.user-portal .table--striped > tbody > tr:nth-of-type(odd) > * {
    background: color-mix(in srgb, var(--up-surface-2) 70%, transparent);
}

/* Guest auth — let .dp-auth-shell paint the textured wash */
body.user-portal--guest {
    height: 100dvh;
    overflow: hidden;
    background: #eef2ff;
}
body.user-portal--guest .preloader,
body.user-portal--guest .scroll-top,
body.user-portal--guest .body-overlay {
    display: none !important;
}
body.user-portal--guest .account-form,
body.user-portal--guest .login-area .custom--card,
body.user-portal--guest .account-section {
    border-radius: 16px;
}

/* Dark mode */
html[data-dp-theme="dark"] body.user-portal .up-kpi,
html[data-dp-theme="dark"] body.user-portal .up-action-tile,
html[data-dp-theme="dark"] body.user-portal .up-card,
html[data-dp-theme="dark"] body.user-portal .up-side-panel,
html[data-dp-theme="dark"] body.user-portal .custom--card,
html[data-dp-theme="dark"] body.user-portal .dashboard-card,
html[data-dp-theme="dark"] body.user-portal .balance-card,
html[data-dp-theme="dark"] body.user-portal .withdraw__card,
html[data-dp-theme="dark"] body.user-portal .up-topbar.header-2,
html[data-dp-theme="dark"] body.user-portal .up-sidebar.main-sidebar {
    background: var(--dp-surface) !important;
    border-color: var(--dp-border) !important;
    color: var(--dp-text);
}
html[data-dp-theme="dark"] body.user-portal .up-topbar__logo {
    background: var(--dp-surface) !important;
    border-right-color: var(--dp-border) !important;
}
html[data-dp-theme="dark"] body.user-portal .up-topbar__brand {
    color: var(--dp-text) !important;
}
html[data-dp-theme="dark"] body.user-portal .up-topbar__brand-chip {
    background: transparent;
}
html[data-dp-theme="dark"] body.user-portal .up-theme-toggle,
html[data-dp-theme="dark"] body.user-portal .up-topbar__account,
html[data-dp-theme="dark"] body.user-portal .up-topbar__user-btn,
html[data-dp-theme="dark"] body.user-portal .up-icon-btn {
    background: var(--dp-surface-2) !important;
    border-color: var(--dp-border) !important;
    color: var(--dp-text);
}
html[data-dp-theme="dark"] body.user-portal .up-theme-btn {
    color: var(--dp-text-muted);
}
html[data-dp-theme="dark"] body.user-portal .up-theme-btn.is-active,
html[data-dp-theme="dark"] body.user-portal .up-theme-btn:hover {
    color: var(--dp-accent, var(--up-accent));
}
html[data-dp-theme="dark"] body.user-portal .up-card__head,
html[data-dp-theme="dark"] body.user-portal .custom--card .card-header {
    background: var(--dp-surface-2) !important;
    border-color: var(--dp-border) !important;
    color: var(--dp-text) !important;
}
html[data-dp-theme="dark"] body.user-portal .up-kpi__value,
html[data-dp-theme="dark"] body.user-portal .up-hero__title,
html[data-dp-theme="dark"] body.user-portal .up-action-tile strong,
html[data-dp-theme="dark"] body.user-portal .dashboard-card__number {
    color: var(--dp-text) !important;
}
html[data-dp-theme="dark"] body.user-portal .up-topbar__user,
html[data-dp-theme="dark"] body.user-portal .up-topbar__toggle.sidebar-toggler,
html[data-dp-theme="dark"] body.user-portal .up-logout.logout-btn {
    background: var(--dp-surface-2) !important;
    border-color: var(--dp-border) !important;
}
html[data-dp-theme="dark"] body.user-portal .up-topbar__title,
html[data-dp-theme="dark"] body.user-portal .up-topbar__username,
html[data-dp-theme="dark"] body.user-portal .up-sidebar__username {
    color: var(--dp-text) !important;
}
html[data-dp-theme="dark"] body.user-portal .up-topbar__meta,
html[data-dp-theme="dark"] body.user-portal .up-topbar__balance,
html[data-dp-theme="dark"] body.user-portal .up-sidebar__balance {
    color: var(--dp-text-muted) !important;
}
html[data-dp-theme="dark"] body.user-portal .text-muted {
    color: var(--dp-text-muted) !important;
}

