/* Stallfront — "green grocer's ink on paper"
   Tokens: paper #FBFAF7 | ink (spruce) #22392E | radish #CF4127
           mustard #DFA320 | sage #7A9184 */

@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&display=swap");

:root {
  --paper: #FBFAF7;
  --ink: #22392E;
  --radish: #CF4127;
  --radish-dark: #B2371F;
  --mustard: #DFA320;
  --sage: #7A9184;
  --line: #D8DAD2;
  --display: "Fraunces", Georgia, serif;
  --body: system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 30rem; margin: 0 auto; padding: 1.25rem 1rem 6rem; }

h1, h2 { font-family: var(--display); font-weight: 700; line-height: 1.1; }
a { color: var(--ink); }
.muted { color: var(--sage); }

/* ---- flash messages ---- */
.flash {
  padding: .75rem 1rem;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  margin-bottom: 1rem;
  background: #fff;
  font-weight: 500;
}
.flash-error { border-color: var(--radish); color: var(--radish-dark); }

/* ---- forms ---- */
.stack { display: flex; flex-direction: column; gap: .9rem; border: 0; padding: 0; margin: 0; }
label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .95rem; }
input, select {
  font: inherit;
  color: var(--ink);
  padding: .65rem .75rem;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  background: #fff;
  min-height: 48px;
}
input:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid var(--mustard);
  outline-offset: 2px;
}
button {
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  border-radius: 6px;
  border: 1.5px solid var(--ink);
  background: #fff;
  color: var(--ink);
  padding: .65rem 1.1rem;
  min-height: 48px;
}
button.primary, .button.primary {
  background: var(--radish);
  border-color: var(--radish);
  color: #fff;
}
button.primary:hover { background: var(--radish-dark); }
button.ghost { border-color: var(--line); background: transparent; }
button.small { min-height: 36px; padding: .3rem .7rem; font-size: .85rem; }
.button {
  display: inline-block;
  text-decoration: none;
  font-weight: 700;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  padding: .55rem 1rem;
  background: #fff;
}

/* ---- public stall page ---- */
.stall-head { margin-bottom: 1.25rem; }
.stall-name {
  font-size: 2.3rem;
  margin: 0 0 .25rem;
  letter-spacing: -.01em;
}
.stall-blurb { margin: 0 0 .75rem; color: var(--sage); }
.stamp-line {
  margin: 0;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  padding: .45rem 0;
}
.cutoff-line { margin: .5rem 0 0; font-size: .85rem; color: var(--sage); }

.menu { list-style: none; margin: 0; padding: 0; }
.menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px dashed var(--line);
}
.menu-item-info { display: flex; flex-direction: column; gap: .15rem; }
.menu-item-name { font-weight: 700; }
.menu-item-desc { font-size: .85rem; color: var(--sage); }
.price {
  font-family: var(--display);
  font-weight: 700;
  color: var(--radish);
  font-size: 1.15rem;
}
.menu-item-action {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .35rem;
  flex-shrink: 0;
}
input.qty { width: 4.2rem; text-align: center; font-size: 1.1rem; font-weight: 700; }
.left-badge {
  font-size: .75rem;
  font-weight: 700;
  color: var(--ink);
  background: color-mix(in srgb, var(--mustard) 25%, white);
  border: 1px solid var(--mustard);
  border-radius: 999px;
  padding: .1rem .6rem;
  white-space: nowrap;
}
.left-badge.urgent { background: var(--mustard); }

.sold-out .menu-item-info { opacity: .45; }
.stamp {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .8rem;
  color: var(--radish);
  border: 2px solid var(--radish);
  border-radius: 4px;
  padding: .15rem .5rem;
  transform: rotate(-6deg);
}

.who { margin: 1.5rem 0; }
.who legend {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.2rem;
  padding: 0 0 .5rem;
}

.reserve-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--paper);
  border-top: 2px solid var(--ink);
  padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 30rem;
  margin: 0 auto;
}
.reserve-bar .total { font-size: 1rem; }
.reserve-bar .total strong { font-family: var(--display); font-size: 1.2rem; }
.reserve-bar button { flex: 1; }

.closed-notice {
  border: 1.5px dashed var(--sage);
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
}

/* ---- pickup ticket (signature) ---- */
.ticket {
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(34, 57, 46, .08);
  overflow: hidden;
  animation: ticket-in .45s cubic-bezier(.2, .9, .3, 1.1);
}
@keyframes ticket-in {
  from { transform: translateY(14px) rotate(-1.2deg); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .ticket { animation: none; }
}
.ticket-top { padding: 1.25rem 1.25rem 1rem; }
.ticket-eyebrow {
  margin: 0 0 .3rem;
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--sage);
}
.ticket-vendor { font-family: var(--display); font-size: 1.6rem; margin: 0 0 .6rem; }
.ticket-perforation {
  border-top: 2px dashed var(--line);
  position: relative;
  margin: 0 -1px;
}
.ticket-perforation::before, .ticket-perforation::after {
  content: "";
  position: absolute;
  top: -11px;
  width: 20px; height: 20px;
  background: var(--paper);
  border-radius: 50%;
}
.ticket-perforation::before { left: -11px; box-shadow: inset -2px 0 0 var(--line); }
.ticket-perforation::after { right: -11px; box-shadow: inset 2px 0 0 var(--line); }
.ticket-body { padding: 1.25rem; }
.ticket-code-label { margin: 0; font-size: .85rem; color: var(--sage); text-align: center; }
.ticket-code {
  font-family: var(--mono);
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-align: center;
  margin: .25rem 0 1rem;
}
.ticket-items { list-style: none; margin: 0 0 .75rem; padding: 0; }
.ticket-items li {
  display: flex;
  justify-content: space-between;
  padding: .35rem 0;
  border-bottom: 1px dotted var(--line);
  font-size: .95rem;
}
.ticket-total {
  display: flex;
  justify-content: space-between;
  margin: .5rem 0 1rem;
  font-size: .95rem;
}
.ticket-total strong { font-family: var(--display); font-size: 1.2rem; color: var(--radish); }
.ticket-instructions {
  margin: 0 0 .5rem;
  padding: .6rem .8rem;
  background: color-mix(in srgb, var(--sage) 12%, white);
  border-radius: 6px;
  font-size: .9rem;
}
.ticket-name { margin: 0; font-size: .85rem; color: var(--sage); }
.ticket-note { text-align: center; font-size: .85rem; color: var(--sage); }

/* ---- vendor & admin utility pages ---- */
.page-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.page-head h1 { font-size: 1.6rem; }
.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; margin: .75rem 0 1.25rem; }
.cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.card {
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: .9rem 1rem;
}
.card .row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.badge {
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-radius: 999px;
  padding: .12rem .6rem;
  border: 1px solid var(--ink);
}
.badge-open { background: var(--ink); color: var(--paper); }
.badge-draft { background: transparent; }
.badge-closed { background: var(--line); border-color: var(--line); }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); font-size: .95rem; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--sage); }
td.num, th.num { text-align: right; }

/* ---- print (pack & pickup lists, share ticket) ---- */
@media print {
  body { background: #fff; color: #000; }
  .wrap { max-width: none; padding: 0; }
  .no-print, .toolbar, .page-head form, .flash { display: none !important; }
  .card, table { border-color: #000; }
}
