:root {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #1f2430;
  --border: #2a3140;
  --text: #e8eaed;
  --muted: #9aa4b2;
  --brand: #e8743b;
  --brand-2: #f0a830;
  --green: #3ecf8e;
  --red: #e5534b;
  --radius: 12px;
  --maxw: 1080px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 24px 20px 64px; }

/* Top bar */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 18px;
}
.brand { font-weight: 800; font-size: 18px; letter-spacing: -0.02em; color: var(--text); }
.brand span { color: var(--brand); }
.nav { display: flex; gap: 16px; margin-left: auto; align-items: center; }
.nav a { color: var(--muted); font-weight: 500; }
.nav a:hover { color: var(--text); text-decoration: none; }
.token-pill {
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 5px 12px; border-radius: 999px; font-weight: 600; font-size: 13px;
}
.token-pill b { color: var(--brand-2); }

/* Headings */
h1 { font-size: 26px; letter-spacing: -0.02em; margin: 0 0 4px; }
h2 { font-size: 19px; margin: 28px 0 12px; }
h3 { font-size: 16px; margin: 0 0 8px; }
.subtle { color: var(--muted); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-bottom: 16px;
}
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 9px;
  padding: 9px 15px; font-weight: 600; font-size: 14px; transition: .15s;
}
.btn:hover { border-color: var(--brand); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #d9652e; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); border-color: #492b2b; }
.btn.danger:hover { background: #2a1818; }
.btn.sm { padding: 6px 11px; font-size: 13px; }
.btn.block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Forms */
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 5px; font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  color: var(--text); border-radius: 9px; padding: 10px 12px; font-size: 14px; font-family: inherit;
}
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }
.checkbox { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.checkbox input { width: auto; }
.checkbox label { margin: 0; }

/* Flash */
.flash { padding: 11px 15px; border-radius: 9px; margin-bottom: 12px; font-weight: 500; border: 1px solid; }
.flash.success { background: #112a1e; border-color: #1f5c3f; color: var(--green); }
.flash.error { background: #2a1414; border-color: #5c2525; color: #f0938c; }
.flash.info { background: #152030; border-color: #274055; color: #8fb6e0; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: none; }

/* Tags / chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip {
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 3px 9px; border-radius: 999px; font-size: 12px; color: var(--muted);
}
.chip.allergen { color: #f0a830; border-color: #4a3a1a; }
.chip.diet { color: var(--green); border-color: #1f5c3f; }
.chip.special { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Auth */
.auth-wrap { max-width: 400px; margin: 60px auto; }
.auth-wrap .card { padding: 28px; }
.auth-logo { text-align: center; font-size: 28px; font-weight: 800; margin-bottom: 4px; }
.auth-logo span { color: var(--brand); }

/* Menu builder */
.cat-block { margin-bottom: 20px; }
.cat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.item-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 9px; margin-bottom: 7px;
}
.item-row.unavailable { opacity: .5; }
.item-thumb { width: 44px; height: 44px; border-radius: 7px; object-fit: cover; background: var(--bg); flex-shrink: 0; }
.item-main { flex: 1; min-width: 0; }
.item-main .nm { font-weight: 600; }
.item-main .desc { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-price { font-weight: 700; color: var(--brand-2); }
.item-actions { display: flex; gap: 6px; }
.inline-form { display: inline; }

.stat { text-align: center; }
.stat .n { font-size: 30px; font-weight: 800; color: var(--brand-2); }
.stat .l { color: var(--muted); font-size: 13px; }

.muted-note { color: var(--muted); font-size: 13px; margin-top: 8px; }
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.toast-wrap { position: fixed; bottom: 20px; right: 20px; z-index: 50; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--surface-2); border: 1px solid var(--border); padding: 12px 16px; border-radius: 9px; max-width: 320px; }
.toast.err { border-color: #5c2525; }

@media (max-width: 640px) {
  .nav { gap: 10px; font-size: 13px; }
  .page-head { flex-direction: column; align-items: stretch; }
}
