:root {
  --cream: #faf8f5;
  --black: #1a1818;
  --espresso: #4a3b32;
  --terracotta: #c26e5a;
  --surface: #f5f1ec;
  --border: #e0dcd6;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--cream);
  color: var(--black);
}
a { color: var(--terracotta); text-decoration: none; }
.btn {
  display: inline-block;
  background: var(--terracotta);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  font-weight: 600;
}
.btn-secondary { background: var(--surface); color: var(--espresso); }
.card {
  background: rgba(255,255,255,.85);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 8px 30px rgba(74,59,50,.08);
}
.hero { text-align: center; padding: 4rem 1.5rem; max-width: 960px; margin: 0 auto; }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 1rem; }
.hero p { color: rgba(74,59,50,.7); font-size: 1.1rem; }
.dashboard { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 1rem;
}
.brand { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.5rem; }
.logo {
  width: 36px; height: 36px; border-radius: .5rem;
  background: var(--terracotta); color: #fff;
  display: grid; place-items: center; font-weight: 700;
}
.nav-link {
  display: block; padding: .65rem .75rem; border-radius: .75rem;
  color: rgba(74,59,50,.65); margin-bottom: .25rem;
}
.nav-link.active, .nav-link:hover { background: var(--surface); color: var(--black); }
.main { flex: 1; padding: 2rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: .35rem; font-weight: 600; }
input, textarea, select {
  width: 100%; padding: .7rem .9rem; border: 1px solid var(--border);
  border-radius: .75rem; font: inherit;
}
.alert { padding: .75rem 1rem; border-radius: .75rem; margin-bottom: 1rem; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-success { background: #dcfce7; color: #166534; }
.menu-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill,minmax(240px,1fr)); }
.menu-item { background: #fff; border: 1px solid var(--border); border-radius: 1rem; overflow: hidden; }
.menu-item img { width: 100%; height: 140px; object-fit: cover; background: var(--surface); }
.menu-item .body { padding: 1rem; }
.public-header { position: sticky; top: 0; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); padding: 1rem; }
.cat-nav { display: flex; gap: .5rem; overflow-x: auto; padding: .75rem 1rem; }
.cat-nav a { white-space: nowrap; padding: .4rem .9rem; border-radius: 999px; background: var(--surface); color: var(--espresso); }
.cat-nav a.active { background: var(--black); color: #fff; }
.site-footer { text-align: center; padding: 2rem; color: rgba(74,59,50,.5); font-size: .85rem; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-card { width: min(420px, 100%); }
.stats-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-top: 1rem; }
.stat-card { text-align: center; }
.stat-label { display: block; font-size: .85rem; color: rgba(74,59,50,.6); }
.stat-value { font-size: 2rem; color: var(--terracotta); }
.form-row { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.inline-form { display: flex; gap: .5rem; flex-wrap: wrap; }
.inline-form input { flex: 1; min-width: 160px; }
.data-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.data-table th, .data-table td { padding: .65rem .5rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.data-table .actions { white-space: nowrap; }
.btn-link { background: none; border: none; color: var(--terracotta); cursor: pointer; font: inherit; padding: 0 .25rem; }
.btn-link.danger { color: #b91c1c; }
.muted { color: rgba(74,59,50,.6); font-size: .9rem; }
.cat-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.qr-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.qr-card .qr-url { word-break: break-all; font-size: .85rem; }
.public-menu { background: var(--cream); padding-bottom: 5rem; }
.public-header-inner { max-width: 640px; margin: 0 auto; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.table-badge { background: var(--surface); padding: .25rem .75rem; border-radius: 999px; font-size: .85rem; }
.public-main { max-width: 640px; margin: 0 auto; padding: 1rem; }
.menu-section { margin-bottom: 2rem; }
.menu-section h2 { font-size: 1.25rem; margin-bottom: .75rem; color: var(--espresso); }
.public-item { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.public-item h3 { margin: 0 0 .25rem; font-size: 1rem; }
.public-item .price { color: var(--terracotta); white-space: nowrap; }
.fab-bar { position: fixed; bottom: 0; left: 0; right: 0; display: flex; gap: .5rem; justify-content: center; padding: 1rem; background: rgba(255,255,255,.95); border-top: 1px solid var(--border); }
