/* Зерно — кофейня в Казани. Тёплая кофейная палитра, чистая типографика. */
:root {
  --bg: #faf6f0;
  --surface: #ffffff;
  --ink: #2a1e17;
  --ink-soft: #6b5a4e;
  --line: #e8ded2;
  --accent: #7b4a2d;
  --accent-dark: #5c3520;
  --accent-soft: #f0e4d8;
  --ok: #2f6b3c;
  --ok-bg: #e6f2e8;
  --err: #a13a2e;
  --err-bg: #f7e7e4;
  --stop: #8a6d3b;
  --stop-bg: #f4ecdd;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(42,30,23,.05), 0 8px 24px rgba(42,30,23,.06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-dark); }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ————— top bar ————— */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-weight: 800; font-size: 1.35rem; color: var(--ink); text-decoration: none; letter-spacing: -.01em; display: inline-flex; align-items: center; gap: .35em; }
.brand:hover { color: var(--accent); }
.brand-mark { color: var(--accent); font-size: .8em; }
.brand--small { margin-bottom: 24px; display: flex; }
.topbar nav { display: flex; align-items: center; gap: 22px; }
.topbar nav a { color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: .95rem; }
.topbar nav a:hover { color: var(--accent); }

/* ————— hero ————— */
.hero { padding: 64px 0 40px; max-width: 720px; }
.hero-kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 700; color: var(--accent); margin: 0 0 12px; }
.hero h1 { font-size: clamp(2.1rem, 5.5vw, 3.3rem); line-height: 1.08; margin: 0 0 18px; letter-spacing: -.02em; }
.hero-lead { font-size: 1.15rem; color: var(--ink-soft); margin: 0 0 28px; max-width: 560px; }

/* ————— buttons ————— */
.btn {
  display: inline-block; font-family: inherit; font-size: 1rem; font-weight: 700;
  border: 1px solid transparent; border-radius: 999px; padding: 13px 26px;
  cursor: pointer; text-decoration: none; transition: background .15s, color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: .85rem; border-radius: 999px; }
.link-btn { background: none; border: none; padding: 0; font-family: inherit; font-size: .95rem; font-weight: 600; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-btn:hover { color: var(--accent-dark); }
.inline-form { display: inline-flex; align-items: center; gap: 8px; margin: 0; }

/* ————— menu ————— */
.menu { padding: 24px 0 8px; }
.menu h2, .lead h2, .admin-card h2 { font-size: 1.7rem; letter-spacing: -.01em; margin: 0 0 6px; }
.menu-note, .lead-note, .admin-note { color: var(--ink-soft); margin: 0 0 24px; max-width: 640px; }
.menu-cat { margin-bottom: 30px; }
.menu-cat h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.dish-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.dish {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  box-shadow: var(--shadow);
}
.dish--stop { background: var(--stop-bg); border-color: #e2d3b3; }
.dish--stop .dish-price { color: var(--stop); }
.dish-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dish-name { font-weight: 700; font-size: 1.02rem; }
.dish-meta { font-size: .85rem; color: var(--ink-soft); }
.dish-price { font-weight: 800; font-size: 1.15rem; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ————— lead form ————— */
.lead { padding: 28px 0 40px; }
.lead-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); max-width: 720px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field--check { flex-direction: row; align-items: center; gap: 10px; }
.field--check .field-label { margin: 0; }
.field-label { font-weight: 600; font-size: .92rem; color: var(--ink); }
.field-label b { color: var(--err); font-weight: 700; }
.field input, .field select, .field textarea {
  font-family: inherit; font-size: 1rem; color: var(--ink);
  padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; transition: border-color .15s, box-shadow .15s; width: 100%;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--err); }
.field-err { color: var(--err); font-size: .85rem; font-weight: 600; }

/* ————— flash ————— */
.flash { border-radius: 10px; padding: 12px 16px; font-weight: 600; margin: 0 0 20px; border: 1px solid; }
.flash--ok { background: var(--ok-bg); color: var(--ok); border-color: #c8e0cd; }
.flash--err { background: var(--err-bg); color: var(--err); border-color: #eecac2; }

/* ————— auth ————— */
.auth-wrap { max-width: 420px; padding: 56px 20px 80px; margin: 0 auto; }
.auth-wrap h1 { font-size: 1.8rem; margin: 0 0 6px; }
.auth-note { color: var(--ink-soft); margin: 0 0 22px; }
.auth-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }

/* ————— admin ————— */
main.wrap > h1 { font-size: 2rem; margin: 28px 0 18px; letter-spacing: -.01em; }
.admin-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 26px; }
.empty { color: var(--ink-soft); background: var(--bg); border: 1px dashed var(--line); border-radius: 10px; padding: 18px; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 640px; }
.data-table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); padding: 8px 12px; border-bottom: 2px solid var(--line); }
.data-table td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.cell-strong { font-weight: 700; display: block; }
.cell-sub { display: block; font-size: .82rem; color: var(--ink-soft); margin-top: 3px; }
.status { display: inline-block; font-size: .8rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.status--new { background: var(--accent-soft); color: var(--accent-dark); }
.status--in_progress { background: #e5eef7; color: #2b5580; }
.status--done { background: var(--ok-bg); color: var(--ok); }

.dish-form { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 22px; }
.dish-form-grid { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 0 16px; align-items: end; }
.dish-form .btn { margin-bottom: 0; }
.dish-admin-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.dish-admin { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.dish-admin--stop { background: var(--stop-bg); border-color: #e2d3b3; }
.dish-admin-main { display: flex; flex-direction: column; gap: 2px; }
.dish-admin-actions { display: flex; align-items: center; gap: 14px; }
.dish-edit { margin: 0; }
.dish-edit summary { list-style: none; cursor: pointer; font-weight: 600; color: var(--accent); }
.dish-edit summary::-webkit-details-marker { display: none; }
.dish-edit[open] { margin-top: 10px; }
.dish-edit .dish-form { margin: 8px 0 0; }

/* ————— footer ————— */
.site-foot { padding: 30px 20px 40px; color: var(--ink-soft); font-size: .9rem; border-top: 1px solid var(--line); margin-top: 30px; }
.site-foot p { margin: 0; }

/* ————— responsive ————— */
@media (max-width: 720px) {
  .grid-2 { grid-template-columns: 1fr; }
  .dish-form-grid { grid-template-columns: 1fr 1fr; }
  .hero { padding-top: 40px; }
  .topbar nav { gap: 14px; }
}
@media (max-width: 480px) {
  .dish-form-grid { grid-template-columns: 1fr; }
  .dish-admin { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
