:root { --bg:#f5f6f8; --card:#fff; --text:#1d2330; --muted:#6b7385; --accent:#2f6fde; --line:#e3e6ec;
        --accent-soft:#eef3fc; --accent-soft2:#e4ecfa; --accent-ring:#c9dafb; --accent-bright:#4f86f0;
        --danger:#c62f2f; --ok:#1f8a4c; }
* { box-sizing: border-box; }
body { margin:0; font:15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background:var(--bg); color:var(--text); }
a { color:var(--accent); }
.top { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap;
       background:var(--card); border-bottom:1px solid var(--line); padding:12px 24px; }
.brand { font-weight:600; font-size:18px; color:inherit; text-decoration:none; }
#nav { display:flex; align-items:center; gap:14px; flex-wrap:wrap; font-size:14px; }
#nav .who { color:var(--muted); }
/* Портал на весь экран: содержимое растягивается по ширине окна (поля по краям — 24 px). */
main { max-width:none; margin:24px 0; padding:0 24px; }
main.wide { max-width:none; }
/* Цвет раздела — как у его иконки на главной: кнопки, ссылки, вкладки, выделения, полоса под шапкой, значок у заголовка. */
body[data-section="recipes"]  { --accent:#1f7a43; --accent-bright:#3aa765; --accent-soft:#eaf6ee; --accent-soft2:#dcefe3; --accent-ring:#bfe3cc; }
body[data-section="scales"]   { --accent:#2c5fcf; --accent-bright:#4f86f0; --accent-soft:#ebf1fd; --accent-soft2:#dde7fb; --accent-ring:#c3d4f7; }
body[data-section="warehouse"] { --accent:#7d5129; --accent-bright:#b07a45; --accent-soft:#f8f1ea; --accent-soft2:#f0e4d6; --accent-ring:#e2cbb1; }
body[data-section="assistant"] { --accent:#0b7a5e; --accent-bright:#14a37f; --accent-soft:#e7f6f1; --accent-soft2:#d3efe5; --accent-ring:#a9dfcc; }
body[data-section="production"] { --accent:#a3461c; --accent-bright:#e07a3c; --accent-soft:#fcf0e8; --accent-soft2:#f8e2d4; --accent-ring:#f1c7ad; }
body[data-section="finance"]  { --accent:#6440c4; --accent-bright:#8c62e6; --accent-soft:#f2edfc; --accent-soft2:#e7defa; --accent-ring:#d6c9f5; }
body[data-section="mailing"]  { --accent:#c42f6c; --accent-bright:#e8558f; --accent-soft:#fcedf3; --accent-soft2:#f9dfe9; --accent-ring:#f3c3d7; }
body[data-section="programs"] { --accent:#0e8794; --accent-bright:#1fb0bd; --accent-soft:#e7f6f7; --accent-soft2:#d6eff1; --accent-ring:#b6e3e7; }
body[data-section="docs"]     { --accent:#a8650c; --accent-bright:#e8a33a; --accent-soft:#fcf4e6; --accent-soft2:#f8ead0; --accent-ring:#f0d9ad; }
body[data-section="requisites"] { --accent:#3b5bdb; --accent-bright:#5c7cfa; --accent-soft:#edf1fe; --accent-soft2:#e0e7fd; --accent-ring:#c5d1fb; }
body[data-section="masterdata"] { --accent:#1c7a6d; --accent-bright:#2f9e8f; --accent-soft:#e8f5f3; --accent-soft2:#d5ede9; --accent-ring:#a9d8d0; }
body[data-section="payroll"] { --accent:#a87d0c; --accent-bright:#d4a017; --accent-soft:#fbf5e3; --accent-soft2:#f5ebcb; --accent-ring:#ead49a; }
body[data-section="company-docs"] { --accent:#5f7d1c; --accent-bright:#8fae3a; --accent-soft:#f2f7e7; --accent-soft2:#e6efd2; --accent-ring:#d0e0a8; }
body[data-section="retail-orders"] { --accent:#a8482c; --accent-bright:#d06a4a; --accent-soft:#fbeee9; --accent-soft2:#f5ddd3; --accent-ring:#ebbfae; }
.badge.ro-wh { color:#1e4a9a; border-color:#bcd0f2; } .badge.ro-cu { color:#1b6b35; border-color:#b5dfc1; }
body[data-section="marking"]  { --accent:#2b3242; --accent-bright:#4b5568; --accent-soft:#eef0f4; --accent-soft2:#e2e5ec; --accent-ring:#c8ccd6; }
body[data-section] .top { border-bottom:0; box-shadow:inset 0 -4px 0 var(--accent-bright); }
body[data-section] { background:linear-gradient(180deg, var(--accent-soft) 0, var(--bg) 260px) no-repeat, var(--bg); }
body[data-section] .tabs a.on { color:var(--accent); }
.sec-icon { display:inline-flex; width:38px; height:38px; border-radius:11px; align-items:center; justify-content:center; vertical-align:middle;
  margin-right:12px; background:linear-gradient(135deg, var(--accent-bright), var(--accent)); box-shadow:0 4px 12px var(--accent-ring); }
.sec-icon svg { width:24px; height:24px; }
h1 .sec-icon { position:relative; top:-2px; }
/* Главная: шапка с логотипами и плитки разделов с иконками */
.hero { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:28px; padding:14px 34px 18px; margin:0 0 18px;
  border-radius:20px; position:relative; overflow:hidden; border:1px solid #efe2df; box-shadow:0 10px 30px rgba(170,30,30,.07);
  background:radial-gradient(circle at 8% 15%, #fff1ef 0, transparent 42%), radial-gradient(circle at 95% 85%, #ecf7ef 0, transparent 45%), #fff; }
.hero::after { content:''; position:absolute; left:0; right:0; bottom:0; height:6px;
  background:linear-gradient(90deg, #d0121b 0, #d0121b 50%, #1b7a3c 50%, #1b7a3c 100%); }
.hero-logo.yasenevo { height:92px; }
.hero-logo.odolen { height:40px; }
.hero-text { text-align:center; }
.hero-text h1 { font-size:30px; margin:2px 0; letter-spacing:.3px; }
.hero-hello { color:#c4141c; font-weight:600; font-size:17px; }
.hero-date { color:var(--muted); font-size:14px; }
@media (max-width:820px) { .hero { grid-template-columns:1fr; justify-items:center; text-align:center; gap:14px; } .hero-logo.yasenevo { height:96px; } }
.grid.home-grid { grid-template-columns:repeat(5, minmax(0, 1fr)); gap:12px; }
/* Узкий экран: меньше столбцов, плитки по порядку сохранённых мест (свои клетки — только при 5 столбцах). */
@media (max-width:1100px) { .grid.home-grid { grid-template-columns:repeat(3, minmax(0, 1fr)); grid-template-rows:none !important; }
  .grid.home-grid > .home-tile { grid-column:auto !important; grid-row:auto !important; } .grid.home-grid .home-slot { display:none; } }
@media (max-width:700px) { .grid.home-grid { grid-template-columns:1fr; } }
.tile.home-tile { cursor:grab; }
.tile.home-tile.dragging { opacity:.35; }
.grid.home-grid.arranging .home-tile { transition:none; }
.home-slot { border:2px dashed #cfd5df; border-radius:12px; min-height:76px; background:rgba(255,255,255,.5); }
.home-slot.drop-on, .tile.home-tile.drop-on { border-color:var(--accent); background:var(--accent-soft); outline:2px dashed var(--accent); outline-offset:2px; }
.home-hint { margin-top:10px; }
.linkbtn { background:none; border:0; padding:0; color:var(--accent); text-decoration:underline; cursor:pointer; font:inherit; }
.tile.home-tile { position:relative; display:flex; gap:12px; align-items:center; padding:12px 14px; border-radius:12px; min-height:76px;
  text-decoration:none; color:inherit; border-top:3px solid var(--c); transition:transform .15s, box-shadow .15s, border-color .15s; }
a.tile.home-tile:hover { transform:translateY(-2px); box-shadow:0 10px 22px rgba(20,30,50,.11); border-color:var(--c); }
.tile.home-tile .tile-text { min-width:0; }
.tile.home-tile h2 { font-size:15px; margin:0 0 2px; line-height:1.25; }
.tile.home-tile p { font-size:12.5px; line-height:1.35; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.hicon { flex:0 0 42px; width:42px; height:42px; border-radius:12px; display:flex; align-items:center; justify-content:center; }
.hicon svg { width:26px; height:26px; }
.tile-go { position:absolute; right:10px; bottom:6px; color:var(--c); font-size:16px; font-weight:600; opacity:0; transition:opacity .15s, transform .15s; }
a.tile.home-tile:hover .tile-go { opacity:1; transform:translateX(3px); }
.tile.home-tile .badge { position:absolute; top:12px; right:12px; }
h1 { font-size:22px; margin:0 0 16px; }
h2 { font-size:17px; margin:24px 0 10px; }
.muted { color:var(--muted); }
.small { font-size:13px; }

.grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:16px; }
.tile { display:block; background:var(--card); border:1px solid var(--line); border-radius:12px; padding:20px;
        color:inherit; text-decoration:none; }
a.tile:hover { border-color:var(--accent); }
.tile h2 { margin:0 0 6px; font-size:17px; }
.tile p { margin:0; color:var(--muted); font-size:14px; }
.tile.soon { opacity:.65; }
.badge { display:inline-block; margin-top:10px; font-size:12px; color:var(--muted); border:1px solid var(--line);
         border-radius:99px; padding:1px 8px; }
.badge.off { color:var(--danger); border-color:#f0c4c4; }

.card { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:20px; }
.narrow { max-width:420px; margin:40px auto; }
form .row { margin-bottom:12px; }
label { display:block; font-size:13px; color:var(--muted); margin-bottom:4px; }
input, select { width:100%; font:inherit; padding:8px 10px; border:1px solid var(--line); border-radius:8px; background:#fff; }
input:focus, select:focus { outline:2px solid var(--accent-ring); border-color:var(--accent); }
.inline { display:flex; gap:8px; align-items:center; }
.inline input { flex:1; }
button { font:inherit; padding:8px 14px; border-radius:8px; border:1px solid var(--line); background:#fff; cursor:pointer; }
button.primary { background:var(--accent); border-color:var(--accent); color:#fff; }
button.danger { color:var(--danger); }
button:disabled { opacity:.6; cursor:default; }
button.link { border:0; background:none; padding:0; color:var(--accent); }
.actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:16px; }
.error { color:var(--danger); margin:8px 0 0; min-height:1em; }
.note { background:var(--accent-soft); border:1px solid var(--accent-ring); border-radius:8px; padding:10px 12px; font-size:14px; margin-bottom:14px; }

.tabs { display:flex; gap:4px; border-bottom:1px solid var(--line); margin-bottom:18px; flex-wrap:wrap; }
.tabs a { padding:8px 14px; text-decoration:none; color:var(--muted); border-bottom:2px solid transparent; }
.tabs a.on { color:var(--text); border-bottom-color:var(--accent); }

table { width:100%; border-collapse:collapse; background:var(--card); border:1px solid var(--line); border-radius:12px; overflow:hidden; }
th, td { text-align:left; padding:9px 12px; border-bottom:1px solid var(--line); vertical-align:top; font-size:14px; }
th { font-weight:600; background:#fafbfc; }
tr:last-child td { border-bottom:0; }
tr.inactive td { color:var(--muted); }
td select { min-width:150px; }

.toast { position:fixed; bottom:20px; left:50%; transform:translateX(-50%); background:#1d2330; color:#fff;
         padding:10px 16px; border-radius:8px; font-size:14px; }
.toast.err { background:var(--danger); }

dialog { border:1px solid var(--line); border-radius:12px; padding:20px; width:min(440px, 92vw); }
dialog::backdrop { background:rgba(20,25,35,.35); }
button, .badge { white-space:nowrap; }
.scroll { overflow-x:auto; border-radius:12px; }
.btnlink { display:inline-block; font:inherit; font-size:14px; padding:8px 14px; border-radius:8px; border:1px solid var(--line);
           background:#fff; color:var(--text); text-decoration:none; cursor:pointer; }
.btnlink:hover { border-color:var(--accent); }
td.num { text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }

/* Документация */
.docs { display:grid; grid-template-columns:260px 1fr; gap:20px; align-items:start; }
@media (max-width:800px) { .docs { grid-template-columns:1fr; } }
.doclist { display:flex; flex-direction:column; gap:2px; position:sticky; top:12px; }
.doclist a { padding:8px 12px; border-radius:8px; text-decoration:none; color:var(--text); }
.doclist a:hover { background:var(--accent-soft); } .doclist a.on { background:var(--accent-soft2); font-weight:600; }
.doc .md { line-height:1.6; }
.md h2 { font-size:22px; margin:4px 0 14px; } .md h3 { font-size:18px; margin:22px 0 8px; } .md h4, .md h5 { font-size:16px; margin:16px 0 6px; }
.md code { background:#f0f2f5; padding:1px 5px; border-radius:4px; font-size:90%; }
.md pre { background:#f0f2f5; padding:12px; border-radius:8px; overflow-x:auto; } .md pre code { background:none; padding:0; }
.md blockquote { margin:12px 0; padding:8px 14px; border-left:4px solid #c9d6ec; background:#f5f8fd; color:#33415a; }
.md table { margin:10px 0; } .md li { margin:3px 0; } .md hr { border:0; border-top:1px solid var(--line); margin:20px 0; }
@media print {
  .top, .tabs, .doclist, .actions, #toast { display:none !important; }
  main { margin:0; max-width:none; } .docs { display:block; } .card { border:0; padding:0; }
}
.md li.check { list-style:none; margin-left:-1.2em; }
.prog p { margin:0 0 8px; }
.note.bad { background:#ffebe9; border-color:#f5c2c0; }
/* Отчёт ДДС */
table.dds td.ddsname, table.dds th.ddsname { position:sticky; left:0; background:var(--card); min-width:260px; z-index:1; }
table.dds tr.ddsgrp td { font-weight:600; background:var(--accent-soft); } table.dds tr.ddsgrp td.ddsname { background:var(--accent-soft); }
table.dds tr.ddsnet td { font-weight:600; } table.dds tr.ddsbal td { font-weight:700; background:var(--accent-soft2); } table.dds tr.ddsbal td.ddsname { background:var(--accent-soft2); }
table.dds tr.ddswarn td { color:var(--danger); }
/* Фильтры в заголовках таблицы */
th.thf { vertical-align:top; } th.thf select { margin-top:4px; padding:3px 6px; font-size:12px; font-weight:400; width:100%; min-width:120px; max-width:260px; }
th.thf select.on { border-color:var(--accent); background:var(--accent-soft); }
/* Операция без статьи или ЦФО */
tr.faneed td { background:#fff8e1; }
/* Подсказки контрагентов */
.cpsugwrap { position:relative; display:inline-block; }
.cpsug { position:absolute; left:0; top:calc(100% + 4px); z-index:20; min-width:100%; width:max-content; max-width:min(520px, 92vw);
  max-height:360px; overflow:auto; background:var(--card); border:1px solid var(--line); border-radius:10px; box-shadow:0 8px 24px rgba(20,30,50,.14); }
.cpsugitem { padding:7px 10px; cursor:pointer; border-bottom:1px solid var(--line); } .cpsugitem:last-child { border-bottom:0; }
.cpsugitem.on { background:var(--accent-soft); }
.cpchip { display:inline-flex; align-items:center; gap:4px; padding:4px 6px 4px 10px; border-radius:16px; background:var(--accent-soft); font-size:14px; }
.cpchip button { border:0; background:none; padding:0 4px; cursor:pointer; color:var(--muted); }
/* План-факт */
.fbgood { color:var(--ok); } .fbbad { color:var(--danger); }
table.dds td.fbplan, table.dds th.fbplan { color:var(--muted); }
table.fbedit td { padding:3px 4px; }
input.fbcell { width:96px; text-align:right; padding:4px 6px; font-variant-numeric:tabular-nums; }
input.fbcell.fbchanged { background:#fff8e1; border-color:#e0b000; }
/* Аналитика */
.faa-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(420px, 1fr)); gap:16px; margin-bottom:16px; }
@media (max-width:900px) { .faa-grid { grid-template-columns:1fr; } }
.faa-chart { position:relative; }
.faa-svg { width:100%; height:auto; display:block; }
.faa-axis { font-size:12px; fill:#6b7385; }
.faa-hit:hover, .faa-hit:focus { fill:rgba(30,58,138,.05); outline:none; }
.faa-legend { display:flex; gap:16px; font-size:13px; color:var(--muted); margin-bottom:6px; }
.faa-legend i { display:inline-block; width:12px; height:12px; border-radius:3px; margin-right:6px; vertical-align:-1px; }
.faa-tip { position:absolute; pointer-events:none; background:#fff; border:1px solid var(--line); border-radius:8px; padding:8px 10px;
           box-shadow:0 4px 14px rgba(20,30,50,.12); font-size:13px; min-width:170px; z-index:5; }
.faa-tip-row { display:flex; gap:8px; align-items:center; }
.faa-key { display:inline-block; width:12px; height:2px; border-radius:1px; }
.faa-bars { display:flex; flex-direction:column; gap:10px; }
.faa-bar { display:grid; grid-template-columns:minmax(120px, 1.2fr) 1fr auto; grid-template-areas:"name track val" "name track delta";
           gap:2px 12px; align-items:center; color:inherit; text-decoration:none; padding:4px 6px; border-radius:6px; }
.faa-bar:hover { background:var(--accent-soft); }
.faa-bar-name { grid-area:name; font-size:14px; } .faa-bar-track { grid-area:track; height:10px; background:#eef1f5; border-radius:4px; overflow:hidden; }
.faa-bar-track span { display:block; height:100%; border-radius:0 4px 4px 0; }
.faa-bar-val { grid-area:val; font-size:14px; text-align:right; white-space:nowrap; } .faa-bar-delta { grid-area:delta; text-align:right; }

/* Отчёт производства */
.pr-photo { border-radius:6px; background:#f1f3f5; display:flex; align-items:center; justify-content:center; overflow:hidden; font-size:10px; color:var(--muted); text-align:center; flex:none; }
.pr-photo img { width:100%; height:100%; object-fit:cover; transform-origin:center; }
table.pr-table { overflow:visible; border-radius:0; }
table.pr-table th, table.pr-table td { padding:6px 6px; }
table.pr-table td.num, table.pr-table th.num { min-width:34px; text-align:right; }
table.pr-table .pr-sticky { position:sticky; background:var(--card); z-index:1; }
table.pr-table .pr-ph { left:0; width:52px; min-width:52px; }
table.pr-table .pr-name { left:52px; min-width:240px; max-width:320px; box-shadow:inset -1px 0 0 var(--line); }
table.pr-table tr.pr-brand td { background:var(--accent-soft); font-weight:600; }
table.pr-table tr.pr-brand td.pr-sticky { left:0; background:var(--accent-soft); }
table.pr-table tr.pr-sum td { font-weight:700; background:var(--accent-soft2); }
table.pr-table tr.pr-sum td.pr-sticky { left:0; background:var(--accent-soft2); }
table.pr-table .pr-we { background:#f6f7f9; }
table.pr-table th.pr-today { color:var(--accent); box-shadow:inset 0 -2px 0 var(--accent-bright); }
table.pr-table .pr-total { font-weight:600; }
table.pr-inner { margin:4px 0; } table.pr-inner td, table.pr-inner th { padding:5px 10px; }
.pr-pick { max-height:60vh; overflow:auto; margin-top:10px; border:1px solid var(--line); border-radius:8px; }
.pr-pick-row { display:flex; gap:12px; align-items:center; padding:8px 10px; border-bottom:1px solid var(--line); }
.pr-pick-row:last-child { border-bottom:0; }
table.pr-skus td:nth-child(3) { min-width:220px; } table.pr-skus td:nth-child(4) { min-width:130px; }
table.pr-skus td:last-child .inline { flex-wrap:wrap; }
.pr-modes { display:flex; flex-wrap:wrap; gap:12px; } .pr-modes p { flex-basis:100%; }
.pr-mode { flex:1 1 280px; display:flex; gap:10px; align-items:flex-start; padding:12px 14px; border:1px solid var(--line); border-radius:10px; cursor:pointer; }
.pr-mode.on { border-color:var(--accent); background:var(--accent-soft); } .pr-mode input { margin-top:4px; width:auto; }

/* Отчёт производства: разделы СКЮ и перетаскивание */
table.pr-skus tr.pr-sec-head td { background:var(--accent-soft); font-weight:600; padding-top:7px; padding-bottom:7px; }
table.pr-skus td.pr-handle-cell { width:28px; padding-left:8px; padding-right:0; vertical-align:middle; }
.pr-handle { cursor:grab; font-size:20px; color:var(--muted); user-select:none; display:inline-block; padding:4px 2px; touch-action:none; }
.pr-handle:hover { color:var(--accent); }
table.pr-skus tr.pr-dragging { opacity:.45; background:var(--accent-soft2); }
table.pr-table tr.pr-section td { background:#fafbfc; font-weight:600; color:var(--muted); font-size:13px; }
table.pr-table tr.pr-section td.pr-sticky { left:0; background:#fafbfc; }

/* Реквизиты и документы компании */
.co-card { margin-bottom:16px; }
.co-head { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; flex-wrap:wrap; margin-bottom:10px; }
.co-head h2 { margin:0 0 2px; }
.btnlink.primary { background:var(--accent); border-color:var(--accent); color:#fff; }
table.co-table { width:100%; max-width:1100px; border-collapse:collapse; }
table.co-table th { text-align:left; font-weight:400; color:var(--muted); width:280px; padding:6px 12px; border-bottom:1px solid var(--line); vertical-align:top; }
table.co-table td { padding:6px 12px; border-bottom:1px solid var(--line); }
table.co-table tr.co-group td { background:var(--accent-soft); font-weight:600; font-size:12px; text-transform:uppercase; letter-spacing:.4px; color:var(--accent); border-bottom:0; }
.co-strong { font-weight:600; }
.co-form-top { display:grid; grid-template-columns:repeat(auto-fit, minmax(280px, 1fr)); gap:0 16px; }
.co-fieldset { border:1px solid var(--line); border-radius:10px; padding:6px 14px 2px; margin:0 0 14px; }
.co-fieldset legend { font-weight:600; padding:0 6px; color:var(--accent); }
.co-fields { display:grid; grid-template-columns:repeat(auto-fit, minmax(300px, 1fr)); gap:0 16px; }
.co-fields textarea { width:100%; font:inherit; }
.co-upload { margin-bottom:16px; }
.co-check { display:inline-flex; align-items:center; gap:6px; font-size:14px; }
table.co-docs td.nowrap button, table.co-docs td.nowrap .btnlink { margin-right:4px; }
.nowrap { white-space:nowrap; }
.co-upload .actions select, .co-toolbar select { width:auto; min-width:240px; max-width:420px; }
.co-upload .actions input[type=file] { width:auto; }
.co-toolbar { align-items:center; }
.co-check input, .co-docs input[type=checkbox] { width:auto; }
.tile.home-tile { touch-action:none; user-select:none; -webkit-user-drag:none; }
.tile.home-tile.ghost { box-shadow:0 18px 40px rgba(20,30,50,.25); transform:rotate(1.5deg); opacity:.95; cursor:grabbing; }
.tile.home-tile.ghost .tile-go { display:none; }

/* ---------- Помощник ---------- */
.as-stats { display:grid; grid-template-columns:repeat(auto-fill, minmax(170px, 1fr)); gap:10px; margin:12px 0 18px; }
.as-stat { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:12px 14px; }
.as-stat-v { font-size:24px; font-weight:700; }
.as-stat-l { color:var(--muted); font-size:13px; }
.as-stat.bad { border-color:#f5c2c0; background:#fff4f3; } .as-stat.bad .as-stat-v { color:#a61b1b; }
.as-stat.warn { border-color:#f3d9a4; background:#fffaf0; } .as-stat.warn .as-stat-v { color:#a8650c; }
.as-stat.good .as-stat-v { color:#1f7a43; }
.as-badge { display:inline-block; font-size:12px; padding:2px 8px; border-radius:10px; background:#eef0f4; color:#4b5568; white-space:nowrap; }
.as-badge.bad { background:#fde2e2; color:#a61b1b; } .as-badge.warn { background:#fdf0d5; color:#8a5208; } .as-badge.good { background:#e2f4e8; color:#1f7a43; }
.as-neg { color:#a61b1b; } .as-pos { color:#1f7a43; }
.as-order, .as-event { margin-bottom:12px; padding:14px 16px; }
.as-order-head { display:flex; justify-content:space-between; align-items:baseline; gap:12px; margin-bottom:8px; }
.as-order-head h3 { margin:0; font-size:16px; }
.as-field { margin-bottom:12px; }
body[data-section="assistant"] th.num { text-align:right; }
.as-check { display:inline-flex; gap:6px; align-items:center; font-size:14px; color:var(--text); margin:0 0 8px; }
.as-check input { flex:none; width:auto; margin:0; }

/* Склад: заголовок раздела сырья или материалов в остатках; то же — в «Рецептурах и сырье» */
tr.wh-group td { background:var(--accent-soft); font-size:13px; padding-top:8px; padding-bottom:8px; }

/* Документы компании: папки */
.co-folders { align-items:center; }
.co-folders button { white-space:nowrap; }

/* ---------- Документы компании: хранилище в виде проводника ---------- */
.cd { display:flex; flex-direction:column; gap:8px; }
.cd-toolbar { display:flex; flex-wrap:wrap; gap:6px; align-items:center; background:var(--card); border:1px solid var(--line); border-radius:10px; padding:8px; }
.cd-toolbar button { padding:6px 10px; font-size:14px; }
.cd-sp { flex:1; }
.cd-search { width:240px; max-width:100%; }
.cd-address { display:flex; align-items:center; gap:2px; flex-wrap:wrap; background:var(--card); border:1px solid var(--line); border-radius:10px; padding:4px 8px; }
.cd-crumb { border:0; background:none; padding:4px 8px; border-radius:6px; font-size:14px; cursor:pointer; }
.cd-crumb:hover { background:var(--accent-soft); }
.cd-sep { color:var(--muted); }
.cd-up { border:0; background:none; font-size:16px; padding:2px 8px; cursor:pointer; }
.cd-body { display:grid; grid-template-columns:minmax(200px, 270px) 1fr; gap:8px; min-height:440px; }
.cd-tree, .cd-main { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:6px; overflow:auto; max-height:70vh; }
.cd-node { display:flex; align-items:center; gap:2px; padding:5px 6px; border-radius:6px; cursor:pointer; font-size:14px; white-space:nowrap; user-select:none; }
.cd-node:hover { background:var(--accent-soft); }
.cd-node.on { background:var(--accent-soft2); font-weight:600; }
.cd-tw { display:inline-block; width:16px; text-align:center; color:var(--muted); flex:none; }
.cd-trash { margin-top:8px; border-top:1px solid var(--line); border-radius:0; padding-top:8px; }
.cd-main { position:relative; }
table.cd-list { width:100%; border-collapse:collapse; font-size:14px; user-select:none; }
table.cd-list th { text-align:left; font-weight:500; color:var(--muted); padding:6px 8px; border-bottom:1px solid var(--line); white-space:nowrap; }
table.cd-list th.num { text-align:right; }
table.cd-list th.cd-sort { cursor:pointer; }
table.cd-list td { padding:5px 8px; border-bottom:1px solid #f0f2f5; vertical-align:top; }
table.cd-list tr:hover td { background:#f6f8fb; }
table.cd-list tr.sel td { background:var(--accent-soft2); }
.cd-name { word-break:break-word; }
.cd-ico { margin-right:6px; }
.cd-empty { color:var(--muted); text-align:center; padding:60px 20px; }
.cd-drop { outline:2px dashed var(--accent-bright); outline-offset:-2px; background:var(--accent-soft) !important; }
.cd-status { display:flex; gap:8px; font-size:13px; color:var(--muted); padding:0 4px; }
.cd-pub { margin-bottom:8px; }
.cd-menu { position:fixed; z-index:50; background:#fff; border:1px solid var(--line); border-radius:10px; box-shadow:0 10px 30px rgba(20,25,35,.18); padding:4px; min-width:220px; display:flex; flex-direction:column; }
.cd-menu button { border:0; background:none; text-align:left; padding:8px 12px; border-radius:6px; font-size:14px; cursor:pointer; }
.cd-menu button:hover { background:var(--accent-soft); }
.cd-pick { max-height:50vh; overflow:auto; border:1px solid var(--line); border-radius:8px; padding:4px; }
.cd-pick-row { padding:6px 8px; border-radius:6px; cursor:pointer; }
.cd-pick-row:hover { background:var(--accent-soft); }
.cd-pick-row.on { background:var(--accent-soft2); font-weight:600; }
.cd-pick-row.dis { color:var(--muted); cursor:not-allowed; }
table.cd-props { margin-top:10px; font-size:14px; }
table.cd-props th { text-align:left; color:var(--muted); font-weight:400; padding:3px 12px 3px 0; }
.cd-queue { position:fixed; right:16px; bottom:16px; z-index:40; width:min(460px, calc(100vw - 32px)); background:#fff; border:1px solid var(--line); border-radius:12px;
  box-shadow:0 12px 32px rgba(20,25,35,.2); padding:12px 14px; }
.cd-queue-head { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-bottom:4px; }
.cd-queue-list { max-height:40vh; overflow:auto; margin-top:6px; }
.cd-queue-row { display:grid; grid-template-columns:1fr auto 92px 28px; gap:8px; align-items:center; padding:4px 0; border-bottom:1px solid #f0f2f5; font-size:14px; }
.cd-queue-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cd-queue-row.done .cd-queue-st { color:#1f7a43; } .cd-queue-row.error .cd-queue-st { color:#a61b1b; } .cd-queue-row.cancel { opacity:.55; }
.cd-bar { display:block; height:4px; background:#e6e9ef; border-radius:2px; margin-top:3px; overflow:hidden; }
.cd-bar span { display:block; height:100%; background:var(--accent-bright, #2c5fcf); }
.cd-x { border:0; background:none; color:var(--muted); cursor:pointer; font-size:15px; padding:2px 6px; border-radius:6px; }
.cd-x:hover { background:#fde2e2; color:#a61b1b; }
@media (max-width: 760px) { .cd-body { grid-template-columns:1fr; } .cd-tree { max-height:200px; } }

/* Управленческий анализ: взаиморасчёты с учредителями */
table.fs-sum th.on { background:var(--accent-soft2); }
tr.fs-bold td { font-weight:600; background:var(--accent-soft); }
.fs-two { display:grid; grid-template-columns:repeat(auto-fit, minmax(360px, 1fr)); gap:14px; align-items:start; margin-bottom:14px; }
.fs-grid { display:grid; grid-template-columns:1fr auto; gap:6px 10px; align-items:center; font-size:14px; }
.fs-grid label { margin:0; color:var(--text); }
tr.fs-auto td { background:#fffaf0; } tr.fs-empty td { background:#fff4f3; }
.fs-purpose { max-width:420px; }
table.fs-ops th.fs-sort { cursor:pointer; user-select:none; white-space:nowrap; }
table.fs-ops tr.fs-filter th { padding:4px; background:var(--accent-soft); }
table.fs-ops tr.fs-filter input, table.fs-ops tr.fs-filter select { font-size:13px; padding:4px 6px; }

/* Управленческий анализ: «Из чего состоит сумма» */
a.fa-drillable { text-decoration:none; border-bottom:1px dotted currentColor; cursor:pointer; }
a.fa-drillable:hover { background:var(--accent-soft); }
dialog.fa-drill { width:min(1200px, 96vw); max-height:88vh; }
tr.clickable { cursor:pointer; }
.zp-plan .zp-big { font-size:22px; font-weight:600; white-space:nowrap; }
.zp-plan.clickable { cursor:pointer; }
.zp-plan.clickable:hover { border-color:var(--accent-ring); box-shadow:0 0 0 2px var(--accent-soft2); }
tr.clickable:hover td { background:#f6f8fb; }
.co-table td { white-space:pre-line; }
.fa-drill-head { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:6px; }

/* Управленка: галочки согласий, окна */
label.check { display:flex; gap:8px; align-items:flex-start; color:var(--text); font-size:13.5px; margin:8px 0; }
label.check input { width:auto; margin-top:3px; }
textarea { font:inherit; padding:8px 10px; border:1px solid var(--line); border-radius:8px; }
dialog.card { border:1px solid var(--line); }
dialog::backdrop { background:rgba(20,30,50,.35); }
