:root {
  --bg: #f7f2ea;
  --bg-card: #fffdf9;
  --ink: #2b1d13;
  --ink-soft: #5d4b3e;
  --line: #e5d9c9;
  --accent: #8a4b22;
  --accent-ink: #fff;
  --accent-hover: #713c1a;
  --accent-soft: #f0e2d2;
  --error: #a3271d;
  --ok-bg: #e8f3e4;
  --ok-ink: #2f5d2a;
  --focus: #2456a6;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(43, 29, 19, .06), 0 4px 16px rgba(43, 29, 19, .06);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img, svg { vertical-align: middle; }

/* skip-link: невидим, пока не фокусирован клавиатурой */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent-ink);
  color: var(--accent);
  padding: 10px 16px;
  border-radius: 0 0 var(--radius) 0;
  font-weight: 600;
  text-decoration: none;
}
.skip:focus {
  left: 0;
}

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 20px; }

h1, h2, h3 { line-height: 1.18; margin: 0 0 .6em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
p { margin: 0 0 1em; }
a { color: var(--accent); }

/* --- header --- */
.site-head {
  background: var(--bg-card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.head-in {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 64px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.25rem; color: var(--ink);
  text-decoration: none; letter-spacing: .01em;
}
.brand .bean { color: var(--accent); }
.site-head nav { display: flex; gap: 6px; flex-wrap: wrap; }
.site-head nav a {
  color: var(--ink-soft); text-decoration: none; font-weight: 600;
  padding: 8px 12px; border-radius: 8px;
}
.site-head nav a:hover { background: var(--accent-soft); color: var(--ink); }
.site-head nav a.active { color: var(--accent); background: var(--accent-soft); }

/* --- sections --- */
main { min-height: 60vh; }
.sec { padding: 56px 0; }
.sec-lead { background: var(--bg-card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sec-narrow { max-width: 640px; margin: 0 auto; padding: 56px 20px; }
.sec-note { color: var(--ink-soft); margin-bottom: 28px; }

/* --- hero --- */
.hero {
  background:
    radial-gradient(1200px 400px at 80% -10%, var(--accent-soft) 0%, transparent 60%),
    var(--bg);
  padding: 72px 0 64px;
  border-bottom: 1px solid var(--line);
}
.hero-kicker {
  text-transform: uppercase; letter-spacing: .14em; font-size: .8rem;
  font-weight: 700; color: var(--accent); margin-bottom: 12px;
}
.hero-lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 56ch; margin-bottom: 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* --- buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 10px 22px; border-radius: var(--radius);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  border: 1.5px solid transparent; transition: background .15s, color .15s, border-color .15s;
}
.btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-danger { background: transparent; color: var(--error); border-color: var(--error); }
.btn-danger:hover { background: #fbeae8; }
.btn-sm { min-height: 38px; padding: 6px 14px; font-size: .92rem; }
.inline { display: inline; }

/* --- menu / dishes --- */
.dish-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.dish-group { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.dish-group h3, .dish-group-title { margin-bottom: 14px; color: var(--ink); font-size: 1.15rem; }
.dish-list { list-style: none; margin: 0; padding: 0; }
.dish { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.dish:last-child { border-bottom: 0; }
.dish-head { display: flex; align-items: baseline; gap: 8px; }
.dish-name { font-weight: 600; }
.dish-dots { flex: 1; border-bottom: 1px dotted #c9b79e; transform: translateY(-4px); min-width: 16px; }
.dish-price { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dish-prep { color: var(--ink-soft); font-size: .86rem; }

/* --- lead form --- */
.lead-wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 44px; align-items: start; }
.lead-hint { color: var(--ink-soft); font-size: .95rem; }
.lead-form { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.field { margin-bottom: 16px; }
.field label, .field legend { display: block; font-weight: 600; margin-bottom: 6px; }
.leg-note { font-weight: 400; color: var(--ink-soft); }
.req { color: var(--error); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 10px 12px;
  font: inherit; color: var(--ink);
  background: var(--bg-card); border: 1.5px solid #cbb9a3;
  border-radius: 8px;
}
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--focus);
}
.field input.invalid, .field select.invalid { border-color: var(--error); background: #fff7f6; }
.field-err { color: var(--error); font-size: .9rem; display: block; margin-top: 4px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dishes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dish-pick {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg-card); cursor: pointer; font-size: .95rem;
}
.dish-pick:hover { border-color: var(--accent); }
.dish-pick input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); }
.dish-pick:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }
fieldset { border: 0; padding: 0; margin: 0 0 16px; }
.form-ok {
  background: var(--ok-bg); color: var(--ok-ink); border: 1px solid #b9d8b2;
  border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; font-weight: 600;
}
.form-err { color: var(--error); font-weight: 600; }
.form-fine { color: var(--ink-soft); font-size: .85rem; margin-top: 14px; }

/* --- footer --- */
.site-foot { border-top: 1px solid var(--line); padding: 28px 0; color: var(--ink-soft); font-size: .95rem; }
.site-foot p { margin: 2px 0; }

/* --- login --- */
.login-form { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-top: 20px; }
.login-form .btn { width: 100%; }
.os-msg { margin-top: 12px; font-weight: 600; }

/* --- panel --- */
.panel-wrap { padding-top: 36px; }
.panel-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.panel-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filters a {
  text-decoration: none; font-weight: 600; font-size: .92rem;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--ink-soft); background: var(--bg-card);
}
.filters a:hover { border-color: var(--accent); color: var(--accent); }
.filters a.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.empty {
  background: var(--bg-card); border: 1px dashed var(--line);
  border-radius: var(--radius); padding: 36px; text-align: center; color: var(--ink-soft);
}
.lead-cards { display: grid; gap: 16px; }
.lead-card { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.lead-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.lead-title { font-weight: 700; font-size: 1.05rem; margin-right: 10px; }
.lead-time { color: var(--ink-soft); font-size: .9rem; }
.badge {
  display: inline-block; padding: 3px 12px; border-radius: 999px;
  font-size: .82rem; font-weight: 700; white-space: nowrap;
}
.status-new { background: #fdf3d8; color: #7a5b12; }
.status-contacted { background: #e2ecfb; color: #1d4f91; }
.status-done { background: var(--ok-bg); color: var(--ok-ink); }
.status-declined { background: #fbeae8; color: var(--error); }
.lead-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px 18px; margin: 0 0 14px;
}
.lead-grid dt { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.lead-grid dd { margin: 2px 0 0; font-weight: 600; }
.lead-grid .wide { grid-column: 1 / -1; }
.lead-status-form { display: flex; align-items: center; gap: 10px; }
.lead-status-form select { min-height: 42px; padding: 8px 10px; font: inherit; border: 1.5px solid #cbb9a3; border-radius: 8px; background: var(--bg); }
.lead-status-form select:focus { outline: 3px solid var(--focus); }

/* --- catalog --- */
.dish-add {
  display: grid; grid-template-columns: 2fr 1.4fr 1fr 1fr auto; gap: 14px; align-items: end;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 24px;
}
.dish-add .field { margin: 0; }
.dish-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-card); }
.dish-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.dish-table th, .dish-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: .95rem; }
.dish-table th { background: var(--accent-soft); font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink); }
.dish-table tbody tr:last-child td { border-bottom: 0; }
.dish-table tr.stopped td { opacity: .6; }
.dish-table tr.stopped td:first-child::after { content: " · стоп-лист"; color: var(--error); font-weight: 700; }

/* --- responsive --- */
@media (max-width: 860px) {
  .lead-wrap { grid-template-columns: 1fr; gap: 28px; }
  .dish-add { grid-template-columns: 1fr 1fr; }
  .dish-add .btn { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .sec { padding: 40px 0; }
  .hero { padding: 48px 0; }
  .field-row, .dishes-grid { grid-template-columns: 1fr; }
  .dish-add { grid-template-columns: 1fr; }
  .btn { width: 100%; }
  .lead-status-form { width: 100%; }
  .lead-status-form select { flex: 1; }
  .lead-grid { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
