/* Order portal styles. Brand colour comes from Settings (--accent). */
/* Fonts are self-hosted (no Google Fonts call, good for privacy). Both free under the SIL Open Font License. */
@font-face { font-family: 'Familjen Grotesk'; src: url('/static/fonts/familjen-grotesk-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Familjen Grotesk'; src: url('/static/fonts/familjen-grotesk-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Familjen Grotesk'; src: url('/static/fonts/familjen-grotesk-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Atkinson Hyperlegible'; src: url('/static/fonts/atkinson-hyperlegible-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Atkinson Hyperlegible'; src: url('/static/fonts/atkinson-hyperlegible-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
:root {
  --bg: #F1E8DA;          /* beige */
  --surface: #FBF7F0;     /* warm off-white */
  --ink: #2E1F17;         /* dark date brown */
  --muted: #7A6655;
  --line: #E0D2BF;
  --line-soft: #ECE2D4;
  --stamp: #4A2E1E;       /* medjool brown: delivery ticket & "new" labels */
  --stamp-ink: #F6EBDC;
  --sand: #D8BE97;
  --danger: #A23A26;
  --ok: #5E6B3A;
  --radius-s: 8px;
  --radius-m: 14px;
  --head: 'Familjen Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --body: 'Atkinson Hyperlegible', 'Segoe UI', Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 var(--body);
}
h1, h2, h3 { font-family: var(--head); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: 2rem; font-weight: 700; }
h2 { font-size: 1.35rem; font-weight: 600; margin-top: 1.6em; }
h3 { font-size: 1.05rem; font-weight: 600; }
a { color: var(--accent); }
p { margin: 0 0 .75em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.pre { white-space: pre-line; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Top bar ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.ticket-stub .ticket-countdown { color: var(--sand); }
.topbar-inner { max-width: 880px; margin: 0 auto; padding: 10px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.topbar-inner.wide, main.wide { max-width: 1180px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--stamp); font: 700 1.3rem var(--head); letter-spacing: -0.02em; margin-right: auto; }
.brand img { height: 32px; width: auto; }
.admin-tag { font: 600 .75rem var(--body); background: var(--ink); color: var(--surface); padding: 2px 8px; border-radius: 99px; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.nav a, .linkish { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: var(--radius-s); font: inherit; font-size: .95rem; background: none; border: 0; cursor: pointer; }
.nav a:hover, .linkish:hover { color: var(--ink); background: var(--bg); }
.nav a.active { color: var(--ink); font-weight: 700; box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.logout { margin: 0; }

main { max-width: 880px; margin: 0 auto; padding: 24px 16px 120px; }

/* ---------- Buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: 700 .95rem var(--body); padding: 10px 16px; min-height: 44px;
  border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.btn.small { min-height: 34px; padding: 5px 12px; font-size: .875rem; }
.btn.big { width: 100%; min-height: 54px; font-size: 1.05rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }

label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: .9rem; }
.label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
input, select, textarea {
  font: 400 1rem var(--body); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; min-height: 44px; width: 100%;
}
textarea { resize: vertical; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); margin: 0; }
input[type=color] { padding: 4px; height: 44px; }
label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 400; }
.hint { font-weight: 400; color: var(--muted); font-size: .85rem; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.narrow { max-width: 380px; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } .span2 { grid-column: span 2; } }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px; margin: 0; background: var(--surface); }
legend { font: 600 1.05rem var(--head); padding: 0 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 20px 0; }
.actions form { margin: 0; }

.flash { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-left: 4px solid var(--accent); padding: 12px 14px; border-radius: var(--radius-s); }
.errors { background: #F7E4DC; border-left: 4px solid var(--danger); color: #5C1510; padding: 12px 14px; border-radius: var(--radius-s); margin-bottom: 16px; }
.errors ul { margin: 0; padding-left: 18px; }
.errors p { margin: 0; }
.empty { background: var(--surface); border: 1px dashed var(--line); padding: 20px; border-radius: var(--radius-m); color: var(--muted); }

/* ---------- Login ---------- */
.login { max-width: 420px; margin: 6vh auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 28px 24px; }

/* ---------- Delivery ticket (the order page hero) ---------- */
.ticket {
  display: grid; grid-template-columns: 1fr auto; background: var(--surface);
  border-radius: var(--radius-m); overflow: hidden; border: 1px solid var(--line); margin-bottom: 16px;
}
.ticket-main { padding: 20px 20px 18px; }
.ticket-label { margin: 0 0 4px; color: var(--muted); font-weight: 700; font-size: .9rem; }
.ticket-date { font: 700 clamp(2rem, 7vw, 3.2rem)/1 var(--head); margin: 0; letter-spacing: -0.03em; }
.ticket-date span { display: block; color: var(--accent); }
.ticket-stub {
  position: relative; background: var(--stamp); color: var(--stamp-ink); padding: 18px 20px 16px 24px;
  display: flex; flex-direction: column; justify-content: center; min-width: 150px;
  /* perforated edge */
  background-image: radial-gradient(circle at 0 8px, var(--surface) 4px, transparent 4.5px);
  background-size: 8px 16px; background-repeat: repeat-y;
}
.ticket-stub p { margin: 0; font-size: .9rem; }
.ticket-time { font: 700 2.2rem/1.05 var(--head) !important; letter-spacing: -0.02em; }
.ticket-countdown { margin-top: 8px !important; font-weight: 700; padding-top: 8px; border-top: 1px solid color-mix(in srgb, var(--stamp-ink) 25%, transparent); }
.ticket-empty .ticket-date { font-size: 1.8rem; }
@media (max-width: 520px) {
  .ticket { grid-template-columns: 1fr; }
  .ticket-stub { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 14px 18px;
    background-image: radial-gradient(circle at 8px 0, var(--surface) 4px, transparent 4.5px); background-size: 16px 8px; background-repeat: repeat-x; }
  .ticket-time { font-size: 1.6rem !important; }
  .ticket-countdown { flex-basis: 100%; }
}
.welcome { color: var(--muted); max-width: 62ch; }

/* ---------- Order sheet ---------- */
.toolbar { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 10px 0; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters { display: flex; gap: 6px; overflow-x: auto; flex: 1 1 auto; padding-bottom: 2px; scrollbar-width: none; }
.chip { font: 700 .9rem var(--body); white-space: nowrap; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 7px 14px; border-radius: 99px; cursor: pointer; min-height: 38px; }
.chip[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.chip .count { font-weight: 400; opacity: .7; margin-left: 2px; }
.search { flex: 1 1 220px; max-width: 320px; min-height: 40px; padding: 8px 12px; }
@media (max-width: 560px) { .search { max-width: none; } }

.category h2 { margin: 1.2em 0 .5em; }
.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); }
.product { padding: 16px; border-top: 1px solid var(--line); }
.product:first-child { border-top: 0; }
.sheet .product:not([hidden]) ~ .product:not([hidden]) { border-top: 1px solid var(--line); }
.product-head { display: grid; grid-template-columns: 1fr auto auto; gap: 4px 14px; align-items: start; }
.product-head .thumb { grid-row: span 2; width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-s); }
.product-head:has(.thumb) { grid-template-columns: 64px 1fr auto auto; }
.product h3 { margin: 0 0 2px; font-size: 1.15rem; }
.desc { margin: 0; color: var(--muted); font-size: .92rem; max-width: 60ch; }
.price { margin: 0; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price .unit { display: block; font-weight: 400; color: var(--muted); font-size: .82rem; }
.fav { border: 0; background: none; cursor: pointer; font-size: 1.35rem; line-height: 1; color: var(--line); padding: 4px; border-radius: var(--radius-s); width: 36px; height: 36px; }
.fav[aria-pressed=true] { color: #C08A3E; }
.fav:hover { color: var(--sand); }

.lines { list-style: none; margin: 12px 0 0; padding: 0; }
.lines li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0 6px 12px; border-left: 3px solid var(--line-soft); }
.lines li + li { margin-top: 2px; }
.lines li.has-qty { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.lines li.has-qty .flavour { font-weight: 700; }
.flavour { flex: 1; }
.stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); overflow: hidden; }
.stepper input { width: 56px; min-height: 40px; text-align: center; border: 0; border-radius: 0; padding: 6px 2px; font-weight: 700; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.step { width: 40px; height: 40px; border: 0; background: var(--bg); font-size: 1.25rem; cursor: pointer; color: var(--ink); }
.step:hover { background: var(--line-soft); }

/* Review */
.review { margin-top: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 20px; scroll-margin-top: 70px; }
.review h2 { margin-top: 0; }
.review-grid { display: grid; gap: 24px; }
@media (min-width: 720px) { .review-grid { grid-template-columns: 1fr 1fr; } }
.review-left { display: flex; flex-direction: column; gap: 16px; }
.dates { border: 0; padding: 0; background: none; }
.dates legend { font: 700 .9rem var(--body); padding: 0; margin-bottom: 6px; }
.date-options { display: grid; gap: 6px; }
.date-option { flex-direction: row; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; cursor: pointer; font-weight: 400; }
.date-option:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.date-day { font-weight: 700; min-width: 100px; }
.date-close { color: var(--muted); font-size: .85rem; margin-left: auto; text-align: right; }
.summary { list-style: none; padding: 0; margin: 0 0 12px; border-bottom: 1px solid var(--line); }
.summary li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: .95rem; font-variant-numeric: tabular-nums; }
.totals { margin: 0 0 12px; }
.totals div { display: flex; justify-content: space-between; padding: 3px 0; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.totals .grand { font: 700 1.25rem var(--head); padding-top: 8px; }
.totals .grand dt { color: var(--ink); }
.min-note { font-size: .9rem; color: var(--muted); }
.min-note.warn { color: var(--ink); background: color-mix(in srgb, var(--sand) 45%, var(--surface)); padding: 8px 10px; border-radius: var(--radius-s); }

.cartbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--ink); color: var(--surface);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px max(16px, calc((100vw - 848px) / 2)); transform: translateY(110%); transition: transform .2s ease;
}
.cartbar.visible { transform: none; }
.cartbar div { display: flex; flex-direction: column; }
.cartbar strong { font: 700 1.2rem var(--head); font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .cartbar { transition: none; } }

.admin-banner { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; background: var(--sand); color: var(--ink); padding: 14px 16px; border-radius: var(--radius-m); margin-bottom: 16px; }
.admin-banner p { margin: 0; }

/* ---------- Orders ---------- */
.order-list { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); }
.order-list li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
.order-list li:first-child { border-top: 0; }
.order-link { flex: 1; display: grid; grid-template-columns: 70px 1fr auto auto; gap: 4px 14px; align-items: center; color: var(--ink); text-decoration: none; }
.order-num { font-weight: 700; }
.order-total { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }
.order-items { grid-column: 2; grid-row: 2; font-size: .875rem; }
@media (max-width: 560px) {
  .order-list li { flex-wrap: wrap; }
  .order-link { grid-template-columns: 1fr auto; }
  .order-items { grid-column: 1; grid-row: auto; }
}
.pill { display: inline-block; font-size: .8rem; font-weight: 700; padding: 2px 10px; border-radius: 99px; white-space: nowrap; }
.pill-new { background: var(--stamp); color: var(--stamp-ink); }
.pill-confirmed { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); color: var(--accent); }
.pill-delivered { background: var(--line-soft); color: var(--muted); }
.pill-cancelled { background: #F3DED6; color: var(--danger); text-decoration: line-through; }

.placed { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--accent); border-radius: var(--radius-m); padding: 20px; margin-bottom: 20px; }
.placed h1 { color: var(--accent); }
.order-meta { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 12px 0; }
.order-meta p { margin: 0; display: flex; flex-direction: column; }
.order-meta .muted { font-size: .85rem; }
.items { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; margin: 12px 0; }
.items th, .items td { padding: 10px 14px; text-align: left; border-top: 1px solid var(--line-soft); }
.items thead th { border-top: 0; font-size: .85rem; color: var(--muted); }
.items tfoot td { color: var(--muted); }
.items tfoot .grand td { color: var(--ink); font: 700 1.1rem var(--head); }
.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.note { background: var(--surface); border: 1px solid var(--line); padding: 12px 14px; border-radius: var(--radius-s); display: flex; flex-direction: column; }
.note .muted { font-size: .85rem; }
.details { display: grid; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); margin: 0 0 12px; }
.details div { display: grid; grid-template-columns: 160px 1fr; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line-soft); }
.details div:first-child { border-top: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }

/* ---------- Admin ---------- */
.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.page-head h1 { margin: 0; }
.page-head .actions { margin: 0; }
.crumb { margin: 0 0 4px; font-size: .9rem; }
.crumb a { color: var(--muted); }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 16px 0; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; font-weight: 700; }
.tabs a.active { color: var(--ink); border-bottom-color: var(--accent); }
.tabs .count { font-weight: 400; margin-left: 6px; font-size: .85rem; }
.filterbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 0 0 16px; }
.filterbar label { min-width: 170px; }
.filterbar .linkish { align-self: center; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); }
.data { width: 100%; border-collapse: collapse; font-size: .95rem; }
.data th { text-align: left; font-size: .85rem; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data td { padding: 10px 12px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
.data tr.inactive td { color: var(--muted); }
.data a { color: var(--ink); }
.data.compact td { padding: 6px 8px; }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions form { display: inline; margin: 0; }
.tag { display: inline-block; margin-left: 8px; font-size: .75rem; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent); }
.price-input { max-width: 120px; }
.inline-select { display: flex; gap: 8px; }
.inline-select select { width: auto; }
.danger-zone { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); }
.password-box { background: var(--surface); border: 2px solid var(--accent); border-radius: var(--radius-m); padding: 16px; margin-bottom: 20px; }
.password-box pre { font: 700 1rem var(--body); background: var(--bg); padding: 12px; border-radius: var(--radius-s); white-space: pre-wrap; margin: 0 0 10px; }
.daypicker { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.flavours-edit { background: var(--bg); }
.flavours-edit .data { background: var(--surface); margin-bottom: 12px; border-radius: var(--radius-s); }
.blocked { list-style: none; padding: 0; margin: 0 0 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); }
.blocked li { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; border-top: 1px solid var(--line-soft); }
.blocked li:first-child { border-top: 0; }
.blocked form { margin: 0; }

/* Packing */
.per-customer { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.pack-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px; break-inside: avoid; }
.pack-card header { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-bottom: 6px; }
.pack-card ul { list-style: none; padding: 0; margin: 8px 0; }
.pack-card li { display: flex; gap: 8px; align-items: baseline; padding: 3px 0; }
.tick { width: 14px; height: 14px; border: 1.5px solid var(--muted); border-radius: 3px; flex: none; transform: translateY(2px); }
.print-title { margin-top: 0; }
main h3 { margin-top: 1.6em; }
main .product h3, .pack-card h3 { margin-top: 0; }

@media print {
  body { background: #fff; }
  .topbar, .no-print, .flash { display: none !important; }
  main { padding: 0; max-width: none; }
  .table-wrap, .pack-card { border-color: #999; }
}
.login form { margin-bottom: 16px; }
.sub { display: block; font-size: .82rem; font-weight: 400; color: var(--muted); }
.to-agree .sub, .pack-day.to-agree { color: #8A5A1E; }
.pack-day { margin: 0 0 4px; font-size: .9rem; }
.ticket-note { margin: 10px 0 0; color: var(--muted); font-size: .9rem; max-width: 46ch; }
.deliver-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px 14px; align-items: flex-end; }
.deliver-form .muted { align-self: center; }
.daypicker + .hint, .label + .hint { display: block; margin: -2px 0 6px; }
/* ---------- Hours ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px; margin-bottom: 24px; }
.panel h2 { margin-top: 0; }
.hours-form { display: flex; flex-direction: column; gap: 14px; }
.hours-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 720px) { .hours-grid { grid-template-columns: 1.3fr 1fr 1fr 1fr; } }
.hours-total { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 10px 14px; background: var(--bg); border-radius: var(--radius-s); }
.hours-total strong { font: 700 1.6rem var(--head); font-variant-numeric: tabular-nums; }
.hours-form .actions { margin: 0; }
.hours-head { margin-top: 8px; }
.hours-head h2 { margin: 0; }
.monthnav { display: flex; align-items: center; gap: 10px; }
.monthnav b { min-width: 130px; text-align: center; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0 16px; }
.stats p { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px 14px; display: flex; flex-direction: column; }
.stats .muted { font-size: .85rem; }
.stats strong { font: 700 1.5rem var(--head); font-variant-numeric: tabular-nums; }
.pill-h-pending { background: color-mix(in srgb, var(--sand) 55%, var(--surface)); color: var(--ink); }
.pill-h-approved { background: color-mix(in srgb, var(--ok) 18%, var(--surface)); color: var(--ok); }
.pill-h-rejected { background: #F3DED6; color: var(--danger); }
.summary-table { margin-bottom: 8px; }
.reject { display: inline-block; position: relative; }
.reject summary { list-style: none; }
.reject summary::-webkit-details-marker { display: none; }
.reject[open] .reject-form { position: absolute; right: 0; top: 40px; z-index: 3; display: flex; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 8px; width: 320px; box-shadow: 0 6px 20px rgba(46,31,23,.12); }
.reject-form input { min-height: 34px; padding: 4px 8px; font-size: .9rem; }
.hours-table .row-actions { white-space: nowrap; }
@media (max-width: 600px) {
  .hours-mine thead { display: none; }
  .hours-mine tr { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "date net" "time brk" "status status" "act act"; gap: 2px 12px; padding: 12px 14px; border-top: 1px solid var(--line-soft); }
  .hours-mine tr:first-child { border-top: 0; }
  .hours-mine td { border: 0; padding: 0; }
  .hours-mine td:nth-child(1) { grid-area: date; }
  .hours-mine td:nth-child(2) { grid-area: time; color: var(--muted); }
  .hours-mine td:nth-child(3) { grid-area: brk; color: var(--muted); }
  .hours-mine td:nth-child(4) { grid-area: net; font-size: 1.1rem; }
  .hours-mine td:nth-child(5) { grid-area: status; margin-top: 6px; }
  .hours-mine td:nth-child(6) { grid-area: act; text-align: left; margin-top: 6px; }
  .hours-mine td:nth-child(6):empty { display: none; }
  .stats strong { font-size: 1.2rem; }
}
.total-row td { border-top: 2px solid var(--line); }
/* ---------- Insights & weekly order ---------- */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 99px; overflow: hidden; background: var(--surface); }
.seg a { padding: 6px 14px; text-decoration: none; color: var(--muted); font-weight: 700; font-size: .9rem; }
.seg a.active { background: var(--ink); color: var(--surface); }
.insight-grid { display: grid; gap: 16px; }
@media (min-width: 860px) { .insight-grid { grid-template-columns: 1fr 1fr; } }
.insight-grid .panel { margin-bottom: 0; }
.panel + .panel, .insight-grid + .panel { margin-top: 16px; }
.panel .page-head h2 { margin: 0; }
.table-wrap.flat { border: 0; border-radius: 0; background: transparent; }
.stats small { font-size: .9rem; font-weight: 400; color: var(--muted); }
.bars { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.bars li { display: grid; grid-template-columns: minmax(120px, 1.2fr) 2fr auto; gap: 10px; align-items: center; }
.bar-track { height: 14px; background: var(--line-soft); border-radius: 4px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.bar-value { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 2.5ch; text-align: right; }
@media (max-width: 560px) { .bars li { grid-template-columns: 1fr auto; } .bar-track { grid-column: 1 / -1; grid-row: 2; } }
.matrix th, .matrix td { white-space: nowrap; }
.matrix td.zero { color: var(--line); }
.matrix th .sub { display: block; font-weight: 400; }
.standing-cta h2, .standing-intro h1 { margin-top: 0; }
.standing-status { border-top: 1px solid var(--line-soft); margin-top: 12px; padding-top: 12px; }
.standing-status .actions { margin: 8px 0 0; }
.order-num .tag { margin-left: 6px; }
.ticket-range { margin: 6px 0 0; font: 600 1.05rem var(--head); color: var(--accent); }
.insight-grid .panel + .panel { margin-top: 0; }
@media (max-width: 600px) {
  .matrix th:first-child, .matrix td:first-child { white-space: normal; min-width: 130px; position: sticky; left: 0; background: var(--surface); }
}
.ticket-range { white-space: nowrap; }
/* My orders: fixed columns so totals, labels and buttons line up on every row */
.order-link { grid-template-columns: 80px 1fr 110px 120px; }
.order-link .order-num { grid-row: 1 / span 2; align-self: center; }
.order-link .order-total { grid-column: 3; grid-row: 1 / span 2; align-self: center; }
.order-link .pill { grid-column: 4; grid-row: 1 / span 2; align-self: center; justify-self: start; }
.order-list li > .btn { flex: none; width: 130px; }
@media (max-width: 560px) {
  .order-link { grid-template-columns: 1fr auto; }
  .order-link .order-num { grid-row: auto; }
  .order-link .order-total { grid-column: 2; grid-row: 1; align-self: start; }
  .order-link .pill { grid-column: 2; grid-row: 2; justify-self: end; align-self: start; }
  .order-list li > .btn { width: 100%; }
}
.cost-note { font-size: .88rem; color: var(--muted); margin: 6px 0 12px; }
.items + .cost-note { margin-top: -4px; }

/* Dietary labels */
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tag-diet { display: inline-block; font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 99px;
  background: color-mix(in srgb, var(--ok) 13%, var(--surface)); color: #4C5830; border: 1px solid color-mix(in srgb, var(--ok) 25%, transparent); }
.flavour .tags { margin-top: 2px; }
.flavour-labels td { padding-top: 0 !important; border-top: 0 !important; }
.flavour-labels .check { display: inline-flex; margin: 4px 12px 4px 0; font-size: .85rem; }
.flavour-labels input[type=checkbox] { width: 16px; height: 16px; }
.filters-diet { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; }
.chip.diet[aria-pressed=true] { background: #4C5830; border-color: #4C5830; }
.allergen-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }

.tag-group { margin-left: 0; background: color-mix(in srgb, var(--sand) 45%, var(--surface)); color: var(--ink); }
.rename-form { display: flex; gap: 8px; align-items: center; }
.rename-form input { max-width: 220px; min-height: 36px; padding: 6px 10px; }
.auto-notice { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--stamp); border-radius: var(--radius-s); padding: 12px 14px; margin-bottom: 16px; }
.auto-notice p { margin: 0; }
.auto-notice .actions { margin: 10px 0 0; }

/* Login screen with logo */
main.bare { padding-bottom: 24px; }
/* Logo + card centred on the page, a touch above the middle (looks more balanced) */
.login-wrap { padding-bottom: 4vh; min-height: calc(100vh - 48px); min-height: calc(100svh - 48px); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.login-wrap .login { width: 100%; }
.login-logo { display: block; width: 170px; height: auto; margin: 0 auto 28px; }
.login-logo + .login { margin-top: 0; }
.login-tagline { font-size: 1.05rem; margin-bottom: 1.1em; }
