/* Общий UI-кит RBS (из ERP «Бетон»). Оформление системы продаж вина — vino/app.css поверх этого файла.
   Шрифты системные: без внешних CDN. */

:root {
  --bg: #e9ecee;
  --panel: #ffffff;
  --panel-2: #f4f6f7;
  --ink: #18212b;
  --muted: #5b6875;
  --line: #c9d0d6;
  --line-soft: #dde2e6;
  --accent: #1f5fbf;
  --accent-ink: #ffffff;
  --accent-soft: #e3ecfa;
  --focus: #1f5fbf;

  /* статусы — из макетов ТЗ; легенда на каждом графике */
  --st-done: #2f9a53;      --st-done-bg: #d6efdd;
  --st-transit: #dd7334;   --st-transit-bg: #fbe2d3;
  --st-loading: #d9a021;   --st-loading-bg: #fcefcd;
  --st-planned: #5a8bd6;   --st-planned-bg: #dce7f8;
  --st-conflict: #c93a3a;  --st-conflict-bg: #f6d6d6;
  --st-none: #9aa5b0;      --st-none-bg: #ffffff;
  --fill-done: #8fd19e; --fill-planned: #9fc0f2; --fill-loading: #f6cf6e; --fill-conflict: #ee9b9b; --fill-plan: #e3e7eb;

  --radius-s: 6px;
  --radius-m: 10px;
  --shadow-pop: 0 12px 32px rgba(24, 33, 43, 0.18);
  --font: "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --rail: 208px;
  color-scheme: light;
}

/* Тёмная тема */
:root[data-theme="dark"] {
  --bg: #161d24;
  --panel: #1f2832;
  --panel-2: #26313c;
  --ink: #e6ebef;
  --muted: #9aa7b3;
  --line: #3a4753;
  --line-soft: #2e3944;
  --accent: #5b9bff;
  --accent-ink: #0d1620;
  --accent-soft: #23344d;
  --focus: #8db8ff;
  --st-done-bg: #1e3a29;
  --st-transit-bg: #42291b;
  --st-loading-bg: #40351a;
  --st-planned-bg: #1f3150;
  --st-conflict-bg: #4a2222;
  --st-none-bg: #1f2832;
  --fill-done: #2f6b41; --fill-planned: #2d4f85; --fill-loading: #7a6020; --fill-conflict: #7a3030; --fill-plan: #34404c;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
#root { min-height: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.num, td.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 700; }
.right { text-align: right; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.tight { gap: 6px; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.tight { gap: 6px; }
.grow { flex: 1 1 auto; min-width: 0; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------- каркас приложения ---------------- */
.shell { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; }
.rail {
  background: var(--ink);
  color: #dfe5ea;
  display: flex; flex-direction: column;
  padding: 14px 10px; gap: 2px;
  position: sticky; top: 0; height: 100vh;
}
:root[data-theme="dark"] .rail { background: #0f151b; }
.rail .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; color: #fff; font-weight: 700; }
.rail .brand svg { flex: none; }
.rail a {
  display: flex; align-items: center; gap: 10px;
  color: inherit; text-decoration: none;
  padding: 9px 10px; border-radius: var(--radius-s);
  font-size: 14px;
}
.rail a:hover { background: rgba(255, 255, 255, 0.07); }
.rail a.active { background: var(--accent); color: #fff; }
.rail a .ico { width: 20px; height: 20px; flex: none; opacity: 0.9; }
.rail .spacer { flex: 1; }
.rail .who { font-size: 13px; padding: 8px 10px; color: #aeb9c3; border-top: 1px solid rgba(255,255,255,0.1); }
.rail .who button { background: none; border: 0; color: #fff; padding: 0; cursor: pointer; text-decoration: underline; }
.rail .rail-links { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; font-size: 13px; }
.rail .rail-links a { color: #e8dcc4; text-decoration: none; }
.rail .rail-links a:hover { text-decoration: underline; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 22px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.content { padding: 18px 22px 40px; display: flex; flex-direction: column; gap: 16px; }
.content.flush { padding: 0; }
.bottom-nav { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .rail { display: none; }
  .topbar { padding: 12px 16px; }
  .content { padding: 14px 16px 92px; }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: var(--panel); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a, .bottom-nav button {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-size: 11px; color: var(--muted); text-decoration: none; padding: 4px 2px;
  }
  .bottom-nav button { background: none; border: 0; font: inherit; font-size: 11px; cursor: pointer; }
  .bottom-nav a.active { color: var(--accent); font-weight: 700; }
  .bottom-nav .ico { width: 22px; height: 22px; }
}

/* ---------------- панели и блоки ---------------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); }
.panel > .ph { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 12px; }
.panel > .pb { padding: 14px 16px; }
.panel.pad { padding: 14px 16px; }
.split { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .cols-2, .cols-3 { grid-template-columns: 1fr; } }

/* ---------------- кнопки и поля ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--panel); color: var(--ink); cursor: pointer; font-weight: 600;
  white-space: nowrap; text-decoration: none;
}
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--st-conflict); border-color: var(--st-conflict); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--panel-2); }
.btn.small { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn.big { min-height: 64px; font-size: 19px; padding: 0 22px; border-width: 2px; border-radius: var(--radius-m); }
.btn.block { width: 100%; }
.icon-btn { width: 36px; padding: 0; }

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label, .field > .label { font-size: 13px; color: var(--muted); }
.field .hint { font-size: 12px; color: var(--muted); }
.field .err { font-size: 12px; color: var(--st-conflict); }
.input, .select, textarea.input {
  width: 100%; min-height: 40px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--panel); color: var(--ink);
}
textarea.input { min-height: 72px; resize: vertical; }
.input:focus, .select:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft); }
.input.invalid { border-color: var(--st-conflict); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid .wide { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.check input { width: 18px; height: 18px; }

/* сегментированные кнопки */
.seg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.seg button {
  min-height: 48px; border: 1.5px solid var(--line); border-radius: var(--radius-s);
  background: var(--panel); font-weight: 600; font-size: 16px; cursor: pointer;
}
.seg button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); border-width: 2px; }
.stepper { display: inline-grid; grid-template-columns: 48px 56px 48px; border: 1.5px solid var(--line); border-radius: var(--radius-s); overflow: hidden; }
.stepper button { border: 0; background: var(--panel-2); font-size: 22px; cursor: pointer; min-height: 48px; }
.stepper input { border: 0; text-align: center; font-size: 18px; font-weight: 700; width: 56px; background: var(--panel); }

/* ---------------- таблицы ---------------- */
.table-wrap { overflow: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 13px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; }
.table td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: var(--panel-2); }
.table td.num, .table th.num { text-align: right; }

/* ---------------- статусы ---------------- */
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px;
  border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink);
}
.tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--st-none); }
.tag.s-done::before { background: var(--st-done); }
.tag.s-transit::before { background: var(--st-transit); }
.tag.s-loading::before { background: var(--st-loading); }
.tag.s-planned::before { background: var(--st-planned); }
.tag.s-conflict::before { background: var(--st-conflict); }
.tag.plain::before { display: none; }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 16px; height: 12px; border-radius: 3px; border: 1.5px solid; display: inline-block; }

.sw-done { background: var(--st-done-bg); border-color: var(--st-done); }
.sw-transit { background: var(--st-transit-bg); border-color: var(--st-transit); }
.sw-loading { background: var(--st-loading-bg); border-color: var(--st-loading); }
.sw-planned { background: var(--st-planned-bg); border-color: var(--st-planned); }
.sw-conflict { background: var(--st-conflict-bg); border-color: var(--st-conflict); }
.sw-none { background: var(--st-none-bg); border-color: var(--line); }

/* предупреждения */
.alert {
  border: 1.5px solid var(--st-loading); background: var(--st-loading-bg);
  border-radius: var(--radius-s); padding: 10px 12px;
}
.alert.risk { border-color: var(--st-conflict); background: var(--st-conflict-bg); }
.alert.info { border-color: var(--st-planned); background: var(--st-planned-bg); }
.alert.ok { border-color: var(--st-done); background: var(--st-done-bg); }
.alert .t { font-weight: 600; }
.alert .d { font-size: 13px; color: var(--muted); }
.alert.opt { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.alert.opt input { margin-top: 3px; }
.alert.opt .d { display: block; }

/* ИИ-выводы визуально отделены от фактических данных */
.ai {
  border: 1.5px dashed var(--accent); border-radius: var(--radius-m);
  background: repeating-linear-gradient(135deg, var(--accent-soft) 0 10px, transparent 10px 20px);
  padding: 12px 14px;
}
.ai .badge { font-size: 12px; font-weight: 700; color: var(--accent); }

/* ---------------- показатели ---------------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px 14px; }
.kpi .k { font-size: 13px; color: var(--muted); }
.kpi .v { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: 2px; }
.kpi .s { font-size: 13px; color: var(--muted); }
.kpi.warn { border-color: var(--st-loading); }
.kpi.bad { border-color: var(--st-conflict); }

.bar { height: 10px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--st-done); border-radius: 999px; }
.bar.warn > i { background: var(--st-transit); }
.bar.thin { height: 6px; }

/* ---------------- выезжающая панель и диалоги ---------------- */
.overlay { position: fixed; inset: 0; background: rgba(15, 21, 27, 0.4); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(980px, 100vw);
  background: var(--panel); z-index: 41; display: flex; flex-direction: column;
  box-shadow: var(--shadow-pop);
}
.drawer.narrow { width: min(560px, 100vw); }
.drawer > header { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.drawer > .body { overflow: auto; flex: 1; padding: 16px 18px; }
.drawer > footer { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; flex-wrap: wrap; }
.modal {
  position: fixed; left: 50%; top: 12vh; transform: translateX(-50%);
  width: min(520px, calc(100vw - 32px)); background: var(--panel); border-radius: var(--radius-m);
  z-index: 41; box-shadow: var(--shadow-pop); padding: 18px; display: flex; flex-direction: column; gap: 14px;
  max-height: calc(100vh - 12vh - 16px); overflow-y: auto;
}

/* уведомления */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--radius-s); max-width: 420px; box-shadow: var(--shadow-pop); }
.toast.err { background: #8f2424; }
@media (max-width: 860px) { .toasts { bottom: 84px; left: 16px; } }

/* связь с сервером */
.netbar { padding: 8px 16px; background: var(--st-conflict); color: #fff; font-weight: 600; text-align: center; }
.netbar.queued { background: var(--st-loading); color: #1b1404; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button {
  border: 0; background: none; padding: 10px 12px; cursor: pointer; color: var(--muted);
  border-bottom: 3px solid transparent; font-weight: 600; white-space: nowrap;
}
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }

.empty { padding: 28px; text-align: center; color: var(--muted); }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- вход ---------------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .box { width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.login .mark { display: flex; gap: 10px; align-items: center; }


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .rail, .topbar, .bottom-nav, .no-print { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
}

/* дочерние элементы сеток не растягивают страницу */
.split > *, .cols-2 > *, .cols-3 > * { min-width: 0; }
.main { overflow-x: hidden; }

/* ---------------- система продаж вина: оформление поверх общего UI-кита ----------------
   Тёплый светлый фон, бордовый акцент. Цвета статусов — общие (shared/styles.css). */

/* «Погреб»: прохладный меловой фон (известняк винных подвалов), бумага этикетки, чернила,
   баклажанный погреб для навигации, вино — для главных действий, латунь капсулы — для отметок.
   Названия вин и заголовки — антиквой, как на этикетке; цифры и интерфейс — гротеском. */
:root {
  --chalk: #e6e4df;
  --paper: #fbfaf7;
  --cellar: #2b1a22;
  --cellar-2: #3a2530;
  --wine: #7a1733;
  --wine-deep: #5e0f26;
  --brass: #a8843f;
  --brass-soft: #efe4cc;

  --bg: var(--chalk);
  --panel: var(--paper);
  --panel-2: #f2f0eb;
  --ink: #1e1a1d;
  --muted: #6a6266;
  --line: #d3cfc8;
  --line-soft: #e4e1db;
  --accent: var(--wine);
  --accent-ink: #ffffff;
  --accent-soft: #f3e4e8;
  --focus: var(--brass);
  --radius-s: 8px;
  --radius-m: 12px;
  --shadow-pop: 0 18px 48px rgba(43, 26, 34, 0.22);
  --shadow-rest: 0 1px 0 rgba(43, 26, 34, 0.04), 0 1px 2px rgba(43, 26, 34, 0.05);
  --serif: "Palatino Linotype", "Book Antiqua", Palatino, "URW Palladio L", "P052", Georgia, serif;
  --font: "Segoe UI", "Segoe UI Variable Text", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --rail: 232px;
  --chat-bg: #ebe7e2;
  --bubble-in: #ffffff;
  --bubble-out: #ecdce1;
  --bubble-client: #e1ebdd;
}
:root[data-theme="dark"] {
  --chalk: #17121a;
  --paper: #211a22;
  --cellar: #120d12;
  --cellar-2: #1d151c;
  --wine: #c45a76;
  --wine-deep: #a2445e;
  --brass: #c9a35a;
  --brass-soft: #3a2f1c;
  --panel-2: #2a222b;
  --ink: #efe9ec;
  --muted: #a99ea4;
  --line: #3e333d;
  --line-soft: #312830;
  --accent-ink: #1a0f14;
  --accent-soft: #3a2029;
  --chat-bg: #1b1519;
  --bubble-in: #2a222b;
  --bubble-out: #4a2a35;
  --bubble-client: #24402e;
}

.badge-n {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.rail a.active .badge-n { background: #fff; color: var(--accent); }

/* демо-полоса */
.demo-bar {
  background: #2b2223; color: #efe7e0; font-size: 13px; padding: 7px 22px;
  display: flex; gap: 8px 18px; flex-wrap: wrap; justify-content: space-between;
}
.demo-bar b { color: #fff; }

/* вино в таблице */
.wine-cell .t { font-weight: 600; }
.wine-cell .s { font-size: 13px; color: var(--muted); }
.dot-color { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; border: 1px solid rgba(0,0,0,.15); }
.c-red { background: #7d1d3a; }
.c-white { background: #e9dc9a; }
.c-rose { background: #e8a3b2; }
.c-sparkling { background: #f1e3b3; }
.c-sweet { background: #d79a2b; }
.c-spirit { background: #8a5a2b; }
.c-fortified { background: #6b2737; }
.c-other { background: #9aa0a6; }

.src-own { background: var(--st-done-bg); border-color: var(--st-done); }
.src-sup { background: var(--st-planned-bg); border-color: var(--st-planned); }
.tag.src-own::before { background: var(--st-done); }
.tag.src-sup::before { background: var(--st-planned); }

.stars { color: #9a6a00; letter-spacing: 1px; white-space: nowrap; }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 6px 14px;
  min-height: 36px; font-weight: 600; cursor: pointer; color: var(--ink);
}
.pill[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

/* карточки (поставщики, находки, заказы) */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.card .h { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.card .h .n { font-weight: 700; font-size: 16px; }
.card .foot { border-top: 1px solid var(--line-soft); padding-top: 8px; display: flex; justify-content: space-between; gap: 8px; font-size: 13px; flex-wrap: wrap; }
.row-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 16px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.row-card .main-col { flex: 1 1 320px; min-width: 0; }
.price-big { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* сводка загрузки прайса */
.diff-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.diff-grid > div { border-radius: var(--radius-s); padding: 10px 12px; border: 1.5px solid; }
.diff-grid .v { font-size: 24px; font-weight: 700; }
.diff-grid .k { font-size: 13px; }
.d-add { background: var(--st-done-bg); border-color: var(--st-done); }
.d-remove { background: var(--st-conflict-bg); border-color: var(--st-conflict); }
.d-update { background: var(--st-planned-bg); border-color: var(--st-planned); }
.d-same { background: var(--panel-2); border-color: var(--line); }
.d-check { background: var(--st-loading-bg); border-color: var(--st-loading); }
@media (max-width: 700px) { .diff-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
tr.a-add td:first-child { box-shadow: inset 4px 0 0 var(--st-done); }
tr.a-remove td:first-child { box-shadow: inset 4px 0 0 var(--st-conflict); }
tr.a-update td:first-child { box-shadow: inset 4px 0 0 var(--st-planned); }
tr.a-check td:first-child { box-shadow: inset 4px 0 0 var(--st-loading); }
tr.a-skip td { opacity: .5; }
.strike { text-decoration: line-through; color: var(--muted); }

/* столбики выручки */
.vbars { display: flex; align-items: flex-end; gap: 12px; height: 210px; border-bottom: 1px solid var(--line); padding-top: 10px; }
.vbars .c { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; min-width: 0; }
.vbars .c i { display: block; width: 100%; max-width: 56px; border-radius: 6px 6px 0 0; background: #c9a5b0; }
.vbars .c.cur i { background: var(--accent); }
.vbars .c b { font-size: 13px; font-variant-numeric: tabular-nums; }
.vbars-x { display: flex; gap: 12px; margin-top: 6px; }
.vbars-x span { flex: 1 1 0; text-align: center; font-size: 13px; color: var(--muted); }

/* ---------------- эмулятор Telegram ---------------- */
.phone {
  width: 100%; max-width: 420px; height: 720px; border: 1px solid var(--line); border-radius: 22px;
  background: var(--chat-bg); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 6px 24px rgba(40, 20, 25, .08);
}
.phone .ph-head { background: var(--panel); border-bottom: 1px solid var(--line); padding: 10px 14px; display: flex; gap: 10px; align-items: center; min-height: 60px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.avatar.gray { background: #4a4240; }
.phone .ph-head .t { font-weight: 700; }
.phone .ph-head .s { font-size: 12px; color: var(--muted); }
.phone .ph-body { flex: 1; overflow-y: auto; padding: 12px 10px; display: flex; flex-direction: column; gap: 8px; }
.phone .ph-input { background: var(--panel); border-top: 1px solid var(--line); padding: 8px; display: flex; gap: 8px; align-items: flex-end; }
.phone .ph-input textarea { flex: 1; min-height: 44px; max-height: 140px; border-radius: 20px; padding: 10px 14px; resize: none; }
.send-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.send-btn:disabled { opacity: .5; cursor: not-allowed; }
.send-btn .ico { width: 20px; height: 20px; }

.bubble { max-width: 86%; padding: 8px 11px; border-radius: 16px; font-size: 14px; line-height: 1.4; white-space: pre-line; overflow-wrap: anywhere; box-shadow: 0 1px 0 var(--line-soft); }
.bubble.in { align-self: flex-start; background: var(--bubble-in); border-bottom-left-radius: 4px; }
.bubble.out { align-self: flex-end; background: var(--bubble-out); border-bottom-right-radius: 4px; }
.bubble.client { background: var(--bubble-client); }
.bubble .meta { font-size: 11px; color: var(--muted); text-align: right; margin-top: 3px; }
.bubble.draft { border: 1.5px dashed var(--accent); background: var(--panel); }
.bubble .who { font-size: 11px; font-weight: 700; color: var(--accent); margin-bottom: 2px; }
.bubble .kb { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bubble .kb button {
  flex: 1 1 auto; min-height: 40px; border: 1px solid var(--line); background: var(--panel-2); color: var(--accent);
  border-radius: 10px; font-weight: 600; font-size: 13px; cursor: pointer; padding: 6px 10px;
}
.bubble .kb button:hover { background: var(--accent-soft); }
.bubble .done { margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--st-done); }
.bubble .img-ph { margin-top: 6px; aspect-ratio: 1 / 1; border-radius: 12px; background: #2b2324; color: #d6cbc3; display: grid; place-items: center; text-align: center; padding: 16px; font-size: 13px; }
.sys-chip { align-self: center; font-size: 12px; color: var(--muted); background: var(--panel); border-radius: 999px; padding: 3px 10px; }

.chat-list { display: flex; flex-direction: column; }
.chat-list button {
  display: flex; gap: 10px; align-items: center; text-align: left; border: 0; border-bottom: 1px solid var(--line-soft);
  background: var(--panel); padding: 10px 12px; cursor: pointer; min-height: 60px; color: var(--ink);
}
.chat-list button[aria-current="true"] { background: var(--accent-soft); }
.chat-list .nm { font-weight: 600; }
.chat-list .pv { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 230px; }
.emu { display: grid; grid-template-columns: 280px minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1250px) { .emu { grid-template-columns: 1fr 1fr; } .emu > .chat-col { grid-column: 1 / -1; } }
@media (max-width: 860px) { .emu { grid-template-columns: 1fr; } }
.emu-hint { font-size: 13px; color: var(--muted); }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.quick button { border: 1px dashed var(--line); background: var(--panel); border-radius: 999px; padding: 4px 10px; font-size: 13px; cursor: pointer; color: var(--ink); }
.quick button:hover { border-color: var(--accent); color: var(--accent); }

/* пост канала */
.post-grp { font-weight: 700; font-size: 13px; margin-top: 10px; }
.post-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; line-height: 1.55; }
.post-row b { white-space: nowrap; }
.file-chip { display: flex; gap: 10px; align-items: center; background: var(--panel-2); border-radius: 10px; padding: 8px 10px; margin-top: 10px; }
.file-chip .x { width: 36px; height: 36px; border-radius: 8px; background: #2f6b3f; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }

/* ---------------- прайс для клиентов (без входа) ---------------- */
.public { min-height: 100vh; background: var(--bg); }
.public header { background: #231c1d; color: #f3ede7; }
.public header .in { max-width: 1120px; margin: 0 auto; padding: 26px 20px; display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center; }
.public header h1 { font-size: 24px; letter-spacing: .02em; }
.public header .s { color: #cfc6be; font-size: 14px; margin-top: 4px; }
.public header a.cta { background: #f3ede7; color: #231c1d; text-decoration: none; font-weight: 700; border-radius: 10px; padding: 12px 18px; min-height: 44px; display: inline-flex; align-items: center; }
.public main { max-width: 1120px; margin: 0 auto; padding: 22px 20px 40px; display: flex; flex-direction: column; gap: 16px; }
.wcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.wcard { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.wcard .r { font-size: 13px; color: var(--muted); }
.wcard .n { font-weight: 700; font-size: 17px; line-height: 1.3; }
.wcard .b { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 8px; gap: 8px; flex-wrap: wrap; }
.wcard .p { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.avail { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.avail.yes { background: var(--st-done-bg); color: #1f4d2b; }
.avail.order { background: var(--st-planned-bg); color: #2b4c7e; }

.svc-grid { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 960px) { .svc-grid { grid-template-columns: 1fr; } }
.cols-2.top { align-items: start; }
td.num { white-space: nowrap; }

/* ---- прайс по ссылке: корзина и оформление */
.cart-bar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 20; display: flex; gap: 14px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 8px 8px 8px 18px; box-shadow: 0 8px 28px rgba(0,0,0,.18);
  max-width: calc(100vw - 32px); }
.checkout { position: fixed; inset: 0; z-index: 30; background: rgba(20, 10, 14, .45); display: grid; place-items: center; padding: 16px; }
.checkout .box { background: var(--panel); border-radius: 16px; padding: 20px; width: min(460px, 100%); display: flex; flex-direction: column; gap: 12px;
  max-height: calc(100vh - 32px); overflow: auto; }
.checkout h2 { margin: 0; }
.checkout .field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.wcard .btn { width: 100%; }
.wcard .row.between .btn { width: auto; min-width: 44px; }

/* выбор вина поиском */
.wpick { position: relative; }
.wpick-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 2px); max-height: 260px; overflow: auto;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-s); box-shadow: var(--shadow-pop); }
.wpick-item { display: block; width: 100%; text-align: left; padding: 7px 10px; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.wpick-item:hover, .wpick-item:focus { background: var(--accent-soft); }
.batch-row td { vertical-align: top; }
.link { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; text-align: left; }

/* похожие названия: урожаи и цены поставщиков рядом, плотно */
.table.compact td { padding: 4px 8px; vertical-align: top; }

/* прайс по винам: строка вина, под ней — все, у кого оно есть */
.table.by-wine tbody + tbody { border-top: 2px solid var(--line, #e5e0d8); }
.table.by-wine tr.wine-head td { background: var(--panel-2, rgba(0, 0, 0, 0.025)); padding-top: 10px; padding-bottom: 6px; }
.table.by-wine tr.vintage-head td { padding-left: 20px; padding-top: 8px; padding-bottom: 4px; border-top: 1px dashed var(--line-soft); }
.table.by-wine tr.offer td:first-child { padding-left: 36px; }
.row.wrap { flex-wrap: wrap; }
.public .lots { list-style: none; margin: 6px 0 0; padding: 0; color: var(--muted, #6b625a); }
.public .lots li { padding: 2px 0; border-top: 1px dashed var(--line-soft); }
.public .lots.offers li { display: grid; gap: 6px; padding: 8px 0; color: var(--ink, inherit); }
.public .lots.offers li > .row.between:first-child { gap: 8px; flex-wrap: wrap; }
.public .lots.offers .btn { min-height: 34px; padding: 4px 10px; }


/* ================================================================== «Погреб»: оформление ===== */

body { font-size: 14.5px; letter-spacing: 0.005em; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: 0; }
h1 { font-size: 27px; line-height: 1.12; }
h2 { font-size: 20px; }
h3 { font-size: 16.5px; }
::selection { background: var(--brass-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

/* навигация — погреб: тёмный баклажан, латунная риска у открытого раздела */
.rail {
  background: var(--cellar);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 40%);
  padding: 18px 12px 14px; gap: 1px; color: #d9cfd3;
}
.rail .brand {
  font-family: var(--serif); font-size: 19px; font-weight: 600; letter-spacing: 0.01em;
  padding: 4px 10px 22px; margin-bottom: 8px; border-bottom: 1px solid rgba(201, 163, 90, 0.22);
}
.rail .brand svg rect { fill: var(--wine); }
.rail a { position: relative; padding: 9px 12px; border-radius: 8px; font-size: 14px; color: #cdbfc5; transition: background 0.15s, color 0.15s; }
.rail a .ico { opacity: 0.75; }
.rail a:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.rail a.active { background: rgba(255, 255, 255, 0.08); color: #fff; font-weight: 600; }
.rail a.active::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brass);
}
.rail a.active .ico { opacity: 1; color: var(--brass); }
.rail .who { border-top: 1px solid rgba(201, 163, 90, 0.18); color: #a7979f; padding: 12px 10px 4px; }
.rail .who button { color: #e8dcc4; text-decoration: none; border-bottom: 1px solid rgba(232, 220, 196, 0.4); }
.badge-n { background: var(--brass); color: var(--cellar); }
.rail a.active .badge-n { background: var(--brass); color: var(--cellar); }

/* верх страницы — на меловом фоне, без белой плашки */
.topbar {
  background: color-mix(in srgb, var(--chalk) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 18px 28px 16px;
}
.content { padding: 22px 28px 48px; gap: 18px; }
@media (max-width: 860px) {
  .topbar { padding: 14px 16px; }
  .content { padding: 16px 16px 92px; }
  h1 { font-size: 23px; }
  .bottom-nav { background: var(--paper); }
  .bottom-nav a.active { color: var(--wine); }
}
.demo-bar { background: var(--cellar-2); color: #e5d9dd; padding: 7px 28px; }
.demo-bar b { color: #f3e7c9; }

/* кнопки: вино — главное действие, бумага с чернильной обводкой — обычное, без рамки — второстепенное */
.btn {
  min-height: 40px; padding: 0 16px; border-radius: 8px; font-weight: 600; font-size: 14px;
  border: 1px solid #c4bdb5; background: var(--paper); color: var(--ink);
  box-shadow: var(--shadow-rest); transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.05s;
}
.btn:hover { border-color: var(--ink); background: #fff; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(180deg, #8a1c3c, var(--wine) 55%, var(--wine-deep));
  border-color: var(--wine-deep); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 1px 2px rgba(94, 15, 38, 0.35);
}
.btn.primary:hover { filter: none; background: linear-gradient(180deg, #951f42, #82193a 55%, #66112a); border-color: #4e0c20; }
.btn.ghost { box-shadow: none; color: var(--muted); }
.btn.ghost:hover { background: rgba(43, 26, 34, 0.06); color: var(--ink); border-color: transparent; }
.btn.danger { background: var(--paper); }
.btn.small { min-height: 32px; padding: 0 11px; font-size: 13px; border-radius: 7px; }
:root[data-theme="dark"] .btn { border-color: var(--line); background: var(--panel-2); }
:root[data-theme="dark"] .btn.primary { background: var(--wine); border-color: var(--wine); color: var(--accent-ink); }

/* поля */
.input, .select, textarea.input {
  min-height: 40px; border-radius: 8px; border-color: #cbc5bd; background: #fff; padding: 8px 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
:root[data-theme="dark"] .input, :root[data-theme="dark"] .select { background: var(--panel-2); border-color: var(--line); }
.input:hover, .select:hover { border-color: #a9a199; }
.input:focus, .select:focus { border-color: var(--brass); outline: none; box-shadow: 0 0 0 3px rgba(168, 132, 63, 0.22); }
.select {
  appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236a6266' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.field > label, .field > .label { font-size: 12.5px; font-weight: 600; color: var(--muted); letter-spacing: 0.01em; }
.check input, .choice input { accent-color: var(--wine); }

/* переключатели: дорожка, выбранное — бумажная плашка */
.pill-row { gap: 2px; padding: 3px; background: rgba(43, 26, 34, 0.07); border-radius: 10px; width: max-content; max-width: 100%; }
.pill {
  border: 0; background: transparent; border-radius: 8px; padding: 6px 14px; min-height: 34px;
  color: var(--muted); font-weight: 600; font-size: 14px; transition: background 0.15s, color 0.15s;
}
.pill:hover { color: var(--ink); }
.pill[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(43, 26, 34, 0.14), 0 0 0 1px rgba(43, 26, 34, 0.04); }
:root[data-theme="dark"] .pill-row { background: rgba(255, 255, 255, 0.06); }
:root[data-theme="dark"] .pill[aria-pressed="true"] { background: var(--panel-2); }

.tabs { border-bottom-color: var(--line); gap: 2px; }
.tabs button { padding: 10px 14px; font-size: 14px; border-bottom-width: 2px; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--wine); }

/* показатели — одна строка счётной книги: колонки через тонкие линии, цифры антиквой */
.kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px;
  background: var(--line-soft); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; box-shadow: var(--shadow-rest);
}
.kpi, .kpi.warn, .kpi.bad { background: var(--paper); border: 0; border-radius: 0; padding: 14px 18px 15px; }
.kpi .k { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.kpi .v { font-family: var(--serif); font-size: 27px; font-weight: 600; margin-top: 4px; letter-spacing: -0.005em; }
.kpi .s { font-size: 12.5px; margin-top: 2px; }
.kpi.warn .v { color: #9a6a12; }
.kpi.bad .v { color: var(--st-conflict); }
@media (max-width: 860px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi { padding: 12px 14px; }
  .kpi .v { font-size: 22px; }
  .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .filters > .select, .filters > .search { flex: 1 1 100%; max-width: none !important; }
  .toolbar > .row { width: 100%; }
}

/* панели и карточки */
.panel, .card, .row-card { border-color: var(--line); box-shadow: var(--shadow-rest); }
.card .h .n, .row-card .n { font-family: var(--serif); font-size: 17.5px; font-weight: 600; }
.card { gap: 9px; }
.card.click:hover, .cards > .card[role="button"]:hover { border-color: #b9b1a8; }
.price-big { font-family: var(--serif); font-size: 22px; }

/* таблицы */
.table th {
  font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--paper);
  border-bottom: 1px solid var(--line); padding: 10px 12px;
}
.table td { padding: 10px 12px; border-bottom-color: var(--line-soft); }
.table tr.click:hover td { background: #f6f3ee; }
:root[data-theme="dark"] .table tr.click:hover td { background: var(--panel-2); }
.wine-cell .t { font-family: var(--serif); font-size: 15.5px; font-weight: 600; }

/* склад: вино — как строка на этикетке, урожаи и предложения — под ним */
.table.by-wine tbody + tbody { border-top: 1px solid var(--line); }
.table.by-wine tr.wine-head td { background: linear-gradient(180deg, #f7f4ef, #f3f0ea); padding: 13px 12px 9px; border-bottom: 0; }
:root[data-theme="dark"] .table.by-wine tr.wine-head td { background: var(--panel-2); }
.table.by-wine tr.wine-head .strong { font-family: var(--serif); font-size: 17px; font-weight: 600; letter-spacing: 0.005em; }
.table.by-wine tr.vintage-head td { padding: 9px 12px 5px 30px; border-top: 0; border-bottom: 0; }
.table.by-wine tr.vintage-head .strong { font-family: var(--serif); font-size: 15px; color: var(--wine); }
.table.by-wine tr.offer td { border-bottom-color: var(--line-soft); }
.table.by-wine tr.offer td:first-child { padding-left: 46px; }
.dot-color { width: 9px; height: 9px; margin-right: 8px; border: 0; box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px rgba(43, 26, 34, 0.12); }

/* отметки */
.tag { border-color: transparent; background: rgba(43, 26, 34, 0.06); font-weight: 600; padding: 2px 9px; }
.tag.plain { background: transparent; border-color: var(--line); color: var(--muted); }
.tag.s-done { background: var(--st-done-bg); }
.tag.s-loading { background: var(--st-loading-bg); }
.tag.s-transit { background: var(--st-transit-bg); }
.tag.s-planned { background: var(--st-planned-bg); }
.tag.s-conflict { background: var(--st-conflict-bg); }
.tag.src-own { background: var(--brass-soft); color: #5d4413; }
.tag.src-own::before { background: var(--brass); }
:root[data-theme="dark"] .tag.src-own { color: var(--brass); }
.stars { color: var(--brass); }
.alert { border-width: 1px; border-left-width: 4px; border-radius: 8px; padding: 12px 14px; }

/* выезжающая панель и окна */
.overlay { background: rgba(30, 14, 22, 0.42); backdrop-filter: blur(2px); }
.drawer { background: var(--paper); box-shadow: -20px 0 60px rgba(43, 26, 34, 0.25); }
.drawer > header { padding: 18px 22px; border-bottom-color: var(--line); }
.drawer > header h2 { font-size: 21px; }
.drawer > .body { padding: 20px 22px; }
.drawer > footer { padding: 14px 22px; background: #f6f3ee; border-top-color: var(--line); }
:root[data-theme="dark"] .drawer > footer { background: var(--panel-2); }
.modal { background: var(--paper); border-radius: 16px; padding: 22px 24px; gap: 16px; border: 1px solid var(--line); top: 10vh; width: min(560px, calc(100vw - 32px)); }
.modal h2 { font-size: 22px; }
.toast { background: var(--cellar); border-left: 3px solid var(--brass); border-radius: 10px; padding: 12px 16px; }
.toast.err { background: #6e1426; border-left-color: #f0b4c2; }
.diff-grid > div { border-width: 1px; border-radius: 10px; }
.diff-grid .v { font-family: var(--serif); font-size: 28px; }

/* окно выгрузки: выбор, что отправить клиенту */
.choice-list { display: flex; flex-direction: column; gap: 8px; }
.choice {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; transition: border-color 0.15s, background 0.15s;
}
:root[data-theme="dark"] .choice { background: var(--panel-2); }
.choice input { margin-top: 3px; width: 16px; height: 16px; }
.choice > span { display: flex; flex-direction: column; gap: 2px; }
.choice.on { border-color: var(--wine); background: var(--accent-soft); }
.pick-tree { display: flex; flex-direction: column; gap: 10px; max-height: 300px; overflow: auto; padding: 2px; }
.pick-group { border: 1px solid var(--line-soft); border-radius: 10px; padding: 10px 12px; background: #fff; }
:root[data-theme="dark"] .pick-group { background: var(--panel-2); }
.pick-subs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 14px; margin: 8px 0 0 26px; }

/* выбор вина поиском */
.wpick-list { border-radius: 10px; padding: 4px; }
.wpick-item { border-radius: 6px; padding: 8px 10px; }

/* ---------------- вход: дверь в погреб ---------------- */
body[data-app="vino"] .login {
  background:
    radial-gradient(1200px 600px at 15% 110%, rgba(122, 23, 51, 0.55), transparent 60%),
    radial-gradient(900px 500px at 100% -10%, rgba(168, 132, 63, 0.18), transparent 60%),
    var(--cellar);
  position: relative; overflow: hidden;
}
/* след бокала на столе — латунное кольцо, прорисовывается один раз при входе */
body[data-app="vino"] .login::before {
  content: ""; position: absolute; width: 560px; height: 560px; right: -140px; top: -160px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Ccircle cx='100' cy='100' r='88' fill='none' stroke='%23a8843f' stroke-opacity='.5' stroke-width='1.2' stroke-dasharray='520 34 6 30'/%3E%3Ccircle cx='100' cy='100' r='80' fill='none' stroke='%23a8843f' stroke-opacity='.22' stroke-width='5' stroke-dasharray='300 80 120 40'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: ring-in 1.6s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes ring-in { from { opacity: 0; transform: rotate(-40deg) scale(.92); } to { opacity: 1; transform: none; } }
body[data-app="vino"] .login .box {
  position: relative; z-index: 1; width: min(420px, 100%); padding: 34px 32px 26px; gap: 16px;
  background: var(--paper); border: 1px solid rgba(168, 132, 63, 0.35); border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}
body[data-app="vino"] .login .mark { flex-direction: column; align-items: flex-start; gap: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
body[data-app="vino"] .login .mark h1 { font-size: 30px; }
body[data-app="vino"] .login .btn.primary { min-height: 46px; font-size: 15px; }

/* ---------------- прайс для клиентов по ссылке ---------------- */
.public header { background: var(--cellar); position: relative; overflow: hidden; }
.public header::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 1px; background: linear-gradient(90deg, transparent, var(--brass), transparent);
}
.public header .in { padding: 34px 20px 30px; }
.public header h1 { font-family: var(--serif); font-size: 32px; letter-spacing: 0.01em; color: #f6efe4; }
.public header .s { color: #c9b9a0; }
.public header a.cta { background: var(--brass); color: var(--cellar); border-radius: 999px; padding: 12px 22px; }
.public header a.cta:hover { background: #bb9851; }
.wcards { gap: 16px; }
.wcard { border-radius: 14px; padding: 18px 18px 16px; box-shadow: var(--shadow-rest); border-color: var(--line); gap: 7px; }
.wcard .n { font-family: var(--serif); font-size: 19px; font-weight: 600; line-height: 1.25; }
.wcard .p { font-family: var(--serif); font-size: 22px; color: var(--wine); }
.avail.yes { background: var(--brass-soft); color: #5d4413; }
.cart-bar { background: var(--cellar); color: #f3e9ee; border-color: transparent; }

/* панель действий и фильтров страницы */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filters .search {
  flex: 1 1 240px; max-width: 380px; padding-left: 36px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236a6266' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center;
}
:root[data-theme="dark"] .filters .search { background-color: var(--panel-2); }
.note { max-width: 760px; margin-top: -6px; }

/* выбор файла: поле-приёмник вместо голой системной кнопки */
input[type="file"] {
  width: 100%; padding: 16px; border: 1.5px dashed #bfb7ae; border-radius: 12px; background: #fff;
  color: var(--muted); font-size: 13.5px; cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
input[type="file"]:hover { border-color: var(--brass); background: #fffdf8; }
input[type="file"]::file-selector-button {
  margin-right: 14px; min-height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--wine-deep);
  background: var(--wine); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}
:root[data-theme="dark"] input[type="file"] { background: var(--panel-2); border-color: var(--line); }
label.btn input[type="file"] { display: none; }

/* переключатель «да / нет» */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--muted); }
.switch input {
  appearance: none; width: 36px; height: 20px; border-radius: 999px; background: #cbc5bd; position: relative;
  cursor: pointer; transition: background 0.15s; margin: 0;
}
.switch input::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: transform 0.15s;
}
.switch input:checked { background: var(--wine); }
.switch input:checked::after { transform: translateX(16px); }
.switch input:checked + span { color: var(--ink); font-weight: 600; }

/* вход в прайс для клиентов (встреча 05.11): имя, контакт, 18+ и согласие */
.public form.box { background: var(--panel); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 10px 30px rgba(43, 26, 34, .08); }
.public form.box .field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.public .check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.linkish { background: none; border: 0; padding: 0; color: var(--wine); text-decoration: underline; cursor: pointer; font: inherit; }
