/* ============================================
   AI-Office — Theme System
   ============================================ */

/* Dark Theme (default) */
:root, [data-theme="dark"] {
    --neon-primary: #00e5ff;
    --neon-secondary: #7c4dff;
    --neon-accent: #00e676;
    --neon-pink: #ff4081;
    --neon-glow: 0 0 10px rgba(0, 229, 255, 0.3), 0 0 20px rgba(0, 229, 255, 0.1);
    --bg-dark: #0a0e17;
    --bg-card: #111827;
    --bg-card-hover: #1a2332;
    --bg-sidebar: #0d1321;
    --bg-input: #1a2332;
    --border-color: #1e293b;
    --border-neon: rgba(0, 229, 255, 0.2);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-main: #e2e8f0; /* alias */
    --text-color: #e2e8f0;
    --bg-main: #0b1020;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.3);
    --btn-close-filter: invert(1);
    --code-bg: rgba(0, 229, 255, 0.08);
    --pre-bg: rgba(0, 0, 0, 0.3);
    --msg-system-bg: rgba(0, 229, 255, 0.05);
    --msg-user-bg: rgba(124, 77, 255, 0.1);
    --msg-user-border: rgba(124, 77, 255, 0.3);
    --avatar-neon-bg: rgba(0, 229, 255, 0.1);
    --avatar-user-bg: rgba(124, 77, 255, 0.1);
    --table-th-bg: rgba(0, 229, 255, 0.08);
    --admin-msg-agent-bg: rgba(0, 229, 255, 0.05);
    --admin-msg-user-bg: rgba(124, 77, 255, 0.05);
    --admin-msg-system-bg: rgba(0, 230, 118, 0.05);
}

/* Light Theme */
[data-theme="light"] {
    --neon-primary: #0097a7;
    --neon-secondary: #5e35b1;
    --neon-accent: #2e7d32;
    --neon-pink: #c2185b;
    --neon-glow: 0 0 10px rgba(0, 151, 167, 0.2), 0 0 20px rgba(0, 151, 167, 0.08);
    --bg-dark: #f0f2f5;
    --bg-card: #ffffff;
    --bg-card-hover: #f8f9fa;
    --bg-sidebar: #ffffff;
    --bg-input: #f5f6f8;
    --border-color: #e0e4e8;
    --border-neon: rgba(0, 151, 167, 0.25);
    --text-primary: #1a1a2e;
    --text-secondary: #5a6070;
    --text-muted: #8a90a0;
    --text-main: #1a1a2e;
    --text-color: #1a1a2e;
    --bg-main: #ffffff;
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.08);
    --btn-close-filter: none;
    --code-bg: rgba(0, 151, 167, 0.08);
    --pre-bg: #f5f6f8;
    --msg-system-bg: rgba(0, 151, 167, 0.06);
    --msg-user-bg: rgba(94, 53, 177, 0.06);
    --msg-user-border: rgba(94, 53, 177, 0.2);
    --avatar-neon-bg: rgba(0, 151, 167, 0.1);
    --avatar-user-bg: rgba(94, 53, 177, 0.1);
    --table-th-bg: rgba(0, 151, 167, 0.06);
    --admin-msg-agent-bg: rgba(0, 151, 167, 0.05);
    --admin-msg-user-bg: rgba(94, 53, 177, 0.05);
    --admin-msg-system-bg: rgba(46, 125, 50, 0.05);
}

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

body {
    font-family: 'Onest', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--neon-primary); }

/* ---- Neon Utilities ---- */
.text-neon { color: var(--neon-primary) !important; }

.btn-neon {
    background: linear-gradient(135deg, var(--neon-primary), var(--neon-secondary));
    border: none;
    color: #fff;
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 0.5rem 1.25rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.btn-neon:hover {
    transform: translateY(-1px);
    box-shadow: var(--neon-glow);
    color: #fff;
}
.btn-neon:active { transform: translateY(0); }

.btn-outline-neon {
    border: 1px solid var(--neon-primary);
    color: var(--neon-primary);
    background: transparent;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.btn-outline-neon:hover {
    background: rgba(0, 229, 255, 0.1);
    color: var(--neon-primary);
    box-shadow: var(--neon-glow);
}

.bg-neon { background: linear-gradient(135deg, var(--neon-primary), var(--neon-secondary)) !important; }
.bg-neon-subtle { background: rgba(0, 229, 255, 0.15) !important; color: var(--neon-primary) !important; }
.border-neon { border-color: var(--border-neon) !important; }
.bg-dark-card { background: var(--bg-card) !important; border: 1px solid var(--border-color); }

/* ---- Auth Pages ---- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-dark);
}

.auth-container {
    width: 100%;
    max-width: 440px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-card);
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}
.auth-logo i {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    display: block;
    filter: drop-shadow(0 0 20px rgba(0, 229, 255, 0.5));
}
.auth-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--neon-primary), var(--neon-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.auth-tabs .nav-link {
    flex: 1;
    text-align: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}
.auth-tabs .nav-link.active {
    background: linear-gradient(135deg, var(--neon-primary), var(--neon-secondary));
    color: #fff;
    border-color: transparent;
}

.auth-form .form-control {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
}
.auth-form .form-control:focus {
    border-color: var(--neon-primary);
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.1);
    background: var(--bg-input);
    color: var(--text-primary);
}
.auth-form .form-floating label {
    color: var(--text-muted);
}

/* ---- App Layout ---- */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    width: 260px;
    min-height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.logo i {
    font-size: 1.75rem;
    filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.5));
}
.logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--neon-primary), var(--neon-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    list-style: none;
    padding: 1rem 0.75rem;
    flex: 1;
}
.sidebar-nav .nav-item { margin-bottom: 0.25rem; }
.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    text-decoration: none;
    font-weight: 500;
}
.sidebar-nav .nav-link:hover {
    background: rgba(0, 229, 255, 0.05);
    color: var(--text-primary);
}
.sidebar-nav .nav-link.active {
    background: rgba(0, 229, 255, 0.1);
    color: var(--neon-primary);
    border-left: 3px solid var(--neon-primary);
}
.sidebar-nav .nav-link i { font-size: 1.2rem; }

/* Группы пунктов в sidebar */
.sidebar-group-title {
    list-style: none;
    padding: 0.8rem 1.5rem 0.35rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0.55;
}
.sidebar-group-title:first-child { padding-top: 0.35rem; }

/* Бейдж счётчика у пунктов меню */
.sidebar-nav .nav-link .nav-badge {
    margin-left: auto;
    background: var(--accent, #00d4ff);
    color: #0a0f1a;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 1.4em;
    padding: 0.1em 0.5em;
    border-radius: 0.75rem;
    line-height: 1.3;
    text-align: center;
}
.sidebar-nav .nav-link.active .nav-badge { background: #fff; color: #0a0f1a; }


.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.user-avatar-small i { font-size: 2rem; color: var(--neon-primary); }
.user-details { display: flex; flex-direction: column; }
.user-name { font-size: 0.875rem; font-weight: 600; }
.user-coins { font-size: 0.75rem; color: var(--neon-primary); }

/* ---- Main Content ---- */
.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-area {
    padding: 2rem;
    flex: 1;
}

.topbar {
    padding: 0.75rem 1rem;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.topbar-title { font-weight: 600; }

/* ---- Page Header ---- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.page-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ---- Agents Cards ---- */
.agent-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: var(--transition);
    height: 100%;
}
.agent-card:hover {
    border-color: var(--border-neon);
    box-shadow: var(--neon-glow);
    transform: translateY(-2px);
}
.agent-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.agent-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--neon-primary);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--avatar-neon-bg);
}
.agent-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.agent-name { font-weight: 600; margin-bottom: 0.25rem; }
.agent-role { font-size: 0.75rem; }
.agent-card-body { margin-bottom: 1rem; }
.agent-model {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.agent-card-actions {
    display: flex;
    gap: 0.5rem;
}

/* Avatar Picker */
.avatar-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.avatar-option {
    cursor: pointer;
}
.avatar-option input { display: none; }
.avatar-option img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    transition: var(--transition);
    padding: 2px;
}
.avatar-option input:checked + img {
    border-color: var(--neon-primary);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
}
.avatar-option:hover img {
    border-color: var(--neon-primary);
}

/* Agent Selector (in new topic modal) */
.agent-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.agent-select-card {
    cursor: pointer;
}
.agent-checkbox { display: none; }
.agent-select-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    transition: var(--transition);
    min-width: 100px;
    text-align: center;
}
.agent-checkbox:checked + .agent-select-inner {
    border-color: var(--neon-primary);
    background: var(--avatar-neon-bg);
    box-shadow: var(--neon-glow);
}
.agent-select-inner:hover {
    border-color: var(--border-neon);
}
.agent-select-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}
.agent-select-name { font-size: 0.8rem; font-weight: 600; }
.agent-select-role { font-size: 0.7rem; color: var(--text-muted); }

/* ---- Chat Layout ---- */
.chat-layout {
    display: flex;
    height: calc(100vh - 64px);
    margin: -2rem;
}

/* Topics Sidebar */
.topics-sidebar {
    width: 280px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: var(--bg-sidebar);
    flex-shrink: 0;
}
.topics-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.topics-header h5 { margin: 0; font-size: 0.95rem; }
.topics-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.topic-item {
    display: flex;
    align-items: center;
    border-radius: var(--radius-sm);
    margin-bottom: 2px;
    transition: var(--transition);
    position: relative;
}
.topic-item:hover { background: rgba(0, 229, 255, 0.05); }
.topic-item.active {
    background: rgba(0, 229, 255, 0.1);
    border-left: 3px solid var(--neon-primary);
}
.topic-link {
    flex: 1;
    padding: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.topic-title {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.topic-meta { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }

.topic-delete-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
    border-radius: 4px;
}
.topic-item:hover .topic-delete-btn { opacity: 1; }
.topic-delete-btn:hover { color: #ef4444; background: rgba(239, 68, 68, 0.1); }

.empty-topics {
    padding: 2rem 1rem;
    text-align: center;
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-card);
}
.chat-header-info { flex: 1; }
.chat-header-info h5 { margin: 0; font-size: 0.95rem; }
.chat-agents-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.25rem;
}
.agent-badge-avatar {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 2px;
}

/* Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    display: flex;
    gap: 0.75rem;
    max-width: 85%;
    animation: fadeIn 0.4s ease-out;
}
.message-agent { align-self: flex-start; }
.message-user { align-self: flex-end; flex-direction: row-reverse; }
.message-system { align-self: center; max-width: 90%; }

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--neon-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--avatar-neon-bg);
}
.message-avatar img { width: 100%; height: 100%; object-fit: cover; }
.message-avatar.user-avatar {
    border-color: var(--neon-secondary);
    background: var(--avatar-user-bg);
}
.message-avatar.user-avatar i { font-size: 1.5rem; color: var(--neon-secondary); }

.message-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
}
.message-user .message-content {
    background: var(--msg-user-bg);
    border-color: var(--msg-user-border);
}

.message-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}
.message-name { font-weight: 600; font-size: 0.85rem; }
.message-role { font-size: 0.7rem; }
.message-time { font-size: 0.7rem; color: var(--text-muted); margin-left: auto; }
.message-text {
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Markdown content in agent messages */
.message-text.markdown-body {
    white-space: normal;
}
.message-text.markdown-body p {
    margin: 0 0 0.5em 0;
}
.message-text.markdown-body p:last-child {
    margin-bottom: 0;
}
.message-text.markdown-body ul,
.message-text.markdown-body ol {
    margin: 0.3em 0 0.5em 0;
    padding-left: 1.4em;
}
.message-text.markdown-body li {
    margin-bottom: 0.2em;
}
.message-text.markdown-body h1,
.message-text.markdown-body h2,
.message-text.markdown-body h3,
.message-text.markdown-body h4 {
    margin: 0.6em 0 0.3em 0;
    font-size: 1em;
    font-weight: 600;
    color: var(--neon-primary);
}
.message-text.markdown-body h1 { font-size: 1.1em; }
.message-text.markdown-body h2 { font-size: 1.05em; }
.message-text.markdown-body strong {
    color: var(--text-primary);
    font-weight: 600;
}
.message-text.markdown-body code {
    background: var(--code-bg);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.85em;
    color: var(--neon-primary);
}
.message-text.markdown-body pre {
    background: var(--pre-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75em 1em;
    margin: 0.5em 0;
    overflow-x: auto;
}
.message-text.markdown-body pre code {
    background: none;
    padding: 0;
    color: var(--text-primary);
}
.message-text.markdown-body blockquote {
    border-left: 3px solid var(--neon-primary);
    padding-left: 0.75em;
    margin: 0.5em 0;
    color: var(--text-secondary);
}
.message-text.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5em 0;
    font-size: 0.85em;
}
.message-text.markdown-body th,
.message-text.markdown-body td {
    border: 1px solid var(--border-color);
    padding: 0.4em 0.6em;
}
.message-text.markdown-body th {
    background: var(--table-th-bg);
    font-weight: 600;
}
.message-text.markdown-body a {
    color: var(--neon-primary);
    text-decoration: underline;
}
.message-text.markdown-body hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 0.75em 0;
}

.message-system .message-text {
    background: var(--msg-system-bg);
    border: 1px solid var(--border-neon);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: var(--neon-primary);
    text-align: center;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.5rem;
}
.typing-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--neon-primary);
}
.typing-avatar img { width: 100%; height: 100%; }
.typing-content {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.typing-dots {
    display: flex;
    gap: 3px;
}
.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--neon-primary);
    animation: typingDot 1.4s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
    0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
    30% { opacity: 1; transform: scale(1); }
}

/* Chat Input */
.chat-input-area {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
}
.chat-input-area .input-group {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}
.chat-input-area .input-group:focus-within {
    border-color: var(--neon-primary);
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.1);
}
.chat-input-area textarea {
    background: transparent;
    border: none;
    color: var(--text-primary);
    resize: none;
    padding: 0.75rem 1rem;
    max-height: 150px;
}
.chat-input-area textarea:focus {
    box-shadow: none;
    background: transparent;
    color: var(--text-primary);
}
.chat-input-area .btn-neon {
    border-radius: 0;
    padding: 0.75rem 1.25rem;
}

.chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}
.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}
.empty-state h4 { margin-bottom: 0.5rem; }

/* ---- Tariff / Balance ---- */
.balance-card {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.1), rgba(124, 77, 255, 0.1));
    border: 1px solid var(--border-neon);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.balance-icon i {
    font-size: 3rem;
    color: var(--neon-primary);
    filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.5));
}
.balance-info { display: flex; flex-direction: column; }
.balance-label { font-size: 0.8rem; color: var(--text-muted); }
.balance-amount {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--neon-primary), var(--neon-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.balance-unit { font-size: 0.85rem; color: var(--text-secondary); }

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 100%;
}
.info-card i { font-size: 2rem; color: var(--neon-secondary); }
.info-card div { display: flex; flex-direction: column; }
.info-label { font-size: 0.8rem; color: var(--text-muted); }
.info-value { font-size: 1.25rem; font-weight: 600; }

.package-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.package-card:hover {
    border-color: var(--border-neon);
    box-shadow: var(--neon-glow);
    transform: translateY(-3px);
}
.package-label {
    font-size: 0.8rem;
    color: var(--neon-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}
.package-coins {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.package-coins i { color: var(--neon-primary); }
.package-price {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}
.package-per-coin {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* ---- Settings Card ---- */
.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    height: 100%;
}
.settings-card h5 {
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ---- Tables ---- */
.table-dark-custom {
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--border-color);
    color: var(--text-primary);
}
.table-dark-custom th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-neon);
}
.table-dark-custom td {
    font-size: 0.875rem;
    vertical-align: middle;
}

/* ---- Admin ---- */
.admin-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.admin-tabs .nav-link {
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}
.admin-tabs .nav-link.active {
    background: linear-gradient(135deg, var(--neon-primary), var(--neon-secondary));
    color: #fff;
    border-color: transparent;
}
.admin-tabs .nav-link:hover:not(.active) {
    border-color: var(--border-neon);
}

.admin-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.admin-chat-view {
    max-height: 600px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}
.admin-msg {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
}
.admin-msg-agent { background: var(--admin-msg-agent-bg); border-left: 3px solid var(--neon-primary); }
.admin-msg-user { background: var(--admin-msg-user-bg); border-left: 3px solid var(--neon-secondary); }
.admin-msg-system { background: var(--admin-msg-system-bg); border-left: 3px solid var(--neon-accent); }
.admin-msg-meta { font-size: 0.8rem; margin-bottom: 0.25rem; }
.admin-msg-text { font-size: 0.9rem; line-height: 1.5; }

/* ---- Form Controls (global overrides) ---- */
.form-control, .form-select {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
}
.form-control:focus, .form-select:focus {
    background: var(--bg-input);
    color: var(--text-primary);
    border-color: var(--neon-primary);
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.1);
}
.form-label { font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); }
.form-select option { background: var(--bg-card); }

/* ---- Modal overrides ---- */
.modal-content.bg-dark-card .modal-header { background: var(--bg-sidebar); }
.modal-content.bg-dark-card .btn-close { filter: var(--btn-close-filter); }

/* ---- Alerts ---- */
.alert { border-radius: var(--radius-sm); }

/* ---- Animations ---- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.4s ease-out; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .chat-layout {
        flex-direction: column;
    }
    .topics-sidebar {
        width: 100%;
        height: auto;
        max-height: 300px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        display: none;
    }
    .topics-sidebar.open {
        display: flex;
    }
    .content-area { padding: 1rem; }
    .page-header h2 { font-size: 1.2rem; }
    .balance-amount { font-size: 2rem; }
    .message { max-width: 95%; }
}

/* ---- Theme Toggle ---- */
.theme-toggle-btn {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    width: 100%;
    justify-content: center;
}
.theme-toggle-btn:hover {
    border-color: var(--border-neon);
    color: var(--neon-primary);
    background: var(--avatar-neon-bg);
}
.theme-toggle-btn i { font-size: 1rem; }

/* Light theme specific overrides */
[data-theme="light"] .bg-dark-card {
    background: var(--bg-card) !important;
    border-color: var(--border-color);
}
[data-theme="light"] .bg-neon-subtle {
    background: rgba(0, 151, 167, 0.1) !important;
    color: var(--neon-primary) !important;
}
[data-theme="light"] .auth-logo i {
    filter: drop-shadow(0 0 12px rgba(0, 151, 167, 0.3));
}
[data-theme="light"] .logo i {
    filter: drop-shadow(0 0 8px rgba(0, 151, 167, 0.3));
}
[data-theme="light"] .sidebar {
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .sidebar-nav .nav-link:hover {
    background: rgba(0, 151, 167, 0.06);
}
[data-theme="light"] .sidebar-nav .nav-link.active {
    background: rgba(0, 151, 167, 0.1);
}
[data-theme="light"] .topic-item:hover {
    background: rgba(0, 151, 167, 0.05);
}
[data-theme="light"] .topic-item.active {
    background: rgba(0, 151, 167, 0.08);
}
[data-theme="light"] .btn-outline-neon:hover {
    background: rgba(0, 151, 167, 0.08);
}
[data-theme="light"] .balance-card {
    background: linear-gradient(135deg, rgba(0, 151, 167, 0.08), rgba(94, 53, 177, 0.08));
}
[data-theme="light"] .agent-card:hover {
    box-shadow: 0 4px 20px rgba(0, 151, 167, 0.12);
}
[data-theme="light"] .chat-input-area .input-group:focus-within {
    box-shadow: 0 0 0 3px rgba(0, 151, 167, 0.1);
}
[data-theme="light"] .auth-form .form-control:focus {
    box-shadow: 0 0 0 3px rgba(0, 151, 167, 0.1);
}
[data-theme="light"] .form-control:focus,
[data-theme="light"] .form-select:focus {
    box-shadow: 0 0 0 3px rgba(0, 151, 167, 0.1);
}
[data-theme="light"] .typing-avatar {
    border-color: var(--neon-primary);
}
[data-theme="light"] .table-dark-custom th {
    border-bottom-color: var(--border-neon);
}
[data-theme="light"] .chat-header {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .topics-sidebar {
    box-shadow: 1px 0 4px rgba(0, 0, 0, 0.05);
}

/* ---- List Group overrides ---- */
.list-group-item {
    border-color: var(--border-color);
    color: var(--text-primary);
}

/* ---- Unread messages badge ---- */
.unread-badge {
    position: absolute;
    bottom: 80px;
    right: 24px;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--neon-primary);
    color: var(--bg-dark);
    font-weight: 700;
    font-size: 14px;
    border-radius: 16px;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 229, 255, 0.4);
    z-index: 10;
    transition: transform 0.2s ease;
    animation: unreadPulse 0.3s ease;
}
.unread-badge:hover {
    transform: scale(1.1);
}
@keyframes unreadPulse {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ============================================
   Image Generator Module Styles
   ============================================ */

.image-model-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.image-model-card {
    cursor: pointer;
    display: block;
}

.image-model-card input[type="radio"] {
    display: none;
}

.image-model-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    transition: var(--transition);
    text-align: center;
}

.image-model-card input[type="radio"]:checked + .image-model-inner {
    border-color: var(--neon-primary);
    background: rgba(0, 229, 255, 0.08);
    box-shadow: var(--neon-glow);
}

.image-model-card:hover .image-model-inner {
    border-color: var(--neon-primary);
    background: var(--bg-card-hover);
}

.image-model-name {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.image-model-price {
    font-size: 0.75rem;
    color: var(--neon-accent);
    font-weight: 600;
}

.image-model-price .bi-coin {
    color: var(--neon-accent);
}

.generated-image-wrap {
    margin: 4px 0;
    max-width: 512px;
}

.generated-image {
    width: 100%;
    max-width: 512px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
}

.generated-image:hover {
    border-color: var(--neon-primary);
    box-shadow: var(--neon-glow);
}

.image-caption {
    margin: 0;
}

.image-cost-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
}

.image-cost-hint .bi-coin {
    color: var(--neon-accent);
}

.image-cost-hint strong {
    color: var(--neon-accent);
}

.btn-outline-neon {
    color: var(--neon-primary);
    border-color: var(--neon-primary);
    background: transparent;
    font-size: 0.75rem;
    padding: 2px 8px;
}

.btn-outline-neon:hover {
    background: rgba(0, 229, 255, 0.1);
    color: var(--neon-primary);
    border-color: var(--neon-primary);
}

@media (max-width: 576px) {
    .image-model-selector {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 8px;
    }

    .image-model-inner {
        padding: 8px 6px;
    }

    .generated-image-wrap {
        max-width: 100%;
    }

    .generated-image {
        max-width: 100%;
    }
}

/* Image Generator: Settings Bar */
.img-settings-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 8px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    align-items: center;
}

.img-settings-bar:empty {
    display: none;
}

.img-setting-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.img-setting-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.img-setting-label .bi {
    font-size: 0.85rem;
    color: var(--neon-primary);
}

.img-setting-pills {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.img-setting-pill {
    padding: 3px 10px;
    font-size: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.img-setting-pill:hover {
    border-color: var(--neon-primary);
    color: var(--text-primary);
}

.img-setting-pill.active {
    border-color: var(--neon-primary);
    background: rgba(0, 229, 255, 0.12);
    color: var(--neon-primary);
    font-weight: 500;
}

.pill-price {
    font-size: 0.65rem;
    opacity: 0.7;
    color: var(--neon-accent);
}

.img-setting-pill.active .pill-price {
    opacity: 1;
}

@media (max-width: 576px) {
    .img-settings-bar {
        gap: 8px;
        padding: 6px 10px;
    }

    .img-setting-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
    }

    .img-setting-pill {
        padding: 2px 8px;
        font-size: 0.7rem;
    }
}

/* Image Generator: Download button on hover */
.generated-image-wrap {
    position: relative;
    display: inline-block;
}

.img-download-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
    z-index: 2;
    backdrop-filter: blur(4px);
}

.generated-image-wrap:hover .img-download-btn {
    opacity: 1;
}

.img-download-btn:hover {
    background: var(--neon-primary);
    color: var(--bg-dark);
}

/* Lightbox fullscreen overlay */
.img-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    backdrop-filter: blur(8px);
}

.img-lightbox.active {
    display: flex;
}

.lightbox-img {
    max-width: 92vw;
    max-height: 90vh;
    border-radius: var(--radius);
    box-shadow: 0 0 60px rgba(0, 229, 255, 0.15);
    cursor: default;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.lightbox-close:hover {
    background: rgba(255, 60, 60, 0.7);
}

.lightbox-download {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 28px;
    border-radius: 30px;
    border: 1px solid var(--neon-primary);
    background: rgba(0, 0, 0, 0.6);
    color: var(--neon-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(4px);
}

.lightbox-download:hover {
    background: var(--neon-primary);
    color: var(--bg-dark);
}

@media (max-width: 576px) {
    .lightbox-img {
        max-width: 98vw;
        max-height: 85vh;
        border-radius: var(--radius-sm);
    }

    .lightbox-download {
        bottom: 16px;
        padding: 8px 20px;
        font-size: 0.8rem;
    }

    .img-download-btn {
        opacity: 1;
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
        top: 6px;
        right: 6px;
    }
}

/* Video Generator: player & actions */
.generated-video-wrap {
    position: relative;
    display: inline-block;
    max-width: 512px;
    width: 100%;
    margin: 4px 0;
}

.generated-video {
    width: 100%;
    max-width: 512px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: #000;
}

.video-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.generated-video-wrap:hover .video-actions {
    opacity: 1;
}

.vid-action-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.65);
    color: #fff;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
    text-decoration: none;
    backdrop-filter: blur(4px);
}

.vid-action-btn:hover {
    background: var(--neon-primary);
    color: var(--bg-dark);
}

/* Video Lightbox */
.vid-lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.94);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    backdrop-filter: blur(8px);
}

.vid-lightbox.active {
    display: flex;
}

.vid-lightbox-video {
    max-width: 92vw;
    max-height: 85vh;
    border-radius: var(--radius);
    cursor: default;
}

@media (max-width: 576px) {
    .generated-video-wrap { max-width: 100%; }
    .generated-video { max-width: 100%; }
    .video-actions { opacity: 1; }
    .vid-lightbox-video { max-width: 98vw; max-height: 80vh; }
}

/* Tariff: top-up card */
.topup-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
}

.topup-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.topup-preset-btn {
    padding: 6px 16px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.topup-preset-btn:hover,
.topup-preset-btn.active {
    border-color: var(--neon-primary);
    background: rgba(0, 229, 255, 0.1);
    color: var(--neon-primary);
}

.topup-form .input-group {
    max-width: 500px;
}

.topup-form .form-control-lg {
    font-size: 1.1rem;
}

/* Pagination neon style */
.pagination .page-link {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.pagination .page-link:hover {
    background: var(--bg-card-hover);
    border-color: var(--neon-primary);
    color: var(--neon-primary);
}

.pagination .page-item.active .page-link {
    background: var(--neon-primary);
    border-color: var(--neon-primary);
    color: var(--bg-dark);
}

.pagination .page-item.disabled .page-link {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-muted);
}

@media (max-width: 576px) {
    .topup-presets { gap: 6px; }
    .topup-preset-btn { padding: 4px 12px; font-size: 0.8rem; }
    .topup-form .input-group { max-width: 100%; }
}

/* Document attachment in chat */
.chat-attachment-bar {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.chat-attachment-bar.active {
    display: flex;
}

.chat-attachment-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--neon-primary);
}

.chat-attachment-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 6px;
    font-size: 1rem;
}

.chat-attachment-remove:hover {
    color: var(--neon-pink);
}

.attach-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    padding: 8px;
    cursor: pointer;
    transition: color 0.2s;
}

.attach-btn:hover {
    color: var(--neon-primary);
}

.message-attachment {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid var(--border-neon);
    border-radius: var(--radius-sm);
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--neon-primary);
    text-decoration: none;
    transition: background 0.2s;
}

.message-attachment:hover {
    background: rgba(0, 229, 255, 0.15);
    color: var(--neon-primary);
}

.message-attachment .bi {
    font-size: 1rem;
}

/* Attachment in new task modal */
.task-attachment-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.task-attachment-info {
    flex: 1;
    font-size: 0.85rem;
    color: var(--neon-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-attachment-status {
    font-size: 0.8rem;
    color: var(--neon-accent);
}

/* Settings: neon tabs */
.nav-tabs-neon {
    border-bottom: 1px solid var(--border-color);
}

.nav-tabs-neon .nav-link {
    color: var(--text-secondary);
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 20px;
    font-size: 0.9rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-tabs-neon .nav-link:hover {
    color: var(--text-primary);
    border-bottom-color: var(--border-color);
}

.nav-tabs-neon .nav-link.active {
    color: var(--neon-primary);
    border-bottom-color: var(--neon-primary);
    background: transparent;
}

.nav-tabs-neon .nav-link .bi {
    font-size: 1rem;
}

@media (max-width: 576px) {
    .nav-tabs-neon .nav-link {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}

/* Task status stickers in sidebar */
.task-status-sticker {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-right: 4px;
    vertical-align: middle;
}

.task-status-active {
    background: rgba(0, 230, 118, 0.15);
    color: var(--neon-accent);
    border: 1px solid rgba(0, 230, 118, 0.3);
}

.task-status-done {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.task-status-cancelled {
    background: rgba(255, 64, 129, 0.1);
    color: var(--neon-pink);
    border: 1px solid rgba(255, 64, 129, 0.2);
}

.btn-outline-danger {
    font-size: 0.75rem;
    padding: 2px 8px;
}

/* Image-to-video preview bar */
.i2v-preview-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.i2v-preview-bar.d-none { display: none !important; }

.i2v-preview-thumb {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid var(--border-neon);
}

.i2v-preview-label {
    color: var(--neon-primary);
    font-weight: 500;
    font-size: 0.75rem;
    white-space: nowrap;
}

.i2v-preview-name {
    color: var(--text-secondary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.i2v-upload-status {
    font-size: 0.75rem;
    white-space: nowrap;
}
/* ============================================
   AI-Office — Theme System
   ============================================ */

/* Dark Theme (default) */
:root, [data-theme="dark"] {
    --neon-primary: #00e5ff;
    --neon-secondary: #7c4dff;
    --neon-accent: #00e676;
    --neon-pink: #ff4081;
    --neon-glow: 0 0 10px rgba(0, 229, 255, 0.3), 0 0 20px rgba(0, 229, 255, 0.1);
    --bg-dark: #0a0e17;
    --bg-card: #111827;
    --bg-card-hover: #1a2332;
    --bg-sidebar: #0d1321;
    --bg-input: #1a2332;
    --border-color: #1e293b;
    --border-neon: rgba(0, 229, 255, 0.2);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-main: #e2e8f0; /* alias */
    --text-color: #e2e8f0;
    --bg-main: #0b1020;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.3);
    --btn-close-filter: invert(1);
    --code-bg: rgba(0, 229, 255, 0.08);
    --pre-bg: rgba(0, 0, 0, 0.3);
    --msg-system-bg: rgba(0, 229, 255, 0.05);
    --msg-user-bg: rgba(124, 77, 255, 0.1);
    --msg-user-border: rgba(124, 77, 255, 0.3);
    --avatar-neon-bg: rgba(0, 229, 255, 0.1);
    --avatar-user-bg: rgba(124, 77, 255, 0.1);
    --table-th-bg: rgba(0, 229, 255, 0.08);
    --admin-msg-agent-bg: rgba(0, 229, 255, 0.05);
    --admin-msg-user-bg: rgba(124, 77, 255, 0.05);
    --admin-msg-system-bg: rgba(0, 230, 118, 0.05);
}

/* Light Theme */
[data-theme="light"] {
    --neon-primary: #0097a7;
    --neon-secondary: #5e35b1;
    --neon-accent: #2e7d32;
    --neon-pink: #c2185b;
    --neon-glow: 0 0 10px rgba(0, 151, 167, 0.2), 0 0 20px rgba(0, 151, 167, 0.08);
    --bg-dark: #f0f2f5;
    --bg-card: #ffffff;
    --bg-card-hover: #f8f9fa;
    --bg-sidebar: #ffffff;
    --bg-input: #f5f6f8;
    --border-color: #e0e4e8;
    --border-neon: rgba(0, 151, 167, 0.25);
    --text-primary: #1a1a2e;
    --text-secondary: #5a6070;
    --text-muted: #8a90a0;
    --text-main: #1a1a2e;
    --text-color: #1a1a2e;
    --bg-main: #ffffff;
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.08);
    --btn-close-filter: none;
    --code-bg: rgba(0, 151, 167, 0.08);
    --pre-bg: #f5f6f8;
    --msg-system-bg: rgba(0, 151, 167, 0.06);
    --msg-user-bg: rgba(94, 53, 177, 0.06);
    --msg-user-border: rgba(94, 53, 177, 0.2);
    --avatar-neon-bg: rgba(0, 151, 167, 0.1);
    --avatar-user-bg: rgba(94, 53, 177, 0.1);
    --table-th-bg: rgba(0, 151, 167, 0.06);
    --admin-msg-agent-bg: rgba(0, 151, 167, 0.05);
    --admin-msg-user-bg: rgba(94, 53, 177, 0.05);
    --admin-msg-system-bg: rgba(46, 125, 50, 0.05);
}

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

body {
    font-family: 'Onest', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--neon-primary); }

/* ---- Neon Utilities ---- */
.text-neon { color: var(--neon-primary) !important; }

.btn-neon {
    background: linear-gradient(135deg, var(--neon-primary), var(--neon-secondary));
    border: none;
    color: #fff;
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 0.5rem 1.25rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.btn-neon:hover {
    transform: translateY(-1px);
    box-shadow: var(--neon-glow);
    color: #fff;
}
.btn-neon:active { transform: translateY(0); }

.btn-outline-neon {
    border: 1px solid var(--neon-primary);
    color: var(--neon-primary);
    background: transparent;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.btn-outline-neon:hover {
    background: rgba(0, 229, 255, 0.1);
    color: var(--neon-primary);
    box-shadow: var(--neon-glow);
}

.bg-neon { background: linear-gradient(135deg, var(--neon-primary), var(--neon-secondary)) !important; }
.bg-neon-subtle { background: rgba(0, 229, 255, 0.15) !important; color: var(--neon-primary) !important; }
.border-neon { border-color: var(--border-neon) !important; }
.bg-dark-card { background: var(--bg-card) !important; border: 1px solid var(--border-color); }

/* ---- Auth Pages ---- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-dark);
}

.auth-container {
    width: 100%;
    max-width: 440px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-card);
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}
.auth-logo i {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    display: block;
    filter: drop-shadow(0 0 20px rgba(0, 229, 255, 0.5));
}
.auth-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--neon-primary), var(--neon-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.auth-tabs .nav-link {
    flex: 1;
    text-align: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}
.auth-tabs .nav-link.active {
    background: linear-gradient(135deg, var(--neon-primary), var(--neon-secondary));
    color: #fff;
    border-color: transparent;
}

.auth-form .form-control {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
}
.auth-form .form-control:focus {
    border-color: var(--neon-primary);
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.1);
    background: var(--bg-input);
    color: var(--text-primary);
}
.auth-form .form-floating label {
    color: var(--text-muted);
}

/* ---- App Layout ---- */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    width: 260px;
    min-height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.logo i {
    font-size: 1.75rem;
    filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.5));
}
.logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--neon-primary), var(--neon-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    list-style: none;
    padding: 1rem 0.75rem;
    flex: 1;
}
.sidebar-nav .nav-item { margin-bottom: 0.25rem; }
.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    text-decoration: none;
    font-weight: 500;
}
.sidebar-nav .nav-link:hover {
    background: rgba(0, 229, 255, 0.05);
    color: var(--text-primary);
}
.sidebar-nav .nav-link.active {
    background: rgba(0, 229, 255, 0.1);
    color: var(--neon-primary);
    border-left: 3px solid var(--neon-primary);
}
.sidebar-nav .nav-link i { font-size: 1.2rem; }

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.user-avatar-small i { font-size: 2rem; color: var(--neon-primary); }
.user-details { display: flex; flex-direction: column; }
.user-name { font-size: 0.875rem; font-weight: 600; }
.user-coins { font-size: 0.75rem; color: var(--neon-primary); }

/* ---- Main Content ---- */
.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-area {
    padding: 2rem;
    flex: 1;
}

.topbar {
    padding: 0.75rem 1rem;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.topbar-title { font-weight: 600; }

/* ---- Page Header ---- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.page-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ---- Agents Cards ---- */
.agent-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: var(--transition);
    height: 100%;
}
.agent-card:hover {
    border-color: var(--border-neon);
    box-shadow: var(--neon-glow);
    transform: translateY(-2px);
}
.agent-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.agent-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--neon-primary);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--avatar-neon-bg);
}
.agent-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.agent-name { font-weight: 600; margin-bottom: 0.25rem; }
.agent-role { font-size: 0.75rem; }
.agent-card-body { margin-bottom: 1rem; }
.agent-model {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.agent-card-actions {
    display: flex;
    gap: 0.5rem;
}

/* Avatar Picker */
.avatar-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.avatar-option {
    cursor: pointer;
}
.avatar-option input { display: none; }
.avatar-option img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    transition: var(--transition);
    padding: 2px;
}
.avatar-option input:checked + img {
    border-color: var(--neon-primary);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
}
.avatar-option:hover img {
    border-color: var(--neon-primary);
}

/* Agent Selector (in new topic modal) */
.agent-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.agent-select-card {
    cursor: pointer;
}
.agent-checkbox { display: none; }
.agent-select-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    transition: var(--transition);
    min-width: 100px;
    text-align: center;
}
.agent-checkbox:checked + .agent-select-inner {
    border-color: var(--neon-primary);
    background: var(--avatar-neon-bg);
    box-shadow: var(--neon-glow);
}
.agent-select-inner:hover {
    border-color: var(--border-neon);
}
.agent-select-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}
.agent-select-name { font-size: 0.8rem; font-weight: 600; }
.agent-select-role { font-size: 0.7rem; color: var(--text-muted); }

/* ---- Chat Layout ---- */
.chat-layout {
    display: flex;
    height: calc(100vh - 64px);
    margin: -2rem;
}

/* Topics Sidebar */
.topics-sidebar {
    width: 280px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: var(--bg-sidebar);
    flex-shrink: 0;
}
.topics-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.topics-header h5 { margin: 0; font-size: 0.95rem; }
.topics-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.topic-item {
    display: flex;
    align-items: center;
    border-radius: var(--radius-sm);
    margin-bottom: 2px;
    transition: var(--transition);
    position: relative;
}
.topic-item:hover { background: rgba(0, 229, 255, 0.05); }
.topic-item.active {
    background: rgba(0, 229, 255, 0.1);
    border-left: 3px solid var(--neon-primary);
}
.topic-link {
    flex: 1;
    padding: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.topic-title {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.topic-meta { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }

.topic-delete-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
    border-radius: 4px;
}
.topic-item:hover .topic-delete-btn { opacity: 1; }
.topic-delete-btn:hover { color: #ef4444; background: rgba(239, 68, 68, 0.1); }

.empty-topics {
    padding: 2rem 1rem;
    text-align: center;
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-card);
}
.chat-header-info { flex: 1; }
.chat-header-info h5 { margin: 0; font-size: 0.95rem; }
.chat-agents-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.25rem;
}
.agent-badge-avatar {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 2px;
}

/* Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    display: flex;
    gap: 0.75rem;
    max-width: 85%;
    animation: fadeIn 0.4s ease-out;
}
.message-agent { align-self: flex-start; }
.message-user { align-self: flex-end; flex-direction: row-reverse; }
.message-system { align-self: center; max-width: 90%; }

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--neon-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--avatar-neon-bg);
}
.message-avatar img { width: 100%; height: 100%; object-fit: cover; }
.message-avatar.user-avatar {
    border-color: var(--neon-secondary);
    background: var(--avatar-user-bg);
}
.message-avatar.user-avatar i { font-size: 1.5rem; color: var(--neon-secondary); }

.message-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
}
.message-user .message-content {
    background: var(--msg-user-bg);
    border-color: var(--msg-user-border);
}

.message-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}
.message-name { font-weight: 600; font-size: 0.85rem; }
.message-role { font-size: 0.7rem; }
.message-time { font-size: 0.7rem; color: var(--text-muted); margin-left: auto; }
.message-text {
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Markdown content in agent messages */
.message-text.markdown-body {
    white-space: normal;
}
.message-text.markdown-body p {
    margin: 0 0 0.5em 0;
}
.message-text.markdown-body p:last-child {
    margin-bottom: 0;
}
.message-text.markdown-body ul,
.message-text.markdown-body ol {
    margin: 0.3em 0 0.5em 0;
    padding-left: 1.4em;
}
.message-text.markdown-body li {
    margin-bottom: 0.2em;
}
.message-text.markdown-body h1,
.message-text.markdown-body h2,
.message-text.markdown-body h3,
.message-text.markdown-body h4 {
    margin: 0.6em 0 0.3em 0;
    font-size: 1em;
    font-weight: 600;
    color: var(--neon-primary);
}
.message-text.markdown-body h1 { font-size: 1.1em; }
.message-text.markdown-body h2 { font-size: 1.05em; }
.message-text.markdown-body strong {
    color: var(--text-primary);
    font-weight: 600;
}
.message-text.markdown-body code {
    background: var(--code-bg);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.85em;
    color: var(--neon-primary);
}
.message-text.markdown-body pre {
    background: var(--pre-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75em 1em;
    margin: 0.5em 0;
    overflow-x: auto;
}
.message-text.markdown-body pre code {
    background: none;
    padding: 0;
    color: var(--text-primary);
}
.message-text.markdown-body blockquote {
    border-left: 3px solid var(--neon-primary);
    padding-left: 0.75em;
    margin: 0.5em 0;
    color: var(--text-secondary);
}
.message-text.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5em 0;
    font-size: 0.85em;
}
.message-text.markdown-body th,
.message-text.markdown-body td {
    border: 1px solid var(--border-color);
    padding: 0.4em 0.6em;
}
.message-text.markdown-body th {
    background: var(--table-th-bg);
    font-weight: 600;
}
.message-text.markdown-body a {
    color: var(--neon-primary);
    text-decoration: underline;
}
.message-text.markdown-body hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 0.75em 0;
}

.message-system .message-text {
    background: var(--msg-system-bg);
    border: 1px solid var(--border-neon);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: var(--neon-primary);
    text-align: center;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.5rem;
}
.typing-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--neon-primary);
}
.typing-avatar img { width: 100%; height: 100%; }
.typing-content {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.typing-dots {
    display: flex;
    gap: 3px;
}
.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--neon-primary);
    animation: typingDot 1.4s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
    0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
    30% { opacity: 1; transform: scale(1); }
}

/* Chat Input */
.chat-input-area {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
}
.chat-input-area .input-group {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}
.chat-input-area .input-group:focus-within {
    border-color: var(--neon-primary);
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.1);
}
.chat-input-area textarea {
    background: transparent;
    border: none;
    color: var(--text-primary);
    resize: none;
    padding: 0.75rem 1rem;
    max-height: 150px;
}
.chat-input-area textarea:focus {
    box-shadow: none;
    background: transparent;
    color: var(--text-primary);
}
.chat-input-area .btn-neon {
    border-radius: 0;
    padding: 0.75rem 1.25rem;
}

.chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}
.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}
.empty-state h4 { margin-bottom: 0.5rem; }

/* ---- Tariff / Balance ---- */
.balance-card {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.1), rgba(124, 77, 255, 0.1));
    border: 1px solid var(--border-neon);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.balance-icon i {
    font-size: 3rem;
    color: var(--neon-primary);
    filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.5));
}
.balance-info { display: flex; flex-direction: column; }
.balance-label { font-size: 0.8rem; color: var(--text-muted); }
.balance-amount {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--neon-primary), var(--neon-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.balance-unit { font-size: 0.85rem; color: var(--text-secondary); }

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 100%;
}
.info-card i { font-size: 2rem; color: var(--neon-secondary); }
.info-card div { display: flex; flex-direction: column; }
.info-label { font-size: 0.8rem; color: var(--text-muted); }
.info-value { font-size: 1.25rem; font-weight: 600; }

.package-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.package-card:hover {
    border-color: var(--border-neon);
    box-shadow: var(--neon-glow);
    transform: translateY(-3px);
}
.package-label {
    font-size: 0.8rem;
    color: var(--neon-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}
.package-coins {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.package-coins i { color: var(--neon-primary); }
.package-price {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}
.package-per-coin {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* ---- Settings Card ---- */
.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    height: 100%;
}
.settings-card h5 {
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ---- Tables ---- */
.table-dark-custom {
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--border-color);
    color: var(--text-primary);
}
.table-dark-custom th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-neon);
}
.table-dark-custom td {
    font-size: 0.875rem;
    vertical-align: middle;
}

/* ---- Admin ---- */
.admin-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.admin-tabs .nav-link {
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}
.admin-tabs .nav-link.active {
    background: linear-gradient(135deg, var(--neon-primary), var(--neon-secondary));
    color: #fff;
    border-color: transparent;
}
.admin-tabs .nav-link:hover:not(.active) {
    border-color: var(--border-neon);
}

.admin-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.admin-chat-view {
    max-height: 600px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}
.admin-msg {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
}
.admin-msg-agent { background: var(--admin-msg-agent-bg); border-left: 3px solid var(--neon-primary); }
.admin-msg-user { background: var(--admin-msg-user-bg); border-left: 3px solid var(--neon-secondary); }
.admin-msg-system { background: var(--admin-msg-system-bg); border-left: 3px solid var(--neon-accent); }
.admin-msg-meta { font-size: 0.8rem; margin-bottom: 0.25rem; }
.admin-msg-text { font-size: 0.9rem; line-height: 1.5; }

/* ---- Form Controls (global overrides) ---- */
.form-control, .form-select {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
}
.form-control:focus, .form-select:focus {
    background: var(--bg-input);
    color: var(--text-primary);
    border-color: var(--neon-primary);
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.1);
}
.form-label { font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); }
.form-select option { background: var(--bg-card); }

/* ---- Modal overrides ---- */
.modal-content.bg-dark-card .modal-header { background: var(--bg-sidebar); }
.modal-content.bg-dark-card .btn-close { filter: var(--btn-close-filter); }

/* ---- Alerts ---- */
.alert { border-radius: var(--radius-sm); }

/* ---- Animations ---- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.4s ease-out; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .chat-layout {
        flex-direction: column;
    }
    .topics-sidebar {
        width: 100%;
        height: auto;
        max-height: 300px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        display: none;
    }
    .topics-sidebar.open {
        display: flex;
    }
    .content-area { padding: 1rem; }
    .page-header h2 { font-size: 1.2rem; }
    .balance-amount { font-size: 2rem; }
    .message { max-width: 95%; }
}

/* ---- Theme Toggle ---- */
.theme-toggle-btn {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    width: 100%;
    justify-content: center;
}
.theme-toggle-btn:hover {
    border-color: var(--border-neon);
    color: var(--neon-primary);
    background: var(--avatar-neon-bg);
}
.theme-toggle-btn i { font-size: 1rem; }

/* Light theme specific overrides */
[data-theme="light"] .bg-dark-card {
    background: var(--bg-card) !important;
    border-color: var(--border-color);
}
[data-theme="light"] .bg-neon-subtle {
    background: rgba(0, 151, 167, 0.1) !important;
    color: var(--neon-primary) !important;
}
[data-theme="light"] .auth-logo i {
    filter: drop-shadow(0 0 12px rgba(0, 151, 167, 0.3));
}
[data-theme="light"] .logo i {
    filter: drop-shadow(0 0 8px rgba(0, 151, 167, 0.3));
}
[data-theme="light"] .sidebar {
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .sidebar-nav .nav-link:hover {
    background: rgba(0, 151, 167, 0.06);
}
[data-theme="light"] .sidebar-nav .nav-link.active {
    background: rgba(0, 151, 167, 0.1);
}
[data-theme="light"] .topic-item:hover {
    background: rgba(0, 151, 167, 0.05);
}
[data-theme="light"] .topic-item.active {
    background: rgba(0, 151, 167, 0.08);
}
[data-theme="light"] .btn-outline-neon:hover {
    background: rgba(0, 151, 167, 0.08);
}
[data-theme="light"] .balance-card {
    background: linear-gradient(135deg, rgba(0, 151, 167, 0.08), rgba(94, 53, 177, 0.08));
}
[data-theme="light"] .agent-card:hover {
    box-shadow: 0 4px 20px rgba(0, 151, 167, 0.12);
}
[data-theme="light"] .chat-input-area .input-group:focus-within {
    box-shadow: 0 0 0 3px rgba(0, 151, 167, 0.1);
}
[data-theme="light"] .auth-form .form-control:focus {
    box-shadow: 0 0 0 3px rgba(0, 151, 167, 0.1);
}
[data-theme="light"] .form-control:focus,
[data-theme="light"] .form-select:focus {
    box-shadow: 0 0 0 3px rgba(0, 151, 167, 0.1);
}
[data-theme="light"] .typing-avatar {
    border-color: var(--neon-primary);
}
[data-theme="light"] .table-dark-custom th {
    border-bottom-color: var(--border-neon);
}
[data-theme="light"] .chat-header {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .topics-sidebar {
    box-shadow: 1px 0 4px rgba(0, 0, 0, 0.05);
}

/* ---- List Group overrides ---- */
.list-group-item {
    border-color: var(--border-color);
    color: var(--text-primary);
}

/* ---- Unread messages badge ---- */
.unread-badge {
    position: absolute;
    bottom: 80px;
    right: 24px;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--neon-primary);
    color: var(--bg-dark);
    font-weight: 700;
    font-size: 14px;
    border-radius: 16px;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 229, 255, 0.4);
    z-index: 10;
    transition: transform 0.2s ease;
    animation: unreadPulse 0.3s ease;
}
.unread-badge:hover {
    transform: scale(1.1);
}
@keyframes unreadPulse {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ============================================
   Image Generator Module Styles
   ============================================ */

.image-model-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.image-model-card {
    cursor: pointer;
    display: block;
}

.image-model-card input[type="radio"] {
    display: none;
}

.image-model-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    transition: var(--transition);
    text-align: center;
}

.image-model-card input[type="radio"]:checked + .image-model-inner {
    border-color: var(--neon-primary);
    background: rgba(0, 229, 255, 0.08);
    box-shadow: var(--neon-glow);
}

.image-model-card:hover .image-model-inner {
    border-color: var(--neon-primary);
    background: var(--bg-card-hover);
}

.image-model-name {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.image-model-price {
    font-size: 0.75rem;
    color: var(--neon-accent);
    font-weight: 600;
}

.image-model-price .bi-coin {
    color: var(--neon-accent);
}

.generated-image-wrap {
    margin: 4px 0;
    max-width: 512px;
}

.generated-image {
    width: 100%;
    max-width: 512px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
}

.generated-image:hover {
    border-color: var(--neon-primary);
    box-shadow: var(--neon-glow);
}

.image-caption {
    margin: 0;
}

.image-cost-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
}

.image-cost-hint .bi-coin {
    color: var(--neon-accent);
}

.image-cost-hint strong {
    color: var(--neon-accent);
}

.btn-outline-neon {
    color: var(--neon-primary);
    border-color: var(--neon-primary);
    background: transparent;
    font-size: 0.75rem;
    padding: 2px 8px;
}

.btn-outline-neon:hover {
    background: rgba(0, 229, 255, 0.1);
    color: var(--neon-primary);
    border-color: var(--neon-primary);
}

@media (max-width: 576px) {
    .image-model-selector {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 8px;
    }

    .image-model-inner {
        padding: 8px 6px;
    }

    .generated-image-wrap {
        max-width: 100%;
    }

    .generated-image {
        max-width: 100%;
    }
}

/* Image Generator: Settings Bar */
.img-settings-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 8px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    align-items: center;
}

.img-settings-bar:empty {
    display: none;
}

.img-setting-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.img-setting-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.img-setting-label .bi {
    font-size: 0.85rem;
    color: var(--neon-primary);
}

.img-setting-pills {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.img-setting-pill {
    padding: 3px 10px;
    font-size: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.img-setting-pill:hover {
    border-color: var(--neon-primary);
    color: var(--text-primary);
}

.img-setting-pill.active {
    border-color: var(--neon-primary);
    background: rgba(0, 229, 255, 0.12);
    color: var(--neon-primary);
    font-weight: 500;
}

.pill-price {
    font-size: 0.65rem;
    opacity: 0.7;
    color: var(--neon-accent);
}

.img-setting-pill.active .pill-price {
    opacity: 1;
}

@media (max-width: 576px) {
    .img-settings-bar {
        gap: 8px;
        padding: 6px 10px;
    }

    .img-setting-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
    }

    .img-setting-pill {
        padding: 2px 8px;
        font-size: 0.7rem;
    }
}

/* Image Generator: Download button on hover */
.generated-image-wrap {
    position: relative;
    display: inline-block;
}

.img-download-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
    z-index: 2;
    backdrop-filter: blur(4px);
}

.generated-image-wrap:hover .img-download-btn {
    opacity: 1;
}

.img-download-btn:hover {
    background: var(--neon-primary);
    color: var(--bg-dark);
}

/* Lightbox fullscreen overlay */
.img-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    backdrop-filter: blur(8px);
}

.img-lightbox.active {
    display: flex;
}

.lightbox-img {
    max-width: 92vw;
    max-height: 90vh;
    border-radius: var(--radius);
    box-shadow: 0 0 60px rgba(0, 229, 255, 0.15);
    cursor: default;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.lightbox-close:hover {
    background: rgba(255, 60, 60, 0.7);
}

.lightbox-download {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 28px;
    border-radius: 30px;
    border: 1px solid var(--neon-primary);
    background: rgba(0, 0, 0, 0.6);
    color: var(--neon-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(4px);
}

.lightbox-download:hover {
    background: var(--neon-primary);
    color: var(--bg-dark);
}

@media (max-width: 576px) {
    .lightbox-img {
        max-width: 98vw;
        max-height: 85vh;
        border-radius: var(--radius-sm);
    }

    .lightbox-download {
        bottom: 16px;
        padding: 8px 20px;
        font-size: 0.8rem;
    }

    .img-download-btn {
        opacity: 1;
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
        top: 6px;
        right: 6px;
    }
}

/* Video Generator: player & actions */
.generated-video-wrap {
    position: relative;
    display: inline-block;
    max-width: 512px;
    width: 100%;
    margin: 4px 0;
}

.generated-video {
    width: 100%;
    max-width: 512px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: #000;
}

.video-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.generated-video-wrap:hover .video-actions {
    opacity: 1;
}

.vid-action-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.65);
    color: #fff;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
    text-decoration: none;
    backdrop-filter: blur(4px);
}

.vid-action-btn:hover {
    background: var(--neon-primary);
    color: var(--bg-dark);
}

/* Video Lightbox */
.vid-lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.94);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    backdrop-filter: blur(8px);
}

.vid-lightbox.active {
    display: flex;
}

.vid-lightbox-video {
    max-width: 92vw;
    max-height: 85vh;
    border-radius: var(--radius);
    cursor: default;
}

@media (max-width: 576px) {
    .generated-video-wrap { max-width: 100%; }
    .generated-video { max-width: 100%; }
    .video-actions { opacity: 1; }
    .vid-lightbox-video { max-width: 98vw; max-height: 80vh; }
}

/* Tariff: top-up card */
.topup-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
}

.topup-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.topup-preset-btn {
    padding: 6px 16px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.topup-preset-btn:hover,
.topup-preset-btn.active {
    border-color: var(--neon-primary);
    background: rgba(0, 229, 255, 0.1);
    color: var(--neon-primary);
}

.topup-form .input-group {
    max-width: 500px;
}

.topup-form .form-control-lg {
    font-size: 1.1rem;
}

/* Pagination neon style */
.pagination .page-link {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.pagination .page-link:hover {
    background: var(--bg-card-hover);
    border-color: var(--neon-primary);
    color: var(--neon-primary);
}

.pagination .page-item.active .page-link {
    background: var(--neon-primary);
    border-color: var(--neon-primary);
    color: var(--bg-dark);
}

.pagination .page-item.disabled .page-link {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-muted);
}

@media (max-width: 576px) {
    .topup-presets { gap: 6px; }
    .topup-preset-btn { padding: 4px 12px; font-size: 0.8rem; }
    .topup-form .input-group { max-width: 100%; }
}

/* Document attachment in chat */
.chat-attachment-bar {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.chat-attachment-bar.active {
    display: flex;
}

.chat-attachment-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--neon-primary);
}

.chat-attachment-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 6px;
    font-size: 1rem;
}

.chat-attachment-remove:hover {
    color: var(--neon-pink);
}

.attach-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    padding: 8px;
    cursor: pointer;
    transition: color 0.2s;
}

.attach-btn:hover {
    color: var(--neon-primary);
}

.message-attachment {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid var(--border-neon);
    border-radius: var(--radius-sm);
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--neon-primary);
    text-decoration: none;
    transition: background 0.2s;
}

.message-attachment:hover {
    background: rgba(0, 229, 255, 0.15);
    color: var(--neon-primary);
}

.message-attachment .bi {
    font-size: 1rem;
}

/* Attachment in new task modal */
.task-attachment-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.task-attachment-info {
    flex: 1;
    font-size: 0.85rem;
    color: var(--neon-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-attachment-status {
    font-size: 0.8rem;
    color: var(--neon-accent);
}

/* Settings: neon tabs */
.nav-tabs-neon {
    border-bottom: 1px solid var(--border-color);
}

.nav-tabs-neon .nav-link {
    color: var(--text-secondary);
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 20px;
    font-size: 0.9rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-tabs-neon .nav-link:hover {
    color: var(--text-primary);
    border-bottom-color: var(--border-color);
}

.nav-tabs-neon .nav-link.active {
    color: var(--neon-primary);
    border-bottom-color: var(--neon-primary);
    background: transparent;
}

.nav-tabs-neon .nav-link .bi {
    font-size: 1rem;
}

@media (max-width: 576px) {
    .nav-tabs-neon .nav-link {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}

/* Task status stickers in sidebar */
.task-status-sticker {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-right: 4px;
    vertical-align: middle;
}

.task-status-active {
    background: rgba(0, 230, 118, 0.15);
    color: var(--neon-accent);
    border: 1px solid rgba(0, 230, 118, 0.3);
}

.task-status-done {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.task-status-cancelled {
    background: rgba(255, 64, 129, 0.1);
    color: var(--neon-pink);
    border: 1px solid rgba(255, 64, 129, 0.2);
}

.btn-outline-danger {
    font-size: 0.75rem;
    padding: 2px 8px;
}

/* Image-to-video preview bar */
.i2v-preview-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.i2v-preview-bar.d-none { display: none !important; }

.i2v-preview-thumb {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid var(--border-neon);
}

.i2v-preview-label {
    color: var(--neon-primary);
    font-weight: 500;
    font-size: 0.75rem;
    white-space: nowrap;
}

.i2v-preview-name {
    color: var(--text-secondary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.i2v-upload-status {
    font-size: 0.75rem;
    white-space: nowrap;
}

/* i2v attachment thumbnail in user message */
.message-i2v-attach {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 4px 10px;
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid var(--border-neon);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
}

.i2v-msg-thumb {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    object-fit: cover;
}

.i2v-msg-label {
    color: var(--neon-primary);
    font-size: 0.75rem;
}

/* ============================================
   Designer module
   ============================================ */

/* ----- Список проектов ----- */
.designer-projects-table tbody tr:hover {
    background: var(--bg-card-hover);
}
.designer-thumb-link { display: inline-block; }
.designer-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}
.designer-thumb:hover {
    border-color: var(--border-neon);
    box-shadow: var(--neon-glow);
}
.designer-thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 229, 255, 0.05);
    color: var(--neon-primary);
    font-size: 1.6rem;
}
.designer-project-title {
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}
.designer-project-title:hover {
    color: var(--neon-primary);
}
.designer-pagination .pagination .page-link {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}
.designer-pagination .pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--neon-primary), var(--neon-secondary));
    border-color: transparent;
    color: #fff;
}
.designer-pagination .pagination .page-item.disabled .page-link {
    background: transparent;
    color: var(--text-muted);
    opacity: 0.5;
}
.designer-pagination .pagination .page-link:hover {
    border-color: var(--border-neon);
    color: var(--neon-primary);
    background: rgba(0, 229, 255, 0.05);
}

/* ----- Плитки выбора типа ----- */
.designer-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}
.designer-tile {
    --tile-color: var(--neon-primary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.75rem 1.25rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    min-height: 200px;
    position: relative;
    overflow: hidden;
}
.designer-tile::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, var(--tile-color), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.designer-tile:hover {
    border-color: var(--tile-color);
    transform: translateY(-3px);
    box-shadow: 0 4px 25px rgba(0,0,0,0.25), 0 0 20px rgba(0, 229, 255, 0.15);
    color: var(--text-primary);
}
.designer-tile:hover::before { opacity: 0.08; }
.designer-tile-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(0, 229, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tile-color);
    font-size: 2rem;
    transition: var(--transition);
    z-index: 1;
}
.designer-tile:hover .designer-tile-icon {
    background: rgba(0, 229, 255, 0.15);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.25);
}
.designer-tile-name {
    font-size: 1.1rem;
    font-weight: 600;
    z-index: 1;
}
.designer-tile-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
    z-index: 1;
}

/* ----- Форма параметров ----- */
.designer-form .form-control,
.designer-form .form-select {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}
.designer-form .form-control:focus,
.designer-form .form-select:focus {
    border-color: var(--neon-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 229, 255, 0.15);
    background: var(--bg-input);
    color: var(--text-primary);
}
.designer-form .form-control-color {
    padding: 4px;
    height: 38px;
}
.designer-cost-box {
    background: rgba(0, 229, 255, 0.05);
    border: 1px solid var(--border-neon);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    margin-top: 0.5rem;
}
.designer-cost-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}
.designer-cost-line + .designer-cost-line {
    margin-top: 0.35rem;
}
.designer-cost-line strong {
    font-size: 1.15rem;
    color: var(--neon-primary);
}

/* ----- Страница run ----- */
.designer-params-list {
    margin: 0;
    display: flex;
    flex-direction: column;
}
.designer-params-list dt {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.6;
    margin: 0 0 0.15rem 0;
}
.designer-params-list dd {
    margin: 0 0 0.6rem 0;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
    font-size: 0.92rem;
    word-break: break-word;
    line-height: 1.35;
}
.designer-params-list dd:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.designer-progress {
    margin-bottom: 1rem;
}
.designer-progress-bar {
    background: var(--bg-input);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.designer-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-primary), var(--neon-secondary));
    border-radius: 4px;
    transition: width 0.4s ease;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
}
.designer-progress-text {
    color: var(--text-secondary);
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.designer-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.designer-result-item {
    position: relative;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.designer-result-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    cursor: zoom-in;
    transition: transform 0.2s;
}
.designer-result-img:hover { transform: scale(1.02); }
.designer-result-item .img-download-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border-neon);
    color: var(--neon-primary);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}
.designer-result-item:hover .img-download-btn { opacity: 1; }
.designer-result-item .img-download-btn:hover {
    background: rgba(0, 229, 255, 0.2);
}

/* ----- Bg-neon-subtle для бейджа в списке ----- */
.bg-neon-subtle {
    background: rgba(0, 229, 255, 0.12) !important;
    color: var(--neon-primary) !important;
    border: 1px solid var(--border-neon);
}


/* ===================== REF IMAGE UPLOAD ===================== */
.designer-ref-upload { margin-top: 0.25rem; }
.designer-ref-preview {
    width: 72px;
    height: 72px;
    border: 2px dashed var(--border-color);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--input-bg);
}
.designer-ref-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ===================== ПРЕЗЕНТАЦИЯ ===================== */

/* Quill editor */
.pres-editor-wrap {
    min-height: 300px;
    border-radius: 0.5rem;
    overflow: hidden;
}
.pres-editor-wrap .ql-toolbar {
    border-color: var(--border-color) !important;
    background: var(--card-bg);
}
.pres-editor-wrap .ql-container {
    border-color: var(--border-color) !important;
    font-size: 0.95rem;
    min-height: 260px;
}
.pres-editor-wrap .ql-editor {
    color: var(--text-color);
    min-height: 260px;
}
.pres-editor-wrap .ql-editor.ql-blank::before {
    color: var(--text-muted);
    font-style: normal;
}
[data-theme="dark"] .pres-editor-wrap .ql-toolbar .ql-stroke { stroke: #aaa; }
[data-theme="dark"] .pres-editor-wrap .ql-toolbar .ql-fill { fill: #aaa; }
[data-theme="dark"] .pres-editor-wrap .ql-toolbar .ql-picker-label { color: #aaa; }
[data-theme="dark"] .pres-editor-wrap .ql-toolbar button:hover .ql-stroke { stroke: #fff; }

/* Upload zone */
.pres-upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 0.75rem;
    padding: 2.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
}
.pres-upload-zone i {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
    color: var(--neon-primary);
}
.pres-upload-zone:hover,
.pres-upload-zone.dragover {
    border-color: var(--neon-primary);
    background: rgba(0, 229, 255, 0.05);
}
.pres-upload-preview {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem;
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: pre-wrap;
}

/* Logo preview */
.pres-logo-preview {
    width: 64px;
    height: 64px;
    border: 2px dashed var(--border-color);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    overflow: hidden;
    flex-shrink: 0;
}
.pres-logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Tabs */
.pres-tabs .nav-link {
    color: var(--text-muted);
    border-color: transparent;
}
.pres-tabs .nav-link.active {
    color: var(--neon-primary);
    background: transparent;
    border-bottom-color: var(--neon-primary);
}

/* Step progress for presentation run */
.pres-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 1.5rem 0;
}
.pres-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    min-width: 80px;
}
.pres-step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.3s;
}
.pres-step.active .pres-step-circle {
    border-color: var(--neon-primary);
    color: var(--neon-primary);
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.3);
    animation: presStepPulse 1.5s infinite;
}
.pres-step.done .pres-step-circle {
    background: var(--neon-primary);
    border-color: var(--neon-primary);
    color: #000;
}
.pres-step-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}
.pres-step.active .pres-step-label { color: var(--neon-primary); }
.pres-step.done .pres-step-label { color: var(--text-color); }

.pres-step-line {
    flex: 1;
    height: 2px;
    background: var(--border-color);
    margin: 0 0.25rem;
    margin-bottom: 1.5rem;
    min-width: 20px;
    max-width: 60px;
}

@keyframes presStepPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(0, 229, 255, 0.2); }
    50% { box-shadow: 0 0 18px rgba(0, 229, 255, 0.5); }
}

/* Download buttons */
.pres-download-btn {
    min-width: 200px;
}

/* ----- Mobile ----- */
@media (max-width: 768px) {
    .designer-tile-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.75rem; }
    .designer-tile { padding: 1.25rem 0.75rem; min-height: 170px; }
    .designer-tile-icon { width: 52px; height: 52px; font-size: 1.6rem; }
    .designer-results-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.6rem; }
    .designer-projects-table th, .designer-projects-table td { padding: 0.5rem; font-size: 0.85rem; }
    .designer-thumb { width: 48px; height: 48px; }
    .pres-steps { gap: 0; flex-wrap: wrap; }
    .pres-step { min-width: 60px; }
    .pres-step-label { font-size: 0.65rem; }
    .pres-editor-wrap, .pres-editor-wrap .ql-container, .pres-editor-wrap .ql-editor { min-height: 200px; }
}
/* ==================== PROTOCOLS MODULE ==================== */
.protocol-upload-zone {
    border: 2px dashed var(--border-color, #2d3a4a);
    border-radius: 12px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: var(--card-bg, rgba(255,255,255,0.02));
    transition: all 0.2s;
    cursor: pointer;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.protocol-upload-zone.drag-over,
.protocol-upload-zone:hover {
    border-color: var(--neon-primary, #00e5ff);
    background: rgba(0, 229, 255, 0.06);
}
.protocol-upload-zone i {
    font-size: 2.5rem;
    color: var(--neon-primary, #00e5ff);
    display: block;
    margin-bottom: 0.5rem;
}
.protocol-upload-zone p { margin: 0; color: var(--text-color, #e0e0e0); }

.protocol-files-list { display: flex; flex-direction: column; gap: 0.5rem; }
.protocol-file-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--border-color, #2d3a4a);
    border-radius: 10px;
    background: var(--card-bg, rgba(255,255,255,0.02));
}
.protocol-file-order {
    flex: 0 0 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--neon-primary, #00e5ff);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}
.protocol-file-icon { flex: 0 0 22px; color: var(--neon-primary, #00e5ff); font-size: 1.25rem; }
.protocol-file-body { flex: 1 1 auto; min-width: 0; }
.protocol-file-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.protocol-file-meta { font-size: 0.8rem; }
.protocol-file-actions { display: flex; gap: 0.25rem; flex: 0 0 auto; }
.protocol-file-actions .btn { padding: 0.2rem 0.5rem; }

.protocol-files-progress { list-style: none; padding-left: 0; margin-bottom: 0; }
.protocol-files-progress li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    border-bottom: 1px dashed var(--border-color, #2d3a4a);
    font-size: 0.9rem;
    flex-wrap: wrap;
}
.protocol-files-progress li:last-child { border-bottom: none; }
.protocol-file-order-badge {
    flex: 0 0 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0,229,255,0.2);
    color: var(--neon-primary, #00e5ff);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
}
.protocol-files-progress .protocol-file-name {
    overflow: hidden; text-overflow: ellipsis;
    max-width: 60%;
}

.protocol-md {
    background: var(--card-bg, rgba(255,255,255,0.02));
    border: 1px solid var(--border-color, #2d3a4a);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    line-height: 1.55;
    font-size: 0.95rem;
    white-space: pre-wrap;
}

.protocol-transcript {
    background: var(--card-bg, rgba(255,255,255,0.02));
    border: 1px solid var(--border-color, #2d3a4a);
    border-radius: 10px;
    padding: 0.75rem 1rem;
}
.protocol-transcript summary {
    cursor: pointer;
    font-weight: 500;
    padding: 0.25rem 0;
}
.protocol-transcript-body {
    max-height: 400px;
    overflow-y: auto;
    font-size: 0.9rem;
    color: var(--text-muted, #9aa0a6);
    padding: 0.5rem 0;
    line-height: 1.5;
}

.protocol-diar-pills { flex-wrap: wrap; }

.btn-outline-neon {
    color: var(--neon-primary, #00e5ff);
    border-color: var(--neon-primary, #00e5ff);
}
.btn-outline-neon:hover {
    background: var(--neon-primary, #00e5ff);
    color: #000;
}

/* ============ Home (Главная) ============ */
.home-page { max-width: 1300px; margin: 0 auto; padding: 1.5rem; }
.home-page .page-title { font-size: 1.6rem; font-weight: 600; margin-bottom: 0.25rem; }
.home-page .page-subtitle { color: var(--text-muted); font-size: 1rem; }

.home-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}
.home-tile {
    display: flex; flex-direction: column;
    padding: 1.25rem;
    background: var(--card-bg, rgba(255,255,255,0.04));
    border: 1px solid var(--border-color);
    border-radius: 0.9rem;
    color: inherit; text-decoration: none;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    min-height: 160px;
}
.home-tile:hover {
    transform: translateY(-2px);
    border-color: var(--accent, #00d4ff);
    background: var(--card-bg-hover, rgba(0,212,255,0.06));
    color: inherit; text-decoration: none;
}
.home-tile-icon {
    font-size: 1.6rem;
    width: 2.4rem; height: 2.4rem;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,212,255,0.12);
    color: var(--accent, #00d4ff);
    border-radius: 0.6rem;
    margin-bottom: 0.8rem;
}
.home-tile-title { font-weight: 600; font-size: 1rem; margin-bottom: 0.2rem; }
.home-tile-sub { color: var(--text-muted); font-size: 0.85rem; line-height: 1.4; margin-bottom: 0.8rem; }
.home-tile-body { flex: 1; }
.home-tile-cta { display: flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; color: var(--accent, #00d4ff); font-weight: 500; }

.home-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
}
@media (max-width: 900px) {
    .home-grid { grid-template-columns: 1fr; }
}

.home-section-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1rem; }
.home-section-header h2 { font-size: 1.1rem; font-weight: 600; margin: 0; }
.home-section-link { color: var(--accent, #00d4ff); text-decoration: none; font-size: 0.88rem; }
.home-section-link:hover { text-decoration: underline; }

.home-recent-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.85rem; }
.home-recent-item {
    display: flex; flex-direction: column;
    background: var(--card-bg, rgba(255,255,255,0.03));
    border: 1px solid var(--border-color);
    border-radius: 0.7rem;
    overflow: hidden;
    color: inherit; text-decoration: none;
    transition: border-color 0.15s, transform 0.15s;
}
.home-recent-item:hover {
    border-color: var(--accent, #00d4ff);
    transform: translateY(-1px);
    color: inherit; text-decoration: none;
}
.home-recent-thumb {
    height: 120px;
    background-color: rgba(255,255,255,0.05);
    background-size: cover;
    background-position: center;
}
.home-recent-thumb-placeholder {
    display: flex; align-items: center; justify-content: center;
    font-size: 2.2rem; color: var(--text-muted); opacity: 0.4;
}
.home-recent-body { padding: 0.7rem 0.9rem; }
.home-recent-type { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); opacity: 0.7; margin-bottom: 0.2rem; }
.home-recent-title { font-weight: 500; font-size: 0.9rem; margin-bottom: 0.2rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.home-recent-when { font-size: 0.75rem; color: var(--text-muted); opacity: 0.6; }

.home-empty { text-align: center; padding: 2.5rem 1rem; color: var(--text-muted); }
.home-empty i { font-size: 2.4rem; color: var(--accent, #00d4ff); opacity: 0.6; margin-bottom: 0.5rem; }
.home-empty p { margin: 0; font-size: 0.95rem; }

.home-aside { display: flex; flex-direction: column; gap: 1rem; }
.home-status-card {
    background: var(--card-bg, rgba(255,255,255,0.04));
    border: 1px solid var(--border-color);
    border-radius: 0.9rem;
    padding: 1.25rem;
}
.home-status-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); opacity: 0.7; margin-bottom: 0.4rem; }
.home-status-value { font-size: 1.7rem; font-weight: 600; display: flex; align-items: baseline; gap: 0.4rem; }
.home-status-value i { color: #ffcf3a; }
.home-status-unit { font-size: 0.9rem; color: var(--text-muted); font-weight: 400; margin-left: 0.2rem; }

.home-stat-row { display: flex; gap: 1rem; margin-top: 0.3rem; }
.home-stat { flex: 1; }
.home-stat-num { font-size: 1.4rem; font-weight: 600; }
.home-stat-lbl { font-size: 0.78rem; color: var(--text-muted); opacity: 0.7; }

/* ============ Sidebar search button ============ */
.sidebar-search-btn {
    display: flex; align-items: center; gap: 0.6rem;
    width: calc(100% - 2rem); margin: 0.5rem 1rem 0.8rem;
    padding: 0.55rem 0.85rem;
    background: var(--card-bg, rgba(255,255,255,0.04));
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    border-radius: 0.5rem;
    font-size: 0.88rem;
    text-align: left;
    transition: border-color 0.15s, color 0.15s;
    cursor: pointer;
}
.sidebar-search-btn:hover { border-color: var(--accent, #00d4ff); color: var(--text-primary); }
.sidebar-search-kbd {
    margin-left: auto;
    font-size: 0.65rem;
    padding: 0.1em 0.4em;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border-color);
    border-radius: 0.3rem;
    font-family: inherit;
    color: var(--text-muted);
}

/* ============ Search modal (Ctrl+K) ============ */
.search-modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    z-index: 1050;
    display: none;
    align-items: flex-start; justify-content: center;
    padding-top: 15vh;
}
.search-modal-backdrop.open { display: flex; }
.search-modal {
    width: min(600px, 90vw);
    background: var(--bg-secondary, #151a24);
    border: 1px solid var(--border-color);
    border-radius: 0.85rem;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.search-modal-input-wrap {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--border-color);
}
.search-modal-input-wrap i { font-size: 1.1rem; color: var(--text-muted); }
.search-modal-input {
    flex: 1; background: transparent; border: 0; outline: 0;
    color: var(--text-primary); font-size: 1rem;
}
.search-modal-results { max-height: 50vh; overflow-y: auto; padding: 0.4rem; }
.search-modal-result {
    display: flex; align-items: center; gap: 0.8rem;
    padding: 0.6rem 0.75rem;
    border-radius: 0.5rem;
    color: inherit; text-decoration: none;
    transition: background 0.1s;
}
.search-modal-result:hover,
.search-modal-result.focused { background: rgba(0,212,255,0.1); color: inherit; text-decoration: none; }
.search-modal-result-icon {
    width: 2rem; height: 2rem;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,212,255,0.12); color: var(--accent, #00d4ff);
    border-radius: 0.4rem; font-size: 1rem;
    flex-shrink: 0;
}
.search-modal-result-body { flex: 1; min-width: 0; }
.search-modal-result-title { font-weight: 500; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-modal-result-meta { font-size: 0.75rem; color: var(--text-muted); opacity: 0.7; }
.search-modal-empty { padding: 2rem; text-align: center; color: var(--text-muted); }
.search-modal-footer {
    padding: 0.55rem 1rem;
    font-size: 0.72rem; color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    display: flex; gap: 1rem;
}
.search-modal-footer kbd {
    background: rgba(255,255,255,0.08); padding: 0.1em 0.35em; border-radius: 0.25rem;
    border: 1px solid var(--border-color); font-family: inherit;
}

/* ============ Gallery ============ */
.gallery-page { max-width: 1400px; margin: 0 auto; padding: 1.5rem; }
.gallery-toolbar { margin-bottom: 1rem; }
.gallery-search {
    position: relative;
    max-width: 500px;
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.55rem 0.85rem;
    background: var(--card-bg, rgba(255,255,255,0.04));
    border: 1px solid var(--border-color);
    border-radius: 0.55rem;
}
.gallery-search:focus-within { border-color: var(--accent, #00d4ff); }
.gallery-search i { color: var(--text-muted); }
.gallery-search input { flex: 1; background: transparent; border: 0; outline: 0; color: var(--text-primary); font-size: 0.95rem; }
.gallery-search-clear { color: var(--text-muted); padding: 0 0.3rem; }

.gallery-filters {
    display: flex; flex-wrap: wrap; gap: 0.4rem;
    margin-bottom: 1.5rem;
}
.gallery-filter {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    background: var(--card-bg, rgba(255,255,255,0.04));
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    color: var(--text-muted); text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.15s;
}
.gallery-filter:hover { color: var(--text-primary); border-color: var(--accent, #00d4ff); text-decoration: none; }
.gallery-filter.active { background: var(--accent, #00d4ff); border-color: var(--accent, #00d4ff); color: #0a0f1a; font-weight: 500; }
.gallery-filter-count {
    font-size: 0.72rem; padding: 0.1em 0.5em;
    background: rgba(255,255,255,0.08); border-radius: 1em;
}
.gallery-filter.active .gallery-filter-count { background: rgba(0,0,0,0.15); color: #0a0f1a; }

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.gallery-item {
    background: var(--card-bg, rgba(255,255,255,0.03));
    border: 1px solid var(--border-color);
    border-radius: 0.7rem;
    overflow: hidden;
    color: inherit; text-decoration: none;
    transition: border-color 0.15s, transform 0.15s;
}
.gallery-item:hover { border-color: var(--accent, #00d4ff); transform: translateY(-2px); color: inherit; text-decoration: none; }
.gallery-item-thumb, .gallery-item-video {
    width: 100%; height: 160px;
    background-size: cover; background-position: center;
    background-color: rgba(255,255,255,0.04);
    display: block;
    object-fit: cover;
}
.gallery-item-placeholder { display: flex; align-items: center; justify-content: center; font-size: 2.5rem; opacity: 0.3; }
.gallery-item-body { padding: 0.7rem 0.9rem 0.85rem; }
.gallery-item-type { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); opacity: 0.7; margin-bottom: 0.2rem; }
.gallery-item-title { font-weight: 500; font-size: 0.92rem; line-height: 1.3; margin-bottom: 0.3rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gallery-item-when { font-size: 0.75rem; color: var(--text-muted); opacity: 0.6; }

.gallery-empty { text-align: center; padding: 4rem 1rem; color: var(--text-muted); }
.gallery-empty i { font-size: 3rem; color: var(--accent, #00d4ff); opacity: 0.5; margin-bottom: 0.8rem; }
.gallery-empty h3 { font-size: 1.1rem; margin-bottom: 0.4rem; color: var(--text-primary); }

.gallery-pagination { display: flex; gap: 0.35rem; justify-content: center; margin-top: 2rem; }
.page-link-btn {
    padding: 0.4rem 0.85rem; border-radius: 0.4rem;
    background: var(--card-bg, rgba(255,255,255,0.04));
    border: 1px solid var(--border-color);
    color: var(--text-muted); text-decoration: none; font-size: 0.85rem;
}
.page-link-btn:hover { border-color: var(--accent, #00d4ff); color: var(--text-primary); text-decoration: none; }
.page-link-btn.active { background: var(--accent, #00d4ff); border-color: var(--accent, #00d4ff); color: #0a0f1a; font-weight: 500; }

/* Voice module styles — append into main style.css */

.voice-layout {
    display: flex;
    height: 100%;
    overflow: hidden;
}
.voice-main {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    min-width: 0;
}

/* Страница создания */
.voice-form-wrap {
    max-width: 980px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}
.voice-form-card {
    background: var(--bg-card, rgba(255,255,255,.03));
    border: 1px solid var(--border-color, rgba(255,255,255,.1));
    border-radius: 14px;
    padding: 2rem;
}
.voice-form-card h3 i { margin-right: .5rem; }

/* Drop-зона файла */
.voice-file-drop {
    border: 2px dashed var(--border-color, rgba(255,255,255,.15));
    border-radius: 10px;
    text-align: center;
    padding: 1.75rem 1rem;
    cursor: pointer;
    transition: all .15s;
    color: var(--text-muted, #98a);
}
.voice-file-drop:hover, .voice-file-drop.dragover {
    border-color: var(--neon, #7dd3fc);
    background: rgba(125, 211, 252, .05);
}
.voice-file-drop i { font-size: 2.2rem; color: var(--neon, #7dd3fc); margin-bottom: .4rem; display: block; }
.voice-file-drop strong { display: block; margin-top: .3rem; color: var(--text-color, #e5e7eb); }
.voice-file-status { margin-top: .75rem; padding: .6rem .9rem; border-radius: 8px; font-size: .92rem; }

.voice-text-meta {
    display: flex; gap: 1.25rem; justify-content: space-between; flex-wrap: wrap;
    font-size: .85rem; color: var(--text-muted, #98a); margin-top: .4rem;
}

/* Пресеты */
.voice-presets {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .6rem;
}
.voice-preset-card {
    background: var(--bg-card, rgba(255,255,255,.03));
    border: 1.5px solid var(--border-color, rgba(255,255,255,.1));
    border-radius: 10px;
    padding: .85rem .9rem;
    text-align: left;
    color: var(--text-color, #e5e7eb);
    cursor: pointer;
    transition: all .15s;
}
.voice-preset-card:hover { border-color: var(--neon, #7dd3fc); transform: translateY(-1px); }
.voice-preset-card.active {
    border-color: var(--neon, #7dd3fc);
    background: rgba(125, 211, 252, .08);
    box-shadow: 0 0 0 2px rgba(125, 211, 252, .15);
}
.voice-preset-card i { font-size: 1.3rem; color: var(--neon, #7dd3fc); display: block; margin-bottom: .3rem; }
.voice-preset-title { font-weight: 600; font-size: .95rem; margin-bottom: .1rem; }
.voice-preset-desc { font-size: .78rem; color: var(--text-muted, #98a); line-height: 1.3; }

.voice-advanced summary { cursor: pointer; color: var(--neon, #7dd3fc); font-size: .92rem; }
.voice-advanced summary:hover { text-decoration: underline; }

.voice-submit-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding-top: 1rem; border-top: 1px solid var(--border-color, rgba(255,255,255,.08));
}
.voice-cost-info strong { color: var(--neon, #7dd3fc); font-size: 1.15rem; }

/* Страница проекта (список версий) */
.voice-project-header {
    display: flex; align-items: center; gap: .75rem;
    padding: 1rem 1.5rem; border-bottom: 1px solid var(--border-color, rgba(255,255,255,.08));
    background: var(--bg-elevated, rgba(255,255,255,.02));
}
.voice-items-list {
    padding: 1.25rem 1.5rem; display: flex; flex-direction: column; gap: 1rem;
}
.voice-item {
    background: var(--bg-card, rgba(255,255,255,.03));
    border: 1px solid var(--border-color, rgba(255,255,255,.08));
    border-radius: 10px;
    padding: 1rem;
}
.voice-item-head {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
    margin-bottom: .6rem;
}
.voice-item-meta { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; font-size: .88rem; color: var(--text-muted, #98a); }
.voice-item-meta .badge { font-weight: 500; }
.voice-item-player { width: 100%; margin-top: .25rem; }
.voice-item-footer { display: flex; align-items: center; gap: 1rem; margin-top: .5rem; flex-wrap: wrap; }
.voice-item-progress { margin-top: .25rem; }
.voice-item-text summary { cursor: pointer; }
.voice-item-text-content {
    max-height: 250px; overflow-y: auto;
    background: rgba(0,0,0,.15); padding: .7rem .9rem; border-radius: 6px;
    font-size: .85rem; white-space: pre-wrap; word-break: break-word;
    font-family: inherit;
}

/* На узких экранах: форма уже, пресеты в 2 колонки */
@media (max-width: 640px) {
    .voice-form-card { padding: 1.25rem; }
    .voice-presets { grid-template-columns: repeat(2, 1fr); }
    .voice-submit-bar { flex-direction: column; align-items: stretch; }
    .voice-submit-bar .btn { width: 100%; }
}

/* Voice tiers */
.voice-tiers { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.voice-tier-card {
    background: var(--bg-card, rgba(255,255,255,.03));
    border: 1.5px solid var(--border-color, rgba(255,255,255,.1));
    border-radius: 10px; padding: .85rem 1rem; text-align: left;
    color: var(--text-color, #e5e7eb); cursor: pointer; transition: all .15s;
}
.voice-tier-card:hover { border-color: var(--neon, #7dd3fc); }
.voice-tier-card.active { border-color: var(--neon, #7dd3fc); background: rgba(125,211,252,.08); box-shadow: 0 0 0 2px rgba(125,211,252,.15); }
.voice-tier-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .25rem; }
.voice-tier-title { font-weight: 600; font-size: 1.05rem; }
.voice-tier-price { font-size: .8rem; color: var(--neon, #7dd3fc); }
.voice-tier-desc { font-size: .82rem; color: var(--text-muted, #98a); line-height: 1.3; }
@media (max-width: 640px) { .voice-tiers { grid-template-columns: 1fr; } }

/* ---- Тонкий скроллбар для левого меню ---- */
.sidebar { overflow: hidden; }
.sidebar-nav {
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(125,211,252,.25) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(125,211,252,.22);
    border-radius: 6px;
    transition: background .2s;
}
.sidebar-nav:hover::-webkit-scrollbar-thumb { background: rgba(125,211,252,.45); }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(125,211,252,.7); }
[data-theme="light"] .sidebar-nav { scrollbar-color: rgba(10,15,26,.18) transparent; }
[data-theme="light"] .sidebar-nav::-webkit-scrollbar-thumb { background: rgba(10,15,26,.15); }
[data-theme="light"] .sidebar-nav:hover::-webkit-scrollbar-thumb { background: rgba(10,15,26,.3); }
/* ИИ-помощник руководителя */
.asst-layout { padding: 1.5rem 2rem; }
.asst-main { max-width: 1180px; margin: 0 auto; }
.asst-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.asst-h1 { font-size: 1.6rem; font-weight: 700; margin: 0 0 .35rem; }
.asst-h1 i { color: var(--neon-primary, #7dd3fc); margin-right: .5rem; }
.asst-sub { color: var(--text-muted, #8aa); margin: 0; }
.asst-company-hint { text-decoration: none; }

.asst-cat { margin: 1.8rem 0; }
.asst-cat-title { font-size: 1rem; font-weight: 600; color: var(--text-muted, #aab); margin-bottom: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.asst-cat-title i { margin-right: .4rem; }

.asst-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; }
.asst-tile {
    display: flex; gap: .8rem; padding: 1rem;
    background: var(--bg-card, #151c2c); border: 1px solid var(--border-color, #263049);
    border-radius: .75rem; text-decoration: none; color: inherit; transition: all .15s;
}
.asst-tile:hover { border-color: var(--neon-primary, #7dd3fc); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(125,211,252,.08); }
.asst-tile > i { font-size: 1.8rem; color: var(--neon-primary, #7dd3fc); }
.asst-tile-body { flex: 1; min-width: 0; }
.asst-tile-title { font-weight: 600; margin-bottom: .25rem; }
.asst-tile-desc { font-size: .82rem; color: var(--text-muted, #8aa); line-height: 1.35; margin-bottom: .5rem; }
.asst-tile-foot { font-size: .75rem; color: var(--neon-primary, #7dd3fc); }

.asst-history { display: flex; flex-direction: column; gap: .4rem; }
.asst-hist-item {
    display: flex; gap: .8rem; align-items: center; padding: .65rem .9rem;
    background: var(--bg-card, #151c2c); border: 1px solid var(--border-color, #263049);
    border-radius: .5rem; text-decoration: none; color: inherit;
}
.asst-hist-item:hover { border-color: var(--neon-primary, #7dd3fc); }
.asst-hist-item > i { font-size: 1.2rem; color: var(--text-muted, #8aa); }
.asst-hist-body { flex: 1; min-width: 0; }
.asst-hist-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asst-hist-meta { font-size: .75rem; color: var(--text-muted, #8aa); }

.asst-status { font-weight: 600; }
.asst-status-queued  { color: #9aa; }
.asst-status-running { color: #fbbf24; }
.asst-status-done    { color: #34d399; }
.asst-status-error   { color: #f87171; }

.asst-back { margin-bottom: .8rem; }
.asst-back a { color: var(--text-muted, #8aa); text-decoration: none; }
.asst-back a:hover { color: var(--neon-primary, #7dd3fc); }

.asst-form { max-width: 760px; background: var(--bg-card, #151c2c); border: 1px solid var(--border-color, #263049); border-radius: .8rem; padding: 1.25rem 1.4rem; }
.asst-field { margin-bottom: 1rem; }
.asst-field label { display: block; font-size: .88rem; margin-bottom: .35rem; color: var(--text-muted, #aab); }
.asst-submit-row { display: flex; justify-content: space-between; align-items: center; margin-top: 1.3rem; padding-top: 1rem; border-top: 1px solid var(--border-color, #263049); }
.asst-cost { color: var(--text-muted, #aab); font-size: .95rem; }
.asst-cost strong { color: var(--neon-primary, #7dd3fc); }

.asst-job-meta { color: var(--text-muted, #aab); font-size: .9rem; margin-bottom: 1.2rem; }
.asst-progress-box { max-width: 760px; }
.asst-progress-box .progress { height: 8px; margin-bottom: .5rem; }
.asst-progress-text { color: var(--text-muted, #aab); font-size: .9rem; }

.asst-result-rec { background: linear-gradient(135deg, rgba(125,211,252,.08), rgba(167,139,250,.08));
    border: 1px solid rgba(125,211,252,.3); border-radius: .75rem; padding: 1rem 1.2rem; margin-bottom: 1.2rem; }
.asst-rec-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--neon-primary, #7dd3fc); margin-bottom: .3rem; }
.asst-rec-text { font-size: 1.15rem; font-weight: 500; line-height: 1.4; }

.asst-naming-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: .8rem; }
.asst-naming-card { background: var(--bg-card, #151c2c); border: 1px solid var(--border-color, #263049); border-radius: .75rem; padding: 1rem 1.2rem; }
.asst-naming-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .5rem; }
.asst-naming-rank { font-size: .8rem; color: var(--text-muted, #8aa); font-weight: 600; }
.asst-naming-name { font-size: 1.3rem; font-weight: 700; flex: 1; }
.asst-naming-score { font-size: .85rem; color: var(--neon-primary, #7dd3fc); }
.asst-naming-arch { font-size: .72rem; padding: .15rem .5rem; background: rgba(167,139,250,.15); border-radius: .3rem; color: #a78bfa; }
.asst-naming-rat { font-size: .88rem; color: var(--text-muted, #aab); margin-bottom: .6rem; line-height: 1.4; }
.asst-naming-pc { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: .5rem; }
.asst-pc-col ul { margin: 0; padding-left: 1rem; font-size: .82rem; }
.asst-pc-title { font-size: .75rem; font-weight: 600; margin-bottom: .2rem; }
.asst-pros .asst-pc-title { color: #34d399; }
.asst-cons .asst-pc-title { color: #fbbf24; }
.asst-naming-next { font-size: .82rem; color: var(--text-muted, #8aa); padding-top: .5rem; border-top: 1px dashed var(--border-color, #263049); }
.asst-naming-next i { color: var(--neon-primary, #7dd3fc); }

.asst-runners { margin-top: 1.2rem; }
.asst-runners-title { font-size: .85rem; color: var(--text-muted, #aab); margin-bottom: .5rem; }
.asst-runners-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.asst-runner-chip { background: var(--bg-card, #151c2c); border: 1px solid var(--border-color, #263049); padding: .25rem .7rem; border-radius: 1rem; font-size: .85rem; }

.asst-selfcheck { margin-top: 1rem; padding: .8rem 1rem; background: rgba(251,191,36,.08); border-left: 3px solid #fbbf24; border-radius: .4rem; display: flex; gap: .6rem; font-size: .88rem; }
.asst-selfcheck i { color: #fbbf24; }

.asst-actions { margin-top: 1.5rem; display: flex; gap: .5rem; flex-wrap: wrap; }

.asst-json { background: var(--bg-card, #151c2c); border: 1px solid var(--border-color, #263049); border-radius: .5rem; padding: 1rem; font-size: .82rem; max-height: 600px; overflow: auto; }

@media (max-width: 600px) {
    .asst-layout { padding: 1rem; }
    .asst-naming-pc { grid-template-columns: 1fr; }
}
/* Универсальные секции результата */
.asst-sec { margin-bottom: 1.8rem; }
.asst-sec-title { font-size: 1.15rem; font-weight: 600; margin-bottom: .5rem; color: var(--text-main, #e5e7eb); }
.asst-sec-sub { font-size: .88rem; color: var(--text-muted, #8aa); margin-bottom: .6rem; }
.asst-sec-text { white-space: pre-wrap; line-height: 1.55; color: var(--text-main, #e5e7eb); }
.asst-sec-bullets { padding-left: 1.3rem; margin: 0; line-height: 1.55; }
.asst-sec-bullets li { margin-bottom: .3rem; }

.asst-sec-list { display: flex; flex-direction: column; gap: .5rem; }
.asst-list-row { background: var(--bg-card, #151c2c); border: 1px solid var(--border-color, #263049); border-radius: .5rem; padding: .7rem 1rem; }
.asst-list-title { font-weight: 600; margin-bottom: .2rem; }
.asst-list-sub { font-size: .78rem; color: var(--text-muted, #8aa); margin-bottom: .25rem; }
.asst-list-text { font-size: .9rem; line-height: 1.5; }

.asst-sec-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .7rem; }
.asst-card { background: var(--bg-card, #151c2c); border: 1px solid var(--border-color, #263049); border-radius: .6rem; padding: .85rem 1rem; }
.asst-card-title { font-weight: 600; margin-bottom: .25rem; }
.asst-card-sub { font-size: .78rem; color: #a78bfa; margin-bottom: .3rem; }
.asst-card-meta { font-size: .78rem; color: var(--neon-primary, #7dd3fc); margin-bottom: .35rem; }
.asst-card-text { font-size: .9rem; line-height: 1.5; color: var(--text-muted, #aab); }
.asst-card-bullets { margin: .5rem 0 0; padding-left: 1.2rem; font-size: .85rem; }
.asst-card-bullets li { margin-bottom: .2rem; }

.asst-sec-table-wrap { overflow-x: auto; }
.asst-sec-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.asst-sec-table th, .asst-sec-table td { padding: .5rem .75rem; border: 1px solid var(--border-color, #263049); vertical-align: top; }
.asst-sec-table th { background: rgba(125,211,252,.08); text-align: left; font-weight: 600; }

.asst-sec-accordion { display: flex; flex-direction: column; gap: .4rem; }
.asst-accord-item { background: var(--bg-card, #151c2c); border: 1px solid var(--border-color, #263049); border-radius: .5rem; }
.asst-accord-item summary { padding: .7rem 1rem; cursor: pointer; font-weight: 500; list-style: none; display: flex; align-items: center; gap: .5rem; }
.asst-accord-item summary::-webkit-details-marker { display: none; }
.asst-accord-item summary::before { content: "›"; font-size: 1.3rem; transition: transform .2s; color: var(--neon-primary, #7dd3fc); }
.asst-accord-item[open] summary::before { transform: rotate(90deg); }
.asst-accord-body { padding: 0 1rem 1rem; }
.asst-accord-ans { padding: .5rem 0; border-top: 1px dashed var(--border-color, #263049); }
.asst-accord-ans:first-child { border-top: 0; }
.asst-accord-ans-head { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: #a78bfa; margin-bottom: .2rem; }
/* Шкала заполненности брифа */
.asst-form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1.2rem; align-items: start; }
.asst-form-layout .asst-form { max-width: none; }

.asst-fillgauge {
    position: sticky; top: 1rem;
    background: var(--bg-card, #151c2c); border: 1px solid var(--border-color, #263049);
    border-radius: .75rem; padding: 1rem 1.1rem;
}
.asst-fillgauge-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .45rem; }
.asst-fillgauge-label { font-size: .82rem; color: var(--text-muted, #aab); text-transform: uppercase; letter-spacing: .04em; }
.asst-fillgauge-pct { font-size: 1.4rem; font-weight: 700; color: var(--neon-primary, #7dd3fc); transition: color .3s; }
.asst-fillgauge-bar { height: 8px; border-radius: 6px; background: rgba(125,211,252,.12); overflow: hidden; }
.asst-fillgauge-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, #fbbf24, #7dd3fc);
    transition: width .35s cubic-bezier(.22,1,.36,1), background .4s;
    border-radius: 6px;
}
.asst-fill-good .asst-fillgauge-fill { background: linear-gradient(90deg, #7dd3fc, #34d399); }
.asst-fill-full .asst-fillgauge-fill { background: linear-gradient(90deg, #34d399, #34d399); box-shadow: 0 0 10px rgba(52,211,153,.4); }
.asst-fill-full .asst-fillgauge-pct { color: #34d399; }

.asst-fillgauge-stage { font-size: .88rem; color: var(--text-main, #e5e7eb); margin: .5rem 0 .75rem; font-weight: 500; }
.asst-fillgauge-tip { font-size: .8rem; line-height: 1.45; color: var(--text-muted, #8aa); margin-bottom: .8rem; padding: .55rem .7rem; background: rgba(167,139,250,.06); border-left: 2px solid #a78bfa; border-radius: .3rem; }
.asst-fillgauge-tip strong { color: var(--text-main, #e5e7eb); }

.asst-fillgauge-checklist { list-style: none; padding: 0; margin: 0; font-size: .82rem; }
.asst-fillgauge-checklist li { display: flex; align-items: center; gap: .5rem; padding: .2rem 0; color: var(--text-muted, #8aa); transition: color .2s; }
.asst-fillgauge-checklist li.partial { color: #fbbf24; }
.asst-fillgauge-checklist li.ok { color: #34d399; }
.asst-fill-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.15); transition: background .25s, box-shadow .25s; flex-shrink: 0; }
.asst-fillgauge-checklist li.partial .asst-fill-dot { background: #fbbf24; }
.asst-fillgauge-checklist li.ok .asst-fill-dot { background: #34d399; box-shadow: 0 0 6px rgba(52,211,153,.6); }

@media (max-width: 900px) {
    .asst-form-layout { grid-template-columns: 1fr; }
    .asst-fillgauge { position: static; }
}

/* Плитки на главной в светлой теме — белый фон вместо прозрачного */
[data-theme="light"] .home-tile {
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 2px 8px rgba(15,23,42,.04);
}
[data-theme="light"] .home-tile:hover {
    background: #ffffff;
    border-color: var(--accent, #00d4ff);
    box-shadow: 0 4px 12px rgba(15,23,42,.08), 0 8px 24px rgba(0,212,255,.08);
}
/* Поддержка + Помощь + Футер */
.sup-layout { padding: 1.5rem 2rem; max-width: 1000px; margin: 0 auto; }
.sup-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.sup-head-actions { display: flex; gap: .5rem; }
.sup-h1 { font-size: 1.5rem; font-weight: 700; margin: 0 0 .3rem; }
.sup-h1 i { color: var(--neon-primary, #7dd3fc); margin-right: .5rem; }
.sup-sub { color: var(--text-muted, #8aa); margin: 0; }

.sup-new-form { max-height: 0; overflow: hidden; opacity: 0; transition: all .3s; background: var(--bg-card, #151c2c); border: 1px solid var(--border-color, #263049); border-radius: .7rem; margin-bottom: 1.2rem; }
.sup-new-form.show { max-height: 600px; opacity: 1; padding: 1.2rem; }
.sup-field { margin-bottom: .9rem; }
.sup-field label { display: block; font-size: .85rem; color: var(--text-muted, #aab); margin-bottom: .3rem; }
.sup-form-actions { display: flex; gap: .5rem; justify-content: flex-end; }

.sup-empty { text-align: center; padding: 3rem 1rem; color: var(--text-muted, #8aa); }
.sup-empty i { font-size: 2.5rem; display: block; margin-bottom: .5rem; }

.sup-ticket-list { display: flex; flex-direction: column; gap: .4rem; }
.sup-ticket-row { display: flex; gap: 1rem; padding: .9rem 1rem; background: var(--bg-card, #151c2c); border: 1px solid var(--border-color, #263049); border-radius: .5rem; text-decoration: none; color: inherit; align-items: center; }
.sup-ticket-row:hover { border-color: var(--neon-primary, #7dd3fc); }
.sup-ticket-id { font-size: .8rem; color: var(--text-muted, #8aa); font-weight: 600; min-width: 48px; }
.sup-ticket-body { flex: 1; min-width: 0; }
.sup-ticket-subject { font-weight: 500; margin-bottom: .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sup-ticket-meta { font-size: .78rem; color: var(--text-muted, #8aa); }
.sup-ticket-status { font-size: .72rem; padding: .2rem .6rem; border-radius: 1rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.sup-st-open     { background: rgba(251,191,36,.15); color: #fbbf24; }
.sup-st-answered { background: rgba(125,211,252,.15); color: #7dd3fc; }
.sup-st-closed   { background: rgba(255,255,255,.08); color: #aab; }

.sup-back { margin-bottom: .8rem; }
.sup-back a { color: var(--text-muted, #aab); text-decoration: none; }
.sup-back a:hover { color: var(--neon-primary, #7dd3fc); }

.sup-ticket-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.sup-ticket-meta-row { color: var(--text-muted, #aab); font-size: .88rem; margin-top: .3rem; }

.sup-thread { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1.2rem; }
.sup-msg { padding: .8rem 1rem; border-radius: .6rem; border: 1px solid var(--border-color, #263049); background: var(--bg-card, #151c2c); }
.sup-msg-admin { background: rgba(125,211,252,.05); border-color: rgba(125,211,252,.25); }
.sup-msg-head { display: flex; justify-content: space-between; margin-bottom: .35rem; font-size: .82rem; color: var(--text-muted, #aab); }
.sup-msg-body { line-height: 1.55; white-space: pre-wrap; }

.sup-reply textarea { margin-bottom: .6rem; }
.sup-reply-actions { display: flex; justify-content: flex-end; }
.sup-closed-note { padding: .8rem 1rem; background: rgba(255,255,255,.04); border-radius: .5rem; color: var(--text-muted, #aab); }
.sup-closed-note i { color: #34d399; }

/* Справочный центр */
.help-layout { padding: 1.5rem 2rem; max-width: 1100px; margin: 0 auto; }
.help-hero { margin-bottom: 1.8rem; }
.help-h1 { font-size: 1.6rem; font-weight: 700; margin: 0 0 .3rem; }
.help-h1 i { color: var(--neon-primary, #7dd3fc); margin-right: .5rem; }
.help-sub { color: var(--text-muted, #8aa); }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .8rem; margin-bottom: 1.5rem; }
.help-card { background: var(--bg-card, #151c2c); border: 1px solid var(--border-color, #263049); border-radius: .7rem; padding: 1rem 1.2rem; }
.help-card h3 { font-size: 1rem; font-weight: 600; margin: 0 0 .5rem; }
.help-card h3 i { color: var(--neon-primary, #7dd3fc); margin-right: .4rem; }
.help-card p { font-size: .88rem; line-height: 1.5; color: var(--text-muted, #aab); margin: 0; }
.help-note { padding: .9rem 1.1rem; background: rgba(167,139,250,.08); border-left: 3px solid #a78bfa; border-radius: .4rem; font-size: .9rem; }
.help-note a { color: var(--neon-primary, #7dd3fc); }

/* Футер приложения */
.app-footer {
    margin-top: 2rem;
    padding: 1rem 2rem;
    border-top: 1px solid var(--border-color, #263049);
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: .8rem;
    font-size: .82rem; color: var(--text-muted, #8aa);
}
.app-footer-links { display: flex; gap: 1.2rem; }
.app-footer-links a { color: var(--text-muted, #aab); text-decoration: none; }
.app-footer-links a:hover { color: var(--neon-primary, #7dd3fc); }
[data-theme="light"] .help-card { background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
[data-theme="light"] .sup-ticket-row, [data-theme="light"] .sup-msg, [data-theme="light"] .sup-new-form.show { background: #fff; }

@media (max-width: 600px) {
    .sup-layout, .help-layout { padding: 1rem; }
    .app-footer { padding: .8rem 1rem; flex-direction: column; text-align: center; }
}

/* Плитка "Нет нужной функции?" на главной */
.home-tile-feature {
    background: linear-gradient(135deg, rgba(167,139,250,.10), rgba(125,211,252,.08));
    border-style: dashed;
    border-color: rgba(167,139,250,.45);
}
.home-tile-feature:hover {
    background: linear-gradient(135deg, rgba(167,139,250,.16), rgba(125,211,252,.12));
    border-color: #a78bfa;
    border-style: solid;
}
.home-tile-feature .home-tile-icon i { color: #a78bfa; }
.home-tile-feature .home-tile-cta { color: #a78bfa; }
[data-theme="light"] .home-tile-feature {
    background: linear-gradient(135deg, rgba(167,139,250,.08), rgba(125,211,252,.06));
}
[data-theme="light"] .home-tile-feature:hover {
    background: #ffffff;
}
/* Улучшение фотографий */
.enh-layout { padding: 1.5rem 2rem; max-width: 1100px; margin: 0 auto; }
.enh-hero { margin-bottom: 1.5rem; }
.enh-h1 { font-size: 1.5rem; font-weight: 700; margin: 0 0 .3rem; }
.enh-h1 i { color: var(--neon-primary, #7dd3fc); margin-right: .5rem; }
.enh-sub { color: var(--text-muted, #8aa); margin: 0; }

.enh-section { margin-bottom: 1.5rem; }
.enh-sec-title { font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted, #aab); margin-bottom: .6rem; font-weight: 600; }

/* Пресеты */
.enh-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .5rem; }
.enh-tile { cursor: pointer; background: var(--bg-card, #151c2c); border: 1px solid var(--border-color, #263049); border-radius: .55rem; padding: .7rem .9rem; transition: all .15s; display: block; margin: 0; }
.enh-tile input { display: none; }
.enh-tile:hover { border-color: var(--neon-primary, #7dd3fc); }
.enh-tile input:checked ~ .enh-tile-body { color: var(--text-main, #fff); }
.enh-tile:has(input:checked) { border-color: var(--neon-primary, #7dd3fc); background: rgba(125,211,252,.07); }
.enh-tile i { font-size: 1.4rem; color: var(--neon-primary, #7dd3fc); margin-bottom: .25rem; display: block; }
.enh-tile-title { font-weight: 600; font-size: .92rem; margin-bottom: .15rem; }
.enh-tile-desc { font-size: .76rem; color: var(--text-muted, #8aa); line-height: 1.3; }

.enh-custom-prompt { margin-top: .6rem; }

/* Интенсивность */
.enh-intensity { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.enh-int-card { cursor: pointer; background: var(--bg-card, #151c2c); border: 1px solid var(--border-color, #263049); border-radius: .55rem; padding: .7rem .9rem; transition: all .15s; margin: 0; display: block; }
.enh-int-card input { display: none; }
.enh-int-card:hover { border-color: var(--neon-primary, #7dd3fc); }
.enh-int-card:has(input:checked) { border-color: var(--neon-primary, #7dd3fc); background: rgba(125,211,252,.07); }
.enh-int-title { font-weight: 600; margin-bottom: .2rem; }
.enh-int-desc { font-size: .78rem; color: var(--text-muted, #8aa); line-height: 1.35; }

/* Тарифы */
.enh-tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.enh-tier-card { cursor: pointer; background: var(--bg-card, #151c2c); border: 1px solid var(--border-color, #263049); border-radius: .55rem; padding: .8rem 1rem; margin: 0; display: block; }
.enh-tier-card input { display: none; }
.enh-tier-card:hover { border-color: var(--neon-primary, #7dd3fc); }
.enh-tier-card:has(input:checked) { border-color: var(--neon-primary, #7dd3fc); background: rgba(125,211,252,.08); }
.enh-tier-head { display: flex; justify-content: space-between; align-items: baseline; }
.enh-tier-title { font-weight: 600; }
.enh-tier-price { font-size: .8rem; color: var(--neon-primary, #7dd3fc); }
.enh-tier-desc { font-size: .78rem; color: var(--text-muted, #8aa); margin-top: .2rem; line-height: 1.35; }

/* Drop-zone */
.enh-drop {
    border: 2px dashed var(--border-color, #263049); border-radius: .75rem;
    padding: 2rem 1rem; text-align: center; cursor: pointer; transition: all .15s;
    background: var(--bg-card, #151c2c);
}
.enh-drop:hover, .enh-drop.drag { border-color: var(--neon-primary, #7dd3fc); background: rgba(125,211,252,.04); }
.enh-drop i { font-size: 2.2rem; color: var(--neon-primary, #7dd3fc); margin-bottom: .4rem; display: block; }
.enh-drop-text { font-weight: 500; margin-bottom: .25rem; }
.enh-drop-link { color: var(--neon-primary, #7dd3fc); text-decoration: underline; }
.enh-drop-hint { font-size: .8rem; color: var(--text-muted, #8aa); }

.enh-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .5rem; margin-top: .8rem; }
.enh-thumb { position: relative; background: var(--bg-card, #151c2c); border: 1px solid var(--border-color, #263049); border-radius: .5rem; overflow: hidden; }
.enh-thumb img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; }
.enh-thumb.error img { opacity: .3; }
.enh-thumb-rm { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,.7); color: #fff; border: 0; cursor: pointer; font-size: 1rem; line-height: 1; }
.enh-thumb-meta { padding: .35rem .5rem; font-size: .7rem; }
.enh-thumb-name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-main, #fff); }
.enh-thumb-size { color: var(--text-muted, #8aa); }

/* Submit */
.enh-submit-row { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem; background: var(--bg-card, #151c2c); border: 1px solid var(--border-color, #263049); border-radius: .6rem; margin-top: 1rem; flex-wrap: wrap; gap: .8rem; }
.enh-cost-box { line-height: 1.5; }
.enh-cost-line strong { color: var(--neon-primary, #7dd3fc); }

/* История */
.enh-history { display: flex; flex-direction: column; gap: .4rem; }
.enh-hist-row { display: flex; gap: .8rem; padding: .6rem .9rem; background: var(--bg-card, #151c2c); border: 1px solid var(--border-color, #263049); border-radius: .5rem; text-decoration: none; color: inherit; align-items: center; }
.enh-hist-row:hover { border-color: var(--neon-primary, #7dd3fc); }
.enh-hist-icon i { font-size: 1.3rem; color: var(--neon-primary, #7dd3fc); }
.enh-hist-body { flex: 1; min-width: 0; }
.enh-hist-title { font-weight: 500; }
.enh-hist-meta { font-size: .78rem; color: var(--text-muted, #8aa); }

/* JOB VIEW */
.enh-back { margin-bottom: .8rem; }
.enh-back a { color: var(--text-muted, #aab); text-decoration: none; }
.enh-back a:hover { color: var(--neon-primary, #7dd3fc); }

.enh-job-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.enh-job-meta { color: var(--text-muted, #aab); font-size: .88rem; margin-top: .3rem; }
.enh-progress-wrap { min-width: 250px; }
.enh-progress-text { font-size: .82rem; color: var(--text-muted, #aab); margin-top: .3rem; }
.enh-status-chip { font-size: .8rem; padding: .2rem .65rem; border-radius: 1rem; font-weight: 600; text-transform: uppercase; }
.enh-status-done { background: rgba(52,211,153,.15); color: #34d399; }
.enh-status-error { background: rgba(248,113,113,.15); color: #f87171; }
.enh-cost-final { font-size: .85rem; color: var(--text-muted, #aab); margin-top: .3rem; text-align: right; }

.enh-results { display: flex; flex-direction: column; gap: 1rem; }
.enh-result-item { background: var(--bg-card, #151c2c); border: 1px solid var(--border-color, #263049); border-radius: .6rem; padding: 1rem; }
.enh-result-label { font-weight: 500; margin-bottom: .5rem; font-size: .88rem; }
.enh-result-ba { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: .6rem; }
.enh-ba-col { position: relative; }
.enh-ba-label { position: absolute; top: 6px; left: 6px; padding: .15rem .5rem; background: rgba(0,0,0,.6); color: #fff; font-size: .72rem; border-radius: .3rem; z-index: 2; text-transform: uppercase; }
.enh-ba-col img { width: 100%; display: block; border-radius: .4rem; background: #000; }
.enh-ba-error, .enh-ba-pending { aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; border-radius: .4rem; background: rgba(255,255,255,.04); color: var(--text-muted, #aab); font-size: .88rem; gap: .4rem; padding: 1rem; text-align: center; }
.enh-ba-error { color: #f87171; }

.enh-actions { display: flex; gap: .5rem; margin-top: 1.5rem; flex-wrap: wrap; }

@media (max-width: 600px) {
    .enh-layout { padding: 1rem; }
    .enh-tiers, .enh-intensity { grid-template-columns: 1fr; }
    .enh-result-ba { grid-template-columns: 1fr; }
}

[data-theme="light"] .enh-tile, [data-theme="light"] .enh-int-card, [data-theme="light"] .enh-tier-card,
[data-theme="light"] .enh-drop, [data-theme="light"] .enh-submit-row, [data-theme="light"] .enh-hist-row,
[data-theme="light"] .enh-result-item, [data-theme="light"] .enh-thumb { background: #fff; }
/* Генерация видео — использует те же визуальные паттерны, что .enh-* */
.vidg-layout { padding: 1.5rem 2rem; max-width: 1100px; margin: 0 auto; }
.vidg-hero { margin-bottom: 1.5rem; }
.vidg-h1 { font-size: 1.5rem; font-weight: 700; margin: 0 0 .3rem; }
.vidg-h1 i { color: var(--neon-primary, #7dd3fc); margin-right: .5rem; }
.vidg-sub { color: var(--text-muted, #8aa); margin: 0; }

.vidg-section { margin-bottom: 1.5rem; }
.vidg-sec-title { font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted, #aab); margin-bottom: .6rem; font-weight: 600; }
.vidg-opt { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-muted, #8aa); }
.vidg-field-hint { font-size: .78rem; color: var(--text-muted, #8aa); margin-top: .4rem; }

.vidg-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .5rem; }
.vidg-tile { cursor: pointer; background: var(--bg-card, #151c2c); border: 1px solid var(--border-color, #263049); border-radius: .55rem; padding: .75rem .9rem; transition: all .15s; display: block; margin: 0; }
.vidg-tile input { display: none; }
.vidg-tile:hover { border-color: var(--neon-primary, #7dd3fc); }
.vidg-tile:has(input:checked) { border-color: var(--neon-primary, #7dd3fc); background: rgba(125,211,252,.07); }
.vidg-tile i { font-size: 1.4rem; color: var(--neon-primary, #7dd3fc); margin-bottom: .25rem; display: block; }
.vidg-tile-title { font-weight: 600; font-size: .92rem; margin-bottom: .15rem; }
.vidg-tile-desc { font-size: .76rem; color: var(--text-muted, #8aa); line-height: 1.3; }

.vidg-tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.vidg-tier-card { cursor: pointer; background: var(--bg-card, #151c2c); border: 1px solid var(--border-color, #263049); border-radius: .55rem; padding: .8rem 1rem; margin: 0; display: block; }
.vidg-tier-card input { display: none; }
.vidg-tier-card:hover { border-color: var(--neon-primary, #7dd3fc); }
.vidg-tier-card:has(input:checked) { border-color: var(--neon-primary, #7dd3fc); background: rgba(125,211,252,.08); }
.vidg-tier-head { display: flex; justify-content: space-between; align-items: baseline; }
.vidg-tier-title { font-weight: 600; }
.vidg-tier-price { font-size: .8rem; color: var(--neon-primary, #7dd3fc); }
.vidg-tier-model { font-size: .72rem; color: var(--text-muted, #8aa); margin-top: .15rem; font-family: monospace; }
.vidg-tier-desc { font-size: .78rem; color: var(--text-muted, #8aa); margin-top: .2rem; line-height: 1.35; }

.vidg-drop { border: 2px dashed var(--border-color, #263049); border-radius: .75rem; padding: 2rem 1rem; text-align: center; cursor: pointer; transition: all .15s; background: var(--bg-card, #151c2c); }
.vidg-drop:hover, .vidg-drop.drag { border-color: var(--neon-primary, #7dd3fc); background: rgba(125,211,252,.04); }
.vidg-drop i { font-size: 2.2rem; color: var(--neon-primary, #7dd3fc); margin-bottom: .4rem; display: block; }
.vidg-drop-text { font-weight: 500; margin-bottom: .25rem; }
.vidg-drop-link { color: var(--neon-primary, #7dd3fc); text-decoration: underline; }
.vidg-drop-hint { font-size: .8rem; color: var(--text-muted, #8aa); }

.vidg-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .5rem; margin-top: .8rem; }
.vidg-thumb { position: relative; background: var(--bg-card, #151c2c); border: 1px solid var(--border-color, #263049); border-radius: .5rem; overflow: hidden; }
.vidg-thumb img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; }
.vidg-thumb.error img { opacity: .3; }
.vidg-thumb-rm { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,.7); color: #fff; border: 0; cursor: pointer; font-size: 1rem; line-height: 1; }
.vidg-thumb-meta { padding: .35rem .5rem; font-size: .7rem; }
.vidg-thumb-name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-main, #fff); }
.vidg-thumb-size { color: var(--text-muted, #8aa); }

.vidg-submit-row { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem; background: var(--bg-card, #151c2c); border: 1px solid var(--border-color, #263049); border-radius: .6rem; margin-top: 1rem; flex-wrap: wrap; gap: .8rem; }
.vidg-cost-box { line-height: 1.5; }
.vidg-cost-box strong { color: var(--neon-primary, #7dd3fc); }
.vidg-warn { font-size: .78rem; color: #fbbf24; margin-top: .3rem; }
.vidg-warn i { margin-right: .3rem; }

.vidg-history { display: flex; flex-direction: column; gap: .4rem; }
.vidg-hist-row { display: flex; gap: .8rem; padding: .6rem .9rem; background: var(--bg-card, #151c2c); border: 1px solid var(--border-color, #263049); border-radius: .5rem; text-decoration: none; color: inherit; align-items: center; }
.vidg-hist-row:hover { border-color: var(--neon-primary, #7dd3fc); }
.vidg-hist-icon i { font-size: 1.3rem; color: var(--neon-primary, #7dd3fc); }
.vidg-hist-body { flex: 1; min-width: 0; }
.vidg-hist-title { font-weight: 500; }
.vidg-hist-meta { font-size: .78rem; color: var(--text-muted, #8aa); }

/* Job view */
.vidg-back { margin-bottom: .8rem; }
.vidg-back a { color: var(--text-muted, #aab); text-decoration: none; }
.vidg-back a:hover { color: var(--neon-primary, #7dd3fc); }
.vidg-job-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.vidg-job-meta { color: var(--text-muted, #aab); font-size: .88rem; margin-top: .3rem; }
.vidg-job-comment { color: var(--text-muted, #aab); font-size: .86rem; margin-top: .3rem; }
.vidg-progress-wrap { min-width: 280px; }
.vidg-progress-text { font-size: .82rem; color: var(--text-muted, #aab); margin-top: .3rem; }
.vidg-progress-hint { font-size: .75rem; color: #fbbf24; margin-top: .2rem; }
.vidg-status-chip { font-size: .8rem; padding: .2rem .65rem; border-radius: 1rem; font-weight: 600; text-transform: uppercase; }
.vidg-status-done  { background: rgba(52,211,153,.15); color: #34d399; }
.vidg-status-error { background: rgba(248,113,113,.15); color: #f87171; }
.vidg-cost-final { font-size: .85rem; color: var(--text-muted, #aab); margin-top: .3rem; text-align: right; }

.vidg-results { display: flex; flex-direction: column; gap: 1rem; }
.vidg-result-item { background: var(--bg-card, #151c2c); border: 1px solid var(--border-color, #263049); border-radius: .6rem; padding: 1rem; }
.vidg-result-label { font-weight: 500; margin-bottom: .5rem; font-size: .88rem; }
.vidg-result-ba { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: .6rem; }
.vidg-ba-col { position: relative; }
.vidg-ba-label { position: absolute; top: 6px; left: 6px; padding: .15rem .5rem; background: rgba(0,0,0,.6); color: #fff; font-size: .72rem; border-radius: .3rem; z-index: 2; text-transform: uppercase; }
.vidg-ba-col img, .vidg-ba-col video { width: 100%; display: block; border-radius: .4rem; background: #000; }
.vidg-ba-error, .vidg-ba-pending { aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; border-radius: .4rem; background: rgba(255,255,255,.04); color: var(--text-muted, #aab); font-size: .88rem; gap: .4rem; padding: 1rem; text-align: center; }
.vidg-ba-error { color: #f87171; }

.vidg-actions { display: flex; gap: .5rem; margin-top: 1.5rem; flex-wrap: wrap; }

@media (max-width: 600px) {
    .vidg-layout { padding: 1rem; }
    .vidg-tiers { grid-template-columns: 1fr; }
    .vidg-result-ba { grid-template-columns: 1fr; }
}

[data-theme="light"] .vidg-tile, [data-theme="light"] .vidg-tier-card,
[data-theme="light"] .vidg-drop, [data-theme="light"] .vidg-submit-row, [data-theme="light"] .vidg-hist-row,
[data-theme="light"] .vidg-result-item, [data-theme="light"] .vidg-thumb { background: #fff; }
/* === Кнопки действий в завершённом задании — видимы в обеих темах === */
.asst-btn-action {
    border: 1px solid var(--border-color, #263049);
    background: var(--bg-card, #151c2c);
    color: var(--text-main, #e8ecf7);
    font-weight: 500;
    transition: border-color .15s, background .15s, color .15s, transform .1s;
}
.asst-btn-action:hover {
    border-color: var(--neon-primary, #7dd3fc);
    color: var(--neon-primary, #7dd3fc);
    background: var(--bg-card, #151c2c);
}
.asst-btn-action.asst-btn-primary {
    background: linear-gradient(135deg, #7dd3fc 0%, #a78bfa 100%);
    border-color: transparent;
    color: #0b1020;
    font-weight: 600;
}
.asst-btn-action.asst-btn-primary:hover {
    color: #0b1020;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(125,211,252,.3);
}
.asst-btn-action.asst-btn-danger {
    color: #f87171;
    border-color: rgba(248,113,113,.35);
}
.asst-btn-action.asst-btn-danger:hover {
    background: rgba(248,113,113,.12);
    color: #f87171;
    border-color: #f87171;
}

[data-theme="light"] .asst-btn-action {
    background: #ffffff;
    color: #1f2937;
    border-color: #d1d5db;
}
[data-theme="light"] .asst-btn-action:hover {
    background: #f9fafb;
    color: #0ea5e9;
    border-color: #0ea5e9;
}
[data-theme="light"] .asst-btn-action.asst-btn-primary {
    color: #0b1020;
    background: linear-gradient(135deg, #0ea5e9 0%, #8b5cf6 100%);
}
[data-theme="light"] .asst-btn-action.asst-btn-primary:hover { color: #fff; }
[data-theme="light"] .asst-btn-action.asst-btn-danger {
    color: #dc2626;
    border-color: rgba(220,38,38,.35);
    background: #fff;
}
[data-theme="light"] .asst-btn-action.asst-btn-danger:hover {
    background: rgba(220,38,38,.08);
    border-color: #dc2626;
}

/* ===== Матрица площадок (content_plan) ===== */
.asst-pmatrix {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: .65rem; margin-top: .25rem;
}
.asst-pcard {
    position: relative; display: block; padding: .9rem 1rem;
    background: var(--bg-card, #151c2c);
    border: 1px solid var(--border-color, #263049);
    border-radius: .7rem; cursor: pointer;
    transition: border-color .15s, background .15s, transform .1s;
    margin: 0;
}
.asst-pcard:hover { border-color: var(--neon-primary, #7dd3fc); transform: translateY(-1px); }
.asst-pcard.is-active {
    border-color: var(--neon-primary, #7dd3fc);
    background: linear-gradient(135deg, rgba(125,211,252,.08), rgba(167,139,250,.06));
}
.asst-pcard-check { position: absolute; opacity: 0; pointer-events: none; }
.asst-pcard-head { display: flex; align-items: center; gap: .55rem; margin-bottom: .55rem; }
.asst-pcard-head i.bi { font-size: 1.25rem; color: var(--neon-primary, #7dd3fc); }
.asst-pcard-name { font-weight: 600; flex: 1; }
.asst-pcard-mark { opacity: 0; color: var(--neon-primary, #7dd3fc); transition: opacity .15s; }
.asst-pcard.is-active .asst-pcard-mark { opacity: 1; }

.asst-pcard-count {
    display: flex; align-items: center; gap: .5rem;
    font-size: .85rem; color: var(--text-muted, #8aa);
}
.asst-pcard-input {
    width: 72px; padding: .3rem .5rem; border-radius: .4rem;
    background: var(--bg-main, #0b1020);
    border: 1px solid var(--border-color, #263049);
    color: var(--text-main, #e8ecf7); font-weight: 600; text-align: center;
    transition: border-color .15s, opacity .15s;
}
.asst-pcard-input:focus { border-color: var(--neon-primary, #7dd3fc); outline: none; }
.asst-pcard-input:disabled { opacity: .45; cursor: not-allowed; }

[data-theme="light"] .asst-pcard { background: #ffffff; border-color: #d1d5db; }
[data-theme="light"] .asst-pcard:hover { border-color: #0ea5e9; }
[data-theme="light"] .asst-pcard.is-active { background: linear-gradient(135deg, rgba(14,165,233,.07), rgba(139,92,246,.05)); border-color: #0ea5e9; }
[data-theme="light"] .asst-pcard-input { background: #fff; color: #0f172a; border-color: #d1d5db; }

/* ===== reviews_input — переключатель Текст/Файл ===== */
.asst-rv-tabs { display: inline-flex; gap: .3rem; background: var(--bg-main, #0b1020); border: 1px solid var(--border-color, #263049); border-radius: .5rem; padding: .2rem; margin-bottom: .6rem; }
.asst-rv-tab {
    background: transparent; border: 0; color: var(--text-muted, #8aa); font-weight: 500;
    padding: .4rem .9rem; border-radius: .35rem; cursor: pointer; display: inline-flex; align-items: center; gap: .4rem;
    transition: background .12s, color .12s;
}
.asst-rv-tab:hover { color: var(--text-main, #e8ecf7); }
.asst-rv-tab.is-active { background: var(--bg-card, #151c2c); color: var(--neon-primary, #7dd3fc); }
.asst-rv-panel { display: none; }
.asst-rv-panel.is-active { display: block; }

.asst-rv-drop {
    display: block; cursor: pointer; text-align: center;
    padding: 1.7rem 1rem; border: 2px dashed var(--border-color, #263049);
    border-radius: .7rem; background: var(--bg-card, #151c2c);
    transition: border-color .15s, background .15s;
    margin: 0;
}
.asst-rv-drop:hover, .asst-rv-drop.drag { border-color: var(--neon-primary, #7dd3fc); background: rgba(125,211,252,.04); }
.asst-rv-drop i.bi { font-size: 1.9rem; color: var(--neon-primary, #7dd3fc); display: block; margin-bottom: .4rem; }
.asst-rv-drop-title { font-weight: 500; }
.asst-rv-drop-title span { color: var(--neon-primary, #7dd3fc); text-decoration: underline; }
.asst-rv-drop-hint { font-size: .82rem; color: var(--text-muted, #8aa); margin-top: .25rem; }
.asst-rv-filename { margin-top: .6rem; font-size: .9rem; color: var(--text-main, #e8ecf7); display: none; }
.asst-rv-filename.has { display: flex; align-items: center; gap: .5rem; }
.asst-rv-filename i { color: var(--neon-primary, #7dd3fc); }
.asst-rv-filename .asst-rv-filerm {
    margin-left: auto; cursor: pointer; background: transparent; border: 0; color: var(--text-muted, #8aa);
    padding: 0; font-size: 1.1rem;
}
.asst-rv-filename .asst-rv-filerm:hover { color: #f87171; }

[data-theme="light"] .asst-rv-tabs { background: #fff; border-color: #d1d5db; }
[data-theme="light"] .asst-rv-tab.is-active { background: #f9fafb; color: #0ea5e9; }
[data-theme="light"] .asst-rv-drop { background: #fff; border-color: #d1d5db; }
[data-theme="light"] .asst-rv-drop:hover, [data-theme="light"] .asst-rv-drop.drag { border-color: #0ea5e9; background: rgba(14,165,233,.05); }

/* ===== Text-to-video source switcher (/videos/) ===== */
.vidg-source-switch { display:inline-flex; gap:.3rem; background: var(--bg-main, #0b1020); border:1px solid var(--border-color, #263049); border-radius:.5rem; padding:.2rem; margin-bottom:.6rem; }
.vidg-source-tab { display:inline-flex; align-items:center; gap:.4rem; padding:.4rem .9rem; border-radius:.35rem; color: var(--text-muted, #8aa); cursor:pointer; font-weight:500; margin:0; }
.vidg-source-tab input { display:none; }
.vidg-source-tab:hover { color: var(--text-main, #e8ecf7); }
.vidg-source-tab.is-active { background: var(--bg-card, #151c2c); color: var(--neon-primary, #7dd3fc); }
.vidg-source-panel { display:none; }
.vidg-source-panel.is-active { display:block; }
[data-theme="light"] .vidg-source-switch { background:#fff; border-color:#d1d5db; }
[data-theme="light"] .vidg-source-tab.is-active { background:#f9fafb; color:#0ea5e9; }

/* ═══════════════ Фиксированный topbar ═══════════════ */
:root { --topbar-h: 52px; }

.topbar-fixed {
    position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 1rem; z-index: 100;
    background: var(--bg-sidebar, #0d1321);
    border-bottom: 1px solid var(--border-color, #263049);
    backdrop-filter: blur(8px);
}
.topbar-left { display:flex; align-items:center; gap:.7rem; }
.topbar-brand { color: var(--text-main, #e8ecf7); text-decoration: none; font-weight: 700; font-size: 1.02rem; display:inline-flex; align-items:center; gap:.4rem; }
.topbar-brand i { color: var(--neon-primary, #7dd3fc); font-size: 1.2rem; }
.topbar-burger { background:transparent; border:0; color: var(--text-main, #e8ecf7); font-size: 1.3rem; padding: .2rem .4rem; }
.topbar-actions { display:flex; align-items:center; gap:.35rem; }

.topbar-btn {
    display:inline-flex; align-items:center; gap:.4rem;
    background: transparent; border:1px solid transparent; color: var(--text-muted, #8aa);
    padding: .45rem .75rem; border-radius:.5rem; text-decoration:none; font-weight:500;
    font-size:.9rem; cursor:pointer; transition: background .12s, color .12s, border-color .12s;
    line-height: 1;
}
.topbar-btn:hover { background: rgba(125,211,252,.08); color: var(--text-main, #e8ecf7); }
.topbar-btn i.bi { font-size: 1.05rem; }
.topbar-balance { color: var(--neon-primary, #7dd3fc); font-weight: 600; border-color: rgba(125,211,252,.25); }
.topbar-balance:hover { background: rgba(125,211,252,.12); color: var(--neon-primary, #7dd3fc); }
.topbar-balance i { color: var(--neon-primary, #7dd3fc); }
.topbar-balance small { color: var(--text-muted, #8aa); margin-left: .15rem; }
.topbar-profile { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-logout:hover { color: #f87171; background: rgba(248,113,113,.1); }

/* Сдвиг wrapper и sidebar под topbar */
.app-wrapper { padding-top: var(--topbar-h); }
.sidebar { top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); }

/* Разделитель в sidebar */
.sidebar-divider {
    list-style:none; margin: .8rem .8rem; padding: 0;
    border-top: 1px solid var(--border-color, #263049);
}

/* Светлая тема */
[data-theme="light"] .topbar-fixed { background:#ffffff; border-bottom-color:#e5e7eb; }
[data-theme="light"] .topbar-brand { color:#0f172a; }
[data-theme="light"] .topbar-btn { color:#64748b; }
[data-theme="light"] .topbar-btn:hover { background:#f1f5f9; color:#0f172a; }
[data-theme="light"] .topbar-balance { color:#0ea5e9; border-color:rgba(14,165,233,.25); }
[data-theme="light"] .topbar-balance:hover { background:rgba(14,165,233,.08); }
[data-theme="light"] .topbar-logout:hover { color:#dc2626; background:rgba(220,38,38,.08); }
[data-theme="light"] .sidebar-divider { border-top-color:#e5e7eb; }

/* На мобильных — скрыть brand когда мало места */
@media (max-width: 480px) {
    .topbar-brand span { display:none; }
    .topbar-btn { padding:.45rem .5rem; }
}

/* ===== Bootstrap .btn-outline-light — читаемый в светлой теме ===== */
[data-theme="light"] .btn-outline-light,
[data-theme="light"] .btn-outline-secondary {
    color: #334155;
    border-color: #cbd5e1;
    background-color: #ffffff;
}
[data-theme="light"] .btn-outline-light:hover,
[data-theme="light"] .btn-outline-light:focus,
[data-theme="light"] .btn-outline-secondary:hover,
[data-theme="light"] .btn-outline-secondary:focus {
    color: #0f172a;
    background-color: #f1f5f9;
    border-color: #94a3b8;
}
[data-theme="light"] .btn-outline-light:disabled,
[data-theme="light"] .btn-outline-light.disabled,
[data-theme="light"] .btn-outline-secondary:disabled {
    color: #94a3b8;
    background-color: #ffffff;
    border-color: #e2e8f0;
    opacity: 1;
}

/* Btn-light заполненный — тоже принимает контрастный цвет текста в светлой теме */
[data-theme="light"] .btn-light {
    color: #0f172a;
    border-color: #e2e8f0;
    background-color: #ffffff;
}
[data-theme="light"] .btn-light:hover {
    color: #0f172a;
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

/* btn-outline-danger — цвет-акцент, но чтобы не сливался в светлой теме */
[data-theme="light"] .btn-outline-danger {
    color: #dc2626;
    border-color: rgba(220,38,38,.35);
    background-color: #ffffff;
}
[data-theme="light"] .btn-outline-danger:hover {
    color: #ffffff;
    background-color: #dc2626;
    border-color: #dc2626;
}

/* ===== Кнопка «Создать видео» поверх картинок (дизайнер/улучшение) ===== */
.img-video-btn {
    position: absolute;
    top: 10px;
    right: 54px;
    width: 36px; height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(125,211,252,.85);
    color: #0b1020;
    font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity .2s ease, background .2s ease, transform .1s;
    z-index: 2;
    backdrop-filter: blur(4px);
    text-decoration: none;
}
.designer-result-item:hover .img-video-btn,
.generated-image-wrap:hover .img-video-btn { opacity: 1; }
.img-video-btn:hover { background: var(--neon-primary, #7dd3fc); transform: scale(1.05); color: #0b1020; }

.lightbox-video {
    position: absolute;
    top: 20px;
    right: 200px;
    background: rgba(125,211,252,.92);
    color: #0b1020;
    border: 0;
    padding: .6rem 1rem;
    border-radius: 6px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    z-index: 2;
    text-decoration: none;
    display: inline-flex; align-items: center; gap: .4rem;
    transition: background .15s;
}
.lightbox-video:hover { background: var(--neon-primary, #7dd3fc); color: #0b1020; }

/* Ряд кнопок в результате enhance */
.enh-result-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }

@media (max-width: 720px) {
    .lightbox-video { right: 20px; top: 70px; }
}

/* Наведение над улучшенным фото — кнопки действий (Скачать / Создать видео) */
.enh-ba-wrap { position: relative; overflow: hidden; border-radius: 6px; }
.enh-ba-overlay {
    position: absolute; inset: 0;
    display: flex; justify-content: center; align-items: center; gap: .5rem;
    background: linear-gradient(180deg, rgba(11,16,32,0) 0%, rgba(11,16,32,.55) 100%);
    opacity: 0;
    transition: opacity .18s;
    pointer-events: none;
}
.enh-ba-wrap:hover .enh-ba-overlay { opacity: 1; }
.enh-ba-overlay .enh-ba-action { pointer-events: auto; }
.enh-ba-action {
    width: 42px; height: 42px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,.92);
    color: #0b1020;
    text-decoration: none;
    font-size: 1.1rem;
    transition: transform .1s, background .15s;
}
.enh-ba-action:hover { transform: scale(1.08); background: #fff; color: #0b1020; }
.enh-ba-action.enh-ba-video { background: var(--neon-primary, #7dd3fc); }
.enh-ba-action.enh-ba-video:hover { background: #a78bfa; }
/* На мобильных — всегда видно */
@media (hover: none) {
    .enh-ba-overlay { opacity: 1; }
}


/* Lightbox: две кнопки рядом внизу */
.lightbox-download {
    /* Переопределение: выровнены относительно центра. */
    left: auto;
    right: calc(50% + 8px);
    transform: none !important;
}
.lightbox-video {
    position: absolute !important;
    top: auto !important;
    bottom: 24px;
    left: calc(50% + 8px);
    right: auto;
    padding: 10px 24px;
    border-radius: 30px;
    background: var(--neon-primary, #7dd3fc);
    color: #0b1020;
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    z-index: 10000;
    border: 1px solid var(--neon-primary, #7dd3fc);
    transition: background .15s, transform .1s;
}
.lightbox-video:hover { background: #a78bfa; color: #0b1020; transform: translateY(-1px); }

/* Плиточная кнопка видео — жёстче позиция и гарантированная видимость */
.img-video-btn {
    position: absolute;
    top: 10px;
    right: 54px;
    width: 36px; height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(125,211,252,.9);
    color: #0b1020;
    font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    text-decoration: none;
    opacity: 0;
    transition: opacity .2s, background .15s, transform .1s;
    z-index: 3;
}
.designer-result-item:hover .img-video-btn,
.generated-image-wrap:hover .img-video-btn { opacity: 1; }
.img-video-btn:hover { background: #a78bfa; transform: scale(1.08); }

@media (max-width: 576px) {
    .lightbox-download,
    .lightbox-video {
        padding: 8px 18px;
        font-size: .82rem;
    }
}

/* ИИ-помощник: рендер markdown, когда модель вернула текст вместо структуры */
.asst-md {
    background: var(--card-bg, rgba(255,255,255,.03));
    border: 1px solid var(--border-color, rgba(255,255,255,.1));
    border-radius: 14px;
    padding: 24px 28px;
    margin-bottom: 20px;
    color: var(--text-primary, #e5e7eb);
    line-height: 1.65;
    font-size: .97rem;
}
.asst-md h1 { font-size: 1.5rem; margin: 0 0 14px; color: var(--text-primary, #fff); }
.asst-md h2 { font-size: 1.25rem; margin: 22px 0 10px; color: var(--text-primary, #fff); border-bottom: 1px solid var(--border-color, rgba(255,255,255,.08)); padding-bottom: 6px; }
.asst-md h3 { font-size: 1.08rem; margin: 18px 0 8px; color: var(--text-primary, #fff); }
.asst-md h4 { font-size: 1.0rem; margin: 14px 0 6px; color: var(--text-primary, #fff); }
.asst-md p { margin: 0 0 10px; }
.asst-md ul, .asst-md ol { margin: 0 0 12px; padding-left: 22px; }
.asst-md li { margin-bottom: 4px; }
.asst-md strong, .asst-md b { color: var(--text-primary, #fff); }
.asst-md code { background: rgba(125,211,252,.12); color: var(--neon-primary, #7dd3fc); padding: 2px 6px; border-radius: 4px; font-size: .9em; }
.asst-md pre { background: rgba(0,0,0,.28); padding: 12px 14px; border-radius: 8px; overflow-x: auto; font-size: .88em; }
.asst-md blockquote { border-left: 3px solid var(--neon-primary, #7dd3fc); padding-left: 14px; margin: 10px 0; color: var(--text-muted, #9ca3af); }
.asst-md a { color: var(--neon-primary, #7dd3fc); text-decoration: none; border-bottom: 1px dashed rgba(125,211,252,.4); }
.asst-md a:hover { border-bottom-style: solid; }
.asst-md hr { border: 0; border-top: 1px solid var(--border-color, rgba(255,255,255,.1)); margin: 16px 0; }
.asst-md table { width: 100%; border-collapse: collapse; margin: 10px 0 14px; font-size: .92em; }
.asst-md th, .asst-md td { border: 1px solid var(--border-color, rgba(255,255,255,.12)); padding: 8px 10px; text-align: left; }
.asst-md th { background: rgba(125,211,252,.08); color: var(--text-primary, #fff); font-weight: 600; }

/* Пилюли выбора пропорций в /enhance/?tab=gen */
.enh-aspect-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.enh-aspect-pill {
    padding: 8px 14px;
    border-radius: 18px;
    border: 1px solid var(--border-color, rgba(255,255,255,.2));
    background: transparent;
    color: var(--text-primary, #e5e7eb);
    font-size: .9rem;
    font-family: monospace;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .1s;
}
.enh-aspect-pill:hover:not(.is-disabled) {
    border-color: var(--neon-primary, #7dd3fc);
    color: var(--neon-primary, #7dd3fc);
}
.enh-aspect-pill.is-active {
    background: var(--neon-primary, #7dd3fc);
    color: #0b1020;
    border-color: var(--neon-primary, #7dd3fc);
    font-weight: 600;
}
.enh-aspect-pill.is-disabled {
    opacity: .35;
    cursor: not-allowed;
    pointer-events: none;
}

/* Пилюли длительности в /videos/ */
.vidg-duration-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.vidg-duration-pill {
    padding: 8px 14px;
    border-radius: 18px;
    border: 1px solid var(--border-color, rgba(255,255,255,.2));
    background: transparent;
    color: var(--text-primary, #e5e7eb);
    font-size: .9rem;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .1s;
}
.vidg-duration-pill:hover:not(.is-disabled) {
    border-color: var(--neon-primary, #7dd3fc);
    color: var(--neon-primary, #7dd3fc);
}
.vidg-duration-pill.is-active {
    background: var(--neon-primary, #7dd3fc);
    color: #0b1020;
    border-color: var(--neon-primary, #7dd3fc);
    font-weight: 600;
}
.vidg-duration-pill.is-disabled {
    opacity: .35;
    cursor: not-allowed;
    pointer-events: none;
}

/* Глобальная настройка: все textarea — двойная высота и font-size 14px */
textarea.form-control,
textarea {
    font-size: 14px !important;
    min-height: 5em; /* примерно 2x от дефолтных rows */
}
textarea.form-control[rows="2"] { min-height: 6em; }
textarea.form-control[rows="3"] { min-height: 9em; }
textarea.form-control[rows="4"] { min-height: 12em; }
textarea.form-control[rows="5"] { min-height: 15em; }
textarea.form-control[rows="6"] { min-height: 18em; }

/* Унификация: все модули используют единый padding от .content-area (как /protocols/) */
.asst-layout,
.enh-layout,
.vidg-layout {
    padding: 0;
    max-width: none;
    margin: 0;
}
@media (max-width: 768px) {
    .asst-layout,
    .enh-layout,
    .vidg-layout { padding: 0; }
}

/* Глобальный поиск в верхней панели */
.topbar-search {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    min-width: 260px;
    max-width: 420px;
    margin-left: 0;
    background: var(--bg-card, rgba(255,255,255,.06));
    border: 1px solid var(--border-color, rgba(255,255,255,.1));
    border-radius: 8px;
    color: var(--text-muted, #9ca3af);
    cursor: text;
    transition: border-color .15s, background .15s;
}
.topbar-search:hover,
.topbar-search:focus-within {
    border-color: var(--neon-primary, #7dd3fc);
}
.topbar-search i { font-size: .9rem; color: var(--text-muted, #9ca3af); }
.topbar-search input {
    flex: 1;
    background: transparent;
    border: 0;
    outline: 0;
    color: var(--text-primary, #e5e7eb);
    font-size: .9rem;
    padding: 2px 0;
    min-width: 0;
}
.topbar-search input::placeholder { color: var(--text-muted, #9ca3af); }
.topbar-search-kbd {
    font-family: monospace;
    font-size: .72rem;
    padding: 2px 6px;
    border: 1px solid var(--border-color, rgba(255,255,255,.15));
    border-radius: 4px;
    color: var(--text-muted, #9ca3af);
    background: transparent;
}
@media (max-width: 768px) {
    .topbar-search { display: none; }
}

/* Унификация отступов: home и history — используют content-area padding */
.home-page,
.hist-layout {
    padding: 0;
    max-width: none;
    margin: 0;
}
@media (max-width: 768px) {
    .home-page,
    .hist-layout { padding: 0; }
}


/* Поиск: светлая тема + сдвиг topbar-search под край content-area */

/* Сдвиг: в десктопе sidebar имеет фиксированную ширину (~240–260px).
   Правило ниже совмещает левый край .topbar-search с началом основной колонки. */
@media (min-width: 769px) {
    .topbar-left {
        width: 260px;
        min-width: 260px;
        flex-shrink: 0;
    }
    /* Сдвигаем на padding-left .content-area (2rem), чтобы левый край поиска
       был ровно над левым краем контента. */
    .topbar-search {
        margin-left: 1rem;
    }
}

/* Светлая тема: модалка поиска */
[data-theme="light"] .search-modal-backdrop {
    background: rgba(15, 23, 42, 0.35);
}
[data-theme="light"] .search-modal {
    background: #ffffff;
    color: #1b2330;
    border: 1px solid #e1e6ef;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
}
[data-theme="light"] .search-modal-input-wrap {
    border-bottom: 1px solid #e5e7eb;
}
[data-theme="light"] .search-modal-input {
    color: #1b2330;
    background: #ffffff;
    caret-color: #1976d2;
}
[data-theme="light"] .search-modal-input::placeholder { color: #9ca3af; }
[data-theme="light"] .search-modal-input-wrap > i { color: #9ca3af; }
[data-theme="light"] .search-modal-empty { color: #6b7280; }
[data-theme="light"] .search-modal-result {
    color: #1b2330;
    border-top: 1px solid #f1f3f7;
}
[data-theme="light"] .search-modal-result:hover,
[data-theme="light"] .search-modal-result.focused {
    background: #eef3ff;
}
[data-theme="light"] .search-modal-result-icon {
    background: #eef3ff;
    color: #1976d2;
}
[data-theme="light"] .search-modal-result-title { color: #0f172a; }
[data-theme="light"] .search-modal-result-meta { color: #6b7280; }
[data-theme="light"] .search-modal-footer {
    background: #f8fafc;
    color: #6b7280;
    border-top: 1px solid #e5e7eb;
}
[data-theme="light"] .search-modal-footer kbd {
    background: #fff;
    border-color: #cbd5e1;
    color: #374151;
}

/* Светлая тема: сам topbar-search */
[data-theme="light"] .topbar-search {
    background: #f1f5f9;
    border-color: #d9e0ea;
}
[data-theme="light"] .topbar-search input {
    color: #1b2330;
}
[data-theme="light"] .topbar-search input::placeholder { color: #9ca3af; }
[data-theme="light"] .topbar-search i,
[data-theme="light"] .topbar-search-kbd { color: #6b7280; }


/* === Логотип Асора === */
.topbar-brand {
    display: inline-flex; align-items: center; padding: 0;
    height: 100%;
}
.topbar-brand-logo {
    height: 25px; width: auto; display: block;
    max-width: 200px;
}
.topbar.d-md-none .topbar-title {
    display: inline-flex; align-items: center;
    padding: 0 .5rem;
}
.topbar.d-md-none .topbar-brand-logo {
    height: 28px;
}
.lp-brand {
    display: inline-flex; align-items: center;
}
.lp-brand-logo {
    height: 36px; width: auto; display: block;
    max-width: 180px;
}


/* === Разделитель и слоган в topbar === */
.topbar-divider {
    display: inline-block;
    width: 1px; height: 28px;
    background: var(--border-color, #2b3545);
    margin: 0 .75rem 0 .7rem;
    flex-shrink: 0;
}
.topbar-tagline {
    display: inline-block;
    font-size: .75rem; line-height: 1.15;
    color: var(--text-muted, #8998ab);
    white-space: nowrap;
    letter-spacing: .01em;
    font-weight: 500;
}
/* На узких экранах слоган прячем, чтоб не ломать верстку */
@media (max-width: 900px) {
    .topbar-divider, .topbar-tagline { display: none; }
}
[data-theme="light"] .topbar-divider { background: #e1e6ef; }
[data-theme="light"] .topbar-tagline { color: #6b7280; }


/* === Переключение логотипа Асора по теме === */
.topbar-brand, .topbar-title { position: relative; }
.topbar-brand-logo--light { display: none; }
.topbar-brand-logo--dark  { display: block; }
[data-theme="light"] .topbar-brand-logo--dark  { display: none; }
[data-theme="light"] .topbar-brand-logo--light { display: block; }

/* Логотип на /login/, /register/, /verify/ */
.auth-logo-link { display:inline-block; text-decoration:none; }
.auth-logo-img { height:44px; width:auto; max-width:220px; display:block; margin:0 auto 0.75rem; }
.auth-logo-img--light { display: none; }
.auth-logo-img--dark  { display: block; }
[data-theme="light"] .auth-logo-img--dark  { display: none; }
[data-theme="light"] .auth-logo-img--light { display: block; }
/* ========== Cookie banner ========== */
.cc-banner {
    position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 10000;
    max-width: 860px; margin: 0 auto;
    background: #111827; color: #e5e7eb;
    border: 1px solid rgba(167,139,250,.4); border-radius: 12px;
    padding: 14px 18px; display: flex; gap: 14px; align-items: center;
    box-shadow: 0 20px 40px rgba(0,0,0,.35);
    font-family: 'Onest', system-ui, sans-serif; font-size: .9rem; line-height: 1.5;
    transition: opacity .25s ease;
}
.cc-banner .cc-text { flex: 1; }
.cc-banner a { color: #c4b5fd; text-decoration: none; border-bottom: 1px solid rgba(196,181,253,.4); }
.cc-banner a:hover { color: #ddd6fe; }
.cc-actions { flex: 0 0 auto; }
.cc-btn { padding: .5rem 1.1rem; border: 0; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: .9rem; font-family: inherit; }
.cc-btn-primary { background: linear-gradient(135deg, #a78bfa, #7dd3fc); color: #111827; }
.cc-btn-primary:hover { filter: brightness(1.1); }
@media (max-width: 640px) {
    .cc-banner { flex-direction: column; align-items: stretch; left: 8px; right: 8px; bottom: 8px; padding: 12px 14px; }
    .cc-actions { display: flex; justify-content: flex-end; }
}

/* ========== Legal footer (full) — landing + lp + legal pages ========== */
.lp-footer-legal { background: #0f172a; color: #cbd5e1; padding: 2.5rem 0 1.5rem; font-size: .9rem; margin-top: 3rem; }
.lp-footer-legal .lp-container { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
.lp-footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid rgba(148,163,184,.2); }
.lp-footer-legal .lp-footer-brand { font-size: 1.25rem; font-weight: 700; color: #fff; }
.lp-footer-legal .lp-footer-tagline { color: #94a3b8; font-size: .85rem; margin-top: .25rem; }
.lp-footer-legal .lp-footer-h { color: #fff; font-weight: 600; margin-bottom: .75rem; font-size: .9rem; }
.lp-footer-legal a { color: #cbd5e1; text-decoration: none; display: block; padding: .2rem 0; }
.lp-footer-legal a:hover { color: #fff; }
.lp-footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 1rem; color: #94a3b8; font-size: .82rem; flex-wrap: wrap; gap: .5rem; }
.lp-footer-req { color: #94a3b8; font-size: .82rem; }
@media (max-width: 720px) {
    .lp-footer-grid { grid-template-columns: 1fr; gap: 1.25rem; }
    .lp-footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* === Админка: блок баланса провайдера в цветах активной темы === */
.admin-balance-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-card);
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}
.admin-balance-card::before {
    content: "";
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--neon-primary), var(--neon-secondary));
    opacity: .8;
}
.admin-balance-row {
    display: flex; flex-wrap: wrap; align-items: center; gap: 1.75rem;
}
.admin-balance-block { min-width: 0; }
.admin-balance-block--main { flex-grow: 1; }
.admin-balance-label {
    display: inline-flex; align-items: center; gap: .35rem;
    color: var(--text-secondary);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .35rem;
}
.admin-balance-label i { color: var(--neon-primary); font-size: .85rem; }
.admin-balance-amount {
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -.01em;
}
.admin-balance-amount.tone-success { color: var(--neon-accent); }
.admin-balance-amount.tone-warning { color: #f59e0b; }
.admin-balance-amount.tone-danger  { color: var(--neon-pink); }
.admin-balance-spent {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}
.admin-balance-meta {
    display: inline-flex; align-items: center; gap: .35rem;
    margin-left: auto;
    color: var(--text-muted);
    font-size: .82rem;
}
.admin-balance-meta i { color: var(--text-muted); }
.admin-balance-refresh {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px;
    border-radius: 6px;
    color: var(--neon-primary);
    text-decoration: none;
    transition: var(--transition);
    margin-left: .25rem;
}
.admin-balance-refresh:hover {
    background: rgba(0, 229, 255, .12);
    color: var(--neon-primary);
}
[data-theme="light"] .admin-balance-refresh:hover {
    background: rgba(0, 151, 167, .12);
}
@media (max-width: 720px) {
    .admin-balance-row { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .admin-balance-meta { margin-left: 0; }
}
