/* Общая палитра для всех разделов, входа и встроенной вкладки «Сайт». */
:root[data-theme="light"] {
 --bg:#f5f5f7;--sidebar:rgba(246,246,248,.96);--card:#fff;--text:#20232a;
 --muted:#626873;--faint:#68707d;--border:#d9dde5;--chart-grid:#d9dde5;
 --accent:#0069cf;--accent-fill:#0065cc;--accent-soft:#e6f0ff;
 --green:#18743e;--orange:#975300;--red:#be302b;--yellow:#856600;
 --shadow:0 1px 2px #00000008,0 4px 16px #00000008;
 color-scheme:light;
}
:root[data-theme="dark"] {
 --bg:#191c23;--sidebar:#20242d;--card:#252b35;--text:#eef1f7;
 --muted:#b0b8c8;--faint:#a4afbf;--border:#47505f;--chart-grid:#47505f;
 --accent:#80b5ff;--accent-fill:#0062c9;--accent-soft:#293f5e;
 --green:#78d69c;--orange:#f2ba70;--red:#ff958e;--yellow:#e8d57c;
 --shadow:0 1px 2px #0005,0 4px 16px #0002;
 color-scheme:dark;
}
:root[data-theme] {background:var(--bg);color:var(--text);--tx:var(--text);--mut:var(--muted);--line:var(--border);--acc:var(--accent);--acc-soft:var(--accent-soft);--ok:var(--green);--ok-soft:color-mix(in srgb,var(--card) 88%,var(--green));--warn:var(--orange);--warn-soft:color-mix(in srgb,var(--card) 88%,var(--orange));--err:var(--red);--err-soft:color-mix(in srgb,var(--card) 88%,var(--red))}
:root[data-theme] select,:root[data-theme] option,:root[data-theme] textarea{color:var(--text);background-color:var(--card)}
:root[data-theme] input::placeholder,:root[data-theme] textarea::placeholder{color:var(--muted);opacity:1}
:root[data-theme] input[type=checkbox],:root[data-theme] input[type=radio]{accent-color:var(--accent-fill)}
:root[data-theme] a{color:var(--accent)}
:root[data-theme] .btn.primary,:root[data-theme] .nav-item.active,:root[data-theme] .skd.on,:root[data-theme] .skdpanel .skd-close{background:var(--accent-fill);color:#fff}
:root[data-theme] .nav-item.active .ico{color:#fff}
:root[data-theme] .theme-control{display:flex;flex-wrap:wrap;align-items:center;gap:7px;margin:8px 0 12px;padding:6px 8px;border:1px solid var(--border);border-radius:9px;color:var(--text);background:var(--card)}
.theme-control label{display:flex;align-items:center;gap:5px;font-size:12px}
.theme-control label>span:first-child{font-size:18px;color:var(--accent)}
.theme-control select{flex:1;min-width:0;max-width:135px;padding:5px 3px;border:0;font:inherit;font-size:12px;cursor:pointer;border-radius:5px}
.theme-control select:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
#oa-theme-status{width:100%;font-size:10px;color:var(--muted)}#oa-theme-status:empty{display:none}#oa-theme-status.neg{color:var(--red)}
:root[data-theme] .chart text{fill:var(--muted)}
:root[data-theme] .chart line{stroke:var(--chart-grid)}
:root[data-theme="dark"] .chart path[stroke="#0071e3"]{stroke:var(--accent)}
:root[data-theme="light"] .chart path[stroke="#34c759"]{stroke:var(--green)}
:root[data-theme="dark"] .nav-item:hover:not(.active){background:#ffffff0b}
:root[data-theme="dark"] .seg{background:#ffffff0c}
:root[data-theme] .mn-dashboard{--mn-blue:var(--accent);--mn-good:var(--green);--mn-bad:var(--red)}
:root[data-theme] .abc-B,:root[data-theme] .abc-product-scroll .oa-product-note{color:var(--orange)}
:root[data-theme] .abc-C{color:var(--red)}
:root[data-theme] .ch-input{color-scheme:inherit}
:root[data-theme] .platform-switch button[data-pf="lfo"]{--pf:var(--green)}
:root[data-theme] #lfoSitePanel iframe{background:var(--bg)}
/* Вход и резерв не зависят от разрешений пользователя. */
:root[data-theme] body.theme-auth{background:var(--bg);color:var(--text)}
.theme-auth .box{background:var(--card);border-color:var(--border);box-shadow:var(--shadow)}
.theme-auth p,.theme-auth small{color:var(--muted)}
.theme-auth .brand,.theme-auth a{color:var(--accent)}
.theme-auth input,.theme-auth #link{background:var(--bg);color:var(--text);border:1px solid var(--border)}
.theme-auth button{background:var(--accent-fill);color:#fff;border:1px solid transparent}
.theme-auth #error{color:var(--red)}
/* Собственный интерфейс WooCommerce во фрейме наследует ту же тему. */
.theme-site button,.theme-site .btn{background:var(--accent-fill);color:#fff}
.theme-site button.sec,.theme-site .btn.sec,.theme-site .chips button,.theme-site input[type=search],.theme-site input[type=number],.theme-site .tbl{background:var(--card);color:var(--text)}
.theme-site .chips button.on{background:var(--text);color:var(--card);border-color:var(--text)}
.theme-site th{background:var(--bg)}
.theme-site .b-other{background:var(--bg)}
.theme-site dialog{background:var(--card);color:var(--text);border:1px solid var(--border)}
@media(max-width:980px){
 :root[data-theme] .theme-control{padding:4px;gap:2px;margin:5px 0 8px}
 .theme-label{display:none}.theme-control label{display:none}.theme-control select{width:100%;max-width:100%;font-size:10px;padding:5px 0}#oa-theme-status{overflow-wrap:anywhere;font-size:9px}
}

/* Цветные метки сохраняют контраст текста в обеих палитрах. */
:root[data-theme] .fb-nav-count{background:#b92431;color:#fff}
:root[data-theme] .oa-account button{color:var(--accent)}
:root[data-theme] .btn.send b{background:var(--accent-fill);color:#fff}
:root[data-theme="dark"] .chart-holder .legend i[style*="#0071e3"]{background:var(--accent)!important}
:root[data-theme="light"] .chart-holder .legend i[style*="#34c759"]{background:var(--green)!important}
