/*
 * Оформление YOI: светлая и тёмная темы — одни и те же на сайте (панель YOI, кабинет ресторана, сети, платформы,
 * партнёра) и в YOI для Windows. Тему включает атрибут data-yoi-theme="light|dark" на <html>: на сайте его ставит
 * yoi-theme.js по выбору человека (по умолчанию светлая), в приложении для Windows — его preload по настройке.
 *
 * Основа — токены yoi.css и brand.css: почти вся панель нарисована ими, и смены токенов хватает. Ниже токенов —
 * только места, где цвет на странице зашит числом. Копия файла едет в приложение для Windows
 * (yoi-pos/electron/panel-theme.css, scripts/yoi-theme/sync.mjs) — для серверов, где этого файла ещё нет.
 *
 * Правило: новый цвет, зашитый в страницу, — сразу и сюда, в обе темы. Лучше — не зашивать, а брать токен.
 */

/* ════════════════════════════════════════════════════════════════════════════
   Тёмная тема
   ════════════════════════════════════════════════════════════════════════════ */

:root[data-yoi-theme="dark"] {
    color-scheme: dark;

    /* Какао: фон страницы — ровно цвет левого меню, карточки — на ступень выше. */
    --yoi-bg: #29251f;
    --yoi-surface: #312c26;
    --yoi-surface-2: #3a342d;
    --yoi-field: #231f1a;
    --yoi-border: #443c33;
    --yoi-border-strong: #5e5448;
    --yoi-text: #f6f1e9;
    --yoi-muted: #bdb3a4;

    /* Салатовый — главное действие и выбор; светлее — текст-акцент на тёмном. */
    --yoi-green: #b8e85b;
    --yoi-green-dark: #cdf084;
    --yoi-green-light: #39432a;
    --yoi-green-soft: #2d2923;
    --yoi-on-accent: #1d1a15;

    --yoi-coral: #eba582;
    --yoi-red: #ff9389;
    --yoi-red-soft: rgba(255, 147, 137, .13);
    --yoi-amber: #f0c06a;
    --yoi-amber-soft: #43361f;
    --yoi-blue: #93cbee;
    --yoi-blue-soft: #233542;
    --yoi-violet: #c9b2ff;
    --yoi-violet-soft: #332c47;

    --yoi-focus: 0 0 0 3px rgba(184, 232, 91, .38);
    --yoi-shadow: 0 18px 44px rgba(0, 0, 0, .42);
    --yoi-scrim: rgba(14, 11, 8, .66);

    /* brand.css: страницы панели берут из него шрифт, текст и поля. */
    --brand-cream: var(--yoi-bg);
    --brand-paper: var(--yoi-surface);
    --brand-surface: var(--yoi-surface);
    --brand-green: var(--yoi-green);
    --brand-green-strong: var(--yoi-green-dark);
    --brand-green-wash: var(--yoi-green-light);
    --brand-charcoal: var(--yoi-text);
    --brand-muted: var(--yoi-muted);
    --brand-line: var(--yoi-border);
    --brand-soft: var(--yoi-surface-2);
    --brand-field: var(--yoi-field);
    --brand-danger: var(--yoi-red);
    --brand-warning: var(--yoi-amber);
    --brand-success: var(--yoi-green);
    --brand-focus: var(--yoi-focus);
    --brand-shadow: var(--yoi-shadow);
    --c-primary: 184 232 91;
    --c-secondary: 41 37 31;
    --c-grayDark: 246 241 233;
    --c-grayLight: 68 60 51;

    background: var(--yoi-bg);
}

:root[data-yoi-theme="dark"] body,
:root[data-yoi-theme="dark"] body.yoi,
:root[data-yoi-theme="dark"] body.yoi-legacy {
    background: var(--yoi-bg) !important;
    color: var(--yoi-text);
}

/* Едва заметный салатовый свет в углу: страница продолжает меню, а не стоит
   рядом с ним плоской заливкой. Фиксирован, чтобы не ехать с прокруткой. */
:root[data-yoi-theme="dark"] body.yoi::before {
    content: '';
    position: fixed;
    inset: 0 0 auto 0;
    height: 420px;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(900px 340px at 0% 0%, rgba(184, 232, 91, .07), transparent 70%);
}
:root[data-yoi-theme="dark"] #main-content { position: relative; z-index: 1; }

:root[data-yoi-theme="dark"] ::selection { background: var(--yoi-green); color: var(--yoi-on-accent); }
:root[data-yoi-theme="dark"] * { scrollbar-color: #5e5448 transparent; }
:root[data-yoi-theme="dark"] .yoi :where(.yoi-scroll, .yoi-table-wrap, .yoi-table-scroll) { scrollbar-color: #5e5448 var(--yoi-surface); }
:root[data-yoi-theme="dark"] ::-webkit-scrollbar { width: 12px; height: 12px; }
:root[data-yoi-theme="dark"] ::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 12px; background: #5e5448; background-clip: content-box; }
:root[data-yoi-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #776b5c; background-clip: content-box; }
:root[data-yoi-theme="dark"] ::-webkit-scrollbar-track,
:root[data-yoi-theme="dark"] ::-webkit-scrollbar-corner { background: transparent; }

:root[data-yoi-theme="dark"] :where(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--yoi-green);
    outline-offset: 2px;
}

/* ── Шапка раздела ─────────────────────────────────────────────────────────── */

:root[data-yoi-theme="dark"] .yoi-topbar {
    background: rgba(41, 37, 31, .9);
    backdrop-filter: blur(12px);
    border-bottom-color: var(--yoi-border);
}
:root[data-yoi-theme="dark"] .yoi-topbar h1 { color: var(--yoi-text); }
:root[data-yoi-theme="dark"] .yoi-topbar a.yoi-btn-primary { color: var(--yoi-on-accent); }

/* ── Карточки, плитки, показатели ──────────────────────────────────────────── */

:root[data-yoi-theme="dark"] .yoi-panel {
    border-color: var(--yoi-border);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px rgba(0, 0, 0, .18);
}
:root[data-yoi-theme="dark"] .yoi-stat-value { color: var(--yoi-text); }
:root[data-yoi-theme="dark"] .yoi-stat:first-child .yoi-stat-value { color: var(--yoi-green); }
:root[data-yoi-theme="dark"] .yoi-tile-icon,
:root[data-yoi-theme="dark"] .yoi-directory .yoi-tile-icon { background: var(--yoi-green-light); color: var(--yoi-green); }
:root[data-yoi-theme="dark"] .yoi-directory .yoi-tile:hover { background: var(--yoi-surface); }

:root[data-yoi-theme="dark"] .yoi-welcome {
    position: relative;
    background:
        radial-gradient(520px 220px at 100% 100%, rgba(184, 232, 91, .16), transparent 70%),
        linear-gradient(135deg, #36302a, #2e2a24);
    border: 1px solid var(--yoi-border);
}
:root[data-yoi-theme="dark"] .yoi-welcome-kicker { color: var(--yoi-green); }
:root[data-yoi-theme="dark"] .yoi-live-count strong { color: var(--yoi-green); }

/* ── Поля ──────────────────────────────────────────────────────────────────── */

:root[data-yoi-theme="dark"] :where(.yoi-input, .yoi-select, .yoi-textarea),
:root[data-yoi-theme="dark"] .yoi :where(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), select, textarea) {
    background-color: var(--yoi-field);
    border-color: var(--yoi-border-strong);
    color: var(--yoi-text);
}
:root[data-yoi-theme="dark"] :where(.yoi-input, .yoi-select, .yoi-textarea):hover { border-color: #7a6e5f; }
:root[data-yoi-theme="dark"] :where(.yoi-input, .yoi-select, .yoi-textarea):focus { border-color: var(--yoi-green); box-shadow: var(--yoi-focus); }
:root[data-yoi-theme="dark"] .yoi-input[readonly] { background: var(--yoi-surface-2) !important; color: var(--yoi-muted); }
:root[data-yoi-theme="dark"] :where(input, textarea) { caret-color: var(--yoi-green); }
:root[data-yoi-theme="dark"] :where(input[type=checkbox], input[type=radio], input[type=range]) { accent-color: var(--yoi-green); }
:root[data-yoi-theme="dark"] option { background: var(--yoi-field); color: var(--yoi-text); }
:root[data-yoi-theme="dark"] .yoi-table-tech .yoi-input { background: transparent; border-color: transparent; }
:root[data-yoi-theme="dark"] .yoi-table-tech .yoi-input:focus { background: var(--yoi-field); border-color: var(--yoi-green); box-shadow: 0 0 0 2px var(--yoi-green-light); }
:root[data-yoi-theme="dark"] .yoi-label { color: var(--yoi-text); }

/* ── Кнопки ────────────────────────────────────────────────────────────────── */

:root[data-yoi-theme="dark"] .yoi-btn-primary,
:root[data-yoi-theme="dark"] .yoi-icon-btn.yoi-icon-btn-primary {
    background: var(--yoi-green);
    border-color: var(--yoi-green);
    color: var(--yoi-on-accent);
    font-weight: 750;
}
:root[data-yoi-theme="dark"] .yoi-btn-primary:hover:not(:disabled),
:root[data-yoi-theme="dark"] .yoi-icon-btn.yoi-icon-btn-primary:hover:not(:disabled) {
    background: var(--yoi-green-dark);
    border-color: var(--yoi-green-dark);
    box-shadow: 0 6px 18px rgba(184, 232, 91, .18);
}
:root[data-yoi-theme="dark"] .yoi-btn-outline,
:root[data-yoi-theme="dark"] .yoi-icon-btn {
    background: var(--yoi-surface);
    border-color: var(--yoi-border-strong);
    color: var(--yoi-text);
}
:root[data-yoi-theme="dark"] .yoi-btn-outline:hover:not(:disabled),
:root[data-yoi-theme="dark"] .yoi-icon-btn:hover:not(:disabled) {
    background: var(--yoi-surface-2);
    border-color: var(--yoi-green);
    color: var(--yoi-green-dark);
}
:root[data-yoi-theme="dark"] .yoi-btn-ghost { color: var(--yoi-muted); }
:root[data-yoi-theme="dark"] .yoi-btn-ghost:hover:not(:disabled) { background: var(--yoi-surface-2); color: var(--yoi-text); }
:root[data-yoi-theme="dark"] .yoi-btn-danger { background: var(--yoi-red-soft); color: var(--yoi-red); }
:root[data-yoi-theme="dark"] .yoi-btn-danger:hover:not(:disabled) { background: #5a2d29; }

/* ── Метки ─────────────────────────────────────────────────────────────────── */

:root[data-yoi-theme="dark"] .yoi-badge-green { background: var(--yoi-green-light); color: var(--yoi-green-dark); }
:root[data-yoi-theme="dark"] .yoi-badge-red { background: var(--yoi-red-soft); color: var(--yoi-red); }
:root[data-yoi-theme="dark"] .yoi-badge-amber { background: var(--yoi-amber-soft); color: var(--yoi-amber); }
:root[data-yoi-theme="dark"] .yoi-badge-blue { background: var(--yoi-blue-soft); color: var(--yoi-blue); }
:root[data-yoi-theme="dark"] .yoi-badge-gray { background: var(--yoi-surface-2); color: var(--yoi-muted); }
:root[data-yoi-theme="dark"] .yoi-badge-ai { background: var(--yoi-violet-soft); color: var(--yoi-violet); }
:root[data-yoi-theme="dark"] .yoi-support-badge { background: #ff6b63; color: var(--yoi-on-accent); }

:root[data-yoi-theme="dark"] .yoi-ai-note { background: var(--yoi-violet-soft); border-color: #4b3f6b; color: #ddd0ff; }
:root[data-yoi-theme="dark"] .yoi-ai-off { background: var(--yoi-amber-soft); border-color: #6b5631; color: var(--yoi-amber); }

/* ── Вкладки ───────────────────────────────────────────────────────────────── */

:root[data-yoi-theme="dark"] .yoi-tab { color: var(--yoi-muted); }
:root[data-yoi-theme="dark"] .yoi-tab:hover { color: var(--yoi-text); }
:root[data-yoi-theme="dark"] .yoi-tab.active { color: var(--yoi-green); border-bottom-color: var(--yoi-green); }

/* ── Таблицы ───────────────────────────────────────────────────────────────── */

:root[data-yoi-theme="dark"] .yoi-scroll { background: var(--yoi-surface); border-color: var(--yoi-border); }
:root[data-yoi-theme="dark"] .yoi-table th { background: #2c2822; color: var(--yoi-muted); border-bottom-color: var(--yoi-border); }
:root[data-yoi-theme="dark"] .yoi-table td { border-bottom-color: #3b342c; }
:root[data-yoi-theme="dark"] .yoi-table tbody tr { background: var(--yoi-surface); }
:root[data-yoi-theme="dark"] .yoi-table tbody tr:nth-child(even) { background: #2f2a24; }
:root[data-yoi-theme="dark"] .yoi-table tbody tr:hover { background: #3b3a2a; }
:root[data-yoi-theme="dark"] .yoi-table-tech th { background: #333a26; color: var(--yoi-green-dark); border-bottom-color: var(--yoi-border-strong); }
:root[data-yoi-theme="dark"] .yoi-table-tech th,
:root[data-yoi-theme="dark"] .yoi-table-tech td { border-right-color: #3b342c; }
:root[data-yoi-theme="dark"] .yoi-table-tech tbody tr:nth-child(even) { background: #2f2a24; }
:root[data-yoi-theme="dark"] .yoi-tech-total { background: var(--yoi-green-light); border-color: #4c5935; color: var(--yoi-green-dark); }

/* ── Дерево номенклатуры ───────────────────────────────────────────────────── */

:root[data-yoi-theme="dark"] .yoi-group-explorer { background: var(--yoi-surface); }
:root[data-yoi-theme="dark"] .yoi-tree-row:hover { background: var(--yoi-surface-2); }
:root[data-yoi-theme="dark"] .yoi-tree-row.is-selected { background: var(--yoi-green-light); color: var(--yoi-green-dark); }
:root[data-yoi-theme="dark"] .yoi-tree-folder { color: var(--yoi-amber); }
:root[data-yoi-theme="dark"] .yoi-tree-folder-root,
:root[data-yoi-theme="dark"] .yoi-tree-node[aria-expanded="true"] > .yoi-tree-row .yoi-tree-folder { color: var(--yoi-green); }
:root[data-yoi-theme="dark"] .yoi-tree-action:hover { background: rgba(184, 232, 91, .14); }

/* ── Модальные окна и уведомления ──────────────────────────────────────────── */

:root[data-yoi-theme="dark"] .yoi-modal-bd,
:root[data-yoi-theme="dark"] .yoi-order-modal { background: var(--yoi-scrim); backdrop-filter: blur(3px); }
:root[data-yoi-theme="dark"] .yoi-modal,
:root[data-yoi-theme="dark"] .yoi-order-dialog {
    background: var(--yoi-surface);
    border: 1px solid var(--yoi-border);
    box-shadow: var(--yoi-shadow);
}
:root[data-yoi-theme="dark"] .yoi-order-close,
:root[data-yoi-theme="dark"] .yoi-order-remove { background: var(--yoi-surface-2); border-color: var(--yoi-border); }
:root[data-yoi-theme="dark"] .yoi-order-close:hover { color: var(--yoi-text); border-color: var(--yoi-border-strong); }
:root[data-yoi-theme="dark"] .yoi-order-item-row { background: #2c2822; }
:root[data-yoi-theme="dark"] .yoi-order-street { background: var(--yoi-field); }
:root[data-yoi-theme="dark"] .yoi-order-address-note { background: rgba(235, 165, 130, .14); color: #f5d2bf; }
:root[data-yoi-theme="dark"] .yoi-order-error,
:root[data-yoi-theme="dark"] .yoi-reg-error { background: var(--yoi-red-soft); border-color: rgba(255, 147, 137, .35); color: var(--yoi-red); }

:root[data-yoi-theme="dark"] .yoi-toast {
    background: var(--yoi-green);
    color: var(--yoi-on-accent);
    font-weight: 700;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
}
:root[data-yoi-theme="dark"] .yoi-toast.error { background: #ff8a80; color: var(--yoi-on-accent); }

/* ── Касса ─────────────────────────────────────────────────────────────────── */

:root[data-yoi-theme="dark"] .yoi-reg-tile { background: var(--yoi-surface); border-color: var(--yoi-border); }
:root[data-yoi-theme="dark"] .yoi-reg-tile:hover:not(:disabled) {
    border-color: var(--yoi-green);
    background: #35302a;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .28), 0 0 0 1px rgba(184, 232, 91, .25);
}
:root[data-yoi-theme="dark"] .yoi-reg-tile-meta { color: var(--yoi-green); }
:root[data-yoi-theme="dark"] .yoi-reg-tile.is-folder { background: #2c2822; }
:root[data-yoi-theme="dark"] .yoi-reg-tile-badge { background: var(--yoi-green); color: var(--yoi-on-accent); }
:root[data-yoi-theme="dark"] .yoi-reg-line { background: #2c2822; }
:root[data-yoi-theme="dark"] .yoi-reg-line-sum { color: var(--yoi-green); }
:root[data-yoi-theme="dark"] .yoi-reg-step { background: var(--yoi-surface-2); border-color: var(--yoi-border-strong); color: var(--yoi-text); }
:root[data-yoi-theme="dark"] .yoi-reg-step:hover { border-color: var(--yoi-green); color: var(--yoi-green); }
:root[data-yoi-theme="dark"] .yoi-reg-chip { background: transparent; }
:root[data-yoi-theme="dark"] .yoi-reg-chip.is-active { background: var(--yoi-green); border-color: var(--yoi-green); color: var(--yoi-on-accent); }
:root[data-yoi-theme="dark"] .yoi-reg-phone-prefix { background: var(--yoi-surface-2); color: var(--yoi-green); }
:root[data-yoi-theme="dark"] .yoi-reg-total b { color: var(--yoi-green); }
:root[data-yoi-theme="dark"] .yoi-reg-submit { background: rgba(49, 44, 38, .96); }
:root[data-yoi-theme="dark"] .yoi-reg-suggest { background: var(--yoi-surface-2); }

/* ── Доска кухни ───────────────────────────────────────────────────────────── */

:root[data-yoi-theme="dark"] .yoi-board-col { background: #25211c; border-color: var(--yoi-border); }
:root[data-yoi-theme="dark"] .yoi-board-col-head { border-bottom-color: var(--yoi-border); }
:root[data-yoi-theme="dark"] .yoi-board-col-title { color: var(--yoi-text); letter-spacing: .01em; }
:root[data-yoi-theme="dark"] .yoi-board-col-count { background: var(--yoi-surface-2); color: var(--yoi-text); }

:root[data-yoi-theme="dark"] .yoi-kcard {
    position: relative;
    background: var(--yoi-surface);
    border-color: var(--yoi-border);
    border-left: 3px solid var(--yoi-green);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
}
:root[data-yoi-theme="dark"] .yoi-kcard:hover,
:root[data-yoi-theme="dark"] .yoi-kcard:focus-visible {
    background: #36312a;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .34);
}
:root[data-yoi-theme="dark"] .yoi-kcard.is-warm { border-left-color: var(--yoi-amber); }
:root[data-yoi-theme="dark"] .yoi-kcard.is-hot { border-left-color: #ff6b63; background: #362622; }
:root[data-yoi-theme="dark"] .yoi-kcard-age { background: var(--yoi-surface-2); color: var(--yoi-muted); }
:root[data-yoi-theme="dark"] .yoi-kcard.is-warm .yoi-kcard-age { background: var(--yoi-amber-soft); color: var(--yoi-amber); }
:root[data-yoi-theme="dark"] .yoi-kcard.is-hot .yoi-kcard-age { background: #ff6b63; color: var(--yoi-on-accent); }
:root[data-yoi-theme="dark"] .yoi-kcard-when { color: var(--yoi-green); }
:root[data-yoi-theme="dark"] .yoi-kcard-when.is-asap { background: var(--yoi-green-light); color: var(--yoi-green-dark); }
:root[data-yoi-theme="dark"] .yoi-kcard-when.is-timed { background: var(--yoi-amber-soft); color: var(--yoi-amber); box-shadow: inset 0 0 0 1px #6b5631; }
:root[data-yoi-theme="dark"] .yoi-kcard-comment { background: var(--yoi-amber-soft); border-left-color: var(--yoi-amber); color: #f7e3bd; }
:root[data-yoi-theme="dark"] .yoi-kcard-items { border-top-color: var(--yoi-border); }
:root[data-yoi-theme="dark"] .yoi-kcard-items b { color: var(--yoi-green); }
:root[data-yoi-theme="dark"] .yoi-kcard-sum { color: var(--yoi-text); }
:root[data-yoi-theme="dark"] .yoi-kcard-persons { background: var(--yoi-green-light); color: var(--yoi-green-dark); }

/* ── Быстрый доступ ────────────────────────────────────────────────────────── */

:root[data-yoi-theme="dark"] .yoi-hour-bar { background: linear-gradient(180deg, var(--yoi-green), #7fae3a); }

/* ── Персоны ───────────────────────────────────────────────────────────────── */

:root[data-yoi-theme="dark"] .yoi-persons-pill,
:root[data-yoi-theme="dark"] .yoi-persons-scale span { background: var(--yoi-surface-2); }
:root[data-yoi-theme="dark"] .yoi-persons-col-pick { background: #2c2822; }
:root[data-yoi-theme="dark"] .yoi-persons-col-pick .yoi-input,
:root[data-yoi-theme="dark"] .yoi-persons-col-pick .yoi-persons-options { background: var(--yoi-field); }
:root[data-yoi-theme="dark"] .yoi-persons-options { background: var(--yoi-field); }
:root[data-yoi-theme="dark"] .yoi-persons-switch-track { background: var(--yoi-border-strong); }
:root[data-yoi-theme="dark"] .yoi-persons-switch input:checked + .yoi-persons-switch-track::after { background: var(--yoi-on-accent); }
:root[data-yoi-theme="dark"] .yoi-persons-tag-group { background: transparent; }

/* ── Чат поддержки ─────────────────────────────────────────────────────────── */

:root[data-yoi-theme="dark"] .yoi-chat-item.active { background: var(--yoi-green-light); }
:root[data-yoi-theme="dark"] .yoi-msg { background: var(--yoi-surface-2); }
:root[data-yoi-theme="dark"] .yoi-msg.staff { background: var(--yoi-green); color: var(--yoi-on-accent); }
:root[data-yoi-theme="dark"] .yoi-chat-item .dot { background: #ff6b63; }

/* ── Экран курьера (свои токены) ───────────────────────────────────────────── */

:root[data-yoi-theme="dark"] .courier-app {
    --cr-canvas: var(--yoi-bg);
    --cr-surface: var(--yoi-surface);
    --cr-surface-soft: var(--yoi-surface-2);
    --cr-leaf: var(--yoi-green);
    --cr-leaf-strong: var(--yoi-green-dark);
    --cr-bamboo: var(--yoi-green-light);
    --cr-ink: var(--yoi-text);
    --cr-muted: var(--yoi-muted);
    --cr-outline: var(--yoi-border);
    --cr-outline-strong: var(--yoi-border-strong);
    --cr-overlay: var(--yoi-scrim);
    --cr-danger: var(--yoi-red);
    --cr-danger-soft: var(--yoi-red-soft);
    --cr-warning: var(--yoi-amber);
}
:root[data-yoi-theme="dark"] :where(.cr-primary, .cr-route-icon, .cr-card-index, .cr-tab-badge) { color: var(--yoi-on-accent); }
:root[data-yoi-theme="dark"] :where(.cr-warn, .cr-card-money, .cr-paid-toggle) { background: var(--yoi-amber-soft); }
:root[data-yoi-theme="dark"] :where(.cr-card-money.is-paid, .cr-paid-toggle.is-on, .cr-history-paid) { background: var(--yoi-green-light); color: var(--yoi-green-dark); }

/* ── Унаследованные страницы (меню сайта, зоны, отзывы, промокоды) ─────────────
 *
 * Их разметка писалась под светлую тему с цветами прямо в style="…" и в
 * собственных <style>. Самые частые из этих цветов переводятся здесь в токены:
 * белые и серо-голубые подложки — в карточку, тёмный текст — в светлый,
 * сине-серые подписи — в приглушённый. !important нужен против inline-стилей
 * и против !important самого yoi.css.
 */

:root[data-yoi-theme="dark"] .yoi-legacy .modal-overlay { background: var(--yoi-scrim) !important; }
:root[data-yoi-theme="dark"] .yoi-legacy .modal-card,
:root[data-yoi-theme="dark"] .yoi-legacy .modal-box { box-shadow: var(--yoi-shadow) !important; }
:root[data-yoi-theme="dark"] .yoi-legacy input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
:root[data-yoi-theme="dark"] .yoi-legacy select,
:root[data-yoi-theme="dark"] .yoi-legacy textarea,
:root[data-yoi-theme="dark"] .yoi-legacy :where(.form-input, .field-input, .field-select, .search-input, .date-input) {
    background: var(--yoi-field) !important;
}
:root[data-yoi-theme="dark"] .yoi-legacy .btn,
:root[data-yoi-theme="dark"] .yoi-legacy .btn-save,
:root[data-yoi-theme="dark"] .yoi-legacy .save-btn,
:root[data-yoi-theme="dark"] .yoi-legacy .apply-btn,
:root[data-yoi-theme="dark"] .yoi-legacy .pbtn.active,
:root[data-yoi-theme="dark"] .yoi-legacy button[style*="background:#16a34a"],
:root[data-yoi-theme="dark"] .yoi-legacy button[style*="background: #16a34a"] { color: var(--yoi-on-accent) !important; }
:root[data-yoi-theme="dark"] .yoi-legacy :where(.btn-ghost, .btn-cancel, .cancel-btn, .sort-btn, .action-btn, .act-edit) { background: var(--yoi-surface-2) !important; }
:root[data-yoi-theme="dark"] .yoi-legacy :where(.tbl, .users-table, .promo-table, .posts-table, main table) th { background: #2c2822 !important; }
:root[data-yoi-theme="dark"] .yoi-legacy :where(.tbl, .users-table, .promo-table, .posts-table, main table) tbody tr:hover td { background: #3b3a2a !important; }

:root[data-yoi-theme="dark"] :is(.yoi-legacy, .yoi) :is(
    [style*="background:#fff"], [style*="background: #fff"], [style*="background:white"], [style*="background: white"],
    [style*="background-color:#fff"], [style*="background-color: #fff"],
    [style*="background:#f8fafc"], [style*="background: #f8fafc"],
    [style*="background:#f7faf5"], [style*="background:#f4faf6"], [style*="background:#f3f7f2"], [style*="background:#faf8f3"], [style*="background:#FAF8F3"]
) { background-color: var(--yoi-surface) !important; }
:root[data-yoi-theme="dark"] :is(.yoi-legacy, .yoi) :is(
    [style*="background:#f1f5f9"], [style*="background: #f1f5f9"], [style*="background:#e2e8f0"],
    [style*="background:#f0eae0"], [style*="background:#F0EAE0"], [style*="background:#f7f4ed"], [style*="background:#F7F4ED"]
) { background-color: var(--yoi-surface-2) !important; }
:root[data-yoi-theme="dark"] :is(.yoi-legacy, .yoi) :is(
    [style*="background:#eaf3e4"], [style*="background:#eaf3e8"], [style*="background:#EAF3E8"], [style*="background:#f0fdf4"],
    [style*="background:#dbeee1"], [style*="background:#b9dfc7"], [style*="background:#e8f7ee"], [style*="background:#E8F7EE"]
) { background-color: var(--yoi-green-light) !important; }
:root[data-yoi-theme="dark"] :is(.yoi-legacy, .yoi) :is(
    [style*="background:#fef2f2"], [style*="background:#fee2e2"], [style*="background:#fceBEC"], [style*="background:#FCEBEC"]
) { background-color: var(--yoi-red-soft) !important; }
:root[data-yoi-theme="dark"] :is(.yoi-legacy, .yoi) :is(
    [style*="background:#fffbeb"], [style*="background:#fef3c7"], [style*="background:#fff7ed"], [style*="background:#FFF7E8"], [style*="background:#fff7e8"]
) { background-color: var(--yoi-amber-soft) !important; }
:root[data-yoi-theme="dark"] :is(.yoi-legacy, .yoi) :is(
    [style*="background:#eff6ff"], [style*="background:#dbeafe"]
) { background-color: var(--yoi-blue-soft) !important; }
:root[data-yoi-theme="dark"] :is(.yoi-legacy, .yoi) :is([style*="background:#fdf4ff"], [style*="background:#faf5ff"], [style*="background:#f5f3ff"]) {
    background-color: var(--yoi-violet-soft) !important;
}

:root[data-yoi-theme="dark"] :is(.yoi-legacy, .yoi) :is(
    [style*="color:#0f172a"], [style*="color: #0f172a"], [style*="color:#1e293b"], [style*="color:#334155"],
    [style*="color:#17333b"], [style*="color:#29251f"], [style*="color:#29251F"], [style*="color:#111"], [style*="color:#000"]
):not([style*="background:#0f172a"]) { color: var(--yoi-text) !important; }
:root[data-yoi-theme="dark"] :is(.yoi-legacy, .yoi) :is(
    [style*="color:#64748b"], [style*="color: #64748b"], [style*="color:#94a3b8"], [style*="color: #94a3b8"],
    [style*="color:#475569"], [style*="color:#526a70"], [style*="color:#6d655a"], [style*="color:#6D655A"], [style*="color:#888"], [style*="color:#666"]
) { color: var(--yoi-muted) !important; }
:root[data-yoi-theme="dark"] :is(.yoi-legacy, .yoi) :is(
    [style*="color:#4f7a47"], [style*="color:#3e6338"], [style*="color:#16a34a"], [style*="color:#245b37"], [style*="color:#245B37"],
    [style*="color:#34784a"], [style*="color:#34784A"], [style*="color:#0f766e"], [style*="color:#22c55e"]
) { color: var(--yoi-green) !important; }
:root[data-yoi-theme="dark"] :is(.yoi-legacy, .yoi) :is([style*="color:#ef4444"], [style*="color:#dc2626"], [style*="color:#b4232f"], [style*="color:#B42332"], [style*="color:#b42332"], [style*="color:#7f1d1d"]) {
    color: var(--yoi-red) !important;
}
:root[data-yoi-theme="dark"] :is(.yoi-legacy, .yoi) :is([style*="color:#b45309"], [style*="color:#8b5a21"], [style*="color:#8B5A21"], [style*="color:#92400e"]) { color: var(--yoi-amber) !important; }
:root[data-yoi-theme="dark"] :is(.yoi-legacy, .yoi) :is([style*="color:#3b82f6"], [style*="color:#1e40af"], [style*="color:#26658e"], [style*="color:#2d6481"], [style*="color:#2D6481"]) { color: var(--yoi-blue) !important; }
:root[data-yoi-theme="dark"] :is(.yoi-legacy, .yoi) :is([style*="background:#4f7a47"], [style*="background:#16a34a"], [style*="background:#3e6338"], [style*="background:#34784a"], [style*="background:#34784A"]) {
    background-color: var(--yoi-green) !important;
    color: var(--yoi-on-accent) !important;
}

:root[data-yoi-theme="dark"] :is(.yoi-legacy, .yoi) :is(
    [style*="solid #e2e8f0"], [style*="solid #f1f5f9"], [style*="solid #f8fafc"], [style*="solid #dbeee1"], [style*="solid #c9ddd8"],
    [style*="solid #e5dfd4"], [style*="solid #E5DFD4"], [style*="solid #ece7dd"]
) { border-color: var(--yoi-border) !important; }

/* Tailwind в старых страницах. */
:root[data-yoi-theme="dark"] .yoi-legacy .bg-white { background-color: var(--yoi-surface) !important; }
:root[data-yoi-theme="dark"] .yoi-legacy :is(.text-slate-900, .text-gray-900, .text-slate-800) { color: var(--yoi-text) !important; }
:root[data-yoi-theme="dark"] .yoi-legacy :is(.text-slate-600, .text-slate-500, .text-gray-500, .text-gray-600) { color: var(--yoi-muted) !important; }

/* ── Белый текст на зелёном ──────────────────────────────────────────────────
 * Страницы пишут «background: var(--yoi-green); color: #fff». На салатовом
 * белый не читается — здесь каждое такое место получает тёмный текст. */
:root[data-yoi-theme="dark"] :is(
    .rp-tabs a.on, .ts-act.pay, .ts-cal button.edge, .ts-months button.on, .btn-green, .btn-outline.active,
    .yoi-auth-page button.yoi-auth-primary, .yoi-auth-page button[type="submit"]
) { color: var(--yoi-on-accent) !important; }

/* ── Отчёты и прибыль ──────────────────────────────────────────────────────── */
:root[data-yoi-theme="dark"] :is(.profit-card-label, .profit-legend, .profit-fact span, .advice-tip small) { color: var(--yoi-muted); }
:root[data-yoi-theme="dark"] .profit-card-note { color: #9a8f80; }
:root[data-yoi-theme="dark"] .profit-card.is-income .profit-card-value { color: var(--yoi-green); }
:root[data-yoi-theme="dark"] .profit-card.is-cost .profit-card-value { color: var(--yoi-amber); }
:root[data-yoi-theme="dark"] .profit-card.is-profit .profit-card-value { color: var(--yoi-text); }
:root[data-yoi-theme="dark"] .profit-card.is-profit.is-loss .profit-card-value { color: var(--yoi-red); }
:root[data-yoi-theme="dark"] :is(.profit-bar .income, .profit-legend .dot.is-income) { background: var(--yoi-green); }
:root[data-yoi-theme="dark"] .advice-tip { border-left-color: var(--yoi-green); }
:root[data-yoi-theme="dark"] :is(.rp-presets, .rp-seg, .rp-views) button.on { border-color: #4c5935; }
:root[data-yoi-theme="dark"] .rp-tip { background: #f6f1e9; color: var(--yoi-on-accent); }
:root[data-yoi-theme="dark"] .rp-disc { color: var(--yoi-amber); }
:root[data-yoi-theme="dark"] .rp-error { background: var(--yoi-red-soft); border-color: rgba(255, 147, 137, .35); color: #ffc2bc; }

/* ── Табель ────────────────────────────────────────────────────────────────── */
:root[data-yoi-theme="dark"] .ts-table th.ts-weekend { color: var(--yoi-coral); }
:root[data-yoi-theme="dark"] .ts-table th.ts-today { color: var(--yoi-green); }
:root[data-yoi-theme="dark"] .ts-cell { color: #8f8577; }
:root[data-yoi-theme="dark"] .ts-cell:hover { outline-color: var(--yoi-green); }
:root[data-yoi-theme="dark"] .ts-cell.work { background: var(--yoi-green-light); color: var(--yoi-green-dark); }
:root[data-yoi-theme="dark"] .ts-cell.off { background: var(--yoi-surface-2); color: var(--yoi-muted); }
:root[data-yoi-theme="dark"] .ts-cell.absent { background: var(--yoi-red-soft); color: var(--yoi-red); }
:root[data-yoi-theme="dark"] .ts-rate { color: var(--yoi-muted); }
:root[data-yoi-theme="dark"] .ts-due { color: var(--yoi-green); }
:root[data-yoi-theme="dark"] .ts-seg button.on { background: var(--yoi-green-light); color: var(--yoi-green-dark); box-shadow: none; }
:root[data-yoi-theme="dark"] .ts-picker { box-shadow: var(--yoi-shadow); }

/* ── Акции и промокоды ─────────────────────────────────────────────────────── */
:root[data-yoi-theme="dark"] .promo-tabs a { background: var(--yoi-surface); border-color: var(--yoi-border); color: var(--yoi-muted); }
:root[data-yoi-theme="dark"] .promo-tabs a:hover { border-color: var(--yoi-border-strong); color: var(--yoi-text); }
:root[data-yoi-theme="dark"] .promo-tabs a.on { background: var(--yoi-green); border-color: var(--yoi-green); color: var(--yoi-on-accent); }
:root[data-yoi-theme="dark"] .link-note { background: var(--yoi-blue-soft); color: var(--yoi-blue); }

/* Бирюзовые акценты старых страниц — в салатовый. */
:root[data-yoi-theme="dark"] :is(.yoi-legacy, .yoi) :is([style*="background:#0f766e"], [style*="background: #0f766e"], [style*="background:#0F766E"]) {
    background-color: var(--yoi-green) !important;
    color: var(--yoi-on-accent) !important;
}

/* ════════════════════════════════════════════════════════════════════════════
   Светлая тема (по умолчанию)

   Та же раскладка и те же приёмы, что у тёмной, на тёплом светлом фоне:
   фон — «овёс», карточки белые с мягкой тенью вместо жёсткой рамки, зелёный —
   у главного действия, салатовый — подсветка выбранного и живые акценты.
   ════════════════════════════════════════════════════════════════════════════ */

:root[data-yoi-theme="light"] {
    color-scheme: light;

    --yoi-bg: #f7f4ed;
    --yoi-surface: #ffffff;
    --yoi-surface-2: #f3eee6;
    --yoi-field: #fffdf9;
    --yoi-border: #e8e2d7;
    --yoi-border-strong: #cfc6b8;
    --yoi-text: #29251f;
    --yoi-muted: #6d655a;

    --yoi-green: #34784a;
    --yoi-green-dark: #245b37;
    --yoi-green-light: #eaf3e8;
    --yoi-green-soft: #fbf9f5;
    --yoi-lime: #b8e85b;
    --yoi-lime-wash: #f1f9e1;

    --yoi-red: #b42332;
    --yoi-red-soft: #fdf0f0;
    --yoi-amber: #8b5a21;
    --yoi-amber-soft: #fdf3e1;
    --yoi-blue: #2d6481;
    --yoi-blue-soft: #e9f2f8;

    --yoi-focus: 0 0 0 3px rgba(52, 120, 74, .22);
    --yoi-shadow: 0 18px 44px rgba(70, 49, 26, .14);
    --yoi-card-shadow: 0 1px 2px rgba(70, 49, 26, .05), 0 8px 24px rgba(70, 49, 26, .06);
    --yoi-scrim: rgba(41, 37, 31, .42);

    background: var(--yoi-bg);
}

/* Салатовый свет в углу — тот же приём, что в тёмной теме. */
:root[data-yoi-theme="light"] body.yoi::before {
    content: '';
    position: fixed;
    inset: 0 0 auto 0;
    height: 420px;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(900px 340px at 0% 0%, rgba(184, 232, 91, .22), transparent 70%);
}
:root[data-yoi-theme="light"] #main-content { position: relative; z-index: 1; }
:root[data-yoi-theme="light"] ::selection { background: var(--yoi-lime); color: var(--yoi-text); }
:root[data-yoi-theme="light"] * { scrollbar-color: #cfc6b8 transparent; }
:root[data-yoi-theme="light"] ::-webkit-scrollbar { width: 12px; height: 12px; }
:root[data-yoi-theme="light"] ::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 12px; background: #d6cdbf; background-clip: content-box; }
:root[data-yoi-theme="light"] ::-webkit-scrollbar-thumb:hover { background: #b9ae9e; background-clip: content-box; }
:root[data-yoi-theme="light"] ::-webkit-scrollbar-track,
:root[data-yoi-theme="light"] ::-webkit-scrollbar-corner { background: transparent; }

/* Шапка раздела — полупрозрачная, страница уходит под неё при прокрутке. */
:root[data-yoi-theme="light"] .yoi-topbar {
    background: rgba(247, 244, 237, .86);
    backdrop-filter: blur(12px);
    border-bottom-color: var(--yoi-border);
}

/* Карточки: мягкая тень вместо жёсткой рамки. */
:root[data-yoi-theme="light"] :is(.yoi-panel, .yoi-group-explorer, .yoi-chat-list, .yoi-chat-view) {
    border-color: #ece6dc;
    box-shadow: var(--yoi-card-shadow);
}
:root[data-yoi-theme="light"] .yoi-stat:first-child .yoi-stat-value { color: var(--yoi-green); }
:root[data-yoi-theme="light"] :is(.yoi-tile-icon, .yoi-directory .yoi-tile-icon) { background: var(--yoi-lime-wash); color: var(--yoi-green-dark); }
:root[data-yoi-theme="light"] .yoi-directory .yoi-tile:hover { background: rgba(255, 255, 255, .7); }
:root[data-yoi-theme="light"] .yoi-welcome {
    background:
        radial-gradient(520px 220px at 100% 100%, rgba(184, 232, 91, .38), transparent 70%),
        linear-gradient(135deg, #fffdf8, #f3eee4);
    border: 1px solid #ece6dc;
    box-shadow: var(--yoi-card-shadow);
}
:root[data-yoi-theme="light"] .yoi-live-count strong { color: var(--yoi-green); }

/* Поля */
:root[data-yoi-theme="light"] :where(.yoi-input, .yoi-select, .yoi-textarea),
:root[data-yoi-theme="light"] .yoi :where(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), select, textarea) {
    background-color: var(--yoi-field);
    border-color: var(--yoi-border-strong);
}
:root[data-yoi-theme="light"] :where(.yoi-input, .yoi-select, .yoi-textarea):hover { border-color: #b3a897; }
:root[data-yoi-theme="light"] :where(.yoi-input, .yoi-select, .yoi-textarea):focus { border-color: var(--yoi-green); box-shadow: var(--yoi-focus); }
:root[data-yoi-theme="light"] :where(input[type=checkbox], input[type=radio], input[type=range]) { accent-color: var(--yoi-green); }

/* Кнопки: главное действие — зелёное и чуть приподнятое. */
:root[data-yoi-theme="light"] :is(.yoi-btn-primary, .yoi-icon-btn.yoi-icon-btn-primary) {
    box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 4px 12px rgba(52, 120, 74, .22);
    font-weight: 750;
}
:root[data-yoi-theme="light"] :is(.yoi-btn-primary, .yoi-icon-btn.yoi-icon-btn-primary):hover:not(:disabled) {
    background: var(--yoi-green-dark);
    box-shadow: 0 6px 18px rgba(52, 120, 74, .28);
}
:root[data-yoi-theme="light"] :is(.yoi-btn-outline, .yoi-icon-btn):hover:not(:disabled) { border-color: var(--yoi-green); }

/* Метки — мягкие подложки одного тона. */
:root[data-yoi-theme="light"] .yoi-badge-red { background: var(--yoi-red-soft); }
:root[data-yoi-theme="light"] .yoi-badge-amber { background: var(--yoi-amber-soft); }
:root[data-yoi-theme="light"] .yoi-badge-blue { background: var(--yoi-blue-soft); }
:root[data-yoi-theme="light"] .yoi-badge-gray { background: var(--yoi-surface-2); }

/* Вкладки */
:root[data-yoi-theme="light"] .yoi-tab.active { color: var(--yoi-green-dark); border-bottom-color: var(--yoi-green); }

/* Таблицы */
:root[data-yoi-theme="light"] .yoi-scroll { border-color: #ece6dc; }
:root[data-yoi-theme="light"] .yoi-table th { background: #f6f2eb; }
:root[data-yoi-theme="light"] .yoi-table td { border-bottom-color: #efeae1; }
:root[data-yoi-theme="light"] .yoi-table tbody tr:nth-child(even) { background: #fcfaf6; }
:root[data-yoi-theme="light"] .yoi-table tbody tr:hover { background: var(--yoi-lime-wash); }

/* Модальные окна и уведомления */
:root[data-yoi-theme="light"] :is(.yoi-modal-bd, .yoi-order-modal) { background: var(--yoi-scrim); backdrop-filter: blur(3px); }
:root[data-yoi-theme="light"] :is(.yoi-modal, .yoi-order-dialog) { border: 1px solid #ece6dc; box-shadow: var(--yoi-shadow); }
:root[data-yoi-theme="light"] .yoi-toast {
    background: #29251f;
    color: #faf8f3;
    font-weight: 700;
    box-shadow: 0 16px 40px rgba(41, 37, 31, .3);
}
:root[data-yoi-theme="light"] .yoi-toast::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 9px; border-radius: 50%; background: var(--yoi-lime); vertical-align: 1px; }
:root[data-yoi-theme="light"] .yoi-toast.error { background: var(--yoi-red); color: #fff; }
:root[data-yoi-theme="light"] .yoi-toast.error::before { background: #fff; }

/* Касса */
:root[data-yoi-theme="light"] .yoi-reg-tile { border-color: #ece6dc; box-shadow: 0 1px 2px rgba(70, 49, 26, .05); }
:root[data-yoi-theme="light"] .yoi-reg-tile:hover:not(:disabled) { border-color: var(--yoi-green); box-shadow: 0 10px 24px rgba(70, 49, 26, .1), 0 0 0 1px rgba(52, 120, 74, .2); }
:root[data-yoi-theme="light"] .yoi-reg-chip.is-active { background: var(--yoi-lime); border-color: #9ccc45; color: var(--yoi-text); }

/* Доска кухни: срочность — полосой слева, как в тёмной теме. */
:root[data-yoi-theme="light"] .yoi-board-col { background: #f1ece3; border-color: #e8e2d7; }
:root[data-yoi-theme="light"] .yoi-board-col-count { background: #fff; color: var(--yoi-text); }
:root[data-yoi-theme="light"] .yoi-kcard {
    border-color: #ece6dc;
    border-left: 3px solid var(--yoi-green);
    box-shadow: 0 1px 2px rgba(70, 49, 26, .05), 0 6px 16px rgba(70, 49, 26, .07);
}
:root[data-yoi-theme="light"] :is(.yoi-kcard:hover, .yoi-kcard:focus-visible) { box-shadow: 0 12px 28px rgba(70, 49, 26, .14); }
:root[data-yoi-theme="light"] .yoi-kcard.is-warm { border-left-color: #d19a27; }
:root[data-yoi-theme="light"] .yoi-kcard.is-hot { border-left-color: var(--yoi-red); background: #fff8f7; }
:root[data-yoi-theme="light"] .yoi-kcard.is-hot .yoi-kcard-age { background: var(--yoi-red); color: #fff; }
:root[data-yoi-theme="light"] .yoi-kcard-when.is-asap { background: var(--yoi-lime-wash); color: var(--yoi-green-dark); box-shadow: inset 0 0 0 1px #d6ecb0; }
:root[data-yoi-theme="light"] .yoi-kcard-items b { color: var(--yoi-green); }

/* Быстрый доступ */
:root[data-yoi-theme="light"] .yoi-hour-bar { background: linear-gradient(180deg, #8fcf55, var(--yoi-green)); }

/* Отчёты, табель, акции: зелёная подсветка выбранного вместо бирюзы. */
:root[data-yoi-theme="light"] .ts-table th.ts-today { color: var(--yoi-green); }
:root[data-yoi-theme="light"] .ts-cell:hover { outline-color: var(--yoi-green); }
:root[data-yoi-theme="light"] .ts-cell.work { background: var(--yoi-green-light); color: var(--yoi-green-dark); }
:root[data-yoi-theme="light"] .ts-due { color: var(--yoi-green-dark); }
:root[data-yoi-theme="light"] .promo-tabs a { background: #fff; border-color: var(--yoi-border); color: var(--yoi-muted); }
:root[data-yoi-theme="light"] .promo-tabs a:hover { border-color: var(--yoi-border-strong); color: var(--yoi-text); }
:root[data-yoi-theme="light"] .promo-tabs a.on { background: var(--yoi-green); border-color: var(--yoi-green); color: #fff; }
:root[data-yoi-theme="light"] :is(.yoi-legacy, .yoi) :is([style*="background:#0f766e"], [style*="background: #0f766e"], [style*="background:#0F766E"]) {
    background-color: var(--yoi-green) !important;
}
:root[data-yoi-theme="light"] .yoi-legacy :is(.card, .main-card, .chart-card, .stat-card) {
    border-color: #ece6dc !important;
    box-shadow: var(--yoi-card-shadow) !important;
}

/* ════════════════════════════════════════════════════════════════════════════
   Кабинет «Деливеренот» (платформа, сеть, ресторан, партнёр) — business*.css, partner.css, marketing.css.
   С 02.11.2026 тема одна на панель и кабинет: раньше приложение для Windows перекрашивало только /yoi,
   и тёмная панель соседствовала со светлым кабинетом.
   ════════════════════════════════════════════════════════════════════════════ */

:root[data-yoi-theme="dark"] body.biz { background: var(--yoi-bg); color: var(--yoi-text); }
/* Левое меню — какао в обеих темах; в тёмной выбранный пункт — салатовый, как в окне приложения. */
:root[data-yoi-theme="dark"] .bz-side { border-color: var(--yoi-border); }
:root[data-yoi-theme="dark"] .bz-side .bz-item[aria-current=page] { background: var(--yoi-green); color: var(--yoi-on-accent) !important; }
:root[data-yoi-theme="dark"] .bz-side .bz-item[aria-current=page] .bz-ico { color: var(--yoi-on-accent); }
:root[data-yoi-theme="dark"] .bz-side .bz-level[aria-current=true] { background: var(--yoi-green); color: var(--yoi-on-accent); }
:root[data-yoi-theme="dark"] .bz-side .bz-item .bz-badge { background: var(--yoi-green); color: var(--yoi-on-accent); }
:root[data-yoi-theme="dark"] .bz-side .bz-menu { background: var(--yoi-surface); }
:root[data-yoi-theme="dark"] .bz-top { background: var(--yoi-bg); border-color: var(--yoi-border); }
:root[data-yoi-theme="dark"] .bz-tip { background: #f6f1e9; color: var(--yoi-on-accent); }
:root[data-yoi-theme="dark"] .bz-backdrop { background: var(--yoi-scrim); }

/* Белый текст на зелёном: в тёмной теме зелёный — салатовый, на нём нужен тёмный текст. */
:root[data-yoi-theme="dark"] :is(.biz-step.current i, .biz-step.done i, .biz-chip[aria-pressed="true"], .biz-guide li::before,
    .biz-tabs button[aria-selected="true"], .bz-chat-unread, .pt-tabs a[aria-current="page"], .pt-send, .biz a.yoi-btn-primary) { color: var(--yoi-on-accent) !important; }
:root[data-yoi-theme="dark"] .pt-send { background: var(--yoi-green); }
:root[data-yoi-theme="dark"] .pt-send:disabled { background: var(--yoi-surface-2); color: var(--yoi-muted) !important; }

:root[data-yoi-theme="dark"] .biz-suggest ul { background: var(--yoi-surface); }
:root[data-yoi-theme="dark"] .biz-map-note { background: rgba(49, 44, 38, .95); color: var(--yoi-text); }
:root[data-yoi-theme="dark"] .biz-status.ok { background: var(--yoi-green-light); color: var(--yoi-green-dark); }
:root[data-yoi-theme="dark"] .biz-status.bad { background: var(--yoi-red-soft); color: var(--yoi-red); }
:root[data-yoi-theme="dark"] .biz-status.warn { background: var(--yoi-amber-soft); color: var(--yoi-amber); border-color: #6b5631; }
:root[data-yoi-theme="dark"] .biz-scroll { scrollbar-color: #5e5448 var(--yoi-surface); }
:root[data-yoi-theme="dark"] .biz-table th { background: #2c2822; color: var(--yoi-muted); }
:root[data-yoi-theme="dark"] .biz-table td { border-color: #3b342c; }
:root[data-yoi-theme="dark"] .biz-card, :root[data-yoi-theme="dark"] .biz-panel { border-color: var(--yoi-border); }

/* Редактор витрины: поля и плитки — карточки темы; сам предпросмотр (страница гостя) остаётся светлым. */
:root[data-yoi-theme="dark"] :is(.pd-preset, .pd-color, .pd-choice, .pd-image, .pd-section-row button, .pd-checks) { background: var(--yoi-surface); border-color: var(--yoi-border); color: var(--yoi-text); }
:root[data-yoi-theme="dark"] .pd-field :is(input:not([type=file]), textarea, select) { background: var(--yoi-field); border-color: var(--yoi-border-strong); color: var(--yoi-text); }
:root[data-yoi-theme="dark"] :is(.pd-tab[aria-selected=true], .pd-seg button[aria-pressed=true]) { background: var(--yoi-surface-2); color: var(--yoi-green-dark); }
:root[data-yoi-theme="dark"] .pd-tab:hover { background: rgba(255, 255, 255, .06); }
:root[data-yoi-theme="dark"] .pd-veil { background: rgba(41, 37, 31, .86); color: var(--yoi-text); }

/* Кабинет партнёра: переписка, подсказки, график выплат. */
:root[data-yoi-theme="dark"] {
    --brand-field: var(--yoi-field);
    --brand-soft: var(--yoi-surface-2);
    --brand-green-wash: var(--yoi-green-light);
}
:root[data-yoi-theme="dark"] .pt-note { background: var(--yoi-amber-soft); }
:root[data-yoi-theme="dark"] .pt-conv.pt-drop::after { background: rgba(57, 67, 42, .9); color: var(--yoi-text); }

/* Маркетинг: зелёная плашка поста и подложки состояний. */
:root[data-yoi-theme="dark"] .mk-post-badge { color: var(--yoi-on-accent); }
:root[data-yoi-theme="dark"] .mk-switch-track::after { background: #f6f1e9; }
:root[data-yoi-theme="dark"] .mk-switch input:checked + .mk-switch-track::after { background: var(--yoi-on-accent); }
:root[data-yoi-theme="dark"] .mk-tabs button[aria-selected="true"] { box-shadow: 0 0 0 1px var(--yoi-border-strong); }

/* Переключатель темы на сайте (в приложении для Windows тему выбирают в его настройках). */
.yoi-theme-switch { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 10px; border: 0; border-radius: 10px; background: none;
    color: inherit; font: inherit; font-weight: 500; cursor: pointer; text-align: left; }
.yoi-theme-switch svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.yoi-theme-switch:hover { background: var(--bz-chrome-soft, var(--yoi-surface-2)); }
.yoi-theme-switch:focus-visible { outline: 2px solid #B8E85B; outline-offset: 2px; }
:root[data-yoi-shell="desktop"] .yoi-theme-switch { display: none; }

/* ═══ Тёмная тема: старые страницы и хвосты (аудит 10.11.2026) ═══
   Найдено проходом по всем разделам в тёмной теме: правила со светлым фоном, которые тема не перекрывала.
   Новый зашитый цвет на странице — сюда же, токеном. */

/* Кнопка меню на телефоне и крестик окон: были белыми на тёмном. */
:root[data-yoi-theme="dark"] .hbtn { background: var(--yoi-surface-2) !important; color: var(--yoi-text) !important; border-color: var(--yoi-border) !important; }

/* Отзывы */
:root[data-yoi-theme="dark"] .yoi-legacy :is(.rv-admin-card, .rg-card, .rv-report-keep, .rv-admin-del, .rg-toggle, .rv-guest button, .cat-header, .item-card) {
    background: var(--yoi-surface) !important; color: var(--yoi-text) !important; border-color: var(--yoi-border) !important; }
:root[data-yoi-theme="dark"] .yoi-legacy :is(.rv-seg, .rv-count, .rc-item, .rv-items summary, .rg-order-title, .rg-photo, .rg-item-img, .item-img, .rv-item img, .item-card img) {
    background: var(--yoi-surface-2) !important; color: var(--yoi-text) !important; border-color: var(--yoi-border) !important; }
:root[data-yoi-theme="dark"] .yoi-legacy .rv-seg button { color: var(--yoi-muted) !important; background: transparent !important; }
:root[data-yoi-theme="dark"] .yoi-legacy .rv-seg button.on { background: var(--yoi-green-light) !important; color: var(--yoi-green-dark) !important; box-shadow: none !important; }
:root[data-yoi-theme="dark"] .yoi-legacy .rg-avatar { background: var(--yoi-green-light) !important; color: var(--yoi-green-dark) !important; }
:root[data-yoi-theme="dark"] .yoi-legacy .rg-badge.wait { background: var(--yoi-amber-soft) !important; color: var(--yoi-amber) !important; }
:root[data-yoi-theme="dark"] .yoi-legacy :is(.rv-report, .rg-badge.alarm, .act-del, .badge-hidden) {
    background: var(--yoi-red-soft) !important; color: var(--yoi-red) !important; border-color: rgba(255, 147, 137, .35) !important; }

/* Авторизации, пользователи, баллы, заказы, меню, ресторан */
:root[data-yoi-theme="dark"] .yoi-legacy .p-android { background: var(--yoi-green-light) !important; color: var(--yoi-green-dark) !important; }
:root[data-yoi-theme="dark"] .yoi-legacy .p-ios { background: var(--yoi-blue-soft) !important; color: var(--yoi-blue) !important; }
:root[data-yoi-theme="dark"] .yoi-legacy :is(.pg-btn, .page-btn, .seg) { background: var(--yoi-surface-2) !important; color: var(--yoi-text) !important; border-color: var(--yoi-border) !important; }
:root[data-yoi-theme="dark"] .yoi-legacy :is(.pg-btn, .page-btn):disabled { color: var(--yoi-muted) !important; opacity: .55; }
:root[data-yoi-theme="dark"] .yoi-legacy .badge-discount { background: var(--yoi-green-light) !important; color: var(--yoi-green-dark) !important; }
:root[data-yoi-theme="dark"] .yoi-legacy .toggle-track { background: var(--yoi-border-strong) !important; }

/* Зашитые в разметку светлые фоны, которых не было в списках выше. */
:root[data-yoi-theme="dark"] :is(.yoi-legacy, .yoi) :is([style*="background:#ffffff"], [style*="background: #ffffff"], [style*="background:#FFFFFF"], [style*="background-color:#ffffff"]) {
    background-color: var(--yoi-surface) !important; }
:root[data-yoi-theme="dark"] :is(.yoi-legacy, .yoi) :is([style*="background:#dcfce7"], [style*="background: #dcfce7"], [style*="background:#eef4e6"], [style*="background:#d5f0e8"]) {
    background-color: var(--yoi-green-light) !important; color: var(--yoi-green-dark) !important; }
:root[data-yoi-theme="dark"] :is(.yoi-legacy, .yoi) :is([style*="background:#fff5f5"], [style*="background:#fff1f2"]) {
    background-color: var(--yoi-red-soft) !important; color: var(--yoi-red) !important; }
:root[data-yoi-theme="dark"] :is(.yoi-legacy, .yoi) :is([style*="background:#eef1f1"], [style*="background:#e5e7eb"], [style*="background:#cbd5e1"]) {
    background-color: var(--yoi-surface-2) !important; color: var(--yoi-text) !important; }
:root[data-yoi-theme="dark"] :is(.yoi-legacy, .yoi) [style*="background:#e0e7ff"] { background-color: var(--yoi-blue-soft) !important; color: var(--yoi-blue) !important; }

/* Журнал печати, журнал действий, уволенные сотрудники */
:root[data-yoi-theme="dark"] .print-device.is-bad,
:root[data-yoi-theme="dark"] .au-table tr.fail td { background: var(--yoi-red-soft) !important; color: var(--yoi-text) !important; }
:root[data-yoi-theme="dark"] .yoi-fired-note { background: var(--yoi-amber-soft) !important; border-color: var(--yoi-amber) !important; color: var(--yoi-text) !important; }
