.admin .brand small { font: 600 15px var(--body); color: #d9bfc4; margin-left: 4px; letter-spacing: 0; }
.admin .top .wrap { flex-wrap: wrap; height: auto; padding-top: 12px; padding-bottom: 8px; row-gap: 6px; }
.tabs { display: flex; gap: 2px; align-items: center; flex-wrap: nowrap; width: 100%; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; }
.tabs #logout { margin-left: auto; flex: none; text-align: right; }
.tabs .who { display: block; font-size: 12px; font-weight: 500; opacity: 0.8; }
.tabs [hidden] { display: none; }
.qty-unit { display: flex; align-items: center; gap: 6px; }
.qty-unit input { width: 100%; }
.qty-unit .unit { min-width: 34px; color: var(--muted); font-size: 14px; }
.recipe-row select { border: 1.5px solid var(--line); border-radius: var(--r-s); padding: 9px 8px; background: #fff; min-width: 0; }
.print-only { display: none; }
code { font-family: ui-monospace, Menlo, monospace; font-size: 13px; background: var(--wine-soft); padding: 2px 6px; border-radius: 6px; }
.recipe-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 86px auto; gap: 6px 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.recipe-row .rn { grid-column: 1 / -1; }
.recipe-row .new-ing { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; background: var(--gold-soft); border-radius: var(--r-s); padding: 10px 12px; font-size: 15px; }
.recipe-row input, .recipe-row select, .search, .toolbar select, .row-btns > select, input[type=month] { border: 1.5px solid var(--line); border-radius: var(--r-s); padding: 9px 10px; background: #fff; min-width: 0; width: 100%; }
.row-btns > .search { width: auto; flex: 1; min-width: 200px; }
.row-btns > select, input[type=month] { width: auto; }
.combo { position: relative; }
.combo-list { position: absolute; z-index: 15; left: 0; right: 0; top: calc(100% + 4px); max-height: 300px; overflow-y: auto; background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-s); box-shadow: 0 8px 24px rgba(36, 22, 26, 0.12); }
.combo-group { font-size: 12px; font-weight: 700; color: var(--muted); padding: 8px 12px 4px; position: sticky; top: 0; background: #fff; }
.combo-opt { padding: 8px 12px; cursor: pointer; font-size: 15px; }
.combo-opt.active, .combo-opt:hover { background: var(--wine-soft); }
.combo-new { color: var(--wine); font-weight: 700; border-top: 1px solid var(--line); }
.photo-row { display: flex; gap: 14px; align-items: center; }
.photo-preview { width: 96px; height: 96px; border-radius: var(--r-m); background: var(--wine-soft); display: grid; place-items: center; overflow: hidden; flex: none; font-size: 12px; color: var(--muted); text-align: center; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.receipt { margin-bottom: 10px; padding: 14px 16px; }
.r-head { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; }
.r-thumb { width: 64px; height: 64px; border-radius: 10px; background: var(--wine-soft); display: grid; place-items: center; overflow: hidden; color: var(--muted); font-weight: 700; text-decoration: none; }
.r-thumb img { width: 100%; height: 100%; object-fit: cover; }
.r-amt { text-align: right; font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.r-amt .small-btn { margin-top: 6px; font-size: 14px; font-weight: 600; }
.r-items { list-style: none; padding: 0; margin: 8px 0 0; }
.r-items li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.pill.purchase { background: var(--gold-soft); }
.pill.expense { background: #e1ecf7; }
.pill.capex { background: #e6e0f5; }
.kinds-help { margin-top: 12px; font-size: 15px; }
.kinds-help summary { cursor: pointer; font-weight: 700; color: var(--wine); }
.kinds-help p { margin: 8px 0 0; }
tr.total td { background: var(--ivory); border-top: 2px solid var(--ink); }
.upload { margin-bottom: 18px; }
/* Menu calendar */
.cal-head { display: flex; align-items: center; gap: 12px; margin: 6px 0 10px; }
.cal-head h2 { margin: 0; font-size: 22px; min-width: 180px; text-align: center; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-dow { font-size: 13px; font-weight: 700; color: var(--muted); text-align: center; padding: 4px 0; }
.cal-day { min-height: 92px; border-radius: var(--r-s); background: transparent; border: 1px solid transparent; padding: 8px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; font: inherit; color: var(--muted); }
.cal-day.out { opacity: 0.4; }
button.cal-day { cursor: pointer; }
.cal-day.deliv { background: #fff; border-color: var(--line); color: var(--ink); }
.cal-day.has { background: var(--gold-soft); border-color: var(--gold); }
.cal-day.past { opacity: 0.65; }
.cal-day.sel { box-shadow: 0 0 0 3px var(--wine); border-color: var(--wine); opacity: 1; }
.cal-day.today .cal-date { background: var(--wine); color: var(--ivory); border-radius: 999px; padding: 0 7px; }
.cal-date { font-weight: 700; font-size: 15px; }
.cal-n { font: 800 18px var(--display); color: var(--wine-deep); margin-top: auto; }
.cal-unit { font: 600 12px var(--body); }
.cal-sold { font-size: 12px; color: var(--muted); }
.cal-plan { margin-top: auto; font-size: 13px; font-weight: 700; color: var(--wine); }
.cal-legend { display: flex; gap: 8px 16px; align-items: center; font-size: 13px; margin: 10px 0 18px; flex-wrap: wrap; }
.cal-legend .lg { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: -10px; vertical-align: -2px; border: 1px solid var(--line); background: #fff; }
.cal-legend .lg.has { background: var(--gold-soft); border-color: var(--gold); }
.day-editor .dd-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--muted); padding: 0 4px 6px; border-bottom: 1px solid var(--line); }
.dd-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.dd-name { display: flex; align-items: center; gap: 10px; cursor: pointer; flex: 1; min-width: 0; }
.dd-name input { width: 22px; height: 22px; accent-color: var(--wine); flex: none; }
.dd-name img, .dd-name .thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; font-size: 18px; }
.dd-limit { width: 110px; border: 1.5px solid var(--line); border-radius: var(--r-s); padding: 9px 10px; background: #fff; text-align: right; }
.dd-limit:disabled { background: #f5f0ec; color: transparent; }
@media (max-width: 600px) {
  .cal { gap: 3px; }
  .cal-day { min-height: 64px; padding: 5px; }
  .cal-unit, .cal-sold { display: none; }
  .cal-plan { font-size: 20px; line-height: 1; }
  .cal-head h2 { min-width: 0; flex: 1; font-size: 19px; }
  .dd-limit { width: 92px; }
}
.field input[type=checkbox] { width: auto; margin: 0 8px 0 0; vertical-align: -2px; accent-color: var(--wine); }
.field label:has(input[type=checkbox]) { font-weight: 600; cursor: pointer; }
.t.shop { table-layout: fixed; }
.t.shop th:first-child { width: 38%; }
.t.shop th:nth-child(3) { width: 12%; }
.t.shop th:last-child { width: 22%; }
.tabs a, .tabs button { color: #e8d3d6; text-decoration: none; padding: 8px 12px; border-radius: 999px; font-weight: 600; background: none; border: 0; cursor: pointer; font-size: 15px; }
.tabs a.on { background: var(--ivory); color: var(--wine-deep); }
.tabs button { opacity: 0.75; }
.admin .page { padding-top: 24px; }
.admin h1 { font-size: 34px; margin-bottom: 16px; }
.login { max-width: 380px; margin: 40px auto; }
.dates { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; align-items: stretch; }
.dates button { flex: none; border: 1.5px solid var(--line); background: #fff; border-radius: var(--r-s); padding: 8px 14px; text-align: left; cursor: pointer; }
.dates button b { display: block; }
.dates button span { font-size: 13px; color: var(--muted); }
.dates button.on { border-color: var(--wine); background: var(--wine); color: var(--ivory); }
.dates button.on span { color: #e6cdd1; }
.dates input { border: 1.5px solid var(--line); border-radius: var(--r-s); padding: 8px 10px; background: #fff; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin: 6px 0 18px; }
.seg { display: inline-flex; border: 1.5px solid var(--wine); border-radius: 999px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 8px 16px; font-weight: 700; color: var(--wine); cursor: pointer; }
.seg button.on { background: var(--wine); color: var(--ivory); }
.small-btn { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px; font-weight: 600; cursor: pointer; text-decoration: none; color: var(--ink); font-size: 15px; }
.stats { display: flex; flex-wrap: wrap; gap: 28px; margin-bottom: 18px; }
.stats div { font-size: 14px; color: var(--muted); }
.stats b { display: block; font: 800 28px/1.1 var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
table.t { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; font-size: 15px; }
.t th, .t td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.t th { background: var(--wine-soft); font-weight: 700; font-size: 14px; }
.t td.n, .t th.n { text-align: right; font-variant-numeric: tabular-nums; }
.t tr:last-child td { border-bottom: 0; }
.t select { border: 1.5px solid var(--line); border-radius: var(--r-s); padding: 5px 6px; background: #fff; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--mist, #f3edea); }
.pill.paid { background: var(--gold-soft); }
.pill.preparing { background: #e1ecf7; }
.pill.out_for_delivery { background: #e6e0f5; }
.pill.delivered { background: var(--wine-soft); color: var(--wine-deep); }
.pill.cancelled, .pill.pending_payment { background: #f3efec; color: var(--muted); }
.muted { color: var(--muted); }
details.more { margin-top: 22px; }
details.more summary { cursor: pointer; font-weight: 700; padding: 8px 0; }
.run h2 { font-size: 22px; margin: 26px 0 10px; }
.stop { background: #fff; border: 1px solid var(--line); border-radius: var(--r-m); padding: 16px; margin-bottom: 10px; display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; }
.stop .who { font-weight: 700; font-size: 18px; }
.stop .addr { font-size: 16px; }
.stop .items { grid-column: 1 / -1; color: var(--muted); font-size: 15px; display: block; }
.stop .note { grid-column: 1 / -1; background: var(--gold-soft); border-radius: var(--r-s); padding: 6px 10px; font-size: 15px; }
.stop .acts { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.prod-list .t td img, .prod-list .thumb { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; font-size: 22px; }
.editor { margin-bottom: 24px; }
.editor .fields { margin-bottom: 14px; }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.danger { color: var(--chilli); }
.slot-row { display: grid; grid-template-columns: 1fr 120px auto; gap: 8px; margin-bottom: 8px; align-items: center; }
.slot-row input { border: 1.5px solid var(--line); border-radius: var(--r-s); padding: 9px 10px; background: #fff; }
.daypick { display: flex; flex-wrap: wrap; gap: 8px; }
.daypick label { border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 14px; cursor: pointer; background: #fff; font-weight: 600; }
.daypick input { margin-right: 6px; accent-color: var(--wine); }
.settings-grid { display: grid; gap: 22px; max-width: 760px; }
.settings-grid h2 { font-size: 22px; margin-bottom: 10px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 200%); visibility: hidden; background: var(--ink); color: var(--ivory); padding: 12px 20px; border-radius: 999px; font-weight: 600; transition: transform 0.2s ease, visibility 0.2s; z-index: 20; }
.toast.show { transform: translate(-50%, 0); visibility: visible; }
.preview-note { background: var(--gold-soft); border-radius: var(--r-s); padding: 10px 14px; margin-bottom: 18px; font-size: 15px; }

@media (max-width: 720px) {
  .recipe-row { grid-template-columns: minmax(0, 1fr) 76px 76px; }
  .recipe-row [data-rm] { grid-column: 3; justify-self: end; }
  .recipe-row .rn { grid-column: 1 / 3; }
  .r-head { grid-template-columns: 52px 1fr auto; }
  .r-thumb { width: 52px; height: 52px; }
  .top .wrap { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; gap: 6px; }
  /* Tables become labelled cards */
  table.t.cards, .t.cards tbody { display: block; background: none; border: 0; }
  .t.cards thead { display: none; }
  .t.cards tr { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--r-m); padding: 12px 14px; margin-bottom: 10px; }
  .t.cards td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border: 0; padding: 4px 0; text-align: right; }
  .t.cards td::before { content: attr(data-label); color: var(--muted); font-size: 14px; font-weight: 600; text-align: left; flex: none; max-width: 45%; }
  .t.cards td[data-label=""]::before { display: none; }
  .t.cards td:first-child, .t.cards td[data-label=""] { justify-content: flex-start; text-align: left; }
  .t.cards td:first-child::before { display: none; }
  .t.cards td:first-child { font-size: 17px; padding-bottom: 6px; }
  .t.cards td:has(> img), .t.cards td:has(> .thumb) { float: right; padding: 0 0 0 10px; }
  .t.cards td select, .t.cards td .small-btn, .t.cards td .row-btns { margin-left: auto; }
  .t.cards tr.total { background: var(--wine-soft); }
  .stats { gap: 14px 22px; }
  .stats b { font-size: 24px; }
  .admin h1 { font-size: 28px; }
  .slot-row { grid-template-columns: 1fr 90px auto; }
}
/* Phones and iPads in portrait: bottom tab bar like an app */
.tabbar, .sheet-backdrop { display: none; }
@media (max-width: 900px) {
  .admin .tabs { display: none !important; }
  .tabbar:not([hidden]) { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: rgba(255, 255, 255, 0.96); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 6px; color: var(--muted); text-decoration: none; font: 600 12px var(--body); background: none; border: 0; min-height: 56px; }
  .tabbar a.on, .tabbar button.on { color: var(--wine); }
  .tabbar a.on svg, .tabbar button.on svg { stroke-width: 2.3; }
  body.admin:has(.tabbar:not([hidden])) { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  body.admin:has(.tabbar:not([hidden])) .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  body.admin:has(.tabbar:not([hidden])) .install-chip { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .sheet-backdrop:not([hidden]) { display: flex; align-items: flex-end; position: fixed; inset: 0; z-index: 50; background: rgba(36, 22, 26, 0.35); }
  .sheet { width: 100%; background: #fff; border-radius: 18px 18px 0 0; padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); display: grid; animation: sheet-up 0.2s ease; }
  .sheet-handle { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 10px; }
  .sheet a, .sheet button { padding: 15px 6px; font: 600 17px var(--body); color: var(--ink); text-decoration: none; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; }
  .sheet a.on { color: var(--wine); }
  .sheet a[hidden] { display: none; }
  .sheet button { border-bottom: 0; color: var(--muted); }
  .sheet .who { display: block; font-size: 13px; font-weight: 500; }
  .admin .top .wrap { padding-top: 10px; padding-bottom: 10px; }
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@media (pointer: coarse) {
  .small-btn { min-height: 40px; padding: 8px 14px; }
  .seg button { min-height: 40px; }
  .dates button { min-height: 56px; }
  .tabs a, .tabs button { padding: 10px 14px; }
}
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }

@media print {
  .print-only { display: block; }
  .top, .dates, .toolbar, .tabs, .tabbar, .acts, .no-print, .toast, .install-chip { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .page { padding: 0; }
  .stop, table.t { border-color: #999; break-inside: avoid; }
}
