/* VibeDesk — сгенерировано tools/extract_css_palettes.py; править вручную / см. docs/UI_STYLES_AND_THEMES.md */

/* Soft Dark — угольно-серый, плоский, без свечений */
body[data-color-palette="dark"]{
    --vd-bg: #1a1d21;
    --vd-bg-deep: #101214;
    --vd-panel: #2a2e33;
    --vd-panel-strong: #2f3338;
    --vd-panel-soft: #252a30;
    --vd-border: #3a3f46;
    --vd-border-soft: #2f3338;
    --vd-border-strong: #4a4f57;
    --vd-accent: #3b82f6;
    --vd-accent-strong: #2563eb;
    --vd-accent-soft: rgba(59, 130, 246, 0.16);
    --vd-accent-soft-2: rgba(59, 130, 246, 0.28);
    --vd-accent-glow: 0 0 0 3px rgba(59, 130, 246, 0.22);
    --vd-chrome-bg: #212529;
    --vd-chrome-bg-soft: #2a2e33;
    --vd-chrome-flat: #3a4046;
    --vd-chrome-gradient-135-from: rgba(33, 37, 41, 0.94);
    --vd-chrome-gradient-135-to: rgba(42, 46, 51, 0.88);
    --vd-chrome-sidebar-glass-from: rgba(33, 37, 41, 0.79);
    --vd-chrome-sidebar-glass-to: rgba(26, 29, 33, 0.77);
    --vd-chrome-panel-180-from: rgba(33, 37, 41, 0.96);
    --vd-chrome-panel-180-to: rgba(26, 29, 33, 0.94);
    --vd-chrome-kb-head-180-from: rgba(33, 37, 41, 0.95);
    --vd-chrome-kb-head-180-to: rgba(26, 29, 33, 0.92);
    --vd-glass-guest-stop-1: rgba(33, 37, 41, 0.72);
    --vd-glass-guest-stop-2: rgba(26, 29, 33, 0.62);
    --vd-glass-guest-stop-3: rgba(30, 34, 38, 0.68);
    --vd-glass-guest-border: rgba(255, 255, 255, 0.1);
    --vd-glass-card-from: rgba(33, 37, 41, 0.92);
    --vd-glass-card-to: rgba(26, 29, 33, 0.82);
    /* UI consistency — home / chat / profile (S4) */
    --vd-card-head-bg: transparent;
    --vd-card-head-fg: var(--vd-text);
    --vd-card-head-border: var(--vd-border-soft);
    --vd-stat-delta-up: #6ee7b7;
    --vd-stat-delta-dn: #fcd34d;
    --zen-msg-area-bg: linear-gradient(180deg, rgba(42, 46, 51, 0.96) 0%, rgba(26, 29, 33, 0.99) 100%);
    --zen-msg-area-fg: var(--vd-text);
    --zen-msg-area-muted: var(--vd-text-muted);
    --zen-msg-composer-bg: var(--vd-panel-strong);
    --zen-msg-border: var(--vd-border);
    --zen-msg-row-active-bg: linear-gradient(90deg, rgba(59, 130, 246, 0.22) 0%, rgba(59, 130, 246, 0.08) 100%);
    --zen-msg-row-active-ring: rgba(59, 130, 246, 0.35);
    --zen-msg-panel-surface: rgba(26, 29, 33, 0.85);
    --zen-msg-panel-surface-soft: rgba(33, 37, 41, 0.72);
    --vd-profile-panel-glass-bg: rgba(42, 46, 51, 0.88);
    --vd-profile-panel-glass-border: rgba(255, 255, 255, 0.1);
    --vd-profile-tabs-bar-bg: rgba(33, 37, 41, 0.72);
    --vd-chrome-shadow-rgb: 0, 0, 0;
    --vd-chrome-text: #e5e7eb;
    --vd-chrome-text-muted: rgba(229, 231, 235, 0.66);
    --vd-chrome-text-faint: rgba(229, 231, 235, 0.38);
    --vd-chrome-border: rgba(255, 255, 255, 0.06);
    --vd-chrome-active-bg: rgba(59, 130, 246, 0.20);
    --vd-chrome-active-text: #dbeafe;
    --vd-text: #e5e7eb;
    --vd-text-strong: #f9fafb;
    --vd-text-muted: #9ca3af;
    --vd-text-faint: #6b7280;
    --vd-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --vd-shadow-md: 0 6px 18px rgba(0, 0, 0, 0.45);
    --vd-shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);

    /* Статус-пилюли на тёмном фоне — чуть ярче */
    --vd-chip-blue-text: #93c5fd;
    --vd-chip-emerald-text: #6ee7b7;
    --vd-chip-orange-text: #fdba74;
    --vd-chip-red-text: #fca5a5;
    --vd-chip-yellow-text: #fde68a;
    --vd-chip-violet-text: #c4b5fd;
    --vd-chip-gray-text: #cbd5e1;
}

body[data-color-palette="dark"] .modal-content .btn-close{
    filter: invert(1) grayscale(100%) brightness(200%);
}

body[data-color-palette="dark"] .vd-glass-card--guest-cta{
    background: linear-gradient(145deg, rgba(33, 37, 41, 0.94) 0%, rgba(26, 29, 33, 0.9) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: var(--vd-text) !important;
}

body[data-color-palette="dark"] .vd-glass-card--guest-cta .vd-guest-cta-lead{
    color: rgba(229, 231, 235, 0.88) !important;
}

body.zen-body:not(.auth-bg):not(.zen-guest)[data-color-palette="dark"] .footer{
    background: rgba(33, 37, 41, 0.82) !important;
    color: var(--vd-chrome-text-muted) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body[data-color-palette="dark"] .vd-glass-card{
    background: rgba(42, 46, 51, 0.92) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--vd-border) !important;
    color: var(--vd-text) !important;
}

/* Soft Dark: те же правила для утилит .text-dark / заголовков */

body[data-color-palette="dark"] .main-wrapper .text-dark,
body[data-color-palette="dark"] .main-wrapper .text-body{
    color: var(--vd-text-muted) !important;
}

body[data-color-palette="dark"] .main-wrapper .card .card-title,
body[data-color-palette="dark"] .main-wrapper .card-title,
body[data-color-palette="dark"] .main-wrapper h1:not(.vd-text-gradient):not(.vd-feed-title),
body[data-color-palette="dark"] .main-wrapper h2:not(.vd-text-gradient),
body[data-color-palette="dark"] .main-wrapper h3:not(.vd-text-gradient),
body[data-color-palette="dark"] .main-wrapper h4:not(.vd-text-gradient),
body[data-color-palette="dark"] .main-wrapper h5:not(.vd-text-gradient),
body[data-color-palette="dark"] .main-wrapper .h1:not(.vd-text-gradient):not(.vd-feed-title),
body[data-color-palette="dark"] .main-wrapper .h2:not(.vd-text-gradient),
body[data-color-palette="dark"] .main-wrapper .h3:not(.vd-text-gradient),
body[data-color-palette="dark"] .main-wrapper .h4:not(.vd-text-gradient),
body[data-color-palette="dark"] .main-wrapper .h5:not(.vd-text-gradient){
    color: var(--vd-text-strong) !important;
}

body[data-color-palette="dark"] .main-wrapper .vd-feed-header h1.vd-feed-title,
body[data-color-palette="dark"] .main-wrapper .vd-feed-header h1 {
    color: #0f172a !important;
}

body[data-color-palette="dark"] .footer{
    background: var(--vd-chrome-bg) !important;
    color: var(--vd-chrome-text-muted) !important;
    border-top: 1px solid var(--vd-chrome-border) !important;
}

body[data-color-palette="dark"] .vd-kb-root-head{
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(59, 130, 246, 0.12));
    color: var(--vd-text-strong);
    border-bottom-color: var(--vd-border) !important;
}

body[data-color-palette="dark"] .vd-kb-main{
    background: linear-gradient(180deg, rgba(42, 46, 51, 0.88) 0%, rgba(33, 37, 41, 0.82) 100%) !important;
    color: var(--vd-text-strong) !important;
}

body[data-color-palette="dark"] .vd-kb-main .vd-kb-welcome-title,
body[data-color-palette="dark"] .vd-kb-main h1,
body[data-color-palette="dark"] .vd-kb-main h2{
    color: var(--vd-text-strong) !important;
}

body[data-color-palette="dark"] .vd-kb-main .text-muted,
body[data-color-palette="dark"] .vd-kb-main .vd-kb-welcome-lead{
    color: var(--vd-text-muted) !important;
}

body[data-color-palette="dark"] .main-wrapper .zen-data-table thead th{
    background: var(--vd-panel-soft) !important;
    color: var(--vd-text-muted) !important;
}

body[data-color-palette="dark"] .main-wrapper .zen-data-table tbody td{
    background-color: rgba(42, 46, 51, 0.65) !important;
    color: var(--vd-text) !important;
}

body[data-color-palette="dark"] .main-wrapper .form-control[type="file"]::file-selector-button{
    background: linear-gradient(135deg, var(--vd-accent) 0%, var(--vd-accent-strong) 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 0.45rem;
    margin-right: 0.65rem;
    padding: 0.35rem 0.85rem;
    font-weight: 600;
}

/* --- scoped isolation (auto-split) --- */

body[data-color-palette="dark"] .zen-chat-group-scroll .list-group-item.active{
    color: var(--vd-chrome-active-text);
}

body[data-color-palette="dark"] .vd-kb-sidebar{
    background: rgba(0, 0, 0, 0.2);
}

body[data-color-palette="dark"] .vd-kb-modal-head{
    background: rgba(15, 23, 42, 0.55);
    color: var(--vd-text-strong);
}

body[data-color-palette="dark"] .vd-kb-modal-head .vd-kb-modal-close{
    filter: invert(1) grayscale(100%) brightness(1.8);
    opacity: 0.85;
}

body[data-color-palette="dark"] .vd-kb-details-sidebar-head{
    background: rgba(0, 0, 0, 0.22);
}

body[data-color-palette="dark"] .vd-kb-details-main-head{
    background: rgba(0, 0, 0, 0.18);
}

/* --- messenger theme tokens (from vd-messenger-theme.css) --- */

body.zen-body[data-color-palette="dark"]{
    --zen-msg-area-bg: linear-gradient(180deg, rgba(42, 46, 51, 0.96) 0%, rgba(26, 29, 33, 0.99) 100%);
    --zen-msg-area-fg: var(--vd-text);
    --zen-msg-area-muted: var(--vd-text-muted);
    --zen-msg-area-empty-icon: var(--vd-accent);
    --zen-msg-panel-surface: rgba(26, 29, 33, 0.85);
    --zen-msg-panel-surface-soft: rgba(33, 37, 41, 0.72);
    --zen-msg-composer-bg: var(--vd-panel-strong);
    --zen-msg-border: var(--vd-border);
    --zen-msg-head-search-bg: rgba(255, 255, 255, 0.12);
    --zen-msg-head-search-fg: var(--vd-chrome-text);
    --zen-msg-head-search-muted: var(--vd-chrome-text-muted);
    --zen-msg-head-badge-bg: rgba(255, 255, 255, 0.16);
    --zen-msg-head-badge-fg: var(--vd-chrome-text);
    --zen-msg-row-active-bg: linear-gradient(90deg, rgba(59, 130, 246, 0.22) 0%, rgba(59, 130, 246, 0.08) 100%);
    --zen-msg-row-active-ring: rgba(59, 130, 246, 0.35);
    --zen-msg-wallpaper-office:
        radial-gradient(circle at 1px 1px, rgba(148, 163, 184, 0.08) 1px, transparent 0),
        var(--zen-msg-area-bg);
    --zen-msg-wallpaper-paper:
        radial-gradient(circle at 1px 1px, rgba(148, 163, 184, 0.10) 1px, transparent 0),
        linear-gradient(180deg, rgba(48, 44, 40, 0.94) 0%, rgba(30, 28, 26, 0.98) 100%);
    --zen-msg-wallpaper-telegram:
        radial-gradient(circle at 10px 10px, rgba(59, 130, 246, 0.12) 1px, transparent 0),
        radial-gradient(circle at 1px 1px, rgba(148, 163, 184, 0.10) 1px, transparent 0),
        linear-gradient(180deg, rgba(30, 41, 59, 0.94) 0%, rgba(26, 29, 33, 0.98) 100%);
    --zen-msg-wallpaper-doodle-blue-base: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    --zen-msg-wallpaper-doodle-light-base: linear-gradient(180deg, #334155 0%, #1e293b 100%);
    --zen-msg-wallpaper-doodle-warm-base: linear-gradient(180deg, #3f3a34 0%, #292524 100%);
    --zen-msg-wallpaper-doodle-mint-base: linear-gradient(180deg, #1e3a3a 0%, #0f172a 100%);
    --zen-msg-wallpaper-doodle-slate-base: linear-gradient(180deg, #1a1d21 0%, #0f1114 100%);
    --zen-msg-wallpaper-doodle-violet-base: linear-gradient(180deg, #1e1b4b 0%, #0f0a1a 100%);
    --zen-msg-tg-bubble-mine-fg: #ecfdf5;
    --zen-msg-tg-bubble-other-bg: var(--vd-panel-strong);
    --zen-msg-tg-bubble-other-fg: var(--vd-text);
}

body.zen-body[data-color-palette="dark"] .zen-messenger-bubbles--telegram .zen-messenger-bubble-mine{
    color: var(--zen-msg-tg-bubble-mine-fg) !important;
}

body.zen-body[data-color-palette="dark"] .zen-messenger-bubbles--telegram .zen-messenger-bubble-other{
    background: var(--zen-msg-tg-bubble-other-bg) !important;
    color: var(--zen-msg-tg-bubble-other-fg) !important;
    border-color: var(--zen-msg-border) !important;
}

body.zen-body[data-color-palette="dark"] .zen-messenger-msg-area .btn-outline-secondary{
    color: var(--zen-msg-area-fg) !important;
    border-color: var(--zen-msg-border) !important;
    background: transparent !important;
}

body.zen-body[data-color-palette="dark"] .zen-messenger-msg-area .btn-outline-secondary:hover{
    background: var(--zen-msg-panel-surface-soft) !important;
}
