:root {
  --ink: #161412;
  --muted: #667085;
  --line: #e5ded3;
  --paper: #fffaf2;
  --panel: #ffffff;
  --accent: #e8412e;
  --accent-dark: #b92718;
  --gold: #c78b2b;
  --leaf: #167a5a;
  --warn: #b45309;
  --ok: #15803d;
  --shadow: 0 18px 46px rgba(49, 32, 19, .16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 700;
}
button:hover { filter: brightness(.96); }
button.secondary { background: #f0eee9; color: var(--ink); }
button.danger { background: var(--accent); }
button.small { min-height: 34px; padding: 7px 10px; font-size: 13px; }
button:disabled { opacity: .45; cursor: not-allowed; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: white;
  color: var(--ink);
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid rgba(232, 65, 46, .18);
  border-color: var(--accent);
}
label { display: grid; gap: 7px; font-size: 13px; color: var(--muted); }
textarea { min-height: 82px; resize: vertical; }
h1, h2, h3 { margin: 0; letter-spacing: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 250, 242, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.nav {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; }
.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 8px 18px rgba(232, 65, 46, .18);
}
.brand-logo.large {
  width: 86px;
  height: 86px;
  margin: 0 auto;
}
.shop-nav .brand span { font-size: 18px; }
.cart-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  white-space: nowrap;
}
.cart-button strong {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
}

.hero {
  min-height: 430px;
  color: white;
  background:
    linear-gradient(90deg, rgba(17, 14, 12, .88), rgba(17, 14, 12, .26)),
    url("/assets/banner.png") center/cover;
}
.hero-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 84px 18px 98px;
}
.hero-copy { max-width: 640px; }
.eyebrow {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  color: #fff1d8;
  font-size: 13px;
  font-weight: 800;
}
.hero h1 {
  font-size: clamp(38px, 7vw, 76px);
  line-height: .98;
  margin-bottom: 16px;
}
.hero p {
  max-width: 560px;
  margin: 0 0 26px;
  font-size: 18px;
  line-height: 1.45;
  color: #fff7ed;
}
.hero button { background: var(--accent); }

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 18px 72px;
}
.closed-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #ffd1cc;
  border-radius: 8px;
  background: #fff1f0;
  color: var(--accent-dark);
}
.closed-banner span { color: #7a2d24; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin: 0 0 20px;
}
.section-head h2 { font-size: clamp(26px, 4vw, 38px); }
.muted { color: var(--muted); line-height: 1.45; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.product-card, .panel, .order-card, .stat, .login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.product-card {
  overflow: hidden;
  display: grid;
  box-shadow: 0 10px 26px rgba(55, 38, 24, .08);
}
.product-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #efe8dc;
}
.product-card .body {
  padding: 15px;
  display: grid;
  gap: 16px;
}
.product-card h3 { font-size: 20px; margin: 4px 0 5px; }
.category-label {
  color: var(--leaf);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.product-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.price { color: var(--accent); font-weight: 900; font-size: 18px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  min-height: 36px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 13px;
  font-size: 14px;
  font-weight: 700;
}
.chip.active { background: var(--ink); color: white; border-color: var(--ink); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(16, 12, 9, .56);
}
.pick-modal {
  width: min(760px, 100%);
  max-height: min(720px, calc(100vh - 36px));
  display: grid;
  grid-template-columns: 42% 1fr;
  overflow: hidden;
  background: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.pick-image {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
}
.pick-content {
  padding: 18px;
  display: grid;
  gap: 14px;
  overflow: auto;
}
.modal-head, .cart-head, .order-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}
.icon-button {
  width: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 8px;
  background: #f0eee9;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}
.topping-list { display: grid; gap: 9px; }
.topping-row {
  min-height: 56px;
  display: flex;
  grid-template-columns: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fffdfa;
}
.topping-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}
.topping-row input, .check-row input {
  width: 18px;
  height: 18px;
}
.actions { display: flex; gap: 9px; flex-wrap: wrap; }
.actions.stretch button { flex: 1; }

.cart-dock {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 35;
  width: min(440px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  display: none;
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
}
.cart-dock.open { display: block; }
.cart-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.cart-line-price { text-align: right; display: grid; gap: 7px; justify-items: end; }
.total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 900;
  padding: 15px 0;
  font-size: 18px;
}
.form-grid { display: grid; gap: 11px; }
.checkout-form button { width: 100%; }
.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fffdfa;
}
.empty.compact { padding: 16px; }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    linear-gradient(90deg, rgba(17, 14, 12, .80), rgba(17, 14, 12, .42)),
    url("/assets/banner.png") center/cover;
}
.login-card {
  width: min(430px, 100%);
  padding: 24px;
  display: grid;
  gap: 14px;
  box-shadow: var(--shadow);
}
.login-card h1 { text-align: center; font-size: 28px; }
.login-card p { margin: 0; text-align: center; color: var(--muted); }
.login-help {
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff8e8;
  color: #7a4b12;
  border: 1px solid #f3d7a1;
  line-height: 1.45;
  font-size: 14px;
}
.alert {
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff1f0;
  color: var(--accent-dark);
  border: 1px solid #ffd1cc;
}
.notify-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid #ffd1cc;
  border-radius: 8px;
  background: #fff1f0;
  color: var(--accent-dark);
  box-shadow: 0 12px 28px rgba(232, 65, 46, .12);
}
.notify-banner strong, .notify-banner span { display: block; }
.notify-banner span { margin-top: 3px; color: #7a2d24; }

.admin-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
  background: #f7f3ec;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: #171412;
  color: white;
  padding: 18px;
}
.admin-brand { align-items: center; margin-bottom: 4px; }
.shop-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  color: white;
  font-weight: 800;
}
.shop-toggle input {
  width: 44px;
  height: 24px;
  accent-color: var(--accent);
}
.tabs { display: grid; gap: 8px; }
.tab {
  background: transparent;
  color: #e8dfd4;
  text-align: left;
  border: 1px solid transparent;
}
.tab.active { color: white; border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.10); }
.logout-button { margin-top: auto; background: #2b2520; }
.admin-main { padding: 24px; min-width: 0; }
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.stat { padding: 17px; }
.stat strong { display: block; margin-top: 8px; font-size: 28px; }
.stat.highlight {
  border-color: #ffd1cc;
  background: #fff8f6;
}
.stat span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 700;
}
.columns {
  display: grid;
  grid-template-columns: minmax(300px, 420px) 1fr;
  gap: 16px;
  align-items: start;
}
.panel { padding: 16px; }
.setup-panel { max-width: 580px; }
.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.table { width: 100%; border-collapse: collapse; min-width: 620px; }
.table th, .table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.table th { color: var(--muted); font-size: 13px; background: #fffaf2; }
.order-card { padding: 15px; display: grid; gap: 12px; margin-bottom: 12px; }
.order-items { display: grid; gap: 6px; }
.status { white-space: nowrap; }
.status-new { color: var(--accent); }
.status-preparing { color: var(--gold); }
.status-delivering { color: var(--leaf); }
.status-done { color: var(--ok); }
.status-cancelled { color: var(--warn); }
.admin-checks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}
.admin-checks label, .check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  color: var(--ink);
}
.image-picker {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  align-items: start;
}
.image-picker img {
  width: 120px;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #efe8dc;
}

@media (max-width: 860px) {
  .nav { padding: 9px 12px; }
  .brand-logo { width: 42px; height: 42px; }
  .shop-nav .brand span { font-size: 16px; }
  .cart-button { padding: 9px 12px; }
  .hero { min-height: 360px; }
  .hero-inner { padding: 58px 18px 72px; }
  .section-head { align-items: start; flex-direction: column; }
  .grid { grid-template-columns: 1fr; }
  .product-card img { aspect-ratio: 16 / 10; }
  .pick-modal { grid-template-columns: 1fr; }
  .pick-image { min-height: 190px; max-height: 240px; }
  .cart-dock {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    max-height: calc(100vh - 20px);
    padding: 14px;
  }
  .admin-layout { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky;
    height: auto;
    z-index: 20;
  }
  .tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tab { text-align: center; padding: 9px 6px; font-size: 13px; }
  .logout-button { margin-top: 0; }
  .columns { grid-template-columns: 1fr; }
  .admin-main { padding: 16px; }
  .closed-banner { align-items: start; flex-direction: column; }
  .notify-banner { align-items: start; flex-direction: column; }
}

@media (max-width: 460px) {
  .shop-nav .brand span { max-width: 148px; line-height: 1.1; }
  .hero h1 { font-size: 40px; }
  .hero p { font-size: 16px; }
  .shell { padding-inline: 12px; }
  .product-foot { align-items: stretch; flex-direction: column; }
  .product-foot button { width: 100%; }
  .cart-line { grid-template-columns: 1fr; }
  .cart-line-price { text-align: left; justify-items: start; }
  .image-picker { grid-template-columns: 1fr; }
  .image-picker img { width: 100%; max-height: 220px; }
}
