/* public/css/dashboard.css */
:root {
    --primary-gradient: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 100%);
    --dash-kpi-icon-bg: linear-gradient(135deg, #e0e7ff 0%, #ede9fe 100%);
    --dashboard-header-h: 68px;
    --dark-bg: #0a0e1a;
    --sidebar-bg: #111625;
    --card-bg: #1a1f2e;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --accent: #00C9FF;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    /* Поля ввода / зоны в секции голоса (inline styles) */
    --border: rgba(255, 255, 255, 0.2);
    --muted: #94a3b8;
    /* Скроллбары дашборда (как в чате /ui) */
    --dash-scroll-track: rgba(15, 23, 42, 0.55);
    --dash-scroll-thumb: #475569;
    --dash-scroll-thumb-hover: #3b82f6;
    --dash-scroll-light-track: #eef2f7;
    --dash-scroll-light-thumb: #94a8c9;
    --dash-scroll-light-thumb-hover: #3b82f6;
}

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

body {
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Шапка: разметка и стили центрального меню — public/css/site-navbar.css (как на лендинге) */

.dashboard-nav-cta {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.navbar .dashboard-nav-cta .btn.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    border: none;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.28);
    padding: 0.48rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    line-height: 1.2;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.navbar .dashboard-nav-cta .btn.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 201, 255, 0.35);
}

/* Выпадающее меню пользователя (как на лендинге) */
.user-menu {
    position: relative;
}

.user-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.35rem;
    min-width: 15.5rem;
    padding: 0.35rem 0;
    background: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.user-menu-dropdown::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -10px;
    height: 10px;
}

.user-menu:hover .user-menu-dropdown,
.user-menu:focus-within .user-menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.user-menu-chevron {
    font-size: 0.55rem;
    opacity: 0.85;
    margin-left: 0.15rem;
    transition: transform 0.2s ease;
}

.user-menu:hover .user-menu-chevron,
.user-menu:focus-within .user-menu-chevron {
    transform: rotate(180deg);
}

.user-info.user-menu-trigger {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(56, 189, 248, 0.65);
    color: #e0f2fe;
    background: transparent;
    padding: 0.5rem 0.85rem;
    border-radius: 10px;
    font: inherit;
    font-weight: 500;
    font-size: 0.9rem;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.user-info.user-menu-trigger:hover {
    background: rgba(56, 189, 248, 0.12);
    border-color: #7dd3fc;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.55rem 1rem;
    margin: 0;
    border: none;
    background: none;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    color: #e2e8f0;
    cursor: pointer;
    box-sizing: border-box;
    transition: background 0.15s ease, color 0.15s ease;
}

a.user-menu-item {
    color: #e2e8f0;
}

.user-menu-item:hover {
    background: rgba(56, 189, 248, 0.12);
    color: #f8fafc;
}

.user-menu-logout {
    color: #fca5a5;
}

.user-menu-logout:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fecaca;
}

.user-info {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: var(--danger);
    color: white;
}

/* ===== КОНТЕЙНЕР ===== */
.dashboard-container {
    display: flex;
    margin-top: var(--dashboard-header-h);
    min-height: calc(100vh - var(--dashboard-header-h));
}

/* ===== Скролл в стиле сайта (тонкий, сине-фиолетовый акцент при hover) ===== */
.dash-scroll,
.sidebar-nav,
#conversationList,
#conversationMessages,
.admin-usage-table-scroll {
    scrollbar-width: thin;
    scrollbar-color: var(--dash-scroll-thumb) var(--dash-scroll-track);
}

.dash-scroll::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar,
#conversationList::-webkit-scrollbar,
#conversationMessages::-webkit-scrollbar,
.admin-usage-table-scroll::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.dash-scroll::-webkit-scrollbar-track,
.sidebar-nav::-webkit-scrollbar-track,
#conversationList::-webkit-scrollbar-track,
#conversationMessages::-webkit-scrollbar-track,
.admin-usage-table-scroll::-webkit-scrollbar-track {
    background: var(--dash-scroll-track);
    border-radius: 8px;
    margin: 2px 0;
}

.dash-scroll::-webkit-scrollbar-thumb,
.sidebar-nav::-webkit-scrollbar-thumb,
#conversationList::-webkit-scrollbar-thumb,
#conversationMessages::-webkit-scrollbar-thumb,
.admin-usage-table-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #334155 0%, var(--dash-scroll-thumb) 55%, #334155 100%);
    border-radius: 8px;
    border: 2px solid var(--dash-scroll-track);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    min-height: 32px;
}

.dash-scroll::-webkit-scrollbar-thumb:hover,
.sidebar-nav::-webkit-scrollbar-thumb:hover,
#conversationList::-webkit-scrollbar-thumb:hover,
#conversationMessages::-webkit-scrollbar-thumb:hover,
.admin-usage-table-scroll::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--dash-scroll-thumb-hover) 0%, #2563eb 100%);
    border-color: var(--dash-scroll-track);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 8px rgba(59, 130, 246, 0.22);
}

.content-area .dash-scroll,
.content-area #conversationList,
.content-area #conversationMessages {
    scrollbar-color: var(--dash-scroll-light-thumb) var(--dash-scroll-light-track);
}

.content-area .dash-scroll::-webkit-scrollbar-track,
.content-area #conversationList::-webkit-scrollbar-track,
.content-area #conversationMessages::-webkit-scrollbar-track {
    background: var(--dash-scroll-light-track);
}

.content-area .dash-scroll::-webkit-scrollbar-thumb,
.content-area #conversationList::-webkit-scrollbar-thumb,
.content-area #conversationMessages::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #b8c5da 0%, var(--dash-scroll-light-thumb) 55%, #b8c5da 100%);
    border-color: var(--dash-scroll-light-track);
}

.content-area .dash-scroll::-webkit-scrollbar-thumb:hover,
.content-area #conversationList::-webkit-scrollbar-thumb:hover,
.content-area #conversationMessages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--dash-scroll-light-thumb-hover) 0%, #2563eb 100%);
    border-color: var(--dash-scroll-light-track);
}

/* ===== САЙДБАР ===== */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    border-right: 1px solid rgba(255,255,255,0.1);
    padding: 2rem 0.65rem 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: var(--dashboard-header-h);
    bottom: 0;
    overflow: hidden;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 0.35rem;
}

.sidebar-footer {
    flex-shrink: 0;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-right: 0.35rem;
}

.sidebar-summary-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.95);
    margin: 0 0 0.35rem 0;
    padding: 0 0.25rem;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
}

.sidebar-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
}

.sidebar-item.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 18px rgba(91, 33, 182, 0.35);
}

.sidebar-item i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

/* Мини-статистика */
.sidebar-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
    padding: 0.85rem;
    background: rgba(15, 23, 42, 0.55);
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.mini-stat--ic {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    text-align: center;
}

.mini-stat--ic > i {
    font-size: 0.85rem;
    color: #93c5fd;
    opacity: 0.9;
}

.mini-stat {
    text-align: center;
}

.mini-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #f8fafc;
}

.mini-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* ===== КОНТЕНТ (светлая колонка; шапка и сайдбар остаются тёмными) ===== */
.content-area {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
    max-width: 1400px;
    min-height: calc(100vh - var(--dashboard-header-h));
    background: #f3f4f6;
    color: #0f172a;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --card-bg: #ffffff;
    --dark-bg: #f8fafc;
    --border: rgba(15, 23, 42, 0.18);
    --muted: #64748b;
}

.content-area .btn-outline:hover {
    color: #0f172a;
}

.content-area .stat-card,
.content-area .account-card,
.content-area .settings-card,
.content-area .plan-card,
.content-area .payment-section,
.content-area .transaction-item,
.content-area .empty-state,
.content-area .upgrade-option-card {
    border-color: rgba(15, 23, 42, 0.1);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.content-area .plan-features li {
    border-bottom-color: rgba(15, 23, 42, 0.08);
}

.content-area .progress-bar-container {
    background: rgba(15, 23, 42, 0.1);
}

.content-area .form-group input,
.content-area .form-group select,
.content-area .form-group textarea {
    border-color: rgba(15, 23, 42, 0.16);
    background: var(--dark-bg);
    color: var(--text-primary);
}

.content-area .voice-upload-card,
.content-area .voices-list-card,
.content-area .voice-test-card {
    border-color: rgba(15, 23, 42, 0.12) !important;
}

.content-area #conversationListWrap,
.content-area #conversationDetail {
    border-color: rgba(15, 23, 42, 0.12) !important;
}

.conversation-list-empty {
    padding: 1.25rem;
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.conversation-list-error {
    color: #f87171;
}

.conversation-list-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    width: 100%;
    padding: 0.85rem 1rem;
    border: none;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    background: transparent;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: inherit;
    transition: background 0.15s ease;
}

.conversation-list-item:hover {
    background: rgba(99, 102, 241, 0.08);
}

.conversation-list-item-title {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.35;
}

.conversation-list-item-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.conversation-msg {
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.05);
}

.conversation-msg.is-user {
    border-left: 3px solid #3b82f6;
}

.conversation-msg.is-partner {
    border-left: 3px solid #22c55e;
}

.conversation-msg-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.conversation-msg-text {
    font-size: 0.92rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.conversation-msg-translated {
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border-top: 1px solid rgba(15, 23, 42, 0.1);
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.content-area #voiceLimitIndicator {
    background: rgba(15, 23, 42, 0.06) !important;
}

.content-area .voice-form-panel {
    border-color: rgba(15, 23, 42, 0.12) !important;
    background: rgba(15, 23, 42, 0.03) !important;
}

.content-area .upload-zone {
    border-color: rgba(15, 23, 42, 0.22) !important;
}

/* Генерация голоса: первая строка — список и тест рядом; ниже — добавление голоса */
.content-area .voice-cloning-layout {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.content-area .voice-cloning-top-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
    width: 100%;
}

@media (max-width: 960px) {
    .content-area .voice-cloning-top-row {
        grid-template-columns: 1fr;
    }
}

/* Добавить голос: зона загрузки и блок записи — в один ряд */
.content-area .voice-upload-record-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
    gap: 1.25rem;
    align-items: stretch;
    margin-bottom: 1.25rem;
    width: 100%;
}

.content-area .voice-upload-record-col {
    min-width: 0;
}

.content-area .voice-upload-record-col--drop {
    display: flex;
    flex-direction: column;
}

.content-area .voice-upload-record-col--drop .upload-zone {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 12rem;
    margin-bottom: 0 !important;
}

.content-area .voice-clone-step-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.65rem;
    line-height: 1.35;
}

.content-area .voice-clone-limit-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin: 0.85rem 0 1rem;
    padding: 0.9rem 1.05rem;
    border-radius: 10px;
    border: 2px solid #dc2626;
    background: #fecaca;
    color: #7f1d1d;
    font-size: 0.9rem;
    line-height: 1.45;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.18);
}

.content-area .voice-clone-limit-notice[hidden] {
    display: none !important;
}

.content-area .voice-clone-limit-notice i {
    margin-top: 0.12rem;
    flex-shrink: 0;
    font-size: 1.15rem;
    color: #dc2626;
}

.content-area #voiceUploadForm.voice-upload-form--limit-reached .voice-upload-record-row,
.content-area #voiceUploadForm.voice-upload-form--limit-reached > .form-group,
.content-area #voiceUploadForm.voice-upload-form--limit-reached > #voiceUploadBtn {
    opacity: 0.45;
    pointer-events: none;
}

.content-area #voiceUploadForm.voice-upload-form--limit-reached .voice-clone-limit-notice {
    opacity: 1;
    pointer-events: auto;
}

.content-area .voice-list-test-btn--ready {
    border: 2px solid #7c3aed !important;
    color: #6d28d9 !important;
    background: rgba(124, 58, 237, 0.1) !important;
    font-weight: 600;
    box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.15);
}

.content-area .voice-list-test-btn--ready:hover {
    background: rgba(124, 58, 237, 0.16) !important;
    border-color: #6d28d9 !important;
}

@media (max-width: 960px) {
    .content-area .voice-upload-record-row {
        grid-template-columns: 1fr;
    }

    .content-area .voice-upload-record-col--drop .upload-zone {
        min-height: 10rem;
    }
}

.content-area .conversation-pause-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: var(--dark-bg);
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.1);
}

.content-area .conversation-pause-label {
    font-weight: 600;
    color: var(--text-primary);
}

.content-area .conversation-pause-control {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.content-area .conversation-pause-btn {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 8px;
    border: 1px solid rgba(15, 23, 42, 0.15);
    background: #fff;
    color: var(--text-primary);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.content-area .conversation-pause-btn:hover {
    background: rgba(0, 201, 255, 0.12);
    border-color: var(--accent);
}

.content-area .conversation-pause-input {
    width: 3.5rem;
    text-align: center;
    padding: 0.45rem 0.35rem;
    border-radius: 8px;
    border: 1px solid rgba(15, 23, 42, 0.16);
    background: #fff;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
}

.content-area .conversation-pause-unit {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Тема и контекст беседы — та же визуальная плотность, что у блока паузы */
.conversation-topic-head {
    margin-top: 1.75rem;
    margin-bottom: 0.45rem;
}

.conversation-topic-head--first {
    margin-top: 0;
}

.settings-card h3.conversation-subsection-title {
    margin: 0 0 0.15rem;
    display: block;
}

.conversation-subsection-title {
    margin: 0 0 0.15rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.conversation-topic-lead {
    margin: 0;
    max-width: 42rem;
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.content-area .conversation-topic-panel {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    padding: 1.15rem 1.25rem;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.content-area .conversation-topic-panel .form-group {
    gap: 0.45rem;
}

.content-area .conversation-topic-panel .form-group label {
    font-weight: 600;
    font-size: 0.875rem;
    color: #334155;
}

.content-area .conversation-topic-panel .form-group input[type="text"] {
    width: 100%;
    max-width: 42rem;
    padding: 0.75rem 0.85rem;
    border-radius: 8px;
    border: 1px solid rgba(15, 23, 42, 0.16);
    background: var(--dark-bg);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
}

.content-area .conversation-topic-panel .form-group input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
}

.content-area .conversation-context-textarea {
    width: 100%;
    max-width: 42rem;
    min-height: 7.5rem;
    max-height: 20rem;
    resize: vertical;
    padding: 0.75rem 0.85rem;
    border-radius: 8px;
    border: 1px solid rgba(15, 23, 42, 0.16);
    background: var(--dark-bg);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    line-height: 1.45;
}

.content-area .conversation-context-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.conversation-topic-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0.15rem;
}

.conversation-preset-block {
    margin-top: 1.35rem;
}

.conversation-pause-row + .conversation-preset-block {
    margin-top: 1.75rem;
}

.conversation-preset-block .conversation-topic-head {
    margin-top: 0;
}

.conversation-field-hint {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    line-height: 1.35;
    color: var(--text-secondary);
    max-width: 42rem;
}

.conversation-tts-row {
    display: flex;
    align-items: stretch;
    gap: 0.55rem;
    max-width: 28rem;
    width: 100%;
}

.content-area .conversation-tts-row select {
    flex: 1;
    min-width: 0;
    max-width: none;
    width: auto;
}

.conversation-tts-preview-btn {
    flex-shrink: 0;
    padding: 0.5rem 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.65rem;
}

.conversation-neural-gender-wrap {
    margin-top: 0.25rem;
    margin-bottom: 0.35rem;
}

.conversation-neural-gender-caption {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.45rem;
}

.conversation-neural-gender-seg {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.conversation-neural-gender-opt {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.9rem;
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    background: var(--dark-bg);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    user-select: none;
}

.conversation-neural-gender-opt:hover {
    border-color: rgba(0, 201, 255, 0.45);
}

.conversation-neural-gender-opt:has(input:checked) {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(0, 201, 255, 0.28);
}

.conversation-neural-gender-opt input {
    margin: 0;
    accent-color: var(--accent);
}

.conversation-card-save-row {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(15, 23, 42, 0.1);
}

/* Нижняя панель «Сохранить предустановки» при несохранённых правках настроек беседы */
.conversation-dirty-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1080;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding-top: 0.65rem;
    padding-right: 2rem;
    padding-bottom: calc(0.65rem + env(safe-area-inset-bottom, 0px));
    padding-left: calc(280px + 2rem);
    pointer-events: none;
    transform: translateY(110%);
    opacity: 0;
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
    background: transparent;
}

.conversation-dirty-bar.is-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.conversation-dirty-bar-inner {
    display: block;
    width: auto;
    max-width: 28rem;
}

.conversation-dirty-bar-btn {
    width: auto;
    max-width: min(28rem, 100%);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
    font-weight: 600;
    margin-left: 33px;
}

.conversation-preset-checkbox-row .conversation-preset-inline-check {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    cursor: pointer;
    font-size: 0.92rem;
    line-height: 1.4;
    color: var(--text-primary);
    font-weight: 500;
}

.conversation-preset-inline-check input[type='checkbox'] {
    margin-top: 0.2rem;
    width: 1.05rem;
    height: 1.05rem;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.content-area .conversation-topic-panel select {
    width: 100%;
    max-width: 22rem;
    padding: 0.65rem 2.5rem 0.65rem 0.85rem;
    border-radius: 8px;
    border: 1px solid rgba(15, 23, 42, 0.16);
    background: var(--dark-bg);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
}

.content-area .conversation-topic-panel select:focus {
    outline: none;
    border-color: var(--accent);
}

@keyframes dash-content-spin {
    to {
        transform: rotate(360deg);
    }
}

.content-area .loading {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid rgba(15, 23, 42, 0.12);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: dash-content-spin 0.75s linear infinite;
    vertical-align: middle;
    box-sizing: border-box;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
    color: #0f172a;
    background: none;
    -webkit-text-fill-color: currentColor;
    -webkit-background-clip: border-box;
    background-clip: border-box;
}

/* ===== СТАТИСТИКА ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border: 1px solid rgba(255,255,255,0.1);
}

.stat-icon {
    font-size: 2.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* Прогресс бар */
.progress-bar-container {
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    height: 8px;
    overflow: hidden;
}

.progress-bar {
    background: var(--primary-gradient);
    height: 100%;
    border-radius: 8px;
    transition: width 0.3s;
}

/* ===== НАСТРОЙКИ ===== */
.settings-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.1);
}

.settings-card h3 {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 500px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    background: var(--dark-bg);
    color: var(--text-primary);
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
}

.form-message {
    padding: 0.75rem;
    border-radius: 8px;
    display: none;
}

.form-message.success {
    display: block;
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.form-message.error {
    display: block;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.profile-info p {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.profile-info strong {
    color: var(--text-primary);
}

/* ===== НАСТРОЙКИ АККАУНТА (макет) ===== */
#settings-section.content-section.active.settings-page {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
    max-width: 920px;
}

.settings-page .section-title {
    margin-bottom: 0.35rem;
}

.account-card {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

.account-card-inner {
    position: relative;
}

.account-card-inner--profile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.75rem 2rem;
    min-height: 168px;
}

.account-profile-main {
    display: flex;
    align-items: flex-start;
    gap: 1.35rem;
    flex: 1;
    min-width: 0;
}

.account-avatar {
    flex-shrink: 0;
    width: 5.5rem;
    height: 5.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    color: #fff;
    font-size: 2rem;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}

.account-profile-body {
    flex: 1;
    min-width: 0;
}

.account-card-heading {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 1.1rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
}

.account-card-heading--solo {
    margin: 0;
}

.account-card-heading-icon {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--dash-kpi-icon-bg);
    color: #6366f1;
    font-size: 0.85rem;
}

.account-card-heading-icon--accent {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #ede9fe 0%, #e0e7ff 100%);
    color: #7c3aed;
    font-size: 1rem;
}

.account-card-heading-icon--mail {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #ede9fe 0%, #e0e7ff 100%);
    color: #7c3aed;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.account-dl {
    margin: 0;
    display: grid;
    gap: 0.85rem;
}

.account-dl-row dt {
    margin: 0 0 0.2rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    letter-spacing: 0.01em;
}

.account-dl-row dd {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 600;
    color: #0f172a;
    word-break: break-word;
}

.account-card-art {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    user-select: none;
}

.account-card-art--profile {
    width: 140px;
    margin-right: 0.5rem;
}

.account-card-art--shield,
.account-card-art--mail {
    width: 120px;
    padding: 1rem 1.25rem 1rem 0;
    align-self: center;
}

.account-art-svg {
    width: 100%;
    height: auto;
    display: block;
}

.account-card-inner--split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 0.5rem;
    padding: 1.65rem 1.75rem 1.75rem 2rem;
}

.account-card-form-col {
    min-width: 0;
    max-width: 520px;
}

.account-card-form-col--wide {
    max-width: 560px;
}

.account-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.35rem;
}

.account-card-header--stack {
    display: block;
    margin-bottom: 1.25rem;
}

.account-card-header-row {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.account-card-subtitle {
    margin: 0.35rem 0 0;
    font-size: 0.86rem;
    color: #64748b;
    line-height: 1.45;
    max-width: 28rem;
}

.account-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.account-field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.account-field label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
}

.account-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.account-input-icon {
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 1;
}

.account-input-wrap input {
    width: 100%;
    padding: 0.82rem 2.75rem 0.82rem 2.65rem;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 12px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.account-input-wrap input:focus {
    outline: none;
    border-color: #8b5cf6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.account-input-wrap input.is-valid {
    border-color: #22c55e;
    padding-right: 4.5rem;
}

.account-input-valid {
    position: absolute;
    right: 2.65rem;
    top: 50%;
    transform: translateY(-50%);
    color: #22c55e;
    font-size: 1.05rem;
    pointer-events: none;
    z-index: 1;
}

.account-input-valid:not([hidden]) {
    display: flex;
}

.account-input-toggle {
    position: absolute;
    right: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
    z-index: 2;
}

.account-input-toggle:hover {
    color: #6366f1;
    background: rgba(99, 102, 241, 0.08);
}

.account-input-toggle.is-visible {
    color: #6366f1;
}

.account-submit-btn {
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.9rem 1.25rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.28);
}

.account-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}

.account-info-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin: 0.25rem 0 0;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.06));
    border: 1px solid rgba(59, 130, 246, 0.15);
    font-size: 0.82rem;
    line-height: 1.5;
    color: #475569;
}

.account-info-banner i {
    flex-shrink: 0;
    margin-top: 0.1rem;
    color: #3b82f6;
    font-size: 1rem;
}

.settings-page .form-message {
    margin-top: 0;
}

@media (max-width: 900px) {
    .account-card-inner--profile {
        flex-direction: column;
        align-items: stretch;
        padding: 1.5rem;
    }

    .account-card-art--profile {
        width: 100%;
        max-width: 160px;
        margin: 0 auto;
    }

    .account-card-inner--split {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }

    .account-card-art--shield,
    .account-card-art--mail {
        display: none;
    }

    .account-card-form-col,
    .account-card-form-col--wide {
        max-width: none;
    }
}

/* ===== ТАРИФЫ ===== */
.current-plan-card {
    background: linear-gradient(135deg, rgba(0, 201, 255, 0.1), rgba(123, 44, 191, 0.1));
    padding: 2rem;
    border-radius: 16px;
    border: 2px solid var(--accent);
    margin-bottom: 2rem;
}

.plan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.plan-badge {
    background: var(--primary-gradient);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.plan-name {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.plan-price {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.plan-expires {
    color: var(--accent);
    font-size: 0.9rem;
}

.plan-usage {
    margin-top: 1.5rem;
}

.usage-label {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.usage-info {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.plan-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    border: 2px solid rgba(255,255,255,0.1);
    text-align: center;
    position: relative;
}

.plan-card.popular {
    border-color: var(--accent);
    box-shadow: 0 0 30px rgba(0, 201, 255, 0.2);
}

.plan-popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-gradient);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.plan-amount {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 1rem 0;
}

.plan-amount span {
    font-size: 1rem;
    color: var(--text-secondary);
}

.plan-features {
    list-style: none;
    text-align: left;
    margin: 1.5rem 0;
    color: var(--text-secondary);
}

.plan-features li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.payment-section {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    border: 1px solid rgba(255,255,255,0.1);
}

.payment-section h3 {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.payment-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
}

.balance-display {
    background: rgba(0, 201, 255, 0.1);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    text-align: center;
}

.balance-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
}

.balance-currency {
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* ===== ТРАНЗАКЦИИ ===== */
.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.transaction-item {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.1);
}

.transaction-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.transaction-status {
    font-size: 1.2rem;
}

.transaction-amount {
    font-weight: 600;
}

.transaction-date {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.transaction-details {
    text-align: right;
}

.transaction-type {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.transaction-status-text {
    font-weight: 600;
    color: var(--success);
}

/* ===== ГЕНЕРАЦИЯ ГОЛОСА ===== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.1);
}

.empty-state i {
    font-size: 4rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.empty-state p {
    color: var(--text-secondary);
}

/* ===== МОДАЛЬНЫЕ ОКНА ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 24px;
    max-width: 500px;
    width: 90%;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    margin-top: 1.5rem;
}

.preset-clone-gate-wrap {
    position: relative;
}

.preset-clone-gate-wrap--plan-blocked::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    cursor: pointer;
    border-radius: 8px;
}

.modal.dash-voice-clone-upgrade-modal.is-open {
    display: flex !important;
}

.crypto-address {
    margin: 1.5rem 0;
}

.address-box {
    display: flex;
    gap: 0.5rem;
    background: var(--dark-bg);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 0.5rem;
}

.address-box code {
    flex: 1;
    word-break: break-all;
    color: var(--accent);
}

.btn-copy {
    background: var(--accent);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
}

.crypto-wait {
    text-align: center;
    color: var(--text-secondary);
    padding: 1rem;
}

.crypto-wait i {
    font-size: 2rem;
    color: var(--warning);
    margin-bottom: 0.5rem;
}

/* ===== КНОПКИ ===== */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 201, 255, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
}

.btn-outline:hover {
    background: var(--accent);
    color: var(--dark-bg);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== НАСТРОЙКИ БЕСЕДЫ (макет) ===== */
#conversation-section.content-section.active.conversation-page {
    display: block;
    max-width: 1120px;
}

.conversation-page-head {
    margin-bottom: 1.35rem;
}

.conversation-page-head .section-title {
    margin-bottom: 0.45rem;
}

.conversation-page-lead {
    margin: 0;
    max-width: 52rem;
    font-size: 0.95rem;
    line-height: 1.55;
    color: #64748b;
}

.conversation-page-lead a {
    color: #6366f1;
    font-weight: 600;
    text-decoration: none;
}

.conversation-page-lead a:hover {
    text-decoration: underline;
}

.conversation-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.1rem;
    align-items: stretch;
}

.conv-card {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
    padding: 1.25rem 1.35rem 1.3rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.conv-card--wide {
    grid-column: 1 / -1;
}

.conv-card-head {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.conv-card-icon {
    flex-shrink: 0;
    width: 2.65rem;
    height: 2.65rem;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ede9fe 0%, #e0e7ff 100%);
    color: #7c3aed;
    font-size: 1.1rem;
    box-shadow: 0 2px 10px rgba(124, 58, 237, 0.12);
}

.conv-card-title {
    margin: 0 0 0.35rem;
    font-size: 1.02rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

.conv-card-lead {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.45;
    color: #64748b;
}

.conv-card-body {
    flex: 1;
    min-width: 0;
}

.conv-card-body--center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding-top: 0.15rem;
}

.conv-card-body--stack {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
}

.conv-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin: 0;
}

.conv-form-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
}

.conv-field-hint {
    margin: 0.35rem 0 0;
    font-size: 0.78rem;
    line-height: 1.4;
    color: #94a3b8;
}

.conv-field-hint--center {
    text-align: center;
}

.conv-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.conv-char-count {
    font-size: 0.78rem;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
}

.conversation-page .conversation-pause-control {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.45rem;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #f8fafc;
}

.conversation-page .conversation-pause-control:has(.conversation-pause-input.is-invalid) {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.conversation-page .conversation-pause-btn {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: #fff;
    color: #334155;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.conversation-page .conversation-pause-btn:hover {
    border-color: #c4b5fd;
    color: #7c3aed;
    background: #faf5ff;
}

.conversation-page .conversation-pause-value {
    display: inline-flex;
    align-items: baseline;
    gap: 0.06rem;
}

.conversation-page .conversation-pause-input {
    width: 2.35rem;
    border: none;
    background: transparent;
    text-align: right;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    padding: 0.35rem 0;
}

.conversation-page .conversation-pause-input:focus {
    outline: none;
}

.content-area .conversation-pause-input::-webkit-outer-spin-button,
.content-area .conversation-pause-input::-webkit-inner-spin-button,
.conversation-page .conversation-pause-input::-webkit-outer-spin-button,
.conversation-page .conversation-pause-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.content-area .conversation-pause-input,
.conversation-page .conversation-pause-input {
    -moz-appearance: textfield;
    appearance: textfield;
}

.conversation-page .conversation-pause-unit {
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748b;
    line-height: 1;
    margin: 0;
    padding: 0 0.1rem 0 0;
}

.conversation-page .conv-form-group select,
.conversation-page .conv-lang-col select,
.conversation-page .conv-form-group input[type="text"],
.conversation-page .conversation-context-textarea {
    width: 100%;
    max-width: none;
    padding: 0.72rem 0.9rem;
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background-color: #f8fafc;
    color: #0f172a;
    font-size: 0.92rem;
    font-family: inherit;
    box-sizing: border-box;
}

.conversation-page .conv-form-group select,
.conversation-page .conv-lang-col select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 2.35rem;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 4.5L6 8L9.5 4.5' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 0.75rem;
}

.conversation-page .conv-form-group select:focus,
.conversation-page .conv-lang-col select:focus,
.conversation-page .conv-form-group input[type="text"]:focus,
.conversation-page .conversation-context-textarea:focus {
    outline: none;
    border-color: #8b5cf6;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.conversation-page .conv-form-group select:focus,
.conversation-page .conv-lang-col select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 4.5L6 8L9.5 4.5' stroke='%237c3aed' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.conversation-page .conversation-context-textarea {
    min-height: 7.5rem;
    resize: vertical;
    line-height: 1.45;
}

.conversation-page .conversation-preset-inline-check {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #334155;
    font-weight: 500;
}

.conversation-page .conversation-preset-inline-check input[type="checkbox"] {
    margin-top: 0.15rem;
    width: 1.05rem;
    height: 1.05rem;
    accent-color: #7c3aed;
    flex-shrink: 0;
}

.conversation-page .conversation-neural-gender-seg {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.conversation-page .conversation-neural-gender-opt {
    justify-content: center;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #f8fafc;
    font-size: 0.88rem;
}

.conversation-page .conversation-neural-gender-opt:has(input:checked) {
    border-color: transparent;
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.28);
}

.conversation-page .conversation-neural-gender-opt:has(input:checked) input {
    accent-color: #fff;
}

.conversation-page .conversation-tts-row {
    max-width: none;
    width: 100%;
}

.conversation-page .conversation-tts-preview-btn {
    width: 2.65rem;
    height: 2.65rem;
    min-width: 2.65rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.conversation-page .conversation-tts-preview-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.38);
}

.conv-lang-pair {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 0.65rem;
    align-items: end;
}

.conv-lang-col {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 0;
}

.conv-lang-col label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
}

.conv-lang-swap {
    width: 2.65rem;
    height: 2.65rem;
    flex-shrink: 0;
    margin-bottom: 0.1rem;
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: #f8fafc;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.conv-lang-swap:hover {
    color: #7c3aed;
    border-color: #c4b5fd;
    background: #faf5ff;
}

.conversation-save-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem 1.25rem;
    margin-top: 1.35rem;
    padding-top: 0.25rem;
}

.conversation-save-btn {
    padding: 0.82rem 1.45rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.28);
}

.conversation-save-hint {
    margin: 0;
    flex: 1;
    min-width: 12rem;
    font-size: 0.84rem;
    line-height: 1.45;
    color: #94a3b8;
}

.conversation-save-message {
    flex-basis: 100%;
    margin: 0;
}

.conversation-save-message.success,
.conversation-save-message.error {
    display: block;
}

@media (max-width: 900px) {
    .conversation-grid {
        grid-template-columns: 1fr;
    }

    .conv-card--wide {
        grid-column: auto;
    }

    .conv-lang-pair {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .conv-lang-swap {
        margin: 0 auto;
        transform: rotate(90deg);
    }
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }
    
    .content-area {
        margin-left: 220px;
    }

    .conversation-dirty-bar {
        padding-left: calc(220px + 2rem);
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .content-area {
        margin-left: 0;
    }

    .conversation-dirty-bar {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    .dashboard-nav-cta {
        gap: 0.35rem;
    }

    .navbar .dashboard-nav-cta .btn.btn-primary {
        padding: 0.42rem 0.72rem;
        font-size: 0.82rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== ТАРИФ И БАЛАНС (макет) ===== */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

#subscription-section.content-section.active.subscription-page {
    display: block;
    max-width: 1120px;
}

.subscription-page .section-title {
    margin-bottom: 1.25rem;
}

.sub-plan-card {
    margin-bottom: 1.75rem;
}

.sub-plan-card-inner {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.65rem 1.85rem;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(224, 242, 254, 0.95) 0%, rgba(237, 233, 254, 0.92) 48%, rgba(255, 255, 255, 0.98) 100%);
    border: 1px solid #b9e6fe;
    box-shadow: 0 8px 28px rgba(59, 130, 246, 0.08);
    position: relative;
    overflow: hidden;
}

.sub-plan-card-main {
    flex: 1;
    min-width: 0;
    z-index: 1;
}

.sub-plan-head {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
}

.sub-plan-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #fff;
    font-size: 0.9rem;
}

.sub-plan-label {
    font-weight: 700;
    font-size: 0.95rem;
    color: #0f172a;
}

.sub-plan-badge {
    margin-left: auto;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    background: var(--primary-gradient);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.28);
}

.sub-plan-name {
    margin: 0 0 0.35rem;
    font-size: clamp(1.65rem, 3vw, 2rem);
    font-weight: 800;
    color: #0f172a;
    line-height: 1.15;
}

.sub-plan-price {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    color: #64748b;
}

.sub-plan-expires {
    margin: 0 0 1.15rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #0891b2;
}

.sub-plan-usage-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.45rem;
}

.sub-plan-usage-label {
    font-size: 0.88rem;
    color: #64748b;
}

.sub-plan-usage-values {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
}

.sub-plan-progress-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.1);
    overflow: hidden;
}

.sub-plan-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: var(--primary-gradient);
    transition: width 0.35s ease;
    min-width: 2px;
}

.sub-plan-decor {
    flex-shrink: 0;
    align-self: center;
    width: min(200px, 34%);
    max-width: 220px;
}

.sub-plan-decor-svg {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 12px 24px rgba(99, 102, 241, 0.2));
}

.sub-pack-activated-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    font-size: 0.95rem;
    line-height: 1.4;
}
.sub-pack-activated-notice i {
    color: #22c55e;
    margin-top: 0.1rem;
}

.sub-upgrade-block {
    margin-bottom: 2rem;
}

.sub-upgrade-head {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.sub-upgrade-head-icon {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff;
    font-size: 1rem;
}

.sub-upgrade-title {
    margin: 0 0 0.35rem;
    font-size: 1.1rem;
    font-weight: 800;
    color: #0f172a;
}

.sub-upgrade-lead {
    margin: 0;
    max-width: 52rem;
    font-size: 0.88rem;
    line-height: 1.55;
    color: #64748b;
}

.sub-upgrade-row {
    display: flex;
    align-items: stretch;
    gap: 1rem;
    flex-wrap: wrap;
}

.sub-balance-card {
    flex: 0 0 auto;
    min-width: 168px;
    padding: 1.1rem 1.15rem;
    border-radius: 14px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    position: relative;
    padding-right: 2.75rem;
}

.sub-balance-label {
    font-size: 0.78rem;
    color: #64748b;
}

.sub-balance-amount {
    font-size: 1.65rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
}

.sub-balance-icon {
    position: absolute;
    right: 0.85rem;
    bottom: 0.85rem;
    font-size: 1.35rem;
    color: #94a3b8;
    opacity: 0.85;
}

.sub-upgrade-cards {
    flex: 1;
    min-width: 0;
    display: flex;
    gap: 0.85rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    scroll-snap-type: x proximity;
}

.sub-upgrade-card {
    flex: 0 0 min(200px, 42vw);
    scroll-snap-align: start;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
    padding: 1.1rem 1rem 1rem;
    border-radius: 14px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.1);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.sub-upgrade-card--popular {
    border-color: rgba(139, 92, 246, 0.45);
    box-shadow: 0 6px 22px rgba(139, 92, 246, 0.12);
}

.sub-upgrade-popular {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    color: #fff;
    background: var(--primary-gradient);
    white-space: nowrap;
}

.sub-upgrade-card-hours {
    font-size: 0.82rem;
    font-weight: 700;
    color: #6366f1;
}

.sub-upgrade-card-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
}

.sub-upgrade-card-price {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.35rem;
}

.sub-upgrade-btn {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.sub-upgrade-btn--outline {
    color: #3b82f6;
    background: #fff;
    border: 1.5px solid #3b82f6;
}

.sub-upgrade-btn--outline:hover {
    background: rgba(59, 130, 246, 0.06);
}

.sub-upgrade-btn--primary {
    color: #fff;
    border: none;
    background: var(--primary-gradient);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.32);
}

.sub-upgrade-btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.38);
}

.sub-transactions-block {
    margin-top: 0.5rem;
}

.sub-transactions-head {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 1rem;
}

.sub-transactions-icon {
    color: #3b82f6;
    font-size: 1.05rem;
}

.sub-transactions-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
    color: #0f172a;
}

.sub-transactions-table-wrap {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.sub-transactions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.sub-transactions-table thead th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.sub-transactions-table tbody td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    vertical-align: middle;
}

.sub-transactions-table tbody tr:last-child td {
    border-bottom: none;
}

.sub-transactions-row:hover td {
    background: rgba(248, 250, 252, 0.9);
}

.sub-tx-op {
    font-weight: 600;
    color: #0f172a;
}

.sub-tx-amount {
    font-weight: 700;
    white-space: nowrap;
}

.sub-tx-amount--neg {
    color: #0f172a;
}

.sub-tx-amount--pos {
    color: #16a34a;
}

.sub-tx-date {
    color: #64748b;
    white-space: nowrap;
}

.sub-tx-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
    color: #16a34a;
    white-space: nowrap;
}
.sub-tx-status-pill--pending {
    color: #d97706;
}
.sub-tx-status-pill--failed {
    color: #dc2626;
}

.sub-tx-chevron {
    width: 2rem;
    text-align: right;
    color: #cbd5e1;
}

.sub-th-chevron {
    width: 2rem;
}

.sub-transactions-empty {
    text-align: center;
    color: #94a3b8;
    padding: 2rem 1rem !important;
}

.sub-transactions-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    margin-top: 0.85rem;
    padding: 0.65rem;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.2s;
}

.sub-transactions-more:hover {
    color: #3b82f6;
}

@media (max-width: 768px) {
    .sub-plan-card-inner {
        flex-direction: column;
        padding: 1.35rem;
    }

    .sub-plan-decor {
        width: 100%;
        max-width: 180px;
        margin: 0 auto;
    }

    .sub-plan-badge {
        margin-left: 0;
    }

    .sub-upgrade-row {
        flex-direction: column;
    }

    .sub-balance-card {
        width: 100%;
    }

    .sub-transactions-table-wrap {
        overflow-x: auto;
    }

    .sub-transactions-table {
        min-width: 560px;
    }
}

/* ===== Апгрейд тарифа (остаток срока) — legacy ===== */
.subscription-upgrade-section {
    margin-top: 2rem;
}

.subscription-upgrade-section h3 {
    margin-bottom: 0.35rem;
    font-size: 1.1rem;
}

.subscription-upgrade-balance {
    font-size: 0.95rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.upgrade-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.upgrade-option-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.upgrade-option-card h4 {
    font-size: 1.05rem;
    margin: 0;
}

.upgrade-option-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.upgrade-option-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.upgrade-option-card .btn {
    margin-top: auto;
    width: 100%;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    box-sizing: border-box;
}

.upgrade-option-card .btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ===== Статистика: PRO CTA (под блоком «Использование тарифа») ===== */
.stats-pro-cta {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    padding: 1.1rem 1.25rem 1.15rem;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 48%, #0c1222 100%);
    border: 1px solid rgba(148, 163, 184, 0.28);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.18);
}

.stats-pro-cta::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(ellipse 80% 70% at 100% 0%, rgba(139, 92, 246, 0.22), transparent 55%);
}

.stats-pro-cta-icon {
    position: relative;
    z-index: 1;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(139, 92, 246, 0.45);
    color: #f5f3ff;
    font-size: 1.15rem;
    margin-bottom: 0.65rem;
}

.stats-pro-cta-text {
    position: relative;
    z-index: 1;
    margin: 0 0 0.85rem 0;
    font-size: 0.88rem;
    line-height: 1.45;
    color: #f1f5f9;
    max-width: 36rem;
}

.stats-pro-cta-btn {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #f8fafc;
    text-decoration: none;
    padding: 0.5rem 0.85rem;
    border-radius: 10px;
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: background 0.15s, color 0.15s, filter 0.15s;
}

.stats-pro-cta-btn:hover {
    filter: brightness(1.08);
    color: #fff;
}

.sidebar .mini-stat-label {
    color: rgba(148, 163, 184, 0.95);
    font-size: 0.68rem;
}

/* ===== Страница «Статистика» (макет) ===== */
#stats-section.content-section.active {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.stats-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.stats-page-title {
    margin: 0;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #0f172a;
}

.stats-page-lead {
    margin: 0.35rem 0 0 0;
    font-size: 0.95rem;
    color: #64748b;
    max-width: 36rem;
}

.stats-date-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: #fff;
    color: #0f172a;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    cursor: default;
}

.stats-date-pill i {
    color: #3b82f6;
    opacity: 0.9;
}

.stats-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.1rem;
}

@media (max-width: 1100px) {
    .stats-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .stats-kpi-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card.stat-card--kpi {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    padding: 1.25rem 1.35rem;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
    overflow: visible;
}

.stat-kpi-top {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.stat-kpi-icon {
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dash-kpi-icon-bg);
    color: #2563eb;
    font-size: 1.25rem;
}

.stat-kpi-main .stat-value {
    font-size: 1.85rem;
    line-height: 1.1;
}

.stat-kpi-main .stat-label {
    margin-top: 0.2rem;
    font-size: 0.82rem;
}

.stat-trend {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 600;
}

.stat-trend--up {
    color: #16a34a;
}

.stat-trend--flat {
    color: #64748b;
}

.stat-trend--neutral {
    color: #64748b;
}

.stat-trend--down {
    color: #dc2626;
}

.stats-chart-empty {
    margin: 0;
    padding: 2rem 1rem;
    text-align: center;
    font-size: 0.9rem;
    color: #64748b;
}

.stat-spark {
    height: 36px;
    width: 100%;
    margin-top: 0.15rem;
}

.stat-spark-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.stat-spark-tip {
    position: absolute;
    z-index: 4;
    pointer-events: none;
    padding: 0.35rem 0.55rem 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #0f172a;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
    white-space: normal;
    transform: translate(-50%, calc(-100% - 6px));
    line-height: 1.25;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.15rem;
    max-width: 11rem;
}

.stat-spark-tip-val {
    font-weight: 700;
    font-size: 0.75rem;
    color: #0f172a;
}

.stat-spark-tip-date {
    font-weight: 600;
    font-size: 0.65rem;
    color: #64748b;
    line-height: 1.2;
}

.stat-spark-tip:not([hidden]) {
    display: flex;
}

.stat-spark-tip[hidden] {
    display: none;
}

.stat-spark-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.stat-spark-vis {
    opacity: 0.35;
    transition: opacity 0.12s ease;
}

.stat-spark-wrap:hover .stat-spark-vis {
    opacity: 0.55;
}

.stat-spark-pt.is-active .stat-spark-vis {
    opacity: 1 !important;
}

/* Карточка тарифа */
.stats-plan-card {
    background: var(--card-bg);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    padding: 1.35rem 1.5rem 1.25rem;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.stats-plan-title {
    margin: 0 0 1rem 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
}

.stats-plan-progress-block {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.stats-plan-track.progress-bar-container {
    height: 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
}

.stats-plan-track .progress-bar {
    border-radius: 999px;
    background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 100%);
}

.stats-plan-scale {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: #94a3b8;
    padding: 0 0.1rem;
}

.stats-plan-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.88rem;
    font-weight: 600;
    color: #0f172a;
}

.stats-plan-banner {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: linear-gradient(90deg, rgba(219, 234, 254, 0.95) 0%, rgba(237, 233, 254, 0.75) 100%);
    border: 1px solid rgba(59, 130, 246, 0.18);
    font-size: 0.84rem;
    line-height: 1.45;
    color: #1e3a5f;
}

.stats-plan-manage {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 1rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
}

.stats-plan-manage:hover {
    color: #1d4ed8;
}

.stats-plan-manage i {
    font-size: 0.75rem;
}

/* Графики */
.stats-charts-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 1.1rem;
    align-items: stretch;
}

@media (max-width: 1024px) {
    .stats-charts-grid {
        grid-template-columns: 1fr;
    }
}

.stats-chart-card {
    background: var(--card-bg);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    padding: 1.15rem 1.25rem 1.25rem;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
    min-height: 280px;
    display: flex;
    flex-direction: column;
}

.stats-chart-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.stats-chart-title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
    color: #0f172a;
}

.stats-chart-pill {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: #f1f5f9;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.stats-line-mount {
    flex: 1;
    min-height: 220px;
}

.stats-line-mount .stats-line-wrap {
    position: relative;
    width: 100%;
    z-index: 0;
}

.stats-line-mount .stats-line-wrap > svg {
    width: 100%;
    height: auto;
    display: block;
}

.stats-line-chart-tip {
    z-index: 6;
}

.stats-line-wrap .stats-line-dot {
    opacity: 0.88;
    transition: opacity 0.12s ease;
}

.stats-line-wrap:hover .stats-line-dot {
    opacity: 0.55;
}

.stats-line-pt.is-active .stats-line-dot {
    opacity: 1 !important;
}

.stats-line-hit {
    cursor: default;
}

.stats-donut-row {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex: 1;
    flex-wrap: wrap;
}

.stats-donut-visual {
    flex: 0 0 auto;
    width: 200px;
    max-width: 100%;
}

.stats-donut-visual .stats-donut-wrap {
    position: relative;
    width: 100%;
}

.stats-donut-visual .stats-donut-wrap > svg {
    width: 100%;
    height: auto;
    display: block;
}

.stats-donut-tip {
    z-index: 6;
}

.stats-donut-hit {
    cursor: default;
    pointer-events: stroke;
}

.stats-donut-vis {
    pointer-events: none;
    transition: opacity 0.12s ease, stroke-width 0.12s ease;
}

.stats-donut-wrap:hover .stats-donut-vis {
    opacity: 0.55;
}

.stats-donut-seg.is-active .stats-donut-vis {
    opacity: 1 !important;
    stroke-width: 26;
}

.stats-donut-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.stats-donut-legend li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.82rem;
    color: #334155;
}

.stats-donut-legend .dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    margin-right: 0.45rem;
    flex-shrink: 0;
}

.stats-donut-legend .lbl {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.stats-donut-legend-empty {
    justify-content: center;
    color: #64748b;
    font-size: 0.88rem;
}

.stats-donut-center-label {
    font-size: 0.68rem;
    fill: #64748b;
    font-weight: 600;
}

.stats-donut-center-value {
    font-size: 1.05rem;
    fill: #0f172a;
    font-weight: 800;
}

/* Админ: статистика сервиса (user id=1) */
.sidebar-item--admin[hidden] {
    display: none !important;
}

.admin-usage-period {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.admin-usage-period-btn {
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.admin-usage-period-btn:hover {
    color: var(--text-primary);
    border-color: rgba(139, 92, 246, 0.55);
}

.admin-usage-period-btn.is-active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.35), rgba(139, 92, 246, 0.35));
    color: #fff;
    border-color: transparent;
}

.admin-usage-kpi {
    margin-bottom: 1.25rem;
}

.admin-usage-chart-card {
    margin-bottom: 1.25rem;
}

.admin-usage-table-wrap {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 1rem 1.1rem 1.15rem;
}

.admin-usage-table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.65rem;
}

.admin-usage-table-hint {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0 0 0.75rem;
}

.admin-usage-table-scroll {
    overflow-x: auto;
}

.admin-usage-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.admin-usage-table th,
.admin-usage-table td {
    padding: 0.55rem 0.65rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    vertical-align: top;
}

.admin-usage-table th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.admin-usage-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.06);
}

.admin-usage-email {
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.admin-usage-user-cell {
    min-width: 10rem;
}

/* Кнопка открытия мастера VB-Cable / Zoom на странице «Настройки беседы» */
.conversation-conf-setup-actions {
    margin: 0 0 1.5rem;
}