/* LUKI Заказы — ТЗ раздел 8: системный шрифт, светлая/тёмная тема по системе, числа по правому краю */
:root {
  --bg: #f6f6f4; --surface: #ffffff; --text: #1d1f21; --muted: #6b6f75; --line: #dedfe2;
  --accent: #2f5d8a; --accent-text: #ffffff; --warn-bg: #fff4cc; --warn: #8a6500;
  --err-bg: #fde4e4; --err: #b3261e; --ok-bg: #e2f3e6; --ok: #1d6b34; --neg: #b3261e;
  --row-alt: #fafafa; --focus: #7aa7d6;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17181a; --surface: #1f2124; --text: #e6e6e6; --muted: #9a9ea5; --line: #34373c;
    --accent: #6c9bd2; --accent-text: #101215; --warn-bg: #3a3214; --warn: #e6c25a;
    --err-bg: #3d1f1f; --err: #f08b84; --ok-bg: #1d3324; --ok: #7fd096; --neg: #f08b84;
    --row-alt: #232528; --focus: #4d7fb8;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
header.top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 8px 16px;
  background: var(--surface); border-bottom: 1px solid var(--line); }
header.top .brand { font-weight: 600; text-decoration: none; color: var(--text); margin-right: 8px; }
nav.menu { display: flex; flex-wrap: wrap; gap: 2px; flex: 1; }
nav.menu a { padding: 6px 10px; border-radius: 6px; text-decoration: none; color: var(--text); }
nav.menu a.on, nav.menu a:hover { background: var(--bg); }
header.top .user { color: var(--muted); font-size: 13px; }
main { padding: 16px; max-width: 1600px; margin: 0 auto; }
footer { padding: 16px; color: var(--muted); font-size: 12px; text-align: center; }
h1 { font-size: 20px; margin: 0 0 12px; }
h2 { font-size: 16px; margin: 20px 0 8px; }
.banner { padding: 8px 16px; font-size: 13px; background: var(--warn-bg); color: var(--warn); }
.banner.err { background: var(--err-bg); color: var(--err); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.muted { color: var(--muted); }
.ok { color: var(--ok); } .warn { color: var(--warn); } .err { color: var(--err); }
.tag { display: inline-block; padding: 0 6px; border-radius: 4px; font-size: 12px; }
.tag.warn { background: var(--warn-bg); } .tag.err { background: var(--err-bg); } .tag.ok { background: var(--ok-bg); }
/* таблицы */
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
table.t { border-collapse: collapse; width: 100%; font-size: 13px; }
table.t th, table.t td { padding: 4px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; text-align: left; }
table.t th { position: sticky; top: 0; background: var(--surface); font-weight: 600; }
table.t th a { color: var(--text); text-decoration: none; }
table.t tbody tr:nth-child(even) { background: var(--row-alt); }
table.t tbody tr:hover { background: var(--bg); }
table.t td.n, table.t th.n { text-align: right; font-variant-numeric: tabular-nums; }
table.t td.wrap { white-space: normal; min-width: 200px; }
table.t tfoot td { font-weight: 600; border-top: 2px solid var(--line); }
.neg { color: var(--neg); }
/* формы */
form.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 12px; }
form.filters label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 2px; }
input, select, textarea, button { font: inherit; color: var(--text); }
input, select, textarea { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: -1px; }
button, .btn { display: inline-block; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-text); cursor: pointer; text-decoration: none; }
button.sec, .btn.sec { background: transparent; color: var(--accent); }
.login { max-width: 360px; margin: 10vh auto; }
.login form p { display: flex; flex-direction: column; gap: 4px; }
.login form p.check { flex-direction: row; align-items: center; gap: 8px; }
.qr svg { width: 220px; height: 220px; background: #fff; padding: 8px; border-radius: 8px; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 0; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; } dl.kv dd.n { text-align: right; font-variant-numeric: tabular-nums; }
dl.kv.small { font-size: 12px; margin-top: 4px; grid-template-columns: max-content minmax(0, 1fr); }
@media (max-width: 600px) { main { padding: 12px 16px; } header.top { padding: 8px 16px; } }
/* правка заказа */
.msg { padding: 8px 12px; border-radius: 6px; background: var(--ok-bg); color: var(--ok); margin: 0 0 12px; }
.msg.error { background: var(--err-bg); color: var(--err); }
form.edit .card { margin-bottom: 12px; }
form.edit h2.first, h2.first { margin-top: 0; }
.fields { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; margin: 8px 0; }
label.f { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); min-width: 120px; }
label.f input, label.f select, label.f textarea { font-size: 14px; color: var(--text); }
label.f.wide { flex: 1 1 320px; }
label.f.bad input, label.f.bad select, label.f.bad textarea { border-color: var(--err); }
label.f small { font-size: 11px; }
label.chk { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; padding-bottom: 6px; }
em.err { font-style: normal; font-size: 12px; color: var(--err); display: block; }
.found { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; font-size: 12px; }
button.small { padding: 2px 8px; font-size: 12px; }
table.t.edit td { vertical-align: top; }
table.t.edit input, table.t.edit select { padding: 3px 6px; }
table.t.edit select { max-width: 220px; }
.card.ship { margin-bottom: 12px; }
details > summary { cursor: pointer; color: var(--accent); margin: 6px 0; }
details.history { margin-top: 20px; }
p.actions { position: sticky; bottom: 0; background: var(--bg); padding: 8px 0; margin: 0; border-top: 1px solid var(--line); }
p.marks { margin: 0 0 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
h1 .btn { font-size: 13px; vertical-align: middle; margin-left: 8px; }
table.t.edit tbody tr { background: var(--surface); }
table.t.edit tr.in td { border-bottom: 0; padding-bottom: 0; }
table.t.edit tr.info td { white-space: normal; font-size: 12px; padding-top: 2px; }
/* отчёты F-10 */
dl.summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; margin: 8px 0 16px; }
dl.summary div { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dotted var(--line); }
dl.summary dt { color: var(--muted, #666); }
dl.summary dd { margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
section.report { margin: 18px 0; }
section.report h2 { font-size: 16px; }
.btn.small { padding: 1px 8px; font-size: 12px; }
table.t tfoot td { font-weight: 600; border-top: 2px solid var(--line); }
span.ym select { margin-right: 4px; }
.exports { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 12px 0; }
.exports h3 { margin: 0 0 6px; font-size: 15px; }
ul.plain { list-style: none; padding: 0; margin: 0 0 8px; }
ul.warnings { margin: 6px 0 0; padding-left: 18px; color: var(--warn); font-size: 13px; }
tr.warn td { background: var(--warn-bg); }
.exports .btn.small { margin: 2px 0; }
pre.report { font: 12px/1.45 Consolas, "Courier New", monospace; background: var(--surface); border: 1px solid var(--line);
  padding: 8px 10px; overflow-x: auto; white-space: pre; }
button.link { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer;
  font: inherit; }
table.checks td:first-child { white-space: nowrap; }
/* карточка заказа: «Деньги» по группам, итог группы — в строке заголовка */
.card.money details { border-bottom: 1px solid var(--line); }
.card.money details:last-child { border-bottom: 0; }
.card.money summary { list-style: none; display: flex; justify-content: space-between; gap: 8px; color: var(--text); font-weight: 600; margin: 0; padding: 5px 0; }
.card.money summary span { font-variant-numeric: tabular-nums; }
.card.money summary::-webkit-details-marker { display: none; }
.card.money summary b::before { content: "▸ "; color: var(--muted); }
.card.money details[open] summary b::before { content: "▾ "; }
.card.money details[open] summary span { visibility: hidden; }
.card.money dl.kv { margin: 0 0 8px 12px; }
dl.kv .sum { font-weight: 600; }
a.num { font-weight: 600; }
details.filt > summary { display: none; }
/* телефон: меню — одна строка с прокруткой, в списке заказов — главные колонки */
@media (max-width: 700px) {
  header.top { padding: 6px 12px; gap: 2px 8px; }
  header.top .user { margin-left: auto; font-size: 12px; }
  nav.menu { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  nav.menu::-webkit-scrollbar { display: none; }
  nav.menu a { white-space: nowrap; padding: 8px 10px; }
  .banner { padding: 6px 12px; font-size: 12px; }
  .banner .long { display: none; }
  table.t .opt { display: none; }
  details.filt > summary { display: list-item; font-weight: 600; margin-bottom: 8px; }
  table.t th, table.t td { padding: 8px 6px; }
  button, .btn { padding: 8px 12px; }
}
