/* Emberstack admin. Light paper theme on purpose: it is read on a tablet next to a hot grill
   and in daylight, where dark screens wash out. */
@font-face { font-family: "Big Shoulders"; src: url("../fonts/big-shoulders-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Bricolage"; src: url("../fonts/bricolage-latin.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

:root {
  --paper: #fbf7f1;
  --card: #ffffff;
  --ink: #1d1712;
  --muted: #5e5045;
  --line: #e3d8cb;
  --field: #8a7462;
  --brick: #8e2f16;
  --ember: #c84b12;
  --cheddar: #f7b538;
  --ok: #1f6b3f;
  --ok-bg: #e5f2e9;
  --warn: #8a5300;
  --warn-bg: #fdf0d6;
  --bad: #a3271b;
  --bad-bg: #fbe8e5;
  --display: "Big Shoulders", "Arial Narrow", Impact, sans-serif;
  --body: "Bricolage", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r: 10px;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.5 var(--body); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brick); }
a[href], button:not(:disabled), summary, select, label[for], [role="button"], input[type="checkbox"], input[type="radio"], input[type="file"] { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--ember); outline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.1; }
h1 { font: 800 40px/1 var(--display); text-transform: uppercase; }
h2 { font: 800 28px/1 var(--display); text-transform: uppercase; }
h3 { font-size: 17px; }
p { margin: 0; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.mono { font-family: var(--mono); }

/* Shell */
.bar { position: sticky; top: 0; z-index: 20; background: var(--ink); color: #fbf7f1; }
.bar-in { display: flex; align-items: center; gap: 14px; padding: 0 16px; min-height: 56px; }
.bar .brand { font: 900 26px/1 var(--display); text-transform: uppercase; color: #fbf7f1; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.bar .brand small { font: 600 13px/1 var(--body); text-transform: none; color: #d8c9b8; margin-left: 10px; }
.bar .who { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 14px; color: #d8c9b8; }
.bar .who button, .bar .who a { min-height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid #6b5a4c; background: none; color: #fbf7f1; text-decoration: none; display: inline-flex; align-items: center; }
.bar .who button:hover, .bar .who a:hover { border-color: #fbf7f1; }
.bar :focus-visible { outline-color: var(--cheddar); }
.tabs { display: flex; gap: 2px; overflow-x: auto; padding: 0 12px; scrollbar-width: none; border-top: 1px solid #3a2f26; }
.tabs a { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 14px; color: #d8c9b8; text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; }
.tabs a:hover { color: #fff; }
.tabs a[aria-current="page"] { color: #fff; border-bottom-color: var(--cheddar); }
.tabs .count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--cheddar); color: var(--ink); font-size: 13px; font-weight: 700; display: inline-grid; place-items: center; }
.demo-bar { background: var(--warn-bg); color: var(--warn); font-size: 14px; padding: 8px 16px; border-bottom: 1px solid #f0d8a8; }
.demo-bar button { background: none; border: 0; padding: 0; color: var(--brick); text-decoration: underline; font-weight: 600; min-height: 40px; }
main { padding: 20px 16px 80px; max-width: 1440px; margin: 0 auto; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 18px; }
.head .tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Buttons and controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 16px; border-radius: 8px; border: 1px solid var(--field); background: var(--card); font-weight: 600; text-decoration: none; color: var(--ink); }
.btn:hover:not(:disabled) { border-color: var(--ink); background: #f6efe6; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; }
.btn-go { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-go:hover:not(:disabled) { background: #3a2f26; border-color: #3a2f26; }
.btn-hot { background: var(--cheddar); border-color: #c98a12; color: var(--ink); }
.btn-hot:hover:not(:disabled) { background: #ffc85e; border-color: #a06b00; }
.btn-bad { color: var(--bad); border-color: #d7a49e; }
.btn-bad:hover:not(:disabled) { background: var(--bad-bg); border-color: var(--bad); }
.btn-small { min-height: 40px; padding: 4px 12px; font-size: 14px; }
.btn-link { background: none; border: 0; padding: 0 4px; min-height: 40px; color: var(--brick); text-decoration: underline; font-weight: 600; }
.switch { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; }
.switch input { appearance: none; width: 46px; height: 26px; border-radius: 13px; background: #8a7462; position: relative; margin: 0; flex: none; transition: background-color 0.15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { transform: translateX(20px); }
.switch input:disabled { opacity: 0.5; }
label.field, .field { display: grid; gap: 4px; }
.field > span:first-child, .field > label { font-weight: 600; font-size: 14px; }
.field .hint { color: var(--muted); font-size: 13px; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="url"], input[type="date"], input[type="time"], input[type="search"], select, textarea { width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid var(--field); border-radius: 8px; background: #fff; }
textarea { min-height: 84px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--ink); }
input[aria-invalid="true"] { border-color: var(--bad); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.checks label { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; }
.checks input { width: 18px; height: 18px; accent-color: var(--brick); }
.checks .switch input { width: 46px; height: 26px; }
.error { padding: 10px 12px; border-radius: 8px; background: var(--bad-bg); color: var(--bad); border: 1px solid #e7b8b2; }
.okay { padding: 10px 12px; border-radius: 8px; background: var(--ok-bg); color: var(--ok); }

/* Panels */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.panel + .panel { margin-top: 16px; }
.panel h2 { margin-bottom: 12px; }
.panel .row-end { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; align-items: center; }
.state { padding: 36px 16px; text-align: center; color: var(--muted); }
.state strong { display: block; color: var(--ink); font-size: 18px; margin-bottom: 4px; }
.loading::after { content: ""; display: inline-block; width: 14px; height: 14px; margin-left: 8px; border: 2px solid var(--muted); border-top-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Orders board */
.pulse-row { display: flex; gap: 10px 22px; flex-wrap: wrap; align-items: center; padding: 12px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 16px; }
.pulse-row .stat strong { font: 800 26px/1 var(--display); margin-right: 6px; }
.pulse-row .stat { color: var(--muted); }
.pulse-row .paused { color: var(--bad); font-weight: 700; }
.board { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 14px; align-items: start; }
.col { background: #f3ebe0; border-radius: var(--r); padding: 10px; min-height: 160px; }
.col > h2 { font-size: 22px; display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 10px; }
.col > h2 span { font: 700 14px/1 var(--body); background: #fff; border-radius: 10px; padding: 4px 9px; }
.col .empty { color: var(--muted); font-size: 14px; padding: 8px 4px; }
@media (max-width: 1180px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .board { grid-template-columns: 1fr; } }

.tk { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 10px; position: relative; }
.tk.is-new { border: 2px solid var(--ember); }
.tk .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tk .code { font: 700 15px/1.2 var(--mono); }
.tk .due { font-weight: 700; font-size: 14px; }
.tk .due.late { color: var(--bad); }
.tk .who { margin-top: 4px; font-size: 14px; }
.tk .who a { font-weight: 600; }
.tk ul { list-style: none; margin: 10px 0 0; padding: 10px 0 0; border-top: 1px dashed var(--line); display: grid; gap: 6px; }
.tk li { display: grid; grid-template-columns: 28px 1fr; gap: 2px 6px; font-size: 15px; }
.tk li b { font-family: var(--mono); }
.tk li .c { grid-column: 2; color: var(--muted); font-size: 13px; }
.tk .note { margin-top: 8px; padding: 6px 8px; border-radius: 6px; background: var(--warn-bg); color: var(--warn); font-size: 14px; }
.tk .foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.tk .total { font: 700 16px/1 var(--mono); }
.tk .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 13px; font-weight: 700; background: #efe6da; color: var(--ink); }
.badge.delivery { background: #e9e4f6; color: #3d2f7a; }
.badge.pickup { background: #e2eef4; color: #1c4c66; }
.badge.chat { background: var(--warn-bg); color: var(--warn); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.wait { background: var(--warn-bg); color: var(--warn); }
.done-list { display: grid; gap: 6px; }
.done-list .tk { padding: 8px 10px; }
.done-list .tk ul, .done-list .tk .who { display: none; }

/* Tables (data) */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
table.data { width: 100%; border-collapse: collapse; font-size: 15px; }
table.data th, table.data td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-size: 13px; color: var(--muted); font-weight: 700; background: #faf5ee; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num { text-align: right; font-family: var(--mono); }
@media (max-width: 720px) {
  table.data.stack thead { display: none; }
  table.data.stack tr { display: block; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  table.data.stack td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 0; }
  table.data.stack td::before { content: attr(data-label); color: var(--muted); font-size: 13px; font-weight: 700; }
  table.data.stack td.num { text-align: right; }
}

/* Menu admin */
.menu-admin { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.cats { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.cats li { display: flex; align-items: center; gap: 4px; }
.cats .pick { flex: 1; text-align: left; min-height: 44px; padding: 6px 10px; border-radius: 8px; border: 1px solid transparent; background: none; font-weight: 600; }
.cats .pick:hover { background: #f3ebe0; }
.cats .pick[aria-pressed="true"] { background: var(--ink); color: #fff; }
.cats .pick small { font-weight: 400; opacity: 0.8; margin-left: 4px; }
.icon-btn { width: 40px; height: 40px; flex: none; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.icon-btn:hover:not(:disabled) { border-color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.items-admin { display: grid; gap: 8px; }
.ia { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.ia img, .ia .ph { width: 64px; height: 64px; border-radius: 6px; object-fit: cover; background: #efe6da; display: grid; place-items: center; font: 800 18px/1 var(--display); color: var(--brick); text-transform: uppercase; }
.ia .name { font-weight: 700; }
.ia .meta { color: var(--muted); font-size: 14px; }
.ia .ctl { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 860px) { .menu-admin { grid-template-columns: 1fr; } .ia { grid-template-columns: 56px minmax(0, 1fr); } .ia .ctl { grid-column: 1 / -1; justify-content: flex-start; } }

/* Dialogs */
dialog { border: 0; border-radius: 12px; padding: 0; width: min(720px, 100vw - 24px); max-height: min(92vh, 1000px); background: var(--paper); color: var(--ink); }
dialog::backdrop { background: rgba(29, 23, 18, 0.55); }
dialog form, .dlg { display: flex; flex-direction: column; max-height: inherit; }
.dlg-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { flex: 1; }
.dlg-body { padding: 18px; overflow-y: auto; display: grid; gap: 14px; }
.dlg-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.dlg-foot .error { margin-right: auto; }
.group-box { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fff; display: grid; gap: 10px; }
.group-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px auto; gap: 8px; align-items: end; }
.choice-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 40px; gap: 6px; align-items: center; }
@media (max-width: 560px) { .group-row { grid-template-columns: 1fr; } }
.photo-edit { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.photo-edit img, .photo-edit .ph { width: 96px; height: 96px; border-radius: 8px; object-fit: cover; background: #efe6da; }

/* Hours editor */
.hours-edit { display: grid; gap: 6px; }
.hours-edit .day { display: grid; grid-template-columns: 120px 120px 1fr 1fr; gap: 8px; align-items: center; }
@media (max-width: 560px) { .hours-edit .day { grid-template-columns: 1fr 1fr; } }

/* Chats */
.chat-list { display: grid; gap: 10px; }
.chat-list details { background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.chat-list summary { padding: 12px; display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; min-height: 44px; }
.chat-list .msgs { padding: 0 12px 12px; display: grid; gap: 6px; }
.chat-list .m { padding: 8px 10px; border-radius: 8px; font-size: 14px; white-space: pre-wrap; }
.chat-list .m.customer { background: #f3ebe0; }
.chat-list .m.assistant { background: #eef3f6; }

/* Sign-in */
.signin { max-width: 400px; margin: 10vh auto 0; }
.signin h1 { margin-bottom: 6px; }

.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; width: min(440px, 100vw - 32px); }
.toast { padding: 12px 16px; border-radius: 8px; background: var(--ink); color: #fff; font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); }
.toast-bad { background: var(--bad); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
@media print {
  .bar, .tabs, .head .tools, .tk .actions, .demo-bar, .pulse-row { display: none !important; }
  body { background: #fff; }
}

[hidden] { display: none !important; }

/* Modern skin: soft warm gradient, rounded glass cards, gradient actions */
:root { --fire: linear-gradient(110deg, #ff5a1f, #f2692a 40%, #f7b538); --r: 18px; }
body { background: radial-gradient(900px 500px at 0% -10%, rgba(242, 105, 42, 0.14), transparent 60%), radial-gradient(800px 500px at 100% 0%, rgba(247, 181, 56, 0.14), transparent 60%), var(--paper); background-attachment: fixed; }
.bar { background: rgba(255, 255, 255, 0.7); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); border-bottom: 1px solid rgba(200, 75, 18, 0.12); }
.bar .brand { background: var(--fire); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tabs a { border-radius: 999px; }
.tabs a[aria-current="page"] { background: var(--fire); color: #1d1712; box-shadow: 0 8px 22px -8px rgba(242, 105, 42, 0.7); border-color: transparent; }
.btn { border-radius: 999px; transition: transform 0.15s, box-shadow 0.2s; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn-go, .btn-hot { background: var(--fire); color: #1d1712; border-color: transparent; box-shadow: 0 10px 26px -10px rgba(242, 105, 42, 0.75); }
.btn-go:hover:not(:disabled), .btn-hot:hover:not(:disabled) { background: var(--fire); box-shadow: 0 14px 32px -10px rgba(242, 105, 42, 0.9); }
.panel, .col, .tk, .ia { border-radius: 22px; border-color: rgba(200, 75, 18, 0.12); background: rgba(255, 255, 255, 0.78); backdrop-filter: blur(12px); box-shadow: 0 1px 2px rgba(29, 23, 18, 0.05), 0 16px 40px -24px rgba(200, 75, 18, 0.35); }
.tk.is-new { box-shadow: 0 0 0 2px #f2692a, 0 16px 40px -18px rgba(242, 105, 42, 0.7); }
.pulse-row .stat strong { background: var(--fire); -webkit-background-clip: text; background-clip: text; color: transparent; }
.badge { border-radius: 999px; }
.cats .pick { border-radius: 14px; }
.cats .pick[aria-pressed="true"] { background: var(--fire); color: #1d1712; border-color: transparent; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea { border-radius: 12px !important; }
.switch input:checked { background: #f2692a; }
.signin { border-radius: 28px; box-shadow: 0 30px 80px -30px rgba(242, 105, 42, 0.45); }
.toast { border-radius: 999px; }
