.glass-panel,
.auth-box,
.profile-card,
.orders-section,
.stat-box,
.ref-link-box,
.tools-link-box,
.tools-email-box {
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-sm);
}

.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 180px);
    padding: 18px 0;
}

.auth-box {
    width: min(380px, 100%);
    padding: 30px 24px;
    text-align: center;
}

.auth-icon,
.profile-avatar,
.stat-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    background: #f3f8f1;
    border: 1px solid #cfe2cd;
}

.auth-icon {
    width: 54px;
    height: 54px;
    margin: 0 auto 16px;
    border-radius: 16px;
}

.auth-title {
    margin: 0 0 8px;
    color: var(--text-primary);
    font-size: 1.5rem;
    letter-spacing: -0.035em;
}

.auth-subtitle {
    margin: 0 0 22px;
    color: var(--text-secondary);
}

.partner-access-note {
    display: grid;
    gap: 10px;
    margin: -6px 0 20px;
    padding: 13px;
    color: var(--text-secondary);
    border: 1px solid #d8e4d5;
    border-radius: 16px;
    background: #f7fbf4;
    text-align: left;
}

.partner-access-note p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.45;
}

.partner-access-note__btn {
    justify-self: start;
    padding: 0;
    color: var(--accent-primary);
    border: 0;
    background: transparent;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.partner-access-note__btn:hover {
    text-decoration: underline;
}

.auth-form {
    display: grid;
    gap: 13px;
    text-align: left;
}

.auth-form .field {
    display: grid;
    gap: 6px;
}

.auth-form label {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 950;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.auth-form input,
.ref-link-input,
.withdraw-input {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    outline: none;
    background: #fbfcf7;
}

.auth-form input:focus,
.ref-link-input:focus,
.withdraw-input:focus {
    border-color: var(--border-hover);
    box-shadow: 0 0 0 4px rgba(47, 125, 91, 0.1);
}

.dashboard-wrapper {
    width: min(1080px, 100%);
    margin: 0 auto;
    padding: 20px 0 34px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.profile-card,
.orders-section { padding: 20px; }

.profile-card--toolbar {
    display: grid;
    grid-template-columns: minmax(150px, auto) minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
}

.profile-identity {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.profile-card--toolbar .profile-name {
    flex: 0 1 auto;
    margin: 0;
    overflow: hidden;
    font-size: 1rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-percent {
    flex: 0 0 auto;
    width: fit-content;
    margin-top: 0;
    padding: 4px 7px;
    color: var(--accent-primary);
    border: 1px solid rgba(var(--accent-rgb), 0.28);
    border-radius: 6px;
    background: rgba(var(--accent-rgb), 0.08);
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1.25;
    white-space: nowrap;
}

.profile-card--toolbar .ref-link-box {
    display: flex;
    align-items: center;
    min-width: 0;
    margin: 0;
    padding: 9px 11px;
    gap: 9px;
}

.profile-card--toolbar .ref-link-label {
    flex: 0 0 auto;
    width: auto;
    font-size: 10px;
    white-space: nowrap;
}

.profile-card--toolbar .ref-link-val {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    overflow: hidden;
    font-size: 0.82rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-actions,
.profile-actions form {
    margin: 0;
}

.profile-actions {
    grid-column: auto;
    grid-row: auto;
}

.profile-card--toolbar .btn-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 96px;
    min-height: 38px;
    padding: 0 13px;
    font-size: 0.82rem;
    white-space: nowrap;
}

.dashboard-main {
    width: 100%;
    min-width: 0;
}

.profile-name,
.orders-title,
.stats-title {
    color: var(--text-primary);
    font-weight: 950;
    letter-spacing: -0.035em;
}

.profile-role {
    display: inline-flex;
    margin-top: 8px;
    padding: 5px 9px;
    color: var(--accent-primary);
    border: 1px solid #cfe2cd;
    border-radius: 999px;
    background: #f3f8f1;
    font-size: 12px;
    font-weight: 900;
}

.ref-link-box {
    display: grid;
    gap: 8px;
    margin: 18px 0;
    padding: 14px;
    cursor: pointer;
}

.ref-link-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 900;
}

.ref-link-val {
    color: var(--accent-primary);
    font-weight: 850;
    word-break: break-all;
}

.btn-logout {
    display: block;
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: #fff;
    color: var(--text-primary);
    font-weight: 900;
    text-decoration: none;
}

.stats-container,
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.stat-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
}

.stat-icon-wrap {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 14px;
}

.stat-label {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 950;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.stat-value {
    margin-top: 5px;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 950;
}

.stat-value.highlight,
.order-reward-compact { color: var(--accent-primary); }

.withdraw-section {
    margin-bottom: 14px;
    padding: 20px;
}

.withdraw-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.withdraw-header .orders-title,
.withdraw-history h4 {
    margin: 0;
}

.withdraw-summary,
.withdraw-subvalue {
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 12px;
}

.withdraw-form {
    display: grid;
    grid-template-columns: minmax(170px, 0.8fr) minmax(260px, 1.4fr) minmax(140px, 0.6fr) auto;
    gap: 12px;
    align-items: end;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: #fbfcf7;
}

.withdraw-field {
    display: grid;
    gap: 6px;
}

.withdraw-field label {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

select.withdraw-input {
    appearance: auto;
}

.withdraw-submit {
    min-height: 48px;
    white-space: nowrap;
}

.withdraw-submit:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.withdraw-history {
    margin-top: 18px;
}

.withdraw-history h4 {
    margin-bottom: 10px;
    color: var(--text-primary);
}

.withdraw-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.withdraw-table {
    width: 100%;
    border-collapse: collapse;
}

.withdraw-table th,
.withdraw-table td {
    padding: 10px 9px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 12px;
    text-align: left;
    vertical-align: middle;
}

.withdraw-table th {
    color: var(--text-muted);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.withdraw-wallet {
    max-width: 280px;
    overflow-wrap: anywhere;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.withdraw-status {
    display: inline-flex;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.withdraw-status.pending { color: #b7791f; background: rgba(234, 179, 8, 0.1); }
.withdraw-status.processing { color: #2563eb; background: rgba(59, 130, 246, 0.1); }
.withdraw-status.paid { color: #15803d; background: rgba(34, 197, 94, 0.1); }
.withdraw-status.rejected,
.withdraw-status.cancelled { color: #b91c1c; background: rgba(239, 68, 68, 0.1); }

.orders-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.empty-state {
    padding: 16px;
    color: var(--text-secondary);
    border: 1px dashed var(--border-color);
    border-radius: 14px;
    background: #fbfcf7;
}

.order-head,
.order-item {
    display: grid;
    grid-template-columns: 90px minmax(260px, 1fr) 140px 120px 70px;
    gap: 14px;
    align-items: center;
}

.order-head {
    padding: 0 14px 10px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 950;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.head-amount,
.head-reward,
.order-amount-compact,
.order-reward-compact {
    text-align: right;
}

.head-status {
    text-align: center;
}

.order-list {
    display: grid;
    gap: 8px;
}

.order-item {
    min-height: 54px;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: #fbfcf7;
}

.order-item > .badge {
    justify-self: center;
}

.tg-date-separator {
    display: flex;
    margin: 10px 0 4px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 900;
}

.pair-cell,
.order-pair-compact {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    flex-wrap: wrap;
}

.pair-token {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 7px;
    color: var(--text-primary);
    border: 1px solid #d5e5d2;
    border-radius: 11px;
    background: #fff;
    font-weight: 850;
}

.pair-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.arr {
    color: var(--text-muted);
    font-weight: 900;
}

.order-time,
.order-amount-compact {
    color: var(--text-secondary);
    font-weight: 850;
}

.badge svg {
    width: 14px;
    height: 14px;
}

@media (max-width: 980px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .stats-container,
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .withdraw-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .order-head { display: none; }
    .order-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

@media (max-width: 640px) {
    .profile-card--toolbar,
    .stats-container,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .profile-card--toolbar {
        gap: 12px;
        padding: 12px;
    }

    .profile-card--toolbar .ref-link-box,
    .profile-actions {
        grid-column: auto;
        grid-row: auto;
    }

    .profile-card--toolbar .btn-logout {
        width: 100%;
    }

    .withdraw-form {
        grid-template-columns: 1fr;
    }
}
