:root {
  --bg: #fbf7ee;
  --surface: #ffffff;
  --band: #efe5cb;
  --ink: #2b2118;
  --quiet: #6f6355;
  --line: #e3d9c4;
  --accent: #66761f;
  --accent-ink: #ffffff;
  --danger: #a3261b;
  --ok-bg: #eef4e4;
  --err-bg: #fbe9e6;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --page: 1120px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 var(--sans);
}

main {
  max-width: var(--page);
  margin: 0 auto;
  padding: 16px 20px 64px;
}

h1,
h2,
h3,
.brand {
  font-family: var(--serif);
  line-height: 1.2;
}

h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin: 0.6em 0 0.3em;
  /* A long word in a drop title wraps instead of pushing the page wider than a phone. */
  overflow-wrap: anywhere;
}

h2 {
  font-size: 1.5rem;
  margin: 1.8em 0 0.6em;
}

h3 {
  font-size: 1.15rem;
  margin: 0 0 0.2em;
}

h3.sub {
  margin-top: 1.4em;
}

a {
  color: var(--accent);
}

img {
  max-width: 100%;
}

.quiet {
  color: var(--quiet);
  font-size: 0.92em;
  font-weight: normal;
}

.lead {
  font-size: 1.15rem;
}

/* ----- Page frame ----- */

.site-header {
  background: var(--band);
}

.site-header > .inner {
  max-width: var(--page);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
}

/* The shop sits on a photo of her kitchen. The photo stays put while the page
   scrolls over it, on a fixed layer rather than background-attachment: fixed,
   which phones handle badly. The content rides on a panel of the page colour
   so text never sits directly on the photo. */
body.shop::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url('/images/kitchen.jpg') center / cover no-repeat;
  opacity: 0.6;
}

body.shop main {
  width: min(var(--page), calc(100% - 24px));
  max-width: none;
  margin: 20px auto;
  padding: 20px 24px 40px;
  border-radius: 20px;
  background: rgba(251, 247, 238, 0.73);
  box-shadow: 0 2px 24px rgba(43, 33, 24, 0.12);
}

body.shop main.receipt {
  width: min(620px, calc(100% - 24px));
}

body.shop .site-footer {
  width: fit-content;
  margin: 0 auto 24px;
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(251, 247, 238, 0.73);
}

@media (max-width: 560px) {
  body.shop main {
    padding: 14px 16px 32px;
  }
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  align-items: center;
}

.site-footer {
  text-align: center;
  color: var(--quiet);
  font-size: 0.9rem;
  padding: 24px 16px;
}

/* Two columns on a wide screen, stacked on a phone. */
.cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 0 48px;
  align-items: start;
}

.hero {
  text-align: center;
  padding: 4px 0;
}

.hero-photo {
  display: block;
  width: 100%;
  height: clamp(220px, 36vw, 440px);
  object-fit: cover;
  border-radius: 16px;
}

/* The logo sits on a disc of the page colour, overlapping the bottom of the
   photo like a seal. It is drawn well below its 720px size, which keeps its
   edges clean. */
.hero-logo {
  width: clamp(190px, 26vw, 270px);
  margin: calc(clamp(190px, 26vw, 270px) / -2) auto 8px;
  padding: 14px;
  border-radius: 50%;
  background: var(--bg);
  position: relative;
  line-height: 0;
}

.hero-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.hero .lead {
  max-width: 40em;
  margin: 0 auto;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 40px;
}

.gallery img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
}

/* ----- Building blocks ----- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  margin: 12px 0;
}

.card.narrow {
  max-width: 420px;
}

.notice,
.error {
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--ok-bg);
}

.error {
  background: var(--err-bg);
  color: var(--danger);
}

button,
.button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 11px 20px;
  font: 600 1rem var(--sans);
  text-decoration: none;
  cursor: pointer;
}

.button.secondary,
button.secondary {
  background: transparent;
  color: var(--accent);
}

/* A button that reads as a link, so it has to take the surrounding text's
   font and sit on its baseline rather than use the button styling. */
button.link {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
}

.site-header nav form {
  display: flex;
  margin: 0;
}

button.link.danger {
  color: var(--danger);
}

.badge {
  font: 600 0.8rem var(--sans);
  background: var(--band);
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
  vertical-align: middle;
}

.badge.warn {
  background: var(--err-bg);
  color: var(--danger);
}

.countdown {
  font: 700 1.6rem var(--serif);
  font-variant-numeric: tabular-nums;
}

/* ----- Forms ----- */

label {
  display: block;
  margin: 12px 0;
  font-weight: 600;
}

input[type='text'],
input[type='email'],
input[type='tel'],
input[type='password'],
input[type='number'],
input[type='date'],
input[type='datetime-local'],
select,
textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid #c9bda4;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: 1rem var(--sans);
}

label.check,
label.option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: normal;
}

label.check input,
label.option input {
  margin-top: 5px;
  flex: none;
}

label.option {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 8px 0;
  cursor: pointer;
}

label.option span span {
  display: block;
}

label.option:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

fieldset {
  min-width: 0;
}

legend {
  font-weight: 700;
  padding: 0 6px;
}

/* ----- The menu ----- */

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 20px;
}

.item {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.item-photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.item-head {
  display: flex;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 16px 0;
}

.item-head h3,
.item p {
  margin: 0;
}

.item .price {
  font-weight: 700;
}

.item-desc {
  padding: 6px 16px 0;
  color: var(--quiet);
  font-size: 0.95rem;
}

/* Pinned to the bottom so the controls line up across a row of cards. */
.item-foot {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  margin-top: auto;
  padding: 14px 16px 16px;
}

.item .low {
  margin-right: auto;
  color: var(--danger);
  font-weight: 600;
}

.item.sold-out .item-photo,
.item.sold-out .item-head,
.item.sold-out .item-desc {
  opacity: 0.55;
}

.qty {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty input {
  width: 3.2em;
  margin: 0;
  padding: 9px 4px;
  text-align: center;
  font-size: 1.1rem;
  appearance: textfield;
}

.qty input::-webkit-inner-spin-button,
.qty input::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}

.qty .step {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--accent);
  font-size: 1.3rem;
  line-height: 1;
}

.qty .step[hidden] {
  display: none;
}

.checkout-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 14px 0;
  margin-top: 28px;
}

.checkout-bar .total {
  font-size: 1.25rem;
  margin: 0;
}

.checkout-bar .total .quiet {
  display: block;
  font-size: 0.85rem;
}

.checkout-bar button {
  flex: 1 1 240px;
  max-width: 420px;
}

/* ----- Lists and tables ----- */

.fulfilment-list,
.past {
  list-style: none;
  padding: 0;
}

.fulfilment-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.fulfilment-list strong,
.fulfilment-list span {
  display: block;
}

.past li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

details {
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

details.card {
  border: 1px solid var(--line);
  padding: 12px 16px;
}

summary {
  cursor: pointer;
  font-weight: 600;
}

table {
  width: 100%;
  border-collapse: collapse;
}

td,
th {
  text-align: left;
  padding: 8px 10px 8px 0;
  vertical-align: top;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.summary .total-row td {
  border-top: 1px solid var(--line);
  font-weight: 700;
}

/* The order page is a receipt, so it stays a readable column. */
.address {
  font: 700 1.25rem var(--serif);
  margin: 0;
}

.receipt {
  max-width: 620px;
  margin: 0 auto;
}

/* ----- Admin ----- */

table.grid th {
  font-size: 0.85rem;
  color: var(--quiet);
  border-bottom: 1px solid var(--line);
}

table.grid td {
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

table.grid.orders td {
  vertical-align: top;
}

input.small {
  width: 5.5em;
  margin: 0 0 0 auto;
  text-align: right;
}

tr.off td:not(:first-child) {
  opacity: 0.45;
}

.thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  vertical-align: middle;
  margin-right: 10px;
}

.area-map {
  height: 480px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 12px 0;
  /* Leaflet sets its own z-indexes; keep them under the page header. */
  isolation: isolate;
}

.photo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin: 12px 0;
}

.photo-row img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.three {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0 16px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

@media (max-width: 640px) {
  body.admin table.grid {
    display: block;
    overflow-x: auto;
  }
}

@media print {
  .site-header nav,
  form,
  .button {
    display: none;
  }
}

/* ----- Sales dashboard ----- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin: 8px 0 20px;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.segmented > span {
  color: var(--quiet);
  font-size: 0.92rem;
}

.segmented a {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.92rem;
  text-decoration: none;
}

.segmented a[aria-current] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}

.tile p {
  margin: 0;
}

.tile-label,
.tile-note {
  color: var(--quiet);
  font-size: 0.9rem;
}

.tile-value {
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1.3;
}

/* Charts: the data is the only loud thing. Gridlines are solid hairlines one
   step off the surface, and text stays in ink, never the bar color. */
.chart {
  display: block;
  width: 100%;
  height: auto;
}

.chart .grid-line {
  stroke: var(--line);
  stroke-width: 1;
}

.chart .axis-line {
  stroke: #c9bda4;
  stroke-width: 1;
}

.chart .tick {
  fill: var(--quiet);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.chart .value {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.chart .bar {
  fill: var(--accent);
}

.chart .hit {
  fill: transparent;
}

.chart .col {
  outline: none;
}

.chart .col:hover .hit,
.chart .col:focus-visible .hit {
  fill: rgba(102, 118, 31, 0.1);
}

.chart .col:hover .bar,
.chart .col:focus-visible .bar {
  fill: #7f9230;
}

.hbar {
  display: grid;
  grid-template-columns: minmax(120px, 220px) 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 7px 0;
}

.hbar-track {
  display: block;
}

.hbar-fill {
  display: block;
  height: 14px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
}

.hbar:hover .hbar-fill,
.hbar:focus-visible .hbar-fill {
  background: #7f9230;
}

.hbar-value {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* The unfilled part is a lighter step of the same hue, so the bar reads as one scale. */
.meter {
  display: inline-block;
  width: 90px;
  height: 8px;
  border-radius: 4px;
  background: var(--band);
  vertical-align: middle;
  overflow: hidden;
}

.meter > span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.tip {
  position: fixed;
  z-index: 10;
  max-width: 260px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 0.85rem;
  pointer-events: none;
}

@media (max-width: 560px) {
  .hbar {
    grid-template-columns: 1fr auto;
  }

  .hbar-track {
    grid-column: 1 / -1;
    order: 3;
  }
}

/* ----- Customer accounts: reviews and messages ----- */

/* Stars are a rating, not a data series: gold on, pale off, always with a text label for screen readers. */
.stars {
  color: #b7791f;
  letter-spacing: 1px;
  white-space: nowrap;
}

.stars-off {
  color: var(--line);
}

.item-rating {
  padding: 2px 16px 0;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 12px;
}

.review {
  margin: 0;
}

.review blockquote {
  margin: 8px 0;
}

.rating {
  border: none;
  padding: 0;
  margin: 12px 0;
}

.rating legend {
  padding: 0;
}

.rating label.check {
  margin: 4px 0;
  align-items: center;
}

.rating label.check input {
  margin-top: 0;
}

.thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
}

.bubble {
  align-self: flex-start;
  max-width: 85%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.bubble.mine {
  align-self: flex-end;
  background: var(--band);
}

.bubble p {
  margin: 0;
}

.bubble-who {
  color: var(--quiet);
  font-size: 0.82rem;
}

.bubble-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.narrow-col {
  max-width: 620px;
}

.link-box {
  font-family: ui-monospace, Consolas, monospace;
  overflow-wrap: anywhere;
  user-select: all;
}

.copy-from {
  align-items: center;
  margin: 12px 0;
}

.copy-from label {
  margin: 0;
  flex: 1 1 260px;
  max-width: 420px;
}

.copy-from select {
  margin: 0;
}

/* A pickup or delivery option that has reached its limit for this drop. */
label.option.full {
  cursor: not-allowed;
  opacity: 0.6;
}

label.option .low {
  color: var(--danger);
  font-weight: 600;
}

input.small-left {
  width: 7em;
}

/* ----- Delivery list (used on her phone at the door) ----- */

.delivery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 12px;
  align-items: start;
}

.delivery {
  margin: 0;
}

.delivery p {
  margin: 0.35em 0;
}

.delivery.done {
  background: var(--ok-bg);
}

.deliver-form {
  border-top: 1px solid var(--line);
  margin-top: 10px;
}

.deliver-form button {
  width: 100%;
}

.delivery-photo {
  display: block;
  width: 100%;
  max-width: 420px;
  border-radius: 10px;
  margin: 8px 0;
}

.message-preview {
  padding: 8px 12px;
  border-left: 3px solid var(--line);
  color: var(--quiet);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

/* ----- The shop's menu: options on an item, and the discount code box ----- */

.item-options {
  list-style: none;
  margin: 10px 0 0;
  padding: 0 16px;
}

.item-options li {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
}

.item-options .opt-name {
  flex: 1;
  font-weight: 600;
}

.item-options .opt-price {
  font-variant-numeric: tabular-nums;
}

.code-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-top: 4px;
}

.code-row input {
  margin-top: 0;
  text-transform: uppercase;
}

.code-row button {
  padding: 8px 16px;
}

#code-note {
  display: block;
  margin-top: 4px;
}

/* ----- Admin: a plain, light workspace with the menu down the left ----- */

body.admin {
  --bg: #ffffff;
  --surface: #ffffff;
  --band: #f4f4f5;
  --ink: #18181b;
  --quiet: #71717a;
  --line: #e4e4e7;
  /* Buttons and the current tab are near-black; charts keep the bakery's olive. */
  --accent: #18181b;
  --chart: #66761f;
  --ok: #3f9a52;
  --pickup: #4a67d6;
  --pickup-done: #9db2f2;
  --delivery: #cf5a17;
  --delivery-done: #f6b08c;
  font-size: 15px;
}

body.admin h1,
body.admin h2,
body.admin h3 {
  font-family: var(--sans);
  letter-spacing: -0.01em;
}

body.admin h1 {
  font-size: 1.5rem;
  margin: 0 0 0.6em;
}

body.admin h2 {
  font-size: 1.1rem;
  margin: 1.6em 0 0.5em;
}

body.admin h3 {
  font-size: 1rem;
}

body.admin a {
  color: var(--ink);
}

body.admin .chart .bar {
  fill: var(--chart);
}

body.admin .hbar-fill,
body.admin .meter > span {
  background: var(--chart);
}

body.admin .segmented a[aria-current] {
  color: #fff;
}

.shell {
  display: flex;
  min-height: 100vh;
}

.side {
  position: sticky;
  top: 0;
  flex: none;
  display: flex;
  flex-direction: column;
  width: 216px;
  height: 100vh;
  padding: 14px 10px;
  border-right: 1px solid var(--line);
  background: #fafafa;
  overflow-y: auto;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 14px;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
}

.side-brand img {
  width: 30px;
  height: 30px;
}

.side nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side nav a,
.side nav button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--ink);
  font: 500 0.95rem var(--sans);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.side nav a:hover,
.side nav button:hover {
  background: var(--band);
}

.side nav a[aria-current] {
  background: #e9e9ec;
  font-weight: 650;
}

.side nav .side-gap {
  height: 1px;
  margin: 8px 4px;
  background: var(--line);
}

.side nav.side-foot {
  margin-top: auto;
  padding-top: 12px;
}

.side nav form {
  margin: 0;
}

.side .count {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
}

.shell-main {
  flex: 1;
  min-width: 0;
}

body.admin main {
  max-width: none;
  margin: 0;
  padding: 22px 28px 64px;
}

/* On a phone the menu slides in over the page from a bar across the top. */
.topbar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
}

body.admin .topbar button {
  padding: 6px 12px;
}

@media (max-width: 820px) {
  .topbar {
    display: flex;
  }

  .side {
    position: fixed;
    z-index: 30;
    left: 0;
    transform: translateX(-100%);
    transition: transform 0.15s;
  }

  .side.open {
    transform: none;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.25);
  }

  body.admin main {
    padding: 16px 14px 56px;
  }
}

/* Login and the other pages shown before anyone is logged in. */
body.admin main.signed-out {
  max-width: 460px;
  margin: 8vh auto 0;
}

.signed-out .side-brand {
  padding-left: 0;
  font-size: 1.2rem;
}

body.admin button,
body.admin .button {
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.93rem;
}

body.admin .button.secondary,
body.admin button.secondary {
  background: #fff;
  border-color: #d4d4d8;
  color: var(--ink);
}

body.admin button.link {
  padding: 0;
  font-size: inherit;
  color: var(--ink);
}

body.admin button.link.danger {
  color: var(--danger);
}

body.admin .card {
  border-radius: 10px;
}

body.admin input[type='text'],
body.admin input[type='email'],
body.admin input[type='tel'],
body.admin input[type='password'],
body.admin input[type='number'],
body.admin input[type='date'],
body.admin input[type='datetime-local'],
body.admin input[type='search'],
body.admin select,
body.admin textarea {
  padding: 8px 10px;
  border-color: #d4d4d8;
  font-size: 0.95rem;
}

input[type='search'] {
  display: block;
  width: 100%;
  border: 1px solid #d4d4d8;
  border-radius: 8px;
  background: #fff;
  font: 1rem var(--sans);
}

body.admin table.grid {
  border: 1px solid var(--line);
  border-radius: 10px;
  border-collapse: separate;
  border-spacing: 0;
}

body.admin table.grid th,
body.admin table.grid td {
  padding: 10px 14px;
}

body.admin table.grid th {
  font-weight: 500;
}

body.admin table.grid tbody tr:last-child td {
  border-bottom: none;
}

body.admin table.grid tbody tr:hover {
  background: #fafafa;
}

body.admin .badge {
  background: var(--band);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.78rem;
}

body.admin .badge.ok {
  background: var(--ok);
  color: #fff;
}

body.admin .badge.pickup {
  background: #e4eafd;
  color: #3b4f9a;
}

body.admin .badge.delivery {
  background: #fde9dd;
  color: #a4501f;
}

.code {
  font-family: ui-monospace, Consolas, monospace;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* The row across the top of a page: its name, a search box, and its main button. */
.page-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

body.admin .page-head h1 {
  margin: 0;
}

.page-head .search {
  flex: 0 1 420px;
  margin: 0;
}

.page-head .search input {
  margin: 0;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 16px;
}

body.admin .tabs a,
body.admin .tabs button {
  padding: 6px 12px;
  border: none;
  border-radius: 999px;
  background: var(--band);
  color: var(--ink);
  font: 500 0.88rem var(--sans);
  text-decoration: none;
  cursor: pointer;
}

body.admin .tabs a[aria-current],
body.admin .tabs button[aria-selected='true'] {
  background: var(--ink);
  color: #fff;
}

.tabs .spacer {
  flex: 1;
}

.tabs label {
  margin: 0;
}

body.admin .tabs select {
  width: auto;
  margin: 0;
}

/* Pop-up windows. */
dialog.modal {
  width: min(640px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: none;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  color: var(--ink);
}

dialog.modal::backdrop {
  background: rgba(24, 24, 27, 0.45);
}

.modal form.modal-form {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 0;
}

body.admin .modal-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

body.admin .modal-head .close {
  padding: 4px 10px;
  border: none;
  background: none;
  color: var(--quiet);
  font-size: 1.3rem;
  line-height: 1;
}

.modal .tabs {
  margin: 12px 20px 0;
}

.modal-body {
  padding: 4px 20px 16px;
  overflow-y: auto;
}

.modal-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
}

.modal-foot .left {
  margin-right: auto;
}

/* A table row that opens a pop-up when clicked. */
tr.clickable {
  cursor: pointer;
}

.option-rows {
  display: grid;
  gap: 8px;
}

.option-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) 84px;
  gap: 8px;
  align-items: end;
}

.option-row label {
  margin: 0;
  font-size: 0.85rem;
}

.option-row label.check {
  align-items: center;
  padding-bottom: 8px;
}

/* The orders board: one card per order, in a row you scroll sideways. */
.board {
  display: flex;
  gap: 14px;
  align-items: stretch;
  padding-bottom: 12px;
  overflow-x: auto;
}

.ticket {
  flex: none;
  display: flex;
  flex-direction: column;
  width: 262px;
  min-height: 400px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.ticket-head {
  padding: 9px 12px;
  background: var(--pickup);
  color: #fff;
}

.ticket.delivery .ticket-head {
  background: var(--delivery);
}

.ticket-head p {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  font-size: 0.82rem;
}

.ticket-head .who {
  font-size: 0.95rem;
  font-weight: 650;
}

.ticket-head .chip {
  padding: 0 6px;
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
}

.ticket-items {
  flex: 1;
  margin: 0;
  padding: 10px 12px;
  list-style: none;
}

.ticket-items li {
  margin: 0 0 10px;
}

.ticket-items label {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin: 0;
  font-weight: 500;
}

.ticket-items input:checked ~ span {
  color: var(--quiet);
}

.ticket-items .opt {
  display: block;
  color: #c2410c;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ticket-note {
  margin: 0 12px 10px;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--band);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.ticket-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  color: var(--quiet);
  font-size: 0.8rem;
}

.ticket form {
  margin: 0;
  padding: 0 10px 10px;
}

.ticket form button {
  width: 100%;
}

.ticket.is-done .ticket-items,
.ticket.is-done .ticket-note {
  opacity: 0.55;
}

/* A drop's menu: what is left, what is in carts, what has sold. */
.tally td.big {
  font-size: 1.05rem;
  font-weight: 650;
}

body.admin table.tally tr.sub td {
  padding-top: 4px;
  padding-bottom: 4px;
  color: var(--quiet);
  font-size: 0.88rem;
}

body.admin table.tally tr.sub td:first-child {
  padding-left: 72px;
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--ok);
}

body.admin .tiles {
  margin-bottom: 18px;
}

body.admin .tile {
  border-radius: 10px;
}

@media print {
  .side,
  .topbar {
    display: none;
  }
}

.filtered-out,
.kind-out {
  display: none !important;
}

.option-row[hidden] {
  display: none;
}

/* A button is a link too, so it needs its own text color back. */
body.admin a.button {
  color: var(--accent-ink);
}

body.admin a.button.secondary {
  color: var(--ink);
}

/* Charts keep to the size they were drawn for, however wide the screen is. */
body.admin .chart {
  max-width: 1140px;
}

body.admin .hbars {
  max-width: 1140px;
}

/* An open order is in full color; one marked done fades, so what is left to do stands out. */
.ticket.is-done .ticket-head {
  background: var(--pickup-done);
}

.ticket.delivery.is-done .ticket-head {
  background: var(--delivery-done);
}

.ticket:not(.is-done) {
  border-color: #c4c4cc;
  box-shadow: 0 1px 4px rgba(24, 24, 27, 0.08);
}

/* A column heading that sorts its table when clicked. */
th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

th.sortable:hover {
  color: var(--ink);
}

th.sortable::after {
  content: '↕';
  margin-left: 5px;
  opacity: 0.3;
}

th.sortable[aria-sort='ascending']::after {
  content: '▲';
  opacity: 1;
  font-size: 0.7em;
}

th.sortable[aria-sort='descending']::after {
  content: '▼';
  opacity: 1;
  font-size: 0.7em;
}

/* The pickers beside the tabs line up with each other and with the tabs. */
.tabs form {
  display: flex;
  margin: 0;
}

.tabs label {
  display: flex;
}

body.admin .tabs select {
  height: 36px;
  padding-top: 0;
  padding-bottom: 0;
}

body.admin .chart {
  margin: 0 auto;
}
