:root {
  --bg: #fff8ef;
  --card: #ffffff;
  --ink: #3a2419;
  --accent: #c2410c;
  --accent-dark: #9a3412;
  --border: #e7d9c9;
  --muted: #8a7362;
  --received: #6b7280;
  --confirmed: #b45309;
  --placed: #15803d;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  margin: 0;
  padding: 0;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.wrap.wide { max-width: 1100px; }

h1 {
  font-size: 1.9rem;
  margin-bottom: 4px;
}

h1 .emoji { font-size: 1.5rem; }

.subtitle {
  color: var(--muted);
  margin-top: 0;
  margin-bottom: 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

fieldset {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 18px;
  padding: 14px 16px;
}

legend {
  font-weight: 600;
  padding: 0 6px;
}

.option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
  gap: 10px;
}
.option-row:last-child { border-bottom: none; }

.option-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.price-tag {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

input[type="text"], input[type="search"], input[type="email"], input[type="password"], input[type="number"], textarea, select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}

label.field-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.field { margin-bottom: 16px; }

button, .btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  font-weight: 600;
}
button:hover, .btn:hover { background: var(--accent-dark); }
button.secondary, .btn.secondary { background: #6b7280; }
button.small, .btn.small { padding: 4px 8px; font-size: 0.78rem; }
button.danger, .btn.danger { background: #b91c1c; }

.total-bar {
  position: sticky;
  bottom: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
}

.total-amount { font-size: 1.4rem; font-weight: 700; }

.error-box {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
th, td {
  text-align: left;
  padding: 5px 7px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th { color: var(--muted); font-weight: 600; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
}
.badge.received { background: var(--received); }
.badge.confirmed { background: var(--confirmed); }
.badge.placed { background: var(--placed); }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.topbar a { color: var(--accent); text-decoration: none; font-weight: 600; }
.topbar a.btn { color: #fff; }

.item-list { margin: 0; padding-left: 14px; }
.item-list li { margin-bottom: 1px; }

.grand-total {
  font-size: 1.1rem;
  font-weight: 700;
}

.muted { color: var(--muted); }

.menu-group {
  margin: 26px 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border);
  font-size: 1.2rem;
}

.menu-tools { margin-bottom: 16px; }
.menu-tools input[type=search] { width: 100%; margin-bottom: 10px; }
.group-links { display: flex; flex-wrap: wrap; gap: 6px; }
.menu-section { scroll-margin-top: 12px; }
.group-chip {
  display: inline-block;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
}
.group-chip:hover { border-color: var(--accent); color: var(--accent); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.stat-num { font-size: 1.5rem; font-weight: 700; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 0 16px; }

.preview-bar { background: #1f2937; color: #fff; padding: 8px 16px; text-align: center; font-size: 0.9rem; }
.preview-bar a { color: #fde68a; }
.admin-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.admin-tools details { flex-basis: 100%; }
.admin-tools details:not([open]) { flex-basis: auto; }
.admin-tools summary { list-style: none; display: inline-block; }
.admin-tools summary::-webkit-details-marker { display: none; }
.quick-edit { display: grid; gap: 8px; margin-top: 8px; max-width: 480px; }
.quick-edit label { font-size: 0.85rem; font-weight: 600; display: grid; gap: 3px; }
.quick-edit.inline { display: flex; flex-wrap: wrap; align-items: center; max-width: none; }
.quick-edit.inline input[type=text] { width: 200px; }
.item-tools { flex-basis: auto; margin-left: 10px; }
.item-tools[open] { flex-basis: 100%; margin-left: 0; }
.item-tools summary { padding: 0 2px; }
.item-tools summary { cursor: pointer; color: var(--muted, #6b7280); list-style: none; font-size: 0.85rem; }
.item-tools summary::-webkit-details-marker { display: none; }
.option-row { flex-wrap: wrap; }
.is-hidden { opacity: 0.55; }

.order-line { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--border); }
.row-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.row-actions .btn, .row-actions button { display: block; width: 100%; text-align: center; padding: 7px 12px; white-space: nowrap; box-sizing: border-box; }
.row-actions form { margin: 0; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 16px; align-items: start; }
.pay-reminder { background: #fef9c3; border: 1px solid #fde68a; border-radius: 10px; padding: 12px 14px; margin: 4px 0 14px; line-height: 1.45; color: #422006; }
.option-row > :nth-child(2) { margin-left: auto; }
.menu-group { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.to-top { font-size: 0.8rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
html { scroll-behavior: smooth; }

.email-toggles { display: flex; flex-direction: column; gap: 2px; font-size: 0.8rem; white-space: nowrap; }
.email-toggles label { display: flex; gap: 5px; align-items: center; font-weight: 400; }
.check-row { display: flex; gap: 8px; align-items: center; margin: 6px 0; font-weight: 400; }

.pay-card { text-align: center; }
.pay-btn { display: inline-block; font-size: 1.1rem; padding: 12px 22px; text-decoration: none; background: #008cff; }
.pay-btn:hover { background: #0074d4; }
.pay-field { display: flex; gap: 4px; align-items: center; font-size: 0.85rem; font-weight: 400; }
.pm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.pm-grid .card { margin: 0; }
.pm-card-head { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.pm-card-head form { margin: 0; }
.pm-form { display: grid; gap: 10px; }
.pm-form label { display: grid; gap: 4px; font-size: 0.85rem; font-weight: 600; }
.pm-form label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.pm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pm-form button { justify-self: start; }
.pm-actions { display: flex; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); }
.pm-actions form { margin: 0; }
.row-actions .pay-btn { font-size: 0.8rem; }

.pricing-top { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; justify-content: space-between; }
.pricing-stats { font-size: 0.9rem; }
.pricing-buttons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pct-pair { display: inline-flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pct-pair label { display: inline-flex; gap: 6px; align-items: center; font-size: 0.85rem; font-weight: 600; }
input.pct { width: 110px; padding: 4px 6px; font-size: 0.85rem; }
.pricing-group-head { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.pricing-group details { margin-top: 8px; }
.pricing-group summary { cursor: pointer; font-size: 0.85rem; }
.pricing-table td.num, .pricing-table th.num { text-align: right; white-space: nowrap; }
.pricing-table .p-row td { border-top: 2px solid var(--border); padding-top: 8px; }
.pricing-table .c-row td { font-size: 0.85rem; font-weight: 600; }
.pricing-table .i-row td { font-size: 0.82rem; }
.price-new { color: #b45309; }
.item-table { width: 100%; }
.item-table th, .item-table td { vertical-align: middle; }
.item-table td:nth-child(2) input { width: 100%; min-width: 140px; }
.item-table td.num input { width: 90px; text-align: right; }
.item-table th.num { text-align: right; }
.item-actions { display: flex; gap: 6px; flex-wrap: nowrap; align-items: center; }
.item-actions form { margin: 0; }

.pricing-row { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin: -8px 0 14px; padding: 8px 10px; background: #f8fafc; border: 1px dashed var(--border); border-radius: 8px; font-size: 0.85rem; }
.pricing-row label { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; }
.item-table input.pct { width: 100px; }
.group-markups { margin-top: 8px; }
.group-markups summary { cursor: pointer; font-size: 0.85rem; }
.group-markups table { margin-top: 6px; }
.in-cart { margin: 0; text-align: center; }
.in-cart input[type=checkbox] { width: 18px; height: 18px; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Option tables: headers centered over their columns (Name stays left). */
.item-table th, .item-table td { text-align: center; }
.item-table th:nth-child(2), .item-table td:nth-child(2) { text-align: left; }
.item-table th.num, .item-table td.num { text-align: center; }
.item-table td.num input, .item-table input.pct { text-align: center; }
.item-table .item-actions { justify-content: center; }

select.round { width: auto; padding: 3px 6px; font-size: 0.8rem; }
.markup-cell { white-space: nowrap; }
.markup-cell select.round { margin-left: 4px; }
.flash-toast { position: fixed; right: 16px; bottom: 16px; z-index: 50; max-width: 420px; margin: 0; padding: 10px 14px; background: #1f2937; color: #fff; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.25); font-size: 0.9rem; }
.flash-toast.error-box { background: #b91c1c; }
.np-unsaved { outline: 1px dashed #b45309; outline-offset: 2px; border-radius: 3px; }
.np-unsaved::after { content: " unsaved"; font-size: 0.7rem; color: #b45309; }
.collapse-controls { display: inline-flex; gap: 6px; margin-left: 6px; }
.collapse-toggle { background: none; color: var(--ink); border: 1px solid var(--border); border-radius: 6px; width: 28px; height: 28px; padding: 0; font-size: 0.9rem; line-height: 1; cursor: pointer; }
.collapse-toggle:hover { background: var(--border); }
.collapsed > .collapse-body { display: none; }
.collapsed > .topbar { margin-bottom: 0 !important; }
.collapse-summary { font-size: 0.75rem; font-weight: 400; }
:not(.collapsed) > .topbar .collapse-summary { display: none; }
.cat-card .collapse-toggle { width: 24px; height: 24px; font-size: 0.8rem; }
.collapse-float { position: fixed; left: 16px; bottom: 16px; z-index: 40; display: flex; gap: 6px; padding: 6px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
/* Disabled products / options in the menu editor: light gray so they stand apart. */
.product-card[data-active="0"] { background: #eef0f3; border-color: #d4d8de; border-style: dashed; }
.product-card[data-active="0"] > .topbar h2 { color: #6b7280; }
.product-card[data-active="0"] .cat-card { background: #f5f6f8 !important; }
.item-table tr.item-disabled td { background: #eef0f3; color: #6b7280; }
.item-table tr.item-disabled input { background: #f5f6f8; }
.save-all { background: #047857; }
.save-all:hover { background: #065f46; }
.checklist-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-bottom: 16px; }
.checklist-grid .card { margin: 0; }
.checklist h3 { margin: 0 0 8px; font-size: 1rem; }
.checklist ol { list-style: none; margin: 0; padding: 0; }
.checklist .step { display: grid; grid-template-columns: 22px 120px 1fr auto; gap: 6px; align-items: center; padding: 6px 4px; border-bottom: 1px dashed var(--border); font-size: 0.88rem; }
.checklist .step:last-child { border-bottom: none; }
.checklist .step.done { opacity: 0.55; }
.checklist .step.next { background: #fef3c7; border-radius: 6px; font-weight: 600; }
.checklist .step-mark { text-align: center; }
.run-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.place-receipt { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: flex-end; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.place-receipt label { display: grid; gap: 4px; font-size: 0.85rem; font-weight: 600; }
.vote-link { margin: -8px 0 14px; }
.vote-card .vote-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin: 10px 0; }
.vote-option { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-weight: 600; }
.vote-option:has(input:checked) { border-color: var(--accent); background: #fff7ed; }
.vote-admin { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); }
.vote-admin form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.favorites-strip { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.fav-list { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; }
.fav-item { display: inline-flex; gap: 8px; align-items: center; margin: 0; padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px; background: #fffbeb; }
.fav-save { display: inline; margin: 0 0 0 4px; }
.fav-star { background: none; color: #d97706; border: none; padding: 0 2px; font-size: 1rem; cursor: pointer; }
.fav-star:hover { color: #b45309; background: none; }
.vote-bar-row { display: grid; grid-template-columns: minmax(140px, 240px) 1fr 36px; gap: 10px; align-items: center; padding: 4px 0; font-size: 0.9rem; }
.vote-bar { height: 12px; background: #f3f4f6; border-radius: 6px; overflow: hidden; }
.vote-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 6px; min-width: 2px; }
.vote-bar-count { text-align: right; font-weight: 700; }
.menu-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.menu-actions form { margin: 0; }

/* Menus page: one compact row per menu, settings fold open underneath */
.menu-list { padding: 4px 16px; }
.menu-row { border-bottom: 1px solid var(--border); padding: 12px 0; }
.menu-row:last-child { border-bottom: none; }
.menu-row.is-active { box-shadow: inset 3px 0 0 #15803d; padding-left: 12px; }
.menu-main { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.menu-pos { margin: 0; }
.menu-pos select { width: auto; padding: 2px 6px; }
.menu-info { flex: 1 1 260px; min-width: 0; }
.menu-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 1.02rem; }
.menu-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.82rem; margin-top: 3px; align-items: center; }
.menu-vote { margin: 0; }
.menu-vote label { display: flex; gap: 4px; align-items: center; font-weight: 400; cursor: pointer; }
.menu-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.menu-buttons form { margin: 0; }
.menu-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px 20px; margin-top: 12px; padding: 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); }
.menu-settings[hidden] { display: none; }
.menu-settings form { margin: 0; }
.menu-settings .field-label { margin-bottom: 4px; }
.menu-settings .inline { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.menu-settings .inline input[type=text], .menu-settings .inline input[type=datetime-local] { width: auto; flex: 1 1 150px; padding: 4px 8px; }
.menu-settings .inline label { display: flex; gap: 4px; align-items: center; font-weight: 400; font-size: 0.85rem; }
.menu-danger { display: flex; gap: 6px; align-items: flex-end; justify-content: flex-end; }
.menu-danger form { margin: 0; }

/* Products page: compact product / option-group headers; edit fields fold into a Details panel */
.product-card { border-width: 1px !important; padding: 14px 18px; }
.prod-head, .cat-head { margin-bottom: 0; gap: 10px; flex-wrap: wrap; }
.prod-head h2, .cat-head h3 { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prod-head h2 { font-size: 1.15rem; }
.cat-head h3 { font-size: 0.98rem; }
.pos-form { margin: 0; display: inline; }
.pos-form select { width: auto; padding: 1px 4px; font-size: 0.8rem; }
.prod-facts { font-size: 0.82rem; font-weight: 400; display: inline-flex; gap: 6px; align-items: center; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); font-size: 0.75rem; }
.warn-text { color: #b45309; }
.cat-rules { font-size: 0.78rem; font-weight: 400; }
.head-buttons { display: flex; gap: 6px; align-items: center; }
.product-card > .collapse-body { margin-top: 10px; }
.cat-card { background: #fffaf3; padding: 10px 14px; margin: 10px 0 0; box-shadow: none; }
.cat-card > .collapse-body { margin-top: 8px; }
.edit-panel { margin: 8px 0 10px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.edit-panel[hidden] { display: none; }
.edit-panel .pricing-row { margin: 10px 0 0; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 12px; align-items: end; margin: 0; }
.field-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.field-grid label.wide { grid-column: span 2; }
.field-grid label.check { flex-direction: row; align-items: center; gap: 6px; font-weight: 400; color: var(--ink); }
.field-grid input[type=text], .field-grid input[type=number] { width: 100%; padding: 5px 8px; }
.field-grid-save { display: flex; align-items: end; }
.panel-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 10px; }
.panel-actions form { margin: 0; }
.item-table th { font-size: 0.72rem; padding-top: 4px; padding-bottom: 4px; }
.item-table td { padding-top: 4px; padding-bottom: 4px; }
.item-table td input { padding: 4px 6px; }
.item-table td.num input { width: 76px; }
.icon-btn { padding: 4px 7px; line-height: 1; }
.add-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 8px 0 0; }
.add-row input[type=text] { flex: 1 1 180px; width: auto; padding: 5px 8px; }
.add-row input.money { width: 90px; padding: 5px 8px; }
.add-group { margin-top: 10px; }
.add-group summary { cursor: pointer; font-weight: 600; font-size: 0.85rem; color: var(--accent); padding: 4px 0; }
.add-group[open] summary { margin-bottom: 8px; }
.pricing-help summary { cursor: pointer; font-size: 0.8rem; margin-bottom: 6px; }
.pricing-help p { font-size: 0.8rem; margin: 0 0 8px; }

/* All Orders: one-line filter bar with totals, tighter table */
.orders-bar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 16px; }
.filter-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0; flex: 1 1 520px; }
.filter-row input[type=search] { width: auto; flex: 1 1 170px; padding: 5px 8px; }
.filter-row select { width: auto; padding: 5px 6px; font-size: 0.85rem; }
.orders-total { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.orders-total strong { font-size: 1.25rem; }
.orders-total .muted { font-size: 0.8rem; }
.orders-card { padding: 6px 12px; }
.orders-table th { font-size: 0.75rem; white-space: nowrap; }
.orders-table td { vertical-align: top; padding-top: 9px; padding-bottom: 9px; }
.orders-table th.num, .orders-table td.num { text-align: right; }
.orders-table .cust strong { display: block; }
.orders-table .cust .muted { display: block; font-size: 0.78rem; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orders-table .items { font-size: 0.88rem; min-width: 220px; }
.orders-table .items > div + div { margin-top: 3px; }
.order-note { margin-top: 4px; font-size: 0.8rem; font-style: italic; color: var(--muted); }
.orders-table .pay form { margin: 0 0 3px; }
.orders-table .pay .muted { display: block; font-size: 0.78rem; white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.pay-toggle { background: none; color: #b45309; border: 1px solid #f0c48a; border-radius: 999px; padding: 2px 10px; font-size: 0.75rem; }
.pay-toggle:hover { background: #fff3e0; }
.pay-toggle.is-paid { color: #15803d; border-color: #9fd6b0; }
.pay-toggle.is-paid:hover { background: #eefaf1; }
.nowrap { white-space: nowrap; }
.order-actions { display: flex; gap: 4px; align-items: center; justify-content: flex-end; flex-wrap: nowrap; }
.order-actions form { margin: 0; }
.order-actions .btn, .order-actions button { white-space: nowrap; }

/* Dashboard: live menu + key numbers in one strip */
.dash-summary { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 16px; }
.dash-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: .04em; }
.dash-sub { font-size: 0.82rem; }
.dash-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.dash-stat { display: flex; flex-direction: column; align-items: center; min-width: 92px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 10px; color: var(--ink); text-decoration: none; line-height: 1.2; }
.dash-stat strong { font-size: 1.2rem; }
.dash-stat span { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
a.dash-stat:hover { background: var(--bg); }
.dash-stat.hot { border-color: var(--accent); }
.dash-stat.hot strong { color: var(--accent); }
.dash-stat.warn { border-color: #f0c48a; }
.dash-stat.warn strong { color: #b45309; }
.dash-head { margin-bottom: 4px; gap: 10px; flex-wrap: wrap; padding-top: 6px; }
.dash-head h3 { margin: 0; }
.dash-head h3 .muted { font-weight: 400; }
.order-actions > form > button { white-space: nowrap; }

/* ---- Phone vs PC ----
   Phones keep the single column above. On PC-sized screens the storefront gets a sticky
   sidebar (cart, search, sections) and a grid of menu cards; product options sit in two
   columns; the cart puts checkout beside the items; admin pages use more of the width. */
.side-cart { display: none; }
@media (min-width: 960px) {
  .wrap { padding-top: 28px; }
  .wrap.store { max-width: 1240px; }
  .wrap.store .cart-strip { display: none; }
  .store-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; }
  .store-side { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
  .side-cart { display: flex; flex-direction: column; gap: 4px; padding: 14px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; color: var(--ink); text-decoration: none; }
  .side-cart strong { font-size: 1.4rem; }
  .side-cart .btn { margin-top: 6px; text-align: center; }
  .store-side .menu-tools { margin: 0; }
  .store-side .group-links { flex-direction: column; flex-wrap: nowrap; gap: 2px; }
  .store-side .group-chip { border: none; background: none; border-radius: 6px; padding: 6px 10px; text-align: left; }
  .store-side .group-chip:hover { background: var(--card); }
  .store-main .menu-section { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; margin-bottom: 26px; }
  .store-main .menu-section > .menu-group { grid-column: 1 / -1; margin: 0; }
  .store-main .menu-card { margin: 0; display: flex; flex-direction: column; }
  .store-main .menu-card > .btn { margin-top: auto; align-self: flex-start; }
  .store-main .menu-card > p.muted { margin: 0 0 12px; font-size: 0.9rem; }
  .store-main .menu-card .admin-tools { margin-top: 10px; }
  .store-main .vote-card { margin-top: 10px; }

  .wrap.product-page { max-width: 1040px; }
  .option-groups { columns: 2; column-gap: 20px; }
  .option-groups fieldset { break-inside: avoid; display: inline-block; width: 100%; margin-top: 0; }

  .wrap.cart-page { max-width: 1100px; }
  .cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; align-items: start; }
  .cart-side { position: sticky; top: 16px; }
  .cart-items .card { margin-top: 0; }
}
@media (min-width: 1440px) {
  .wrap.wide { max-width: 1360px; }
  .wrap.store { max-width: 1400px; }
}
.cart-strip { position: static; border-radius: 12px; border: 1px solid var(--border); margin-bottom: 20px; }
@media (max-width: 600px) {
  .wrap.store > .topbar, .wrap.product-page > .topbar { flex-wrap: wrap; gap: 6px; }
  .wrap.store > .topbar > div:last-child { font-size: 0.9rem; }
  .wrap.wide { padding-left: 10px; padding-right: 10px; }
}
@media (max-width: 600px) {
  .admin-top { flex-wrap: wrap; gap: 6px; }
  .admin-top h1 { font-size: 1.5rem; }
  .admin-nav { flex-wrap: nowrap !important; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .admin-nav .btn { flex: 0 0 auto; }
  .menu-main { align-items: flex-start; }
  .wrap.wide > p.muted { font-size: 0.85rem; }
  .card { padding: 14px; }
}

/* Menu photos: small thumbnail beside the name on phones, full-width on top of the card on PC */
.menu-card.has-photo { position: relative; min-height: 128px; }
.menu-card.has-photo > h3, .menu-card.has-photo > p { margin-right: 100px; }
.menu-photo { position: absolute; top: 16px; right: 16px; width: 86px; height: 86px; border-radius: 10px; overflow: hidden; background: #f3ece3; }
.menu-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-photo { display: block; width: 100%; max-height: 260px; object-fit: cover; border-radius: 12px; margin: 4px 0 12px; }
@media (min-width: 960px) {
  .store-main .menu-card.has-photo { padding: 0 0 18px; overflow: hidden; }
  .store-main .menu-card.has-photo > :not(.menu-photo) { margin-left: 18px; margin-right: 18px; }
  .store-main .menu-card.has-photo > h3, .store-main .menu-card.has-photo > p { margin-right: 18px; }
  .store-main .menu-card.has-photo .menu-photo { position: static; width: auto; height: 170px; border-radius: 0; margin-bottom: 14px; }
  .product-photo { width: 360px; max-height: 270px; float: right; margin: 0 0 12px 20px; }
  .option-groups { clear: both; }
}

/* Photo placeholders (no photo, or a photo that fails to load) and photo editing */
.menu-photo { display: flex; align-items: center; justify-content: center; }
.menu-photo .ph-initial { display: none; }
.menu-photo.no-photo { background: linear-gradient(135deg, #fbe7d3, #f6d4b8); }
.menu-photo.no-photo .ph-initial { display: block; font-size: 2rem; font-weight: 700; color: rgba(154, 52, 18, .45); font-family: Georgia, serif; }
.prod-thumb { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; }
.photo-edit { display: flex; gap: 14px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.photo-edit img, .photo-edit .photo-none { width: 120px; height: 90px; border-radius: 8px; object-fit: cover; flex: 0 0 auto; }
.photo-none { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #fbe7d3, #f6d4b8); color: rgba(154, 52, 18, .6); font-size: 0.8rem; font-weight: 600; }
.photo-form { display: inline-block; margin: 4px 6px 0 0; }
.photo-form label.btn, .admin-photo-tools label.btn { cursor: pointer; }
.admin-photo-tools { display: flex; gap: 6px; margin: 0 0 12px; flex-wrap: wrap; }
.admin-photo-tools form { margin: 0; }
@media (min-width: 960px) { .store-main .menu-photo.no-photo .ph-initial { font-size: 3.6rem; } }
.lazy-body { min-height: 24px; }
.pos-form input[type=number] { width: 52px; padding: 1px 4px; font-size: 0.8rem; text-align: center; }
