/* Menu admin. Same warm palette as the site, tuned for reading and editing. */
:root {
  --bg: #120b08;
  --panel: #1b120d;
  --panel-2: #241811;
  --line: rgba(247, 234, 214, 0.12);
  --line-2: rgba(247, 234, 214, 0.24);
  --text: #f4e8d6;
  --muted: rgba(244, 232, 214, 0.62);
  --turmeric: #ffc629;
  --ember: #ff6a1f;
  --chili: #e3261a;
  --mint: #3ddc84;
  --pink: #ff3d7f;
  --saffron: #ff9a1f;
  --sky: #8fc8ff;
  --radius: 14px;
  --f-display: "Rozha One", Georgia, serif;
  --f-sans: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--f-sans); -webkit-font-smoothing: antialiased; }
a { color: var(--turmeric); }
h1, h2 { margin: 0; font-weight: 400; }
h1 { font-family: var(--f-display); font-size: clamp(28px, 3vw, 40px); line-height: 1.05; }
h2 { font-weight: 800; font-size: 18px; }
:focus-visible { outline: 2px solid var(--turmeric); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.mono { font-family: var(--f-mono); font-size: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.boot { padding: 40px; text-align: center; color: var(--muted); }
.empty { padding: 30px 0; }
[hidden] { display: none !important; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 16px;
  border: 1px solid var(--line-2); border-radius: 999px;
  background: transparent; color: var(--text);
  font: 700 14px var(--f-sans); text-decoration: none; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { border-color: var(--text); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn.hot { background: var(--turmeric); border-color: var(--turmeric); color: #1d130e; }
.btn.hot:hover:not(:disabled) { background: #ffd65c; }
.btn.ghost { background: rgba(244, 232, 214, 0.04); }
.btn.danger { border-color: rgba(227, 38, 26, 0.6); color: #ff8a7a; }
.btn.danger:hover { background: var(--chili); color: #fff; }
.btn.link { border-color: transparent; background: none; color: var(--muted); padding-inline: 8px; }
.btn.link:hover { color: var(--text); }
.btn.sm { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.btn.wide { width: 100%; }
.btn.file { position: relative; overflow: hidden; }
.btn.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.btn.file.is-disabled { opacity: 0.45; pointer-events: none; }

/* story photos on the feed card */
.story-strip { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 10px; align-items: flex-start; }
.story-thumb { position: relative; margin: 0; width: 72px; }
.story-thumb img { display: block; width: 72px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
.story-thumb.is-main img { border-color: var(--turmeric); }
.story-thumb figcaption { position: absolute; top: 4px; left: 4px; padding: 1px 6px; border-radius: 999px; background: rgba(0, 0, 0, 0.7); font-size: 11px; font-weight: 700; }
.story-tools { display: flex; justify-content: space-between; margin-top: 4px; }
.story-tools .icon { width: 30px; height: 30px; font-size: 13px; }
.story-busy { align-self: center; margin: 0; color: var(--muted); font-size: 13px; }
.icon {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--text);
  font-size: 15px; cursor: pointer;
}
.icon:hover:not(:disabled) { border-color: var(--text); }
.icon:disabled { opacity: 0.25; cursor: default; }
.icon.danger:hover { background: var(--chili); border-color: var(--chili); }

/* ---------- gate (login) ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.gate--overlay { position: fixed; inset: 0; z-index: 100; background: rgba(8, 5, 3, 0.8); backdrop-filter: blur(6px); min-height: 0; }
.gate-card { width: min(420px, 100%); padding: 32px; border-radius: 22px; background: var(--panel); border: 1px solid var(--line); display: grid; gap: 14px; }
.gate-brand { margin: 0; font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ember); }
.gate-msg { margin: 0; padding: 10px 12px; border-radius: 10px; background: rgba(255, 198, 41, 0.1); color: var(--turmeric); }
.gate-err { margin: 0; min-height: 1.2em; color: #ff8a7a; font-weight: 700; }
code { font-family: var(--f-mono); font-size: 13px; background: var(--panel-2); padding: 1px 6px; border-radius: 6px; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
  padding: 12px clamp(14px, 3vw, 32px);
  background: rgba(18, 11, 8, 0.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; }
.brand svg { width: 22px; fill: var(--ember); }
.brand b { font-family: var(--f-display); font-weight: 400; font-size: 20px; }
.brand span { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.tabs a { padding: 8px 12px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 700; font-size: 14px; }
.tabs a:hover { color: var(--text); }
.tabs a.is-active { background: rgba(244, 232, 214, 0.1); color: var(--text); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.save-state { font-family: var(--f-mono); font-size: 12px; color: var(--mint); }
.save-state.is-dirty { color: var(--turmeric); }
.save-state.is-dirty::before { content: "● "; }

.banner, .errors {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  margin: 16px clamp(14px, 3vw, 32px) 0; padding: 14px 18px; border-radius: var(--radius);
  background: rgba(255, 198, 41, 0.1); border: 1px solid rgba(255, 198, 41, 0.35);
}
.banner p { margin: 0; }
.errors { display: block; background: rgba(227, 38, 26, 0.12); border-color: rgba(227, 38, 26, 0.5); }
.errors ul { margin: 8px 0 0; padding-left: 20px; }
.errors li { margin: 2px 0; }

main { padding: 24px clamp(14px, 3vw, 32px) 80px; max-width: 1400px; margin: 0 auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.page-head p { margin: 4px 0 0; }
.head-actions { display: flex; gap: 8px; }
.back { display: inline-block; margin-bottom: 6px; font-weight: 700; text-decoration: none; }

/* ---------- fields ---------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field > span:first-child { font-size: 12px; font-weight: 700; letter-spacing: 0.02em; color: var(--muted); }
.field em { font-style: normal; font-weight: 400; opacity: 0.8; }
.field.grow, .grow { flex: 1 1 240px; }
input, select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px;
  border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--bg); color: var(--text); font: 15px var(--f-sans);
}
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--turmeric); box-shadow: 0 0 0 3px rgba(255, 198, 41, 0.18); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 0; accent-color: var(--turmeric); }
.money, .pct { position: relative; display: block; }
.money input { padding-left: 26px; }
.money::before { content: "$"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.pct input { padding-right: 30px; }
.pct::after { content: "%"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.hint { margin: 0; font-size: 13px; color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.filters { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; padding: 14px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.filters .field:not(.grow) { width: 170px; }

/* ---------- chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.6; border: 1px solid var(--line-2); }
.chip--mint { color: var(--mint); border-color: color-mix(in srgb, var(--mint) 50%, transparent); }
.chip--pink { background: var(--pink); border-color: var(--pink); color: #fff; }
.chip--turmeric { background: var(--turmeric); border-color: var(--turmeric); color: #1d130e; }
.chip--saffron { color: var(--saffron); border-color: color-mix(in srgb, var(--saffron) 55%, transparent); }
.chip--chili { background: var(--chili); border-color: var(--chili); color: #fff; }
.chip--sky { color: var(--sky); border-color: rgba(143, 200, 255, 0.5); }
.chip--cream { color: var(--text); }
.chip--line { color: var(--muted); }

/* ---------- item rows ---------- */
.group { margin-bottom: 26px; }
.group-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); position: sticky; top: 64px; background: var(--bg); z-index: 5; }
.group-head small { font-family: var(--f-mono); font-size: 12px; font-weight: 400; color: var(--muted); }
.rows { display: grid; }
.row {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) 170px 150px auto; gap: 14px; align-items: center;
  padding: 12px 6px; border-bottom: 1px solid var(--line);
}
.row:hover { background: rgba(244, 232, 214, 0.025); }
.row.status-soldout .row-name { text-decoration: line-through; text-decoration-color: var(--chili); }
.row.status-hidden { opacity: 0.5; }
.row-thumb { width: 64px; height: 64px; border-radius: 12px; overflow: hidden; background: var(--panel-2); display: grid; place-items: center; text-decoration: none; }
.row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-thumb span { font-size: 10px; color: var(--muted); text-align: center; }
.row-name { color: var(--text); font-weight: 800; font-size: 16px; text-decoration: none; }
.row-name:hover { color: var(--turmeric); }
.row-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.row-desc { margin: 4px 0 0; font-size: 13px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.row-prices { display: flex; gap: 16px; font-family: var(--f-mono); font-size: 14px; }
.row-prices span { display: grid; }
.row-prices small { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.row-status select { min-height: 36px; padding: 6px 10px; font-size: 14px; }
.row-actions { display: flex; gap: 4px; }

/* ---------- editors ---------- */
.editor-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 20px; align-items: start; }
.col { display: grid; gap: 20px; }
.card { margin: 0; padding: 18px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); display: grid; gap: 14px; min-width: 0; }
fieldset.card legend, .card .legend { float: left; width: 100%; margin: 0 0 2px; padding: 0; font-weight: 800; font-size: 15px; }
fieldset.card legend + * { clear: both; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg.col { flex-direction: column; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; min-height: 38px; padding: 6px 14px; border: 1px solid var(--line-2); border-radius: 10px; font-weight: 700; font-size: 14px; }
.seg input:checked + span { background: var(--turmeric); border-color: var(--turmeric); color: #1d130e; }
.seg input:focus-visible + span { outline: 2px solid var(--turmeric); outline-offset: 2px; }
.pick { display: flex; flex-wrap: wrap; gap: 6px; }
.pick.col1 { flex-direction: column; gap: 10px; }
.pick-chip { cursor: pointer; border: 0; padding: 0; }
.pick-chip input { position: absolute; opacity: 0; pointer-events: none; }
.pick-chip span { display: inline-flex; align-items: center; min-height: 34px; padding: 5px 12px; border-radius: 999px; border: 1px dashed var(--line-2); color: var(--muted); font-weight: 700; font-size: 13px; }
.pick-chip input:checked + span { border-style: solid; border-color: var(--turmeric); background: rgba(255, 198, 41, 0.14); color: var(--text); }
.pick-chip input:checked + span::before { content: "✓ "; color: var(--turmeric); }
.pick-chip input:focus-visible + span { outline: 2px solid var(--turmeric); outline-offset: 2px; }
.dot { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; background: var(--text); }
.dot--mint { background: var(--mint); }
.dot--pink { background: var(--pink); }
.dot--turmeric { background: var(--turmeric); }
.dot--saffron { background: var(--saffron); }
.dot--chili { background: var(--chili); }
.dot--sky { background: var(--sky); }
.dot--cream { background: var(--text); }
.pick-chip input:checked + span .dot { box-shadow: 0 0 0 2px var(--bg); }
.pick-chip input:checked + span::before { margin-right: 2px; }

.photo { position: relative; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: var(--bg); border: 2px dashed var(--line-2); display: grid; place-items: center; transition: border-color 0.15s; }
.photo.is-over { border-color: var(--turmeric); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-empty, .photo-busy { text-align: center; color: var(--muted); font-weight: 700; }
.photo-busy { color: var(--turmeric); }
.photo-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.preview-card { background: var(--bg); }
.pv { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; }
.pv.is-out { opacity: 0.55; }
.pv img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; }
.pv-name { margin: 0; font-family: var(--f-display); font-size: 22px; line-height: 1.1; }
.pv-name .chip { font-family: var(--f-sans); vertical-align: middle; }
.pv-desc { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.pv-all { margin: 4px 0 0; font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
.pv-price { margin: 0; font-family: var(--f-mono); font-size: 16px; text-align: right; white-space: nowrap; }
.pv-price small { display: block; font-size: 10px; color: var(--muted); text-transform: uppercase; }
.editor-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }

/* specials */
.week-board { list-style: none; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin: 0 0 24px; padding: 0; }
.week-board li { display: flex; flex-direction: column; gap: 6px; min-height: 110px; padding: 12px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.week-board b { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.wk { display: grid; padding: 6px 8px; border-radius: 8px; background: rgba(255, 198, 41, 0.12); color: var(--text); text-decoration: none; font-weight: 700; font-size: 13px; line-height: 1.3; }
.wk small { font-weight: 400; color: var(--turmeric); }
.wk.is-off { opacity: 0.45; text-decoration: line-through; }
.sp-list { display: grid; gap: 8px; }
.sp-row { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.sp-row p { margin: 2px 0 0; font-size: 13px; }
.sp-row.is-off { opacity: 0.6; }
.days { display: flex; flex-wrap: wrap; gap: 6px; }
.day { min-width: 56px; min-height: 44px; border-radius: 12px; border: 1px solid var(--line-2); background: transparent; color: var(--text); font: 800 14px var(--f-sans); cursor: pointer; }
.day.on { background: var(--turmeric); border-color: var(--turmeric); color: #1d130e; }
.quick { display: flex; flex-wrap: wrap; gap: 4px; margin-top: -6px; }
.chosen { display: flex; flex-wrap: wrap; gap: 6px; }
.chosen-item { display: inline-flex; align-items: center; gap: 6px; padding: 4px 4px 4px 12px; border-radius: 999px; background: rgba(255, 198, 41, 0.14); border: 1px solid rgba(255, 198, 41, 0.4); font-weight: 700; font-size: 13px; }
.chosen-item small { font-family: var(--f-mono); font-weight: 400; color: var(--turmeric); }
.chosen-item.is-warn { background: rgba(227, 38, 26, 0.14); border-color: rgba(227, 38, 26, 0.5); }
.chosen-item.is-warn small { color: #ff8a7a; }
.chosen-item button { width: 24px; height: 24px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.3); color: var(--text); cursor: pointer; }
.picker { max-height: 420px; overflow: auto; padding-right: 6px; display: grid; gap: 12px; }
.picker-group p { margin: 0 0 6px; font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.picker-group .check { padding: 4px 0; }

/* categories / tags / history */
.cat-list { display: grid; gap: 8px; }
.cat-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.cat-row .field:not(.grow) { width: 180px; }
.cat-row > .mono, .cat-row > .check { align-self: center; }
/* fixed widths so the columns line up row to row */
.cat-row > .check { width: 168px; }
.cat-row > .mono:not(.grow) { width: 150px; text-align: right; overflow-wrap: anywhere; }
.cat-order { display: flex; flex-direction: column; gap: 4px; align-self: center; }
.add-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-top: 16px; padding: 14px 16px; border-radius: var(--radius); border: 1px dashed var(--line-2); }
.tag-sample { align-self: center; }
.allergen-ref { margin-top: 28px; }

/* library dialog */
.library { width: min(900px, 94vw); max-height: 88vh; padding: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); color: var(--text); }
.library::backdrop { background: rgba(8, 5, 3, 0.75); }
.library form { display: grid; gap: 14px; padding: 20px; }
.library header, .library footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.library footer { justify-content: flex-end; }
.library--sm { width: min(460px, 94vw); }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; max-height: 50vh; overflow: auto; }
.lib-item { padding: 0; border: 2px solid transparent; border-radius: 12px; background: var(--bg); color: var(--muted); cursor: pointer; overflow: hidden; text-align: left; }
.lib-item:hover, .lib-item:focus-visible { border-color: var(--turmeric); }
.lib-item img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.lib-item span { display: block; padding: 6px 8px; font-size: 12px; }

/* toasts */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-2); font-weight: 700; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5); animation: pop 0.25s ease-out; }
.toast.ok { border-color: var(--mint); }
.toast.bad { border-color: var(--chili); background: #3a140f; }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } }

/* ---------- small screens: rows become cards ---------- */
@media (max-width: 960px) {
  .editor-grid { grid-template-columns: 1fr; }
  .week-board { grid-template-columns: repeat(2, 1fr); }
  .row { grid-template-columns: 56px minmax(0, 1fr) auto; grid-template-areas: "thumb main main" "thumb prices status" "actions actions actions"; }
  .row-thumb { grid-area: thumb; width: 56px; height: 56px; align-self: start; }
  .row-main { grid-area: main; }
  .row-prices { grid-area: prices; }
  .row-status { grid-area: status; }
  .row-actions { grid-area: actions; justify-content: flex-end; }
  .group-head { top: 0; position: static; }
  .top { position: static; }
}
@media (max-width: 560px) {
  .two { grid-template-columns: 1fr; }
  .actions { width: 100%; margin-left: 0; }
  .actions .btn.hot { flex: 1; }
  .filters .field:not(.grow), .cat-row .field:not(.grow) { width: 100%; }
  .cat-row > .check, .cat-row > .mono:not(.grow) { width: auto; text-align: left; }
}
