:root {
  --bg: #ffffff;
  --bg-soft: #f5f5f7;
  --surface: #ffffff;
  --ink: #111113;
  --ink-2: #6e6e73;
  --ink-3: #a1a1a6;
  --line: #e8e8ed;
  --accent: #111113;
  --accent-ink: #ffffff;
  --danger: #d70015;
  --danger-soft: #fff1f2;
  --bar: rgba(255, 255, 255, .86);
  --radius: 14px;
  --tap: 48px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0c;
    --bg-soft: #1c1c1e;
    --surface: #161618;
    --ink: #f5f5f7;
    --ink-2: #a1a1a6;
    --ink-3: #6e6e73;
    --line: #2c2c2e;
    --accent: #f5f5f7;
    --accent-ink: #0b0b0c;
    --danger: #ff6961;
    --danger-soft: #2a1214;
    --bar: rgba(22, 22, 24, .86);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.ic { width: 24px; height: 24px; flex: none; }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 22px;
  border: 0; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-ink);
  font-weight: 600; cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.btn:active { transform: scale(.98); opacity: .85; }
.btn:disabled { opacity: .35; cursor: default; transform: none; }
.btn-block { width: 100%; }
.icon-btn, .link-btn {
  display: inline-flex; align-items: center; gap: 10px;
  border: 0; background: none; cursor: pointer; color: var(--ink-2);
}
.icon-btn { width: 44px; height: 44px; justify-content: center; border-radius: 50%; margin-right: -10px; }
.icon-btn:active { background: var(--bg-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Вход */
.auth {
  min-height: 100dvh;
  display: grid; place-items: center;
  padding: calc(24px + var(--safe-top)) 20px calc(24px + var(--safe-bottom));
  background: var(--bg-soft);
}
.auth-box { width: 100%; max-width: 380px; display: grid; gap: 20px; }
.auth-head { text-align: center; display: grid; justify-items: center; gap: 6px; margin-bottom: 8px; }
.auth-icon { border-radius: 16px; margin-bottom: 10px; box-shadow: 0 6px 20px rgba(0, 0, 0, .12); }
.auth-head h1 { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.auth-head p { color: var(--ink-2); }
.auth-form { display: grid; gap: 14px; }
.auth-form .btn { margin-top: 8px; }
.field { display: grid; gap: 6px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--ink-2); padding-left: 4px; }
.field-input {
  display: flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 0 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink-3);
  transition: border-color .15s, box-shadow .15s;
}
.field-input:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 10%, transparent); }
.field-input .ic { width: 20px; height: 20px; }
.field-input input {
  flex: 1; min-width: 0; height: 50px;
  border: 0; outline: 0; background: none;
  font-size: 17px; color: var(--ink);
}
.alert {
  padding: 12px 14px; border-radius: var(--radius);
  background: var(--danger-soft); color: var(--danger);
  font-size: 15px; text-align: center;
}

/* Приложение: телефон */
.app { min-height: 100dvh; }
.side { display: none; }
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(6px + var(--safe-top)) 16px 6px;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
}
.top-brand { font-weight: 600; font-size: 15px; letter-spacing: .01em; }
.content { padding: 8px 16px calc(96px + var(--safe-bottom)); max-width: 1080px; }
.page-title { font-size: 32px; font-weight: 700; letter-spacing: -.025em; margin: 4px 0 20px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(3, 1fr);
  padding: 6px 8px calc(6px + var(--safe-bottom));
  background: var(--bar); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
}
.tabbar .nav-item {
  display: grid; justify-items: center; gap: 2px;
  padding: 6px 0; font-size: 11px; font-weight: 500; color: var(--ink-3);
}
.nav-item[aria-current="page"] { color: var(--ink); }
.nav-item[aria-current="page"] .ic { stroke-width: 2.2; }

/* Пустые разделы */
.empty {
  display: grid; justify-items: center; gap: 8px; text-align: center;
  padding: 56px 24px; max-width: 420px; margin: 0 auto;
}
.empty-icon {
  display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 8px;
  border-radius: 50%; background: var(--bg-soft); color: var(--ink-2);
}
.empty-icon .ic { width: 28px; height: 28px; }
.empty h2 { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.empty p { color: var(--ink-2); font-size: 15px; }

/* Подсказка установки (iPhone) */
.install {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 12px 12px calc(12px + var(--safe-bottom));
  background: rgba(0, 0, 0, .35);
  animation: fade .2s ease-out;
}
.install-card {
  width: 100%; max-width: 420px;
  display: grid; justify-items: center; gap: 10px; text-align: center;
  padding: 24px 20px 20px; border-radius: 22px; background: var(--surface);
  animation: rise .25s ease-out;
}
.install-icon { border-radius: 13px; }
.install-card h2 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.install-card p { color: var(--ink-2); font-size: 15px; }
.install-card ol {
  width: 100%; margin: 6px 0 8px; padding: 0; list-style: none; counter-reset: s;
  display: grid; gap: 8px; text-align: left;
}
.install-card li {
  counter-increment: s; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 14px; border-radius: 12px; background: var(--bg-soft); font-size: 15px;
}
.install-card li::before { content: counter(s); font-weight: 700; color: var(--ink-3); width: 16px; }
.install-card li .ic { width: 20px; height: 20px; color: #0a84ff; }
.install-card .btn { width: 100%; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }

/* Заголовок страницы с кнопкой */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 20px; }
.page-head .page-title { margin: 0; }
.btn-sm { min-height: 40px; padding: 0 16px 0 12px; border-radius: 999px; font-size: 15px; }
.btn-sm .ic { width: 20px; height: 20px; }
.back {
  display: inline-flex; align-items: center; gap: 2px; margin: 0 0 6px -8px; padding: 6px 8px;
  color: var(--ink-2); font-weight: 500;
}
.back .ic { width: 22px; height: 22px; }
.empty-action { display: flex; justify-content: center; margin-top: -24px; }

/* Сообщения */
.toasts {
  position: fixed; left: 50%; bottom: calc(84px + var(--safe-bottom)); z-index: 60;
  transform: translateX(-50%); display: grid; gap: 8px; width: max-content; max-width: calc(100% - 32px);
}
.toast {
  padding: 12px 18px; border-radius: 12px; background: var(--ink); color: var(--bg);
  font-size: 15px; font-weight: 500; text-align: center; box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  animation: rise .25s ease-out;
}

/* Список заказов */
.order-list { display: grid; gap: 10px; }
.order-card {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center;
  padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  transition: background .15s;
}
.order-card:active { background: var(--bg-soft); }
.order-thumb {
  width: 56px; height: 56px; border-radius: 10px; overflow: hidden;
  display: grid; place-items: center; background: var(--bg-soft); color: var(--ink-3);
}
.order-thumb img { width: 100%; height: 100%; object-fit: cover; }
.order-main { display: grid; gap: 1px; min-width: 0; }
.order-top { display: flex; align-items: center; gap: 8px; }
.order-num { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.order-client { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-items { font-size: 14px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-side { display: grid; justify-items: end; gap: 4px; }
.order-sum { font-weight: 600; white-space: nowrap; }
.badge, .pay {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge { background: var(--bg-soft); color: var(--ink-2); }
.s-new { background: #eaf2ff; color: #0a5bd3; }
.s-awaiting { background: #fff4e0; color: #a35a00; }
.s-bought { background: #f1ebff; color: #6b3fd4; }
.s-shipping { background: #e6f6ff; color: #006a9e; }
.s-received { background: #e8f7ee; color: #17803d; }
.pay-unpaid { color: var(--danger); }
.pay-partial { color: #a35a00; }
.pay-paid { color: #17803d; }
@media (prefers-color-scheme: dark) {
  .s-new { background: #0f2547; color: #7fb0ff; }
  .s-awaiting { background: #3a2a0c; color: #ffc46b; }
  .s-bought { background: #2a1f4a; color: #b9a2ff; }
  .s-shipping { background: #0b2c3d; color: #6fd0ff; }
  .s-received { background: #0f3020; color: #6ee59a; }
  .pay-partial { color: #ffc46b; }
  .pay-paid { color: #6ee59a; }
}

/* Форма заказа */
.form-page .tabbar { display: none; }
.form-page .content { padding-bottom: calc(110px + var(--safe-bottom)); }
.order-form { display: grid; gap: 14px; max-width: 720px; }
.card {
  display: grid; gap: 14px; padding: 18px 16px;
  border: 1px solid var(--line); border-radius: 18px; background: var(--surface);
}
.card-title { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.f { display: grid; gap: 6px; min-width: 0; }
.f-label { font-size: 13px; font-weight: 600; color: var(--ink-2); padding-left: 2px; }
.f input:not([type=radio]):not([type=checkbox]):not([type=file]), .f textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft);
  font-size: 17px; color: var(--ink); outline: 0; -webkit-appearance: none; appearance: none;
  transition: border-color .15s, background .15s;
}
.f input[type=date] { min-width: 0; display: block; }
.f textarea { resize: vertical; min-height: 88px; line-height: 1.4; }
.f input::placeholder, .f textarea::placeholder { color: var(--ink-3); }
.f input:focus, .f textarea:focus { border-color: var(--ink); background: var(--surface); }
.f-suffix { position: relative; display: block; }
.f-suffix input { padding-right: 30px !important; }
.f-suffix i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--ink-3); pointer-events: none; }
.has-error input, .has-error textarea { border-color: var(--danger) !important; }
.f-error { font-size: 13px; color: var(--danger); padding-left: 2px; }
.hint { font-size: 13px; color: var(--ink-3); }
.grid-2, .grid-3 { display: grid; gap: 10px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-3 .f-label { font-size: 12px; }
.grid-3 input { padding-left: 10px !important; font-size: 16px !important; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg-soft);
  font-size: 15px; font-weight: 500; color: var(--ink-2); cursor: pointer; user-select: none;
  transition: background .15s, color .15s, border-color .15s;
}
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.items { display: grid; gap: 12px; }
.item { display: grid; gap: 12px; padding: 14px; border-radius: 14px; background: var(--bg-soft); }
.item .f input:not([type=radio]):not([type=checkbox]):not([type=file]) { background: var(--surface); }
.item-head { display: flex; align-items: center; justify-content: space-between; min-height: 28px; }
.item-title { font-weight: 600; font-size: 15px; }
.icon-sm { width: 32px; height: 32px; margin-right: -6px; }
.icon-sm .ic { width: 18px; height: 18px; }

.photos { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.photo, .photo-add { position: relative; flex: none; width: 76px; height: 76px; border-radius: 12px; }
.photo { overflow: hidden; background: var(--line); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo.loading::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 22px; height: 22px;
  border: 2px solid var(--ink-3); border-top-color: transparent; border-radius: 50%;
  animation: spin .8s linear infinite;
}
.photo-x {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; padding: 0;
  display: grid; place-items: center; border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .55); color: #fff; cursor: pointer;
}
.photo-x .ic { width: 14px; height: 14px; stroke-width: 2.4; }
.photo-add {
  display: grid; place-content: center; justify-items: center; gap: 2px;
  border: 1.5px dashed var(--ink-3); color: var(--ink-2); font-size: 12px; font-weight: 600; cursor: pointer;
}
.photo-add input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.photo-add .ic { width: 24px; height: 24px; }

.btn-ghost, .btn-soft {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; padding: 0 16px; border-radius: 12px; cursor: pointer; font-weight: 600;
}
.btn-ghost { border: 1.5px dashed var(--line); background: none; color: var(--ink); }
.btn-ghost .ic { width: 20px; height: 20px; }
.btn-soft { border: 0; background: var(--bg-soft); color: var(--ink); white-space: nowrap; }
.btn-ghost:active, .btn-soft:active { opacity: .7; }

.totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; padding-top: 14px; border-top: 1px solid var(--line); }
.totals div { display: grid; gap: 2px; }
.totals dt { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.totals dd { margin: 0; font-weight: 700; font-size: 17px; }
.totals dd.neg { color: var(--danger); }
.pay-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.pay-row .btn-soft { min-height: 48px; }
.pay-state { font-size: 15px; font-weight: 600; }

.savebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 10px 16px calc(10px + var(--safe-bottom));
  background: var(--bar); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
}
.savebar .btn { max-width: 720px; margin: 0 auto; display: flex; }
.form-page .toasts { bottom: calc(90px + var(--safe-bottom)); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Поиск, месяц и вкладки */
.filters { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-bottom: 12px; }
.search {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px;
  border-radius: 12px; background: var(--bg-soft); color: var(--ink-3);
}
.search .ic { width: 20px; height: 20px; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 17px; color: var(--ink); -webkit-appearance: none; }
.search input::-webkit-search-cancel-button { opacity: .5; }
.search:focus-within { box-shadow: 0 0 0 2px var(--ink) inset; }
.month {
  min-height: 44px; max-width: 150px; padding: 0 30px 0 12px; border: 0; border-radius: 12px;
  background: var(--bg-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 8px center / 18px;
  font-size: 15px; color: var(--ink); -webkit-appearance: none; appearance: none; text-overflow: ellipsis;
}
.tabs {
  display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 14px; padding: 0 16px 2px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px;
  border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--ink-2); background: var(--bg-soft);
}
.tab span { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.tab[aria-current] { background: var(--accent); color: var(--accent-ink); }
.tab[aria-current] span { color: var(--accent-ink); opacity: .6; }
#results { transition: opacity .15s; }
#results.loading { opacity: .5; }

/* Таблица заказов: только на компьютере */
.order-table { display: none; }

/* Удаление заказа */
.delete-form { max-width: 720px; margin-top: 14px; }
.btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: 48px; border: 1px solid var(--line); border-radius: 14px; background: none;
  color: var(--danger); font-weight: 600; cursor: pointer;
}
.btn-danger .ic { width: 20px; height: 20px; }
.btn-danger:active { background: var(--danger-soft); }

/* Итоги */
.month-switch { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; margin-bottom: 16px; }
.round { margin: 0; background: var(--bg-soft); color: var(--ink); }
.flip .ic { transform: rotate(180deg); }
.month-name { display: grid; justify-items: center; text-align: center; }
.month-name b { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.month-name a { font-size: 13px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat {
  display: grid; gap: 2px; align-content: start; padding: 14px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
}
.stat-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.stat-value { font-size: 24px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.stat-value small { font-size: 15px; font-weight: 600; color: var(--ink-2); letter-spacing: 0; }
.stat-value.neg { color: var(--danger); }
.stat-note { font-size: 13px; color: var(--ink-3); }
.stat-main { background: var(--accent); border-color: var(--accent); }
.stat-main .stat-label, .stat-main .stat-note { color: var(--accent-ink); opacity: .7; }
.stat-main .stat-value { color: var(--accent-ink); }
.hint.center { text-align: center; margin-top: 12px; }
.debts { margin-top: 28px; display: grid; gap: 8px; }
.debts-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.debts-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.debts-total { font-size: 17px; font-weight: 700; color: var(--danger); white-space: nowrap; }
.debt-list { display: grid; gap: 8px; margin-top: 4px; }
.debt {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.debt:active { background: var(--bg-soft); }
.debt small { display: block; font-size: 13px; color: var(--ink-3); }
.debt-main { min-width: 0; }
.debt-main b, .debt-main small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.debt-main b { display: block; font-weight: 600; }
.debt-side { text-align: right; flex: none; }
.debt-side b { color: var(--danger); font-weight: 700; }
.all-paid { padding: 16px; border-radius: var(--radius); background: var(--bg-soft); color: var(--ink-2); text-align: center; }

/* Наличие */
.filters-one { grid-template-columns: minmax(0, 1fr); }
.stock-count { margin-bottom: 10px; }
.stock-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stock-card {
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
}
.stock-link { display: flex; flex-direction: column; flex: 1; }
.stock-photo {
  position: relative; display: grid; place-items: center; aspect-ratio: 1;
  background: var(--bg-soft); color: var(--ink-3);
}
.stock-photo img { width: 100%; height: 100%; object-fit: cover; }
.stock-photo .ic { width: 32px; height: 32px; }
.stock-more {
  position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 999px;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 11px; font-weight: 600;
}
.stock-info { display: grid; gap: 1px; padding: 10px 12px 8px; min-width: 0; }
.stock-brand { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.stock-name { font-size: 15px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stock-size { font-size: 13px; color: var(--ink-2); }
.stock-price { font-size: 17px; font-weight: 700; margin-top: 4px; }
.stock-sell {
  display: grid; place-items: center; min-height: 40px; margin: 0 10px 10px;
  border-radius: 10px; background: var(--bg-soft); font-size: 14px; font-weight: 600;
}
.stock-sell:active { background: var(--line); }
.savebar-row { display: grid; gap: 10px; max-width: 720px; margin: 0 auto; }
.savebar-row.two { grid-template-columns: 1fr 1.4fr; }
.savebar .savebar-row .btn { max-width: none; margin: 0; }
.btn-soft-dark { background: var(--bg-soft); color: var(--ink); }
.sell-item {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
}
.sell-item b { display: block; font-weight: 600; }
.sell-item small { display: block; font-size: 13px; color: var(--ink-2); }

/* Приложение: компьютер */
@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 240px 1fr; }
  .top, .tabbar { display: none; }
  .side {
    position: sticky; top: 0; height: 100dvh;
    display: flex; flex-direction: column; gap: 24px;
    padding: 24px 14px; border-right: 1px solid var(--line); background: var(--bg-soft);
  }
  .side-brand { display: flex; align-items: center; gap: 10px; padding: 0 10px; font-weight: 600; }
  .mark {
    display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
    background: #111113; color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .02em;
  }
  .side-nav { display: grid; gap: 2px; }
  .side-nav .nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 500;
  }
  .side-nav .nav-item:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
  .side-nav .nav-item[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
  .side-nav .ic { width: 20px; height: 20px; }
  .side-out { margin-top: auto; }
  .side-out .link-btn { width: 100%; padding: 10px 12px; border-radius: 10px; font-weight: 500; }
  .side-out .link-btn:hover { color: var(--ink); }
  .side-out .ic { width: 20px; height: 20px; }
  .content { padding: 40px 48px 64px; }
  .page-title { font-size: 34px; }
  .page-head { margin: 0 0 28px; }
  .filters { grid-template-columns: minmax(0, 420px) auto; justify-content: start; }
  .tabs { margin: 0 0 16px; padding: 0; flex-wrap: wrap; }
  .order-list { display: none; }
  .order-table { display: table; width: 100%; border-collapse: collapse; font-size: 15px; }
  .order-table th {
    text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3);
    padding: 0 12px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
  }
  .order-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
  .order-table tbody tr { cursor: pointer; transition: background .12s; }
  .order-table tbody tr:hover { background: var(--bg-soft); }
  .order-table .r { text-align: right; white-space: nowrap; }
  .order-table .num { color: var(--ink-3); font-weight: 600; width: 1%; }
  .order-table small { display: block; font-size: 13px; color: var(--ink-3); }
  .order-table .neg { color: var(--danger); }
  .order-table .muted { color: var(--ink-3); }
  .order-table .nowrap { white-space: nowrap; color: var(--ink-2); }
  .t-client { display: flex; align-items: center; gap: 10px; }
  .t-client img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; }
  .t-client b { font-weight: 600; display: block; }
  .t-items span { display: block; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .t-items span + span { font-size: 13px; color: var(--ink-2); }
  .t-track { white-space: nowrap; }
  .stats { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .stat { padding: 18px; }
  .stat-value { font-size: 28px; }
  .month-switch { max-width: 420px; }
  .debts { max-width: 720px; }
  .debt:hover { background: var(--bg-soft); }
  .stock-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
  .stock-card:hover { box-shadow: 0 4px 16px rgba(0, 0, 0, .06); }
  .savebar { left: 240px; }
  .toasts { bottom: 32px; }
  .form-page .content { padding-bottom: 120px; }
}

/* Кнопка «Показать ещё» под списком заказов */
.more { width: 100%; margin-top: 12px; }
