/* ═══════════════════════════════════════════════════════════════
   TLG Trade Referral Partner Portal — Referee CSS
   ═══════════════════════════════════════════════════════════════ */

/* ── Variables ──────────────────────────────────────────────── */
:root {
    --brand: #7b0f19;
    --brand-dark: #5c0017;
    --brand-light: rgba(128, 0, 32, .08);
    --brand-gold: #d4af37;
    --brand-cream: #fff7ef;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, .06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, .08);
    --shadow-lg: 0 18px 50px rgba(45, 15, 20, .12);
    --transition: .2s ease;
}

/* ── Base ───────────────────────────────────────────────────── */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(212, 175, 55, .11), transparent 25%),
        linear-gradient(180deg, #faf7f4 0%, #ffffff 48%, #f7f2ee 100%);
    min-height: 100vh;
    margin: 0;
}

/* ── Auth Layout — Split Screen ─────────────────────────────── */
.auth-page-split {
    min-height: 100vh;
    margin: 0;
    background: #f8f5f2;
}

.auth-split-container {
    display: flex;
    min-height: 100vh;
}

/* Decorative Left Panel */
.auth-deco-panel {
    flex: 0 0 42%;
    background: linear-gradient(135deg, var(--brand) 0%, #5a0018 50%, #3d0010 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
    color: #fff;
}

.deco-bg-shapes {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.deco-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .04);
}

.deco-circle-1 {
    width: 500px;
    height: 500px;
    top: -120px;
    left: -100px;
    animation: decoFloat 12s ease-in-out infinite;
}

.deco-circle-2 {
    width: 350px;
    height: 350px;
    bottom: -80px;
    right: -60px;
    animation: decoFloat 10s ease-in-out infinite reverse;
}

.deco-circle-3 {
    width: 200px;
    height: 200px;
    top: 40%;
    right: 15%;
    background: rgba(212, 175, 55, .08);
    animation: decoPulse 8s ease-in-out infinite;
}

@keyframes decoFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(20px, -20px) scale(1.05);
    }
}

@keyframes decoPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: .6;
    }

    50% {
        transform: scale(1.15);
        opacity: 1;
    }
}

.deco-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 380px;
}

.deco-brand {
    margin-bottom: 1rem;
}

.deco-logo {
    height: 64px;
    width: auto;
    opacity: 1;
    display: block;
    margin: 0 auto;
}

.deco-headline {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 1rem;
    letter-spacing: -.01em;
}

.deco-accent {
    color: var(--brand-gold);
}

.deco-subtext {
    font-size: 1rem;
    opacity: .8;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.deco-features {
    display: flex;
    flex-direction: column;
    gap: .85rem;
    text-align: left;
}

.deco-feature {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: .92rem;
    opacity: .85;
}

.deco-feature i {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    flex-shrink: 0;
}

.deco-footer {
    position: absolute;
    bottom: 1.5rem;
    left: 0;
    right: 0;
    text-align: center;
    font-size: .78rem;
    opacity: .5;
    z-index: 2;
}

/* Right Form Panel */
.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: #f8f5f2;
}

.auth-form-wrapper {
    width: 100%;
    max-width: 440px;
}

.auth-form-header {
    margin-bottom: 2rem;
}

.auth-mobile-brand {
    display: none;
    align-items: center;
    gap: .5rem;
    text-decoration: none;
    margin-bottom: 1.5rem;
}

.auth-mobile-brand img {
    height: 40px;
    width: auto;
}

.auth-form-header h1 {
    font-size: 1.65rem;
    font-weight: 800;
    color: #1a1a1a;
    margin: 0 0 .35rem;
    letter-spacing: -.02em;
}

.auth-form-subtitle {
    color: #777;
    font-size: .95rem;
    margin: 0;
}

.auth-form-body {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .06);
    border: 1px solid rgba(0, 0, 0, .04);
}

.auth-form-body .alert {
    border-radius: var(--radius-md);
    font-size: .88rem;
    padding: .75rem 1rem;
    margin-bottom: 1.25rem;
}

.auth-footer-links {
    text-align: center;
    margin-top: 1.25rem;
    font-size: .875rem;
    color: #777;
}

.auth-footer-links a {
    color: var(--brand);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer-links a:hover {
    color: var(--brand-dark);
    text-decoration: underline;
}

/* Legacy auth-page support */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
    background:
        radial-gradient(circle at top left, rgba(212, 175, 55, .14), transparent 30%),
        radial-gradient(circle at bottom right, rgba(128, 0, 32, .12), transparent 28%),
        linear-gradient(135deg, #f8f3ef 0%, #fff 45%, #f5f2ee 100%);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid rgba(128, 0, 32, .08);
    margin: 1rem auto;
}

.auth-card.auth-card-wide {
    max-width: 620px;
}

.auth-card.auth-card-wide .auth-body {
    padding: 1.75rem 2rem 2rem;
}

.auth-card.auth-card-wide .auth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1.25rem;
}

.auth-card.auth-card-wide .auth-grid-full {
    grid-column: 1 / -1;
}

.auth-header {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    padding: 2rem 1.75rem 1.5rem;
    text-align: center;
    color: #fff;
}

.auth-header img {
    height: 54px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    display: block;
    margin: 0 auto 1rem;
}

.auth-header h1 {
    font-size: 1.3rem;
    font-weight: 800;
    margin: .25rem 0 0;
    letter-spacing: .02em;
}

.auth-header .subline {
    font-size: .88rem;
    opacity: .86;
    margin-top: .4rem;
}

.auth-body {
    padding: 2rem;
}

/* ── Form Controls ──────────────────────────────────────────── */
.form-control,
.form-select {
    border-radius: var(--radius-md);
    border-color: #d9d9d9;
    padding: .75rem .95rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 .2rem rgba(128, 0, 32, .12);
}

/* Override browser autofill styling */
.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover, 
.form-control:-webkit-autofill:focus, 
.form-control:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px white inset !important;
    -webkit-text-fill-color: #444 !important;
    transition: background-color 5000s ease-in-out 0s;
}

.form-label {
    font-weight: 600;
    font-size: .875rem;
    color: #444;
    margin-bottom: .35rem;
}

.form-text {
    font-size: .8rem;
    color: #888;
}

.input-icon-wrapper {
    position: relative;
}

.input-icon-wrapper .form-control {
    padding-left: 2.5rem;
}

.input-icon-wrapper .input-icon {
    position: absolute;
    left: .85rem;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    pointer-events: none;
    font-size: .9rem;
}

.password-toggle {
    position: absolute;
    right: .75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: .25rem;
    font-size: 1rem;
    z-index: 5;
    transition: color var(--transition);
}

.password-toggle:hover {
    color: var(--brand);
}

/* Password strength meter */
.password-strength {
    height: 4px;
    border-radius: 2px;
    background: #e9ecef;
    margin-top: .35rem;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    border-radius: 2px;
    transition: width .3s ease, background .3s ease;
    width: 0;
}

.password-strength-bar.strength-weak {
    width: 25%;
    background: #dc3545;
}

.password-strength-bar.strength-fair {
    width: 50%;
    background: #fd7e14;
}

.password-strength-bar.strength-good {
    width: 75%;
    background: #20c997;
}

.password-strength-bar.strength-strong {
    width: 100%;
    background: #198754;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn-brand {
    background: linear-gradient(135deg, var(--brand) 0%, #9a1736 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    padding: .8rem 1.25rem;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-brand:hover {
    background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(128, 0, 32, .25);
}

.btn-brand:active {
    transform: translateY(0);
}

.btn-brand:disabled {
    opacity: .65;
    transform: none;
    box-shadow: none;
}

.btn-brand .btn-spinner {
    display: none;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, .3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .6s linear infinite;
    margin-right: .5rem;
}

.btn-brand.is-loading .btn-spinner {
    display: inline-block;
}

.btn-brand.is-loading .btn-text {
    opacity: .7;
}

.btn-brand.is-loading {
    pointer-events: none;
}

.btn-outline-brand {
    border: 2px solid var(--brand);
    color: var(--brand);
    background: transparent;
    border-radius: var(--radius-md);
    font-weight: 600;
    padding: .75rem 1.25rem;
    transition: all var(--transition);
}

.btn-outline-brand:hover {
    background: var(--brand);
    color: #fff;
}

/* ── Navigation — Topbar ────────────────────────────────────── */
.portal-nav {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    padding: .55rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .18);
    gap: 1rem;
}

.portal-nav .nav-left {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-shrink: 0;
}

.portal-nav .brand {
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    transition: opacity var(--transition);
}

.portal-nav .brand:hover {
    opacity: .9;
}

.portal-nav .brand img {
    height: 30px;
    width: auto;
    object-fit: contain;
}

.portal-nav .brand-text {
    white-space: nowrap;
}

/* Nav Center — Quick Stats */
.portal-nav .nav-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.portal-nav .nav-quick-stats {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .35rem 1rem;
    background: rgba(255, 255, 255, .12);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, .15);
    backdrop-filter: blur(8px);
}

.portal-nav .quick-stat {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: rgba(255, 255, 255, .9);
    font-size: .8rem;
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition);
    white-space: nowrap;
}

.portal-nav .quick-stat:hover {
    color: #fff;
}

.portal-nav .quick-stat i {
    font-size: .7rem;
    opacity: .8;
}

.portal-nav .quick-stat-divider {
    width: 1px;
    height: 16px;
    background: rgba(255, 255, 255, .25);
}

/* Nav Right */
.portal-nav .nav-right {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-shrink: 0;
}

/* Share Referral CTA Button */
.portal-nav .btn-share-referral {
    background: var(--brand-gold);
    color: #1a1a1a;
    border: none;
    padding: .4rem .8rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: .78rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    transition: all var(--transition);
    white-space: nowrap;
}

.portal-nav .btn-share-referral:hover {
    background: #e5c03d;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, .35);
}

.portal-nav .btn-share-referral:active {
    transform: translateY(0);
}

/* Notifications */
.portal-nav .nav-notifications {
    position: relative;
}

.portal-nav .notification-btn {
    position: relative;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .15);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    font-size: .85rem;
}

.portal-nav .notification-btn:hover {
    background: rgba(255, 255, 255, .2);
    border-color: rgba(255, 255, 255, .3);
}

.portal-nav .notification-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #dc3545;
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--brand);
}

.portal-nav .notification-dropdown {
    position: absolute;
    top: calc(100% + .5rem);
    right: 0;
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, .15);
    min-width: 280px;
    max-width: 320px;
    z-index: 1060;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, .06);
}

.portal-nav .notif-header {
    padding: .85rem 1rem;
    font-weight: 700;
    font-size: .85rem;
    color: #1a1a1a;
    border-bottom: 1px solid #f0f0f0;
}

.portal-nav .notif-item {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .85rem 1rem;
    text-decoration: none;
    color: inherit;
    transition: background var(--transition);
    border-bottom: 1px solid #f8f8f8;
}

.portal-nav .notif-item:hover {
    background: rgba(128, 0, 32, .03);
    text-decoration: none;
}

.portal-nav .notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: .85rem;
}

.portal-nav .notif-icon-warning {
    background: rgba(245, 158, 11, .12);
    color: #f59e0b;
}

.portal-nav .notif-content {
    flex: 1;
    min-width: 0;
}

.portal-nav .notif-title {
    font-weight: 600;
    font-size: .82rem;
    color: #1a1a1a;
}

.portal-nav .notif-text {
    font-size: .78rem;
    color: #666;
    margin-top: .1rem;
    line-height: 1.4;
}

.portal-nav .notif-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: #999;
    font-size: .85rem;
}

.portal-nav .notif-empty i {
    display: block;
    font-size: 1.5rem;
    margin-bottom: .5rem;
    opacity: .5;
}

/* User Dropdown */
.portal-nav .nav-user-dropdown {
    position: relative;
}

.portal-nav .nav-user-trigger {
    display: flex;
    align-items: center;
    gap: .45rem;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .15);
    padding: .25rem .6rem .25rem .25rem;
    border-radius: 30px;
    color: #fff;
    cursor: pointer;
    transition: all var(--transition);
}

.portal-nav .nav-user-trigger:hover {
    background: rgba(255, 255, 255, .18);
    border-color: rgba(255, 255, 255, .3);
}

.portal-nav .nav-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .2);
    border: 2px solid rgba(255, 255, 255, .35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    font-weight: 700;
    color: #fff;
}

.portal-nav .user-name {
    color: rgba(255, 255, 255, .9);
    font-size: .8rem;
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-nav .nav-chevron {
    font-size: .6rem;
    opacity: .7;
    transition: transform var(--transition);
}

.portal-nav .nav-user-trigger[aria-expanded="true"] .nav-chevron,
.portal-nav .nav-user-trigger.active .nav-chevron {
    transform: rotate(180deg);
}

.portal-nav .user-dropdown {
    position: absolute;
    top: calc(100% + .5rem);
    right: 0;
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, .15);
    min-width: 220px;
    z-index: 1060;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, .06);
}

.portal-nav .user-dropdown-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
}

.portal-nav .user-dropdown-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    font-weight: 700;
    color: #fff;
}

.portal-nav .user-dropdown-name {
    font-weight: 600;
    font-size: .9rem;
    color: #1a1a1a;
}

.portal-nav .user-dropdown-email {
    font-size: .75rem;
    color: #888;
}

.portal-nav .user-dropdown-item {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .6rem 1rem;
    color: #444;
    text-decoration: none;
    font-size: .85rem;
    transition: all var(--transition);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.portal-nav .user-dropdown-item:hover {
    background: var(--brand-light);
    color: var(--brand);
    text-decoration: none;
}

.portal-nav .user-dropdown-item i {
    width: 18px;
    text-align: center;
    font-size: .85rem;
}

.portal-nav .user-dropdown-divider {
    height: 1px;
    background: #f0f0f0;
    margin: .35rem 0;
}

.portal-nav .user-dropdown-logout {
    color: #dc3545;
}

.portal-nav .user-dropdown-logout:hover {
    background: rgba(220, 53, 69, .06);
    color: #dc3545;
}

/* Hamburger — mobile only */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.35rem;
    cursor: pointer;
    padding: .25rem;
    line-height: 1;
}

/* ── Sidebar (Desktop) ──────────────────────────────────────── */
.portal-sidebar {
    width: 250px;
    min-height: calc(100vh - 52px);
    background: #fff;
    border-right: 1px solid #e9ecef;
    padding: 1.25rem 0;
    flex-shrink: 0;
    overflow-y: auto;
}

.sidebar-user-profile {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 0 1.25rem 1.25rem;
    margin-bottom: .5rem;
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-user-info {
    min-width: 0;
}

.sidebar-user-name {
    font-weight: 600;
    font-size: .9rem;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: .78rem;
    color: #888;
}

.portal-sidebar .sidebar-section {
    padding: 0 1rem;
    margin-bottom: .5rem;
}

.portal-sidebar .sidebar-label {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #aaa;
    font-weight: 700;
    padding: 0 .5rem;
    margin-bottom: .35rem;
    margin-top: .5rem;
}

.portal-sidebar .nav-link {
    color: #555;
    padding: .6rem .75rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .88rem;
    text-decoration: none;
    transition: all var(--transition);
    margin-bottom: 2px;
}

.portal-sidebar .nav-link i {
    width: 18px;
    text-align: center;
    font-size: .9rem;
}

.portal-sidebar .nav-link:hover {
    background: var(--brand-light);
    color: var(--brand);
}

.portal-sidebar .nav-link.active {
    background: var(--brand-light);
    color: var(--brand);
    font-weight: 600;
    border-left: 3px solid var(--brand);
    padding-left: calc(.75rem - 3px);
}

.portal-sidebar .nav-link-highlight {
    background: linear-gradient(135deg, rgba(99, 102, 241, .06), rgba(99, 102, 241, .02));
    border: 1px solid rgba(99, 102, 241, .12);
}

.portal-sidebar .nav-link-highlight:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, .1), rgba(99, 102, 241, .04));
    border-color: rgba(99, 102, 241, .2);
}

.nav-badge {
    margin-left: auto;
    background: #f59e0b;
    color: #fff;
    font-size: .65rem;
    font-weight: 600;
    padding: .15rem .45rem;
    border-radius: 10px;
    line-height: 1;
}

/* ── Mobile Sidebar (Offcanvas) ─────────────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    z-index: 1040;
    opacity: 0;
    transition: opacity .3s ease;
}

.sidebar-overlay.is-active {
    display: block;
    opacity: 1;
}

.mobile-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    background: #fff;
    z-index: 1050;
    transform: translateX(-100%);
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
    overflow-y: auto;
    box-shadow: 4px 0 24px rgba(0, 0, 0, .15);
}

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

.mobile-sidebar-header {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
}

.mobile-sidebar-header .brand {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 800;
    font-size: .95rem;
    color: #fff;
    text-decoration: none;
}

.mobile-sidebar-header .brand img {
    height: 28px;
    width: auto;
}

.mobile-sidebar-close {
    background: rgba(255, 255, 255, .15);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: background var(--transition);
}

.mobile-sidebar-close:hover {
    background: rgba(255, 255, 255, .3);
}

.mobile-sidebar-user {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-sidebar-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.mobile-sidebar-user-info {
    min-width: 0;
}

.mobile-sidebar-user-name {
    font-weight: 600;
    font-size: .9rem;
    color: #1a1a1a;
}

.mobile-sidebar-user-email {
    font-size: .78rem;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-sidebar-nav {
    padding: .5rem 0;
}

.mobile-sidebar-label {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #aaa;
    font-weight: 700;
    padding: .75rem 1.25rem .35rem;
}

.mobile-sidebar .nav-link {
    color: #444;
    padding: .65rem 1.25rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: .9rem;
    text-decoration: none;
    transition: all var(--transition);
    border-left: 3px solid transparent;
}

.mobile-sidebar .nav-link i {
    width: 20px;
    text-align: center;
    font-size: .9rem;
}

.mobile-sidebar .nav-link:hover {
    background: var(--brand-light);
    color: var(--brand);
}

.mobile-sidebar .nav-link.active {
    background: var(--brand-light);
    color: var(--brand);
    font-weight: 600;
    border-left-color: var(--brand);
}

.mobile-sidebar .sidebar-user {
    padding: 1rem 1.25rem;
    border-top: 1px solid #f0f0f0;
    margin-top: .5rem;
}

.btn-logout-mobile {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    padding: .65rem 1rem;
    background: none;
    border: 1px solid #e9ecef;
    border-radius: var(--radius-sm);
    color: #dc3545;
    font-size: .88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-logout-mobile:hover {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

/* ── Main Content ───────────────────────────────────────────── */
.portal-wrapper {
    display: flex;
    min-height: calc(100vh - 52px);
}

.portal-main {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    width: 100%;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: .75rem;
}

.page-header h4 {
    font-weight: 700;
    margin: 0;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.page-header h4 i {
    color: var(--brand);
}

/* ── Page Section Headers ───────────────────────────────────── */
.page-section {
    margin-bottom: 1.5rem;
}

.page-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.page-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.page-section-title i {
    color: var(--brand);
    font-size: .9rem;
}

/* ── Subpage Stats ──────────────────────────────────────────── */
.subpage-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.subpage-stat {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, .04);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all var(--transition);
}

.subpage-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.subpage-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.subpage-stat-info {
    min-width: 0;
}

.subpage-stat-label {
    font-size: .78rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .03em;
    font-weight: 600;
}

.subpage-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
}

/* ── Dashboard Hero ─────────────────────────────────────────── */
.dashboard-hero {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    border-radius: var(--radius-lg);
    padding: 2rem 2.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    color: #fff;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 .35rem;
}

.hero-subtitle {
    font-size: .95rem;
    opacity: .85;
    margin: 0;
}

.hero-decoration {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.hero-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .06);
}

.hero-circle-1 {
    width: 200px;
    height: 200px;
    top: -60px;
    right: -40px;
}

.hero-circle-2 {
    width: 120px;
    height: 120px;
    bottom: -30px;
    right: 80px;
    background: rgba(212, 175, 55, .1);
}

/* ── KYC Banner ─────────────────────────────────────────────── */
.kyc-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, .06), rgba(99, 102, 241, .02));
    border: 1px solid rgba(99, 102, 241, .15);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.kyc-banner-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(99, 102, 241, .1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6366f1;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.kyc-banner-content {
    flex: 1;
    min-width: 0;
}

.kyc-banner-content strong {
    display: block;
    color: #1a1a1a;
    font-size: .92rem;
}

.kyc-banner-content p {
    margin: .15rem 0 0;
    font-size: .85rem;
    color: #666;
}

.kyc-banner-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem 1rem;
    border: 1px solid #6366f1;
    border-radius: var(--radius-sm);
    color: #6366f1;
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition);
}

.kyc-banner-btn:hover {
    background: #6366f1;
    color: #fff;
}

/* ── Referral Hero ──────────────────────────────────────────── */
.referral-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: #fff;
    border: 1px solid rgba(128, 0, 32, .1);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.referral-hero-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.referral-hero-content {
    flex: 1;
    min-width: 0;
}

.referral-hero-label {
    display: block;
    font-size: .78rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 600;
}

.referral-hero-code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: .1em;
    color: var(--brand);
}

.referral-hero-actions {
    display: flex;
    gap: .5rem;
    flex-shrink: 0;
}

.btn-referral-action {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem 1rem;
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    background: #fff;
    color: #555;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-referral-action:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: var(--brand-light);
}

.btn-referral-share {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.btn-referral-share:hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #fff;
}

/* ── Stats Grid ─────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stats-grid .stat-card {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    padding: 1.15rem;
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, .04);
    transition: all var(--transition);
}

.stats-grid .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stats-grid .stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.stat-green .stat-icon {
    background: rgba(16, 185, 129, .1);
    color: #10b981;
}

.stat-blue .stat-icon {
    background: rgba(59, 130, 246, .1);
    color: #3b82f6;
}

.stat-amber .stat-icon {
    background: rgba(245, 158, 11, .1);
    color: #f59e0b;
}

.stat-purple .stat-icon {
    background: rgba(99, 102, 241, .1);
    color: #6366f1;
}

.stat-pink .stat-icon {
    background: rgba(236, 72, 153, .1);
    color: #ec4899;
}

.stat-orange .stat-icon {
    background: rgba(249, 115, 22, .1);
    color: #f97316;
}

.stats-grid .stat-info {
    min-width: 0;
}

.stats-grid .stat-label {
    font-size: .75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .03em;
    font-weight: 600;
}

.stats-grid .stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
    white-space: nowrap;
}

/* ── Dashboard Grid ─────────────────────────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* ── Tier List ──────────────────────────────────────────────── */
.tier-list {
    padding: .5rem 0;
}

.tier-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem 1.25rem;
    border-bottom: 1px solid #f5f5f5;
    font-size: .88rem;
    transition: background var(--transition);
}

.tier-item:last-child {
    border-bottom: none;
}

.tier-item:hover {
    background: rgba(128, 0, 32, .02);
}

.tier-item.tier-first {
    background: linear-gradient(90deg, rgba(16, 185, 129, .04), transparent);
}

.tier-item.tier-second {
    background: linear-gradient(90deg, rgba(59, 130, 246, .04), transparent);
}

.tier-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .72rem;
    font-weight: 700;
    color: #666;
    flex-shrink: 0;
}

.tier-first .tier-number {
    background: rgba(16, 185, 129, .15);
    color: #10b981;
}

.tier-second .tier-number {
    background: rgba(59, 130, 246, .15);
    color: #3b82f6;
}

.tier-name {
    flex: 1;
    color: #555;
}

.tier-rate {
    font-weight: 700;
    color: #333;
    min-width: 40px;
    text-align: right;
}

.tier-rate.tier-first {
    color: #10b981;
}

.tier-rate.tier-second {
    color: #3b82f6;
}

.tier-example {
    color: #888;
    font-size: .82rem;
    min-width: 70px;
    text-align: right;
}

/* ── Activity Feed ──────────────────────────────────────────── */
.activity-feed {
    padding: .5rem 0;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .75rem 1.25rem;
    border-bottom: 1px solid #f5f5f5;
    transition: background var(--transition);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item:hover {
    background: rgba(128, 0, 32, .02);
}

.activity-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    flex-shrink: 0;
}

.activity-icon-approved {
    background: rgba(16, 185, 129, .1);
    color: #10b981;
}

.activity-icon-paid {
    background: rgba(59, 130, 246, .1);
    color: #3b82f6;
}

.activity-icon-pending {
    background: rgba(245, 158, 11, .1);
    color: #f59e0b;
}

.activity-icon-rejected {
    background: rgba(220, 53, 69, .1);
    color: #dc3545;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-title {
    font-weight: 600;
    font-size: .88rem;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-meta {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin-top: .2rem;
    font-size: .8rem;
}

.activity-amount {
    font-weight: 700;
    color: #333;
}

.activity-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #ccc;
}

.activity-status {
    color: #888;
}

.activity-status.status-approved {
    color: #10b981;
}

.activity-status.status-paid {
    color: #3b82f6;
}

.activity-status.status-pending {
    color: #f59e0b;
}

.activity-time {
    font-size: .78rem;
    color: #999;
    white-space: nowrap;
    flex-shrink: 0;
}

.activity-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: #999;
}

.activity-empty i {
    font-size: 2rem;
    margin-bottom: .5rem;
    opacity: .5;
}

.activity-empty p {
    margin: 0;
    font-size: .9rem;
}

.panel-link {
    font-size: .82rem;
    color: var(--brand);
    text-decoration: none;
    font-weight: 600;
}

.panel-link:hover {
    text-decoration: underline;
}

/* ── Stat Cards ─────────────────────────────────────────────── */
.stat-card {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 1.15rem 1.25rem;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--brand);
    transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card .stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    margin-bottom: .5rem;
}

.stat-card .label {
    font-size: .75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 600;
}

.stat-card .value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-top: .15rem;
    line-height: 1.3;
}

.stat-card .sub-text {
    font-size: .78rem;
    color: #999;
    margin-top: .15rem;
}

/* ── Card Panels ────────────────────────────────────────────── */
.card-panel {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-panel .panel-head {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
}

.card-panel .panel-head h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

/* ── Status Badges ──────────────────────────────────────────── */
.badge-pending {
    background: #fff3cd;
    color: #856404;
}

.badge-approved {
    background: #d1e7dd;
    color: #0a3622;
}

.badge-paid {
    background: #cfe2ff;
    color: #084298;
}

.badge-rejected {
    background: #f8d7da;
    color: #842029;
}

.badge-voided {
    background: #e2e3e5;
    color: #41464b;
}

.badge-processing {
    background: #cff4fc;
    color: #055160;
}

/* ── Referral Code Banner ───────────────────────────────────── */
.referral-code-banner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .75rem;
    padding: .75rem 1rem;
    background: linear-gradient(135deg, rgba(128, 0, 32, .04), rgba(212, 175, 55, .06));
    border: 1px solid rgba(128, 0, 32, .1);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.referral-code-banner .code-label {
    font-size: .85rem;
    color: #666;
    font-weight: 500;
}

.referral-code-banner .code-value {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: .12em;
    color: var(--brand);
    background: rgba(128, 0, 32, .06);
    padding: .3rem .75rem;
    border-radius: var(--radius-sm);
    border: 1px dashed rgba(128, 0, 32, .2);
}

.referral-code-banner .btn-group-actions {
    display: flex;
    gap: .35rem;
    margin-left: auto;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid #ddd;
    background: #fff;
    color: #555;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    font-size: .85rem;
    position: relative;
}

.btn-icon:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: var(--brand-light);
}

.btn-icon .tooltip-text {
    display: none;
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    font-size: .72rem;
    padding: .25rem .5rem;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
}

.btn-icon:hover .tooltip-text {
    display: block;
}

/* ── Tables (Desktop) ───────────────────────────────────────── */
.table-responsive {
    border-radius: 0;
}

.table {
    margin-bottom: 0;
    font-size: .88rem;
}

.table thead th {
    font-weight: 600;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #666;
    border-bottom-width: 1px;
    padding: .75rem .85rem;
    white-space: nowrap;
}

.table tbody td {
    padding: .7rem .85rem;
    vertical-align: middle;
    border-color: #f5f5f5;
}

.table-hover tbody tr:hover {
    background: rgba(128, 0, 32, .02);
}

.table tbody tr {
    cursor: pointer;
    transition: background var(--transition);
}

.table-clickable tbody tr:hover {
    background: rgba(128, 0, 32, .04);
}

/* ── Mobile Card Lists ──────────────────────────────────────── */
.mobile-card-list {
    display: none;
}

.mobile-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: .75rem;
    transition: all var(--transition);
    cursor: pointer;
}

.mobile-card:hover {
    border-color: rgba(128, 0, 32, .2);
    box-shadow: var(--shadow-sm);
}

.mobile-card:active {
    background: rgba(128, 0, 32, .02);
}

.mobile-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .5rem;
}

.mobile-card-title {
    font-weight: 700;
    font-size: .95rem;
    color: #222;
}

.mobile-card-subtitle {
    font-size: .8rem;
    color: #888;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.mobile-card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .4rem .75rem;
    font-size: .83rem;
}

.mobile-card-body .card-field-label {
    color: #999;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.mobile-card-body .card-field-value {
    color: #333;
    font-weight: 500;
}

.mobile-card-body .card-field-value.fw-bold {
    font-weight: 700;
}

.mobile-card-footer {
    margin-top: .65rem;
    padding-top: .5rem;
    border-top: 1px solid #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ── Empty States ───────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state .empty-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--brand-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.6rem;
    color: var(--brand);
    opacity: .7;
}

.empty-state h5 {
    font-weight: 700;
    color: #333;
    margin-bottom: .35rem;
}

.empty-state p {
    color: #888;
    font-size: .9rem;
    max-width: 360px;
    margin: 0 auto;
    line-height: 1.5;
}

.empty-state .empty-cta {
    margin-top: 1rem;
}

/* ── Modals ─────────────────────────────────────────────────── */
.modal-backdrop-custom {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-panel {
    background: #fff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .2);
}

.modal-panel-wide {
    max-width: 640px;
}

.modal-panel-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-panel-header h5 {
    margin: 0;
    font-weight: 700;
    font-size: 1.05rem;
}

.modal-panel-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f5f5f5;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    font-size: .85rem;
}

.modal-panel-close:hover {
    background: #e9ecef;
    color: #333;
}

.modal-panel-body {
    padding: 1.5rem;
}

.modal-panel-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
}

/* Detail modal fields */
.detail-field {
    display: flex;
    justify-content: space-between;
    padding: .5rem 0;
    border-bottom: 1px solid #f8f8f8;
    font-size: .9rem;
}

.detail-field:last-child {
    border-bottom: none;
}

.detail-field .field-label {
    color: #888;
    font-weight: 500;
}

.detail-field .field-value {
    font-weight: 600;
    color: #333;
    text-align: right;
}

/* Share modal */
.share-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .75rem;
}

.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    padding: 1rem;
    border: 2px solid #eee;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    color: #444;
    font-size: .85rem;
    font-weight: 600;
}

.share-option:hover {
    border-color: var(--brand);
    background: var(--brand-light);
    color: var(--brand);
    text-decoration: none;
}

.share-option .share-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #fff;
}

.share-option.whatsapp .share-icon {
    background: #25d366;
}

.share-option.sms .share-icon {
    background: #17a2b8;
}

.share-option.telegram .share-icon {
    background: #0088cc;
}

.share-option.copy-link .share-icon {
    background: #6c757d;
}

/* ── Toast Notifications ────────────────────────────────────── */
.toast-container {
    position: fixed;
    top: 70px;
    right: 1rem;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    max-width: 380px;
    width: calc(100% - 2rem);
}

.toast-item {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 30px rgba(0, 0, 0, .12);
    padding: .85rem 1rem;
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    border-left: 4px solid #6c757d;
    animation: toastIn .3s ease;
    transition: all .3s ease;
}

.toast-item.toast-success {
    border-left-color: #198754;
}

.toast-item.toast-error {
    border-left-color: #dc3545;
}

.toast-item.toast-warning {
    border-left-color: #fd7e14;
}

.toast-item.toast-info {
    border-left-color: #0d6efd;
}

.toast-item .toast-icon {
    font-size: 1rem;
    margin-top: .1rem;
    flex-shrink: 0;
}

.toast-item.toast-success .toast-icon {
    color: #198754;
}

.toast-item.toast-error .toast-icon {
    color: #dc3545;
}

.toast-item.toast-warning .toast-icon {
    color: #fd7e14;
}

.toast-item.toast-info .toast-icon {
    color: #0d6efd;
}

.toast-item .toast-content {
    flex: 1;
    min-width: 0;
}

.toast-item .toast-title {
    font-weight: 700;
    font-size: .85rem;
    color: #333;
    margin-bottom: .1rem;
}

.toast-item .toast-message {
    font-size: .82rem;
    color: #666;
    line-height: 1.4;
}

.toast-item .toast-close {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    padding: .15rem;
    font-size: .8rem;
    flex-shrink: 0;
    transition: color var(--transition);
}

.toast-item .toast-close:hover {
    color: #333;
}

.toast-item.is-leaving {
    opacity: 0;
    transform: translateX(100%);
}

/* ── Withdrawal Form ────────────────────────────────────────── */
.withdrawal-form {
    max-width: 480px;
}

.withdrawal-form .otp-section {
    overflow: hidden;
    transition: all .3s ease;
}

.withdrawal-balance-display {
    background: linear-gradient(135deg, rgba(16, 185, 129, .06), rgba(16, 185, 129, .02));
    border: 1px solid rgba(16, 185, 129, .15);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
    margin-bottom: 1rem;
}

.withdrawal-balance-display .balance-label {
    font-size: .78rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.withdrawal-balance-display .balance-amount {
    font-size: 1.8rem;
    font-weight: 800;
    color: #10b981;
}

.withdrawal-balance-display .balance-sub {
    font-size: .78rem;
    color: #999;
    margin-top: .15rem;
}

/* ── Confirm Dialog ─────────────────────────────────────────── */
.confirm-dialog-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
}

.confirm-dialog-icon.icon-warning {
    background: #fff3cd;
    color: #fd7e14;
}

.confirm-dialog-icon.icon-danger {
    background: #f8d7da;
    color: #dc3545;
}

.confirm-dialog-icon.icon-success {
    background: #d1e7dd;
    color: #198754;
}

.confirm-dialog-text {
    text-align: center;
}

.confirm-dialog-text h5 {
    font-weight: 700;
    margin-bottom: .35rem;
}

.confirm-dialog-text p {
    color: #666;
    font-size: .9rem;
}

/* ── Pagination ─────────────────────────────────────────────── */
.pagination {
    gap: .25rem;
}

.page-link {
    border-radius: var(--radius-sm) !important;
    font-size: .85rem;
    padding: .4rem .7rem;
    color: var(--brand);
    border-color: #eee;
    transition: all var(--transition);
}

.page-link:hover {
    background: var(--brand-light);
    border-color: var(--brand);
    color: var(--brand);
}

.page-item.active .page-link {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

/* ── Alert Overrides ────────────────────────────────────────── */
.alert {
    border-radius: var(--radius-md);
    font-size: .9rem;
    border: none;
}

/* ── Skeleton Loader ────────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 14px;
    margin-bottom: .5rem;
}

.skeleton-text-sm {
    height: 10px;
    width: 60%;
    margin-bottom: .35rem;
}

.skeleton-stat {
    height: 80px;
    border-radius: var(--radius-md);
}

.skeleton-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
}

.skeleton-badge {
    height: 24px;
    width: 60px;
    border-radius: 12px;
}

.skeleton-card {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

/* ── Page Transitions ───────────────────────────────────────── */
.page-enter {
    animation: pageEnter .3s ease;
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Focus States (Accessibility) ───────────────────────────── */
:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--brand);
    color: #fff;
    padding: .5rem 1rem;
    z-index: 9999;
    transition: top .3s;
    text-decoration: none;
    font-weight: 600;
    border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
    top: 0;
}

/* ── Reduced Motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .skeleton {
        animation: none;
    }
}

/* ── High Contrast Mode ─────────────────────────────────────── */
@media (prefers-contrast: high) {

    .stat-card,
    .card-panel,
    .mobile-card {
        border: 2px solid #333;
    }

    .btn-brand {
        border: 2px solid #000;
    }

    .form-control,
    .form-select {
        border-width: 2px;
    }
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fade-in {
    animation: fadeIn .3s ease;
}

.slide-up {
    animation: slideUp .3s ease;
}

/* ── Footer ─────────────────────────────────────────────────── */
.portal-footer {
    text-align: center;
    padding: 1.5rem;
    font-size: .78rem;
    color: #aaa;
    border-top: 1px solid #f0f0f0;
    margin-top: 2rem;
}

.portal-footer a {
    color: var(--brand);
    text-decoration: none;
}

.portal-footer a:hover {
    text-decoration: underline;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1023.98px) {
    .auth-deco-panel {
        display: none;
    }

    .auth-form-panel {
        padding: 1.5rem;
    }

    .auth-mobile-brand {
        display: flex;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991.98px) {
    .portal-sidebar {
        display: none;
    }

    .hamburger-btn {
        display: block;
    }

    .portal-main {
        padding: 1.25rem;
    }
}

@media (max-width: 767.98px) {
    .portal-nav {
        padding: .5rem 1rem;
    }

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

    .portal-nav .nav-center {
        display: none !important;
    }

    .portal-nav .btn-share-referral {
        padding: .4rem;
        width: 32px;
        height: 32px;
        justify-content: center;
    }

    .portal-nav .btn-share-referral span {
        display: none;
    }

    .portal-nav .notification-dropdown {
        position: fixed;
        top: 52px;
        left: .5rem;
        right: .5rem;
        width: auto;
        max-width: none;
    }

    .portal-main {
        padding: 1rem;
    }

    .dashboard-hero {
        padding: 1.5rem;
    }

    .hero-title {
        font-size: 1.25rem;
    }

    .referral-hero {
        flex-wrap: wrap;
    }

    .referral-hero-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .kyc-banner {
        flex-wrap: wrap;
    }

    .kyc-banner-btn {
        width: 100%;
        justify-content: center;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card .value {
        font-size: 1.15rem;
    }

    .stat-card .label {
        font-size: .7rem;
    }

    .page-header h4 {
        font-size: 1.1rem;
    }

    .referral-code-banner {
        flex-direction: column;
        align-items: flex-start;
    }

    .referral-code-banner .btn-group-actions {
        margin-left: 0;
    }

    .card-panel .panel-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .table-responsive {
        display: none;
    }

    .mobile-card-list {
        display: block;
    }

    .modal-panel {
        margin: .5rem;
        border-radius: var(--radius-md);
    }

    .modal-panel-body {
        padding: 1rem;
    }

    .share-options {
        grid-template-columns: 1fr 1fr;
        gap: .5rem;
    }

    .detail-field {
        flex-direction: column;
        gap: .15rem;
    }

    .detail-field .field-value {
        text-align: left;
    }

    .portal-footer {
        padding: 1rem;
    }

    .auth-form-body {
        padding: 1.5rem;
    }
}

@media (max-width: 575.98px) {
    .auth-form-panel {
        padding: 1rem;
    }

    .auth-form-body {
        padding: 1.25rem;
    }

    .auth-form-header h1 {
        font-size: 1.35rem;
    }

    .auth-card.auth-card-wide {
        max-width: 100%;
    }

    .auth-card.auth-card-wide .auth-body {
        padding: 1.5rem;
    }

    .auth-card.auth-card-wide .auth-grid {
        grid-template-columns: 1fr;
    }

    .mobile-card-body {
        grid-template-columns: 1fr;
    }

    .withdrawal-form {
        max-width: 100%;
    }

    .toast-container {
        left: .5rem;
        right: .5rem;
        max-width: none;
        width: auto;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .referral-hero-code {
        font-size: 1.1rem;
    }

    .portal-nav .nav-quick-stats {
        display: none;
    }
}

/* ── Print ──────────────────────────────────────────────────── */
@media print {

    .portal-nav,
    .portal-sidebar,
    .mobile-sidebar,
    .sidebar-overlay,
    .toast-container,
    .btn-icon,
    .hamburger-btn {
        display: none !important;
    }

    .portal-main {
        max-width: 100%;
        padding: 0;
    }

    .card-panel {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}