:root {
  --deep: #14382a;
  --ink: #1c2b22;
  --forest: #24543c;
  --citrus: #dfa32b;
  --lemon: #f7dd6a;
  --cream: #f7f3e8;
  --white: #fffdf7;
  --muted: #5d6b5a;
  --line: rgba(28, 43, 34, 0.14);
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --sans: "Avenir Next", Avenir, "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: var(--sans); font-size: 14px; line-height: 1.5; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); }
.admin-shell { width: min(1360px, calc(100% - 40px)); margin-inline: auto; }
.admin-header { background: var(--deep); color: var(--cream); padding: 20px 0; }
.admin-header .admin-shell { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.admin-kicker { font-family: var(--mono); font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--lemon); }
.admin-header h1 { font-family: var(--serif); font-weight: 500; font-size: 34px; margin-top: 4px; }
.admin-head-right { display: flex; align-items: center; gap: 10px; }
.admin-link { font-size: 12px; text-decoration: underline; text-underline-offset: 4px; color: rgba(251, 246, 233, 0.75); }
.admin-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 7px 14px;
  border: 1px solid var(--line); border-radius: 999px; background: transparent;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer;
  white-space: nowrap;
}
.admin-header .admin-btn { border-color: rgba(251, 246, 233, 0.3); color: var(--cream); }
.admin-btn:hover { border-color: var(--ink); }
.admin-note { min-height: 0; font-size: 12px; color: #a83226; padding-top: 12px; }
.admin-note:not(:empty) { padding: 10px 12px; margin-top: 12px; border: 1px solid #eccbc6; background: #fdf2f0; border-radius: 8px; }
.admin-stats { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin: 18px 0; }
.stat-card { padding: 12px 14px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; }
.stat-card strong { display: block; font-family: var(--serif); font-size: 26px; line-height: 1; }
.stat-card span { font-family: var(--mono); font-size: 8px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 0; }
.admin-tab {
  border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; background: transparent;
  padding: 9px 14px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--muted); cursor: pointer;
}
.admin-tab.is-active { background: var(--white); border-color: var(--line); color: var(--ink); }
.admin-panel { background: var(--white); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 12px 12px; padding: 16px; }
.admin-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.admin-panel-head h2 { font-family: var(--serif); font-weight: 500; font-size: 24px; }
.admin-panel-head > div { display: flex; gap: 8px; align-items: center; }
.admin-search input { width: 250px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--cream); font-size: 12px; }
.admin-showall { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--cream); font-family: var(--mono); font-size: 9px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); cursor: pointer; white-space: nowrap; }
.admin-showall input { margin: 0; accent-color: var(--forest); cursor: pointer; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.admin-table th { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--ink); font-family: var(--mono); font-size: 8px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.admin-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table tr:hover td { background: #fbf8ef; }
.admin-table .ref { font-family: var(--mono); font-size: 10px; white-space: nowrap; }
.admin-table .sub { color: var(--muted); font-size: 10px; }
.admin-table .money { font-family: var(--mono); white-space: nowrap; }
.pill { display: inline-block; padding: 3px 7px; border-radius: 999px; background: var(--cream); border: 1px solid var(--line); font-family: var(--mono); font-size: 8px; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.pill.paid, .pill.active, .pill.fulfilled { background: #e7f3e5; border-color: #b9d8b4; color: #24543c; }
.pill.cancelled { background: #f8e7e4; border-color: #e5c2bc; color: #8a2f23; }
.actions { display: flex; flex-wrap: wrap; gap: 4px; min-width: 120px; }
.actions button { border: 1px solid var(--line); background: transparent; border-radius: 6px; padding: 3px 7px; font-size: 9px; cursor: pointer; }
.actions button:hover { background: var(--cream); border-color: var(--ink); }
.admin-empty { padding: 30px; text-align: center; color: var(--muted); font-size: 12px; }
@media (max-width: 1000px) {
  .admin-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .admin-shell { width: calc(100% - 24px); }
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-panel-head { flex-direction: column; align-items: flex-start; }
  .admin-search input { width: 180px; }
}

/* name of the person signed in, and the quieter sign-out button */
.admin-user { font-family: var(--mono); font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(251, 246, 233, 0.7); white-space: nowrap; }
.admin-header .admin-btn-quiet { border-color: transparent; color: rgba(251, 246, 233, 0.7); }
.admin-header .admin-btn-quiet:hover { border-color: rgba(251, 246, 233, 0.4); color: var(--cream); }

/* team accounts */
.admin-user-form { border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 20px; background: var(--cream); }
.admin-user-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; }
.admin-sections { border: 0; padding: 0; margin: 0 0 14px; }
.admin-sections legend { font-size: 11.5px; font-weight: 700; margin-bottom: 8px; padding: 0; }
.admin-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.admin-check { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink); }
.admin-check input { margin: 0; }
.admin-check input:disabled + span, .admin-check input:disabled { opacity: 0.55; }
/* Grove flavors: one tick per catalogue flavor, in a readable grid */
.admin-flavor-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px 18px; margin-bottom: 16px; }
.admin-flavor-checks .admin-check { min-height: 28px; }
.admin-flavor-checks .sub { color: var(--muted); font-size: 10.5px; }

.admin-user-table td { vertical-align: top; }
.admin-user-table .actions { margin-top: 8px; }

/* sign in */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 24px; background: var(--cream); }
.login-shell { width: 100%; max-width: 420px; }
.login-card { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 28px; box-shadow: 0 24px 60px rgba(20, 56, 42, 0.08); }
.login-card h1 { font-family: var(--serif); font-weight: 500; font-size: 30px; line-height: 1.1; margin: 6px 0 10px; }
.login-note { font-size: 12.5px; color: var(--muted); margin-bottom: 20px; }
.login-fine { font-size: 11px; color: var(--muted); margin-top: 18px; }
.login-back { margin-top: 14px; font-size: 11.5px; }
.login-back a { text-decoration: underline; text-underline-offset: 4px; }

/* form pieces the desk pages need without loading the storefront sheet */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field label { font-size: 11.5px; font-weight: 700; color: var(--ink); }
.field input {
  min-height: 40px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--white); font: inherit; font-size: 13px;
}
.field input:focus { outline: 2px solid var(--forest); outline-offset: 1px; }
.form-status { min-height: 0; font-size: 12px; color: #a83226; margin: 0 0 10px; }
.form-status:not(:empty) { padding: 9px 11px; border-radius: 8px; background: #fdf2f0; border: 1px solid #eccbc6; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 12px 20px;
  border: 1px solid transparent; border-radius: 999px; background: transparent; cursor: pointer;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.btn-primary { background: var(--deep); color: var(--cream); }
.btn-primary:hover { background: var(--forest); }
.btn-submit { width: 100%; margin-top: 4px; }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn-spinner { display: none; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: desk-spin 0.7s linear infinite; }
.is-loading .btn-spinner { display: inline-block; }
@keyframes desk-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn-spinner { animation: none; } }
@media (max-width: 700px) {
  .admin-user-fields { grid-template-columns: minmax(0, 1fr); }
  .admin-head-right { flex-wrap: wrap; justify-content: flex-end; }
}

/* quick pay (popup sales) */
.qp-shell { width: min(560px, calc(100% - 24px)); margin: 18px auto 48px; display: grid; gap: 14px; }
.qp-card { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.qp-label { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 12px 0 6px; }
.qp-label:first-child { margin-top: 0; }
.qp-opt { text-transform: none; letter-spacing: 0; }
.qp-amount-row { display: flex; align-items: center; gap: 6px; border: 2px solid var(--line); border-radius: 12px; padding: 4px 14px; background: #fff; }
.qp-amount-row:focus-within { border-color: var(--forest); }
.qp-dollar { font-family: var(--serif); font-size: 34px; color: var(--muted); }
.qp-amount { width: 100%; border: 0; outline: 0; background: transparent; font-family: var(--serif); font-size: 44px; padding: 4px 0; min-width: 0; }
.qp-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.qp-chip { min-height: 44px; border: 1px solid var(--line); background: var(--cream); border-radius: 10px; font-size: 16px; font-weight: 600; cursor: pointer; }
.qp-chip:active { background: var(--lemon); }
.qp-note { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: #fff; font-size: 16px; }
.qp-error { color: #9a2a1a; font-weight: 600; margin-top: 10px; }
.qp-go { width: 100%; min-height: 56px; margin-top: 16px; border: 0; border-radius: 12px; background: var(--forest); color: var(--cream); font-size: 18px; font-weight: 700; cursor: pointer; }
.qp-go:disabled { opacity: 0.6; }
.qp-result { text-align: center; }
.qp-status { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.qp-total { font-family: var(--serif); font-size: 52px; line-height: 1.1; margin-top: 4px; }
.qp-for { color: var(--muted); min-height: 1.4em; }
.qp-qr { width: min(300px, 80%); margin: 12px auto; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.qp-qr svg { display: block; width: 100%; height: auto; }
.qp-hint { font-size: 13px; color: var(--muted); max-width: 40ch; margin: 0 auto; }
.qp-actions { display: grid; gap: 8px; margin-top: 16px; }
.qp-btn { min-height: 48px; border: 1px solid var(--line); border-radius: 12px; background: var(--cream); font-weight: 600; cursor: pointer; }
.qp-btn-main { background: var(--forest); color: var(--cream); border-color: var(--forest); }
.qp-result.is-paid { background: #e6f4e8; border-color: #2e8a49; }
.qp-result.is-paid .qp-status { color: #1d6b34; font-size: 22px; }
.qp-result.is-paid .qp-qr { opacity: 0.25; }
.qp-recent-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.qp-recent-head h2 { font-family: var(--serif); font-size: 20px; font-weight: 500; }
.qp-today { color: #1d6b34; font-weight: 600; }
.qp-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.qp-item { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 10px; background: var(--cream); border-left: 4px solid var(--line); }
.qp-item.is-paid { border-left-color: #2e8a49; background: #eef7ef; }
.qp-item-meta { color: var(--muted); white-space: nowrap; }
.qp-empty { color: var(--muted); margin-top: 8px; }
