/* iSklad — разделы на компьютере (от 821px). Одна главная кнопка и «Ещё», поиск без «Показать», период кнопками,
   таблицы без повторов, карточки в две колонки. Детали для телефона — в mobile.css; эти блоки на телефоне скрыты (.desk-only). */

/* ---------- колокольчик в боковом меню: вместо плашек сверху каждой страницы ---------- */
.side-bell { position:absolute; top:17px; right:12px; width:38px; height:38px; display:grid; place-items:center; padding:0; border:0; border-radius:10px;
  background:var(--ink-2); color:#c8d1e6; cursor:pointer; }
.side-bell:hover { background:var(--ink-line); color:#fff; }
.side-bell svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.side-bell b { position:absolute; top:-5px; right:-5px; min-width:18px; height:18px; padding:0 5px; box-sizing:border-box; border-radius:9px;
  background:var(--amber); color:#10172a; font-size:11px; font-weight:700; line-height:18px; text-align:center; box-shadow:0 0 0 2px var(--ink); }
.sidebar .brand { padding-right:60px; }
@media (min-width:821px) {
  /* на компьютере «Требует внимания» — окошко у колокольчика, а не шторка снизу */
  dialog.msheet#sh-alerts { inset:62px auto auto 16px; margin:0; width:440px; max-width:calc(100vw - 32px); max-height:calc(100vh - 90px);
    border-radius:16px; padding:10px 10px 6px; box-shadow:0 24px 60px -16px rgba(10,14,28,.45); }
  dialog.msheet#sh-alerts .msheet-grip { display:none; }
  dialog.msheet#sh-alerts h3 { margin:6px 8px 8px; font-size:15px; }
  dialog.msheet#sh-alerts::backdrop { background:rgba(10,14,28,.18); }
  dialog.msheet#sh-alerts[open] { animation:dk-pop .16s var(--ease) backwards; }
}
@keyframes dk-pop { from { opacity:0; transform:translateY(-6px); } }

/* ---------- шапка раздела: название, строка сводки, одна главная кнопка и «Ещё» ---------- */
.dk-head { display:flex; flex-wrap:wrap; align-items:flex-end; gap:10px 12px; margin:0 0 18px; }
.dk-title { flex:1 1 380px; min-width:0; }
.dk-title h1 { margin:0 !important; display:flex; flex-wrap:wrap; align-items:center; gap:10px; }
.dk-sub { margin:5px 0 0; color:var(--muted); font-size:14px; }
.dk-crumb { display:inline-flex; align-items:center; gap:4px; margin:0 0 6px; font-size:13.5px; font-weight:500; text-decoration:none !important; }
.dk-btn { display:inline-flex; align-items:center; justify-content:center; gap:7px; height:40px; padding:0 16px; box-sizing:border-box; border-radius:11px;
  border:1px solid var(--line); background:var(--card); color:var(--fg) !important; font:600 14px var(--ui); white-space:nowrap; cursor:pointer;
  text-decoration:none !important; transition:background-color .12s, border-color .12s, transform .1s; }
.dk-btn:hover { border-color:var(--action); }
.dk-btn:active { transform:scale(.98); }
.dk-btn svg { width:17px; height:17px; flex:none; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.dk-btn.pri { background:var(--action); border-color:var(--action); color:#fff !important; }
.dk-btn.on { border-color:var(--action); background:var(--action-soft); color:var(--action); }   /* выбран фильтр: «Обувь ▾» вместо «Все категории ▾» */
.dk-btn.pri:hover { background:var(--action-h); }
.dk-btn.in { background:var(--ok); border-color:var(--ok); color:#fff !important; }
.dk-btn.out { color:var(--err) !important; border-color:color-mix(in srgb, var(--err) 45%, var(--line)); }
.dk-btn.ic { width:40px; padding:0; }
.dk-btn.big { width:100%; height:48px; font-size:15.5px; border-radius:12px; }
.dk-btn.ghost { border:1.5px solid var(--action); color:var(--action) !important; background:var(--card); }
.dk-btn[disabled] { opacity:.5; cursor:default; }
.dk-link { border:0; background:none; padding:0; font:inherit; color:var(--action); cursor:pointer; font-weight:600; }

/* «Ещё ▾» — список редких действий */
details.dk-dd { position:relative; }
details.dk-dd > summary { list-style:none; }
details.dk-dd > summary::-webkit-details-marker { display:none; }
details.dk-dd[open] > summary { border-color:var(--action); }
.dk-menu { position:absolute; top:calc(100% + 6px); right:0; z-index:40; width:280px; padding:6px; background:var(--card); border:1px solid var(--line);
  border-radius:13px; box-shadow:0 18px 40px -12px rgba(16,23,42,.35); display:flex; flex-direction:column; }
.dk-menu.left { right:auto; left:0; }
.dk-menu a, .dk-menu button { display:flex; align-items:center; gap:10px; width:100%; padding:9px 10px; border:0; border-radius:9px; background:none;
  color:var(--fg) !important; font:500 14px var(--ui); text-align:left; text-decoration:none !important; cursor:pointer; box-sizing:border-box; }
.dk-menu a:hover, .dk-menu button:hover { background:var(--action-soft); }
.dk-menu svg { width:18px; height:18px; flex:none; fill:none; stroke:var(--action); stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.dk-menu em { margin-left:auto; font-style:normal; color:var(--muted); font-size:13px; }
.dk-menu small { display:block; color:var(--muted); font-size:12px; font-weight:400; }
.dk-menu hr { border:0; border-top:1px solid var(--line-2); margin:5px 4px; }
.dk-menu .danger, .dk-menu .danger svg { color:var(--err) !important; stroke:var(--err); }
.dk-menu form { margin:0; }

/* ---------- строка фильтров: поиск, чипы, период ---------- */
.dk-bar { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin:0 0 14px; }
.dk-bar form { margin:0; }
.dk-search { display:flex; align-items:center; gap:9px; flex:1 1 280px; max-width:430px; height:40px; box-sizing:border-box; padding:0 6px 0 12px;
  border:1px solid var(--line); border-radius:11px; background:var(--card); color:var(--muted); }
.dk-search:focus-within { border-color:var(--action); box-shadow:0 0 0 3px var(--action-soft); }
.dk-search input { flex:1; min-width:0; height:36px; margin:0 !important; padding:0 !important; border:0 !important; outline:0; background:transparent !important;
  box-shadow:none !important; font:inherit; color:var(--fg); }
.dk-search > svg { width:17px; height:17px; flex:none; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
.dk-search .m-scan { width:32px; height:32px; border-radius:8px; }
.dk-search .m-scan svg { width:19px; height:19px; }
.dk-chips { display:flex; flex-wrap:wrap; gap:6px; }
.dk-chip { display:inline-flex; align-items:center; gap:6px; height:32px; padding:0 12px; box-sizing:border-box; border-radius:16px; border:1px solid var(--line);
  background:var(--card); color:var(--fg) !important; font:500 13.5px var(--ui); white-space:nowrap; cursor:pointer; text-decoration:none !important; }
.dk-chip:hover { border-color:var(--action); }
.dk-chip.on { background:var(--ink); border-color:var(--ink); color:#fff !important; }
:root[data-theme="dark"] .dk-chip.on { background:var(--fg); border-color:var(--fg); color:var(--bg) !important; }
.dk-chip.wait { background:color-mix(in srgb, var(--amber) 16%, var(--card)); border-color:color-mix(in srgb, var(--amber) 55%, var(--line)); }
.dk-chip.wait.on { background:var(--amber); border-color:var(--amber); color:#1b1400 !important; }
.dk-seg { display:inline-flex; flex-wrap:wrap; gap:2px; padding:3px; border-radius:11px; background:color-mix(in srgb, var(--line) 70%, var(--bg)); }
.dk-seg a, .dk-seg button { display:inline-flex; align-items:center; height:32px; padding:0 12px; border:0; border-radius:8px; background:none;
  font:600 13.5px var(--ui); color:var(--muted) !important; text-decoration:none !important; cursor:pointer; white-space:nowrap; }
.dk-seg a.on, .dk-seg button.on { background:var(--card); color:var(--fg) !important; box-shadow:0 1px 3px rgba(16,23,42,.16); }
.dk-push { margin-left:auto; }
.dk-pop { position:absolute; top:calc(100% + 6px); right:0; z-index:40; width:300px; padding:14px; background:var(--card); border:1px solid var(--line);
  border-radius:13px; box-shadow:0 18px 40px -12px rgba(16,23,42,.35); }
.dk-pop label { display:flex; flex-direction:column; gap:4px; margin:0 0 10px; font-size:12.5px; color:var(--muted); }
.dk-pop input { margin:0; }
.dk-pop .dk-btn { width:100%; }
.dk-cal.on > summary { border-color:var(--action); color:var(--action) !important; }

/* ---------- таблицы ---------- */
.dk-card { background:var(--card); border:1px solid var(--line); border-radius:14px; box-shadow:var(--shadow); }
.dk-tbl { overflow-x:auto; }
table.dk-t { width:100%; border-collapse:collapse; margin:0; background:transparent; border:0; box-shadow:none; }
.dk-t th { padding:11px 14px; text-align:left; font-size:12px; font-weight:500; color:var(--muted); border-bottom:1px solid var(--line-2); white-space:nowrap; background:none; }
.dk-t td { padding:9px 14px; border-top:1px solid var(--line-2); vertical-align:middle; white-space:nowrap; }
.dk-t tbody tr:first-child td { border-top:0; }
.dk-t .r { text-align:right; }
.dk-t tbody tr[data-href] { cursor:pointer; }
.dk-t tbody tr[data-href]:hover td { background:var(--action-soft); }
.dk-t tr.dk-day td { background:var(--card-2); padding:8px 14px; font-size:13px; color:var(--muted); cursor:default; }
.dk-t tr.dk-day:hover td { background:var(--card-2); }
.dk-t tr.dk-day b { color:var(--fg); font-size:14px; font-weight:650; margin-right:8px; }
.dk-t tfoot td { background:var(--card-2); border-top:1px solid var(--line); font-weight:650; }
.dk-t .wrap { white-space:normal; }
.dk-cell { display:flex; align-items:center; gap:11px; min-width:0; }
.dk-cell .m-av { width:34px; height:34px; border-radius:10px; font-size:12.5px; }
.dk-cell .m-av.round { border-radius:50%; }
.dk-cell .m-av svg { width:18px; height:18px; }
.dk-nm { font-weight:600; color:var(--fg) !important; text-decoration:none !important; }
a.dk-nm:hover { color:var(--action) !important; }
.dk-no { font-weight:600; text-decoration:none !important; }
.dk-small { display:block; font-size:12.5px; color:var(--muted); font-weight:400; }
.dk-mut { color:var(--muted); }
.dk-num { font-weight:600; }
.dk-pos { color:var(--ok); }
.dk-neg { color:var(--err); }
.dk-arr { color:var(--muted); margin:0 5px; }
.dk-t .m-tag { font-size:12px; padding:2px 8px; border-radius:7px; }
.dk-empty { padding:26px 16px !important; text-align:center; color:var(--muted); }
.dk-foot { display:flex; flex-wrap:wrap; justify-content:space-between; gap:10px; padding:12px 16px; border-top:1px solid var(--line-2); font-size:13px; color:var(--muted); }
.dk-pager { display:flex; justify-content:space-between; align-items:center; gap:10px; margin:14px 0 0; color:var(--muted); font-size:14px; }
.dk-note { margin:10px 2px 0; font-size:12.5px; color:var(--muted); }

/* ---------- две колонки: главное слева, сводка справа (на телефоне — обычный поток) ---------- */
@media (min-width:821px) {
  .dk-cols { display:flex; flex-wrap:wrap; gap:18px; align-items:flex-start; }
  .dk-main { flex:999 1 560px; min-width:0; display:flex; flex-direction:column; gap:12px; }
  .dk-side { flex:1 1 320px; max-width:390px; display:flex; flex-direction:column; gap:12px; }
  .dk-main > h2, .dk-main > p { margin:0; }
  /* свёрнутые блоки документа и карточек на компьютере — карточкой с заголовком */
  details.m-fold { background:var(--card); border:1px solid var(--line); border-radius:14px; box-shadow:var(--shadow); }
  details.m-fold > summary { display:flex; align-items:center; gap:12px; padding:13px 16px; }
  details.m-fold > summary > h2 { flex:1; margin:0 !important; font-size:15.5px !important; }
  details.m-fold > summary .m-fold-sub { color:var(--muted); font-size:13.5px; }
  details.m-fold > summary::after { content:""; width:9px; height:9px; border-right:2px solid var(--muted); border-bottom:2px solid var(--muted);
    transform:rotate(45deg); margin:-4px 4px 0 0; transition:transform .15s; }
  details.m-fold[open] > summary::after { transform:rotate(-135deg); margin-top:4px; }
  details.m-fold > table.grid { margin:0 12px 12px !important; width:calc(100% - 24px); }
}
.dk-panel { padding:16px; }
.dk-lbl { display:flex; justify-content:space-between; align-items:center; gap:10px; margin:0 0 10px; font-size:12px; font-weight:600; color:var(--muted);
  text-transform:uppercase; letter-spacing:.04em; }
.dk-lbl a { text-transform:none; letter-spacing:0; font-size:13px; text-decoration:none !important; }
.dk-kv { display:flex; justify-content:space-between; gap:12px; padding:7px 0; border-top:1px solid var(--line-2); font-size:14px; }
.dk-kv:first-of-type { border-top:0; }
.dk-kv > span:first-child { color:var(--muted); }
.dk-kv b { font-weight:600; text-align:right; }
.dk-big { font-size:30px; font-weight:700; letter-spacing:-.02em; line-height:1.15; }
.dk-links { display:flex; flex-wrap:wrap; gap:6px 16px; margin-top:12px; font-size:13.5px; font-weight:600; }
.dk-links a { text-decoration:none !important; }
.dk-who { display:flex; align-items:center; gap:12px; }
.dk-who .m-av { width:44px; height:44px; font-size:15px; }
.dk-who b { display:block; font-size:15.5px; }
.dk-meter { height:8px; border-radius:4px; background:var(--line-2); overflow:hidden; margin:10px 0 4px; }
.dk-meter i { display:block; height:100%; background:var(--ok); }
details.dk-fold { background:var(--card); border:1px solid var(--line); border-radius:14px; box-shadow:var(--shadow); }
details.dk-fold > summary { display:flex; align-items:center; gap:12px; padding:14px 16px; cursor:pointer; list-style:none; }
details.dk-fold > summary::-webkit-details-marker { display:none; }
details.dk-fold > summary b { font-weight:650; }
details.dk-fold > summary span { flex:1; color:var(--muted); font-size:13.5px; }
details.dk-fold > summary::after { content:""; width:9px; height:9px; border-right:2px solid var(--muted); border-bottom:2px solid var(--muted); transform:rotate(45deg);
  margin:-4px 4px 0 0; transition:transform .15s; }
details.dk-fold[open] > summary::after { transform:rotate(-135deg); margin-top:4px; }
details.dk-fold > .dk-fold-body { padding:0 16px 14px; }
details.dk-fold table.grid { margin:0; }

/* вкладки внутри карточки */
.dk-tabs { display:flex; flex-wrap:wrap; gap:4px; padding:6px; border-bottom:1px solid var(--line-2); }
.dk-tab { height:36px; padding:0 14px; border:0; border-radius:9px; background:none; font:600 14px var(--ui); color:var(--muted); cursor:pointer; }
.dk-tab.on { background:var(--action-soft); color:var(--action); }
.dk-tab em { font-style:normal; font-weight:500; color:var(--muted); margin-left:4px; }
[data-dk-pane][hidden] { display:none !important; }

/* плитки-фильтры и карточки действий */
.dk-tiles { display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:12px; margin:0 0 14px; }
.dk-tile { display:flex; align-items:center; gap:14px; padding:14px 18px; border:1px solid var(--line); border-radius:14px; background:var(--card);
  color:var(--fg) !important; text-decoration:none !important; box-shadow:var(--shadow); font:inherit; text-align:left; cursor:pointer; }
.dk-tile:hover, .dk-tile.on { border-color:var(--action); }
.dk-tile.on { box-shadow:0 0 0 3px var(--action-soft); }
.dk-tile small { display:block; font-size:13px; color:var(--muted); }
.dk-tile b { display:block; font-size:22px; font-weight:700; letter-spacing:-.02em; line-height:1.25; }
.dk-tile em { margin-left:auto; font-style:normal; font-size:13px; font-weight:600; color:var(--action); white-space:nowrap; }
.dk-tile.act b { font-size:15px; font-weight:650; }
.dk-acts { display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:12px; margin:0 0 14px; }
.dk-warncard { display:flex; flex-wrap:wrap; align-items:center; gap:14px; padding:14px 16px; margin:0 0 16px; border:1px solid color-mix(in srgb, var(--amber) 55%, var(--line));
  border-radius:14px; background:color-mix(in srgb, var(--amber) 8%, var(--card)); }
.dk-warncard > div { flex:1 1 300px; }
.dk-warncard b { display:block; font-size:15px; font-weight:650; }
.dk-warncard small { font-size:13px; color:var(--muted); }

/* закупки: «Ждём поставку» */
.dk-sechead { display:flex; justify-content:space-between; align-items:baseline; gap:10px; margin:0 2px 8px; }
.dk-sechead b { font-size:16px; font-weight:650; }
.dk-sechead a { font-size:13.5px; font-weight:600; text-decoration:none !important; }
.dk-orders { display:grid; grid-template-columns:repeat(auto-fill, minmax(210px, 1fr)); gap:10px; margin:0 0 20px; }
.dk-order { display:flex; flex-direction:column; gap:3px; padding:12px 14px; border:1px solid var(--line); border-radius:13px; background:var(--card);
  color:var(--fg) !important; text-decoration:none !important; box-shadow:var(--shadow); }
.dk-order:hover { border-color:var(--action); }
.dk-order.late { border-color:var(--err-line, var(--line)); }
.dk-order .top { display:flex; justify-content:space-between; gap:8px; font-weight:650; }
.dk-order small { font-size:12.5px; color:var(--muted); }
.dk-order .m-tag { align-self:flex-start; }

/* деньги: кассы справа */
.dk-boxes { margin-top:12px; border-top:1px solid var(--line-2); }
.dk-box { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:8px 2px; border-bottom:1px solid var(--line-2);
  color:var(--fg) !important; text-decoration:none !important; }
.dk-box:last-child { border-bottom:0; }
.dk-box:hover span { color:var(--action); }
.dk-box span { font-size:14px; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dk-box b { font-weight:600; text-align:right; white-space:nowrap; }
.dk-box b small { display:block; font-size:12px; color:var(--muted); font-weight:500; }
.dk-box.zero, .dk-box.zero b { color:var(--muted) !important; }

/* отчёты и настройки: меню слева */
@media (min-width:821px) {
  .dk-split { display:flex; flex-wrap:wrap; gap:20px; align-items:flex-start; }
  .dk-split > .dk-content { flex:999 1 520px; min-width:0; }
}
.dk-subnav { flex:1 1 210px; max-width:250px; box-sizing:border-box; padding:10px; position:sticky; top:16px; }
.dk-subnav h1 { margin:6px 10px 6px !important; font-size:22px !important; }
.dk-subnav p { margin:12px 10px 4px; font-size:11.5px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; }
.dk-subnav p:first-child { margin-top:4px; }
.dk-subnav a { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:7px 10px; border-radius:9px; color:var(--fg) !important;
  text-decoration:none !important; font-size:14px; font-weight:500; }
.dk-subnav a:hover { background:var(--card-2); }
.dk-subnav a.on { background:var(--action-soft); color:var(--action) !important; font-weight:650; }
.dk-subnav a em { font-style:normal; font-size:12.5px; color:var(--muted); font-weight:500; white-space:nowrap; }
.dk-subnav a em.w { color:#7a4f00; background:color-mix(in srgb, var(--amber) 20%, var(--card)); padding:0 7px; border-radius:7px; font-weight:600; line-height:20px; }
:root[data-theme="dark"] .dk-subnav a em.w { color:var(--amber); }
.dk-subnav a em.err { color:var(--err); background:var(--err-soft); padding:0 7px; border-radius:7px; font-weight:700; line-height:20px; }

/* отчёт о прибыли: по месяцам и «куда уходят деньги» */
.dk-chart { padding:16px 18px 14px; }
.dk-chart h2, .dk-panel h2 { margin:0 0 4px; font-size:16px; font-weight:650; }
.dk-legend { display:flex; gap:16px; font-size:12.5px; color:var(--muted); margin:0 0 12px; }
.dk-legend i { display:inline-block; width:10px; height:10px; border-radius:3px; margin-right:6px; vertical-align:-1px; }
.dk-bars { display:flex; gap:10px; align-items:flex-end; height:230px; padding:0 6px; border-bottom:1px solid var(--line); overflow-x:auto; }
.dk-mon { flex:1 0 64px; display:flex; justify-content:center; align-items:flex-end; gap:5px; height:100%; }
.dk-col { display:flex; flex-direction:column; align-items:center; justify-content:flex-end; gap:4px; height:100%; width:26px; }
.dk-col span { font-size:10.5px; color:var(--muted); white-space:nowrap; writing-mode:vertical-rl; transform:rotate(180deg); }
.dk-col i { display:block; width:100%; border-radius:5px 5px 0 0; min-height:2px; }
.dk-rev { background:color-mix(in srgb, var(--action) 30%, var(--card)); }
.dk-gro { background:var(--action); }
.dk-gro.neg { background:var(--err); }
.dk-months { display:flex; gap:10px; padding:8px 6px 0; overflow:hidden; }
.dk-months span { flex:1 0 64px; text-align:center; font-size:12.5px; font-weight:600; }
.dk-ex { display:grid; grid-template-columns:minmax(110px, 170px) minmax(0, 1fr) auto; gap:10px; align-items:center; padding:5px 0; font-size:13.5px; }
.dk-ex span { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dk-ex i { display:block; height:10px; border-radius:5px; background:var(--amber); min-width:2px; }
.dk-ex b { font-weight:600; white-space:nowrap; text-align:right; }

/* розница: карточки точек */
.dk-stores { display:grid; grid-template-columns:repeat(auto-fill, minmax(340px, 1fr)); gap:14px; margin:0 0 22px; }
.dk-store { padding:18px; }
.dk-store-top { display:flex; align-items:center; gap:12px; }
.dk-store-top b { display:block; font-size:17px; font-weight:650; }
.dk-store-top small { display:flex; align-items:center; gap:6px; font-size:13px; color:var(--muted); }
.dk-dot { width:8px; height:8px; border-radius:50%; background:var(--ok); box-shadow:0 0 0 3px var(--ok-soft); flex:none; }
.dk-nums { display:grid; grid-template-columns:1.4fr 1fr 1fr; gap:8px; margin:16px 0 14px; }
.dk-nums div { padding:10px 12px; border-radius:11px; background:var(--card-2); min-width:0; }
.dk-nums small { display:block; font-size:12px; color:var(--muted); }
.dk-nums b { display:block; font-size:19px; font-weight:700; letter-spacing:-.01em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dk-hours { display:grid; grid-auto-flow:column; grid-auto-columns:minmax(0, 1fr); gap:4px; align-items:end; height:64px; padding:0 2px; border-bottom:1px solid var(--line); }
.dk-hours i { display:block; border-radius:3px 3px 0 0; background:var(--action); min-height:2px; }
.dk-hours i.z { background:var(--line); }
.dk-hlab { display:grid; grid-auto-flow:column; grid-auto-columns:minmax(0, 1fr); gap:4px; padding:4px 2px 14px; font-size:11px; color:var(--muted); text-align:center; }
.dk-pay { display:inline-block; padding:2px 8px; border-radius:7px; font-size:12px; font-weight:600; background:var(--card-2); color:var(--muted); }
.dk-pay.bank { background:var(--action-soft); color:var(--action); }

/* товар: фото, остатки по складам, цены */
.dk-photo { width:64px; height:64px; flex:none; border-radius:14px; overflow:hidden; border:1.5px dashed var(--line); background:var(--card); display:grid; place-items:center;
  color:var(--muted); text-decoration:none !important; font-size:11.5px; font-weight:600; text-align:center; line-height:1.2; }
.dk-photo img { width:100%; height:100%; object-fit:cover; display:block; }
.dk-photo.has { border-style:solid; }
.dk-headrow { display:flex; align-items:center; gap:16px; min-width:0; }
.dk-wh { display:grid; grid-template-columns:minmax(0, 1fr) auto; gap:4px 12px; align-items:center; margin-top:14px; }
.dk-wh span { font-size:14px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dk-wh b { font-weight:600; text-align:right; white-space:nowrap; }
.dk-wh i { grid-column:1 / -1; display:block; height:6px; border-radius:3px; background:var(--line-2); overflow:hidden; margin-bottom:6px; }
.dk-wh i u { display:block; height:100%; background:var(--action); border-radius:3px; }
.dk-pr { display:flex; justify-content:space-between; align-items:baseline; gap:12px; padding:9px 0; border-top:1px solid var(--line-2); }
.dk-pr:first-of-type { border-top:0; }
.dk-pr b { font-size:16px; font-weight:650; white-space:nowrap; }
.dk-m { display:block; font-size:12px; color:var(--ok); font-weight:500; }
.dk-m.neg { color:var(--err); }
.dk-low { display:inline-block; padding:2px 8px; border-radius:7px; background:color-mix(in srgb, var(--amber) 20%, var(--card)); color:#7a4f00; font-weight:600; }
:root[data-theme="dark"] .dk-low { color:var(--amber); }
.dk-zero { display:inline-block; padding:2px 8px; border-radius:7px; background:var(--err-soft); color:var(--err); font-weight:600; }
.dk-t .m-ph { width:40px; height:40px; border-radius:10px; }
.dk-t .m-ph svg { width:19px; height:19px; }
.dk-kit { display:inline-block; margin-left:6px; padding:1px 7px; border-radius:6px; background:var(--action-soft); color:var(--action); font-size:11.5px; font-weight:600; vertical-align:1px; }

/* новая накладная: товары слева, деньги справа (на телефоне колонки «растворяются» — порядок прежний) */
.dk-sale-main, .dk-sale-side { display:contents; }
.client-note { display:none; margin-top:5px; font-size:12.5px; color:var(--muted); font-weight:500; }
.client-note.owe { color:#7a4f00; }
:root[data-theme="dark"] .client-note.owe { color:var(--amber); }
.client-note.we { color:var(--err); }
@media (min-width:821px) { .client-note:not([hidden]) { display:block; } }   /* долг клиента под выбором — только на компьютере */
@media (min-width:821px) {
  form.dk-sale { display:grid; grid-template-columns:minmax(0, 1fr) minmax(320px, 380px); grid-template-rows:auto auto 1fr; gap:14px 18px; align-items:start; }
  form.dk-sale > .dk-sale-main { display:block; grid-column:1; grid-row:1 / span 3; min-width:0; }
  form.dk-sale > .dk-sale-side { display:flex; flex-direction:column; gap:12px; grid-column:2; grid-row:1; min-width:0; }
  form.dk-sale > .dk-sale-foot { grid-row:2; }
  form.dk-sale .doc-head { display:flex; flex-direction:column; align-items:stretch; gap:12px; margin:0; padding:16px; }
  form.dk-sale .doc-head > label { width:auto !important; min-width:0 !important; flex:none; }
  form.dk-sale .doc-head > label.check { height:auto; }
  form.dk-sale .doc-head .m-extra { display:none; }
  form.dk-sale .doc-head.open .m-extra { display:block; }
  form.dk-sale .doc-head.open .m-extra.check { display:flex; }
  form.dk-sale .picker { margin:0 0 12px; }
  form.dk-sale .picker input { height:50px; border:1.5px solid var(--action); box-shadow:0 0 0 4px var(--action-soft); border-radius:13px; }
  form.dk-sale .doc-foot { display:block; margin:0; }
  form.dk-sale .totals { min-width:0; width:100%; box-sizing:border-box; border-radius:14px; padding:16px; }
  form.dk-sale .totals .big b { font-size:26px; letter-spacing:-.02em; }
  form.dk-sale .doc-foot .actions { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:8px; margin:12px 0 0; }
  form.dk-sale .doc-foot .actions > * { width:100%; margin:0; justify-content:center; box-sizing:border-box; }
  form.dk-sale .doc-foot .actions > #form-error, form.dk-sale .doc-foot .actions > button:first-of-type { grid-column:1 / -1; }
  form.dk-sale .doc-foot .actions > button:first-of-type { height:48px; font-size:15.5px; }
  .dk-hint { margin:10px 2px 0; }
  /* в узкой левой колонке: себестоимость и прибыль строки прячем (итог прибыли — справа), маржа остаётся */
  form.dk-sale table.lines .c-cost, form.dk-sale table.lines .c-profit { display:none; }
  form.dk-sale table.lines td:first-child { min-width:200px; white-space:normal; }
  form.dk-sale table.lines input.num { width:96px; }
  form.dk-sale .doc-foot .actions .dk-cancel { grid-column:1 / -1; height:auto; border:0; background:none; box-shadow:none; color:var(--muted) !important;
    font-weight:500; font-size:13.5px; padding:4px; }
}
.dk-params { display:flex; align-items:center; gap:10px; width:100%; box-sizing:border-box; padding:12px 14px; border:1px dashed var(--line); border-radius:12px;
  background:transparent; font:inherit; font-size:13.5px; color:var(--muted); text-align:left; cursor:pointer; }
.dk-params b { color:var(--fg); font-weight:600; }
.dk-params span { flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dk-params svg { width:17px; height:17px; flex:none; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; transition:transform .15s; }
.dk-params[aria-expanded="true"] svg { transform:rotate(180deg); }

@media (max-width:1100px) {
  .dk-side { max-width:none; }
}
@media (min-width:821px) { .m-hide-desk { display:none !important; } }
.dk-t.dk-lines td:first-child { white-space:normal; min-width:180px; }
.dk-t.dk-lines th, .dk-t.dk-lines td { padding-left:12px; padding-right:12px; }

/* контрагенты: роль-метка, сортировка по заголовку */
.dk-role { display:inline-block; padding:2px 8px; margin:1px 4px 1px 0; border-radius:6px; background:var(--card-2); border:1px solid var(--line-2);
  font-size:12.5px; font-weight:600; color:var(--muted); white-space:nowrap; }
.dk-t th[data-sort] { cursor:pointer; user-select:none; }
.dk-t th[data-sort]:hover { color:var(--fg); }
.dk-t th.sorted::after { content:" ↓"; }
.dk-t th.sorted.asc::after { content:" ↑"; }
/* карточка контрагента */
.m-av.dk-avbig { width:56px; height:56px; font-size:19px; }
.dk-dates { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:0 0 10px; }
.dk-dates label { display:flex; flex-direction:column; gap:4px; margin:0; font-size:12.5px; color:var(--muted); }
.dk-dates input { width:100%; min-width:0; height:38px; padding:0 8px; border:1px solid var(--line); border-radius:9px; background:var(--card); color:var(--fg); font:500 13.5px var(--ui); }
.dk-two { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:0 0 8px; }
.dk-two .dk-btn { justify-content:center; }
.dk-tiles.two { grid-template-columns:repeat(2, minmax(0, 380px)); }
.dk-tile:not(.act) b { white-space:nowrap; }
/* отчёты: строка периода и доп. фильтров */
.dk-pop-left { left:0; right:auto; }
.dk-cal.on > summary.ic { width:auto; padding:0 12px; gap:8px; }
.dk-repx { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.dk-repx select { width:auto; height:40px; margin:0; padding:0 12px; border:1px solid var(--line); border-radius:10px; background-color:var(--card);
  color:var(--fg); font:600 13.5px var(--ui); cursor:pointer; }
.dk-repx label { margin:0; }
@media (min-width:821px) { .dk-content > h2 { margin:22px 0 10px; font-size:17px; } }
/* отчёт о прибыли */
.dk-kpis { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:12px; margin:0 0 14px; }
@media (max-width:1240px) { .dk-kpis { grid-template-columns:repeat(2, minmax(0, 1fr)); } }
.dk-kpi { padding:14px 16px; min-width:0; }
.dk-kpi small { display:block; font-size:13px; color:var(--muted); }
.dk-kpi b { display:block; margin:4px 0 2px; font-size:22px; font-weight:700; letter-spacing:-.02em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dk-kpi span { display:block; font-size:12.5px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dk-chart { margin:0 0 14px; }
a.dk-mon { text-decoration:none !important; border-radius:8px 8px 0 0; padding-top:6px; }
a.dk-mon:hover { background:var(--card-2); }
.dk-two-panels { display:grid; grid-template-columns:repeat(auto-fit, minmax(340px, 1fr)); gap:14px; margin:0 0 4px; align-items:start; }
.dk-kv.dk-kv-big { margin-top:6px; padding-top:12px; border-top:2px solid var(--line); font-size:15.5px; font-weight:650; }
.dk-kv.dk-kv-big > span:first-child { color:var(--fg); }
.dk-kv.dk-kv-big b { font-size:20px; font-weight:700; }
details.dk-fold.flat { background:none; border:0; border-top:1px solid var(--line-2); border-radius:0; box-shadow:none; }
details.dk-fold.flat > summary { padding:10px 0 8px; }
details.dk-fold.flat > summary span { text-align:right; font-weight:600; }
details.dk-fold.flat > .dk-fold-body { padding:0; }
details.dk-fold > .dk-fold-body.dk-tbl { padding:0; }
.dk-repx button.ui-select { width:auto; margin:0; min-height:40px; height:40px; padding:0 12px; border-radius:10px; font-weight:600; font-size:13.5px; white-space:nowrap; }
.dk-ex { grid-template-columns:minmax(130px, 210px) minmax(0, 1fr) auto; }
.dk-bar-h { margin:0 6px 0 0; font-size:18px; font-weight:650; }
.dk-btn.dk-wide { width:100%; justify-content:center; }
.dk-nums small { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dk-stores { grid-template-columns:repeat(auto-fill, minmax(360px, 1fr)); }
.dk-stores { grid-template-columns:repeat(auto-fit, minmax(360px, 1fr)); }
.dk-stores:has(> .dk-store:only-child) { max-width:620px; }
/* настройки: заголовок раздела там, где у страницы своего нет */
.dk-set-h { margin:4px 0 14px; font-size:24px; font-weight:700; letter-spacing:-.01em; }
@media (min-width:821px) {
  .dk-settings > h2:first-child, .dk-settings > .page-head:first-child { margin-top:4px; }
  .dk-settings > h2.dk-set-h { margin:4px 0 14px; font-size:24px; font-weight:700; }
}
.dk-subnav { flex-basis:250px; max-width:270px; }
.dk-subnav a > span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
@media (min-width:821px) {
  .dk-settings table.grid td.actions { display:table-cell; }
  .dk-settings table.grid td.actions form { display:inline-block; margin:0; }
  .dk-settings .badge { white-space:nowrap; }
}
@media (min-width:821px) and (max-width:1180px) {
  .dk-split > .dk-content { flex-basis:420px; }
  .dk-subnav { flex-basis:200px; max-width:220px; }
}
/* категории товаров: длинный список прокручивается внутри меню */
.dk-menu.dk-cat-menu { max-height:min(70vh, 560px); overflow:auto; }
