/* ============================================
   ПЕРЕМЕННЫЕ
   ============================================ */
   :root {
    --green: #1a7a4c;
    --red: #c41e1e;
    --gold: #d4a017;
    --orange: #e8751a;
    --dark: #0f0f0f;
    --card: #1a1a1a;
    --border: #2a2a2a;
    --text: #e8e8e8;
    --muted: #888;
    --radius: 12px;
}

/* ============================================
   БАЗОВЫЙ СБРОС
   ============================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--dark);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================
   ШАПКА
   ============================================ */
.header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
}

.logo span {
    background: linear-gradient(90deg, var(--gold), var(--orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-badge {
    font-size: 0.6rem;
    background: var(--green);
    color: #fff;
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-weight: 600;
    text-transform: uppercase;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--orange));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #1a1a1a;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-status {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-weight: 600;
}

.user-status.active {
    background: rgba(26, 122, 76, 0.25);
    color: #4ade80;
    border: 1px solid rgba(26, 122, 76, 0.4);
}

.user-status.frozen {
    background: rgba(196, 30, 30, 0.25);
    color: #f87171;
    border: 1px solid rgba(196, 30, 30, 0.4);
}

.header-balance {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(212, 160, 23, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    border: 1px solid rgba(212, 160, 23, 0.2);
}

.balance-value {
    font-weight: 700;
    color: var(--gold);
    font-size: 0.9rem;
}

.logout-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 0.4rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    border-color: var(--red);
    color: #fff;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

/* ============================================
   ДАШБОРД
   ============================================ */
.dashboard {
    display: flex;
    min-height: calc(100vh - 70px);
}

/* ============================================
   САЙДБАР
   ============================================ */
.sidebar {
    width: 220px;
    background: var(--card);
    border-right: 1px solid var(--border);
    padding: 2rem 0;
    flex-shrink: 0;
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    padding: 0.6rem 1.5rem;
    margin: 0.2rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-menu li:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

.sidebar-menu li.active {
    background: rgba(212, 160, 23, 0.15);
    color: var(--gold);
    border-left: 3px solid var(--gold);
    border-radius: 0 8px 8px 0;
    margin-left: 0;
    padding-left: 1.2rem;
}

.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 1rem 1.5rem;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    font-size: 0.7rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
}

.overlay {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 150;
}

.overlay.show {
    display: block;
}

/* ============================================
   ОСНОВНОЙ КОНТЕНТ
   ============================================ */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: calc(100% - 220px);
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
}

.page-header p {
    color: var(--muted);
    font-size: 0.95rem;
}

/* ============================================
   КАРТОЧКИ
   ============================================ */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: rgba(212, 160, 23, 0.3);
    transform: translateY(-2px);
}

.stat-card .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    margin-top: 0.25rem;
}

.stat-card .value.gold {
    background: linear-gradient(135deg, var(--gold), var(--orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card .value.green { color: #4ade80; }
.stat-card .sub {
    font-size: 0.8rem;
    color: var(--muted);
}

/* ============================================
   ПРОГРЕСС-БАР
   ============================================ */
.balance-bar {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.balance-bar .top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.balance-bar .label {
    font-size: 0.85rem;
    color: var(--muted);
}

.balance-bar .value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
}

.progress-track {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--gold), var(--orange));
    transition: width 0.8s ease;
}

.progress-fill.danger {
    background: linear-gradient(90deg, var(--red), #f87171);
}

.progress-fill.warning {
    background: linear-gradient(90deg, var(--orange), var(--gold));
}

.balance-bar .bottom {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--muted);
}

/* ============================================
   КНОПКИ
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--orange));
    color: #1a1a1a;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 160, 23, 0.3);
}

.btn-success {
    background: var(--green);
    color: #fff;
}

.btn-success:hover {
    background: #15603c;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
}

.quick-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

/* ============================================
   АЛЕРТЫ
   ============================================ */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.alert-warning {
    background: rgba(232, 117, 26, 0.15);
    border: 1px solid rgba(232, 117, 26, 0.3);
    color: var(--orange);
}

.alert-danger {
    background: rgba(196, 30, 30, 0.15);
    border: 1px solid rgba(196, 30, 30, 0.3);
    color: #f87171;
}

/* ============================================
   СТАТИСТИКА ТАБЛИЦА
   ============================================ */
.stats-table-wrap {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
}

.stats-table th {
    text-align: left;
    padding: 1rem 1.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
}

.stats-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.stats-table tr:last-child td {
    border-bottom: none;
}

.stats-table tr:hover td {
    background: rgba(255,255,255,0.02);
}

.partner-tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(212, 160, 23, 0.15);
    color: var(--gold);
}

.partner-tag.seo { background: rgba(26, 122, 76, 0.15); color: #4ade80; }
.partner-tag.soc { background: rgba(232, 117, 26, 0.15); color: var(--orange); }
.partner-tag.wmr { background: rgba(196, 30, 30, 0.15); color: #f87171; }

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
}

.status-badge.success { background: rgba(26, 122, 76, 0.2); color: #4ade80; }
.status-badge.warning { background: rgba(232, 117, 26, 0.2); color: var(--orange); }
.status-badge.danger { background: rgba(196, 30, 30, 0.2); color: #f87171; }

.stats-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ============================================
   РЕФЕРАЛЬНЫЕ ССЫЛКИ
   ============================================ */
.ref-links {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.ref-link-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.ref-link-item .site {
    font-weight: 600;
    font-size: 0.85rem;
    color: #fff;
    white-space: nowrap;
}

.ref-link-item .link {
    font-size: 0.75rem;
    color: var(--gold);
    font-family: 'Courier New', monospace;
    word-break: break-all;
    flex: 1;
    min-width: 150px;
}

.ref-link-item .copy-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.ref-link-item .copy-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.ref-tip {
    padding: 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--muted);
    font-size: 0.85rem;
}

/* ============================================
   TELEGRAM
   ============================================ */
.telegram-block {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
}

.telegram-block .icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.telegram-block h3 {
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.telegram-block p {
    color: var(--muted);
    font-size: 0.9rem;
    max-width: 500px;
    margin: 0 auto 1.25rem;
}

.telegram-note {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.75rem;
}

.telegram-status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
}

.telegram-status.success {
    background: rgba(26, 122, 76, 0.1);
    border: 1px solid rgba(26, 122, 76, 0.3);
    color: #4ade80;
}

/* ============================================
   ПРОФИЛЬ
   ============================================ */
.profile-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 500px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--orange));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
}

.profile-name {
    font-weight: 700;
    font-size: 1.3rem;
    color: #fff;
}

.profile-meta {
    font-size: 0.85rem;
    color: var(--muted);
}

.profile-details {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

.profile-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.profile-row:last-child {
    border-bottom: none;
}

.profile-label {
    color: var(--muted);
}

.profile-value {
    color: #fff;
    font-weight: 600;
}

.profile-value.gold {
    color: var(--gold);
}

.profile-value.status-active { color: #4ade80; }
.profile-value.status-frozen { color: #f87171; }

.profile-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn.danger {
    border-color: rgba(196, 30, 30, 0.4);
    color: #f87171;
}

.btn.danger:hover {
    border-color: var(--red);
    color: #fff;
}

/* ============================================
   FAQ
   ============================================ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 700px;
}

.faq-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
}

.faq-item h4 {
    color: #fff;
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.faq-item p {
    color: var(--muted);
    font-size: 0.9rem;
}

/* ============================================
   ФУТЕР
   ============================================ */
.footer {
    padding: 2rem 2rem 1.5rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

.footer-content {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    font-size: 0.8rem;
    color: #555;
}

.footer-content p {
    margin-bottom: 0.5rem;
}

.footer-links {
    margin-top: 0.75rem;
}

.footer-links a {
    color: var(--muted);
    text-decoration: underline;
}

.footer-links span {
    margin: 0 0.5rem;
}

/* ============================================
   АДАПТИВ
   ============================================ */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .sidebar {
        display: none;
        position: fixed;
        top: 70px;
        left: 0;
        width: 260px;
        height: calc(100vh - 70px);
        z-index: 200;
        box-shadow: 4px 0 30px rgba(0,0,0,0.5);
    }

    .sidebar.mobile-open {
        display: flex;
        animation: slideIn 0.3s ease;
    }

    @keyframes slideIn {
        from { transform: translateX(-100%); }
        to { transform: translateX(0); }
    }

    .main-content {
        max-width: 100%;
        padding: 1rem;
    }

    .header {
        padding: 0 1rem;
    }

    .header-user .user-name {
        display: none;
    }

    .cards-grid {
        grid-template-columns: 1fr 1fr;
    }

    .ref-link-item {
        flex-direction: column;
        align-items: stretch;
    }

    .ref-link-item .link {
        width: 100%;
        font-size: 0.7rem;
    }

    .stats-table-wrap {
        overflow-x: auto;
    }

    .stats-table {
        font-size: 0.8rem;
        min-width: 500px;
    }

    .stats-table th,
    .stats-table td {
        padding: 0.7rem 1rem;
    }
}

@media (max-width: 480px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }

    .header-right {
        gap: 0.75rem;
    }

    .logout-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }

    .page-header h1 {
        font-size: 1.3rem;
    }

    .profile-card {
        padding: 1.5rem;
    }
}
/* Добавить в конец файла */
.main-content.full-width {
  max-width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 2rem;
}
/* Системные сообщения */
.chat-message.system {
  background: rgba(212, 160, 23, 0.05);
  border-color: rgba(212, 160, 23, 0.2);
}

.chat-message-avatar.system-avatar {
  background: rgba(212, 160, 23, 0.2);
  color: var(--gold);
  font-size: 1.2rem;
}

.chat-message-author.system-author {
  color: var(--gold);
}

.chat-message-text.system-text {
  color: #d4a017;
  font-style: italic;
}
/* ============================================
   МОБИЛЬНАЯ ШАПКА
   ============================================ */
   .desktop-only {
    display: flex;
}

.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: flex !important;
    }
    
    .header-right {
        gap: 0.5rem;
    }
    
    .logout-btn.mobile-only {
        background: transparent;
        border: 1px solid var(--border);
        color: var(--muted);
        padding: 0.3rem 0.6rem;
        border-radius: 6px;
        cursor: pointer;
        font-size: 0.9rem;
        transition: all 0.3s ease;
        line-height: 1;
    }
    
    .logout-btn.mobile-only:hover {
        border-color: var(--red);
        color: #fff;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0 0.75rem;
        height: 60px;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .logo-badge {
        font-size: 0.5rem;
        padding: 0.1rem 0.4rem;
    }
    
    .mobile-menu-btn {
        font-size: 1.2rem;
    }
}
/* ============================================
   БЕСПЛАТНЫЕ РЕФЕРАЛЫ (HELP)
   ============================================ */
.free-referrals-block {
    display: flex;
    gap: 1.5rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    border-left: 4px solid var(--gold);
    transition: all 0.3s ease;
}

.free-referrals-block:hover {
    border-color: rgba(212, 160, 23, 0.4);
}

.free-referrals-icon {
    font-size: 3rem;
    flex-shrink: 0;
    line-height: 1;
}

.free-referrals-content h3 {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.free-referrals-content p {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.free-referrals-content p strong {
    color: #fff;
}

.free-referrals-conditions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.condition-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(0,0,0,0.2);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--muted);
}

.condition-item strong {
    color: #fff;
}

.condition-icon {
    font-size: 1.1rem;
}

.free-referrals-note {
    padding: 0.75rem 1rem;
    background: rgba(212, 160, 23, 0.08);
    border: 1px solid rgba(212, 160, 23, 0.15);
    border-radius: 6px;
    color: var(--gold);
    font-size: 0.9rem;
}

.free-referrals-note strong {
    color: #fff;
}

/* Адаптив */
@media (max-width: 768px) {
    .free-referrals-block {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.5rem;
    }
    
    .free-referrals-conditions {
        grid-template-columns: 1fr;
        width: 100%;
    }
    
    .condition-item {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .free-referrals-block {
        padding: 1.25rem;
    }
    
    .free-referrals-icon {
        font-size: 2.5rem;
    }
    
    .free-referrals-content h3 {
        font-size: 1rem;
    }
}