.auth-overlay {
    position: fixed;
    top: 0;
    left: 250px; 
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: all 0.3s ease;
    pointer-events: none; /* Клики проходят сквозь оверлей к кнопке меню */
}

.auth-card {
    max-width: 420px;
    background: #ffffff;
    border: 1px solid #e5e5e7;
    border-radius: 16px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    pointer-events: auto; /* Возвращаем кликабельность элементам внутри карточки */
}

.auth-card h1 {
    font-size: 28px;
    font-weight: 800;
    color: #2481cc;
    margin: 0 0 15px 0;
}

.auth-card p {
    font-size: 14px;
    line-height: 1.6;
    color: #707579;
    margin: 0 0 30px 0;
}

.connect-btn {
    background-color: #2481cc;
    color: #ffffff;
    border: none;
    padding: 14px 40px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.2s ease;
}

.connect-btn:hover {
    background-color: #1e71b3;
}

.blur-content {
    filter: blur(5px);
    pointer-events: none;
    user-select: none;
}

.dashboard-header-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: #f4f4f5;
    padding: 15px 25px;
    border-radius: 12px;
    border: 1px solid #e5e5e7;
}

.meta-label, .status-label {
    font-size: 12px;
    color: #707579;
    font-weight: 700;
    margin-right: 5px;
}

.meta-value, .status-value {
    font-size: 15px;
    font-weight: 800;
    color: #000000;
}

.status-value {
    color: #2481cc;
}

.sub-badge {
    font-size: 12px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 20px;
}
.sub-badge.expired {
    background: #fbe9e7;
    color: #d84315;
}
.sub-badge.active {
    background: #e8f5e9;
    color: #2e7d32;
}

.control-bar {
    background: #ffffff;
    border: 1px solid #e5e5e7;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.wallet-bar-info {
    flex: 1;
    min-width: 200px;
}

.wallet-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #707579;
    margin-bottom: 4px;
}

.wallet-bar-info code {
    font-family: monospace;
    font-size: 14px;
    color: #2481cc;
    font-weight: 600;
    word-break: break-all;
    white-space: normal;
    display: block;
}

/* Группа кнопок управления подпиской и возвратом */
.sub-btn-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 240px;
}

.sub-action-btn {
    background: #2481cc;
    color: #ffffff;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: center;
}

.sub-action-btn:hover {
    background: #1e71b3;
}

.refund-btn {
    background: #fbe9e7;
    color: #c62828;
    border: 1px solid #ffcdd2;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: center;
}

.refund-btn:hover {
    background: #ffcdd2;
}

.balances-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.balance-card {
    background: #ffffff;
    border: 1px solid #e5e5e7;
    border-radius: 14px;
    padding: 25px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.action-card {
    border: 2px solid #2481cc;
    background: #fcfdfe;
}

.hold-card {
    background: #fafafa;
}

.bal-icon {
    font-size: 28px;
    margin-bottom: 10px;
}

.bal-title {
    font-size: 12px;
    font-weight: 800;
    color: #707579;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.bal-value {
    font-size: 22px;
    font-weight: 800;
    color: #000000;
    margin-bottom: 10px;
}

.bal-value.highlighted {
    color: #2481cc;
}

.bal-desc {
    font-size: 12px;
    line-height: 1.4;
    color: #707579;
}

.action-btn {
    background: #2481cc;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    margin-top: 15px;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.2s;
}

.action-btn:hover {
    background: #1e71b3;
}

.referrals-section, .transactions-section {
    background: #ffffff;
    border: 1px solid #e5e5e7;
    border-radius: 14px;
    padding: 30px;
    margin-bottom: 40px;
}

.referrals-section h2, .transactions-section h2 {
    font-size: 16px;
    font-weight: 800;
    margin: 0 0 25px 0;
    color: #000000;
    letter-spacing: 0.5px;
}

.ref-stats-row {
    display: flex;
    gap: 30px;
    align-items: center;
    flex-wrap: wrap;
}

.ref-stat-box {
    background: #f4f4f5;
    border: 1px solid #e5e5e7;
    padding: 15px 25px;
    border-radius: 10px;
    text-align: center;
    min-width: 120px;
}

.ref-num {
    display: block;
    font-size: 26px;
    font-weight: 800;
    color: #2481cc;
}

.ref-text {
    font-size: 12px;
    color: #707579;
    font-weight: 600;
}

.ref-info-text {
    flex-grow: 1;
    font-size: 13px;
    line-height: 1.5;
    color: #707579;
    max-width: 500px;
}

.table-container {
    overflow-x: auto;
}

.tx-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.tx-table th {
    padding: 12px 15px;
    color: #707579;
    font-weight: 700;
    font-size: 12px;
    border-bottom: 1px solid #e5e5e7;
    text-transform: uppercase;
}

.tx-table td {
    padding: 14px 15px;
    border-bottom: 1px solid #f4f4f5;
    vertical-align: middle;
}

.tx-type {
    font-weight: 700;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
}

.tx-type.deposit {
    background: #e8f3fc;
    color: #2481cc;
}

.tx-target {
    font-weight: 600;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
}

.tx-target.hold {
    background: #fff3e0;
    color: #e65100;
}

.tx-target.available {
    background: #e8f5e9;
    color: #1b5e20;
}

.tx-time {
    color: #707579;
    font-size: 13px;
}

@media (max-width: 768px) {
    .auth-overlay {
        left: 0; 
    }
    .dashboard-header-block {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .control-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .sub-btn-group {
        width: 100%;
    }
    .referrals-section, .transactions-section {
        padding: 20px;
    }
    .ref-stats-row {
        flex-direction: column;
        align-items: fill;
        width: 100%;
    }
    .ref-stat-box {
        width: 100%;
        box-sizing: border-box;
    }
}

.ref-link-wrapper {
    width: 100%;
    margin-top: 12px;
}

.ref-link-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.ref-link-row code {
    font-family: monospace;
    font-size: 13.5px;
    color: #2e7d32 !important; /* Выделим ссылку приятным зеленым цветом */
    background: #e8f5e9;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #c8e6c9;
    word-break: break-all;
    white-space: normal;
    flex: 1;
}

.copy-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    transition: transform 0.1s ease;
}

.copy-icon-btn:active {
    transform: scale(0.9);
}

