/* «Без остатка» — тёмная тема в цветах презентации. Mobile-first. */
:root {
  --bg: #121614;
  --surface: #1a1f1c;
  --surface-2: #222824;
  --border: #2c332e;
  --text: #f2ede4;
  --muted: #a9a49b;
  --accent: #ff6a3d;
  --accent-ink: #1a0d07;
  --mint: #6fd3a8;
  --mint-ink: #08241a;
  --danger: #ff8a8a;
  /* Цвета графиков: те же оттенки, что у бренда, но темнее — проверены валидатором
     (полоса светлоты для тёмного фона, различимость при дальтонизме, контраст ≥ 3:1) */
  --chart-1: #e8592c;
  --chart-2: #3fa67e;
  --radius: 14px;
  --gap: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 Manrope, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--mint); }

.topbar {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 14px var(--gap);
  border-bottom: 1px solid var(--border);
}
.brand { color: var(--text); font-weight: 800; font-size: 18px; text-decoration: none; letter-spacing: -.01em; }
.cafe { color: var(--muted); font-size: 14px; }

.demo-banner {
  background: color-mix(in srgb, var(--accent) 14%, var(--bg));
  color: var(--text);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  padding: 8px var(--gap);
  font-size: 13px;
}

.page { max-width: 720px; margin: 0 auto; padding: 20px var(--gap) 48px; }
h1 { font-size: 26px; line-height: 1.15; margin: 0 0 8px; letter-spacing: -.02em; font-weight: 800; }
.lead { color: var(--muted); margin: 0 0 20px; }
.hint { color: var(--muted); font-size: 14px; }

.checklist { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.checklist li {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px;
}
.checklist li::before {
  content: ""; flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%;
  border: 2px solid var(--muted);
}
.checklist li.done::before {
  border-color: var(--mint); background: var(--mint)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%2308241a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat;
}
.checklist strong { display: block; font-size: 17px; }
.checklist span { color: var(--muted); font-size: 14px; }
.checklist li.is-disabled { opacity: .6; }
.checklist li:has(a.row-link):hover { border-color: color-mix(in srgb, var(--mint) 50%, var(--border)); }
.checklist li:has(a.row-link)::after { content: "›"; margin-left: auto; color: var(--muted); font-size: 22px; line-height: 1; }

/* ---------- навигация ---------- */
.tabs {
  display: flex; gap: 4px; overflow-x: auto; padding: 0 var(--gap);
  border-bottom: 1px solid var(--border); scrollbar-width: none;
}
.tabs a {
  padding: 12px 8px; font-size: 15px; color: var(--muted); text-decoration: none; font-weight: 600; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
@media (max-width: 400px) {
  .tabs { gap: 0; padding: 0 8px; }
  .tabs a { padding: 12px 7px; font-size: 14px; }
}

.seg-tabs { display: flex; gap: 6px; margin: 0 0 16px; flex-wrap: wrap; }
.seg-tabs a {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border);
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px;
}
.seg-tabs a span { opacity: .7; font-weight: 500; margin-left: 2px; }
.seg-tabs a[aria-current="page"] { background: var(--text); color: var(--bg); border-color: var(--text); }

.back { display: inline-block; margin-bottom: 8px; color: var(--muted); text-decoration: none; font-size: 15px; }

/* ---------- блоки ---------- */
h2 { font-size: 18px; margin: 0 0 12px; letter-spacing: -.01em; }
section { margin: 20px 0; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px;
}
.card-demo { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.card p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.warn-text { color: var(--accent); font-style: normal; }

.msg { border-radius: var(--radius); padding: 12px 14px; margin: 0 0 12px; font-size: 15px; }
.msg-ok { background: color-mix(in srgb, var(--mint) 16%, var(--bg)); border: 1px solid color-mix(in srgb, var(--mint) 45%, transparent); }
.msg-warn { background: color-mix(in srgb, var(--accent) 12%, var(--bg)); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.msg-season { background: color-mix(in srgb, var(--mint) 10%, var(--bg)); border: 1px solid color-mix(in srgb, var(--mint) 30%, transparent); color: var(--text); }
.msg-error { background: color-mix(in srgb, var(--danger) 14%, var(--bg)); border: 1px solid color-mix(in srgb, var(--danger) 50%, transparent); }

.empty {
  text-align: center; padding: 28px 16px; margin: 0 0 16px;
  border: 1px dashed var(--border); border-radius: var(--radius);
}
.empty strong { display: block; font-size: 17px; margin-bottom: 6px; }
.empty p { color: var(--muted); margin: 0 auto 14px; max-width: 420px; }

.list { list-style: none; padding: 0; margin: 0 0 16px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); }
.list li + li { border-top: 1px solid var(--border); }
.list strong { display: block; font-weight: 600; }
.list .muted { font-size: 14px; }
.list a strong { color: var(--text); }
.grow { flex: 1; min-width: 0; }
.row-link { display: block; color: inherit; text-decoration: none; flex: 1; min-width: 0; }

.howto { margin-top: 12px; color: var(--muted); font-size: 15px; }
.howto summary { cursor: pointer; color: var(--mint); font-weight: 600; padding: 6px 0; }
.howto p { margin: 8px 0; }
.hint { color: var(--muted); font-size: 14px; margin: 10px 0 0; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: .92em; }

.subtabs { display: flex; gap: 4px; overflow-x: auto; padding: 8px var(--gap); scrollbar-width: none; }
.subtabs a {
  padding: 6px 12px; border-radius: 999px; color: var(--muted); text-decoration: none;
  font-size: 14px; font-weight: 600; white-space: nowrap;
}
.subtabs a[aria-current="page"] { background: var(--surface-2); color: var(--text); }

/* ---------- лист заготовок ---------- */
.sheet-title { font-size: 28px; margin-bottom: 4px; }
.sheet-why { color: var(--accent); font-weight: 600; margin: 0 0 16px; }
.sheet { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.sheet details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.sheet summary {
  list-style: none; cursor: pointer; padding: 14px 16px;
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name qty" "reason ratio"; gap: 2px 12px;
  align-items: baseline;
}
.sheet summary::-webkit-details-marker { display: none; }
.sheet-name { grid-area: name; font-size: 18px; font-weight: 700; }
.sheet-qty { grid-area: qty; font-size: 32px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; text-align: right; line-height: 1.05; }
.sheet-qty small { font-size: 16px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.sheet-reason { grid-area: reason; color: var(--muted); font-size: 14px; }
.sheet-ratio { grid-area: ratio; justify-self: end; font-weight: 800; font-size: 15px; padding: 1px 8px; border-radius: 999px; }
.sheet-ratio.is-up { background: var(--accent); color: var(--accent-ink); }
.sheet-ratio.is-down { background: var(--mint); color: var(--mint-ink); }
.sheet-more { padding: 0 16px 14px; font-size: 14px; }
.sheet-more p { margin: 0 0 6px; }
.sheet-more ul { margin: 0; padding-left: 18px; }
.list-num { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.list-group { background: var(--bg) !important; color: var(--muted); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 10px 14px 6px !important; }

/* ---------- заказ ---------- */
.stock-note { font-size: 14px; color: var(--muted); margin: 0 0 16px; }
.stock-note.is-missing { color: var(--accent); }
.supplier-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.supplier-head h2 { margin: 0; }
.order-lines { list-style: none; padding: 0; margin: 0 0 14px; }
.order-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.order-lines li:last-child { border-bottom: 0; }
.order-lines strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 12px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4); max-width: calc(100% - 32px); z-index: 10;
}
.stock-list .unit { width: 28px; font-size: 14px; }
.stock-list input { min-height: 44px; text-align: right; }
.sticky-bar {
  position: sticky; bottom: 0; padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--bg) 30%);
}
.sticky-bar .btn { width: 100%; }

/* ---------- списания ---------- */
.kpi {
  display: grid; gap: 2px; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin: 0 0 16px;
}
.kpi-label { color: var(--muted); font-size: 14px; }
.kpi-value { font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-delta { font-weight: 600; font-size: 15px; }
.kpi-delta.is-good { color: var(--mint); }
.kpi-delta.is-bad { color: var(--accent); }
.kpi-link { color: var(--muted); font-size: 14px; margin-top: 4px; }
.bars { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.bars li { display: grid; grid-template-columns: 92px 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.bar-label { color: var(--muted); }
.bar { height: 12px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--chart-1); border-radius: 0 4px 4px 0; }
.bar-mint span { background: var(--chart-2); }
.bars li.is-current .bar-label, .bars li.is-current .bar-value { color: var(--text); font-weight: 800; }
.bars li[title] { cursor: default; }
.bars li:hover .bar span { filter: brightness(1.15); }
.bars-wide li { grid-template-columns: minmax(120px, 42%) 1fr auto; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.kpi-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 12px; }
.kpi-grid .kpi { margin: 0; }
@media (min-width: 560px) { .kpi-grid { grid-template-columns: 1fr 1fr; } }
.kpi-good .kpi-value { color: var(--mint); }
.who { margin-left: auto; color: var(--muted); font-size: 13px; text-decoration: none; white-space: nowrap; }
.role-buttons { display: grid; gap: 8px; }
.role-btn { width: 100%; text-align: left; justify-content: flex-start; flex-direction: column; align-items: flex-start; padding: 10px 16px; min-height: 56px; }
.role-btn small { color: var(--muted); font-weight: 500; }
.card-review { border-color: color-mix(in srgb, var(--mint) 45%, var(--border)); }
.review { border-top: 1px solid var(--border); padding: 12px 0; display: grid; gap: 8px; }
.review-head strong { display: block; font-size: 16px; }
.review-head .muted { font-size: 14px; }
.review-note { margin: 0; font-size: 14px; color: var(--muted); }
.review-src { font-size: 14px; }
.review-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: end; }
.review-form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.review-form .btn { grid-column: 1 / -1; }
.llm-text { color: var(--text); font-size: 15px; margin: 0 0 14px; line-height: 1.4; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 15px; }
.link-field { font-size: 14px; color: var(--muted); }
.pair { display: grid; gap: 3px; }
.pair .bar { height: 10px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 8px 6px; text-align: right; border-bottom: 1px solid var(--border); }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl th { color: var(--muted); font-weight: 600; font-size: 13px; }
.tbl tr.is-best td { color: var(--mint); font-weight: 700; }
.tbl-wrap { overflow-x: auto; }
.target { font-weight: 700; }
.target.ok { color: var(--mint); }
.target.no { color: var(--accent); }
.bar-value { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- календарь ---------- */
.days { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 10px; }
.day { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.day.is-special { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.day-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.day-head strong { font-size: 17px; }
.temp { font-size: 30px; font-weight: 800; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.temp.is-cold { color: #9fd4ff; }
.day-wx { color: var(--muted); font-size: 14px; margin: 4px 0 8px; }
.day-plain { margin: 0; font-size: 14px; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-right: 6px; vertical-align: 2px; }
.tag-accent { background: var(--accent); color: var(--accent-ink); }
.event {
  display: block; text-decoration: none; color: var(--text); margin: 6px 0;
  padding: 10px 12px; border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border-left: 3px solid var(--accent);
}
.event-title { display: block; font-weight: 700; }
.event .muted { font-size: 13px; }
.chips { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li {
  font-size: 13px; padding: 4px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--mint) 12%, var(--surface)); color: var(--mint);
  border: 1px solid color-mix(in srgb, var(--mint) 30%, transparent);
}
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.seg-wrap { gap: 8px; }
.seg-wrap legend { width: 100%; margin-bottom: 6px; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; }
.pill span {
  display: inline-block; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface-2); cursor: pointer; font-weight: 600;
}
.pill small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
.pill input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--surface-2)); }
.pill input:focus-visible + span { outline: 2px solid var(--mint); outline-offset: 2px; }

/* ---------- формы ---------- */
.stack { display: grid; gap: 12px; }
.stack label { display: grid; gap: 6px; color: var(--muted); font-size: 14px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.inline-form input:not(.w-short) { flex: 1 1 180px; }
.w-short { flex: 0 1 110px; }
input, select {
  font: inherit; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 10px; padding: 12px; min-height: 48px; width: 100%;
}
.inline-form input, .inline-form select { width: auto; }
input:focus-visible, select:focus-visible, .btn:focus-visible, a:focus-visible {
  outline: 2px solid var(--mint); outline-offset: 2px;
}
input[type="file"] { padding: 10px; }
input[type="file"]::file-selector-button {
  font: inherit; font-weight: 600; margin-right: 12px; padding: 6px 12px; border-radius: 8px;
  border: 0; background: var(--text); color: var(--bg); cursor: pointer;
}
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); }
.check { display: flex !important; align-items: center; gap: 10px; color: var(--text) !important; font-size: 16px !important; }
.seg { border: 0; padding: 0; margin: 0; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.seg legend { color: var(--muted); font-size: 14px; padding: 0; margin-right: 4px; }
.seg label { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 16px; }

.btn {
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; text-align: center;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 18px; border-radius: 12px;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
}
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { filter: brightness(1.08); border-color: var(--accent); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); border-color: var(--border); }
.btn-sm { min-height: 40px; padding: 0 12px; font-size: 14px; font-weight: 600; }
