:root {
  --bg: #faf7f2; --panel: #ffffff; --ink: #24201c; --muted: #6f675f;
  --accent: #b4532a; --accent-ink: #ffffff; --line: #e6dfd5; --bad: #a32020; --good: #2c6e49;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, "Segoe UI", Arial, sans-serif; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h2 { margin-top: 1.5rem; }
main { max-width: 1500px; margin: 0 auto; padding: 1rem 1.5rem 3rem; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .9rem 1.5rem; background: var(--ink); }
.top a { color: #fff; text-decoration: none; margin-left: 1.25rem; }
.top .brand { font-size: 1.4rem; font-weight: 700; margin-left: 0; }
.top form { display: inline; margin-left: 1.25rem; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 1.5rem; }
.banner { background: #fff3cd; border: 1px solid #e6c766; padding: .75rem 1rem; border-radius: 8px; }
.banner.error { background: #fde8e8; border-color: #e3a3a3; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 2rem; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1.25rem; }
.panel.narrow { max-width: 520px; margin: 2rem auto; }
.basket { position: sticky; top: 1rem; }
.basket h2 { margin-top: 0; }
.dishes { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.dish { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  display: flex; flex-direction: column; }
.dish img { width: 100%; height: 180px; object-fit: cover; display: block; }
.dish-body { padding: 1rem; display: flex; flex-direction: column; flex: 1; }
.dish-body p { margin: 0 0 .5rem; color: var(--muted); }
.dish-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; }
.dish.sold-out { opacity: .55; }
.allergens { font-size: .85rem; }
.price { font-weight: 700; font-size: 1.1rem; }
.tag { background: var(--line); border-radius: 999px; padding: .15rem .7rem; font-size: .85rem; }
.muted { color: var(--muted); }
button, .button { font: inherit; cursor: pointer; border: 0; border-radius: 8px; padding: .55rem 1.1rem;
  background: var(--accent); color: var(--accent-ink); text-decoration: none; display: inline-block; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.secondary, .button.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
button.danger { background: var(--bad); }
.wide { display: block; width: 100%; text-align: center; margin-top: 1rem; }
.basket-line { display: grid; grid-template-columns: 1fr auto auto; gap: .75rem; align-items: center;
  padding: .45rem 0; border-bottom: 1px solid var(--line); }
.basket-total { grid-template-columns: 1fr auto; font-weight: 700; border-bottom: 0; }
.basket-controls { display: inline-flex; align-items: center; gap: .4rem; }
button.qty { padding: 0; width: 1.9rem; height: 1.9rem; background: #fff; color: var(--ink); border: 1px solid var(--line); }
form label { display: block; margin: .6rem 0 .2rem; font-weight: 600; }
form label.inline { display: inline-flex; gap: .4rem; align-items: center; font-weight: 400; margin-right: 1.25rem; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=number], input[type=time],
select, textarea { font: inherit; width: 100%; padding: .5rem .6rem; border: 1px solid #cfc6ba; border-radius: 6px; background: #fff; }
textarea { min-height: 4.5rem; }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 1rem; padding: .75rem 1rem 1rem; }
legend { font-weight: 700; padding: 0 .4rem; }
.field-error { color: var(--bad); font-size: .9rem; margin: .2rem 0 0; }
.sums { margin: 1rem 0; }
.sums div { display: flex; justify-content: space-between; padding: .2rem 0; }
.sums .total { font-weight: 700; font-size: 1.15rem; border-top: 1px solid var(--line); margin-top: .3rem; padding-top: .5rem; }
.status { font-size: 1.5rem; font-weight: 700; color: var(--good); }
.status.cancelled { color: var(--bad); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
td form { display: inline; }
.orders { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1rem; }
.order-card { background: var(--panel); border: 1px solid var(--line); border-left: 6px solid var(--accent);
  border-radius: 10px; padding: 1rem; }
.order-card.status-preparing { border-left-color: #c98a00; }
.order-card.status-ready, .order-card.status-out_for_delivery { border-left-color: var(--good); }
.order-card h3 { display: flex; justify-content: space-between; }
.order-card ul { margin: .5rem 0; padding-left: 1.2rem; }
.order-card .actions { display: flex; gap: .5rem; margin-top: .75rem; }
.order-card .actions form:first-child { flex: 1; }
.order-card .actions form:first-child button { width: 100%; }
.note { background: #fff3cd; border-radius: 6px; padding: .35rem .6rem; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1; min-width: 140px; }
.row > .fit { flex: 0 0 auto; min-width: 0; }
.thumb { width: 56px; height: 42px; object-fit: cover; border-radius: 4px; }
[hidden] { display: none !important; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .basket { position: static; }
}
