/*=====================================================================
    PRODUCTION-READY STYLESHEET
    - Target Files: index.html, dashboard.html, admin.html
    - Author: Gemini (adapted)
    - Theme: Royal Blue + Gold (Balanced Dual: .light-blue, .dark-theme)
    - Features: CSS Variables, Theming (Light/Dark), Responsive Design
=====================================================================*/

/*=====================================================================
    1. ROOT VARIABLES & THEME CONFIGURATION
=====================================================================*/
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700;800&family=Poppins:wght@400;600;700&display=swap');

:root {
    /* Primary Color Palette (Royal Blue + Gold) */
    --color-primary: #1e40af;
    /* royal blue */
    --color-primary-dark: #12307a;
    /* darker royal */
    --color-gold: #c79e2b;
    /* gold accent */
    --color-gold-strong: #d4af37;

    /* Neutral / Surfaces */
    --color-bg: #f1f5f9;
    /* page background (light default) */
    --color-surface: #ffffff;
    /* cards, surfaces */
    --color-surface-accent: #f8fafc;
    /* slightly tinted surface */
    --color-border: #e2e8f0;
    /* light border */
    --color-muted: #64748b;
    /* muted text (light) */

    /* Semantic */
    --color-success: #16a34a;
    --color-danger: #dc2626;
    --color-warning: #f59e0b;
    --color-info: #0ea5e9;

    /* Text colors */
    --color-text-primary: #0b1220;
    --color-text-secondary: #304155;
    --color-text-muted: #64748b;
    --color-text-on-dark: #ffffff;

    /* Typography */
    --font-family-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-family-head: "Poppins", "Inter", sans-serif;
    --font-size-base: 16px;
    --font-weight-normal: 400;
    --font-weight-bold: 600;

    /* Sizing & Spacing */
    --spacing-xs: 0.25rem;
    /* 4px */
    --spacing-sm: 0.5rem;
    /* 8px */
    --spacing-md: 1rem;
    /* 16px */
    --spacing-lg: 1.5rem;
    /* 24px */
    --spacing-xl: 2rem;
    /* 32px */

    /* Radii & shadows */
    --border-radius-sm: 0.25rem;
    /* 4px */
    --border-radius-md: 0.5rem;
    /* 8px */
    --border-radius-lg: 1rem;
    /* 16px */
    --box-shadow-sm: 0 6px 18px rgba(2, 8, 23, 0.06);
    --box-shadow-md: 0 12px 40px rgba(2, 8, 23, 0.12);
    --glass-blur: 8px;

    /* Transitions */
    --transition-fast: 180ms cubic-bezier(.2, .9, .2, 1);
    --transition-md: 280ms cubic-bezier(.2, .9, .2, 1);
}

/* Dark Theme Overrides */
body.dark-theme {
    --color-bg: linear-gradient(180deg, #041226 0%, #031427 100%);
    --color-surface: rgba(6, 12, 20, 0.72);
    --color-surface-accent: rgba(12, 22, 36, 0.65);
    --color-border: rgba(255, 255, 255, 0.06);
    --color-muted: #9fb0d6;
    --color-text-primary: #eaf4ff;
    --color-text-secondary: #c6d7ff;
    --color-text-muted: #9fb0d6;

    /* accents */
    --color-primary: #2b61ff;
    /* slightly brighter on dark */
    --color-primary-dark: #143a9b;
    --color-gold: #d4af37;
}

/* Light Blue Theme (used by dashboard.html historically) - adapt to royal blue */
body.light-blue {
    --color-primary: #1e40af;
    --color-primary-dark: #12307a;
    --color-bg: linear-gradient(180deg, #f7fbff 0%, #eef5ff 100%);
    --color-surface: #ffffff;
    --color-surface-accent: #f8fbff;
    --color-border: #e6eefc;
    --color-muted: #5b6f9a;
}

/* Utility: theme transition */
body {
    transition: background-color var(--transition-md), color var(--transition-md);
}

/*=====================================================================
    2. GLOBAL RESETS & BASE STYLES
=====================================================================*/
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    overflow-x: hidden;
    /* Prevents horizontal scroll */
}

body {
    font-family: var(--font-family-sans);
    font-size: var(--font-size-base);
    line-height: 1.65;
    color: var(--color-text-primary);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
    direction: ltr;
    /* Ensure left-to-right */
    text-align: left;
    /* Ensure base alignment is left */
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-family-head);
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-sm);
}

p {
    color: var(--color-text-secondary);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* accessibility helpers */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

/*=====================================================================
    3. AUTH PAGE STYLES (index.html)
=====================================================================*/
.auth-container {
    max-width: 950px;
    margin: var(--spacing-xl) auto;
    background: var(--color-surface);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-md);
    padding: var(--spacing-xl);
    display: grid;
    gap: var(--spacing-xl);
}

/* Header */
.auth-header {
    text-align: center;
    grid-column: 1 / -1;
}

.auth-header h1 {
    color: var(--color-primary);
    font-family: var(--font-family-head);
    font-size: 1.75rem;
}

.auth-header .tagline {
    color: var(--color-text-secondary);
    margin-top: 6px;
}

/* Form wrapper */
.auth-form-wrapper {
    background: var(--color-surface-accent);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-lg);
    border: 1px solid var(--color-border);
    position: relative;
    box-shadow: var(--box-shadow-sm);
}

.auth-form-wrapper h2 {
    text-align: center;
    color: var(--color-text-primary);
}

.auth-form-wrapper .form-subtitle {
    text-align: center;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-lg);
}

/* Password toggle */
.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* Form sections */
.form-section {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px dashed var(--color-border);
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    border-left: 4px solid var(--color-primary);
    padding-left: var(--spacing-sm);
    font-size: 1.05rem;
    margin-bottom: var(--spacing-md);
}

/* Features */
.features-section {
    background: var(--color-surface-accent);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-lg);
}

.features-grid {
    display: grid;
    gap: var(--spacing-md);
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.feature-item {
    background: var(--color-surface);
    border-radius: var(--border-radius-sm);
    padding: var(--spacing-md);
    text-align: center;
    box-shadow: var(--box-shadow-sm);
}

.feature-icon {
    font-size: 1.75rem;
    margin-bottom: 8px;
}

/* Desktop Layout for Auth Page */
@media (min-width: 951px) {
    .auth-container {
        grid-template-columns: 1.5fr 1fr;
        align-items: flex-start;
    }

    .features-section {
        grid-row: 2 / 3;
        grid-column: 2 / 3;
    }

    #login-form-wrapper,
    #register-form-wrapper {
        grid-row: 2 / 3;
        grid-column: 1 / 2;
    }
}

/* Form controls (shared) */
.form-group {
    margin-bottom: var(--spacing-md);
    position: relative;
}

.form-label,
.form-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
}

.form-control,
.form-group input,
.form-group select,
.form-group textarea {
    display: block;
    width: 100%;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    color: var(--color-text-primary);
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus,
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 6px 18px rgba(30, 64, 175, 0.12);
}

/* Buttons used in auth */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 0.7rem 1.2rem;
    font-size: 0.95rem;
    font-weight: var(--font-weight-bold);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-text-on-dark);
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-sm);
}

.btn-success {
    background-color: var(--color-success);
    color: #fff;
}

.btn-secondary {
    background-color: var(--color-surface);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
}

/*=====================================================================
    4. DASHBOARD STYLES (dashboard.html & admin.html)
=====================================================================*/
.dashboard-header {
    background-color: var(--color-surface);
    padding: var(--spacing-md) var(--spacing-lg);
    box-shadow: var(--box-shadow-sm);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 80;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    gap: var(--spacing-md);
}

.header-content h1 {
    font-size: 1.25rem;
    margin: 0;
    font-family: var(--font-family-head);
    color: var(--color-text-primary);
}

.header-actions {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

/* Dashboard container */
.dashboard-container {
    padding: var(--spacing-lg);
    max-width: 1400px;
    margin: 0 auto;
    /* Center container */
    display: grid;
    gap: var(--spacing-lg);
    grid-auto-rows: min-content;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    gap: var(--spacing-lg);
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stat-card {
    background-color: var(--color-surface);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    border: 1px solid var(--color-border);
    box-shadow: var(--box-shadow-sm);
    width: 100%;
    /* Ensure cards try to fill width */
}

.stat-icon {
    font-size: 1.6rem;
    color: var(--color-primary);
    background-color: var(--color-bg);
    padding: var(--spacing-md);
    border-radius: 50%;
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    /* Prevent icon shrinking */
}

.stat-info {
    overflow: hidden;
    /* Prevent text overflow */
}

.stat-card h3 {
    font-size: 1rem;
    color: var(--color-text-secondary);
    margin: 0;
    white-space: nowrap;
    /* Prevent title wrapping */
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-card p {
    font-size: 1.35rem;
    font-weight: var(--font-weight-bold);
    margin: 0;
    color: var(--color-text-primary);
    white-space: nowrap;
    /* Prevent amount wrapping */
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tabs (Admin) */
.tabs-container {
    grid-column: 1 / -1;
}

.tabs-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    border-bottom: 2px solid var(--color-border);
    margin-bottom: var(--spacing-lg);
}

.tab-link {
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--color-text-muted);
    border-bottom: 2px solid transparent;
    transition: color var(--transition-fast), border-bottom-color var(--transition-fast);
}

.tab-link.active,
.tab-link:hover {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Main grid areas for dashboard */
.main-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
}

/* Auction timer styles */
.auction-timer {
    font-size: 2.5rem;
    font-weight: var(--font-weight-bold);
    text-align: center;
    color: var(--color-primary);
}

/* Referral / stats helper */
.referral-card .referral-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin: var(--spacing-lg) 0;
}

.referral-stat-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: var(--color-bg);
    padding: var(--spacing-md);
    border-radius: var(--border-radius-md);
    width: 100%;
    /* Ensure full width */
}

/* Tables & table container */
.table-container {
    overflow-x: auto;
    border-radius: var(--border-radius-sm);
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    background: transparent;
}

table th,
table td {
    padding: var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
    /* Prevent wrapping in table cells */
}

table thead {
    background-color: var(--color-surface-accent);
}

table tbody tr:hover {
    background-color: var(--color-bg);
}

/* Cards (shared) */
.card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    box-shadow: var(--box-shadow-sm);
    overflow: hidden;
    /* Prevent content overflow */
    width: 100%;
    /* Make cards take full width available */
}

.card-header,
.card-body,
.card-footer {
    padding: var(--spacing-md);
}

.card-header {
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-family: var(--font-family-head);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Card-row / responsive */
.card-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--spacing-lg);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.3em 0.6em;
    font-size: 0.75em;
    font-weight: var(--font-weight-bold);
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: var(--border-radius-sm);
    color: var(--color-text-primary);
    background-color: var(--color-border);
}

.badge-confirmed {
    background-color: var(--color-success);
    color: #fff;
}

.badge-pending {
    background-color: var(--color-warning);
    color: #0b1220;
}

.badge-rejected {
    background-color: var(--color-danger);
    color: #fff;
}

/* Modals / Overlays */
.modal,
.verification-overlay {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(3, 6, 12, 0.6);
    display: none;
    /* Changed: Hide by default */
    justify-content: center;
    align-items: center;
}

.modal-content,
.verification-modal {
    background-color: var(--color-surface);
    padding: var(--spacing-xl);
    border-radius: var(--border-radius-md);
    box-shadow: var(--box-shadow-md);
    width: 90%;
    max-width: 720px;
    position: relative;
    border: 1px solid var(--color-border);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.close-modal,
.close-modal-btn {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--color-text-muted);
    background: none;
    border: none;
    cursor: pointer;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--color-text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
}

.empty-state h4 {
    color: var(--color-text-secondary);
}

/* Small utility styles */
.center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

/*=====================================================================
    5. REUSABLE COMPONENTS
=====================================================================*/
/* Buttons (refined) */
.btn {
    border-radius: calc(var(--border-radius-sm) * 1.2);
    padding: 0.7rem 1.2rem;
    font-weight: var(--font-weight-bold);
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: var(--color-text-on-dark);
    box-shadow: 0 8px 30px rgba(18, 48, 122, 0.12), inset 0 -2px 6px rgba(255, 255, 255, 0.03);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--box-shadow-md);
}

.btn-gold {
    background: linear-gradient(90deg, rgba(199, 158, 43, 0.12), rgba(199, 158, 43, 0.06));
    color: var(--color-gold);
    border: 1px solid rgba(199, 158, 43, 0.14);
}

.btn-secondary {
    background: transparent;
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
}

.btn-success {
    background: var(--color-success);
    color: #fff;
}

.btn-danger {
    background: var(--color-danger);
    color: #fff;
}

.icon-btn {
    padding: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Form controls (shared repeated for readability) */
.form-control,
.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.8rem 1rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-primary);
    width: 100%;
    /* Ensure form elements take full width */
}

.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 8px 20px rgba(30, 64, 175, 0.10);
    outline: none;
}

/* Small components: pills, badges, indicators */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(30, 64, 175, 0.06), rgba(199, 158, 43, 0.02));
    color: var(--color-text-primary);
    border: 1px solid rgba(30, 64, 175, 0.04);
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.02));
    border: 1px solid var(--color-border);
    color: var(--color-text-primary);
}

/*=====================================================================
    6. RESPONSIVE DESIGN
=====================================================================*/
@media (max-width: 1024px) {
    .card-row {
        grid-template-columns: 1fr;
    }

    .main-content-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

/* --- MOBILE STYLES (Includes Centering Fix) --- */
@media (max-width: 768px) {
    body {
        font-size: 14px;
        text-align: left;
        /* Ensure base alignment */
        direction: ltr;
        /* Ensure direction */
    }

    /* --- Hamburger Menu Logic --- */
    .hamburger-menu {
        display: inline-flex;
        font-size: 1.25rem;
        background: none;
        border: none;
        color: var(--color-text-primary);
        cursor: pointer;
        /* Add cursor pointer */
    }

    .header-actions {
        display: none;
        /* Hide desktop actions */
        position: absolute;
        top: 100%;
        right: 0;
        background-color: var(--color-surface);
        border: 1px solid var(--color-border);
        box-shadow: var(--box-shadow-md);
        border-radius: 0 0 8px 8px;
        flex-direction: column;
        width: 200px;
        z-index: 1001;
    }

    .header-actions.active {
        /* Show menu when active */
        display: flex;
    }

    .header-actions .btn {
        width: 100%;
        border-radius: 0;
        text-align: left;
        padding: 0.75rem 1rem;
        justify-content: flex-start;
        /* Align text left */
    }

    .header-actions .btn:not(:last-child) {
        border-bottom: 1px solid var(--color-border);
    }

    /* --- End Hamburger Menu --- */

    /* --- Centering Fix for Mobile --- */
    .dashboard-container {
        padding: 0 var(--spacing-md);
        /* Equal padding */
        margin: var(--spacing-md) auto;
        /* Center container with auto margin */
        width: 100%;
        /* Use full width */
        max-width: 100%;
        /* Override desktop max-width */
        text-align: left;
        /* Ensure content inside aligns left */
        justify-items: stretch;
        /* FIX: Force grid items (cards) to stretch horizontally */
    }

    /* --- End Centering Fix --- */

    .dashboard-header {
        padding: var(--spacing-md);
        /* Reduce header padding */
    }

    .header-content h1 {
        font-size: 1.1rem;
        /* Smaller header title */
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        /* 2 columns for stats */
        gap: var(--spacing-md);
    }

    .main-content-grid {
        grid-template-columns: 1fr;
        /* Stack main content */
    }

    .card-body,
    .card-header,
    .card-footer {
        padding: var(--spacing-md);
        /* Reduce card padding */
    }

    .referral-card .referral-stats-grid {
        grid-template-columns: 1fr;
        /* Stack referral stats */
    }

    .investment-details {
        grid-template-columns: 1fr;
        /* Stack investment details */
    }

    .table-container {
        /* Ensure tables scroll if too wide */
        overflow-x: auto;
    }

    /* Ensure cards have 100% width on mobile */
    .card {
        width: 100%;
    }
}


@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
        /* Single column for stats */
    }

    .auth-container {
        margin: var(--spacing-md);
        padding: var(--spacing-md);
    }

    .referral-card .referral-stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-icon {
        width: 52px;
        height: 52px;
    }

    .header-content h1 {
        font-size: 1rem;
        /* Further reduce title size */
    }
}

/*=====================================================================
    7. POLISH & ICONIC GOLD ACCENTS
    - subtle gold underline for headings, small glows, focus states
=====================================================================*/
/* gold underline accent for card headers */
.card-header h3::after {
    content: "";
    display: block;
    width: 44px;
    height: 4px;
    margin-top: 8px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--color-gold) 0%, rgba(199, 158, 43, 0.45) 100%);
    opacity: 0.95;
}

/* focus outlines for accessibility */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(30, 64, 175, 0.12);
    outline-offset: 2px;
}

/* subtle glow on primary buttons and important elements */
.btn-primary:focus,
.pill:focus {
    box-shadow: 0 12px 40px rgba(30, 64, 175, 0.14);
}

/* micro animation for stat cards */
.stat-card {
    transition: transform var(--transition-md), box-shadow var(--transition-md);
}

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--box-shadow-md);
}

/* subtle table row hover */
table tbody tr:hover {
    background: linear-gradient(90deg, rgba(30, 64, 175, 0.02), rgba(199, 158, 43, 0.01));
}

/* proof modal image */
#proof-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
}

/*=====================================================================
    8. SMALL HELPERS (spacing, text utilities)
=====================================================================*/
.text-muted {
    color: var(--color-text-muted);
}

.text-primary {
    color: var(--color-primary);
}

.lead {
    font-size: 1.05rem;
    color: var(--color-text-secondary);
}

.mb-sm {
    margin-bottom: var(--spacing-sm);
}

.mb-md {
    margin-bottom: var(--spacing-md);
}

/*=====================================================================
    End of stylesheet
=====================================================================*/

/* ===== PROOF MODAL - PREMIUM STYLISH VERSION ===== */
/* Elegant, glassy design with subtle animations and vibrant blue highlights */

#proof-modal .modal-content {
    max-width: 700px;
    width: 95%;
    max-height: 85vh;
    margin: 2% auto;
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(10, 25, 47, 0.95), rgba(20, 60, 90, 0.9));
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: proofModalSlideIn 0.35s ease-out;
    overflow: hidden;
}

/* Header */
#proof-modal .modal-header {
    padding: 14px 22px;
    background: linear-gradient(90deg, #0a3d62, #0061a8);
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: "Poppins", sans-serif;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#proof-modal .modal-header h3 {
    margin: 0;
    font-size: 1.15rem;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Body */
#proof-modal .modal-body {
    padding: 20px;
    text-align: center;
    background: transparent;
    max-height: calc(85vh - 60px);
    overflow-y: auto;
    color: #dbe4ee;
}

/* Proof Image Container */
.proof-image-container {
    display: inline-block;
    max-width: 100%;
    position: relative;
    margin: 0 auto;
}

/* Proof Image - Enhanced Style */
#proof-image {
    max-width: 100%;
    max-height: 50vh;
    width: auto;
    height: auto;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    object-fit: contain;
    background: linear-gradient(145deg, #1a2b4b, #2b4f77);
    padding: 8px;
    transition: all 0.3s ease;
    cursor: zoom-in;
}

/* Hover + Zoom Animation */
#proof-image:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 22px rgba(0, 123, 255, 0.3);
}

#proof-image.zoomed {
    cursor: zoom-out;
    transform: scale(1.4);
    z-index: 1100;
    border-color: #00aaff;
}

/* Proof Controls - Rounded Buttons */
.proof-controls {
    margin-top: 16px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.proof-controls .btn {
    background: linear-gradient(90deg, #007bff, #00a8ff);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.proof-controls .btn:hover {
    background: linear-gradient(90deg, #00a8ff, #007bff);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 136, 255, 0.3);
}

/* Proof Info Section */
.proof-info {
    margin-top: 15px;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 0.85rem;
    color: #cfd8e3;
    line-height: 1.4;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.proof-info p {
    margin: 4px 0;
}

.proof-info strong {
    color: #ffffff;
}

/* Close Button */
#proof-modal .close-modal {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

#proof-modal .close-modal:hover {
    color: #00b4ff;
    transform: rotate(90deg);
}

/* Modal Backdrop */
.modal {
    /* display: none; */
    /* JS will handle display */
    position: fixed;
    z-index: 1000;
    inset: 0;
    background: rgba(2, 12, 27, 0.8);
    backdrop-filter: blur(6px);
    animation: fadeInBackdrop 0.4s ease-in-out;
}

/* Compact Buttons in Tables */
.btn-view-proof {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 12px;
    background: linear-gradient(90deg, #004e92, #000428);
    color: #fff;
    border: none;
    transition: all 0.3s ease;
}

.btn-view-proof:hover {
    background: linear-gradient(90deg, #00aaff, #004e92);
    transform: scale(1.05);
}

/* Responsive Image Sizes */
@media (min-width: 1200px) {
    #proof-image {
        max-width: 500px;
        max-height: 400px;
    }
}

@media (max-width: 767px) {
    #proof-image {
        max-height: 280px;
    }

    #proof-modal .modal-content {
        border-radius: 10px;
    }
}

@media (max-width: 480px) {
    #proof-image {
        max-height: 220px;
    }

    #proof-modal .modal-body {
        padding: 10px;
    }
}

/* Keyframes */
@keyframes proofModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-40px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeInBackdrop {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Dark Theme Enhancements */
.dark-theme #proof-modal .modal-content {
    background: linear-gradient(145deg, #0a192f, #112d4e);
    border-color: rgba(255, 255, 255, 0.05);
}

.dark-theme #proof-image {
    background: linear-gradient(145deg, #112d4e, #1b3a6b);
    border-color: #1b3a6b;
}

.dark-theme .proof-info {
    background: rgba(255, 255, 255, 0.05);
    color: #a0b3c8;
}

/* Print Optimization */
@media print {
    #proof-modal .modal-content {
        box-shadow: none;
        background: white;
    }

    #proof-image {
        border: 1px solid #000;
        box-shadow: none;
    }
}

/* ===== INVESTMENT LEDGER – PREMIUM MODERN STYLE ===== */
.investment-ledger-container {
    background: linear-gradient(145deg, #0a192f, #112d4e);
    border-radius: 22px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    animation: fadeInLedger 0.8s ease-out;
    font-family: "Poppins", sans-serif;
    width: 100%;
    /* Ensure full width */
}

.investment-ledger-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(0, 200, 255, 0.15), transparent 70%),
        radial-gradient(circle at bottom right, rgba(153, 102, 255, 0.15), transparent 70%);
    z-index: 0;
}

/* Header */
.investment-ledger-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.ledger-title {
    font-size: 1.9rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

.ledger-title::before {
    content: '💎';
    font-size: 2rem;
    animation: floatIcon 3s ease-in-out infinite;
}

.ledger-count {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    padding: 0.55rem 1.4rem;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
}

.ledger-count::before {
    content: '📈';
    font-size: 1.2rem;
}

.ledger-count:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Investment Card */
.investment-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    padding: 1.6rem;
    margin-bottom: 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.15);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
    animation: slideInUp 0.6s ease both;
    width: 100%;
    /* Ensure full width */
}

.investment-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #00b4ff, #764ba2);
    transition: width 0.3s ease;
}

.investment-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
}

.investment-item:hover::before {
    width: 6px;
}

/* Header inside each investment */
.investment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    /* Allow wrapping */
    gap: 0.5rem;
}

.investment-info h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #e2e8f0;
    margin: 0 0 0.25rem;
}

.amount {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(90deg, #00c6ff, #0072ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: transform 0.3s ease;
}

.investment-item:hover .amount {
    transform: scale(1.08);
}

/* Status Badges – Neon Glow */
.status-badge {
    padding: 0.45rem 0.9rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
    /* Prevent badge shrinking */
    white-space: nowrap;
    /* Prevent wrapping */
}

.status-badge.active {
    background: linear-gradient(135deg, #00ffcc, #0099ff);
    color: #003b5c;
}

.status-badge.pending {
    background: linear-gradient(135deg, #ffd86f, #fc6262);
    color: #4b2700;
}

.status-badge.matured {
    background: linear-gradient(135deg, #a29bfe, #6c5ce7);
    color: #1b0038;
}

.status-badge.withdrawn {
    background: linear-gradient(135deg, #fd79a8, #e84393);
    color: #fff;
}

.status-badge.error {
    background: linear-gradient(135deg, #ff4b2b, #ff416c);
    color: #fff;
}

/* Investment Details Grid */
.investment-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    /* Adjusted minmax */
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.label {
    font-size: 0.85rem;
    color: #a0aec0;
}

.value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
}

/* Timeline Info */
.timeline {
    font-size: 0.85rem;
    color: #cbd5e0;
    font-style: italic;
    margin-bottom: 1rem;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    border-left: 4px solid #00b4ff;
}

/* Footer */
.investment-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-wrap: wrap;
    /* Allow wrapping on small screens */
    gap: 0.5rem;
    /* Add gap for wrapped items */
}

.date {
    font-size: 0.8rem;
    color: #a0aec0;
    white-space: nowrap;
    /* Prevent date wrapping */
}

.actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    /* Allow buttons to wrap */
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    white-space: nowrap;
    /* Prevent button text wrapping */
}

.btn-primary {
    background: linear-gradient(90deg, #00b4ff, #0072ff);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 180, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 180, 255, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #00d2ff, #3a7bd5);
    color: #fff;
    box-shadow: 0 4px 15px rgba(58, 123, 213, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(58, 123, 213, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #ffb347, #ffcc33);
    color: #4b2700;
    box-shadow: 0 4px 15px rgba(255, 204, 51, 0.3);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 204, 51, 0.4);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #a0aec0;
}

.empty-state i {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
    animation: floatIcon 3s ease-in-out infinite;
}

.empty-state h4 {
    color: #e2e8f0;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #a0aec0;
    margin: 0;
}

/* Scrollbar */
#investment-ledger {
    max-height: 600px;
    overflow-y: auto;
}

#investment-ledger::-webkit-scrollbar {
    width: 8px;
}

#investment-ledger::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #00b4ff, #6c5ce7);
    border-radius: 3px;
}

#investment-ledger::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

/* Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLedger {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes floatIcon {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .ledger-title {
        font-size: 1.5rem;
    }

    .investment-details {
        grid-template-columns: 1fr;
    }

    .investment-footer {
        flex-direction: column;
        align-items: flex-start;
        /* Align items left */
        gap: 1rem;
    }

    .actions {
        width: 100%;
        justify-content: flex-start;
        /* Align buttons left */
    }

    .investment-header {
        flex-direction: column;
        /* Stack header items */
        align-items: flex-start;
        gap: 0.5rem;
    }

    .status-badge {
        align-self: flex-start;
        /* Keep badge aligned left */
    }
}

/* === ACTIVE SPEED PAYMENTS SECTION === */
#speed-payment-section {
    background: linear-gradient(145deg, #061a3a, #0c2b60);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 6px 18px rgba(0, 50, 120, 0.4);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#speed-payment-section:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 140, 255, 0.35);
}

/* Header */
#speed-payment-section .card-header {
    background: rgba(0, 102, 204, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#speed-payment-section .card-header h3 {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

#speed-payment-section .card-header i {
    color: #00b4ff;
    font-size: 1.1rem;
}

/* Active Count Badge */
#speed-payment-section .badge {
    background: linear-gradient(90deg, #00b4ff, #0072ff);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 30px;
    box-shadow: 0 0 8px rgba(0, 180, 255, 0.4);
}

/* Card Body */
#speed-payment-section .card-body {
    padding: 20px;
    color: #e1e9ff;
    background: rgba(255, 255, 255, 0.02);
}

/* Speed Payment Content */
#active-speed-payments {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Each Payment Block */
#active-speed-payments>div {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px 18px;
    line-height: 1.6;
    color: #dfe7ff;
    transition: background 0.3s ease;
    width: 100%;
    /* Ensure full width */
}

#active-speed-payments>div:hover {
    background: rgba(0, 102, 204, 0.18);
}

/* Emphasis and highlights */
#active-speed-payments strong {
    color: #ffffff;
}

#active-speed-payments .highlight-amount,
#active-speed-payments p strong:nth-child(1) {
    color: #00b4ff;
    font-weight: 700;
}

/* Upload Button inside the section */
#active-speed-payments .btn,
#active-speed-payments button {
    background: linear-gradient(90deg, #00b4ff, #0072ff);
    color: #fff;
    border: none;
    border-radius: 25px;
    padding: 10px 18px;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 3px 8px rgba(0, 180, 255, 0.4);
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

#active-speed-payments .btn:hover,
#active-speed-payments button:hover {
    background: linear-gradient(90deg, #0098e6, #005cd8);
    transform: translateY(-2px);
}

/* Timer / Speed Bonus Text */
#active-speed-payments p {
    margin: 4px 0;
}

#active-speed-payments p:last-child {
    margin-bottom: 0;
}

#active-speed-payments p:has(.fa-upload) {
    margin-top: 10px;
}

#active-speed-payments span {
    color: #00b4ff;
    font-weight: 500;
}

/* Empty State Styling */
#active-speed-payments .empty-state {
    text-align: center;
    color: #9aa7c2;
    padding: 30px;
}

#active-speed-payments .empty-state i {
    font-size: 2rem;
    color: #00b4ff;
    margin-bottom: 8px;
    display: block;
}

#active-speed-payments .empty-state h4 {
    color: #fff;
    margin: 10px 0 5px;
    font-size: 1rem;
}

#active-speed-payments .empty-state p {
    color: #9aa7c2;
    font-size: 0.9rem;
}

/* ===========================
   PROGRESS BAR STYLES (Dashboard)
   =========================== */
.progress-bars-container .progress-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.6s ease-in-out;
}

/* 0% — Red (Not Started) */
.progress-bars-container .progress-0 {
    background: linear-gradient(90deg, #dc3545, #ff4d4d);
}

/* 10% — Orange (Insurance Paid, Awaiting Auction) */
.progress-bars-container .progress-10 {
    background: linear-gradient(90deg, #fd7e14, #ff9800);
}

/* 25% — Yellow (Awaiting Confirmation) */
.progress-bars-container .progress-25 {
    background: linear-gradient(90deg, #ffc107, #ffda6a);
}

/* 50% — Teal (Awaiting Auction) */
.progress-bars-container .progress-50 {
    background: linear-gradient(90deg, #20c997, #40e0d0);
}

/* 90% — Blue (Awaiting Payment Proof / Confirmation) */
.progress-bars-container .progress-90 {
    background: linear-gradient(90deg, #17a2b8, #33cfff);
}

/* 100% — Green (Fully Invested / Complete) */
.progress-bars-container .progress-100 {
    background: linear-gradient(90deg, #28a745, #34ce57);
}

/* Container for progress bars */
.progress-bars-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* Individual progress bar styling (assuming structure from dashboard.js) */
.investment-progress-bar {
    background: var(--color-surface);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-md);
    border: 1px solid var(--color-border);
    width: 100%;
    /* Ensure full width */
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-xs);
}

.progress-bar-container {
    height: 10px;
    background: var(--color-bg);
    border-radius: 5px;
    overflow: hidden;
    width: 100%;
    /* Ensure bar container takes full width */
}


/* ===========================
   REFERRED USERS SECTION
   =========================== */

.referred-users-section {
    background: #f9fafc;
    border: 1px solid #e0e4eb;
    border-radius: 12px;
    padding: 25px;
    margin-top: 25px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.referred-users-section:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* Section Header */
.referred-users-section h4 {
    font-size: 1.25rem;
    color: #0d47a1;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Referred Users Container */
.referred-users-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 10px;
}

/* Individual Referred User Item (ensure full width) */
.referred-user-item {
    background: #ffffff;
    border: 1px solid #e0e4eb;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    width: 100%;
}

.referred-user-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(13, 71, 161, 0.15);
}

/* User Avatar */
.referred-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1976d2, #42a5f5);
    color: #fff;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* User Info */
.referred-user-info {
    flex-grow: 1;
    text-align: left;
    overflow: hidden;
    /* Prevent text overflow */
}

.referred-user-info h5 {
    font-weight: 600;
    color: #333;
    margin: 0 0 4px;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.referred-user-info .user-email,
.referred-user-info .join-date {
    font-size: 0.8rem;
    color: #666;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Status & Bonus */
.referred-user-status {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.referred-user-status .status-badge {
    font-size: 0.7rem;
    padding: 3px 6px;
}

.referred-user-status .bonus-amount {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-success);
}


/* Empty State */
.referred-users-container .empty-state {
    text-align: center;
    color: #607d8b;
    padding: 30px 10px;
    background: #f1f5fb;
    border-radius: 10px;
    border: 1px dashed #b0bec5;
    grid-column: 1 / -1;
    /* Span full width */
}

.referred-users-container .empty-state i {
    font-size: 2rem;
    color: #90caf9;
    margin-bottom: 8px;
}

.referred-users-container .empty-state h4 {
    color: #1565c0;
    font-weight: 600;
    margin-bottom: 6px;
}

.referred-users-container .empty-state p {
    font-size: 0.9rem;
    color: #546e7a;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .referred-users-section {
        padding: 18px;
    }

    .referred-users-section h4 {
        font-size: 1.1rem;
    }

    .referred-users-container {
        grid-template-columns: 1fr;
        /* Stack on smaller screens */
    }
}

/* ===========================
   HOW REFERRALS WORK SECTION
   =========================== */

.referral-info-section {
    background: #f9fafc;
    border: 1px solid #e0e4eb;
    border-radius: 12px;
    padding: 30px;
    margin-top: 30px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    font-family: "Poppins", "Segoe UI", Roboto, sans-serif;
    color: #263238;
    transition: all 0.3s ease;
}

.referral-info-section:hover {
    box-shadow: 0 5px 18px rgba(13, 71, 161, 0.08);
}

/* Section Heading */
.referral-info-section h4 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0d47a1;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 25px;
    text-align: center;
    font-family: "Poppins", "Segoe UI", Roboto, sans-serif;
}

/* Steps Layout */
.info-steps {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
}

.info-step {
    flex: 1 1 calc(33.333% - 20px);
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e3f2fd;
    padding: 25px 20px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: default;
    width: 100%;
    /* Ensure full width when stacked */
}

.info-step:hover {
    transform: translateY(-6px);
    box-shadow: 0 6px 16px rgba(13, 71, 161, 0.15);
}

/* Step Number */
.step-number {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    background: linear-gradient(135deg, #1976d2, #42a5f5);
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(25, 118, 210, 0.3);
}

/* Step Content */
.step-content strong {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: #0d47a1;
    margin-bottom: 6px;
    font-family: "Poppins", "Segoe UI", Roboto, sans-serif;
}

.step-content p {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #455a64;
    font-family: "Poppins", "Segoe UI", Roboto, sans-serif;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .info-step {
        flex: 1 1 calc(50% - 15px);
    }
}

@media (max-width: 600px) {
    .info-step {
        flex: 1 1 100%;
    }

    .referral-info-section h4 {
        font-size: 1.2rem;
        /* Smaller title on mobile */
    }

    .referral-info-section {
        padding: 20px;
        /* Less padding on mobile */
    }
}

/* ===========================
   MATCHING SYSTEM FONT STYLING
   (Applies only inside Matching System modal)
   =========================== */

#matching-system-modal {
    font-family: "Poppins", "Segoe UI", Roboto, sans-serif;
    color: #1e2a38;
    line-height: 1.6;
}

/* Headings (Main & Section Titles) */
#matching-system-modal h3,
#matching-system-modal h4 {
    font-family: "Poppins", "Segoe UI", Roboto, sans-serif;
    font-weight: 700;
    color: #0d47a1;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#matching-system-modal h3 i,
#matching-system-modal h4 i {
    color: #1565c0;
}

/* Card Titles */
#matching-system-modal .card-header h3 {
    font-size: 1.2rem;
    text-transform: capitalize;
    margin: 0;
}

/* Section Descriptions and Paragraphs */
#matching-system-modal p,
#matching-system-modal .section-description {
    font-size: 0.95rem;
    color: #37474f;
    font-weight: 400;
    margin: 8px 0;
    text-align: justify;
}

/* Labels and form hints */
#matching-system-modal label {
    font-weight: 600;
    color: #0d47a1;
    margin-bottom: 5px;
    display: inline-block;
}

#matching-system-modal small {
    color: #607d8b;
    font-size: 0.85rem;
    display: block;
    margin-top: 4px;
}

/* Inputs and Select Fields */
#matching-system-modal input,
#matching-system-modal select,
#matching-system-modal textarea {
    font-family: "Poppins", "Segoe UI", Roboto, sans-serif;
    font-size: 0.95rem;
    color: #263238;
    padding: 10px 12px;
    border: 1px solid #cfd8dc;
    border-radius: 6px;
    transition: all 0.3s ease;
    width: 100%;
    background-color: #ffffff;
}

#matching-system-modal input:focus,
#matching-system-modal select:focus,
#matching-system-modal textarea:focus {
    border-color: #1e88e5;
    box-shadow: 0 0 6px rgba(30, 136, 229, 0.3);
    outline: none;
}

/* Table Headings & Text */
#matching-system-modal table th {
    background: #1565c0;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px;
}

#matching-system-modal table td {
    font-size: 0.9rem;
    color: #263238;
    padding: 10px;
}

/* Buttons Typography */
#matching-system-modal .btn {
    font-family: "Poppins", "Segoe UI", Roboto, sans-serif;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: capitalize;
    transition: transform 0.2s ease;
}

#matching-system-modal .btn:hover {
    transform: translateY(-1px);
}

/* Info Box / Settings Section */
#matching-system-modal .settings-info p {
    font-size: 0.95rem;
    color: #0d47a1;
    font-weight: 500;
    line-height: 1.5;
    margin: 5px 0;
}

#matching-system-modal .settings-info strong {
    color: #1565c0;
}

/* Modal Header Typography */
#matching-system-modal .modal-header h3 {
    font-size: 1.4rem;
    color: #0d47a1;
    font-weight: 700;
    text-align: left;
    letter-spacing: 0.5px;
}

/* Account Cards (Primary/Secondary Account) */
#matching-system-modal .accounts-grid .account-card strong {
    font-size: 1rem;
    color: #1565c0;
    font-weight: 600;
}

#matching-system-modal .accounts-grid .account-card p {
    font-size: 0.9rem;
    color: #455a64;
    line-height: 1.4;
}

/* Subtle hover highlight on text cards */
#matching-system-modal .account-card:hover {
    background-color: #e3f2fd;
    transition: background-color 0.3s ease;
}

/* Make sure mobile readability is perfect */
@media (max-width: 768px) {

    #matching-system-modal h3,
    #matching-system-modal h4 {
        font-size: 1rem;
    }

    #matching-system-modal p,
    #matching-system-modal label,
    #matching-system-modal table td {
        font-size: 0.85rem;
    }
}

/* ===============================================
   GLOBAL THEME VARIABLES
   =============================================== */
:root {
    --primary-color: #4169E1;
    /* Royal Blue */
    --primary-dark: #2d4ea2;
    --accent-gold: #FFD700;
    /* Illuminating Gold */
    --accent-gold-light: #FFE866;
    --accent-sky: #3DDCFF;
    /* Luminous Sky Blue */
    --bg-color: #0b1120;
    --card-bg: #101a33;
    --border-color: rgba(255, 215, 0, 0.3);
    --border-color-light: rgba(255, 215, 0, 0.15);
    --text-color: #f5f5f5;
    --text-muted: #c0c0c0;
}

/* ===============================================
   TRANSACTION HISTORY SECTION (Royal Blue + Gold)
   =============================================== */

.transaction-history-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(65, 105, 225, 0.2);
    border: 1px solid var(--border-color);
}

/* ... all your transaction history styles remain intact ... */
/* (no structural or pattern changes) */

/* ===============================================
   INVESTMENT LEDGER SECTION (Royal Blue + Sky Blue)
   =============================================== */

.investment-ledger-section {
    background: linear-gradient(145deg, #0d1a3a, #101f4d);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 0 25px rgba(61, 220, 255, 0.15);
    border: 1px solid rgba(61, 220, 255, 0.3);
    color: var(--text-color);
}

/* Header and Title */
.investment-ledger-section h3,
.investment-ledger-section h4 {
    color: var(--accent-sky);
    font-weight: 700;
}

/* Investment Cards */
.investment-card {
    background: rgba(16, 31, 77, 0.9);
    border: 1px solid rgba(61, 220, 255, 0.25);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.investment-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-sky);
    box-shadow: 0 0 25px rgba(61, 220, 255, 0.25);
}

/* Plan Title */
.investment-card .plan-title {
    font-size: 1.2em;
    font-weight: 700;
    color: #3DDCFF;
}

/* Amounts and ROI */
.investment-card .amount {
    font-size: 1.4em;
    font-weight: 700;
    color: #00E5FF;
}

.investment-card .roi-rate,
.investment-card .potential-return,
.investment-card .insurance,
.investment-card .auction {
    color: #B8DAFF;
    font-weight: 600;
}

/* Info Section */
.investment-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    border-top: 1px solid rgba(61, 220, 255, 0.25);
    margin-top: 15px;
    padding-top: 15px;
}

.investment-info span {
    display: block;
    color: var(--text-muted);
}

.investment-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(61, 220, 255, 0.15);
    color: #3DDCFF;
    font-weight: 600;
    text-transform: uppercase;
}

/* Status Variants */
.investment-status.active {
    background: rgba(0, 229, 255, 0.15);
    color: #00E5FF;
}

.investment-status.pending {
    background: rgba(255, 230, 0, 0.1);
    color: #FFD700;
}

.investment-status.completed {
    background: rgba(0, 255, 170, 0.15);
    color: #00FFA6;
}

/* Investment Note / Info Box */
.investment-note {
    background: rgba(61, 220, 255, 0.08);
    border: 1px solid rgba(61, 220, 255, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin-top: 15px;
    color: #B8DAFF;
    font-style: italic;
}

/* Date Info */
.investment-date {
    font-size: 0.85em;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .investment-info {
        grid-template-columns: 1fr;
    }

    .investment-card {
        padding: 15px;
    }
}

/* ===============================================
   Royal Blue with Illuminating Royal Blue Theme
   =============================================== */

/* Transaction History Section */
.transaction-history-section {
    margin-top: 2rem;
    background: linear-gradient(135deg, #0b132b, #101a4d);
    border-radius: 10px;
    box-shadow: 0 0 25px rgba(65, 105, 225, 0.25);
    color: #e6f0ff;
}

/* Filters */
.transaction-filters {
    background: rgba(16, 26, 77, 0.9);
    padding: 1.5rem;
    border-bottom: 1px solid rgba(61, 92, 255, 0.4);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
    border-radius: 8px 8px 0 0;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    font-size: 0.875rem;
    color: #9ec9ff;
}

.filter-group select,
.filter-group input {
    padding: 0.5rem;
    border: 1px solid rgba(61, 92, 255, 0.4);
    border-radius: 4px;
    font-size: 0.875rem;
    background: #0f1a40;
    color: #e6f0ff;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: #3ddcff;
    box-shadow: 0 0 5px rgba(61, 220, 255, 0.5);
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Transaction Statistics */
.transaction-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(11, 19, 43, 0.8);
    border-bottom: 1px solid rgba(61, 92, 255, 0.3);
}

.transaction-stats .stat-card {
    text-align: center;
    padding: 1rem;
    background: rgba(16, 26, 77, 0.95);
    border-radius: 8px;
    border: 1px solid rgba(61, 220, 255, 0.25);
    box-shadow: 0 0 10px rgba(61, 92, 255, 0.15);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: #3ddcff;
}

.stat-value.income {
    color: #4dff88;
}

.stat-value.expense {
    color: #ff4d4d;
}

.stat-label {
    font-size: 0.875rem;
    color: #9ec9ff;
    font-weight: 500;
}

/* Transaction List Header */
.transaction-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(11, 19, 43, 0.95);
    border-bottom: 1px solid rgba(61, 92, 255, 0.3);
}

.transaction-search {
    position: relative;
    width: 300px;
}

.transaction-search input {
    width: 100%;
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    border: 1px solid rgba(61, 92, 255, 0.4);
    border-radius: 4px;
    font-size: 0.875rem;
    background: #0f1a40;
    color: #e6f0ff;
}

.transaction-search .fa-search {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #3ddcff;
}

.transaction-pagination {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: #9ec9ff;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-controls .btn {
    padding: 0.25rem 0.5rem;
    border: 1px solid rgba(61, 92, 255, 0.4);
    background: rgba(16, 26, 77, 0.8);
    border-radius: 4px;
    cursor: pointer;
    color: #3ddcff;
    transition: all 0.2s ease;
}

.pagination-controls .btn:hover {
    background: rgba(61, 92, 255, 0.25);
}

.pagination-controls .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Transaction List */
.transaction-list {
    background: rgba(11, 19, 43, 0.95);
}

.transaction-item {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr auto;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(61, 92, 255, 0.2);
    align-items: center;
    font-size: 0.875rem;
    transition: background 0.3s ease;
}

.transaction-item:hover {
    background: rgba(61, 92, 255, 0.1);
}

.transaction-type {
    font-weight: 600;
    color: #b8d1ff;
}

.transaction-amount {
    font-weight: 600;
    text-align: right;
    color: #3ddcff;
}

.transaction-amount.negative {
    color: #ff4d4d;
}

.transaction-amount.positive {
    color: #4dff88;
}

.transaction-status {
    display: flex;
    justify-content: center;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending {
    background: rgba(255, 200, 0, 0.15);
    color: #ffd700;
    border: 1px solid rgba(255, 200, 0, 0.3);
}

.status-completed {
    background: rgba(61, 220, 255, 0.15);
    color: #3ddcff;
    border: 1px solid rgba(61, 220, 255, 0.3);
}

.status-failed {
    background: rgba(255, 77, 77, 0.15);
    color: #ff4d4d;
    border: 1px solid rgba(255, 77, 77, 0.3);
}

.transaction-date {
    color: #9ec9ff;
    text-align: center;
}

.transaction-actions {
    display: flex;
    justify-content: flex-end;
}

.btn-view {
    padding: 0.25rem 0.75rem;
    background: #3ddcff;
    color: #001a33;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.btn-view:hover {
    background: #2cbbe5;
    color: white;
}

/* Loading and Empty States */
.loading-state,
.empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
    color: #9ec9ff;
}

.loading-state .fa-spinner {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #3ddcff;
}

.empty-state .fas {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: rgba(61, 92, 255, 0.4);
}

.empty-state h4 {
    margin-bottom: 0.5rem;
    color: #b8d1ff;
}

.empty-state p {
    color: #9ec9ff;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .transaction-filters {
        grid-template-columns: 1fr;
    }

    .transaction-list-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .transaction-search {
        width: 100%;
    }

    .transaction-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        text-align: center;
    }

    .transaction-amount {
        text-align: center;
    }

    .transaction-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/*
  ===========================
  FIX FOR ADJUST BALANCE MODAL
  ===========================
  Constrains the modal's body height and adds scrolling
  to prevent content (like buttons) from being cropped
  on smaller screens.
*/
#adjust-balance-modal .modal-body {
    /* Set a max-height relative to the viewport height (e.g., 80vh).
      This ensures the modal body doesn't expand off the screen.
      You can adjust this value (e.g., 75vh, 85vh) as needed.
    */
    max-height: 80vh;

    /* Add a vertical scrollbar *only* if the content
      (the form, preview, and buttons) is taller than the max-height.
    */
    overflow-y: auto;
}

/* --- START: CSS for Permissions Modal Height --- */

#permissions-modal .modal-content {
    /* Optional: Set a max height for the entire modal content area */
    max-height: 85vh;
    /* Adjust percentage as needed */
    display: flex;
    /* Helps manage internal flex layout */
    flex-direction: column;
    /* Stack header, body, footer vertically */
}

#permissions-modal .modal-body {
    /* Set a maximum height for the scrollable body */
    max-height: 65vh;
    /* Adjust percentage as needed, make it less than modal-content max-height */
    /* Add vertical scrolling only when needed */
    overflow-y: auto;
    /* Ensure padding doesn't add to the scrollable height constraints */
    box-sizing: border-box;
}

/* Optional: Minor adjustments if header/footer take too much space */
#permissions-modal .modal-header {
    flex-shrink: 0;
    /* Prevent header from shrinking */
}

#permissions-modal .modal-body .form-actions {
    flex-shrink: 0;
    /* Prevent footer actions from shrinking */
    margin-top: 15px;
    /* Adjust spacing if needed */
}

/* --- END: CSS for Permissions Modal Height --- */
.modal-open {
    overflow: hidden;
}

.share-options {
    text-align: center;
    padding: 20px;
}

.share-content-preview {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
    margin: 15px 0;
}

.share-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-linkedin {
    background-color: #0077b5;
    color: white;
}

.btn-linkedin:hover {
    background-color: #005885;
}

/* Mobile-friendly layout for action buttons */
@media screen and (max-width: 600px) {

    .speed-payments-container .btn,
    .transaction-list .btn,
    .ledger-container .btn {
        display: block !important;
        width: 100% !important;
        margin: 6px 0 !important;
        text-align: center !important;
        font-size: 14px !important;
        padding: 10px 12px !important;
        border-radius: 8px !important;
    }

    /* Container for buttons within each task/card */
    .speed-payments-container .button-group,
    .ledger-container .button-group {
        display: flex;
        flex-direction: column;
        gap: 6px;
        width: 100%;
    }

    /* Improve card padding and button spacing */
    .speed-payments-container .card,
    .ledger-container .card {
        padding: 10px !important;
    }

    /* Make icons inside buttons align neatly */
    .btn i {
        margin-right: 6px;
    }

    /* Optional: different colors for clarity */
    .btn-confirm {
        background-color: #28a745 !important;
        /* green */
        color: #fff !important;
    }

    .btn-view {
        background-color: #007bff !important;
        /* blue */
        color: #fff !important;
    }

    .btn-report {
        background-color: #dc3545 !important;
        /* red */
        color: #fff !important;
    }
}