/* Управленческий учёт — оформление */
:root {
  --bg: #EEF1F4; --surface: #FFFFFF; --ink: #1B2631; --muted: #5B6875; --faint: #8794A1;
  --line: #DCE1E6; --line2: #EDF0F3; --field: #C9D1D9;
  --side: #17222E; --side2: #243241; --side-ink: #C9D3DC; --top: #0F1922;
  --acc: #0E6E62; --acc-d: #0A5249; --acc-l: #E3F1EE; --row: #F4FAF8; --sel: #D6EDE8;
  --neg: #B42318; --warn-bg: #FEF3E7; --warn: #7A2E0B; --info-bg: #EAF0F6; --info: #2B4A66;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  --font: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif; --hfont: var(--font);
  --acc-t: #0E6E62; --on-acc: #fff; --th: #F6F8FA; --hover: #F3F6F8; --hl: #FFF6E0; --hl-b: #F5D9A6; --hl2: #fff1db; --rad: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.4 var(--font); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--acc-t); } a:hover { color: var(--acc-t); text-decoration-thickness: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num, .mono { font-family: var(--mono); font-size: 13px; }
.num { text-align: right; white-space: nowrap; }
.neg { color: var(--neg); }
.muted { color: var(--muted); }

/* кнопки */
.btn { height: 32px; padding: 0 12px; border: 1px solid var(--field); background: var(--surface); border-radius: 6px;
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.btn:hover { background: var(--hover); }
a.btn { text-decoration: none; color: var(--ink); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.p { background: var(--acc); border-color: var(--acc); color: var(--on-acc); font-weight: 500; }
.btn.p:hover { background: var(--acc-d); }
.btn.danger { color: var(--neg); }
.ico { width: 30px; height: 30px; border: 0; background: none; border-radius: 5px; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ico:hover { background: var(--bg); color: var(--ink); }
svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* вход */
.login { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login form { width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.login h1 { margin: 0; font-size: 20px; }
.logo { width: 30px; height: 30px; border-radius: 6px; background: var(--acc); color: var(--on-acc); display: flex;
  align-items: center; justify-content: center; font-weight: 600; flex-shrink: 0; }

/* CRM */
.crmfeed { display: flex; flex-direction: column; gap: 6px; max-height: 520px; overflow: auto; margin-top: 6px; }
.crmfeed .fe { background: var(--bg); border-radius: 6px; padding: 6px 8px; font-size: 13px; white-space: pre-wrap; }
.crmfeed .fe.doc { background: none; border: 1px dashed var(--line); cursor: pointer; } .crmfeed .fe.doc:hover { background: var(--info-bg); }
.stage { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 10px; background: #eef1f5; margin-bottom: 6px; }
.st-КП_отправлено { background: #e6f0ff; } .st-Частично_оплачен { background: #fff4d6; } .st-Оплачен { background: #e3f6e8; }
.st-Отгружен { background: #d9f2df; } .st-Отказ { background: #fde2e2; }

/* задачи */
.tcnt { margin-left: auto; background: #3a4a5a; color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; line-height: 18px; }
.tcnt.hot { background: #e2410f; }
table.tasks tr { cursor: pointer; } table.tasks tr.over td:nth-child(2) b { color: var(--neg); }
table.tasks tr.closed b { text-decoration: line-through; color: var(--muted); } table.tasks tr.unseen { background: var(--hl); }
.urg { display: inline-block; background: #e2410f; color: #fff; border-radius: 4px; font-size: 11px; padding: 0 5px; margin-right: 6px; vertical-align: 1px; }
.tquick { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.tcomm { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow: auto; margin-bottom: 8px; }
.tcomm .tc { background: var(--bg); border-radius: 6px; padding: 6px 8px; font-size: 13px; white-space: pre-wrap; }
.trem { border-bottom: 1px solid var(--line); padding: 8px 0; } .trem:last-child { border-bottom: 0; }
td.editable { cursor: pointer; } td.editable:hover { background: var(--info-bg); text-decoration: underline dotted; }

/* компактная шапка документа (как в УНФ) */
.fgrid.compact { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.3fr) minmax(150px, 1fr) minmax(180px, 1fr); gap: 8px 14px; }
.fgrid.compact .span2 { grid-column: span 2; }
.inp.autonum { background: var(--bg); color: var(--muted); }
.cpbal { font-size: 12px; margin-top: 3px; } .cpbal .neg { color: var(--neg); } .cpbal .pos { color: #13a34a; }
.cpbal .risk { font-weight: 700; padding: 4px 8px; border-radius: 6px; margin-bottom: 3px; } .cpbal .risk.grey { background: #fff4d6; color: #8a5a00; } .cpbal .risk.black { background: #fde2e2; color: #a40000; }
details.fmore { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
details.fmore > summary { cursor: pointer; color: var(--acc-t); font-size: 13px; list-style: none; }
details.fmore > summary:before { content: '▸ '; } details.fmore[open] > summary:before { content: '▾ '; }
details.fmore[open] > summary { margin-bottom: 6px; }
@media (max-width: 900px) { .fgrid.compact { grid-template-columns: 1fr; } .fgrid.compact .span2 { grid-column: auto; } }

/* экран входа */
.lg { min-height: 100vh; display: flex; flex-direction: column; background: #fff; color: #1d2330; --surface: #fff; --ink: #1d2330; --field: #C9D1D9; --muted: #5B6875; color-scheme: light; font-family: var(--font); }
.lg-top { background: #0f4f86; text-align: center; padding: 7px 16px; font-size: 13px; }
.lg-top a { color: #d8e8f6; text-decoration: none; } .lg-top a:hover { color: #fff; text-decoration: underline; }
.lg-head { background: linear-gradient(90deg, #0a6fbf, #1590dc); color: #fff; padding: 16px 60px; display: flex; align-items: center; gap: 14px; }
.lg-head img { height: 52px; width: auto; background: #fff; border-radius: 50%; padding: 2px; }
.lg-head .logo { width: 48px; height: 48px; border-radius: 50%; background: #fff; color: #0a6fbf; font-size: 20px; }
.lg-head b { font-size: 22px; display: block; line-height: 1.1; } .lg-head small { opacity: .85; font-size: 13px; }
.lg-idle { background: #fbf1c4; border-bottom: 1px solid #eadc9a; padding: 10px 24px; font-weight: 600; font-size: 14px; display: flex; gap: 16px; align-items: center; }
.lg-idle span { flex: 1; text-align: center; } .lg-idle button { border: 0; background: none; font-size: 20px; line-height: 1; color: #555; cursor: pointer; }
.lg-hero { position: relative; overflow: hidden; background: linear-gradient(120deg, #0d3e6e 0%, #1675bf 60%, #2a8fd8 100%);
  display: flex; align-items: center; gap: 60px; padding: 64px 120px; min-height: 520px; flex: 1; }
.lg-hero:before { content: ''; position: absolute; right: -120px; top: -140px; width: 720px; height: 720px; border-radius: 50%; border: 80px solid rgba(255,255,255,.05); }
.lg-hero:after { content: ''; position: absolute; left: 28%; bottom: -280px; width: 520px; height: 520px; border-radius: 50%; border: 60px solid rgba(255,255,255,.04); }
.lg-slides { position: relative; z-index: 1; color: #fff; flex: 1; max-width: 600px; display: grid; }
.lg-slide { grid-area: 1 / 1; opacity: 0; transform: translateY(14px); transition: opacity .6s, transform .6s; pointer-events: none; }
.lg-slide.on { opacity: 1; transform: none; pointer-events: auto; }
.lg-kick { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #ffd27a; margin-bottom: 12px; }
.lg-slide h2 { font-size: 38px; line-height: 1.15; margin: 0 0 14px; font-weight: 700; }
.lg-slide p { font-size: 17px; opacity: .92; margin: 0 0 22px; line-height: 1.5; }
.lg-pill { display: inline-block; border: 1.5px solid rgba(255,255,255,.9); border-radius: 6px; padding: 8px 14px; margin: 0 8px 8px 0; font-weight: 600; font-size: 14px; }
.lg-dots { grid-area: 2 / 1; display: flex; gap: 8px; margin-top: 18px; }
.lg-dots button { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid #fff; background: transparent; padding: 0; cursor: pointer; }
.lg-dots button.on { background: #fff; }
.lg-card { position: relative; z-index: 1; margin-left: auto; width: 380px; max-width: 100%; background: #fff; border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,20,60,.3); padding: 30px; display: flex; flex-direction: column; gap: 6px; }
.lg-card h1 { margin: 0; font-size: 22px; } .lg-card .sub { margin: 0 0 8px; color: #667; font-size: 13px; }
.lg-card label { font-size: 12px; color: #556; margin-top: 8px; }
.lg-card .inp { height: 44px; font-size: 15px; }
.lg-card .go { height: 46px; margin-top: 16px; border: 0; border-radius: 8px; background: #f4511e; color: #fff; font-weight: 700; font-size: 15px; cursor: pointer; }
.lg-card .go:hover { background: #e2410f; } .lg-card .go:disabled { opacity: .7; cursor: default; }
.lg-tiles { display: flex; justify-content: center; gap: 56px; padding: 30px 16px 36px; flex-wrap: wrap; }
.lg-tiles div { text-align: center; font-weight: 600; color: #0f4f86; font-size: 14px; }
.lg-tiles i { display: flex; align-items: center; justify-content: center; width: 76px; height: 76px; margin: 0 auto 10px; border-radius: 50%; background: var(--info-bg); border: 2px solid #d4e3f1; color: #1588d8; }
.lg-tiles svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 900px) {
  .lg-head { padding: 14px 16px; } .lg-hero { flex-direction: column; padding: 28px 16px; gap: 28px; align-items: stretch; }
  .lg-slide h2 { font-size: 24px; } .lg-slide p { font-size: 15px; } .lg-pill { display: none; } .lg-card { margin: 0 auto; order: -1; } .lg-tiles { gap: 24px; }
  .lg-idle { font-size: 13px; padding: 10px 16px; }
}

/* каркас */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.top { height: 52px; background: var(--top); color: #fff; display: flex; align-items: center; gap: 14px; padding: 0 12px; position: sticky; top: 0; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand b { font-size: 14px; display: block; }
.brand small { font-size: 11px; color: #9FB0BF; display: block; }
.gsearch { position: relative; flex: 1 1 300px; max-width: 560px; }
.gsearch label { display: flex; align-items: center; gap: 8px; height: 34px; background: #1D2A36; border-radius: 6px; padding: 0 10px; color: #9FB0BF; }
.gsearch input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: #fff; font-size: 13px; }
.drop { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 10px 28px rgba(15,25,34,.16); max-height: 420px; overflow: auto; z-index: 40; padding: 4px 0; }
.drop button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; border: 0; background: none; padding: 7px 12px; }
.drop button:hover, .drop button.on { background: var(--row); }
.drop small { color: var(--faint); font-size: 12px; }
.drop .empty { padding: 8px 12px; color: var(--muted); }
.topr { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 12px; color: #9FB0BF; }
.topr .rates span { margin-left: 8px; white-space: nowrap; }
.topr .me { color: #fff; background: none; border: 0; font-size: 13px; padding: 6px 8px; border-radius: 6px; }
.topr .me:hover { background: #1D2A36; }
.menu-btn { display: none; color: #fff; }
.menu-btn:hover { background: #1D2A36; color: #fff; }

.body { flex: 1; display: flex; min-height: 0; }
.side { width: 232px; flex-shrink: 0; background: var(--side); padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; }
.nav { width: 100%; text-align: left; background: none; border: 0; color: var(--side-ink); padding: 7px 12px; border-radius: 6px; display: flex; align-items: center; gap: 10px; }
.nav:hover { background: var(--side2); color: #fff; }
.nav.on { background: var(--acc); color: var(--on-acc); }
.side hr { border: 0; height: 1px; background: #2A3947; margin: 10px 6px; }
.side h6 { margin: 2px 12px 4px; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: #6F8293; font-weight: 500; }
.win { width: 100%; display: flex; align-items: center; gap: 4px; border-radius: 6px; }
.win > button:first-child { flex: 1; min-width: 0; text-align: left; background: none; border: 0; color: #9FB0BF; padding: 6px 12px; font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win:hover, .win.on { background: var(--side2); }
.win.on > button:first-child, .win:hover > button:first-child { color: #fff; }
.win .x { width: 24px; height: 24px; border: 0; background: none; color: #6F8293; border-radius: 4px; display: none; align-items: center; justify-content: center; }
.win:hover .x, .win.on .x { display: inline-flex; }
.win .x:hover { color: #fff; background: #31414F; }
.main { flex: 1; min-width: 0; padding: 16px 20px 28px; }
.view { display: none; flex-direction: column; gap: 12px; }
.view.on { display: flex; }

/* заголовок окна */
.vh { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vh h1 { margin: 0; font-size: 21px; font-weight: 600; font-family: var(--hfont); }
.badge { font-size: 12px; padding: 3px 8px; border-radius: 10px; background: var(--acc-l); color: var(--acc-d); white-space: nowrap; }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.grey { background: var(--line2); color: var(--muted); }
.bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.bar .grow { flex: 1; }
.lsearch { display: flex; align-items: center; gap: 8px; height: 32px; border: 1px solid var(--field); border-radius: 6px; background: var(--surface);
  padding: 0 10px; flex: 0 1 320px; min-width: 200px; margin-left: auto; color: var(--muted); }
.lsearch input { flex: 1; min-width: 0; border: 0; outline: none; font-size: 13px; color: var(--ink); background: transparent; }

/* раздел */
.sec { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--rad); padding: 14px; }
.card h3 { margin: 0 0 8px; font-size: 13px; color: var(--acc-t); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.dropzone-on { outline: 2px dashed var(--acc, #1F7A63); outline-offset: -4px; box-shadow: inset 0 0 0 9999px rgba(31,122,99,.06); }
.links button { display: block; border: 0; background: none; padding: 4px 0; color: var(--ink); text-align: left; }
.links button:hover { color: var(--acc-t); text-decoration: underline; }
.links .soon { display: block; padding: 4px 0; color: var(--faint); }
.links .soon small { font-size: 11px; margin-left: 6px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--rad); padding: 14px; }
.kpi small { color: var(--muted); display: block; }
.kpi b { font-size: 22px; font-weight: 600; font-family: var(--mono); display: block; margin-top: 4px; }

/* список */
.lwrap { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.tbox { flex: 999 1 600px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--rad); overflow: auto; max-height: calc(100vh - 200px); }
table { border-collapse: collapse; width: 100%; }
th { font-weight: 500; color: var(--muted); font-size: 12px; text-align: left; padding: 8px 10px; background: var(--th); border-bottom: 1px solid var(--line);
  white-space: nowrap; position: sticky; top: 0; z-index: 1; user-select: none; }
th.sort { cursor: pointer; } th.sort:hover { color: var(--ink); }
td { padding: 7px 10px; border-bottom: 1px solid var(--line2); vertical-align: top; }
.tbox td { white-space: nowrap; max-width: 380px; overflow: hidden; text-overflow: ellipsis; }
tbody tr { cursor: default; }
tbody tr:hover td { background: var(--row); }
tbody tr.sel td { background: var(--sel); }
tr.del td { color: var(--faint); text-decoration: line-through; }
tfoot td { position: sticky; bottom: 0; background: var(--th); font-weight: 600; border-top: 1px solid var(--line); }
.more { padding: 10px; text-align: center; }
.filt { flex: 0 1 260px; max-width: 280px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.filt h4 { margin: 0; font-size: 14px; }
.lwrap.nofilt .filt { display: none; }
/* список занимает всё свободное место окна по высоте (как в 1С) */
@media (min-width: 761px) { .lwrap > .tbox.mlist { height: calc(100vh - 172px); max-height: none; min-height: 320px; } .lwrap > .filt { max-height: calc(100vh - 172px); overflow: auto; } }
.btn.on { background: var(--acc-l); border-color: var(--acc); color: var(--acc-d); }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--field); background: var(--surface); font-size: 13px; }
.pill.on { background: var(--acc); border-color: var(--acc); color: var(--on-acc); }

/* форма */
.fwrap { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.fmain { flex: 999 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.fside { flex: 1 1 260px; max-width: 320px; display: flex; flex-direction: column; gap: 12px; }
.grid { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px 16px; }
.fld { display: flex; flex-direction: column; gap: 4px; min-width: 0; position: relative; }
.fld.wide { grid-column: 1 / -1; }
.fld > span { font-size: 12px; color: var(--muted); }
.fld > span .req { color: var(--neg); }
.inp { height: 32px; border: 1px solid var(--field); border-radius: 6px; background: var(--surface); padding: 0 10px; width: 100%; min-width: 0; outline: none; }
.inp:focus { border-color: var(--acc); box-shadow: 0 0 0 3px rgba(14,110,98,.15); }
.inp[readonly] { background: var(--th); }
textarea.inp { height: 64px; padding: 6px 10px; resize: vertical; }
.fld.err .inp { border-color: var(--neg); }
.fld .msg { font-size: 12px; color: var(--neg); }
.refw { display: flex; gap: 2px; align-items: center; }
.refw .inp { flex: 1; }
.chk { display: flex; align-items: center; gap: 8px; height: 32px; }
.chk input { width: 16px; height: 16px; accent-color: var(--acc); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line2); }
.kv:last-child { border-bottom: 0; }
.note { padding: 10px; border-radius: 6px; font-size: 13px; line-height: 1.45; }
.note.warn { background: var(--warn-bg); color: var(--warn); }
.note.info { background: var(--info-bg); color: var(--info); }
.note.ok { background: var(--acc-l); color: var(--acc-d); }
.tabs { display: flex; gap: 20px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.tabs span { padding: 9px 2px; border-bottom: 2px solid var(--acc); font-weight: 500; }

/* окна поверх */
.modal-bg { position: fixed; inset: 0; background: rgba(15,25,34,.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 60; }
.modal { width: 100%; max-width: 480px; background: var(--surface); border-radius: 10px; box-shadow: 0 16px 40px rgba(15,25,34,.25); }
.modal header { display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.modal header h2 { margin: 0; font-size: 17px; }
.modal header .ico { margin-left: auto; }
.modal .mb { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.modal footer { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid var(--line); }
.toast { position: fixed; right: 16px; bottom: 16px; max-width: calc(100vw - 32px); box-sizing: border-box; overflow-wrap: anywhere; background: var(--top); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 80;
  box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: 360px; }
.toast.err { background: var(--neg); }
.placeholder { background: var(--surface); border: 1px dashed var(--field); border-radius: 8px; padding: 28px; color: var(--muted); text-align: center; }

.me-ini { display: none; }
@media (max-width: 860px) {
  .menu-btn { display: inline-flex; }
  .brand small, .topr .rates { display: none; }
  .top { gap: 8px; } .brand > div:last-child { display: none; }
  .me-full { display: none; } .me-ini { display: inline-flex; width: 34px; height: 34px; border-radius: 50%; background: #1D2A36; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
  button.me { padding: 0; background: none; border: 0; }
  .gsearch { flex: 1 1 auto; min-width: 0; }
  .side { position: fixed; top: 52px; bottom: 0; left: 0; z-index: 50; transform: translateX(-100%); transition: transform .15s; overflow: auto; }
  .side.open { transform: none; }
  .main { padding: 12px; }
  .filt, .fside { max-width: none; }
  .tbox { max-height: none; }
}

/* поля формы по группам, как в УНФ */
.grid.grouped { display: block; }
.grid.grouped .fgroup { margin: 14px 0 8px; font-size: 15px; font-weight: 600; color: var(--acc-t); }
.grid.grouped .fgroup:first-child { margin-top: 0; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px 16px; }

/* документ: компактная шапка, большая таблица товаров, итоги и комментарий внизу (как в 1С) */
.grid.dochead { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 14px; padding: 10px 14px; }
.grid.dochead .inp { height: 30px; }
.lines-ed { display: flex; flex-direction: column; min-height: calc(100vh - 400px); }
.lines-scroll { flex: 1; overflow: auto; }
.lines-ed td { padding-top: 4px; padding-bottom: 4px; }
.lines-ed td .inp { height: 30px; }
.grid.fbottom { padding: 10px 14px; }
@media (max-width: 760px) { .lines-ed { min-height: 0; } }
.tabs .tabb { border: 0; background: none; padding: 9px 2px; border-bottom: 2px solid transparent; color: var(--muted); font: inherit; cursor: pointer; }
.tabs .tabb.on { border-bottom-color: var(--acc); color: var(--ink); font-weight: 500; }

/* номенклатура (как в УНФ) */
.ibw { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 12px; align-items: start; }
.ibtable { max-height: calc(100vh - 190px); }
.ibtable td.ibdesc { max-width: 320px; }
.ibside { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 64px; }
.ibtree { max-height: 38vh; overflow: auto; font-size: 13px; }
.ibnode { display: flex; align-items: center; gap: 6px; padding: 4px 8px; cursor: pointer; white-space: nowrap; }
.ibnode:hover { background: var(--row); }
.ibnode.on { background: var(--acc); color: var(--on-acc); }
.ibnode svg { width: 15px; height: 15px; flex-shrink: 0; }
.ibtg { width: 16px; height: 16px; border: 0; background: none; padding: 0; color: inherit; font-size: 13px; line-height: 1; flex-shrink: 0; }
.ibinfo { font-size: 13px; max-height: calc(62vh - 140px); min-height: 160px; overflow: auto; }
.ibinfo .ibtitle { display: block; font-size: 15px; font-weight: 600; color: var(--acc-t); margin-bottom: 8px; text-decoration: none; }
.ibphoto { width: 100%; max-height: 170px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 8px; }
.ibstock { width: 100%; font-size: 13px; }
.ibstock th, .ibstock td { padding: 4px 6px; }
.ibinfo .kv { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
@media (max-width: 1100px) { .ibw { grid-template-columns: 1fr; } .ibside { position: static; } .ibtable { max-height: 60vh; } }
.ibtable td a { text-decoration: none; color: inherit; } .ibtable td a:hover { color: var(--acc-t); text-decoration: underline; }
.cards3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; } .cards3 .kv { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; font-size: 13px; }
/* ABC и панель товара */
.abc-A { background: #2E9E5B; } .abc-B { background: #E5B92E; } .abc-C { background: #D9534F; }
.ibtable td.abcs { width: 6px; padding: 0; } .ibtable td.abcs i { display: block; width: 6px; min-height: 30px; }
.abcl { display: inline-block; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 4px; color: #fff; text-align: center; font-size: 12px; line-height: 20px; font-weight: 700; }
.ibinfo { padding: 0; max-height: none; }
.ibinfo .ibtitle { padding: 12px 14px 2px; margin: 0; cursor: default; user-select: none; }
.ibinfo .tabs { padding: 0 14px; }
.ibpane { padding: 10px 14px 14px; max-height: calc(62vh - 150px); overflow: auto; }
.ibpane h3 { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--acc-t); margin: 2px 0 6px; }
.ibpane .fside { max-width: none; } .ibpane .fside .card { border: 0; padding: 0; }
.ibstock tfoot td { font-weight: 600; border-top: 1px solid var(--line); }
tr.ibprice { cursor: pointer; } tr.ibprice:hover td { background: var(--hl); }
.drop .dropft { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding: 6px 12px; position: sticky; bottom: -4px; background: var(--surface); }
.drop .dropft a { color: var(--acc-t); } .drop .dropft .btn { height: 28px; padding: 0 8px; }
.picker { width: 100%; max-width: 1400px; height: 90vh; background: var(--bg); border-radius: 10px; box-shadow: 0 16px 40px rgba(15,25,34,.3); display: flex; flex-direction: column; overflow: hidden; }
.picker header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.picker header h2 { margin: 0; font-size: 17px; }
.pickbody { flex: 1; overflow: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.pickbody .ibtable { max-height: calc(90vh - 170px); }
.drop .dropft .btn { width: auto; flex-direction: row; display: inline-flex; }
.pos { color: #1E7B45; } .pstbl td { vertical-align: middle; } .pstbl td .inp { height: 30px; }
.signprev { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 8px; text-align: center; background-image: linear-gradient(transparent 70%, #c9d2da 70%, #c9d2da 71%, transparent 71%); } .signprev img { max-width: 100%; max-height: 90px; }
/* прайс-лист */
.plwrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; align-items: start; }
.plside { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 64px; }
.plchk { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.plhead { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; } .plhead h2 { margin: 0; font-size: 20px; }
.pltbl { max-height: calc(100vh - 230px); }
.pltbl tr.plg td { background: var(--th); font-weight: 600; border-top: 1px solid var(--line); }
.pltbl tr.plg0 td { font-size: 15px; background: var(--line2); } .pltbl tr.plg1 td { font-size: 14px; }
@media (max-width: 1000px) { .plwrap { grid-template-columns: 1fr; } .plside { position: static; order: -1; } }
/* меню «Печать ▾», «Доп. расход ▾» */
.popmenu { position: fixed; z-index: 300; background: var(--surface); border: 1px solid var(--field); border-radius: 8px; box-shadow: 0 10px 28px rgba(15,25,34,.18); padding: 4px 0; min-width: 220px; }
.popmenu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 14px; font: inherit; cursor: pointer; white-space: nowrap; }
.popmenu button:hover { background: var(--row); }
.popmenu .popsep { height: 1px; background: var(--line); margin: 4px 0; }
/* реализация: вкладки и доп. расходы */
.stabs { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.stabs > .dtabs { padding: 0 14px; }
.stabs > div > .card { border: 0; border-radius: 0 0 8px 8px; }
.dlv { padding: 14px; display: flex; flex-direction: column; gap: 10px; max-width: 760px; }
.dlv .kv2 { display: grid; grid-template-columns: 150px 1fr; gap: 8px; }
.xsum { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; padding: 10px 14px; background: var(--hl); border-color: var(--hl-b); }
.xchip { display: inline-flex; align-items: center; gap: 4px; }
.xchip .ico { width: 24px; height: 24px; }
.stabs .card > .tabs { display: none; } .stabs .lines-ed > .tabs { display: none; }
/* низ документа как в 1С: комментарий + ответственный */
.grid.fbottom { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 10px 16px; align-items: start; border-top: 1px solid var(--line, #E3E8EE); margin-top: 8px; }
.grid.fbottom > * { grid-column: auto !important; }
.grid.fbottom .fb-text textarea { min-height: 54px; }
@media (max-width: 700px) { .grid.fbottom { grid-template-columns: 1fr; } }
.grid.fbottom .fb-ref .inp { min-width: 0; }
.seg { display: flex; gap: 6px; }
.fside hr { border: 0; border-top: 1px solid var(--line, #E3E8EE); margin: 8px 0; }

/* карточка товара: комплект, сопряжённые детали, аналоги, кросс-номера */
.ilinks { margin-top: 12px; }
.ilinks table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ilinks th, .ilinks td { padding: 6px 8px; border-bottom: 1px solid var(--line, #E3E8EE); text-align: left; }
.iladd { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; flex-wrap: wrap; }
.iladd .grow { flex: 1 1 260px; min-width: 200px; }
.iladd > input, .iladd textarea { flex: 1 1 160px; }
.iladd > input.num { flex: 0 0 80px; }
.modal:has(.hist) { width: min(980px, 96vw); max-width: none; }

.pbar { height: 6px; background: var(--line, #E3E8EE); border-radius: 3px; overflow: hidden; margin-top: 3px; min-width: 80px; }
.pbar i { display: block; height: 100%; background: var(--acc, #0E6E5C); }

/* склад: отбор и размещение */
.wms .wms-scan{font-size:18px;height:44px;flex:1}
.wms .wms-row{display:flex;flex-direction:column;align-items:flex-start;width:100%;height:auto;padding:10px;margin-bottom:6px;text-align:left;gap:2px}
.wms tr.wms-done td{background:#E8F5EE;color:#5b6b63}
.wms tr.wms-short td{background:#FDECEC}
@media (max-width:700px){.wms table td,.wms table th{font-size:14px;padding:8px 6px}}

tr.due td{background:var(--hl)}
/* дни рождения, контактные лица */
.modal.wide { max-width: 860px; }
.modal footer { flex-wrap: wrap; }
.bdwrap { display: grid; grid-template-columns: 1fr 270px; gap: 14px; align-items: start; }
.bdprev canvas { width: 100%; height: auto; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.18); display: block; }
@media (max-width: 700px) { .bdwrap { grid-template-columns: 1fr; } .bdprev { max-width: 260px; } }
.cnt { padding: 6px 4px; border-bottom: 1px solid var(--line2); cursor: pointer; font-size: 13px; }
.cnt:hover { background: var(--row); }
.bdtoday { color: var(--neg); font-weight: 600; }
.bdsoon { color: var(--warn); }

/* состояние документа как в 1С */
.dstate { display: inline-flex; vertical-align: -3px; margin-right: 6px; }
.badge.state { display: inline-flex; align-items: center; gap: 2px; }
.badge.state .dstate { margin-right: 2px; }
.badge.ok { background: #E3F4E8; color: #1F7A3C; }

/* связанные товары плитками (как у Donaldson) */
.ltiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 8px; }
.ltile { position: relative; border: 1px solid var(--line, #e2e5e9); border-radius: 8px; padding: 8px; background: var(--surface); display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.ltile.click { cursor: pointer; }
.ltile.click:hover { border-color: #0f6f5c; box-shadow: 0 1px 6px rgba(0,0,0,.08); }
.ltile-pic { height: 120px; display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 6px; overflow: hidden; }
.ltile-pic img { max-width: 100%; max-height: 120px; object-fit: contain; }
.ltile-nopic { font-size: 34px; opacity: .35; }
.ltile-num { font-weight: 700; margin-top: 4px; }
.ltile-name { color: var(--muted); line-height: 1.25; max-height: 3.8em; overflow: hidden; }
.ltile-note { font-style: italic; color: #8a5a00; font-size: 12px; }
.ltile-qty { font-size: 12px; }
.ltile-av { margin-top: auto; padding-top: 4px; font-size: 12px; }
.ltile-del { position: absolute; top: 4px; right: 4px; background: var(--surface); }

.btn.help-q { width: 28px; height: 28px; min-width: 28px; padding: 0; border-radius: 50%; font-weight: 700; justify-content: center; }
.modal.wide { max-width: 820px; }
.helptext { max-height: 70vh; overflow: auto; font-size: 14px; line-height: 1.5; }
.helptext h1 { font-size: 18px; margin: 0 0 8px; }
.helptext h2 { font-size: 16px; margin: 16px 0 6px; }
.helptext p, .helptext ol { margin: 6px 0; }
.helptext blockquote { margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--acc); background: var(--acc-l); }
.helptext table { border-collapse: collapse; width: 100%; margin: 8px 0; }
.helptext th, .helptext td { border: 1px solid var(--line); padding: 4px 8px; text-align: left; vertical-align: top; }
table.payslip { border-collapse: collapse; width: 100%; max-width: 520px; font-size: 14px; }
table.payslip td { padding: 4px 6px; border-bottom: 1px solid var(--line2); }
.phours { display: flex; gap: 1px; }
.phours span { display: inline-block; width: 6px; height: 14px; background: var(--acc); border-radius: 1px; }

.bell { position: relative; background: none; border: 0; color: inherit; cursor: pointer; padding: 6px; margin-right: 6px; display: inline-flex; align-items: center; }
.bell-cnt { position: absolute; top: 0; right: -2px; background: #d33; color: #fff; border-radius: 9px; font-size: 11px; line-height: 16px; min-width: 16px; padding: 0 4px; text-align: center; font-weight: 700; }
.bell-pop { position: fixed; top: 52px; right: 12px; width: min(420px, calc(100vw - 24px)); max-height: 70vh; display: flex; flex-direction: column; background: var(--surface); color: var(--ink); border-radius: 10px; box-shadow: 0 16px 40px rgba(15,25,34,.3); z-index: 70; }
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.bell-list { overflow: auto; }
.bell-item { padding: 8px 12px; border-bottom: 1px solid var(--line2); cursor: pointer; }
.bell-item:hover { background: var(--acc-l); }
.bell-item.unread { border-left: 3px solid var(--acc); }
.bell-item.unread .bell-t { font-weight: 700; }
.bell-x { font-size: 12px; color: var(--muted, #667); white-space: pre-wrap; max-height: 3.6em; overflow: hidden; }
.bell-at { font-size: 11px; color: var(--faint, #99a); margin-top: 2px; }
.logo-img { width: 32px; height: 32px; border-radius: 50%; object-fit: contain; background: #fff; flex-shrink: 0; }
.card.bkaud.bad { border-left: 4px solid #d33; }
.card.bkaud.ok { border-left: 4px solid var(--acc); }
/* кнопка «?» — вся инструкция по программе УУ */
.help-top { border: 1.5px solid #8FA3B5 !important; border-radius: 50% !important; width: 28px; height: 28px; padding: 0 !important; color: #E6EEF5 !important; font-weight: 700; font-size: 15px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.help-top:hover { background: rgba(255,255,255,.12) !important; }
/* «Моя зарплата» + прогноз бонуса рядом */
.payrow { display: flex; gap: 32px; flex-wrap: wrap; align-items: flex-start; }
.payrow > .paycol, .payrow > .payslip, .payrow > .bfc { flex: 1 1 380px; max-width: 560px; }
.payrow h4.payhead { margin: 0 0 8px; font-size: 15px; line-height: 1.35; min-height: 2.7em; }
.payrow table.payslip { max-width: none; }
.bfc:empty { display: none; }
/* первый столбец (контрагент / группировка) не уезжает при прокрутке вправо */
table.stick1 th:first-child, table.stick1 td:first-child { position: sticky; left: 0; z-index: 2; background: var(--surface, #fff); box-shadow: 1px 0 0 var(--line, #dde3ea); }
table.stick1 thead th:first-child { z-index: 4; background: var(--th); }
table.stick1 tfoot td:first-child { z-index: 3; background: var(--th); }
table.stick1 td:first-child { min-width: 180px; max-width: 320px; }
table.stick1 tbody tr:hover td:first-child { background: var(--row); }

/* процент выполнения и подзадачи */
.pbar{position:relative;flex:1;min-width:120px;max-width:320px;height:18px;border-radius:9px;background:var(--line,#e5e7eb);overflow:hidden}
.pbar.sm{height:12px;min-width:80px;max-width:160px;flex:0 0 140px}
.pbar .pfill{height:100%;background:var(--accent,#0f766e);opacity:.85}
.pbar .pfill.full{background:#16a34a}
.pbar span{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:600;color:var(--ink)}
.pbar.sm span{font-size:9px}
.tchecks .tcheck{display:flex;align-items:center;gap:6px;padding:5px 0;border-bottom:1px solid var(--line)}
.tchecks .ttxt.done{text-decoration:line-through;color:var(--muted,#6b7280)}

/* Интерфейс, а не текст: шапка, меню, заголовки, кнопки и подписи не выделяются и не показывают мигающий курсор
   (курсор в тексте бывает при включённом в Chrome «режиме курсора» — F7). Курсор — только в полях ввода. */
body { caret-color: transparent; }
input, textarea, select, [contenteditable="true"] { caret-color: auto; }
.top, .brand, .side, nav, .vh, .vh h1, .bar, .btn, button, label > span, .fld > span, th, .card h3, .card h4, .kpi small, .badge, .tabs, .links {
  -webkit-user-select: none; user-select: none;
}


/* реализации без ЭСФ — подсветка в списке */
tr.noesf td { background: var(--hl2); }
tr.noesf.sel td { background: var(--sel, #d9efe9); }

/* ===== Оформление на выбор (имя вверху → «Оформление»). Классическое — выше; «Как в дашборде» — светлое и тёмное ===== */
:root[data-theme^="dash"] {
  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif; --hfont: 'Unbounded', 'Onest', system-ui, sans-serif;
  --mono: 'Onest', system-ui, sans-serif; --rad: 10px;
}
:root[data-theme^="dash"] .num, :root[data-theme^="dash"] .mono, :root[data-theme^="dash"] .kpi b { font-variant-numeric: tabular-nums; }
:root[data-theme^="dash"] .vh h1 { font-size: 19px; letter-spacing: -.01em; }
:root[data-theme^="dash"] th { text-transform: uppercase; letter-spacing: .04em; font-size: 11px; font-weight: 600; }
:root[data-theme^="dash"] .card h3 { letter-spacing: .06em; }
:root[data-theme^="dash"] .top { box-shadow: inset 0 -3px 0 var(--acc); }
:root[data-theme="dash"] {
  --bg: #f4f5f6; --surface: #ffffff; --ink: #15191d; --muted: #4c545c; --faint: #7d858d;
  --line: #e1e4e7; --line2: #eceef0; --field: #cfd4d9;
  --side: #15191d; --side2: #262b31; --side-ink: #c3c9cf; --top: #15191d;
  --acc: #c98a00; --acc-d: #9a6a00; --acc-l: #fbf1da; --acc-t: #8f6200; --on-acc: #15191d; --row: #fbf6ea; --sel: #f6e6bf;
  --neg: #c23a32; --warn-bg: #fdf0d8; --warn: #8a5200; --info-bg: #eaf0f6; --info: #2b4a66;
  --th: #f7f8f9; --hover: #f1f2f4; --hl: #fdf0d8; --hl-b: #efd59a; --hl2: #fde9cf;
}
:root[data-theme="dash-dark"] {
  --bg: #121518; --surface: #1b1f23; --ink: #f1f3f5; --muted: #b7bec5; --faint: #848c94;
  --line: #2c3238; --line2: #24292e; --field: #3a4148;
  --side: #0e1114; --side2: #22272c; --side-ink: #b7bec5; --top: #0e1114;
  --acc: #e0a422; --acc-d: #f0b93a; --acc-l: #2e2614; --acc-t: #e8b443; --on-acc: #15191d; --row: #22272c; --sel: #3a3020;
  --neg: #ef6b62; --warn-bg: #33270f; --warn: #e3a33a; --info-bg: #1c2733; --info: #9cc0e0;
  --th: #20252a; --hover: #262b31; --hl: #33290f; --hl-b: #5a4718; --hl2: #3a2c12;
  color-scheme: dark;
}
:root:is([data-theme="dash-dark"],[data-night]) .stage { background: #2a3038; }
:root:is([data-theme="dash-dark"],[data-night]) .st-КП_отправлено { background: #1d2b40; } :root:is([data-theme="dash-dark"],[data-night]) .st-Частично_оплачен { background: #3a2f12; }
:root:is([data-theme="dash-dark"],[data-night]) .st-Оплачен, :root:is([data-theme="dash-dark"],[data-night]) .st-Отгружен { background: #183324; } :root:is([data-theme="dash-dark"],[data-night]) .st-Отказ { background: #3a1f1d; }
:root:is([data-theme="dash-dark"],[data-night]) .badge.ok { background: #183324; color: #6fd29a; }
:root:is([data-theme="dash-dark"],[data-night]) .cpbal .risk.grey { background: #33270f; color: #e3a33a; } :root:is([data-theme="dash-dark"],[data-night]) .cpbal .risk.black { background: #3a1f1d; color: #ef6b62; }
:root:is([data-theme="dash-dark"],[data-night]) .cpbal .pos, :root:is([data-theme="dash-dark"],[data-night]) .pos { color: #4cc07f; }
:root:is([data-theme="dash-dark"],[data-night]) .wms tr.wms-done td { background: #183324; color: #a9c9b5; } :root:is([data-theme="dash-dark"],[data-night]) .wms tr.wms-short td { background: #3a1f1d; }
:root:is([data-theme="dash-dark"],[data-night]) .modal-bg { background: rgba(0,0,0,.6); }
:root:is([data-theme="dash-dark"],[data-night]) .inp:focus { box-shadow: 0 0 0 3px rgba(224,164,34,.25); }
:root[data-theme="dash"] .inp:focus { box-shadow: 0 0 0 3px rgba(201,138,0,.2); }
.thpick { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.thpick button { border: 2px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); padding: 8px; text-align: left; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.thpick button.on { border-color: var(--acc); }
.thpick i { display: flex; height: 54px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.thpick i b { display: block; width: 26%; } .thpick i u { flex: 1; display: flex; flex-direction: column; gap: 5px; padding: 7px 6px; }
.thpick i s { display: block; height: 8px; border-radius: 3px; text-decoration: none; }
.thpick small { color: var(--muted); }

/* «Во весь экран»: без левого меню */
.shell.wide .side { display: none; }
.shell.wide .menu-btn { display: none; }
.shell.wide .main { padding-left: 14px; padding-right: 14px; }

/* платёжный календарь — таблица по статьям (как в дашборде) */
.pt-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--rad); }
table.pt { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
table.pt th, table.pt td { padding: 6px 8px; border-bottom: 1px solid var(--line2); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.pt th { position: sticky; top: 0; background: var(--th); z-index: 2; font-size: 12px; }
table.pt th small { display: block; font-weight: 400; color: var(--faint); font-size: 11px; text-transform: none; letter-spacing: 0; }
table.pt .stk { position: sticky; left: 0; background: var(--surface); text-align: left; z-index: 1; min-width: 210px; box-shadow: 1px 0 0 var(--line); }
table.pt th.stk { z-index: 3; background: var(--th); }
table.pt td.c { cursor: pointer; } table.pt td.c:hover { background: var(--row); }
table.pt .z { color: var(--faint); }
table.pt .od { background: var(--hl2); } table.pt th.od { background: var(--hl); }
table.pt .we { color: var(--faint); }
table.pt tr.grp td { font-weight: 700; color: var(--acc-t); background: var(--surface); padding-top: 10px; }
table.pt tr.cp td { font-size: 12px; color: var(--muted); } table.pt tr.cp td.stk { padding-left: 34px; }
table.pt tr.rv td { color: var(--faint); font-style: italic; }
table.pt tr.tt td { font-weight: 600; border-top: 1px solid var(--line); } table.pt tr.tt.sub td { font-weight: 400; color: var(--muted); border-top: 0; }
table.pt tr.tt.in td:not(.stk) { color: var(--acc-t); }
table.pt tr.en td { font-weight: 700; border-top: 2px solid var(--line); }
table.pt tr.en td.low { color: var(--warn); background: var(--warn-bg); } table.pt tr.en td.gap { color: #fff; background: var(--neg); }
table.pt .tgl { display: inline-block; width: 18px; border: 0; background: none; padding: 0; color: var(--muted); cursor: pointer; font: inherit; }
.pc-det { margin-top: 10px; }

/* справка с поиском */
.helpq { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px 0 4px; border: 1px solid rgba(255,255,255,.25); border-radius: 16px; background: none; color: #E6EEF5; font-size: 13px; cursor: pointer; }
.helpq:hover { background: rgba(255,255,255,.12); }
.helpq-i { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid #8FA3B5; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
@media (max-width: 860px) { .helpq-t { display: none; } .helpq { padding: 0 4px; border: 0; } }
.hsr { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; max-height: 62vh; overflow: auto; }
.hsr-it { text-align: left; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); padding: 8px 10px; cursor: pointer; font: inherit; }
.hsr-it:hover { border-color: var(--acc); background: var(--row); }

/* «Главное»: настройка блоков с кнопками */
.hb-list { display: flex; flex-direction: column; gap: 4px; }
.hb-it { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); cursor: grab; }
.hb-it.drag { opacity: .5; } .hb-it.over { border-color: var(--acc); box-shadow: 0 -2px 0 var(--acc); }
.hb-it .ico { width: 24px; height: 24px; }
.hb-grip { color: var(--faint); cursor: grab; }
.hb-edit { border-style: dashed; }

/* ===== Оформление «Как в Kaspi»: белое, красные акценты ===== */
:root[data-theme="kaspi"] {
  --bg: #F3F4F6; --surface: #FFFFFF; --ink: #1F1F1F; --muted: #6B7280; --faint: #9CA3AF;
  --line: #ECEEF1; --line2: #F3F4F6; --field: #D9DDE3;
  --side: #FFFFFF; --side2: #F3F4F6; --side-ink: #1F1F1F; --top: #F14635;
  --acc: #F14635; --acc-d: #D63A2A; --acc-l: #FDECEA; --acc-t: #D63A2A; --on-acc: #fff; --row: #FFF5F3; --sel: #FDE1DC;
  --neg: #D92D20; --warn-bg: #FFF4E5; --warn: #8A4B00; --info-bg: #EEF3FB; --info: #2B4A66;
  --th: #FAFAFB; --hover: #F6F7F9; --hl: #FFF4E5; --hl-b: #F5D9A6; --hl2: #FFEDE6; --rad: 14px;
  --font: -apple-system, 'SF Pro Text', 'Roboto', 'Segoe UI', system-ui, sans-serif; --mono: var(--font);
}
:root:is([data-theme="kaspi"],[data-theme="donaldson"]) .num, :root:is([data-theme="kaspi"],[data-theme="donaldson"]) .kpi b { font-variant-numeric: tabular-nums; }
:root:is([data-theme="kaspi"],[data-theme="donaldson"]) .card, :root:is([data-theme="kaspi"],[data-theme="donaldson"]) .kpi { border: 0; box-shadow: 0 1px 3px rgba(16,24,40,.06); }
:root:is([data-theme="kaspi"],[data-theme="donaldson"]) .card h3 { color: var(--ink); text-transform: none; letter-spacing: 0; font-size: 16px; font-weight: 700; }
:root:is([data-theme="kaspi"],[data-theme="donaldson"]) .gsearch label { background: rgba(255,255,255,.22); color: #fff; border-radius: 10px; }
:root:is([data-theme="kaspi"],[data-theme="donaldson"]) .gsearch input::placeholder { color: rgba(255,255,255,.85); }
:root:is([data-theme="kaspi"],[data-theme="donaldson"]) .topr, :root:is([data-theme="kaspi"],[data-theme="donaldson"]) .brand small { color: #FFE3DE; }
:root:is([data-theme="kaspi"],[data-theme="donaldson"]) .me-ini, :root:is([data-theme="kaspi"],[data-theme="donaldson"]) .topr .me:hover { background: rgba(255,255,255,.22); }
:root:is([data-theme="kaspi"],[data-theme="donaldson"]) .side { border-right: 1px solid var(--line); }
:root:is([data-theme="kaspi"],[data-theme="donaldson"]) .nav:hover { color: var(--ink); }
:root:is([data-theme="kaspi"],[data-theme="donaldson"]) .side hr { background: var(--line); }
:root:is([data-theme="kaspi"],[data-theme="donaldson"]) .win > button:first-child { color: var(--muted); }
:root:is([data-theme="kaspi"],[data-theme="donaldson"]) .win.on > button:first-child, :root:is([data-theme="kaspi"],[data-theme="donaldson"]) .win:hover > button:first-child { color: var(--ink); }
:root:is([data-theme="kaspi"],[data-theme="donaldson"]) .btn { border-radius: 10px; }

/* ===== Телефон: нижнее меню, плитки сервисов, списки карточками (как в приложении Kaspi) ===== */
.bnav { display: none; }
.links .ti { display: none; }
@media (max-width: 760px) {
  .menu-btn { display: none !important; }
  .bnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; background: var(--surface); border-top: 1px solid var(--line);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); box-shadow: 0 -2px 12px rgba(0,0,0,.05); }
  .bnav button { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: none;
    color: var(--faint); font-size: 11px; padding: 6px 0 4px; min-height: 52px; }
  .bnav button .i { width: 24px; height: 24px; }
  .bnav button.on { color: var(--acc); font-weight: 600; }
  .bnav em { position: absolute; top: 2px; left: calc(50% + 6px); font-style: normal; background: var(--neg); color: #fff; font-size: 10px; font-weight: 700;
    min-width: 17px; height: 17px; border-radius: 9px; padding: 0 4px; display: flex; align-items: center; justify-content: center; }
  .bnav em.grey { background: var(--faint); }
  .main { padding: 12px 12px calc(84px + env(safe-area-inset-bottom)); }
  .side { top: 52px; bottom: calc(60px + env(safe-area-inset-bottom)); width: 86vw; max-width: 340px; box-shadow: 8px 0 24px rgba(0,0,0,.18); }
  .nav { padding: 12px 14px; font-size: 15px; }
  .toast { bottom: calc(74px + env(safe-area-inset-bottom)); right: 12px; left: 12px; max-width: none; }

  /* «Главное»: сервисы плитками */
  .mtiles { display: flex; flex-direction: column; gap: 12px; }
  .mtiles .card.hbk { border-radius: 16px; padding: 14px 10px 6px; }
  .mtiles .card.hbk h3 { padding: 0 6px; }
  .mtiles .links { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 4px; }
  .mtiles .links button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 2px 10px; font-size: 12px; line-height: 1.2;
    text-align: center; color: var(--ink); text-decoration: none !important; }
  .mtiles .links .ti { display: flex; width: 52px; height: 52px; border-radius: 16px; align-items: center; justify-content: center; font-size: 26px; font-style: normal;
    background: color-mix(in srgb, var(--tc) 14%, var(--surface)); }
  .mtiles .hb-edit { border-radius: 16px; }
  .kpis { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .kpis > .kpi { flex: 0 0 78%; scroll-snap-align: start; border-radius: 16px; }
  .vh h1 { font-size: 22px; font-weight: 700; }

  /* карточки на «Главном» (задачи, звонки, дни рождения): строки — блоками, без широкой таблицы */
  .card.calls .tbox, .card .tbox[style*="max-height"] { max-height: none !important; overflow: visible; }
  .card.calls table, .card.calls tbody { display: block; }
  .card.calls tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid var(--line2); }
  .card.calls td { border: 0 !important; padding: 0 !important; white-space: normal !important; background: none !important; }
  .card.calls td:first-child { flex: 1 1 100%; }

  /* разделы: пункты меню строками со стрелкой */
  .sec { grid-template-columns: 1fr; }
  .sec .card { border-radius: 16px; padding: 12px 0 4px; }
  .sec .card h3 { padding: 0 16px; }
  .sec .links button, .sec .links .soon { position: relative; width: 100%; padding: 13px 40px 13px 16px; border-top: 1px solid var(--line2); font-size: 15px; text-decoration: none !important; }
  .sec .links button::after { content: '›'; position: absolute; right: 16px; top: 50%; transform: translateY(-52%); font-size: 22px; color: var(--faint); }

  /* списки документов и справочников — карточками */
  .mlist { border: 0; background: none; overflow: visible; }
  .mlist table, .mlist tbody { display: block; width: 100%; }
  .mlist thead { display: none; }
  .mlist tbody tr { display: block; background: var(--surface); border-radius: 16px; margin: 0 0 10px; padding: 12px 14px; box-shadow: 0 1px 3px rgba(16,24,40,.06); }
  .mlist tbody tr.sel td { background: none; }
  .mlist tbody td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border: 0 !important; padding: 3px 0 !important;
    white-space: normal !important; text-align: right; background: none !important; font-size: 14px; }
  .mlist tbody td::before { content: attr(data-l); color: var(--muted); font-size: 12px; text-align: left; flex-shrink: 0; font-family: var(--font); }
  .mlist tbody tr { display: flex; flex-direction: column; }
  .mlist tbody td.ttl { order: -1; font-size: 17px; font-weight: 700; justify-content: flex-start; text-align: left; padding-bottom: 6px !important; }
  .mlist tbody td.ttl::before { display: none; }
  .mlist tbody td.ttl a { text-decoration: none; color: var(--ink); }
  .mlist tbody td.em { display: none; }
  .mlist tbody td[colspan] { justify-content: center; }
  .mlist tbody td[colspan]::before { display: none; }
  .mlist tfoot { display: block; } .mlist tfoot tr { display: flex; gap: 10px; padding: 4px 6px; } .mlist tfoot td { border: 0; padding: 0; }
  .mlist tfoot td:empty { display: none; }
  .lsearch { flex: 1 1 100%; margin-left: 0; height: 42px; border-radius: 12px; order: -1; }
  .lsearch input { font-size: 16px; }
  .view.on .fabnew { position: fixed; right: 16px; bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 44; width: 56px; height: 56px; border-radius: 50%;
    padding: 0; justify-content: center; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
  .view.on .fabnew span { display: none; }
  .view.on .fabnew .i { width: 26px; height: 26px; }
  .modal-bg { align-items: flex-end; padding: 0; }
  .modal { border-radius: 18px 18px 0 0; max-height: 92vh; width: 100%; }
}

/* ===== Оформление «Сине-жёлтое»: тёмно-синяя шапка, жёлтые акценты ===== */
:root[data-theme="donaldson"] {
  --bg: #F2F4F7; --surface: #FFFFFF; --ink: #0F1E33; --muted: #5A6779; --faint: #8A96A6;
  --line: #E3E7ED; --line2: #EEF1F5; --field: #CDD4DE;
  --side: #FFFFFF; --side2: #EEF2F8; --side-ink: #0F1E33; --top: #002B5C;
  --acc: #003A70; --acc-d: #002B5C; --acc-l: #E6EEF7; --acc-t: #003A70; --on-acc: #fff; --row: #F3F7FC; --sel: #DCE7F4;
  --neg: #C62828; --warn-bg: #FFF6DB; --warn: #7A5200; --info-bg: #EAF0F7; --info: #23446B;
  --th: #F7F9FB; --hover: #F2F5F9; --hl: #FFF6DB; --hl-b: #FFD54F; --hl2: #FFF1C4; --rad: 12px;
  --font: -apple-system, 'Segoe UI', 'Roboto', system-ui, sans-serif; --mono: var(--font);
}
:root[data-theme="donaldson"] .top { box-shadow: inset 0 -4px 0 #FFC72C; }
:root[data-theme="donaldson"] .topr, :root[data-theme="donaldson"] .brand small { color: #C9D6E6; }
:root[data-theme="donaldson"] .btn.p { background: #FFC72C; border-color: #FFC72C; color: #002B5C; font-weight: 600; }
:root[data-theme="donaldson"] .btn.p:hover { background: #F5B800; }
:root[data-theme="donaldson"] .nav.on { background: #002B5C; color: #fff; box-shadow: inset 4px 0 0 #FFC72C; }
:root[data-theme="donaldson"] .card h3 { border-left: 4px solid #FFC72C; padding-left: 8px; }
:root[data-theme="donaldson"] .bnav button.on { color: #002B5C; }
:root[data-theme="donaldson"] .bnav button.on .i { color: #002B5C; filter: drop-shadow(0 2px 0 #FFC72C); }

/* вкладки (Аналоги, Кросс-номера, Применяемость…) — листаются пальцем, страница не уезжает вбок */
.tabs { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; }
.tabs .tabb { white-space: nowrap; flex-shrink: 0; }
@media (max-width: 760px) {
  html, body { overflow-x: hidden; }
  .shell, .body, .main, .view { min-width: 0; max-width: 100vw; }
  .view .card, .view .tbox, .view form, .view .grid { max-width: 100%; min-width: 0; }
}
@media (max-width: 760px) {
  .view .btn { max-width: 100%; white-space: normal; height: auto; min-height: 32px; text-align: left; }
  .view .bar > *, .view .vh > * { max-width: 100%; min-width: 0; overflow-wrap: anywhere; }
}

/* ===== Телефон: каталог товаров плитками, карточка товара, корзина (как в Kaspi) ===== */
.ibgrid, .ibchips, .ibcart { display: none !important; }
@media (max-width: 760px) {
  .ibgrid { display: grid !important; grid-template-columns: 1fr 1fr; gap: 10px; }
  .ibw > .ibtable, .ibw > .ibside { display: none !important; }
  .ibw { display: block; }
  .ibcard { background: var(--surface); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 1px 3px rgba(16,24,40,.06); cursor: pointer; min-width: 0; }
  .ibph { position: relative; aspect-ratio: 1 / 1; background: #fff; display: flex; align-items: center; justify-content: center; }
  .ibph img { width: 100%; height: 100%; object-fit: contain; }
  .noph { font-size: 52px; opacity: .35; }
  .stk { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 8px; white-space: nowrap; }
  .ibph .stk { position: absolute; left: 6px; bottom: 6px; }
  .stk.ok { background: #2E9B4F; color: #fff; } .stk.tr { background: #F2C94C; color: #3a2a00; } .stk.no { background: #E4E7EB; color: #59636e; }
  .ibpr { font-size: 19px; font-weight: 800; padding: 8px 10px 0; font-variant-numeric: tabular-nums; }
  .ibnm { font-size: 13px; line-height: 1.3; padding: 4px 10px 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 34px; }
  .ibft { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 8px 10px 10px; margin-top: auto; font-size: 12px; min-width: 0; }
  .ibft .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ibadd { position: absolute; right: 6px; bottom: 6px; width: 46px; height: 40px; border: 0; border-radius: 12px; background: #12A150; color: #fff; font-size: 19px; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
  .ibchips { display: flex !important; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
  .ibchips::-webkit-scrollbar { display: none; }
  .chip { flex-shrink: 0; border: 0; background: var(--surface); border-radius: 12px; padding: 9px 14px; font-size: 14px; white-space: nowrap; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
  .chip.on { background: var(--acc); color: var(--on-acc); font-weight: 600; }
  .chip.back { background: var(--line2); }
  .ibcart { display: flex !important; position: fixed; left: 10px; right: 10px; bottom: calc(68px + env(safe-area-inset-bottom)); z-index: 44; background: var(--top); color: #fff;
    border-radius: 16px; padding: 8px 8px 8px 14px; align-items: center; gap: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
  .ibcart[hidden] { display: none !important; }
  .ibcart .ibc-info { flex: 1; background: none; border: 0; color: #fff; text-align: left; font-size: 14px; }
  .view .ibcart .btn.p { height: 42px; border-radius: 12px; }
  /* карточка товара */
  .isph { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; background: #fff; border-radius: 16px; aspect-ratio: 1 / 1; align-items: center; justify-content: center; scrollbar-width: none; }
  .isph::-webkit-scrollbar { display: none; }
  .isph img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: contain; scroll-snap-align: center; }
  .isph .noph { font-size: 90px; }
  .isinfo { border-radius: 16px; }
  .ispr { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
  .isprs { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
  .isprs .chip { background: var(--acc-l); color: var(--acc-t); padding: 6px 10px; font-size: 13px; box-shadow: none; }
  .isstk { display: inline-block; font-weight: 700; border-radius: 10px; padding: 6px 10px; margin: 4px 0 8px; }
  .isstk.ok { background: #E3F4E8; color: #1E7A3D; } .isstk.no { background: var(--line2); color: var(--muted); }
  .isnm { font-size: 19px; font-weight: 500; margin: 4px 0; line-height: 1.3; }
  .iswh { margin-top: 10px; border-top: 1px solid var(--line2); padding-top: 6px; }
  .isalts { border-radius: 16px; padding-right: 0; }
  .isarow { display: flex; gap: 10px; overflow-x: auto; padding: 2px 14px 4px 0; scrollbar-width: none; }
  .isarow::-webkit-scrollbar { display: none; }
  .isalt { flex: 0 0 62%; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left; border: 1px solid var(--line); background: var(--surface);
    border-radius: 14px; padding: 10px; font-size: 13px; }
  .isalt b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 500; }
  .isseg { display: flex; background: var(--line2); border-radius: 14px; padding: 4px; margin-bottom: 12px; }
  .isseg button { flex: 1; border: 0; background: none; border-radius: 10px; padding: 10px; font-size: 15px; color: var(--ink); }
  .isseg button.on { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.1); font-weight: 600; }
  .isdesc { white-space: pre-wrap; line-height: 1.5; font-size: 15px; }
  .isdesc.clamp { max-height: 9.5em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
  .ismore { display: block; margin: 6px auto 0; border: 0; background: none; font-size: 16px; font-weight: 600; color: var(--ink); }
  .isprops .kv { padding: 8px 0; border-bottom: 1px solid var(--line2); gap: 12px; }
  .isprops .kv b { font-weight: 500; text-align: right; }
  .isbuy { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 5; display: grid; grid-template-columns: auto 1fr 1fr; gap: 8px; align-items: center;
    background: var(--bg); padding: 8px 0; }
  .isq { display: flex; align-items: center; gap: 4px; }
  .isq .btn { width: 30px; min-width: 30px; justify-content: center; padding: 0; }
  .view .isbuy .btn.go, .view .isbuy .btn.p { height: 50px; border-radius: 14px; justify-content: center; text-align: center; font-size: 15px; font-weight: 600; white-space: nowrap; padding: 0 8px; }
  .view .isbuy .btn.go { background: #12A150; border-color: #12A150; color: #fff; }
  .view .isbuy .btn.p { background: #0B6FD6; border-color: #0B6FD6; color: #fff; }
}
@media (max-width: 760px) {
  /* каталог на телефоне: лишние кнопки компьютера убраны — остаются «Создать», «Только в наличии», склад и поиск */
  .view .bar button[title^="Создать новый товар копированием"], .view .bar button[title^="Этикетка 58"], .view .bar button[title^="Новый документ «Установка цен»"] { display: none; }
}
.ibview { display: none; }
@media (max-width: 760px) {
  .ibvrow { display: flex; align-items: center; gap: 8px; min-width: 0; }
  .ibvrow .ibchips { flex: 1; min-width: 0; }
  .ibview { display: flex; flex-shrink: 0; background: var(--surface); border-radius: 12px; padding: 3px; gap: 2px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
  .ibview button { width: 36px; height: 34px; border: 0; background: none; border-radius: 9px; font-size: 18px; color: var(--muted); }
  .ibview button.on { background: var(--acc); color: var(--on-acc); }
  /* мелкие плитки — по 3 в ряд */
  .ibgrid.v-small { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .ibgrid.v-small .ibpr { font-size: 14px; padding: 6px 7px 0; }
  .ibgrid.v-small .ibnm { font-size: 11.5px; padding: 3px 7px 0; min-height: 30px; }
  .ibgrid.v-small .ibph { order: 0; } .ibgrid.v-small .ibpr { order: 1; } .ibgrid.v-small .ibft { order: 2; } .ibgrid.v-small .ibnm { order: 3; }
  .ibgrid.v-small .ibft { padding: 2px 7px 0; margin-top: 0; }
  .ibgrid.v-small .ibft .muted { font-size: 11.5px; font-weight: 700; color: var(--ink); }
  .ibgrid.v-small .ibft .lstk { display: none; }
  .ibgrid.v-small .ibnm { -webkit-line-clamp: 2; min-height: 0; color: var(--muted); }
  .ibgrid.v-small .stk { font-size: 9.5px; padding: 2px 5px; left: 4px; bottom: 4px; }
  .ibgrid.v-small .ibadd { width: 32px; height: 30px; font-size: 14px; border-radius: 9px; right: 4px; bottom: 4px; }
  .ibgrid.v-small .stk:not(.ok) { display: none; }
  .ibgrid.v-small .ibcard { border-radius: 12px; padding-bottom: 8px; }
  .ibgrid.v-small .noph { font-size: 34px; }
  /* списком: маленькое фото слева, справа цена, название, наличие */
  .ibgrid.v-list { grid-template-columns: 1fr; gap: 8px; }
  .ibgrid.v-list .ibcard { position: relative; display: block; padding: 10px 62px 10px 14px; border-radius: 14px; }
  .ibgrid.v-list .ibph { display: contents; }
  .ibgrid.v-list .ibph img, .ibgrid.v-list .ibph .noph, .ibgrid.v-list .ibph .stk { display: none; }
  .ibgrid.v-list .ibadd { right: 10px; left: auto; top: 50%; bottom: auto; transform: translateY(-50%); width: 42px; height: 40px; }
  .ibgrid.v-list .ibpr { padding: 0; font-size: 17px; }
  .ibgrid.v-list .ibnm { padding: 2px 0 0; min-height: 0; }
  .ibgrid.v-list .ibft { padding: 4px 0 0; }
}
.lstk { display: none; }
@media (max-width: 760px) {
  .ibgrid.v-list .lstk { display: inline; font-size: 12px; font-weight: 700; white-space: nowrap; }
  .lstk.ok { color: #1E7A3D; } .lstk.no { color: var(--faint); }
}
@media (max-width: 760px) { .ibgrid.v-small .ibpr .muted { font-size: 11px !important; } }

/* ===== Ночной режим — отдельной кнопкой, к любому оформлению (тёмный фон, акценты оформления сохраняются) ===== */
:root[data-night] {
  --bg: #121518; --surface: #1b1f23; --ink: #f1f3f5; --muted: #b7bec5; --faint: #848c94;
  --line: #2c3238; --line2: #24292e; --field: #3a4148;
  --side: #0e1114; --side2: #22272c; --side-ink: #b7bec5; --top: #0e1114;
  --row: #22272c; --sel: #2a3540; --neg: #ef6b62; --warn-bg: #33270f; --warn: #e3a33a; --info-bg: #1c2733; --info: #9cc0e0;
  --th: #20252a; --hover: #262b31; --hl: #33290f; --hl-b: #5a4718; --hl2: #3a2c12;
  color-scheme: dark;
}
:root[data-night]:not([data-theme]) { --acc: #12917f; --acc-d: #1aa894; --acc-l: #14302b; --acc-t: #4fc3ae; }
:root[data-night][data-theme="kaspi"] { --acc: #F14635; --acc-l: #3a1c18; --acc-t: #ff7b6b; --top: #1a1012; }
:root[data-night][data-theme="kaspi"] .top { box-shadow: inset 0 -3px 0 #F14635; }
:root[data-night][data-theme="donaldson"] { --acc: #2f6fb3; --acc-d: #3d82cc; --acc-l: #18273a; --acc-t: #FFC72C; --top: #0b1830; }
:root[data-night][data-theme="donaldson"] .card h3 { color: #FFC72C; }
:root[data-night] .ibph, :root[data-night] .isph { background: #f4f5f6; }
:root[data-night] .stk.no { background: #2c3238; color: #b7bec5; }
:root[data-night] .isstk.ok { background: #183324; color: #6fd29a; }
:root[data-night] .chip { background: var(--surface); color: var(--ink); }
:root[data-night] .chip.on { background: var(--acc); color: var(--on-acc); }
:root[data-night] .thpick button { color: var(--ink); }
.nightpick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.nightpick button { border: 2px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 12px; padding: 10px 8px; text-align: left; display: flex; flex-direction: column; gap: 4px; }
.nightpick button.on { border-color: var(--acc); }
.nightpick small { color: var(--muted); font-size: 12px; }
@media (max-width: 520px) { .nightpick { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .ibgrid .ibft .muted { font-weight: 600; color: var(--ink); opacity: .75; } .ibview button { display: flex; align-items: center; justify-content: center; } }
/* ===== Телефон: строка сортировки и фильтров каталога (как в Kaspi) ===== */
.ibfbar, .ibfchips { display: none; }
@media (max-width: 760px) {
  .view .ibbar > *:not(.lsearch) { display: none !important; }
  .ibvrow .ibchips { display: none !important; }
  .ibfbar { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
  .fbtn { position: relative; flex-shrink: 0; width: 44px; height: 42px; border: 0; border-radius: 14px; background: var(--surface); color: var(--ink);
    display: flex; align-items: center; justify-content: center; font-size: 22px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
  .fbtn .svgi { display: flex; }
  .fcnt { position: absolute; top: -4px; right: -4px; font-style: normal; background: var(--neg); color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px;
    border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
  .fcnt[hidden] { display: none; }
  .ibfchips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
  .ibfchips:empty { display: none; }
  .ibfbar .grow { flex: 1; }
  .ibfchips::-webkit-scrollbar { display: none; }
  .ibfchips .chip { padding: 9px 12px; font-size: 13px; }
  .fpanel h4 { margin: 14px 0 8px; font-size: 15px; }
  .fpanel h4:first-child { margin-top: 0; }
  .fchipset { display: flex; flex-wrap: wrap; gap: 8px; }
  .fpanel .chip { background: var(--line2); box-shadow: none; }
  .fpanel .chip.on { background: var(--acc); color: var(--on-acc); }
  .fprice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .fprice .inp { height: 44px; font-size: 16px; }
  .modal .mb:has(.fpanel) { max-height: 70vh; overflow: auto; }
  .modal footer:has(+ *), .modal footer { gap: 10px; }
  .sortlist { display: flex; flex-direction: column; }
  .sortlist button { border: 0; background: none; text-align: left; padding: 14px 4px; font-size: 16px; border-bottom: 1px solid var(--line2); color: var(--ink); }
  .sortlist button.on { font-weight: 700; color: var(--acc-t); }
  .sortlist button.on::after { content: ' ✓'; }
}
.ibtype { display: inline-block; margin-top: 3px; font-size: 11px; font-weight: 700; color: var(--warn); background: var(--warn-bg); border-radius: 6px; padding: 1px 6px; }
/* длинные окна (Оформление, Фильтры, Корзина…) — содержимое прокручивается, заголовок и кнопки на месте */
.modal { display: flex; flex-direction: column; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); }
.modal > header, .modal > footer { flex-shrink: 0; }
.modal > .mb { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
@media (max-width: 760px) { .modal { max-height: 92vh; max-height: 92dvh; } }
.agas { display: flex; flex-direction: column; gap: 6px; }
.agas:empty { display: none; }
.agas-h { padding: 8px 12px; border-radius: 10px; font-size: 15px; }
.agas-h.green { background: #E3F4E8; color: #1E7A3D; } .agas-h.yellow { background: var(--warn-bg); color: var(--warn); } .agas-h.red { background: #FDE8E7; color: var(--neg); }
:root[data-night] .agas-h.green, :root[data-theme="dash-dark"] .agas-h.green { background: #183324; color: #6fd29a; }
:root[data-night] .agas-h.red, :root[data-theme="dash-dark"] .agas-h.red { background: #3a1f1d; }
.agas-t { width: 100%; border-collapse: collapse; font-size: 13px; }
.agas-t td, .agas-t th { padding: 4px 6px; border-bottom: 1px solid var(--line2); text-align: left; }
.agas-t th { font-weight: 600; color: var(--muted); font-size: 12px; }
.agas-why { margin: 0; padding-left: 18px; font-size: 13px; }
.agas-why li { margin: 2px 0; }
.pwbox { position: relative; display: flex; }
.pwbox .inp { flex: 1; padding-right: 44px; }
.pweye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 30px; border: 0; background: none; font-size: 17px; cursor: pointer; opacity: .7; }
.pweye:hover { opacity: 1; }
.lg-card .pwbox .inp { width: 100%; }
/* свои настройки форм и таблиц («Изменить форму») */
.lhid { display: none !important; }
th.ldrag { position: relative; cursor: grab; }
th.ldrag:active { cursor: grabbing; }
th.ldrop { box-shadow: inset 3px 0 0 var(--acc); }
th .lrsz { position: absolute; top: 0; right: -3px; width: 7px; height: 100%; cursor: col-resize; z-index: 2; }
th .lrsz:hover { background: var(--acc); opacity: .35; }
td.lw { overflow: hidden; text-overflow: ellipsis; }
td.lw .inp, td.lw input, td.lw select { min-width: 0; max-width: 100%; }
.lay-btn { padding: 4px 9px; font-size: 15px; line-height: 1; }
.tabs .lay-btn { margin: 4px 8px; }
.laylist { display: flex; flex-direction: column; gap: 2px; max-height: 60vh; overflow: auto; min-width: 340px; }
.layrow { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg, #fff); }
.layrow.dragging { opacity: .4; }
.layrow label { display: flex; align-items: center; gap: 4px; flex: 1; cursor: pointer; }
.layrow .lgrip { cursor: grab; user-select: none; }
.layrow .laybtns { display: flex; gap: 2px; }
.layrow .laybtns .ico { width: 26px; height: 26px; font-size: 11px; }

/* ===== Оформление «Как в 1С» (интерфейс «Такси» 1С:Предприятия 8.3) — включается каждым пользователем в настройках ===== */
:root[data-theme="onec"]:not([data-night]) {
  --bg: #FFFFFF; --surface: #FFFFFF; --ink: #333333; --muted: #4D4D4D; --faint: #8C8C8C;
  --line: #C9C6B1; --line2: #E6E6E6; --field: #A0A0A0;
  --side: #F6ECA7; --side2: #EED99B; --side-ink: #333333; --top: #F4E9A4;
  --acc: #F5D550; --acc-d: #EBC731; --acc-l: #FBF2D2; --acc-t: #1C4A93; --on-acc: #333333; --row: #FBF2D2; --sel: #FBF2D2;
  --neg: #CC0000; --warn-bg: #FFF7DB; --warn: #6B4A00; --info-bg: #F7F7F2; --info: #4D4D4D;
  --th: #F2F2F2; --hover: #F5F5F5; --hl: #FFF7D6; --hl-b: #F0D77A; --hl2: #FFF1C4; --rad: 0;
  --font: Arial, 'Segoe UI', Helvetica, sans-serif; --hfont: Arial, 'Segoe UI', Helvetica, sans-serif; --mono: Arial, 'Segoe UI', Helvetica, sans-serif;
}
:root[data-theme="onec"]:not([data-night]) body { font-size: 13px; }
:root[data-theme="onec"]:not([data-night]) .num, :root[data-theme="onec"]:not([data-night]) .mono { font-size: 13px; font-variant-numeric: tabular-nums; }
/* шапка — светло-жёлтая, тёмный текст */
:root[data-theme="onec"]:not([data-night]) .top { color: #333; border-bottom: 1px solid #DDB181; height: 40px; }
:root[data-theme="onec"]:not([data-night]) .brand small, :root[data-theme="onec"]:not([data-night]) .topr { color: #6B5E2E; }
:root[data-theme="onec"]:not([data-night]) .topr .me, :root[data-theme="onec"]:not([data-night]) .menu-btn { color: #333; }
:root[data-theme="onec"]:not([data-night]) .topr .me:hover, :root[data-theme="onec"]:not([data-night]) .menu-btn:hover { background: #F5E08A; color: #333; }
:root[data-theme="onec"]:not([data-night]) .gsearch label { background: #FFFFFF; border: 1px solid #D9C277; border-radius: 2px; color: #8C8C8C; height: 28px; }
:root[data-theme="onec"]:not([data-night]) .gsearch input { color: #333; }
/* панель разделов слева */
:root[data-theme="onec"]:not([data-night]) .side { border-right: 1px solid #C9C6B1; }
:root[data-theme="onec"]:not([data-night]) .nav { border-radius: 0; padding: 6px 12px; }
:root[data-theme="onec"]:not([data-night]) .nav:hover { background: #EED99B; color: #333; }
:root[data-theme="onec"]:not([data-night]) .nav.on { background: #EED99B; color: #333; box-shadow: none; font-weight: 700; }
:root[data-theme="onec"]:not([data-night]) .side hr { background: #DCCB85; }
:root[data-theme="onec"]:not([data-night]) .side h6 { color: #8C7A3A; }
:root[data-theme="onec"]:not([data-night]) .win { border-radius: 0; }
:root[data-theme="onec"]:not([data-night]) .win > button:first-child { color: #4D4D4D; }
:root[data-theme="onec"]:not([data-night]) .win.on { background: #EED99B; }
:root[data-theme="onec"]:not([data-night]) .win.on > button:first-child, :root[data-theme="onec"]:not([data-night]) .win:hover > button:first-child { color: #333; }
:root[data-theme="onec"]:not([data-night]) .win .x { color: #8C8C8C; } :root[data-theme="onec"]:not([data-night]) .win .x:hover { color: #333; background: #EAD98F; }
/* заголовок формы — как у 1С: крупно, без жирного */
:root[data-theme="onec"]:not([data-night]) .vh h1 { font-weight: 400; font-size: 22px; color: #333; }
:root[data-theme="onec"]:not([data-night]) .card, :root[data-theme="onec"]:not([data-night]) .stabs, :root[data-theme="onec"]:not([data-night]) .tbox { border-radius: 2px; box-shadow: none; }
:root[data-theme="onec"]:not([data-night]) .card h3 { text-transform: none; letter-spacing: 0; color: #333; font-size: 14px; font-weight: 700; }
/* кнопки: серые с градиентом, основная — жёлтая */
:root[data-theme="onec"]:not([data-night]) .btn { height: 26px; border-radius: 2px; border-color: #B8B8B8; color: #333; background: linear-gradient(#FFFFFF, #F5F5F5); box-shadow: 0 1px 1px rgba(0,0,0,.08); font-size: 13px; }
:root[data-theme="onec"]:not([data-night]) .btn:hover { background: linear-gradient(#FFFFFF, #E2E2E2); border-color: #9C9C9C; }
:root[data-theme="onec"]:not([data-night]) .btn.p { background: linear-gradient(#FCE68A, #F2CF3B); border-color: #C9A20E; color: #333; font-weight: 700; }
:root[data-theme="onec"]:not([data-night]) .btn.p:hover { background: linear-gradient(#FDEB9C, #EDC522); }
:root[data-theme="onec"]:not([data-night]) .btn.on { background: #F9EBA6; border-color: #C9A20E; }
/* поля ввода */
:root[data-theme="onec"]:not([data-night]) .inp { height: 26px; border-radius: 2px; border-color: #B4B4B4; padding: 0 6px; }
:root[data-theme="onec"]:not([data-night]) .inp:focus { border-color: #E2B500; box-shadow: 0 0 0 1px #F5D550; }
:root[data-theme="onec"]:not([data-night]) .inp[readonly], :root[data-theme="onec"]:not([data-night]) .inp:disabled { background: #F7F7F7; }
:root[data-theme="onec"]:not([data-night]) .fld > span { color: #4D4D4D; font-size: 13px; }
/* таблицы: сетка, серая шапка, жёлтая выделенная строка */
:root[data-theme="onec"]:not([data-night]) th { color: #4D4D4D; font-size: 13px; font-weight: 400; text-transform: none; letter-spacing: 0; padding: 4px 6px; background: #F2F2F2; border: 1px solid #D6D6D6; border-top: 0; }
:root[data-theme="onec"]:not([data-night]) td { padding: 4px 6px; border: 1px solid #E6E6E6; border-top: 0; }
:root[data-theme="onec"]:not([data-night]) tbody tr:nth-child(even) td { background: #FAFAFA; }
:root[data-theme="onec"]:not([data-night]) tbody tr:hover td { background: #FDF8E8; }
:root[data-theme="onec"]:not([data-night]) tbody tr.sel td { background: #FBF2D2; }
:root[data-theme="onec"]:not([data-night]) a { color: #1E58A8; }
/* вкладки — «закладки» как в 1С */
:root[data-theme="onec"]:not([data-night]) .tabs { gap: 2px; padding: 6px 8px 0; border-bottom: 1px solid #C8C8C8; }
:root[data-theme="onec"]:not([data-night]) .tabs span, :root[data-theme="onec"]:not([data-night]) .tabs .tabb { padding: 5px 12px; border: 1px solid #C8C8C8; border-bottom: 0; border-radius: 3px 3px 0 0; background: #EDEDED; color: #333; margin-bottom: -1px; font-weight: 400; }
:root[data-theme="onec"]:not([data-night]) .tabs span { background: #FFFFFF; }
:root[data-theme="onec"]:not([data-night]) .tabs .tabb.on { background: #FFFFFF; border-color: #C8C8C8; border-bottom: 1px solid #FFFFFF; font-weight: 400; }
:root[data-theme="onec"]:not([data-night]) .tabs > div { border: 0 !important; background: none !important; padding: 0 !important; }
:root[data-theme="onec"]:not([data-night]) .badge { border-radius: 2px; }
:root[data-theme="onec"]:not([data-night]) .popmenu { border-radius: 2px; }
:root[data-theme="onec"]:not([data-night]) .modal { border-radius: 3px; }
:root[data-theme="onec"]:not([data-night]) .modal header { background: #FBEDB0; }
:root[data-theme="onec"]:not([data-night]) .helpq { color: #333; border-color: #D9C277; border-radius: 3px; }
:root[data-theme="onec"]:not([data-night]) .helpq:hover { background: #F5E08A; }
:root[data-theme="onec"]:not([data-night]) .helpq-i { border-color: #8C7A3A; }
:root[data-theme="onec"]:not([data-night]) .bell { color: #333; }
:root[data-theme="onec"]:not([data-night]) .bell-pop { top: 44px; }
/* реализация без ЭСФ — розоватая, чтобы не путать с выделенной (жёлтой) строкой */
:root[data-theme="onec"]:not([data-night]) tr.noesf td { background: #FCEBEB; }
:root[data-theme="onec"]:not([data-night]) tr.noesf.sel td { background: #F9EBA6; }
:root[data-theme="onec"]:not([data-night]) tfoot td { background: #F2F2F2; }
:root[data-theme="onec"]:not([data-night]) .tabs .tabb.on { font-weight: 700; box-shadow: inset 0 2px 0 #F5D550; }
.bell-foot { border-top: 1px solid var(--line); padding: 8px 12px; display: flex; justify-content: flex-end; }
.linkbtn { border: 0; background: none; color: var(--acc-t); cursor: pointer; padding: 2px 0; font: inherit; font-size: 13px; }
.linkbtn:hover { text-decoration: underline; }

:root[data-theme="onec"]:not([data-night]) .tbox { border-color: #A0A0A0; }
:root[data-theme="onec"]:not([data-night]) th { border-color: #E5E5E5; border-bottom-color: #A0A0A0; }
:root[data-theme="onec"]:not([data-night]) tbody tr.noesf td { background: #FCEBEB; }
:root[data-theme="onec"]:not([data-night]) tbody tr.sel td, :root[data-theme="onec"]:not([data-night]) tbody tr.noesf.sel td { background: #FBF2D2; }
:root[data-theme="onec"]:not([data-night]) .main { padding: 10px 14px 12px; }
:root[data-theme="onec"]:not([data-night]) .vh h1 { font-size: 20px; }
@media (min-width: 761px) { :root[data-theme="onec"]:not([data-night]) .lwrap > .tbox.mlist { height: calc(100vh - 148px); } :root[data-theme="onec"]:not([data-night]) .lwrap > .filt { max-height: calc(100vh - 148px); } }
