/* POSTPRESS — общие стили. Сначала телефон, с 768px — компьютер. */

:root {
  color-scheme: light dark;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eef0f4;
  --text: #15171c;
  --muted: #5f6672;
  --border: #e1e4ea;
  --accent: #1f4fd1;
  --accent-hover: #1a43b3;
  --accent-soft: #e8eefc;
  --on-accent: #ffffff;
  --danger: #c0352b;
  --danger-soft: #fdecea;
  --warning: #9a5b00;
  --warning-soft: #fff3df;
  --success: #1d7a45;
  --success-soft: #e4f4ea;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 2px 8px rgba(16, 24, 40, .06);
  --tabbar-h: 62px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1114;
    --surface: #181b20;
    --surface-2: #22262d;
    --text: #e8eaef;
    --muted: #9aa1ad;
    --border: #2b3038;
    --accent: #7096ff;
    --accent-hover: #8aaaff;
    --accent-soft: #1d2848;
    --on-accent: #0b1020;
    --danger: #ff7b72;
    --danger-soft: #3a1d1b;
    --warning: #f0b35a;
    --warning-soft: #392a13;
    --success: #5fd394;
    --success-soft: #14301f;
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
body.has-tabbar { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }

h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 700; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.icon {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* Бренд */
.brand {
  font-weight: 800; letter-spacing: .04em; font-size: 18px;
  color: var(--text); text-decoration: none; white-space: nowrap;
}
.brand span { color: var(--accent); }
.brand--big { font-size: 30px; text-align: center; }

/* Шапка */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top);
}
.topbar__inner {
  max-width: 1200px; margin: 0 auto; padding: 0 16px; height: 56px;
  display: flex; align-items: center; gap: 16px;
}
.topnav, .topbar__user, .topbar__logout { display: none; }
.topbar__tools { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar__user { color: var(--muted); font-size: 14px; }
.topnav__link {
  padding: 8px 12px; border-radius: 8px; color: var(--muted);
  font-weight: 600; font-size: 15px; text-decoration: none;
}
.topnav__link:hover { background: var(--surface-2); color: var(--text); }
.topnav__link.is-active { background: var(--accent-soft); color: var(--accent); }

/* Нижнее меню на телефоне */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--surface); border-top: 1px solid var(--border);
}
.tabbar__item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 600;
}
.tabbar__item .icon { width: 24px; height: 24px; }
.tabbar__item.is-active { color: var(--accent); }

/* Страница */
.page { max-width: 1200px; margin: 0 auto; padding: 16px; }
.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 12px; margin-bottom: 16px;
}
.page-head p { margin: 4px 0 0; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.card__title { margin-bottom: 12px; }
.empty { text-align: center; padding: 32px 16px; color: var(--muted); }
.empty h1 { color: var(--text); margin-bottom: 16px; font-size: 20px; }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: none; color: var(--text);
  font: 600 15px/1.2 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--secondary { background: var(--surface); border-color: var(--border); }
.btn--secondary:hover, .btn--ghost:hover { background: var(--surface-2); }
.btn--sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn--block { width: 100%; }
.btn:focus-visible, .lang__btn:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent-soft); outline-offset: 2px;
}

/* Поля */
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: 16px/1.3 var(--font);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 3px solid var(--accent-soft); border-color: var(--accent);
}
.field--error input, .field--error select { border-color: var(--danger); }
.field__error { margin: 6px 0 0; color: var(--danger); font-size: 13px; }

/* Сообщения */
.message { padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 12px; background: var(--surface-2); }
.message--error { background: var(--danger-soft); color: var(--danger); }
.message--success { background: var(--success-soft); color: var(--success); }
.message--warning { background: var(--warning-soft); color: var(--warning); }

/* Переключатель языка */
.lang {
  display: inline-flex; padding: 2px; gap: 2px; margin: 0;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
}
.lang__btn {
  min-height: 32px; padding: 0 10px; border: 0; border-radius: 999px; background: none;
  color: var(--muted); font: 700 13px/1 var(--font); cursor: pointer;
}
.lang__btn.is-active { background: var(--accent); color: var(--on-accent); }
.lang--big { display: flex; }
.lang--big .lang__btn { flex: 1; min-height: 44px; font-size: 15px; }

/* Значки */
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px; white-space: nowrap;
  font-size: 12.5px; font-weight: 600; background: var(--surface-2); color: var(--muted);
}
.badge--done, .badge--login, .badge--create { background: var(--success-soft); color: var(--success); }
.badge--next, .badge--export, .badge--update { background: var(--accent-soft); color: var(--accent); }
.badge--login_failed, .badge--delete { background: var(--danger-soft); color: var(--danger); }
.badge--reverse { background: var(--warning-soft); color: var(--warning); }

/* Вход */
body.auth .page { max-width: 440px; padding-top: 8vh; }
.auth__lang { display: flex; justify-content: flex-end; margin-bottom: 16px; }
.auth__card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 28px 20px; box-shadow: var(--shadow);
}
.auth__subtitle { text-align: center; color: var(--muted); margin: 6px 0 24px; font-size: 15px; }
.auth__card .btn { margin-top: 6px; }

/* Этапы на главной */
.stages { list-style: none; margin: 0; padding: 0; }
.stage {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.stage:last-child { border-bottom: 0; padding-bottom: 0; }
.stage__num {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: 14px;
}
.stage--done .stage__num { background: var(--success-soft); color: var(--success); }
.stage--next .stage__num { background: var(--accent-soft); color: var(--accent); }
.stage--later .stage__title { color: var(--muted); }

/* Фильтры */
.filters summary {
  display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  font-weight: 700; min-height: 28px;
}
.filters summary::-webkit-details-marker { display: none; }
.filters__form { margin-top: 14px; }
.filters__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Списки: на телефоне — карточки, на компьютере — таблица */
.list { width: 100%; border-collapse: separate; border-spacing: 0; }
.list thead { display: none; }
.list tbody, .list tr, .list td { display: block; }
.list tr {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 14px; margin-bottom: 10px;
}
.list td { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; text-align: right; }
.list td::before { content: attr(data-label); color: var(--muted); font-size: 14px; text-align: left; flex: none; }
.list td.list__primary { font-weight: 700; font-size: 16px; }
.list td.list__primary::before { content: none; }

.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 16px 0; }

/* «Ещё» */
.profile__name { font-size: 18px; font-weight: 700; }
.menu-list { padding: 0; overflow: hidden; }
.menu-list form { margin: 0; }
.menu-list__item {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 0 16px;
  border: 0; border-bottom: 1px solid var(--border); background: none;
  color: var(--text); font: 600 16px/1.2 var(--font); text-decoration: none; cursor: pointer; text-align: left;
}
.menu-list > :last-child, .menu-list > :last-child .menu-list__item { border-bottom: 0; }
.menu-list__item:hover { background: var(--surface-2); }
.menu-list__item--danger { color: var(--danger); }

/* ===== Этап 1: общие блоки ===== */
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions--tight { margin-top: 10px; }
.backlink {
  display: inline-flex; align-items: center; gap: 4px; margin-bottom: 8px;
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600;
}
.backlink .icon { width: 18px; height: 18px; }
.card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.card__head .card__title { margin-bottom: 0; }
summary.summary { cursor: pointer; list-style: none; margin: 0; }
summary.summary::-webkit-details-marker { display: none; }
details[open] > summary.summary { margin-bottom: 12px; }
.subhead { font-size: 14px; font-weight: 700; color: var(--muted); margin: 16px 0 8px; text-transform: uppercase; letter-spacing: .03em; }
.notes { white-space: pre-line; background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; margin: 10px 0 0; }
.grid-2 { display: grid; gap: 0 16px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.danger-zone { display: flex; justify-content: flex-end; margin: 8px 0 24px; }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none;
  box-shadow: var(--shadow); min-width: 0;
}
.stat__label { font-size: 13px; color: var(--muted); }
.stat__value { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat--danger .stat__value { color: var(--danger); }
.stat--accent .stat__value { color: var(--accent); }
.stat--success .stat__value { color: var(--success); }

.row-link {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none;
}
.row-link:last-child { border-bottom: 0; }
.row-link__main { min-width: 0; }
.row-link__side { display: flex; gap: 6px; align-items: center; flex: none; }

.badge--urgent { background: var(--danger-soft); color: var(--danger); }
.badge--ready { background: var(--accent-soft); color: var(--accent); }
.badge--st-draft { background: var(--surface-2); color: var(--muted); }
.badge--st-accepted { background: var(--warning-soft); color: var(--warning); }
.badge--st-in_work { background: var(--accent-soft); color: var(--accent); }
.badge--st-ready { background: var(--success-soft); color: var(--success); }
.badge--st-issued_partial { background: var(--accent-soft); color: var(--accent); }
.badge--st-issued { background: var(--surface-2); color: var(--success); }
.badge--st-cancelled { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }
.order-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.order-title .badge { font-size: 13px; }

.due { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--surface-2); font-size: 13px; font-weight: 600; }
.due--soon { background: var(--warning-soft); color: var(--warning); }
.due--overdue { background: var(--danger-soft); color: var(--danger); }
.amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
.amount--debt { color: var(--danger); font-weight: 700; }
.amount--prepaid { color: var(--success); font-weight: 700; }

.tabs { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 12px; padding-bottom: 2px; }
.tabs__item {
  flex: none; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px;
}
.tabs__item.is-active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.searchbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; align-items: center; }
.searchbar__input { position: relative; flex: 1 1 220px; }
.searchbar__input .icon { position: absolute; left: 12px; top: 12px; color: var(--muted); }
.searchbar input[type=text], .searchbar input:not([type]), .searchbar select {
  min-height: 44px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: 16px var(--font); width: 100%;
}
.searchbar__input input { padding-left: 40px !important; }
.searchbar select { width: auto; }
.sortbar { margin: 0 0 12px; }
.sortbar a { color: var(--muted); }
.sortbar a.is-active { color: var(--accent); font-weight: 700; text-decoration: none; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.check--danger { color: var(--danger); font-size: 14px; }

.list__link { cursor: pointer; }
.list .list__primary a { color: var(--text); text-decoration: none; }
.list tr.is-urgent td.list__primary a { color: var(--danger); }
.list tr.is-cancelled, .doc.is-cancelled { opacity: .55; }
.list tr.is-cancelled strong { text-decoration: line-through; }
.list td.list__actions { justify-content: flex-end; }
.list td.list__actions::before { content: none; }
.list--flat tr { box-shadow: none; }

/* Формы */
.form-grid { display: grid; gap: 0 12px; }
.form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-actions { display: flex; gap: 8px; margin-top: 8px; }
.form-actions--sticky {
  position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); z-index: 5;
  padding: 10px 0; background: linear-gradient(to top, var(--bg) 70%, transparent);
}
.form-actions--sticky .btn { flex: 1; }
.field textarea { min-height: 70px; resize: vertical; }
.field__help { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.req { color: var(--danger); margin-left: 2px; }
.field--check label { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 15px; cursor: pointer; margin: 0; }
.field--check input { width: 22px; height: 22px; min-height: 0; accent-color: var(--accent); flex: none; }
.field-with-link > a { display: inline-block; margin: -8px 0 12px; }
.subform { border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 10px; }
.subform__footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.subform__footer .field { margin: 0; }
[data-formset-row].is-deleted > :not(.card__head):not(.subform__footer) { opacity: .35; }
.logo-preview { max-height: 64px; max-width: 200px; display: block; margin-bottom: 12px; }
.segmented { display: flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.segmented__item { flex: 1; position: relative; cursor: pointer; margin: 0 !important; }
.segmented__item input { position: absolute; opacity: 0; }
.segmented__item span { display: block; text-align: center; padding: 11px 8px; font-weight: 600; color: var(--muted) !important; }
.segmented__item input:checked + span { background: var(--accent); color: var(--on-accent) !important; }
.segmented__item input:focus-visible + span { outline: 3px solid var(--accent-soft); }

.inline-confirm { display: inline-block; position: relative; }
.inline-confirm > summary { list-style: none; }
.inline-confirm > summary::-webkit-details-marker { display: none; }
.inline-confirm__form {
  display: flex; gap: 6px; margin-top: 6px; padding: 8px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); min-width: 260px;
}
.inline-confirm__form input { flex: 1; min-height: 36px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: 15px var(--font); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger-text { color: var(--danger); }
.btn--block-mobile { width: 100%; margin-bottom: 16px; }

/* Заказ: форма */
.position-form { border-left: 4px solid var(--accent); }
.operation { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 10px; }
.operation__toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 16px; }
.operation__toggle input { width: 22px; height: 22px; accent-color: var(--accent); }
.operation__body { display: none; margin-top: 12px; }
.operation.is-on { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.operation.is-on .operation__body { display: block; }
.form-grid--ops { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.op-code {
  display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 4px; border-radius: 6px;
  background: var(--text); color: var(--bg); font-weight: 800; font-size: 13px;
}
.position-price { font-size: 15px; margin: 4px 0 12px; }

/* Заказ: карточка */
.action-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.action-bar__btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 12px;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  color: var(--text); text-decoration: none; font-weight: 700; box-shadow: var(--shadow);
}
.action-bar__btn:hover { border-color: var(--accent); }
.action-bar__btn--accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ops { display: grid; gap: 10px; margin: 4px 0 12px; }
.op { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; }
.op__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.op__price { margin-left: auto; font-weight: 700; white-space: nowrap; }
.progress { height: 6px; background: var(--border); border-radius: 999px; overflow: hidden; margin: 8px 0 6px; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.op__nums { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); }
.op__nums b { color: var(--text); }
.balance { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 10px; }
.balance > div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 10px; }
.balance dt { font-size: 12.5px; color: var(--muted); }
.balance dd { margin: 0; font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; }
.doc { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.doc:last-of-type { border-bottom: 0; }
.doc__main { min-width: 0; }
.doc__actions { display: flex; gap: 4px; align-items: flex-start; flex: none; }
.doc__actions .inline-confirm__form { position: absolute; right: 0; z-index: 10; }
.contact { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.contact__name { font-weight: 600; }
.map { height: 300px; border-radius: var(--radius-sm); border: 1px solid var(--border); margin-bottom: 8px; z-index: 0; }
.map--small { height: 200px; }

.files { display: grid; gap: 10px; margin-bottom: 16px; }
.file { display: flex; gap: 12px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.file.is-approved { border-color: var(--success); }
.file__thumb {
  flex: none; width: 64px; height: 64px; border-radius: 8px; background: var(--surface-2);
  display: grid; place-items: center; overflow: hidden; color: var(--muted);
}
.file__thumb img { width: 100%; height: 100%; object-fit: cover; }
.file__info { min-width: 0; flex: 1; }
.file__name { font-weight: 600; overflow-wrap: anywhere; }
.file__actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.file__actions form { margin: 0; }
.upload { border-top: 1px solid var(--border); padding-top: 12px; }
.field input[type=file] { padding: 8px; }

/* Сводная таблица */
.summary-wrap { display: none; }
.summary-cards { display: block; }
.summary-card {
  display: block; padding: 12px 14px; margin-bottom: 10px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none;
  box-shadow: var(--shadow);
}
.summary-card.is-urgent { border-left: 4px solid var(--danger); }
.summary-card__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 2px; }
.summary-card__pos { padding: 8px 0; border-bottom: 1px dashed var(--border); }
.summary-card__nums, .summary-card__money { display: flex; flex-wrap: wrap; gap: 2px 12px; color: var(--muted); margin-top: 4px; }
.summary-card__nums b, .summary-card__money b { color: var(--text); }
.summary-card__money { padding-top: 8px; }
.ops-inline { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; color: var(--muted); margin-left: 4px; }
.ops-inline .op-code { min-width: 18px; height: 18px; font-size: 11px; border-radius: 4px; }
.stats--summary .stat__value { font-size: 19px; }
body.page--wide .page { max-width: 1680px; }
body.page--wide .topbar__inner { max-width: 1680px; }

@media (min-width: 900px) {
  .summary-wrap {
    display: block; overflow-x: auto; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px;
  }
  .summary-cards { display: none; }
  .summary-table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
  .summary-table th {
    position: sticky; top: 0; background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 12.5px;
    text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); white-space: nowrap;
  }
  .summary-table th.num, .summary-table td.num { text-align: right; white-space: nowrap; }
  .summary-table th.sortable a { color: inherit; text-decoration: none; }
  .summary-table th.sortable a:hover { color: var(--accent); }
  .summary-table th.is-sorted { color: var(--accent); }
  .sort-arrow { font-size: 10px; }
  .summary-table td { padding: 8px 10px; vertical-align: top; border-bottom: 1px solid var(--border); }
  .summary-table .summary-group:hover td { background: color-mix(in srgb, var(--accent-soft) 40%, transparent); }
  .summary__order { cursor: pointer; }
  .summary__order td:first-child, .summary__order td:nth-child(4), .summary__order td:nth-child(5) { white-space: nowrap; }
  .summary-table tbody td:nth-child(2) { min-width: 140px; }
  .summary-table tbody td:nth-child(3) { min-width: 180px; }
  .summary__order td a { color: var(--text); text-decoration: none; }
  .summary-group.is-urgent .summary__order td:first-child { box-shadow: inset 4px 0 0 var(--danger); }
  .summary__pos td { border-bottom-style: dashed; padding-top: 5px; padding-bottom: 5px; font-size: 13px; }
  .summary__pos td:first-child { padding-left: 22px; }
  .summary-table tfoot td { font-weight: 800; background: var(--surface-2); border-bottom: 0; }
  .filters__form--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  .stats.stats--summary { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}

/* Компьютер */
@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stats--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .form-grid--ops { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .form-grid--contact { grid-template-columns: 1.2fr 1fr 1fr; }
  .form-actions--sticky { bottom: 0; }
  .form-actions--sticky .btn { flex: 0 1 auto; min-width: 220px; }
  .action-bar { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .balance { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .balance--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .files { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .btn--block-mobile { width: auto; }
  .filters__form--inline { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
  .filters__form--inline .field { margin-bottom: 0; }
  .list td.list__actions { text-align: right; }
  body.has-tabbar { padding-bottom: 0; }
  .tabbar { display: none; }
  .topnav { display: flex; gap: 4px; }
  .topbar__user { display: inline; }
  .topbar__logout { display: block; margin: 0; }
  .page { padding: 24px; }
  h1 { font-size: 26px; }

  .filters__form { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0 12px; align-items: end; }
  .filters__actions { grid-column: 1 / -1; }

  .list {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden;
  }
  .list thead { display: table-header-group; }
  .list tbody { display: table-row-group; }
  .list tr { display: table-row; padding: 0; margin: 0; border: 0; border-radius: 0; background: none; }
  .list th, .list td {
    display: table-cell; padding: 10px 14px; border-bottom: 1px solid var(--border);
    text-align: left; vertical-align: top;
  }
  .list th { font-size: 13px; font-weight: 600; color: var(--muted); background: var(--surface-2); }
  .list td::before { content: none; }
  .list td.list__primary { font-size: 15px; white-space: nowrap; }
  .list tbody tr:last-child td { border-bottom: 0; }
  .list tbody tr:hover td { background: var(--surface-2); }
}
