/* ============================================================ */
/* style.css — AutoAds v4.0.2 Премиум-дизайн                    */
/* ============================================================ */

:root {
    /* Светлая тема */
    --bg-page: #f0f2f8;
    --bg-card: #ffffff;
    --bg-card-hover: #f8f9fc;
    --bg-input: #f0f2f8;
    --bg-nav: rgba(255, 255, 255, 0.92);
    --bg-modal: rgba(0, 0, 0, 0.4);
    --bg-overlay: rgba(255, 255, 255, 0.85);
    
    --text-primary: #1a1a2e;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --text-white: #ffffff;
    
    --border-color: #e8ecf2;
    --border-light: #d5d9e0;
    
    --primary: #6D5DF6;
    --primary-hover: #5a4ad9;
    --primary-light: rgba(109, 93, 246, 0.12);
    --primary-glow: rgba(109, 93, 246, 0.25);
    
    --success: #22C55E;
    --success-bg: rgba(34, 197, 94, 0.12);
    --danger: #EF4444;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --warning: #F59E0B;
    --warning-bg: rgba(245, 158, 11, 0.12);
    
    --radius: 16px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --radius-full: 9999px;
    
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-nav: 0 -4px 24px rgba(0, 0, 0, 0.04);
    --shadow-modal: 0 24px 64px rgba(0, 0, 0, 0.15);
    
    --transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-spring: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    
    --font: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
}

[data-theme="dark"] {
    --bg-page: #09090B;
    --bg-card: #121318;
    --bg-card-hover: #1A1B24;
    --bg-input: #1A1B24;
    --bg-nav: rgba(18, 19, 24, 0.92);
    --bg-modal: rgba(0, 0, 0, 0.6);
    --bg-overlay: rgba(9, 9, 11, 0.9);
    
    --text-primary: #FFFFFF;
    --text-secondary: #8E8E93;
    --text-muted: #5C5C62;
    
    --border-color: #1E1E26;
    --border-light: #2A2A34;
    
    --primary: #6D5DF6;
    --primary-hover: #8C7CFF;
    --primary-light: rgba(109, 93, 246, 0.15);
    --primary-glow: rgba(109, 93, 246, 0.3);
    
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 8px 40px rgba(109, 93, 246, 0.08);
    --shadow-nav: 0 -4px 24px rgba(0, 0, 0, 0.6);
    --shadow-modal: 0 24px 64px rgba(0, 0, 0, 0.6);
}

/* ============================================================ */
/* БАЗА                                                         */
/* ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    font-family: var(--font);
    background: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 12px 12px 80px 12px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background 0.3s, color 0.3s;
}

.app {
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
}

/* ===== СКРОЛЛ ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg-page); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

/* ===== СТРАНИЦЫ ===== */
.page {
    display: none;
    animation: fadeSlide 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.page.active { display: block; }

@keyframes fadeSlide {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================ */
/* АВТОРИЗАЦИЯ                                                  */
/* ============================================================ */

#page-auth.auth-page {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    border-radius: var(--radius) !important;
    
    background-color: #08080e !important;
    background: url('/assets/images/auth-bg.jpg') no-repeat center center !important;
    background-size: cover !important;
    
    display: none !important;
}

#page-auth.auth-page.active {
    display: flex !important;
}

/* ===== КАРТОЧКА ===== */
#page-auth.auth-page .auth-screen {
    position: relative !important;
    z-index: 1 !important;
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 480px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 32px 28px !important;
    min-height: auto !important;
    text-align: center !important;
    
    background: rgba(18, 20, 30, 0.65) !important;
    border-radius: 20px !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 
        inset 0 1px rgba(255, 255, 255, 0.08),
        0 16px 32px rgba(0, 0, 0, 0.15) !important;
    
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

/* ===== ИКОНКА ===== */
#page-auth.auth-page .auth-icon {
    font-size: 52px !important;
    margin-bottom: 10px !important;
    display: block !important;
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@media (prefers-reduced-motion: no-preference) {
    #page-auth.auth-page .auth-icon {
        animation: pulseGlow 2s ease-in-out infinite;
    }
}

/* ===== ТЕКСТЫ (ВСЕГДА БЕЛЫЕ) ===== */
#page-auth.auth-page .auth-title {
    font-size: 34px !important;
    font-weight: 800 !important;
    letter-spacing: -0.5px !important;
    margin-bottom: 2px !important;
    color: #ffffff !important;
    background: linear-gradient(135deg, #ffffff 60%, rgba(255, 255, 255, 0.7)) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

#page-auth.auth-page .auth-subtitle {
    font-size: 14px !important;
    color: rgba(255, 255, 255, 0.6) !important;
    margin-bottom: 24px !important;
}

/* ===== СТАТУС ===== */
#page-auth.auth-page .auth-status {
    padding: 16px 20px !important;
    border-radius: var(--radius-sm) !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.04) !important;
    margin-bottom: 20px !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
}

#page-auth.auth-page .status-title {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
}

#page-auth.auth-page .status-desc {
    font-size: 13px !important;
    color: rgba(255, 255, 255, 0.4) !important;
}

/* ===== КНОПКА ВХОДА ===== */
#page-auth.auth-page .btn-auth {
    width: 100% !important;
    padding: 14px !important;
    border: none !important;
    border-radius: var(--radius-sm) !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #fff !important;
    background: var(--primary) !important;
    cursor: pointer !important;
    transition: var(--transition) !important;
    box-shadow: 0 4px 20px var(--primary-glow) !important;
    font-family: inherit !important;
}

#page-auth.auth-page .btn-auth:hover {
    background: var(--primary-hover) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 30px var(--primary-glow) !important;
}

#page-auth.auth-page .btn-auth:active {
    transform: scale(0.97) !important;
}

/* ===== ФИЧИ ===== */
#page-auth.auth-page .auth-features {
    display: flex !important;
    gap: 12px !important;
    margin-top: 24px !important;
    width: 100% !important;
    justify-content: center !important;
}

#page-auth.auth-page .auth-features .feature-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 2px !important;
    flex: 1 !important;
    padding: 8px 4px !important;
    border-radius: var(--radius-xs) !important;
    transition: var(--transition) !important;
}

#page-auth.auth-page .auth-features .feature-item:hover {
    background: rgba(255, 255, 255, 0.03) !important;
}

#page-auth.auth-page .auth-features .feature-icon {
    font-size: 18px !important;
}

#page-auth.auth-page .auth-features .feature-label {
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
}

#page-auth.auth-page .auth-features .feature-desc {
    font-size: 10px !important;
    color: rgba(255, 255, 255, 0.35) !important;
}

/* ===== РАЗРАБОТЧИК ===== */
#page-auth.auth-page .auth-footer {
    margin-top: 24px !important;
    padding-top: 16px !important;
    border-top: 0.5px solid rgba(255, 255, 255, 0.7) !important;
    width: 100% !important;
    text-align: center !important;
}

#page-auth.auth-page .btn-dev {
    background: none !important;
    border: none !important;
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 12px !important;
    cursor: pointer !important;
    transition: var(--transition) !important;
    font-family: inherit !important;
    padding: 8px 16px !important;
    border-radius: var(--radius-full) !important;
}

#page-auth.auth-page .btn-dev:hover {
    color: rgba(255, 255, 255, 0.7) !important;
    background: rgba(255, 255, 255, 0.7) !important;
}

/* ============================================================ */
/* СУПЕР-ФИКС: БЕЛЫЙ ТЕКСТ НА АВТОРИЗАЦИИ                      */
/* ============================================================ */

#page-auth.auth-page,
#page-auth.auth-page * {
    --text-primary: #ffffff !important;
    --text-secondary: rgba(255, 255, 255, 0.6) !important;
    --text-muted: rgba(255, 255, 255, 0.3) !important;
    --bg-card: transparent !important;
    --border-color: rgba(255, 255, 255, 0.04) !important;
}

#page-auth.auth-page .auth-title,
#page-auth.auth-page .auth-subtitle,
#page-auth.auth-page .status-title,
#page-auth.auth-page .status-desc,
#page-auth.auth-page .auth-features .feature-label,
#page-auth.auth-page .auth-features .feature-desc,
#page-auth.auth-page .btn-dev,
#page-auth.auth-page * {
    color: #ffffff !important;
}

#page-auth.auth-page .auth-title {
    background: linear-gradient(135deg, #ffffff 60%, rgba(255, 255, 255, 0.7)) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

#page-auth.auth-page .auth-features .feature-desc {
    color: rgba(255, 255, 255, 0.35) !important;
}

#page-auth.auth-page .status-desc {
    color: rgba(255, 255, 255, 0.4) !important;
}

#page-auth.auth-page .btn-dev {
    color: rgba(255, 255, 255, 0.7) !important;
}

#page-auth.auth-page .btn-dev:hover {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* ============================================================ */
/* АДАПТИВ ДЛЯ МОБИЛЬНЫХ                                        */
/* ============================================================ */

@media (max-width: 480px) {
    body { padding: 10px 10px 72px 10px; }
    
    #page-auth.auth-page .auth-screen {
        padding: 28px 20px !important;
        border-radius: 16px !important;
    }
    
    #page-auth.auth-page .auth-title {
        font-size: 28px !important;
    }
    
    #page-auth.auth-page .auth-subtitle {
        font-size: 13px !important;
        margin-bottom: 16px !important;
    }
    
    #page-auth.auth-page .auth-icon {
        font-size: 44px !important;
        margin-bottom: 8px !important;
    }
    
    #page-auth.auth-page .auth-status {
        padding: 12px 16px !important;
        margin-bottom: 16px !important;
    }
    
    #page-auth.auth-page .status-title {
        font-size: 14px !important;
    }
    
    #page-auth.auth-page .status-desc {
        font-size: 12px !important;
    }
    
    #page-auth.auth-page .btn-auth {
        padding: 12px !important;
        font-size: 15px !important;
        border-radius: 14px !important;
    }
    
    #page-auth.auth-page .auth-features {
        gap: 8px !important;
        margin-top: 16px !important;
    }
    
    #page-auth.auth-page .auth-features .feature-item {
        padding: 6px 2px !important;
    }
    
    #page-auth.auth-page .auth-features .feature-icon {
        font-size: 16px !important;
    }
    
    #page-auth.auth-page .auth-features .feature-label {
        font-size: 10px !important;
    }
    
    #page-auth.auth-page .auth-features .feature-desc {
        font-size: 9px !important;
    }
    
    #page-auth.auth-page .auth-footer {
        margin-top: 16px !important;
        padding-top: 12px !important;
    }
    
    #page-auth.auth-page .btn-dev {
        font-size: 11px !important;
        padding: 6px 12px !important;
    }
    
    .stats-grid { gap: 8px; }
    .stat-value { font-size: 18px; }
    .stat-card { padding: 12px 8px; }
    .modal { max-width: 100%; margin: 0 10px; }
    .group-item { flex-wrap: wrap; }
    .group-item .g-actions { margin-top: 4px; width: 100%; justify-content: flex-end; }
}

@media (max-width: 380px) {
    #page-auth.auth-page .auth-screen {
        padding: 20px 14px !important;
        border-radius: 14px !important;
    }
    #page-auth.auth-page .auth-title { font-size: 24px !important; }
    #page-auth.auth-page .auth-features .feature-item { padding: 4px 2px !important; }
}

@media (max-height: 600px) and (orientation: landscape) {
    #page-auth.auth-page .auth-screen {
        padding: 16px 20px !important;
        max-width: 380px !important;
    }
    #page-auth.auth-page .auth-icon { font-size: 32px !important; margin-bottom: 4px !important; }
    #page-auth.auth-page .auth-title { font-size: 22px !important; margin-bottom: 0 !important; }
    #page-auth.auth-page .auth-subtitle { font-size: 12px !important; margin-bottom: 12px !important; }
    #page-auth.auth-page .auth-status { padding: 8px 14px !important; margin-bottom: 12px !important; }
    #page-auth.auth-page .btn-auth { padding: 10px !important; font-size: 14px !important; }
    #page-auth.auth-page .auth-features { margin-top: 12px !important; gap: 4px !important; }
    #page-auth.auth-page .auth-features .feature-item { padding: 4px 2px !important; }
}

/* ============================================================ */
/* ХЕДЕР, СТАТИСТИКА, КАРТОЧКИ, ГРУППЫ, ТОКЕНЫ, ОБЪЯВЛЕНИЯ    */
/* ============================================================ */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0 16px 0;
    margin-bottom: 16px;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.header-right { display: flex; align-items: center; gap: 6px; }

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid var(--border-color);
    transition: var(--transition);
}
.avatar:hover { border-color: var(--primary); transform: scale(1.05); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.greeting {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}
.greeting-sub {
    font-size: 12px;
    color: var(--text-secondary);
}

.btn-logout {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 6px 8px;
    border-radius: 50%;
    transition: var(--transition);
}
.btn-logout:hover {
    background: var(--bg-card);
    color: var(--text-secondary);
}

.btn-back {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px 6px;
    transition: var(--transition);
}
.btn-back:hover { color: var(--text-primary); }

.btn-theme-toggle {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 50%;
    transition: var(--transition);
    color: var(--text-secondary);
}
.btn-theme-toggle:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.page-title {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.3px;
}
.page-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ===== СТАТИСТИКА ===== */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 16px 12px;
    text-align: center;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-card);
}
.stat-card:hover {
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
    transform: translateY(-2px);
}
.stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}
.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 2px;
}

/* ===== КАРТОЧКИ ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px 18px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    margin-bottom: 16px;
    transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-hover); }
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}
.card-link {
    font-size: 13px;
    color: var(--primary);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}
.card-link:hover { color: var(--primary-hover); }
.card-header-right { display: flex; align-items: center; gap: 8px; }
.badge-count {
    font-size: 11px;
    color: var(--text-secondary);
    padding: 2px 10px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
}

/* ===== ГРУППЫ (компактные) ===== */
.group-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}
.group-compact:last-child { border-bottom: none; }
.group-compact .group-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    cursor: pointer;
}
.group-compact .avatar-compact {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    border: 1px solid var(--border-color);
}
.group-compact .avatar-compact img { width: 100%; height: 100%; object-fit: cover; }
.group-compact .group-info { flex: 1; min-width: 0; }
.group-compact .group-name {
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.group-compact .group-meta {
    font-size: 11px;
    color: var(--text-secondary);
}
.group-compact .group-status {
    font-size: 11px;
    font-weight: 500;
}
.group-compact .group-status.active { color: var(--success); }
.group-compact .group-status.paused { color: var(--warning); }
.group-compact .group-right { display: flex; align-items: center; gap: 4px; }

/* ===== ТОКЕНЫ НА ГЛАВНОЙ ===== */
.token-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}
.token-item:last-child { border-bottom: none; }
.token-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border: 1px solid var(--border-color);
}
.token-avatar img { width: 100%; height: 100%; object-fit: cover; }
.token-info { flex: 1; min-width: 0; }
.token-name {
    font-weight: 600;
    font-size: 13px;
}
.token-meta {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.token-status {
    font-size: 10px;
    font-weight: 500;
    padding: 1px 8px;
    border-radius: var(--radius-full);
}
.token-status.active {
    background: var(--success-bg);
    color: var(--success);
}
.token-status.inactive {
    background: var(--danger-bg);
    color: var(--danger);
}
.token-stats {
    font-size: 10px;
    color: var(--text-muted);
}
.token-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.token-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    border-radius: var(--radius-xs);
    transition: var(--transition);
    color: var(--text-muted);
}
.token-actions button:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}
.token-actions .btn-refresh:hover { color: var(--primary); }

/* ===== ОБЪЯВЛЕНИЯ ===== */
.ad-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}
.ad-item:last-child { border-bottom: none; }
.ad-item .ad-photo {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-xs);
    background: var(--bg-input);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border: 1px solid var(--border-color);
}
.ad-item .ad-photo img { width: 100%; height: 100%; object-fit: cover; }
.ad-item .ad-info { flex: 1; min-width: 0; }
.ad-item .ad-title {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ad-item .ad-meta {
    font-size: 11px;
    color: var(--text-secondary);
}
.ad-item .ad-status {
    font-size: 11px;
    font-weight: 500;
    margin-top: 2px;
}
.ad-item .ad-status.published { color: var(--success); }
.ad-item .ad-status.scheduled { color: var(--warning); }
.ad-item .ad-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}
.ad-item .ad-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}
.ad-item .ad-price.free { color: var(--success); }
.ad-item .ad-link {
    font-size: 11px;
    color: var(--primary);
    text-decoration: none;
}
.ad-item .ad-link:hover { text-decoration: underline; }

/* ===== ГРУППЫ (список) ===== */
.group-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}
.group-item:hover {
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}
.group-item .g-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    border: 1px solid var(--border-color);
}
.group-item .g-avatar img { width: 100%; height: 100%; object-fit: cover; }
.group-item .g-info { flex: 1; min-width: 0; }
.group-item .g-name {
    font-weight: 600;
    font-size: 14px;
}
.group-item .g-meta {
    font-size: 12px;
    color: var(--text-secondary);
}
.group-item .g-status {
    font-size: 11px;
    font-weight: 500;
}
.group-item .g-status.active { color: var(--success); }
.group-item .g-status.paused { color: var(--warning); }
.group-item .g-status.disconnected { color: var(--text-muted); }
.group-item .g-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    align-items: center;
    flex-wrap: wrap;
}

/* ===== КНОПКИ ===== */
.btn-primary {
    padding: 10px 20px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}
.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 20px var(--primary-glow);
}
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
    padding: 10px 20px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}
.btn-secondary:hover {
    background: var(--border-color);
    color: var(--text-primary);
}
.btn-secondary.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.btn-danger {
    padding: 10px 20px;
    background: var(--danger);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}
.btn-danger:hover { opacity: 0.85; }

.btn-sm { padding: 4px 12px; font-size: 12px; border-radius: var(--radius-xs); min-height: 28px; }
.btn-block { width: 100%; }

.btn-icon {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: var(--radius-xs);
    transition: var(--transition);
    color: var(--text-secondary);
}
.btn-icon:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

/* ===== БЕЙДЖИ ===== */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 500;
}
.badge-success {
    background: var(--success-bg);
    color: var(--success);
}
.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}
.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}
.badge-info {
    background: var(--bg-input);
    color: var(--text-secondary);
}

/* ===== ПОИСК ===== */
.search-box { margin-bottom: 16px; }
.search-box input,
.search-box select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    transition: var(--transition);
    outline: none;
    box-shadow: var(--shadow-card);
}
.search-box input::placeholder { color: var(--text-muted); }
.search-box input:focus,
.search-box select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.search-box select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

/* ===== ПЕРЕКЛЮЧАТЕЛЬ (iOS стиль) ===== */
.switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
    flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--border-color);
    transition: var(--transition);
    border-radius: var(--radius-full);
}
.switch .slider::before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background: #fff;
    transition: var(--transition-spring);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ===== АККОРДЕОНЫ ===== */
.accordion {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}
.accordion:hover { box-shadow: var(--shadow-hover); }
.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: var(--transition);
    gap: 8px;
}
.accordion-header:hover { background: var(--bg-card-hover); }
.accordion-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}
.accordion-title .accordion-icon { font-size: 18px; }
.accordion-arrow {
    font-size: 12px;
    color: var(--text-muted);
    transition: var(--transition);
    flex-shrink: 0;
}
.accordion.open .accordion-arrow {
    transform: rotate(180deg);
    color: var(--primary);
}
.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    padding: 0 16px;
}
.accordion.open .accordion-body {
    max-height: 2000px;
    padding: 0 16px 16px 16px;
}

/* ===== МОДАЛКИ ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-modal);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.25s ease;
}
.modal-overlay.hidden { display: none; }
.modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    max-width: 440px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-modal);
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid var(--border-color);
}
@keyframes slideUp {
    from { transform: translateY(24px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px 12px 20px;
    border-bottom: 1px solid var(--border-color);
}
.modal-title { font-size: 17px; font-weight: 700; }
.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px;
    transition: var(--transition);
}
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 16px 20px 20px 20px; }
.modal-footer {
    padding: 12px 20px 16px 20px;
    border-top: 1px solid var(--border-color);
}

/* ===== ТОКЕН-МОДАЛКА ===== */
.token-instructions ol {
    margin: 10px 0 14px 18px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.8;
}
.token-instructions ol a { color: var(--primary); text-decoration: none; }
.token-instructions ol a:hover { text-decoration: underline; }
.token-input-wrap {
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    margin: 10px 0;
}
.token-input-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.token-input {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    font-size: 13px;
    font-family: monospace;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
}
.token-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.token-input-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}
.token-preview {
    background: var(--primary-light);
    border-radius: var(--radius-xs);
    padding: 10px 14px;
    border: 1px solid var(--primary);
    margin-top: 10px;
}
.token-preview-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
    font-family: monospace;
    margin-top: 2px;
}

/* ===== ПРОФИЛЬ ===== */
.profile-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 28px 20px;
    text-align: center;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    margin-bottom: 16px;
}
.profile-avatar {
    font-size: 56px;
    margin-bottom: 6px;
}
.profile-avatar img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}
.profile-name {
    font-size: 18px;
    font-weight: 700;
}
.profile-id {
    font-size: 13px;
    color: var(--text-secondary);
}
.menu-list {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}
.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}
.menu-item:last-child { border-bottom: none; }
.menu-item:hover { background: var(--bg-input); }
.menu-icon { font-size: 18px; }
.menu-label {
    font-size: 14px;
    font-weight: 500;
    flex: 1;
}
.menu-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    background: var(--primary-light);
    color: var(--primary);
}
.menu-arrow {
    color: var(--text-muted);
    font-size: 14px;
}

/* ===== НИЖНЯЯ НАВИГАЦИЯ ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-nav);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 0.5px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding: 4px 0 env(safe-area-inset-bottom);
    max-width: 480px;
    margin: 0 auto;
    z-index: 100;
    box-shadow: var(--shadow-nav);
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 4px 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 10px;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    min-height: 44px;
    justify-content: center;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}
.nav-item .nav-icon { font-size: 20px; }
.nav-item .nav-label {
    font-size: 9px;
    font-weight: 500;
}
.nav-item.active {
    color: var(--primary);
}
.nav-item.active .nav-icon { transform: scale(1.05); }
.nav-item.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--primary);
    border-radius: 0 0 4px 4px;
}
.nav-item:hover { color: var(--text-primary); }

/* ===== АВАТАРКИ ===== */
.ad-item .ad-group-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border: 2px solid var(--border-color);
}
.ad-item .ad-group-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ad-item .ad-group-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ad-item .ad-group-meta {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.ad-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border: 2px solid var(--border-color);
}
.ad-avatar img { width: 100%; height: 100%; object-fit: cover; }

.token-avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    border: 1px solid var(--border-color);
}
.token-avatar-circle img { width: 100%; height: 100%; object-fit: cover; }

.avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border: 1px solid var(--border-color);
}
.avatar-sm img { width: 100%; height: 100%; object-fit: cover; }

.group-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    border: 1px solid var(--border-color);
}
.group-avatar img { width: 100%; height: 100%; object-fit: cover; }

.avatar-header {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}
.avatar-header:hover {
    border-color: var(--primary);
    transform: scale(1.05);
}
.avatar-header img { width: 100%; height: 100%; object-fit: cover; }

.avatar-profile {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    border: 3px solid var(--border-color);
    margin: 0 auto 12px;
}
.avatar-profile img { width: 100%; height: 100%; object-fit: cover; }

.avatar-settings {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    border: 2px solid var(--border-color);
}
.avatar-settings img { width: 100%; height: 100%; object-fit: cover; }

.photo-item {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid var(--border-color);
    aspect-ratio: 1;
    background: var(--bg-page);
}
.photo-item img { width: 100%; height: 100%; object-fit: cover; }
.photo-item .remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
    border: none;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.photo-item .remove:hover { transform: scale(1.1); }
.photo-item .photo-index {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
}

/* ===== ФУТЕР ===== */
.footer {
    text-align: center;
    padding: 16px 0 8px 0;
    font-size: 11px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
    display: flex;
    gap: 6px;
    justify-content: center;
}

/* ===== ЗАГРУЗКА ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    gap: 12px;
}
.loading-overlay.hidden { display: none; }
.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
    color: var(--text-secondary);
    font-size: 13px;
}

/* ===== ТОСТЫ ===== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 16px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    max-width: 90%;
    text-align: center;
    animation: toastFade 0.3s ease;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    min-width: 200px;
}

.toast-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.toast-error {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

.toast-info {
    background: var(--bg-card);
    color: var(--text);
    border-color: var(--border-color);
}

@keyframes toastFade {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* ===== УТИЛИТЫ ===== */
.text-center { text-align: center; }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 14px; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 8px; }

/* ===== АДАПТИВ ДЛЯ ПК ===== */
@media (min-width: 768px) {
    body {
        padding: 20px 20px 96px 20px;
        background: radial-gradient(ellipse at 30% 20%, #1A1A2E, #000000 70%);
    }
    [data-theme="dark"] body {
        background: radial-gradient(ellipse at 30% 20%, #1A1A2E, #000000 70%);
    }
    [data-theme="light"] body {
        background: radial-gradient(ellipse at 30% 20%, #e8ecf2, #d5d9e0 70%);
    }
    .app {
        background: var(--bg-page);
        border-radius: var(--radius);
        padding: 0 20px 20px 20px;
        min-height: 90vh;
        box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
        border: 0.5px solid var(--border-color);
        transition: background 0.3s;
    }
    [data-theme="dark"] .app {
        box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
    }
    .bottom-nav {
        border-radius: 0 0 var(--radius) var(--radius);
    }
}

/* ===== СТАРЫЕ СТИЛИ ДЛЯ АВТОРИЗАЦИИ (FALLBACK) ===== */
.auth-screen .auth-footer {
    margin-top: auto;
    padding-top: 20px;
    padding-bottom: 10px;
    width: 100%;
    max-width: 320px;
    border-top: 0.5px solid rgba(255, 255, 255, 0.06);
    text-align: center;
}

.btn-dev {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    font-size: 12px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    padding: 8px 16px;
    border-radius: 100px;
    letter-spacing: 0.3px;
}

.btn-dev:hover {
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .btn-dev {
    color: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .btn-dev:hover {
    color: rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .auth-screen .auth-footer {
    border-top: 0.5px solid rgba(0, 0, 0, 0.06);
}

/* ===== QR МОДАЛКА ===== */
#modal-qr .modal {
    max-width: 400px;
}

#modal-qr #qrcode {
    background: #ffffff;
    padding: 16px;
    border-radius: 12px;
    display: inline-block;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

[data-theme="dark"] #modal-qr #qrcode {
    background: #ffffff;
}

#modal-qr #qrcode canvas {
    display: block;
    width: 220px;
    height: 220px;
}

#modal-qr #qr-link-text {
    background: var(--bg-page);
    border-radius: var(--radius-xs);
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text-secondary);
    word-break: break-all;
    margin-top: 8px;
}

@media (max-width: 480px) {
    #modal-qr #qrcode canvas {
        width: 180px;
        height: 180px;
    }
}
/* ============================================================ */
/* ИНСТРУКЦИЯ — МОДАЛКА                                          */
/* ============================================================ */

.modal-instruction {
    max-width: 600px !important;
    max-height: 90vh !important;
}

.modal-instruction .modal-body {
    padding: 16px 20px 12px 20px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Аккордеоны внутри инструкции */
.instruction-accordion {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}

.instruction-accordion .accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: var(--transition);
    gap: 8px;
    background: var(--bg-page);
}

.instruction-accordion .accordion-header:hover {
    background: var(--bg-card-hover);
}

.instruction-accordion .accordion-header .step-badge {
    display: inline-block;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    line-height: 28px;
    flex-shrink: 0;
}

.instruction-accordion .accordion-header .step-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.instruction-accordion .accordion-header .step-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.instruction-accordion .accordion-header .accordion-arrow {
    font-size: 12px;
    color: var(--text-muted);
    transition: var(--transition);
    flex-shrink: 0;
}

.instruction-accordion.open .accordion-header .accordion-arrow {
    transform: rotate(180deg);
    color: var(--primary);
}

.instruction-accordion .accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    padding: 0 16px;
}

.instruction-accordion.open .accordion-body {
    max-height: 2000px;
    padding: 0 16px 16px 16px;
}

.instruction-accordion .accordion-body p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 8px;
}

.instruction-accordion .accordion-body ul,
.instruction-accordion .accordion-body ol {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
    padding-left: 20px;
    margin-bottom: 8px;
}

.instruction-accordion .accordion-body li {
    margin-bottom: 2px;
}

.instruction-accordion .accordion-body .highlight {
    background: var(--primary-light);
    border-radius: var(--radius-xs);
    padding: 8px 12px;
    border-left: 3px solid var(--primary);
    margin: 8px 0;
    font-size: 13px;
    color: var(--text-primary);
}

.instruction-accordion .accordion-body .highlight code {
    background: var(--bg-page);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
    color: var(--primary);
}

.instruction-accordion .accordion-body .warning {
    background: var(--warning-bg);
    border-radius: var(--radius-xs);
    padding: 8px 12px;
    border-left: 3px solid var(--warning);
    margin: 8px 0;
    font-size: 13px;
    color: var(--text-primary);
}

@media (max-width: 480px) {
    .modal-instruction .modal-body {
        padding: 12px 14px 10px 14px;
    }
    .instruction-accordion .accordion-header {
        padding: 10px 12px;
    }
    .instruction-accordion .accordion-header .step-title {
        font-size: 13px;
    }
    .instruction-accordion .accordion-body p,
    .instruction-accordion .accordion-body ul,
    .instruction-accordion .accordion-body ol {
        font-size: 12px;
    }
}
/* ===== СТАТУСЫ ОБЪЯВЛЕНИЙ ===== */
.badge-published {
    background: var(--success-bg);
    color: var(--success);
}

.badge-scheduled {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-approved {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-rejected {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-filling {
    background: var(--bg-input);
    color: var(--text-secondary);
}

.badge-paid {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-moderation {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-queued {
    background: var(--bg-input);
    color: var(--text-secondary);
}

.badge-draft {
    background: var(--bg-input);
    color: var(--text-secondary);
}

.badge-unknown {
    background: var(--bg-input);
    color: var(--text-secondary);
}

/* ============================================================ */
/* БАЛАНС В ШАПКЕ                                               */
/* ============================================================ */

.balance-display {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px 4px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    position: relative;
}

.balance-display:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
}

.balance-display .balance-icon {
    font-size: 16px;
}

.balance-display .balance-amount {
    font-weight: 700;
    min-width: 50px;
}

.balance-display .balance-warning {
    font-size: 14px;
    color: var(--danger);
    animation: pulse-warning 1.5s ease-in-out infinite;
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.1); }
}

/* ★★★ КНОПКИ СУММ ПОПОЛНЕНИЯ ★★★ */
.topup-amount {
    padding: 8px 4px !important;
    font-size: 13px !important;
    min-height: 36px !important;
    width: 100% !important;
    transition: var(--transition);
}

.topup-amount.active {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
}

.topup-amount:hover {
    border-color: var(--primary) !important;
}

/* ★★★ БЕЙДЖ БАЛАНСА В ПРОФИЛЕ ★★★ */
#billing-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    background: var(--primary-light);
    color: var(--primary);
}