/* =========================================================
   AI TRADE hub
   Global CSS
========================================================= */

:root {
    --bg: #090b0f;
    --bg-soft: #0d1015;
    --panel: #11151b;
    --panel-hover: #151a21;
    --panel-soft: #0f1318;

    --border: #20262f;
    --border-light: #29313b;

    --text: #f4f6f8;
    --text-soft: #a8b0bb;
    --text-muted: #68727f;

    --accent: #7c5cff;
    --accent-hover: #8b70ff;
    --accent-soft: rgba(124, 92, 255, 0.12);
    --accent-border: rgba(124, 92, 255, 0.3);

    --success: #32d583;
    --success-soft: rgba(50, 213, 131, 0.1);

    --warning: #f5b942;
    --warning-soft: rgba(245, 185, 66, 0.1);

    --danger: #f15b6c;
    --danger-soft: rgba(241, 91, 108, 0.1);

    --white: #ffffff;

    --sidebar-width: 250px;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;

    --shadow: 0 12px 40px rgba(0, 0, 0, 0.25);

    --transition: 180ms ease;
}


/* =========================================================
   RESET
========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;

    background:
        radial-gradient(
            circle at 80% 0%,
            rgba(124, 92, 255, 0.07),
            transparent 30%
        ),
        var(--bg);

    color: var(--text);

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    font-size: 14px;
    line-height: 1.5;

    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
}

a {
    color: inherit;
    text-decoration: none;
}

input {
    outline: none;
}

::selection {
    background: rgba(124, 92, 255, 0.35);
    color: white;
}


/* =========================================================
   APP
========================================================= */

.app {
    min-height: 100vh;
    display: flex;
}


/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {
    position: fixed;
    z-index: 100;

    top: 0;
    left: 0;

    width: var(--sidebar-width);
    height: 100vh;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    padding: 24px 16px;

    background: rgba(13, 16, 21, 0.94);

    border-right: 1px solid var(--border);

    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}


/* =========================================================
   BRAND
========================================================= */

.brand {
    display: flex;
    align-items: center;
    gap: 11px;

    padding: 5px 8px 28px;
}

.brand-mark {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    border-radius: 11px;

    background:
        linear-gradient(
            135deg,
            #7c5cff,
            #5c3cff
        );

    color: white;

    font-size: 12px;
    font-weight: 800;

    box-shadow:
        0 8px 24px rgba(124, 92, 255, 0.25);
}

.brand-text {
    display: flex;
    flex-direction: column;

    line-height: 1.05;
}

.brand-text strong {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.brand-text span {
    color: var(--text-soft);

    font-size: 13px;
    font-weight: 500;

    margin-top: 3px;
}


/* =========================================================
   NAVIGATION
========================================================= */

.main-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    position: relative;

    width: 100%;

    display: flex;
    align-items: center;
    gap: 12px;

    padding: 11px 12px;

    border-radius: 10px;

    background: transparent;

    color: var(--text-soft);

    text-align: left;

    transition:
        background var(--transition),
        color var(--transition),
        transform var(--transition);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.nav-item:active {
    transform: scale(0.98);
}

.nav-item.active {
    background: var(--accent-soft);
    color: var(--text);
}

.nav-item.active::before {
    content: "";

    position: absolute;

    left: -16px;
    top: 8px;
    bottom: 8px;

    width: 3px;

    border-radius: 0 4px 4px 0;

    background: var(--accent);
}

.nav-icon {
    width: 20px;

    display: grid;
    place-items: center;

    color: var(--text-muted);

    font-size: 18px;
}

.nav-item.active .nav-icon {
    color: var(--accent-hover);
}

.nav-label {
    font-size: 13px;
    font-weight: 600;
}


/* =========================================================
   SIDEBAR BOTTOM
========================================================= */

.sidebar-bottom {
    display: flex;
    flex-direction: column;
    gap: 12px;
}


/* Network */

.network-status {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 12px;

    border: 1px solid var(--border);

    border-radius: 10px;

    background: var(--panel-soft);
}

.status-dot {
    width: 8px;
    height: 8px;

    flex: 0 0 auto;

    border-radius: 50%;

    background: var(--success);

    box-shadow:
        0 0 0 4px rgba(50, 213, 131, 0.08);
}

.network-status div {
    display: flex;
    flex-direction: column;

    line-height: 1.2;
}

.status-label {
    color: var(--text-muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
}

.network-status strong {
    margin-top: 3px;

    color: var(--success);

    font-size: 12px;
    font-weight: 600;
}


/* Wallet mini */

.wallet-mini {
    width: 100%;

    display: flex;
    align-items: center;
    gap: 9px;

    padding: 10px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--panel);

    color: var(--text);

    text-align: left;

    transition:
        border-color var(--transition),
        background var(--transition);
}

.wallet-mini:hover {
    background: var(--panel-hover);
    border-color: var(--border-light);
}

.wallet-avatar {
    width: 32px;
    height: 32px;

    display: grid;
    place-items: center;

    border-radius: 9px;

    background: var(--accent-soft);

    color: var(--accent-hover);

    font-size: 12px;
    font-weight: 700;
}

.wallet-info {
    min-width: 0;

    flex: 1;

    display: flex;
    flex-direction: column;
}

.wallet-info small {
    color: var(--text-muted);
    font-size: 10px;
}

.wallet-info strong {
    margin-top: 2px;

    color: var(--text-soft);

    font-size: 11px;
    font-weight: 600;

    overflow: hidden;
    text-overflow: ellipsis;
}

.wallet-arrow {
    color: var(--text-muted);
    font-size: 18px;
}


/* =========================================================
   MOBILE HEADER
========================================================= */

.mobile-header {
    display: none;
}


/* =========================================================
   MAIN CONTENT
========================================================= */

.main-content {
    width: calc(100% - var(--sidebar-width));

    margin-left: var(--sidebar-width);

    min-height: 100vh;

    padding: 0 38px 60px;
}


/* =========================================================
   TOPBAR
========================================================= */

.topbar {
    min-height: 92px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid var(--border);

    margin-bottom: 36px;
}

.page-heading {
    display: flex;
    flex-direction: column;
}

.eyebrow,
.section-kicker,
.card-kicker {
    color: var(--text-muted);

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 1px;
    text-transform: uppercase;
}

.page-heading h1 {
    margin-top: 3px;

    font-size: 22px;
    font-weight: 700;

    letter-spacing: -0.6px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wallet-status {
    display: flex;
    align-items: center;
    gap: 7px;

    padding: 8px 11px;

    border: 1px solid var(--border);

    border-radius: 9px;

    color: var(--text-muted);
}

.wallet-status-dot {
    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: var(--success);
}

.wallet-network {
    font-size: 11px;
    font-weight: 600;
}

.connect-wallet-button {
    display: flex;
    align-items: center;
    gap: 8px;

    padding: 8px 11px;

    border: 1px solid var(--border-light);
    border-radius: 9px;

    background: var(--panel);

    color: var(--text);

    font-size: 11px;
    font-weight: 600;

    transition:
        background var(--transition),
        border-color var(--transition);
}

.connect-wallet-button:hover {
    background: var(--panel-hover);
    border-color: var(--accent-border);
}

.wallet-button-icon {
    width: 23px;
    height: 23px;

    display: grid;
    place-items: center;

    border-radius: 7px;

    background: var(--accent-soft);

    color: var(--accent-hover);

    font-size: 10px;
}


/* =========================================================
   TAB CONTAINER
========================================================= */

.tab-container {
    width: 100%;
    max-width: 1250px;

    margin: 0 auto;
}

.tab-panel {
    display: none;

    animation: tabFade 180ms ease;
}

.tab-panel.active {
    display: block;
}

@keyframes tabFade {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

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


/* =========================================================
   WELCOME / TAB INTRO
========================================================= */

.welcome-section,
.tab-intro {
    margin-bottom: 28px;
}

.welcome-section {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.welcome-section h2,
.tab-intro h2 {
    margin-top: 5px;

    color: var(--text);

    font-size: 27px;
    font-weight: 700;

    letter-spacing: -0.9px;
}

.section-description {
    max-width: 650px;

    margin-top: 7px;

    color: var(--text-soft);

    font-size: 13px;
    line-height: 1.7;
}


/* =========================================================
   BUTTONS
========================================================= */

.primary-button,
.secondary-button,
.text-button {
    transition:
        background var(--transition),
        border-color var(--transition),
        color var(--transition),
        transform var(--transition),
        opacity var(--transition);
}

.primary-button {
    min-height: 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 17px;

    border: 1px solid transparent;
    border-radius: 9px;

    background: var(--accent);

    color: white;

    font-size: 12px;
    font-weight: 700;

    white-space: nowrap;

    box-shadow:
        0 7px 20px rgba(124, 92, 255, 0.16);
}

.primary-button:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.primary-button:active {
    transform: translateY(0);
}

.primary-button:disabled {
    opacity: 0.45;
    box-shadow: none;
}

.secondary-button {
    min-height: 40px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 15px;

    border: 1px solid var(--border-light);
    border-radius: 9px;

    background: var(--panel);

    color: var(--text);

    font-size: 12px;
    font-weight: 600;
}

.secondary-button:hover {
    background: var(--panel-hover);
    border-color: var(--accent-border);
}

.secondary-button.disabled,
.secondary-button:disabled {
    color: var(--text-muted);
    background: var(--panel-soft);
    border-color: var(--border);
    opacity: 0.65;
}

.text-button {
    padding: 4px;

    background: transparent;

    color: var(--accent-hover);

    font-size: 11px;
    font-weight: 600;
}

.text-button:hover {
    color: white;
}

.full-width {
    width: 100%;
}


/* =========================================================
   STATS GRID
========================================================= */

.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 12px;

    margin-bottom: 14px;
}

.stat-card {
    min-width: 0;

    padding: 17px;

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    background: var(--panel);

    transition:
        border-color var(--transition),
        transform var(--transition);
}

.stat-card:hover {
    border-color: var(--border-light);
    transform: translateY(-1px);
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    color: var(--text-muted);

    font-size: 11px;
    font-weight: 600;
}

.stat-icon {
    width: 26px;
    height: 26px;

    display: grid;
    place-items: center;

    border-radius: 7px;

    background: var(--panel-soft);

    color: var(--text-soft);

    font-size: 12px;
}

.stat-value {
    display: block;

    margin-top: 15px;

    color: var(--text);

    font-size: 21px;
    font-weight: 700;

    letter-spacing: -0.5px;

    white-space: nowrap;
}

.stat-value.positive {
    color: var(--success);
}

.stat-value.status-active {
    color: var(--success);
}

.stat-meta {
    display: block;

    margin-top: 4px;

    color: var(--text-muted);

    font-size: 10px;
}


/* =========================================================
   CARDS
========================================================= */

.card {
    margin-bottom: 14px;

    padding: 21px;

    border: 1px solid var(--border);
    border-radius: var(--radius-lg);

    background: var(--panel);

    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.08);
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 22px;
}

.card-header h3 {
    margin-top: 4px;

    color: var(--text);

    font-size: 15px;
    font-weight: 650;

    letter-spacing: -0.25px;
}


/* =========================================================
   BADGES
========================================================= */

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 25px;

    padding: 0 9px;

    border-radius: 7px;

    background: var(--accent-soft);

    color: var(--accent-hover);

    font-size: 10px;
    font-weight: 700;
}

.badge-active {
    background: var(--success-soft);
    color: var(--success);
}

.badge-reward {
    background: var(--success-soft);
    color: var(--success);
}


/* =========================================================
   ACTIVE TRADE
========================================================= */

.active-trade-card {
    padding: 23px;
}

.trade-overview {
    display: grid;

    grid-template-columns:
        minmax(190px, 0.7fr)
        minmax(300px, 1.3fr);

    gap: 40px;

    align-items: center;

    padding-bottom: 24px;

    border-bottom: 1px solid var(--border);
}

.trade-amount {
    display: flex;
    flex-direction: column;
}

.trade-amount > span:first-child {
    color: var(--text-muted);
    font-size: 11px;
}

.trade-amount strong {
    margin-top: 5px;

    color: var(--text);

    font-size: 29px;
    font-weight: 700;

    letter-spacing: -1px;
}

.trade-amount strong small {
    color: var(--text-soft);

    font-size: 13px;
    font-weight: 600;
}

.trade-amount > span:last-child {
    width: fit-content;

    margin-top: 8px;
    padding: 4px 7px;

    border-radius: 5px;

    background: var(--accent-soft);

    color: var(--accent-hover);

    font-size: 10px;
    font-weight: 700;
}


/* Progress */

.progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 9px;

    color: var(--text-muted);

    font-size: 11px;
}

.progress-header strong {
    color: var(--text-soft);

    font-size: 11px;
}

.progress-header strong span {
    color: var(--text-muted);
    font-weight: 500;
}

.progress-track {
    height: 7px;

    overflow: hidden;

    border-radius: 10px;

    background: #1b2028;
}

.progress-fill {
    height: 100%;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            var(--accent),
            #9b87ff
        );

    box-shadow:
        0 0 16px rgba(124, 92, 255, 0.25);
}

.progress-dates {
    display: flex;
    justify-content: space-between;

    margin-top: 8px;

    color: var(--text-muted);

    font-size: 9px;
}


/* Trade Details */

.trade-details-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 12px;

    padding: 20px 0;
}

.detail-item {
    display: flex;
    flex-direction: column;

    gap: 4px;
}

.detail-item span {
    color: var(--text-muted);

    font-size: 10px;
}

.detail-item strong {
    color: var(--text-soft);

    font-size: 12px;
    font-weight: 650;
}


/* Actions */

.card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 9px;

    padding-top: 4px;
}


/* =========================================================
   DASHBOARD GRID
========================================================= */

.dashboard-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 14px;
}


/* =========================================================
   REFERRAL PREVIEW
========================================================= */

.referral-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    margin-bottom: 18px;
}

.referral-code-box {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.referral-code-box span {
    color: var(--text-muted);
    font-size: 10px;
}

.referral-code-box strong {
    color: var(--text);

    font-size: 19px;
    letter-spacing: 1px;
}


/* Mini stats */

.mini-stats {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 8px;
}

.mini-stats > div {
    padding: 11px;

    border: 1px solid var(--border);
    border-radius: 9px;

    background: var(--panel-soft);
}

.mini-stats span {
    display: block;

    color: var(--text-muted);

    font-size: 9px;
}

.mini-stats strong {
    display: block;

    margin-top: 4px;

    color: var(--text-soft);

    font-size: 12px;
}


/* =========================================================
   ACTIVITY
========================================================= */

.activity-list {
    display: flex;
    flex-direction: column;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 11px;

    padding: 11px 0;

    border-bottom: 1px solid var(--border);
}

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

.activity-item:first-child {
    padding-top: 0;
}

.activity-icon,
.history-icon {
    width: 31px;
    height: 31px;

    flex: 0 0 auto;

    display: grid;
    place-items: center;

    border-radius: 9px;

    font-size: 13px;
}

.activity-icon.trade,
.history-icon.trade {
    background: var(--accent-soft);
    color: var(--accent-hover);
}

.activity-icon.referral,
.history-icon.referral {
    background: var(--success-soft);
    color: var(--success);
}

.activity-icon.earnings,
.history-icon.earnings {
    background: var(--warning-soft);
    color: var(--warning);
}

.activity-icon.withdrawal,
.history-icon.withdrawal {
    background: var(--success-soft);
    color: var(--success);
}

.activity-content {
    min-width: 0;

    flex: 1;

    display: flex;
    flex-direction: column;
}

.activity-content strong {
    color: var(--text-soft);

    font-size: 11px;
}

.activity-content span {
    margin-top: 2px;

    color: var(--text-muted);

    font-size: 9px;
}

.activity-value {
    color: var(--text-soft);

    font-size: 11px;
}

.activity-value.positive {
    color: var(--success);
}


/* =========================================================
   TRADE PAGE
========================================================= */

.trade-page-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1.15fr)
        minmax(300px, 0.85fr);

    gap: 14px;

    align-items: start;
}


/* Amount */

.amount-input-wrapper {
    margin-bottom: 11px;
}

.amount-input-wrapper label,
.form-group label {
    display: block;

    margin-bottom: 7px;

    color: var(--text-soft);

    font-size: 11px;
    font-weight: 600;
}

.amount-input {
    display: flex;
    align-items: center;

    min-height: 57px;

    padding: 0 15px;

    border: 1px solid var(--border-light);
    border-radius: 11px;

    background: var(--panel-soft);

    transition:
        border-color var(--transition),
        box-shadow var(--transition);
}

.amount-input:focus-within {
    border-color: var(--accent-border);

    box-shadow:
        0 0 0 3px var(--accent-soft);
}

.amount-input input {
    width: 100%;

    border: 0;
    background: transparent;

    color: var(--text);

    font-size: 22px;
    font-weight: 700;

    letter-spacing: -0.5px;
}

.amount-input input::-webkit-inner-spin-button,
.amount-input input::-webkit-outer-spin-button {
    appearance: none;
    margin: 0;
}

.amount-input span {
    color: var(--text-muted);

    font-size: 12px;
    font-weight: 700;
}

.input-help {
    display: block;

    margin-top: 6px;

    color: var(--text-muted);

    font-size: 9px;
}


/* Quick amounts */

.quick-amounts {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;

    margin-bottom: 23px;
}

.quick-amounts button {
    padding: 7px 11px;

    border: 1px solid var(--border);
    border-radius: 7px;

    background: var(--panel-soft);

    color: var(--text-muted);

    font-size: 10px;
    font-weight: 600;

    transition:
        background var(--transition),
        border-color var(--transition),
        color var(--transition);
}

.quick-amounts button:hover {
    color: var(--text);
    border-color: var(--border-light);
    background: var(--panel-hover);
}


/* Form */

.form-group {
    margin-bottom: 22px;
}

.form-group label span {
    color: var(--text-muted);
    font-weight: 400;
}

.form-group input,
.referral-link-wrapper input {
    width: 100%;

    min-height: 44px;

    padding: 0 12px;

    border: 1px solid var(--border);
    border-radius: 9px;

    background: var(--panel-soft);

    color: var(--text);

    font-size: 12px;

    transition:
        border-color var(--transition),
        box-shadow var(--transition);
}

.form-group input:focus,
.referral-link-wrapper input:focus {
    border-color: var(--accent-border);

    box-shadow:
        0 0 0 3px var(--accent-soft);
}


/* Trade preview */

.trade-preview-card {
    position: sticky;
    top: 20px;
}

.preview-amount {
    display: flex;
    flex-direction: column;

    padding: 15px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--panel-soft);

    margin-bottom: 15px;
}

.preview-amount span {
    color: var(--text-muted);

    font-size: 10px;
}

.preview-amount strong {
    margin-top: 4px;

    color: var(--text);

    font-size: 22px;
    font-weight: 700;
}


/* Terms */

.terms-list {
    display: flex;
    flex-direction: column;
}

.term-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 11px 0;

    border-bottom: 1px solid var(--border);
}

.term-row:last-child {
    border-bottom: 0;
}

.term-row span {
    color: var(--text-muted);
    font-size: 11px;
}

.term-row strong {
    color: var(--text-soft);
    font-size: 11px;
}

.preview-notice {
    margin-top: 18px;
    padding: 11px;

    border-radius: 9px;

    background: var(--accent-soft);

    color: var(--text-soft);

    font-size: 10px;
    line-height: 1.6;
}


/* Confirmation */

.confirmation-card {
    margin-top: 14px;
}

.confirmation-details {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 10px;

    margin-bottom: 20px;
}

.confirmation-details > div {
    padding: 13px;

    border: 1px solid var(--border);

    border-radius: 9px;

    background: var(--panel-soft);
}

.confirmation-details span {
    display: block;

    color: var(--text-muted);

    font-size: 9px;
}

.confirmation-details strong {
    display: block;

    margin-top: 4px;

    color: var(--text-soft);

    font-size: 12px;
}


/* =========================================================
   REFERRALS
========================================================= */

.referral-link-card {
    padding-bottom: 18px;
}

.referral-link-wrapper {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.referral-link-wrapper input {
    flex: 1;
}

.referral-code-row {
    display: flex;
    align-items: center;
    gap: 8px;

    margin-top: 11px;

    color: var(--text-muted);

    font-size: 10px;
}

.referral-code-row strong {
    color: var(--text-soft);

    font-size: 11px;
    letter-spacing: 0.8px;
}

.referral-stats {
    margin-bottom: 14px;
}


/* Reward balance */

.rewards-card {
    display: flex;
    flex-direction: column;
}

.reward-balance {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.reward-balance strong {
    color: var(--success);

    font-size: 36px;
    font-weight: 700;

    letter-spacing: -1.5px;
}

.reward-balance span {
    color: var(--text-muted);

    font-size: 13px;
    font-weight: 600;
}

.rewards-card .section-description {
    margin-bottom: 17px;
}


/* Referral levels */

.referral-levels {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 8px;
}

.level-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 12px;

    border: 1px solid var(--border);
    border-radius: 9px;

    background: var(--panel-soft);
}

.level-row span {
    color: var(--text-muted);

    font-size: 10px;
}

.level-row strong {
    color: var(--text-soft);

    font-size: 11px;
}


/* =========================================================
   HISTORY
========================================================= */

.history-toolbar {
    display: flex;
    justify-content: flex-start;

    margin-bottom: 12px;
}

.history-filters {
    display: flex;
    align-items: center;
    gap: 5px;

    padding: 4px;

    border: 1px solid var(--border);

    border-radius: 9px;

    background: var(--panel-soft);
}

.filter-button {
    min-height: 30px;

    padding: 0 11px;

    border-radius: 6px;

    background: transparent;

    color: var(--text-muted);

    font-size: 10px;
    font-weight: 600;
}

.filter-button:hover {
    color: var(--text);
}

.filter-button.active {
    background: var(--panel);
    color: var(--text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}


/* History list */

.history-list {
    display: flex;
    flex-direction: column;
}

.history-date {
    padding: 4px 0 10px;

    color: var(--text-muted);

    font-size: 10px;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: 0.7px;
}

.history-date:not(:first-child) {
    padding-top: 25px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 13px;

    padding: 15px 0;

    border-bottom: 1px solid var(--border);
}

.history-item:last-child {
    border-bottom: 0;
}

.history-info {
    min-width: 0;

    flex: 1;

    display: flex;
    flex-direction: column;
}

.history-info strong {
    color: var(--text-soft);

    font-size: 12px;
}

.history-info span {
    margin-top: 2px;

    color: var(--text-muted);

    font-size: 10px;
}

.history-info small {
    margin-top: 2px;

    color: var(--text-muted);

    font-size: 9px;
}

.history-amount {
    font-size: 11px;
    font-weight: 650;

    white-space: nowrap;
}

.history-amount.positive {
    color: var(--success);
}


/* Empty */

.empty-state {
    padding: 60px 20px;

    text-align: center;
}

.empty-icon {
    width: 42px;
    height: 42px;

    display: grid;
    place-items: center;

    margin: 0 auto 12px;

    border-radius: 12px;

    background: var(--panel-soft);

    color: var(--text-muted);

    font-size: 18px;
}

.empty-state h3 {
    color: var(--text-soft);
    font-size: 14px;
}

.empty-state p {
    margin-top: 4px;

    color: var(--text-muted);
    font-size: 11px;
}


/* =========================================================
   HOW IT WORKS
========================================================= */

.steps-list {
    display: flex;
    flex-direction: column;
}

.step-card {
    display: flex;
    align-items: flex-start;
    gap: 20px;

    margin-bottom: 10px;
}

.step-number {
    width: 42px;
    height: 42px;

    flex: 0 0 auto;

    display: grid;
    place-items: center;

    border-radius: 11px;

    background: var(--accent-soft);

    color: var(--accent-hover);

    font-size: 11px;
    font-weight: 800;
}

.step-content h3 {
    margin-top: 4px;

    color: var(--text);

    font-size: 15px;
}

.step-content p:last-child {
    max-width: 680px;

    margin-top: 6px;

    color: var(--text-muted);

    font-size: 11px;
    line-height: 1.7;
}


/* Tiers */

.tiers-card {
    margin-top: 4px;
}

.tiers-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 9px;
}

.tier-card {
    display: flex;
    flex-direction: column;

    padding: 15px;

    border: 1px solid var(--border);
    border-radius: 11px;

    background: var(--panel-soft);

    transition:
        border-color var(--transition),
        background var(--transition);
}

.tier-card:hover {
    border-color: var(--accent-border);
    background: var(--panel-hover);
}

.tier-label {
    color: var(--accent-hover);

    font-size: 9px;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: 0.7px;
}

.tier-card strong {
    margin-top: 7px;

    color: var(--text);

    font-size: 13px;
}

.tier-card > span:not(.tier-label) {
    margin-top: 5px;

    color: var(--text-muted);

    font-size: 9px;
}


/* Info */

.info-card {
    display: flex;
    align-items: flex-start;
    gap: 13px;

    margin-top: 14px;

    background:
        linear-gradient(
            90deg,
            rgba(124, 92, 255, 0.06),
            transparent
        );
}

.info-icon {
    width: 30px;
    height: 30px;

    flex: 0 0 auto;

    display: grid;
    place-items: center;

    border-radius: 8px;

    background: var(--accent-soft);

    color: var(--accent-hover);

    font-weight: 700;
}

.info-card h3 {
    color: var(--text-soft);
    font-size: 12px;
}

.info-card p {
    max-width: 760px;

    margin-top: 4px;

    color: var(--text-muted);

    font-size: 10px;
    line-height: 1.7;
}


/* =========================================================
   MODAL
========================================================= */

.modal-overlay {
    position: fixed;
    z-index: 1000;

    inset: 0;

    display: grid;
    place-items: center;

    padding: 20px;

    background: rgba(0, 0, 0, 0.7);

    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}

.modal-overlay[hidden] {
    display: none;
}

.modal {
    position: relative;

    width: 100%;
    max-width: 400px;

    padding: 28px;

    border: 1px solid var(--border-light);
    border-radius: 20px;

    background: #11151b;

    box-shadow: var(--shadow);

    animation: modalIn 180ms ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }

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

.modal-close {
    position: absolute;

    top: 13px;
    right: 13px;

    width: 30px;
    height: 30px;

    display: grid;
    place-items: center;

    border-radius: 8px;

    background: var(--panel-soft);

    color: var(--text-muted);

    font-size: 19px;
}

.modal-close:hover {
    color: var(--text);
    background: var(--panel-hover);
}

.modal-icon {
    width: 45px;
    height: 45px;

    display: grid;
    place-items: center;

    margin-bottom: 18px;

    border-radius: 13px;

    background: var(--accent-soft);

    color: var(--accent-hover);

    font-weight: 800;
}

.modal h2 {
    color: var(--text);

    font-size: 20px;
    letter-spacing: -0.5px;
}

.modal > p {
    margin-top: 7px;

    color: var(--text-muted);

    font-size: 11px;
    line-height: 1.7;
}

.wallet-options {
    display: flex;
    flex-direction: column;
    gap: 8px;

    margin-top: 22px;
}

.wallet-option {
    width: 100%;

    display: flex;
    align-items: center;
    gap: 11px;

    padding: 12px;

    border: 1px solid var(--border);
    border-radius: 11px;

    background: var(--panel-soft);

    color: var(--text);

    text-align: left;

    transition:
        background var(--transition),
        border-color var(--transition);
}

.wallet-option:hover {
    background: var(--panel-hover);
    border-color: var(--accent-border);
}

.wallet-option-icon {
    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    border-radius: 9px;

    background: var(--accent-soft);

    color: var(--accent-hover);

    font-size: 11px;
    font-weight: 800;
}

.wallet-option > span:nth-child(2) {
    flex: 1;

    display: flex;
    flex-direction: column;
}

.wallet-option strong {
    font-size: 11px;
}

.wallet-option small {
    margin-top: 2px;

    color: var(--text-muted);

    font-size: 9px;
}


/* =========================================================
   TOAST
========================================================= */

.toast {
    position: fixed;
    z-index: 2000;

    right: 22px;
    bottom: 22px;

    display: flex;
    align-items: center;
    gap: 9px;

    padding: 11px 14px;

    border: 1px solid var(--border-light);
    border-radius: 10px;

    background: #151a21;

    box-shadow: var(--shadow);

    animation: toastIn 180ms ease;
}

.toast[hidden] {
    display: none;
}

.toast-icon {
    width: 22px;
    height: 22px;

    display: grid;
    place-items: center;

    border-radius: 7px;

    background: var(--success-soft);

    color: var(--success);

    font-size: 10px;
}

.toast-message {
    color: var(--text-soft);

    font-size: 11px;
    font-weight: 600;
}

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

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


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1100px) {

    :root {
        --sidebar-width: 220px;
    }

    .main-content {
        padding-left: 25px;
        padding-right: 25px;
    }

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

    .trade-details-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

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

    .referral-levels {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}


@media (max-width: 850px) {

    .sidebar {
        width: 210px;

        transform: translateX(-100%);

        transition:
            transform 220ms ease;
    }

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

    .mobile-header {
        position: fixed;
        z-index: 90;

        top: 0;
        left: 0;
        right: 0;

        height: 62px;

        display: flex;
        align-items: center;
        justify-content: space-between;

        padding: 0 16px;

        border-bottom: 1px solid var(--border);

        background: rgba(9, 11, 15, 0.92);

        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }

    .main-content {
        width: 100%;
        margin-left: 0;

        padding:
            90px
            18px
            50px;
    }

    .topbar {
        display: none;
    }

    .menu-button {
        width: 36px;
        height: 36px;

        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 4px;

        padding: 9px;

        border-radius: 9px;

        background: var(--panel);

        border: 1px solid var(--border);

        color: var(--text);
    }

    .menu-button span {
        width: 100%;
        height: 1.5px;

        background: var(--text-soft);

        border-radius: 2px;
    }

    .mobile-brand {
        display: flex;
        align-items: center;
        gap: 8px;

        color: var(--text);

        font-size: 13px;
        font-weight: 700;
    }

    .mobile-brand-mark {
        width: 29px;
        height: 29px;

        display: grid;
        place-items: center;

        border-radius: 8px;

        background: var(--accent);

        font-size: 9px;
        font-weight: 800;
    }

    .mobile-wallet-button {
        width: 36px;
        height: 36px;

        border: 1px solid var(--border);
        border-radius: 9px;

        background: var(--panel);

        color: var(--accent-hover);

        font-size: 10px;
        font-weight: 800;
    }

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

    .trade-preview-card {
        position: static;
    }
}


@media (max-width: 600px) {

    body {
        font-size: 13px;
    }

    .main-content {
        padding:
            82px
            13px
            40px;
    }

    .welcome-section {
        flex-direction: column;
        align-items: stretch;
    }

    .welcome-section h2,
    .tab-intro h2 {
        font-size: 23px;
    }

    .welcome-section .primary-button {
        width: 100%;
    }

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

        gap: 8px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-value {
        font-size: 17px;
    }

    .stat-card-header {
        font-size: 9px;
    }

    .trade-overview {
        grid-template-columns: 1fr;

        gap: 25px;
    }

    .trade-amount strong {
        font-size: 25px;
    }

    .trade-details-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .card {
        padding: 17px;

        border-radius: 15px;
    }

    .card-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .card-actions button {
        width: 100%;
    }

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

    .referral-preview {
        flex-direction: column;
        align-items: stretch;
    }

    .referral-preview .secondary-button {
        width: 100%;
    }

    .confirmation-details {
        grid-template-columns: 1fr;
    }

    .referral-link-wrapper {
        flex-direction: column;
    }

    .referral-link-wrapper .primary-button {
        width: 100%;
    }

    .referral-code-row {
        flex-wrap: wrap;
    }

    .referral-levels {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

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

    .step-card {
        gap: 13px;
    }

    .step-number {
        width: 36px;
        height: 36px;
    }

    .history-filters {
        width: 100%;

        overflow-x: auto;

        scrollbar-width: none;
    }

    .history-filters::-webkit-scrollbar {
        display: none;
    }

    .filter-button {
        flex: 0 0 auto;
    }

    .history-item {
        align-items: flex-start;
    }

    .history-amount {
        font-size: 10px;
    }

    .toast {
        right: 12px;
        left: 12px;
        bottom: 12px;
    }
}


@media (max-width: 380px) {

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

    .trade-details-grid {
        grid-template-columns: 1fr;
    }

    .referral-levels {
        grid-template-columns: 1fr;
    }

    .wallet-network {
        display: none;
    }
}


/* =========================================================
   ACCESSIBILITY
========================================================= */

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


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

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