/* Шрифт Onest (SIL Open Font License 1.1, static/fonts/OFL.txt): переменный,
   веса 100–900 в одном файле, без обращений во внешние сети. Оба файла
   заранее загружаются из layout.html (preload), а font-display: fallback не дает
   браузеру сначала нарисовать страницу системным шрифтом и потом перескочить
   на Onest — из-за этого при каждом переходе текст «подергивался». */
@font-face { font-family: "Onest"; font-style: normal; font-weight: 100 900; font-display: fallback; src: url(/static/fonts/onest-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 100 900; font-display: fallback; src: url(/static/fonts/onest-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Цвета и размеры — переменные. Оформление «блоками» (2026-10-24): приглушённая
   палитра индиго + жёлтый + роза + бирюза, темная верхняя панель (--top-*),
   плитки без теней. Роли цветов: индиго — ссылки, заголовки таблиц, пометки;
   жёлтый — главная кнопка, следующий шаг, полоски логотипа; роза — отмена,
   «+ новый», выделенная строка; бирюза — сделано, «проведен», включенный фильтр.
   --accent-fg — цвет текста на акцентной заливке, --accent-text — акцентный
   текст на фоне. */
:root {
  --bg: #f3f3f9; --card: #ffffff; --raised: #f8f8fd; --hover: #ececf6; --fg: #222340; --strong: #141530;
  --muted: #646689; --subtle: #8f90ad; --line: #e1e2f0; --line-strong: #c6c8de;
  --accent: #5b5bc0; --accent-hover: #4b4bae; --accent-fg: #ffffff; --accent-soft: #e9e9f8; --accent-text: #4747a6;
  --primary-bg: #f6e3a1; --primary-hover: #f1d984; --primary-fg: #4a3a00; --primary-line: #e9cf6c;
  --yellow: #e6c65a; --yellow-soft: #fbf0c4; --yellow-text: #7a5d00;
  --rose: #e2679b; --rose-soft: #fbe3ee; --rose-text: #a8355f;
  --teal: #2fa39b; --teal-soft: #dcf3f0; --teal-text: #157a73;
  --top-bg: #1f2048; --top-fg: #aeb0d6; --top-strong: #ffffff; --top-hover: #2c2d5c; --top-line: #30315f;
  --ok-bg: #e3f6e9; --ok-fg: #1a7f37; --err-bg: #fdecea; --err-fg: #c0262f; --warn: #a35200; --warn-bg: #fff4d6; --chip: #ececf6;
  --shadow-sm: none;
  --shadow: none;
  --shadow-pop: 0 2px 6px rgba(20, 21, 48, .10), 0 14px 36px rgba(20, 21, 48, .18);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
  --r-sm: 8px; --r: 10px; --r-lg: 14px;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --select-arrow: url("/static/select.svg");
  color-scheme: light;
}
/* Оформление выбирает пользователь (data-theme на <html>): без атрибута —
   как в системе, light — светлое, dark — темное, classic — классическое. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #111228; --card: #1d1e3c; --raised: #252649; --hover: #2e2f58; --fg: #ecebf7; --strong: #ffffff;
    --muted: #b4b5d3; --subtle: #8e8fb0; --line: #35375e; --line-strong: #4d4f7e;
    --accent: #a3a3ec; --accent-hover: #b5b5f3; --accent-fg: #141530; --accent-soft: #34366c; --accent-text: #c3c3ff;
    --primary-bg: #e9cb62; --primary-hover: #f1d77a; --primary-fg: #2b2100; --primary-line: #e9cb62;
    --yellow: #e9cb62; --yellow-soft: #4d4019; --yellow-text: #f1d77a;
    --rose: #ef86b6; --rose-soft: #4a2a46; --rose-text: #ff9ccb;
    --teal: #4fc9bf; --teal-soft: #163f3e; --teal-text: #6fdcd2;
    --top-bg: #0b0c1e; --top-fg: #a2a3c6; --top-strong: #ffffff; --top-hover: #1b1c3a; --top-line: #26274c;
    --ok-bg: #0f2a1d; --ok-fg: #56c770; --err-bg: #341519; --err-fg: #ff8078; --warn: #e0a83a; --warn-bg: #2d2510; --chip: #2e2f58;
    --shadow-sm: none;
    --shadow: none;
    --shadow-pop: 0 2px 6px rgba(0, 0, 0, .45), 0 12px 32px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111228; --card: #1d1e3c; --raised: #252649; --hover: #2e2f58; --fg: #ecebf7; --strong: #ffffff;
  --muted: #b4b5d3; --subtle: #8e8fb0; --line: #35375e; --line-strong: #4d4f7e;
  --accent: #a3a3ec; --accent-hover: #b5b5f3; --accent-fg: #141530; --accent-soft: #34366c; --accent-text: #c3c3ff;
  --primary-bg: #e9cb62; --primary-hover: #f1d77a; --primary-fg: #2b2100; --primary-line: #e9cb62;
  --yellow: #e9cb62; --yellow-soft: #4d4019; --yellow-text: #f1d77a;
  --rose: #ef86b6; --rose-soft: #4a2a46; --rose-text: #ff9ccb;
  --teal: #4fc9bf; --teal-soft: #163f3e; --teal-text: #6fdcd2;
  --top-bg: #0b0c1e; --top-fg: #a2a3c6; --top-strong: #ffffff; --top-hover: #1b1c3a; --top-line: #26274c;
  --ok-bg: #0f2a1d; --ok-fg: #56c770; --err-bg: #341519; --err-fg: #ff8078; --warn: #e0a83a; --warn-bg: #2d2510; --chip: #2e2f58;
  --shadow-sm: none;
  --shadow: none;
  --shadow-pop: 0 2px 6px rgba(0, 0, 0, .45), 0 12px 32px rgba(0, 0, 0, .55);
  color-scheme: dark;
}
:root[data-theme="classic"] {
  --bg: #f7f2e6; --card: #fefbf1; --raised: #fefbf1; --hover: #fbf6d9; --fg: #1b1a14; --strong: #1b1a14;
  --muted: #6e6a58; --subtle: #6e6a58; --line: #cbc6af; --line-strong: #a8a387;
  --accent: #2a4fc4; --accent-hover: #2a4fc4; --accent-fg: #ffffff; --accent-soft: #f5f1de; --accent-text: #2a4fc4;
  --primary-bg: var(--accent); --primary-hover: var(--accent); --primary-fg: #ffffff; --primary-line: var(--accent);
  --ok-bg: #e7f1dc; --ok-fg: #2f5d1a; --err-bg: #fbe3dc; --err-fg: #a12a1f; --warn: #8a5a00; --warn-bg: #fbf6d9; --chip: #ece8d6;
  --grid: #b2ac8a; --band: #e9e5d9; --sel: #3f5fcc;
  --yellow: #c9a227; --yellow-soft: #fbf6d9; --yellow-text: #8a5a00;
  --rose: #a12a1f; --rose-soft: #fbe3dc; --rose-text: #a12a1f;
  --teal: #2f5d1a; --teal-soft: #e7f1dc; --teal-text: #2f5d1a;
  --top-bg: var(--band); --top-fg: var(--fg); --top-strong: var(--fg); --top-hover: var(--hover); --top-line: var(--grid);
  --shadow-sm: none; --shadow: none; --shadow-pop: 2px 2px 4px rgba(0, 0, 0, .2); --ring: none;
  --r-sm: 0; --r: 0; --r-lg: 0;
  --font: Tahoma, Verdana, "Segoe UI", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:where(a, button, input, select, textarea, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1 { font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; color: var(--strong); margin: 0 0 6px; }
h2 { font-size: 18px; line-height: 1.3; font-weight: 650; letter-spacing: -.01em; color: var(--strong); margin: 30px 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
/* Закладки внутри страницы: подчеркивание акцентом у выбранной. */
nav.tabs { display: flex; gap: 2px 18px; flex-wrap: wrap; margin: 14px 0 20px; border-bottom: 1px solid var(--line); }
nav.tabs a { padding: 9px 2px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 500; }
nav.tabs a:hover { color: var(--strong); text-decoration: none; }
nav.tabs a.active { color: var(--strong); border-bottom-color: var(--accent); font-weight: 600; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.scroll { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.scroll td.text { min-width: 16rem; }
.scroll td.who { min-width: 10rem; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; background: var(--raised); }
th.center { text-align: center; }
tr:last-child td { border-bottom: none; }
tr:hover > td { background: var(--hover); }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
th.wrap { white-space: normal; min-width: 5.5rem; }
tr.total td { font-weight: 700; color: var(--strong); border-top: 1px solid var(--line-strong); background: var(--raised); }
.notice { background: var(--ok-bg); color: var(--ok-fg); padding: 11px 14px; border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  border-radius: var(--r); margin-bottom: 16px; }
.error { background: var(--err-bg); color: var(--err-fg); padding: 11px 14px; border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  border-radius: var(--r); margin-bottom: 16px; white-space: pre-wrap; }
.warn { color: var(--warn); margin: 6px 0; }
.fx-gain { color: var(--ok-fg); }
.fx-loss { color: var(--err-fg); }
.chip { display: inline-block; padding: 1px 9px; border-radius: 999px; background: var(--chip); color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1.6; }
.chip.posted { background: var(--ok-bg); color: var(--ok-fg); }
.chip.cancelled { background: var(--err-bg); color: var(--err-fg); }
form .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 16px; }
form .grid > .end { align-self: end; }
label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); }
input, select, textarea { width: 100%; font: inherit; color: var(--fg); background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--r);
  padding: 7px 10px; margin-top: 4px; transition: border-color .15s ease, box-shadow .15s ease; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--line-strong) 60%, var(--muted)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
select:not([multiple]) { appearance: none; -webkit-appearance: none; padding-right: 30px; background-image: var(--select-arrow);
  background-repeat: no-repeat; background-position: right 8px center; background-size: 16px; }
input.amount { text-align: right; font-variant-numeric: tabular-nums; }
table input, table select { margin: 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; align-items: center; }
button, .button { font: inherit; font-weight: 600; font-size: 14px; line-height: 1.45; padding: 8px 16px; border-radius: var(--r); border: 1px solid var(--line-strong);
  background: var(--card); color: var(--fg); cursor: pointer; display: inline-block; box-shadow: var(--shadow-sm);
  transition: background .15s ease, border-color .15s ease, color .15s ease; }
button:hover, .button:hover { background: var(--hover); text-decoration: none; }
button:active, .button:active { transform: translateY(1px); }
/* Главная кнопка: цвета из --primary-* (в светлой теме мягкая, в темной сплошная). */
button.primary, .button.primary { background: var(--primary-bg); color: var(--primary-fg); border-color: var(--primary-line); box-shadow: none; }
button.primary:hover, .button.primary:hover { background: var(--primary-hover); border-color: var(--primary-line); }
button.danger { color: var(--err-fg); }
.inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.inline > div { min-width: 160px; }
.inline > .grow { flex: 1 1 240px; }
.big { font-size: 20px; font-weight: 700; }
.mb { margin-bottom: 16px; }
.mt { margin-top: 12px; }
.mt0 { margin-top: 0; }
.full { flex-basis: 100%; margin: 0; }
code { background: var(--chip); padding: 1px 5px; border-radius: 4px; font-size: .92em; }
nav.tabs .group { padding: 9px 4px 9px 14px; font-size: 12px; color: var(--subtle); border-left: 1px solid var(--line); align-self: center; }
tr.archived td { color: var(--muted); }
.check { display: flex; gap: 8px; align-items: center; color: var(--fg); font-size: 14px; font-weight: 400; }
.check input { width: auto; margin: 0; }
.chip.error { background: var(--err-bg); color: var(--err-fg); }
.chip.pending { background: var(--chip); }
.chip.done { background: var(--ok-bg); color: var(--ok-fg); }
.chip.active, .chip.open { background: var(--accent-soft); color: var(--accent-text); }
.chip.rejected { background: var(--err-bg); color: var(--err-fg); }
tr.current > td { background: var(--accent-soft); }
.taskform input { min-width: 14rem; }
.taskform .actions { margin-top: 8px; }
.chip.abc-A { background: var(--ok-bg); color: var(--ok-fg); }
.sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 8px; }
.sections .card { margin-bottom: 0; }
td.links { white-space: nowrap; }
.filterinfo { margin: 0 0 10px; }
/* Листалка длинных списков (pager.go). */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 14px 0 8px; font-size: 14px; }
.pager a, .pager .cur, .pager .gap { min-width: 34px; padding: 5px 10px; border-radius: 8px; text-align: center; box-sizing: border-box; }
.pager a { border: 1px solid var(--line); color: var(--fg); }
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager .cur { background: var(--accent); color: var(--accent-fg); font-weight: 700; }
.pager .gap { color: var(--muted); padding: 5px 2px; min-width: 0; }
.pager .pager-info { color: var(--muted); margin-right: 6px; }
.pager .pager-all { margin-left: auto; color: var(--muted); }

/* Раскладка как у МойСклад: сверху панель разделов со значками (пункты
   раздела — в выпадающем списке и второй строкой у выбранного), справа в
   ней организация, настройки и пользователь. Под ней панель страницы:
   заголовок, кнопки, «Фильтр» и поиск; фильтры раскрываются над списком.
   Содержимое — во всю ширину. */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: stretch; gap: 8px; min-height: 60px; padding: 0 16px;
  background: var(--card); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.topbar a.brand { display: flex; align-items: center; gap: 9px; flex: none; padding-right: 10px; font-weight: 800; font-size: 17px;
  letter-spacing: -.01em; color: var(--strong); }
.topbar a.brand:hover { text-decoration: none; }
.topbar a.brand::before { content: ""; flex: none; width: 24px; height: 24px;
  background: url(/static/icons/icon.svg) center / contain no-repeat; border-radius: 0; }
nav.areas { display: flex; flex-wrap: wrap; align-items: stretch; flex: 1; min-width: 0; }
/* Разделы делят ширину панели поровну по содержимому: сколько бы их ни
   было (модули скрыты, права), панель заполнена без пустоты справа. */
nav.areas .area { position: relative; display: flex; flex: 1 1 0; min-width: max-content; justify-content: center; }
nav.areas .area > a { flex: 1; }
nav.areas .area > a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 6px 9px 5px;
  color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1.1; white-space: nowrap; border-bottom: 2px solid transparent; }
nav.areas .area > a svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
nav.areas .area > a:hover, nav.areas .area:hover > a { color: var(--strong); background: var(--hover); text-decoration: none; }
nav.areas .area > a.active { color: var(--accent-text); border-bottom-color: var(--accent); }
nav.areas .dropdown { display: none; position: absolute; z-index: 50; top: 100%; left: 0; min-width: 230px; padding: 5px;
  background: var(--card); border: 1px solid var(--line); border-radius: 0 0 var(--r-lg) var(--r-lg); box-shadow: var(--shadow-pop); }
nav.areas .dropdown a { display: block; padding: 7px 10px; border-radius: var(--r-sm); color: var(--fg); font-size: 14px; white-space: nowrap; }
nav.areas .dropdown a:hover { background: var(--hover); text-decoration: none; }
nav.areas .dropdown a.active { color: var(--accent-text); font-weight: 600; }
@media (hover: hover) and (min-width: 721px) {
  nav.areas .area:hover > .dropdown, nav.areas .area:focus-within > .dropdown { display: block; }
}
.topright { display: flex; align-items: center; gap: 6px; flex: none; margin-left: auto; }
.topmenu { position: relative; }
.topmenu > summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 8px; border-radius: var(--r);
  cursor: pointer; color: var(--muted); user-select: none; }
.topmenu > summary::-webkit-details-marker { display: none; }
.topmenu > summary:hover, .topmenu[open] > summary { background: var(--hover); color: var(--strong); }
.topmenu > summary svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.topmenu.active > summary { color: var(--accent-text); }
.orgmenu > summary { max-width: 260px; }
.orgmenu > summary::after { content: "▾"; color: var(--subtle); font-size: 12px; }
.orgmenu .orgname { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.orgmenu .orgname b, .orgmenu .orgname small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orgmenu .orgname b { font-weight: 600; font-size: 14px; color: var(--fg); }
.orgmenu .orgname small { font-size: 12px; color: var(--muted); }
.orgmenu .avatar { width: 28px; height: 28px; font-size: 12px; }
.topmenu .menu { position: absolute; z-index: 50; top: calc(100% + 6px); right: 0; min-width: 260px; max-height: calc(100vh - 80px); overflow-y: auto;
  padding: 5px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column; font-size: 14px; }
.topmenu .menu > a, .topmenu .menu button.linklike { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: var(--r-sm);
  color: var(--fg); font-size: 14px; font-weight: 400; text-align: left; width: 100%; }
.topmenu .menu > a:hover, .topmenu .menu button.linklike:hover { background: var(--hover); text-decoration: none; }
.topmenu .menu > a.active { background: var(--accent-soft); color: var(--accent-text); }
.topmenu .menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.topmenu .menu-group { margin: 0; padding: 6px 10px 2px; color: var(--subtle); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.topmenu .menu-note { margin: 0; padding: 7px 10px; color: var(--muted); font-size: 13px; }
.orgmenu .menu { min-width: 300px; }
.orgmenu .menu a { align-items: flex-start; }
.orgmenu .menu a.add { align-items: center; color: var(--accent-text); }
.orgmenu .txt { display: flex; flex-direction: column; min-width: 0; }
.orgmenu .name { line-height: 1.3; }
.orgmenu .meta { font-size: 12px; line-height: 1.3; color: var(--muted); }
.orgmenu a.active .meta { color: var(--accent-text); opacity: .75; }
.orgmenu a.add .avatar { background: transparent; color: var(--accent-text); border: 1px dashed var(--line-strong); font-size: 18px; font-weight: 400; }
.usermenu .avatar.round { border-radius: 50%; width: 32px; height: 32px; }
.usermenu .avatar:not([class*="tone"]) { background: var(--chip); color: var(--muted); }
.usermenu .user { display: flex; flex-direction: column; padding: 8px 10px 4px; }
.usermenu .user .name { font-weight: 600; color: var(--fg); }
.usermenu .user .meta { font-size: 12px; color: var(--muted); }
.usermenu .themebar { padding: 6px 10px; }
.usermenu .themebar label { font-size: 12px; }
.usermenu .themebar select { padding: 4px 28px 4px 8px; font-size: 13px; }

nav.subnav { display: flex; gap: 0 20px; flex-wrap: wrap; padding: 0 24px; background: var(--card); border-bottom: 1px solid var(--line); }
nav.subnav a { padding: 9px 2px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 14px; font-weight: 500; }
/* Пункты раздела тоже растягиваются на всю строку. */
nav.subnav a { flex: 1 1 auto; text-align: center; white-space: nowrap; }
nav.subnav a:hover { color: var(--strong); text-decoration: none; }
nav.subnav a.active { color: var(--strong); border-bottom-color: var(--accent); font-weight: 600; }

main.page { flex: 1; min-width: 0; padding: 16px 24px 56px; container-type: inline-size; }
/* Панель страницы: заголовок, кнопки и поиск слева, печать и Excel справа. */
.pagebar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 0 0 14px; min-height: 38px; }
.pagebar:not(:has(h1, a, button, form)) { display: none; }
.pagetitle { display: flex; align-items: center; gap: 10px; min-width: 0; margin-right: 6px; }
.pagetitle h1 { font-size: 22px; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.pagebar .tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pagebar .tools:empty { display: none; }
.pagebar .tools.right { margin-left: auto; }
.pagebar .actions, .pagebar .docbar { margin: 0; gap: 8px; }
.pagebar .button, .pagebar button:not(.linklike), .pagebar .printmenu > summary { padding: 6px 13px; font-size: 13.5px; }
.pagebar .filterbtn { display: inline-flex; align-items: center; gap: 6px; }
.pagebar .filterbtn svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.pagebar .filterbtn.on { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
/* Вкладки карточки (app.js): «Карточка», «Бухгалтерия», «Файлы N» рядом с
   «История»; блоки с data-panel показываются по вкладке. */
.pagebar .cardtabs { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.pagebar .cardtabs .button.on { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); font-weight: 600; }
.pagebar .cardtabs .count { display: inline-block; min-width: 18px; margin-left: 6px; padding: 0 5px; border-radius: 999px; background: var(--chip); color: var(--muted); font-size: 11.5px; line-height: 18px; text-align: center; }
.pagebar .cardtabs .button.on .count { background: var(--accent); color: var(--accent-fg); }
.quicksearch input { margin: 0; width: 240px; padding: 6px 10px; font-size: 13.5px; }
.listhint { margin: 0 0 8px; }

/* Фильтры — раскрывающаяся панель над списком, поля в несколько колонок. */
.filterpanel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; margin-bottom: 14px;
  box-shadow: var(--shadow-sm); }
.filterpanel[hidden], [data-kpp][hidden] { display: none; }
.filterpanel .block + .block { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.filterpanel h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--subtle); margin: 0 0 8px; font-weight: 600; }
.filterpanel form { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 14px; align-items: end; }
.filterpanel form label, .filterpanel form .check, .filterpanel .actions { margin: 0; }
.filterpanel form > p { grid-column: 1 / -1; margin: 0; }

/* Форма документа: кнопки «Провести», «Сохранить» — сверху, как в МойСклад,
   и остаются на виду при прокрутке. */
form.card:has(> .grid):has(> .actions:last-child button.primary) { display: flex; flex-direction: column; }
form.card:has(> .grid) > .actions:last-child:has(button.primary) { order: -1; position: sticky; top: 61px; z-index: 20; margin: -18px -18px 16px;
  padding: 10px 18px; background: var(--raised); border-bottom: 1px solid var(--line); border-radius: var(--r-lg) var(--r-lg) 0 0; }

/* Значки организаций: мягкая подложка оттенка и буквы того же цвета. */
.avatar { flex: none; width: 32px; height: 32px; border-radius: var(--r); display: grid; place-items: center; font-size: 13px; font-weight: 700;
  line-height: 1; --tone: var(--muted); color: var(--tone); background: color-mix(in srgb, var(--tone) 14%, var(--card)); }
.avatar.tone0 { --tone: #c97400; } .avatar.tone1 { --tone: #2f8a55; } .avatar.tone2 { --tone: #7b5ccc; }
.avatar.tone3 { --tone: #b8691f; } .avatar.tone4 { --tone: #23838c; } .avatar.tone5 { --tone: #b84a6e; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .avatar { background: color-mix(in srgb, var(--tone) 22%, var(--card)); color: color-mix(in srgb, var(--tone) 55%, #fff); }
}
:root[data-theme="dark"] .avatar { background: color-mix(in srgb, var(--tone) 22%, var(--card)); color: color-mix(in srgb, var(--tone) 55%, #fff); }

/* Узкий экран (телефон): разделы — строкой со значками, подменю — второй строкой. */
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; padding: 0 10px; gap: 0 6px; position: static; }
  .topbar a.brand { order: 1; min-height: 52px; }
  .topright { order: 2; }
  nav.areas { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; border-top: 1px solid var(--line); }
  nav.areas .area, nav.subnav a { flex: 0 0 auto; }
  .orgmenu > summary { max-width: 160px; }
  nav.subnav { padding: 0 12px; flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; }
  main.page { padding: 12px 12px 40px; }
  .quicksearch, .quicksearch input { width: 100%; }
  .pagebar .tools.right { margin-left: 0; }
  form.card:has(> .grid) > .actions:last-child:has(button.primary) { top: 0; }
}

/* Воронка сделок: колонки стадий с карточками. */
.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.board .column { background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px; }
.board h3 { font-size: 13px; font-weight: 600; color: var(--muted); margin: 2px 4px 10px; }
.dealcard { display: flex; flex-direction: column; gap: 2px; padding: 10px; margin-bottom: 8px; border: 1px solid var(--line);
  border-radius: var(--r); background: var(--card); color: var(--fg); box-shadow: var(--shadow-sm); }
.dealcard:hover { border-color: var(--accent); text-decoration: none; }

/* Вход и пользователи: мягкое акцентное свечение в углу. */
.bare { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(60% 55% at 85% 0%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 70%), var(--bg); }
.bare main.card { width: 100%; max-width: 400px; padding: 28px; box-shadow: var(--shadow-pop); }
.bare .brand-line { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; color: var(--strong); font-size: 17px; }
.bare .brand-line::before { content: ""; width: 24px; height: 24px;
  background: url(/static/icons/icon.svg) center / contain no-repeat; border-radius: 0; }
form.stack label { display: block; margin-bottom: 14px; }
button.linklike { border: 0; background: none; padding: 0; color: var(--accent-text); font-size: 13px; font-weight: 500; box-shadow: none; }
button.linklike:hover { background: none; text-decoration: underline; }
.exportbar { display: flex; gap: 16px; align-items: center; margin: 0 0 12px; font-size: 13px; }
.temp-password { border-color: var(--warn); }
code.big { font-size: 18px; letter-spacing: 1px; user-select: all; }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 8px 12px; }
fieldset .check { margin: 4px 0; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Сторно в журнале и карточке счета */
tr.storno td { color: var(--err-fg); }

/* Сводка организации */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card);
  color: var(--fg); text-decoration: none; box-shadow: var(--shadow-sm); transition: border-color .15s ease, box-shadow .15s ease; }
.kpi:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: var(--shadow); text-decoration: none; }
.kpi .label { color: var(--muted); font-size: 13px; }
.kpi .value { font-size: 22px; font-weight: 700; letter-spacing: -.01em; color: var(--strong); font-variant-numeric: tabular-nums; }
.kpi .hint { color: var(--subtle); font-size: 12px; }
.kpi.bad .value { color: var(--err-fg); }

/* Печать отчетов: без меню, фильтров и кнопок */
.print-title h1 { font-size: 18px; }
table.kudir tr.cols td { text-align: center; color: var(--muted); font-size: 12px; }
@media print {
  .topbar, nav.subnav, .filterpanel, .actions, .noprint { display: none !important; }
  .app, main.page, main, .pagebar { display: block !important; margin: 0 !important; padding: 0 !important; }
  body { background: #fff; color: #000; }
  table { font-size: 11px; }
  a { color: inherit; text-decoration: none; }
  .card, .scroll { box-shadow: none; }
}
/* Кнопка «Печать» с выпадающим списком печатных форм. */
.docbar { display: flex; gap: 8px; align-items: center; margin: 0 0 12px; }
.printmenu { position: relative; display: inline-block; }
.printmenu > summary { list-style: none; padding: 5px 12px; font-size: 13px; user-select: none; }
.printmenu > summary::-webkit-details-marker { display: none; }
.printmenu > summary::after { content: " ▾"; color: var(--subtle); }
.printmenu[open] > summary { border-color: var(--accent); }
.printmenu .menu { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 240px; padding: 5px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column; font-size: 14px; }
.printmenu .menu-forms { display: flex; flex-direction: column; }
.printmenu .menu a, .printmenu .menu button { display: block; padding: 7px 10px; text-align: left; white-space: nowrap;
  color: var(--fg); text-decoration: none; border: 0; border-radius: var(--r-sm); background: none; font-size: 14px; font-weight: 400; box-shadow: none; }
.printmenu .menu a:hover, .printmenu .menu button:hover { background: var(--hover); }
.printmenu .menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.printmenu .menu-note { margin: 0; padding: 7px 10px; color: var(--muted); font-size: 13px; }
.printmenu .menu-group { margin: 0; padding: 6px 10px 2px; color: var(--subtle); font-size: 11.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; }
.createmenu > summary { font-size: 14px; padding: 7px 14px; }
.createmenu > summary::after { color: inherit; opacity: .8; }
.printmenu .menu-note[hidden] { display: none; }
tr[data-row] { cursor: default; }
tr[data-row].selected > td { background: color-mix(in srgb, var(--accent) 12%, transparent); }
@media print { tr[data-row].selected > td { background: none; } }

/* Выбор оформления: в меню пользователя и на странице профиля. */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.themecard { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-lg);
  color: var(--fg); font-size: 14px; font-weight: 400; cursor: pointer; }
.themecard:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.themecard input { width: auto; margin: 0; }
/* Выбор страны учета: карточки стран. */
.countries { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.countrycard { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-lg);
  color: var(--fg); font-size: 15px; font-weight: 400; cursor: pointer; }
.countrycard:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
.countrycard input { width: auto; margin: 0; }
.countrycard .check b { font-size: 16px; }
.preview { position: relative; display: block; height: 64px; border: 1px solid var(--pv-line); border-radius: var(--r); overflow: hidden;
  background: var(--pv-bg); }
.preview i { position: absolute; display: block; left: 30%; right: 8px; height: 7px; background: var(--pv-line); border-radius: 3px; }
.preview i:nth-child(1) { left: 0; right: auto; top: 0; bottom: 0; width: 22%; height: auto; background: var(--pv-side);
  border-right: 1px solid var(--pv-line); border-radius: 0; }
.preview i:nth-child(2) { top: 9px; height: 9px; background: var(--pv-accent); right: 40%; }
.preview i:nth-child(3) { top: 27px; }
.preview i:nth-child(4) { top: 42px; }
.preview-light { --pv-bg: #f3f3f9; --pv-side: #ffffff; --pv-line: #e1e2f0; --pv-accent: #5b5bc0; }
.preview-dark { --pv-bg: #111228; --pv-side: #1d1e3c; --pv-line: #35375e; --pv-accent: #a3a3ec; }
.preview-system { --pv-side: transparent; --pv-line: #8f90ad; --pv-accent: #7b7bd6;
  --pv-bg: linear-gradient(135deg, #f3f3f9 50%, #111228 50%); }
.preview-classic { --pv-bg: #fefbf1; --pv-side: #e9e5d9; --pv-line: #b2ac8a; --pv-accent: #3f5fcc; border-radius: 0; }
.preview-classic i { border-radius: 0; }
.preview-classic i:nth-child(3), .preview-classic i:nth-child(4) { background: #fff; border: 1px solid #b2ac8a; height: 9px; }

/* Классическое оформление: мелкий шрифт, плотные таблицы с полной сеткой,
   объемные кнопки и закладки, подчеркнутые ссылки, синее выделение. */
[data-theme="classic"] body { font: 13px/1.4 Tahoma, Verdana, "Segoe UI", Arial, sans-serif; }
[data-theme="classic"] main :where(a:not(.button, .kpi, .dealcard)) { text-decoration: underline; }
[data-theme="classic"] h1 { font-size: 22px; font-weight: 400; color: #8a8463; }
[data-theme="classic"] h2 { font-size: 13px; font-weight: 700; color: var(--muted); background: var(--band); padding: 3px 8px; margin: 18px 0 8px; }
[data-theme="classic"] .small { font-size: 12px; }
[data-theme="classic"] .card, [data-theme="classic"] .scroll, [data-theme="classic"] .filterpanel,
[data-theme="classic"] .board .column, [data-theme="classic"] .kpi, [data-theme="classic"] .dealcard,
[data-theme="classic"] fieldset, [data-theme="classic"] .themecard, [data-theme="classic"] .countrycard { border-radius: 0; border-color: var(--grid); }
[data-theme="classic"] .card { padding: 10px 12px; margin-bottom: 12px; }
[data-theme="classic"] .scroll { background: #fff; }
[data-theme="classic"] th, [data-theme="classic"] td { padding: 2px 6px; border: 1px solid #d6d1bb; }
[data-theme="classic"] th { font-size: 12px; font-weight: 400; color: var(--fg); background: linear-gradient(#fbf9ef, #ebe7d3);
  border-color: var(--grid); }
[data-theme="classic"] tr:last-child td { border-bottom: 1px solid #d6d1bb; }
[data-theme="classic"] tr.total td { border-top: 2px solid var(--grid); background: var(--band); }
[data-theme="classic"] tbody tr:hover > td, [data-theme="classic"] tr[data-row]:hover > td { background: #fbf6d9; }
[data-theme="classic"] tr[data-row].selected > td { background: var(--sel); color: #fff; }
[data-theme="classic"] tr[data-row].selected > td a, [data-theme="classic"] tr[data-row].selected > td .chip { color: #fff; }
[data-theme="classic"] tr[data-row].selected > td .chip { background: rgba(255, 255, 255, .2); }
[data-theme="classic"] input, [data-theme="classic"] select, [data-theme="classic"] textarea {
  background: #fff; border-color: #a8a387; border-radius: 0; padding: 3px 5px; }
[data-theme="classic"] input:focus, [data-theme="classic"] select:focus, [data-theme="classic"] textarea:focus {
  outline: 1px solid var(--sel); outline-offset: 0; border-color: var(--sel); }
[data-theme="classic"] label { font-size: 12px; }
[data-theme="classic"] button, [data-theme="classic"] .button { padding: 3px 12px; border-radius: 2px; border-color: #a8a387; color: var(--fg);
  background: linear-gradient(#fefdf8, #e6e2d0); }
[data-theme="classic"] button:hover, [data-theme="classic"] .button:hover { background: linear-gradient(#fffbe6, #f2e3a6); text-decoration: none; }
[data-theme="classic"] button.primary, [data-theme="classic"] .button.primary { font-weight: 700; color: var(--fg); border-color: #7a7458;
  background: linear-gradient(#fefdf8, #e6e2d0); }
[data-theme="classic"] button.danger { color: var(--err-fg); }
[data-theme="classic"] button.linklike { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; }
[data-theme="classic"] .actions { margin-top: 10px; gap: 6px; }
[data-theme="classic"] table input, [data-theme="classic"] table select { border-color: transparent; background: transparent; }
[data-theme="classic"] table input:hover, [data-theme="classic"] table select:hover { border-color: #c9c3a6; }
[data-theme="classic"] .notice, [data-theme="classic"] .error { border-radius: 0; padding: 6px 10px; border: 1px solid currentColor; }
[data-theme="classic"] .chip { border-radius: 2px; }
[data-theme="classic"] code { border-radius: 0; }
[data-theme="classic"] .avatar { border-radius: 2px; }
[data-theme="classic"] nav.subnav { background: var(--card); border-top-color: var(--grid); padding: 4px 24px; gap: 2px 14px; }
[data-theme="classic"] nav.subnav a { padding: 1px 0; border-radius: 0; color: var(--accent); text-decoration: underline; }
[data-theme="classic"] nav.subnav a.active { background: none; color: var(--fg); text-decoration: none; font-weight: 700; }
[data-theme="classic"] nav.tabs { gap: 2px; margin: 10px 0 14px; border-bottom-color: var(--grid); }
[data-theme="classic"] nav.tabs a { padding: 3px 12px; border: 1px solid #c0bb9f; border-bottom: 0; border-radius: 3px 3px 0 0;
  color: var(--fg); background: linear-gradient(#f8f6ea, #e3dfc8); text-decoration: none; }
[data-theme="classic"] nav.tabs a.active { background: var(--card); border-color: var(--grid); font-weight: 400; }
[data-theme="classic"] nav.tabs .group { padding: 3px 4px 3px 12px; border-left-color: var(--grid); }
[data-theme="classic"] .printmenu .menu { border-radius: 0; border-color: var(--grid); box-shadow: 2px 2px 4px rgba(0, 0, 0, .2); background: #fff; }
[data-theme="classic"] .printmenu .menu a, [data-theme="classic"] .printmenu .menu button { padding: 4px 14px; font-size: 13px;
  background: none; border: 0; text-decoration: none; font-weight: 400; }
[data-theme="classic"] .printmenu .menu a:hover, [data-theme="classic"] .printmenu .menu button:hover { background: var(--sel); color: #fff; }
[data-theme="classic"] .exportbar { font-size: 12px; }
[data-theme="classic"] .exportbar a { text-decoration: underline; }
/* Классическое оформление не берет черты основного: без скруглений, теней,
   жирных подписей и знака у названия. */
[data-theme="classic"] h1, [data-theme="classic"] h2 { letter-spacing: normal; }
[data-theme="classic"] button, [data-theme="classic"] .button { font-weight: 400; font-size: inherit; line-height: inherit; }
[data-theme="classic"] button:active, [data-theme="classic"] .button:active { transform: none; }
[data-theme="classic"] select { appearance: auto; -webkit-appearance: menulist; }
[data-theme="classic"] :where(.chip) { font-weight: 400; color: var(--fg); line-height: 1.5; }
[data-theme="classic"] .avatar { background: var(--tone); color: #fff; }
[data-theme="classic"] nav.subnav a { border-bottom: 0; margin-bottom: 0; font-size: inherit; font-weight: 400; }
[data-theme="classic"] nav.tabs a { margin-bottom: 0; font-weight: 400; }
[data-theme="classic"] nav.tabs a.active { margin-bottom: -1px; }
[data-theme="classic"] .printmenu .menu { padding: 4px 0; }

/* Классическое оформление верхней панели: бежевая полоса, разделы —
   кнопки со значками, выпадающие списки и меню — с синим выделением. */
[data-theme="classic"] .topbar { background: var(--band); border-bottom-color: var(--grid); box-shadow: none; min-height: 54px; }
[data-theme="classic"] .topbar a.brand { font-weight: 700; font-size: 15px; letter-spacing: normal; }
[data-theme="classic"] .topbar a.brand::before, [data-theme="classic"] .bare .brand-line::before { display: none; }
[data-theme="classic"] nav.areas .area > a { font-size: 12px; font-weight: 400; color: var(--fg); border-bottom: 0; margin: 4px 1px; padding: 3px 7px;
  border: 1px solid transparent; border-radius: 2px; }
[data-theme="classic"] nav.areas .area > a:hover, [data-theme="classic"] nav.areas .area:hover > a { background: linear-gradient(#fffbe6, #f2e3a6); border-color: #c9c3a6; }
[data-theme="classic"] nav.areas .area > a.active { background: linear-gradient(#fbf9ef, #ebe7d3); border-color: var(--grid); font-weight: 700; }
[data-theme="classic"] nav.areas .dropdown, [data-theme="classic"] .topmenu .menu { border-radius: 0; border-color: var(--grid); box-shadow: 2px 2px 4px rgba(0, 0, 0, .2);
  background: #fff; padding: 4px 0; }
[data-theme="classic"] nav.areas .dropdown a, [data-theme="classic"] .topmenu .menu > a, [data-theme="classic"] .topmenu .menu button.linklike { border-radius: 0;
  padding: 4px 14px; font-size: 13px; text-decoration: none; }
[data-theme="classic"] nav.areas .dropdown a:hover, [data-theme="classic"] .topmenu .menu > a:hover,
[data-theme="classic"] .topmenu .menu > a.active, [data-theme="classic"] .topmenu .menu button.linklike:hover { background: var(--sel); color: #fff; }
[data-theme="classic"] .topmenu .menu > a:hover .meta, [data-theme="classic"] .topmenu .menu > a.active .meta { color: #fff; }
[data-theme="classic"] .topmenu > summary { border-radius: 2px; }
[data-theme="classic"] .topmenu > summary:hover, [data-theme="classic"] .topmenu[open] > summary { background: #f5f1de; }
[data-theme="classic"] .topmenu .menu-group, [data-theme="classic"] .filterpanel h3 { font-size: 12px; text-transform: none; letter-spacing: normal; color: var(--muted); }
[data-theme="classic"] nav.subnav { background: var(--card); border-bottom-color: var(--grid); padding: 4px 24px; gap: 2px 14px; }
[data-theme="classic"] nav.subnav a { padding: 1px 0; border-radius: 0; color: var(--accent); text-decoration: underline; border-bottom: 0; margin-bottom: 0;
  font-size: inherit; font-weight: 400; }
[data-theme="classic"] nav.subnav a.active { background: none; color: var(--fg); text-decoration: none; font-weight: 700; }
[data-theme="classic"] main.page { padding: 10px 16px 40px; }
[data-theme="classic"] .pagetitle h1 { font-size: 20px; }
[data-theme="classic"] .pagebar { margin-bottom: 10px; }
[data-theme="classic"] .pagebar .actions { margin: 0; }
[data-theme="classic"] .pagebar .cardtabs .button.on, [data-theme="classic"] .pagebar .filterbtn.on { background: linear-gradient(#fffbe6, #f2e3a6); color: var(--fg); }
[data-theme="classic"] .filterpanel { padding: 8px 12px; box-shadow: none; background: var(--band); }
[data-theme="classic"] form.card:has(> .grid) > .actions:last-child:has(button.primary) { margin: -10px -12px 12px; padding: 6px 12px; border-radius: 0;
  background: var(--band); border-bottom-color: var(--grid); top: 55px; }
[data-theme="classic"] .bare { background: var(--bg); }
[data-theme="classic"] .bare main.card { padding: 16px; }
/* Печать — всегда светлая, в каком бы оформлении ни работал пользователь. */
@media print {
  :root:not([data-theme]), :root[data-theme] {
    --bg: #ffffff; --card: #ffffff; --fg: #000000; --muted: #555555; --line: #cccccc; --grid: #999999; --band: #eeeeee;
    --accent: #000000; --chip: #eeeeee; --ok-bg: #ffffff; --ok-fg: #000000; --err-bg: #ffffff; --err-fg: #000000;
    --raised: #ffffff; --hover: #ffffff; --strong: #000000; --subtle: #555555; --line-strong: #999999; --accent-text: #000000;
    --shadow-sm: none; --shadow: none; --shadow-pop: none;
    color-scheme: light;
  }
  [data-theme] th { background: none; }
}

/* Штрихкоды в карточке номенклатуры. */
/* Главное фото на карточке номенклатуры (item.html, mainphoto). */
.mainphoto { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.mainphoto .preview { flex: none; display: flex; align-items: center; justify-content: center; width: 112px; height: 112px; border-radius: var(--r-lg); background: var(--chip); border: 1px solid var(--line); overflow: hidden; }
.mainphoto .preview img { width: 100%; height: 100%; object-fit: cover; }
.mainphoto .preview.empty { color: var(--subtle); border-style: dashed; }
.mainphoto-text { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.mainphoto-actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 14px; }
.mainphoto-actions .linklike, .mainphoto-pick > summary { color: var(--accent-text); cursor: pointer; }
.mainphoto-actions .linklike:hover, .mainphoto-pick > summary:hover { text-decoration: underline; }
.mainphoto-pick > summary { list-style: none; }
.mainphoto-pick[open] { flex-basis: 100%; }
.mainphoto-pick > summary::-webkit-details-marker { display: none; }
.mainphoto-list { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.mainphoto-item { padding: 2px; width: 64px; height: 64px; border: 2px solid var(--line); border-radius: var(--r); background: var(--chip); cursor: pointer; }
.mainphoto-item:hover { border-color: var(--accent); }
.mainphoto-item img { width: 100%; height: 100%; object-fit: cover; border-radius: calc(var(--r) - 2px); }
@media (max-width: 720px) { .mainphoto .preview { width: 84px; height: 84px; } }

/* «+ Доп. поле» в карточке (customfields). */
.quickfield { margin-top: 10px; }
.quickfield > summary { list-style: none; cursor: pointer; display: inline-block; color: var(--accent-text); font-size: 14px; }
.quickfield > summary::-webkit-details-marker { display: none; }
.quickfield > summary:hover { text-decoration: underline; }
.quickfield[open] > summary { margin-bottom: 6px; }
.quickitem > summary.button { color: inherit; font-size: inherit; }
.quickitem > summary.button:hover { text-decoration: none; }
.quickitem[open] > summary { margin-bottom: 10px; }
[data-quickitem-done] .notice { margin-bottom: 10px; }
.quickfield .inline { padding: 12px 14px; border: 1px dashed var(--line); border-radius: var(--r); }
.barcodes { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.barcodes figure { margin: 0; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
.barcodes svg { display: block; width: 200px; height: 70px; }

/* Поле сканера в документе: первая кнопка формы — «Добавить по штрихкоду»,
   чтобы Enter сканера не проводил документ; на экране ее не видно. */
.defaultsubmit { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
/* Розница: рабочее место кассира (pos.js), документы розницы. */
.grid-info { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 16px; }
.posbar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 14px; }
.posbar h2 { margin: 0; }
.postitle { display: flex; flex-direction: column; }
.posbar .grow { flex: 1; }
.posmsg { padding: 11px 14px; border-radius: var(--r-lg); margin-bottom: 14px; background: var(--ok-bg); color: var(--ok-fg); white-space: pre-wrap; }
.posmsg.error { background: var(--err-bg); color: var(--err-fg); }
.posmsg.big { font-size: 20px; font-weight: 600; }
.posgrid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
@container (max-width: 860px) { .posgrid { grid-template-columns: minmax(0, 1fr); } }
.poscart, .pospay { margin-bottom: 0; }
.posscan input { font-size: 17px; padding: 10px 12px; }
.posfound { list-style: none; margin: 6px 0 10px; padding: 4px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow-pop); max-height: 320px; overflow-y: auto; }
.posfound li button { display: flex; width: 100%; gap: 12px; justify-content: space-between; border: 0; border-radius: var(--r-sm); background: none; text-align: left; padding: 8px 10px; font-weight: 400; box-shadow: none; }
.posfound li button:hover, .posfound li button:focus { background: var(--hover); }
.posfound .muted { white-space: nowrap; }
.postable { margin-top: 10px; }
.postable td { vertical-align: middle; }
.postable input { width: 7rem; padding: 5px 7px; }
.postable input.posqty { width: 5.5rem; }
.postable input.posdisc { width: 4.5rem; }
.postable button.posdel { padding: 2px 9px; color: var(--err-fg); }
.postable tr.noprice input.posprice { border-color: var(--err-fg); }
.postotal { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.postotal b { font-size: 32px; font-weight: 700; letter-spacing: -.02em; color: var(--strong); font-variant-numeric: tabular-nums; }
.pospay label { margin-bottom: 10px; }
.pospay input { font-size: 17px; }
.poschange { margin: 2px 0 14px; font-size: 17px; }
.poschange b { font-variant-numeric: tabular-nums; }
.posbuttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
button.posbig { width: 100%; padding: 14px 10px; font-size: 17px; font-weight: 600; }
.posmixed { margin-top: 12px; }
.posmixed summary { cursor: pointer; color: var(--accent-text); font-size: 14px; margin-bottom: 8px; }
.posrefund { border: 1px solid var(--line); border-radius: var(--r); padding: 8px 12px; margin: 0 0 12px; }
.posrefund legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
.posrefund .check { margin: 4px 0; }
.posreceipts { margin-top: 8px; }
.posfind summary { cursor: pointer; }
.pos.busy button { opacity: .6; pointer-events: none; }
.chip.new { background: var(--err-bg); color: var(--err-fg); }
.chip.failed { background: var(--chip); color: var(--muted); }
.chip.draft { background: var(--chip); }
/* Узкий экран (телефон): строка чека — название сверху, поля под ним. */
@container (max-width: 640px) {
  #pos-cart thead { display: none; }
  #pos-cart tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1fr) auto; gap: 4px 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
  #pos-cart td { padding: 0; border: 0; }
  #pos-cart td:first-child { grid-column: 1 / -1; }
  #pos-cart td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); text-align: left; }
  #pos-cart td.num { text-align: left; }
  #pos-cart input { width: 100%; }
  #pos-cart td:last-child { align-self: end; }
  #pos-cart td.possum { grid-column: 1 / 4; font-weight: 600; }
}

/* Терминал склада (/orgs/{org}/m): страницы для телефона и терминала сбора
   данных — крупные кнопки и поля, без меню и боковой панели. */
.m-shell { max-width: 640px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.m-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 6px; min-height: 56px; padding: 6px 12px;
  background: var(--card); border-bottom: 1px solid var(--line); }
.m-back { display: grid; place-items: center; width: 40px; height: 40px; margin-left: -6px; border-radius: var(--r); color: var(--accent-text); }
.m-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.m-title b { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-title span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-home { padding: 8px 10px; font-weight: 600; }
#m-main { flex: 1; padding: 14px 16px 24px; }
#m-main h2 { margin: 20px 0 8px; }
.m-foot { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; padding: 12px 16px; font-size: 13px; color: var(--muted);
  border-top: 1px solid var(--line); }
.m-foot form { margin-left: auto; }
.m-whpick select { font-size: 17px; padding: 10px; }
.m-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.m-tile { display: flex; flex-direction: column; gap: 4px; min-height: 104px; padding: 16px 14px; border-radius: calc(var(--r-lg) + 2px); background: var(--card);
  border: 1px solid var(--line); color: var(--fg); box-shadow: var(--shadow-sm); }
.m-tile:hover { text-decoration: none; border-color: var(--accent); }
.m-tile b { font-size: 18px; color: var(--accent-text); }
.m-tile span { font-size: 13px; color: var(--muted); }
.m-wide { display: block; text-align: center; padding: 14px; font-size: 17px; margin-bottom: 8px; }
.m-scan { margin-bottom: 14px; }
.m-scanrow { display: flex; gap: 8px; align-items: stretch; }
.m-scanrow input { flex: 1; min-width: 0; margin: 0; font-size: 18px; padding: 12px; }
.m-scanrow button { min-width: 52px; min-height: 52px; font-size: 16px; }
.m-cambtn { display: grid; place-items: center; padding: 0; color: var(--accent-text); }
.m-cambtn[hidden] { display: none; }
.m-cambtn.active { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.m-full { margin-bottom: 10px; }
.m-qty, .m-more, .m-left { margin-top: 10px; }
.m-qty summary, .m-more summary, .m-left summary, .m-fix summary { color: var(--accent-text); cursor: pointer; font-size: 14px; padding: 4px 0; }
.m-qty input { font-size: 17px; max-width: 12rem; }
.m-left ul { margin: 6px 0 0; padding-left: 20px; }
.m-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.m-cards a { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); color: var(--fg); box-shadow: var(--shadow-sm); }
.m-cards a:hover { text-decoration: none; border-color: var(--accent); }
.m-cards a b { color: var(--accent-text); }
.m-overdue { color: var(--err-fg); }
.m-lines { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.m-lines li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.m-lines li:last-child { border-bottom: 0; }
.m-lines li.last { background: var(--ok-bg); }
.m-lines li.done .m-name, .m-lines li.done .m-q { color: var(--muted); }
.m-lines li.done .m-q b::before { content: "✓ "; color: var(--ok-fg); }
.m-name { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.m-q { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.m-q b { font-size: 18px; }
.m-fix { grid-column: 1 / -1; }
.m-fixform { display: flex; gap: 8px; margin-top: 4px; }
.m-fixform input { margin: 0; max-width: 9rem; font-size: 17px; }
.m-choices form { margin-top: 8px; }
.m-choice { width: 100%; text-align: left; padding: 12px; }
.m-head { margin: 0 0 4px; }
.m-figures { display: flex; gap: 20px; flex-wrap: wrap; }
.m-figures div { display: flex; flex-direction: column; }
.m-figures b { font-size: 22px; }
.m-prefilled { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); }
.m-cam { position: sticky; top: 56px; z-index: 4; background: #000; }
.m-cam[hidden] { display: none; }
.m-cam video { display: block; width: 100%; height: 34vh; object-fit: cover; }
.m-cam-bar { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 6px 12px; color: #fff; font-size: 13px; }
.m-cam-bar button { padding: 6px 12px; }

/* Код из письма: цифры крупно и вразрядку */
input.code { font-size: 20px; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }

/* Тариф и оплата: баннер о подписке, состояние, карточки тарифов */
.banner { padding: 11px 14px; border-radius: var(--r); margin-bottom: 16px; border: 1px solid color-mix(in srgb, currentColor 18%, transparent); }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.error { background: var(--err-bg); color: var(--err-fg); }
.banner a { color: inherit; font-weight: 600; }
/* Владелец программы в базе компании (visit.go). */
.banner.visit { background: var(--warn-bg); color: var(--warn); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.banner.visit .visit-actions { display: inline-flex; gap: 8px; margin-left: auto; }
.banner.visit form { margin: 0; }
.substate-title { margin: 0 0 12px; font-size: 15px; }
.substate-kpis { margin-bottom: 8px; }
.kpi .value.small { font-size: 14px; font-weight: 600; }
.chip.ok, .chip.paid { background: var(--ok-bg); color: var(--ok-fg); }
.chip.warn, .chip.issued { background: var(--warn-bg); color: var(--warn); }
.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 18px; }
.plan { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; background: var(--card); box-shadow: var(--shadow-sm); }
.plan.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
/* Карточка тарифа выбирается кликом: прозрачная радиокнопка накрывает всю карточку. */
.plan.pickable { position: relative; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.plan.pickable:hover { border-color: var(--accent); }
.plan-pick { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.plan.pickable:has(.plan-pick:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); background: var(--accent-soft); }
.plan.pickable:has(.plan-pick:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.plan-mark { display: none; position: absolute; top: 12px; right: 12px; font-size: 11.5px; font-weight: 650; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-fg); }
.plan-pick:checked + .plan-mark { display: inline-block; }
.plan h3 { margin: 0 0 6px; font-size: 17px; }
.plan .price { margin: 0 0 8px; font-size: 15px; }
.plan .price b { font-size: 20px; color: var(--strong); }
.plan ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); }
/* «За год / Помесячно» на странице тарифов: радиокнопки скрыты, подписи —
   вкладки; видна цена выбранного срока (как на сайте, static/site.css). */
.terms { position: relative; }
.term-radio { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.term-switch { display: inline-flex; gap: 4px; margin: 0 0 14px; padding: 3px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; }
.term-switch label { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: 13.5px; color: var(--muted); cursor: pointer; user-select: none; }
.term-save { font-size: 11.5px; font-weight: 650; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); }
#term-year:checked ~ .term-switch label[for="term-year"], #term-month:checked ~ .term-switch label[for="term-month"] { background: var(--accent); color: var(--accent-fg); }
#term-year:checked ~ .term-switch label[for="term-year"] .term-save { background: rgba(255, 255, 255, .22); color: inherit; }
.term-radio:focus-visible ~ .term-switch { outline: 2px solid var(--accent); outline-offset: 2px; }
#term-year:checked ~ .plans .price-month, #term-month:checked ~ .plans .price-year { display: none; }
.plan .plan-save { margin: 0 0 8px; font-size: 12.5px; color: var(--accent-text); }
.plan .price-month .plan-save { color: var(--muted); }
table.props th { text-align: left; color: var(--muted); font-weight: 500; width: 9rem; }
[data-theme="classic"] .plan, [data-theme="classic"] .banner { border-radius: 0; }

/* Связь: переписка WhatsApp, звонки, кнопки у номеров (comms.go). */
.phoneacts { display: inline-flex; gap: 2px; margin-left: 6px; vertical-align: middle; }
.inlineform { display: inline; margin: 0; }
/* Вспомогательные классы вместо инлайн-стилей (их запрещает CSP). */
input.upper { text-transform: uppercase; }
input.short { width: 7em; max-width: 8rem; }
input.mid { width: 11em; max-width: 12rem; }
th.left { text-align: left; }
td[data-level] { padding-left: 8px; }
td[data-level="1"] { padding-left: 26px; } td[data-level="2"] { padding-left: 44px; } td[data-level="3"] { padding-left: 62px; }
td[data-level="4"] { padding-left: 80px; } td[data-level="5"] { padding-left: 98px; } td[data-level="6"] { padding-left: 116px; }
.iconbtn { padding: 1px 6px; font-size: 13px; line-height: 1.4; border-radius: var(--r-sm); box-shadow: none; background: transparent; border-color: transparent; }
.iconbtn:hover { background: var(--hover); border-color: var(--line); }
.nowrap { white-space: nowrap; }
.chatgrid { display: grid; grid-template-columns: minmax(240px, 320px) 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .chatgrid { grid-template-columns: 1fr; } }
.chatlist { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; box-shadow: var(--shadow-sm); }
.chatrow { display: block; padding: 8px 10px; margin: 0 -4px; border-radius: var(--r); color: var(--fg); }
.chatrow:hover { background: var(--hover); text-decoration: none; }
.chatrow.active { background: var(--accent-soft); }
.chatrow-head { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.chatrow-head b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat h2 { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.messages { display: flex; flex-direction: column; gap: 8px; padding: 16px; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-lg); min-height: 200px; max-height: 60vh; overflow-y: auto; }
.msg { max-width: 72%; padding: 8px 12px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-sm); overflow-wrap: anywhere; }
.msg .body { white-space: pre-wrap; }
.msg.in { align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.out { align-self: flex-end; background: var(--accent-soft); border-color: transparent; border-bottom-right-radius: 4px; }
.msg .attach { font-weight: 600; }
.msg .meta { margin-top: 2px; }
.sendform { display: flex; gap: 10px; margin-top: 12px; }
.sendform input { margin: 0; }
.sendmenu .menu { min-width: 300px; padding: 12px 14px; }
.sendmenu .stack label { margin-top: 8px; }
.sendmenu .stack button { margin-top: 10px; }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px 14px; }
legend { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0 6px; }
/* Карточка входящего звонка (app.js по data-live). */
.calltoast { position: fixed; right: 20px; bottom: 20px; z-index: 50; width: min(360px, calc(100vw - 40px)); background: var(--card); color: var(--fg);
  border: 1px solid var(--accent); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); padding: 14px 16px; animation: calltoast .25s ease; }
@keyframes calltoast { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.calltoast .ct-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); font-weight: 600; }
.calltoast .ct-phone { font-size: 20px; font-weight: 700; color: var(--strong); margin: 4px 0 2px; }
.calltoast .ct-name { margin-bottom: 8px; }
.calltoast .ct-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.calltoast .ct-close { background: none; border: none; box-shadow: none; padding: 0 4px; font-size: 18px; color: var(--muted); }

/* Расчеты по договорам — строки под контрагентом (settlements.html). */
tr.sub td { font-size: 13px; color: var(--muted); }
tr.sub td.indent { padding-left: 28px; }
tr.sub td a { color: inherit; }
/* Документы долга в отчете «Долги по срокам». */
td details summary { cursor: pointer; color: var(--muted); }
td details table { margin-top: 4px; }
tr.items td { padding-top: 0; border-top: 0; }
tr.items details table { width: auto; }
td.num.bad { color: var(--err-fg); }
/* План счетов и ведомости: уровень вложенности субсчета, строка счета-группы. */
td.lvl1 { padding-left: 28px; }
td.lvl2 { padding-left: 46px; }
td.lvl3 { padding-left: 64px; }
td.lvl4 { padding-left: 82px; }
tr.grp td { font-weight: 600; color: var(--strong); }
/* Итог документа — справа под таблицей позиций, как в МойСклад. */
form.card > p.big { text-align: right; margin: 14px 0 4px; }

/* Страница «Помощь»: оглавление слева, разделы-карточки справа. */
.mb0 { margin-bottom: 0; }
.help { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.help-toc { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; padding: 12px; }
.help-toc a { padding: 6px 8px; border-radius: var(--r-sm); color: var(--fg); text-decoration: none; }
.help-toc a:hover { background: var(--hover); color: var(--accent-text); }
.help-head { color: var(--subtle); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 0 8px 6px; margin: 0; }
.help-body section { scroll-margin-top: 16px; max-width: 860px; }
.help-body h2 { font-size: 17px; }
.help-steps { padding-left: 22px; }
.help-steps li { margin-bottom: 10px; }
.help-faq dt { font-weight: 600; color: var(--strong); margin-top: 12px; }
.help-faq dd { margin: 4px 0 0; color: var(--muted); }
@media (max-width: 720px) { .help { grid-template-columns: 1fr; } .help-toc { position: static; } }
.hint { margin: -4px 0 14px; }

/* Распознавание документов (recognize.go): файл слева, форма проверки справа. */
.recognize { display: grid; grid-template-columns: minmax(260px, 2fr) minmax(0, 3fr); gap: 18px; align-items: start; }
.recognize-file { position: sticky; top: 72px; }
.recognize-file img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); }
.recognize-file object { width: 100%; height: 80vh; border: 1px solid var(--line); border-radius: var(--r-lg); }
.recognize-form table.lines input { min-width: 4rem; }
.recognize-form table.lines td:first-child input { min-width: 14rem; }
.recognize-form table.lines select { max-width: 16rem; }
@media (max-width: 900px) { .recognize { grid-template-columns: 1fr; } .recognize-file { position: static; } .recognize-file object { height: 50vh; } }

/* Доска сделок как в Битрикс24: каждая стадия целиком подсвечена своим цветом (--stage),
   суммы по стадиям, карточки с клиентом, ответственным и делами. */
.board.kanban { display: flex; gap: 12px; overflow-x: auto; align-items: flex-start; padding-bottom: 8px; scrollbar-width: thin; }
.board.kanban .column { flex: 0 0 264px; min-height: 180px; --stage: var(--muted); padding: 0 8px 8px; transition: outline-color .15s ease;
  background: color-mix(in srgb, var(--stage) 16%, var(--raised)); border-color: color-mix(in srgb, var(--stage) 45%, var(--line)); border-top: 4px solid var(--stage); }
.board.kanban .column.over { outline: 2px dashed var(--accent); outline-offset: 2px; }
.stagehead { display: flex; flex-direction: column; gap: 0; padding: 9px 4px 8px; margin: 0 0 8px; color: color-mix(in srgb, var(--stage) 65%, var(--strong)); }
.stagehead b { font-size: 13px; line-height: 1.3; }
.stagehead span { font-size: 12px; opacity: .92; font-variant-numeric: tabular-nums; }
.column > .dealcard[draggable="true"] { cursor: grab; }
.dealcard.dragging { opacity: .45; }
.dealcard.closed { opacity: .85; }
.dc-head { display: flex; gap: 6px; align-items: baseline; justify-content: space-between; }
.dc-title { font-weight: 600; color: var(--strong); }
.dc-amount { font-weight: 700; color: var(--strong); font-variant-numeric: tabular-nums; display: flex; gap: 6px; align-items: center; }
.dc-client { font-size: 13px; }
.dc-foot { display: flex; align-items: center; gap: 8px; margin-top: 4px; min-height: 24px; }
.dc-foot .avatar { width: 24px; height: 24px; font-size: 11px; }
.dc-acts { display: flex; gap: 2px; align-items: center; }
.dc-acts .iconbtn { font-size: 14px; padding: 1px 4px; }
.dc-tasks { margin-left: auto; font-size: 12px; white-space: nowrap; }
.dc-last { font-size: 12px; }
.quick > summary { font-size: 12.5px; font-weight: 600; color: var(--accent-text); cursor: pointer; list-style: none; margin: 0 4px 8px; }
.quick > summary::-webkit-details-marker { display: none; }
.quick form.card { padding: 10px; margin-bottom: 8px; }
.quick form.card label { margin-bottom: 6px; }
.quick form.card .actions { margin-top: 8px; }
.chip.stage { --stage: var(--muted); background: color-mix(in srgb, var(--stage) 18%, var(--card)); color: color-mix(in srgb, var(--stage) 70%, var(--strong)); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; background: var(--card); }
.seg a { padding: 6px 12px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.seg a:hover { background: var(--hover); text-decoration: none; }
.seg a.on { background: var(--accent-soft); color: var(--accent-text); }
.seg a + a { border-left: 1px solid var(--line-strong); }
.dealtabs { margin-top: 0; }
.dealtabs .counter { font-weight: 500; font-size: 13px; }
.dealtabs .counter.warn { color: var(--err-fg); }
.inlineform { display: inline; }
td.nowrap { white-space: nowrap; }
input[type="color"] { width: 46px; height: 34px; padding: 2px 4px; margin-top: 0; vertical-align: middle; cursor: pointer; }
input.stagename { --stage: var(--muted); border-left: 6px solid var(--stage); margin-top: 0; }
@media (max-width: 720px) {
  .board.kanban .column { flex-basis: 84vw; }
}
[data-theme="classic"] .board.kanban .column { background: color-mix(in srgb, var(--stage) 22%, var(--card)); border-radius: 0; }
[data-theme="classic"] .stagehead { color: var(--fg); }
[data-theme="classic"] .seg a.on { background: var(--sel); color: #fff; }

/* Диск: файлы и фото на карточках (filesbox) и раздел «Файлы». */
.filegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 14px; }
.filegrid.gallery { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.file { margin: 0; display: flex; flex-direction: column; gap: 6px; padding: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); min-width: 0; }
.file.main { border-color: var(--accent); }
.file .preview { display: flex; align-items: center; justify-content: center; height: 120px; border-radius: var(--r); background: var(--chip); overflow: hidden; }
.filegrid.gallery .file .preview { height: 150px; }
.file .preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.file .ext, .filecell .ext { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 32px; padding: 0 8px; border-radius: var(--r); background: var(--chip); color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.file .preview .ext { height: 44px; font-size: 14px; }
.file figcaption { display: flex; flex-direction: column; gap: 2px; font-size: 14px; min-width: 0; }
.file figcaption > a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fileactions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.fileupload { padding: 14px 18px; }
.filecell { width: 56px; }
.filethumb { display: block; width: 48px; height: 48px; object-fit: cover; border-radius: var(--r); border: 1px solid var(--line); }

/* Стартовая страница (home.html): приветствие на темном индиго-блоке,
   помощник настройки, быстрые действия, организации. */
.hero { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px; overflow: hidden;
  margin: 0 0 18px; padding: 26px 30px; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); border-radius: var(--r-lg);
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent) 26%, transparent) 0%, transparent 55%),
    linear-gradient(135deg, var(--accent-soft) 0%, var(--card) 70%); }
.hero-text { position: relative; min-width: 0; }
.hero-date { margin: 0 0 4px; color: var(--accent-text); font-size: 13px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.hero-title { font-size: 30px; margin: 0 0 6px; }
.hero-sub { margin: 0; color: var(--muted); }
.hero-art { flex: none; width: 132px; height: 100px; fill: var(--accent); opacity: .85; }
.hero-art rect:nth-child(odd) { fill: color-mix(in srgb, var(--accent) 55%, var(--card)); }

.setupcard { padding: 20px 22px; }
.setup-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.setup-title { margin: 0 0 2px; }
.setup-head .linklike { white-space: nowrap; }
.setupbar { display: block; width: 100%; height: 8px; margin: 14px 0 16px; border: 0; border-radius: 999px; background: var(--chip); overflow: hidden; appearance: none; }
.setupbar::-webkit-progress-bar { background: var(--chip); border-radius: 999px; }
.setupbar::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
.setupbar::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.setupsteps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px; }
.setupsteps a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--r); color: var(--fg); background: var(--raised); }
.setupsteps a:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); text-decoration: none; }
.setupsteps .txt, .wizardsteps .txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.setupsteps small, .wizardsteps small { color: var(--subtle); font-size: 12px; }
.dot { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 700;
  border: 1.5px solid var(--line-strong); color: var(--muted); background: var(--card); }
.done > a .dot, a.done .dot { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.done > a small, a.done small { color: var(--accent-text); }
.skipped > a .dot, a.skipped .dot { border-style: dashed; }
.blocked > a, a.blocked { opacity: .6; }
.setupsteps .next a { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
.setupsteps .next .dot { border-color: var(--accent); color: var(--accent-text); }
.setupnext { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }

.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 8px; }
.quicktile { display: flex; gap: 12px; align-items: center; padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); color: var(--fg); box-shadow: var(--shadow-sm); }
.quicktile:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: var(--shadow); text-decoration: none; }
.quicktile svg { flex: none; width: 38px; height: 38px; padding: 8px; border-radius: var(--r); background: var(--accent-soft); fill: none; stroke: var(--accent-text); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.quicktile span { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.quicktile small { color: var(--subtle); font-size: 12.5px; }

.homehead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.orgcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.orgcard { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow-sm); }
.orgcard.current { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.orghead { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; color: var(--fg); }
.orghead:hover { text-decoration: none; }
.orghead:hover b { color: var(--accent-text); }
.orghead span:last-child { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.orghead small { color: var(--muted); font-size: 12.5px; }
.emptyhome { max-width: 760px; }
.homehelp { margin-top: 28px; }

/* Помощник настройки (start.html): шаги слева, выбранный шаг справа. */
.wizardtop { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.wizardtop p { max-width: 760px; margin-bottom: 0; }
.wizardcount { display: flex; flex-direction: column; align-items: flex-end; flex: none; line-height: 1.2; }
.wizardcount b { font-size: 22px; color: var(--strong); }
.wizard { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; margin-bottom: 14px; }
.wizardsteps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.wizardsteps a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--r); color: var(--fg); border: 1px solid transparent; }
.wizardsteps a:hover { background: var(--hover); text-decoration: none; }
.wizardsteps a.on { background: var(--card); border-color: var(--accent); box-shadow: var(--shadow-sm); }
.wizardstep { margin: 0; padding: 22px 24px; }
.wizardhead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 2px 0 4px; }
.wizardhead h2 { margin: 0; font-size: 22px; }
.stepstatus { padding: 2px 10px; border-radius: 999px; background: var(--chip); color: var(--muted); font-size: 12.5px; font-weight: 600; }
.stepstatus.done { background: var(--ok-bg); color: var(--ok-fg); }
.stepstatus.skipped { background: var(--warn-bg); color: var(--warn); }
.wizardstep > p { max-width: 720px; }
.facts { margin: 0 0 4px; padding: 10px 14px 10px 30px; border-radius: var(--r); background: var(--raised); border: 1px solid var(--line); }
.facts li { margin: 2px 0; }
.wizardfoot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.wizardfoot form { margin: 0; }
.wizardfoot .button:only-child { margin-left: auto; }
@media (max-width: 860px) {
  .wizard { grid-template-columns: 1fr; }
  .hero { padding: 20px; }
  .hero-art { display: none; }
  .hero-title { font-size: 24px; }
  .wizardtop { flex-direction: column; align-items: flex-start; }
  .wizardcount { align-items: flex-start; }
}
[data-theme="classic"] .hero { background: var(--card); border-color: var(--line); }
[data-theme="classic"] .hero-art { display: none; }
[data-theme="classic"] .hero-date { text-transform: none; letter-spacing: 0; }
[data-theme="classic"] .quicktile, [data-theme="classic"] .orgcard, [data-theme="classic"] .setupsteps a, [data-theme="classic"] .facts { border-radius: 0; }
[data-theme="classic"] .dot { border-radius: 0; }
/* Табличная часть документа: ручка перетаскивания, крестик удаления, кнопка
   «Добавить строку», подбор номенклатуры в строке (app.js). */
td.linedrag, th.linedrag { width: 1.5rem; padding-left: 6px; padding-right: 0; }
td.linedel, th.linedel { width: 1.5rem; padding-left: 0; padding-right: 6px; }
td.linedrag .handle, td.linedel .del { padding: 2px 6px; border: 0; background: none; box-shadow: none; color: var(--muted); font-size: 15px; line-height: 1.2; }
td.linedrag .handle { cursor: grab; touch-action: none; letter-spacing: -2px; }
td.linedrag .handle:hover, td.linedel .del:hover { background: var(--hover); color: var(--fg); }
td.linedel .del:hover { color: var(--err-fg); }
tr.dragging > td { background: var(--accent-soft); opacity: .85; }
.linesbar { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.linesbar .muted { margin: 0; }
.pick { display: flex; align-items: center; gap: 4px; min-width: 14rem; }
.pick a.itemlink { flex: none; padding: 2px 5px; border-radius: var(--r); color: var(--muted); font-size: 14px; line-height: 1; text-decoration: none; }
.pick a.itemlink:hover { background: var(--hover); color: var(--accent-text); }
.pick input.unknown { border-color: var(--err-fg); }
.picklist { position: fixed; z-index: 30; max-height: 16rem; overflow-y: auto; background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--r); box-shadow: var(--shadow-sm); margin-top: 2px; }
.pickitem { padding: 6px 10px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pickitem.active, .pickitem:hover { background: var(--accent-soft); }

/* Панель поверх документа: карточка номенклатуры по ссылке ↗ в строке
   (app.js); страница внутри открыта с ?panel=1 — без меню. */
.drawer-back { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .35); display: flex; justify-content: flex-end; }
.drawer { width: min(720px, 100%); height: 100%; background: var(--card); display: flex; flex-direction: column; box-shadow: -4px 0 24px rgba(0, 0, 0, .2); }
.drawer header { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-weight: 600; }
.drawer header .close { margin-left: auto; border: 0; background: none; box-shadow: none; font-size: 22px; line-height: 1; padding: 2px 8px; color: var(--muted); }
.drawer header .close:hover { background: var(--hover); color: var(--fg); }
.drawer iframe { flex: 1; width: 100%; border: 0; background: var(--bg); }
body.drawer-open { overflow: hidden; }
/* Форма подбора номенклатуры с остатками (app.js [data-pick-open]). */
.pickdrawer { width: min(860px, 100%); }
.pickdrawer header .muted { font-weight: 400; }
.pickbar { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pickbar input[type="search"] { flex: 1; min-width: 200px; margin: 0; }
.pickbar .check { display: flex; gap: 6px; align-items: center; margin: 0; white-space: nowrap; }
.picktable { flex: 1; overflow-y: auto; }
.picktable table { width: 100%; border-collapse: collapse; }
.picktable th { position: sticky; top: 0; background: var(--card); z-index: 1; }
.picktable th, .picktable td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.picktable .num { text-align: right; white-space: nowrap; }
.pickdrawer.nowh .picktable th:nth-child(4), .pickdrawer.nowh .picktable td:nth-child(4) { display: none; }
.picktable tr:not(:first-child) { cursor: pointer; }
.picktable tr.active td, .picktable tr:not(:first-child):hover td { background: var(--accent-soft); }
.pickdrawer footer { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--line); }
.pickdrawer footer .muted { margin: 0; }
body.panel .topbar, body.panel nav.subnav, body.panel .orgs-sidebar, body.panel .pagebar { display: none !important; }
body.panel main.page { padding: 12px 16px 32px; }

/* ===== Оформление «блоками» (2026-10-24, по мотивам айдентики «Путь к успеху»):
   темная верхняя панель, пункты раздела плитками, три полоски логотипа как
   знак перед заголовком страницы и на странице входа, цветные роли палитры.
   Классическое оформление эти правила не трогают (сбросы в конце блока). ===== */
.topbar { background: var(--top-bg); border-bottom-color: var(--top-line); box-shadow: none; }
.topbar a.brand { color: var(--top-strong); }
nav.areas .area > a { color: var(--top-fg); }
nav.areas .area > a:hover, nav.areas .area:hover > a { color: var(--top-strong); background: var(--top-hover); }
nav.areas .area > a.active { color: var(--top-strong); border-bottom-color: var(--accent); background: var(--top-hover); }
nav.areas .area > a.active svg { stroke: var(--yellow); }
.topmenu > summary { color: var(--top-fg); }
.topmenu > summary:hover, .topmenu[open] > summary { background: var(--top-hover); color: var(--top-strong); }
.topmenu.active > summary { color: var(--yellow); }
.orgmenu .orgname b { color: var(--top-strong); }
.orgmenu .orgname small, .orgmenu > summary::after { color: var(--top-fg); }
.usermenu .avatar:not([class*="tone"]) { background: var(--top-hover); color: var(--top-strong); }

/* Пункты раздела — плитки; активная залита акцентом. */
nav.subnav { gap: 2px; padding: 6px 16px; }
nav.subnav a { flex: 0 1 auto; padding: 5px 12px; margin: 0; border: 0; border-radius: 8px; font-weight: 500; }
nav.subnav a:hover { background: var(--hover); }
nav.subnav a.active { background: var(--accent); color: var(--accent-fg); border-bottom: 0; font-weight: 600; }

/* Знак перед заголовком страницы: три полоски логотипа (рисуются градиентами,
   без картинок — data: URI запрещены CSP). */
.pagetitle h1::before { content: ""; display: inline-block; width: 16px; height: 18px; margin-right: 4px;
  background: linear-gradient(var(--yellow), var(--yellow)) 0 100% / 4px 60% no-repeat,
    linear-gradient(var(--yellow), var(--yellow)) 50% 100% / 4px 100% no-repeat,
    linear-gradient(var(--yellow), var(--yellow)) 100% 100% / 4px 78% no-repeat; }
h1 { font-weight: 750; letter-spacing: -.02em; }
th { color: var(--accent-text); letter-spacing: .03em; text-transform: uppercase; font-size: 11.5px; }
button, .button { box-shadow: none; }
.pagebar .cardtabs .button.on, .pagebar .filterbtn.on { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.pagebar .cardtabs .button.on .count { background: var(--yellow); color: #2b2100; }
.pagebar .filterbtn.on { background: var(--teal-soft); color: var(--teal-text); border-color: var(--teal); }
tr.current > td, tr[data-row].selected > td { background: var(--rose-soft); }

/* Чипы: «проведен» бирюзовый, «отменен» розовый, пометки вроде «из Торговли» — индиго. */
.chip { background: var(--accent-soft); color: var(--accent-text); }
.chip.posted, .chip.done { background: var(--teal-soft); color: var(--teal-text); }
.chip.cancelled, .chip.rejected, .chip.error { background: var(--rose-soft); color: var(--rose-text); }
.chip.pending { background: var(--yellow-soft); color: var(--yellow-text); }
.notice { background: var(--teal-soft); color: var(--teal-text); }
.orgmenu .menu a.add, form a[href*="new"] { color: var(--rose-text); }

/* Главная: приветствие — темный индиго-блок с желтыми и розовыми полосками;
   помощник: сделано — бирюза, следующий шаг — желтый. */
.hero { background: linear-gradient(120deg, var(--top-bg) 0%, #4a4b9a 100%); border: 0; color: #fff; }
.hero-date { color: var(--yellow); }
.hero-title { color: #fff; }
.hero-sub { color: #c9cae6; }
.hero-art { fill: var(--yellow); opacity: 1; }
.hero-art rect:nth-child(odd) { fill: var(--rose); }
.setupbar::-webkit-progress-value { background: var(--yellow); }
.setupbar::-moz-progress-bar { background: var(--yellow); }
.done > a .dot, a.done .dot { background: var(--teal); border-color: var(--teal); color: #fff; }
.done > a small, a.done small { color: var(--teal-text); }
.setupsteps a { border-color: var(--line-strong); }
.setupsteps small { color: var(--muted); }
.setupsteps .next a { border-color: var(--yellow); box-shadow: 0 0 0 1px var(--yellow); background: var(--yellow-soft); }
.setupsteps .next .dot { border-color: var(--yellow); color: var(--yellow-text); background: var(--card); }
.blocked > a, a.blocked { opacity: .78; }
.quicktile, .orgcard { background: var(--raised); border-color: var(--line-strong); }
.quicktile small { color: var(--muted); }
.quicktile svg { border-radius: 9px; }
.quicktile:nth-child(4n+2) svg { background: var(--yellow-soft); stroke: var(--yellow-text); }
.quicktile:nth-child(4n+3) svg { background: var(--rose-soft); stroke: var(--rose-text); }
.quicktile:nth-child(4n) svg { background: var(--teal-soft); stroke: var(--teal-text); }
.avatar.tone0 { --tone: #c9a227; } .avatar.tone1 { --tone: #2fa39b; } .avatar.tone2 { --tone: #5b5bc0; }
.avatar.tone3 { --tone: #e2679b; } .avatar.tone4 { --tone: #4a8fd6; } .avatar.tone5 { --tone: #9a6ad6; }

/* Вход: спокойный фон, по бокам большие бледные полоски логотипа. */
.bare { position: relative; overflow: hidden; background: var(--bg); }
.bare::before, .bare::after { content: ""; position: absolute; bottom: -4%; width: 260px; height: 62%; opacity: .10;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 60px 58% no-repeat,
    linear-gradient(var(--accent), var(--accent)) 50% 100% / 60px 100% no-repeat,
    linear-gradient(var(--accent), var(--accent)) 100% 100% / 60px 76% no-repeat; }
.bare::before { left: 7%; }
.bare::after { right: 7%; height: 46%; opacity: .07; }
.bare main.card { position: relative; z-index: 1; border: 1px solid var(--line); padding: 32px; }
.bare .brand-line { font-weight: 800; font-size: 19px; }
.bare h1 { font-size: 28px; }

/* Классическое оформление: без полосок и блочных подложек. */
[data-theme="classic"] .pagetitle h1::before, [data-theme="classic"] .bare::before, [data-theme="classic"] .bare::after { display: none; }
[data-theme="classic"] nav.subnav a.active { background: none; color: var(--fg); }
[data-theme="classic"] th { text-transform: none; letter-spacing: 0; }
[data-theme="classic"] .hero-title, [data-theme="classic"] .hero-sub { color: var(--fg); }
[data-theme="classic"] .quicktile, [data-theme="classic"] .orgcard { background: var(--card); border-color: var(--grid); }
[data-theme="classic"] .bare main.card { padding: 12px; }

/* Счетчики CRM в меню (как в Битрикс24): число у пункта и на значке. */
.navcount { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--yellow-soft, var(--chip)); color: var(--yellow-text, var(--fg));
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; vertical-align: 1px; }
.navcount.warn { background: var(--rose, #e5484d); color: #fff; }
nav.areas .area > a { position: relative; }
.navbadge { position: absolute; top: 2px; right: 50%; margin-right: -22px; min-width: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--rose, #e5484d); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }

/* Роботы на странице воронки: колонки стадий. */
.robotstages { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.robotstage { --stage: var(--muted); border: 1px solid var(--line); border-top: 4px solid var(--stage); border-radius: var(--r-md, 8px); padding: 10px 12px; background: var(--card); }
.robotstage h3 { margin: 0 0 8px; font-size: 14px; }
.robotrow { padding: 6px 0; border-top: 1px solid var(--line); }
.robotrow:first-of-type { border-top: 0; }
[data-robot-for][hidden] { display: none; }
.delayfield { display: flex; gap: 8px; }
.delayfield input { width: 6em; flex: 0 0 auto; }
.delayfield select { flex: 1 1 auto; }

/* Календарь CRM. */
.calbar { align-items: center; flex-wrap: wrap; }
.caltitle { font-size: 16px; margin: 0 6px; }
table.calendar { table-layout: fixed; width: 100%; min-width: 760px; }
table.calendar.day { min-width: 0; }
table.calendar th, table.calendar td { border: 1px solid var(--line); vertical-align: top; padding: 4px; }
table.calendar th.calhour { width: 72px; text-align: right; color: var(--muted); font-weight: 500; text-transform: none; }
table.calendar th.today { background: var(--yellow-soft, var(--accent-soft)); }
table.calendar th.weekend a { color: var(--muted); }
table.calendar td { height: 34px; }
.calevent { display: block; margin: 0 0 4px; padding: 4px 6px; border-radius: 6px; border-left: 3px solid var(--accent); background: var(--accent-soft);
  color: var(--fg); font-size: 12.5px; line-height: 1.3; overflow: hidden; }
.calevent:hover { text-decoration: none; filter: brightness(.97); }
.calevent.kind-meeting { border-left-color: var(--teal, #12a594); background: var(--teal-soft, var(--accent-soft)); }
.calevent.kind-call { border-left-color: var(--yellow, #f5b400); background: var(--yellow-soft, var(--chip)); }
.calevent.overdue { border-left-color: var(--rose, #e5484d); }
.calevent.done { opacity: .55; text-decoration: line-through; }
.calevent .ce-time { font-weight: 700; margin-right: 4px; }
.calevent .ce-kind { color: var(--muted); font-size: 11px; margin-right: 4px; }
.calevent .ce-subj { display: block; font-weight: 600; }
.calevent .ce-rel { display: block; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.remindtoast { bottom: calc(20px + var(--stack, 0) * 150px); border-color: var(--yellow, var(--accent)); }

/* Загрузка каталога витрины файлом: ход в фоне (shop_settings.html) */
.catalog-job { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 10px 0 14px; }
.catalog-job p { margin: 4px 0; }
.catalog-job progress { width: 100%; height: 8px; appearance: none; border: 0; background: var(--chip); border-radius: 999px; overflow: hidden; }
.catalog-job progress::-webkit-progress-bar { background: var(--chip); border-radius: 999px; }
.catalog-job progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
.catalog-job progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.catalog-job ul { margin: 6px 0 0; padding-left: 18px; max-height: 220px; overflow: auto; }
