:root {
  color-scheme: light;
  --ink: #28352c;
  --muted: #68746a;
  --paper: #f7f3e8;
  --card: #fffefa;
  --line: #e4e1d6;
  --green: #376747;
  --green-dark: #285238;
  --green-soft: #e8f0e6;
  --yellow-soft: #fbf0d1;
  --red: #9b3c31;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); }
.topbar { position: relative; min-height: 250px; padding: 12px clamp(18px, 5vw, 70px); display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--line); background: rgba(255,254,250,.84); }
.brand { display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; }
.brand-logo { display: block; width: clamp(220px, 31vw, 330px); height: auto; }
.top-actions { display: flex; gap: 18px; align-items: center; }
.top-actions form { margin: 0; }
.quiet-link, .link-button { border: 0; background: none; color: var(--muted); font: inherit; font-size: .92rem; text-decoration: none; cursor: pointer; }
.quiet-link:hover, .link-button:hover { color: var(--green-dark); text-decoration: underline; }
.page-shell { width: min(1080px, calc(100% - 32px)); margin: 0 auto; min-height: calc(100vh - 298px); padding: 30px 0 72px; }
.narrow { width: min(100%, 560px); margin-left: auto; margin-right: auto; }
.hero { text-align: center; }
.eyebrow { margin: 0 0 12px; color: var(--green); font-size: .72rem; font-weight: 800; letter-spacing: .16em; }
h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.3rem); line-height: 1.04; letter-spacing: -.055em; }
.lede { margin: 15px 0 26px; color: var(--muted); line-height: 1.6; }
.card { border: 1px solid var(--line); border-radius: 20px; background: var(--card); box-shadow: 0 12px 35px rgba(53, 62, 47, .055); }
.form-stack { padding: clamp(22px, 5vw, 34px); display: flex; flex-direction: column; gap: 10px; text-align: left; }
label { margin-top: 8px; color: #39463b; font-size: .9rem; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 48px; padding: 11px 13px; border: 1px solid #d8dcd2; border-radius: 10px; background: #fff; color: var(--ink); font: inherit; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(67, 125, 80, .18); border-color: var(--green); }
.optional, .unit { color: var(--muted); font-weight: 450; }
.optional { font-size: .82rem; }
.unit { text-transform: lowercase; }
.button { min-height: 48px; border: 0; border-radius: 11px; display: inline-flex; justify-content: center; align-items: center; padding: 0 18px; font: inherit; font-weight: 750; text-decoration: none; cursor: pointer; transition: background .15s ease, transform .15s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { margin-top: 10px; color: #fff; background: var(--green); }
.button-primary:hover { background: var(--green-dark); }
.button-secondary { color: var(--green-dark); background: var(--green-soft); }
.button-secondary:hover { background: #dce9d9; }
.button-danger { color: #fff; background: var(--red); }
.button-danger:hover { background: #7e2f27; }
.form-hint { margin: 5px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.choice-fieldset { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 8px 0 2px; padding: 0; border: 0; }
.choice-fieldset legend { margin: 0 0 8px; color: #39463b; font-size: .9rem; font-weight: 700; }
.choice-card { display: flex; min-height: 58px; align-items: center; justify-content: center; gap: 8px; margin: 0; padding: 10px; border: 1px solid #d8dcd2; border-radius: 11px; background: #fff; cursor: pointer; text-align: center; }
.choice-card:has(input:checked) { border-color: var(--green); background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green); }
.choice-card input { width: 17px; min-height: 17px; height: 17px; margin: 0; accent-color: var(--green); }
.choice-card span { font-size: .88rem; }
.queue-summary { padding: 12px 15px; border-radius: 12px; background: var(--green-soft); }
.queue-notice { margin-top: 22px; padding: 25px; text-align: center; }
.queue-notice p { line-height: 1.55; }
.queue-number { margin: 0; color: var(--green-dark); font-size: 1.45rem; font-weight: 850; }
.issued-key { margin: 0 0 22px; padding: 24px; text-align: center; }
.issued-key h2 { margin: 0 0 8px; }
.issued-key p { color: var(--muted); }
.issued-key code { display: inline-block; max-width: 100%; margin-top: 8px; padding: 13px 18px; border: 1px dashed #a5b49f; border-radius: 10px; background: var(--green-soft); color: var(--green-dark); font-size: clamp(1rem, 4vw, 1.4rem); font-weight: 800; overflow-wrap: anywhere; user-select: all; }
.customer-create { margin-bottom: 28px; }
.customer-create h2 { margin: 0; font-size: 1.15rem; }
.create-customer-form { display: flex; flex-direction: column; gap: 10px; }
.customer-actions { display: flex; flex: 0 0 205px; flex-direction: column; align-self: center; gap: 8px; }
.customer-actions form { margin: 0; }
.customer-actions .button { width: 100%; min-height: 42px; }
.section-title { margin: 0 0 14px; font-size: 1.3rem; }
.alerts { width: min(100%, 560px); margin: 0 auto 18px; }
.alert { padding: 12px 15px; border-radius: 10px; text-align: left; }
.alert-error { color: #772e27; background: #fae7e2; }
.alert-success { color: #285238; background: var(--green-soft); }
.confirmation { padding: 44px 30px; text-align: center; }
.success-icon { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 20px; border-radius: 50%; color: #fff; background: var(--green); font-size: 28px; }
.confirmation .button { width: 100%; }
.footer { padding: 19px 16px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; font-size: .78rem; }
.admin-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 28px; }
.admin-heading .lede { margin-bottom: 0; }
.stats { display: flex; gap: 12px; }
.stat { min-width: 144px; padding: 14px 17px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.stat strong { display: block; color: var(--green-dark); font-size: 1.6rem; }
.stat span { display: block; margin-top: 3px; color: var(--muted); font-size: .78rem; }
.request-list { display: grid; gap: 13px; }
.request-card { display: flex; justify-content: space-between; gap: 28px; padding: 22px 24px; }
.request-main { min-width: 0; flex: 1; }
.request-title-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.request-title-line h2 { margin: 0; font-size: 1.2rem; letter-spacing: -.025em; }
.pill { padding: 6px 10px; border-radius: 99px; font-size: .75rem; font-weight: 750; }
.pill-green { color: #2c5a3a; background: var(--green-soft); }
.pill-yellow { color: #765916; background: var(--yellow-soft); }
.queue-position { display: grid; flex: 0 0 34px; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; background: var(--green); font-size: .9rem; font-weight: 850; }
.quantity { margin: 10px 0; font-size: 1.35rem; font-weight: 800; }
.quantity span { color: var(--muted); font-size: .95rem; font-weight: 550; }
.details { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; }
.details div { min-width: 120px; max-width: 100%; }
.details dt { color: var(--muted); font-size: .72rem; }
.details dd { margin: 3px 0 0; overflow-wrap: anywhere; font-size: .88rem; }
.status-form { display: flex; flex: 0 0 190px; flex-direction: column; align-self: center; gap: 8px; }
.status-form label { margin: 0; }
.status-form .button { min-height: 42px; }
.empty-state { padding: 45px 24px; text-align: center; }
.empty-mark { margin-bottom: 8px; color: #a7b5a5; font-size: 2.5rem; }
.empty-state h2 { margin: 0 0 8px; letter-spacing: -.03em; }
.empty-state p { margin: 0; color: var(--muted); }
.error-card { padding: 32px; text-align: center; }
.error-card .button { width: 100%; }

@media (max-width: 720px) {
  .topbar { min-height: 210px; padding: 48px 16px 8px; }
  .brand-logo { width: min(76vw, 270px); }
  .top-actions { position: absolute; top: 10px; right: 16px; }
  .page-shell { min-height: calc(100vh - 258px); padding-top: 24px; }
  .admin-heading { align-items: stretch; flex-direction: column; }
  .stats { display: grid; grid-template-columns: 1fr 1fr; }
  .request-card { flex-direction: column; gap: 18px; padding: 19px; }
  .status-form { flex-basis: auto; width: 100%; }
  .customer-actions { flex-basis: auto; width: 100%; }
  .choice-fieldset { grid-template-columns: 1fr; }
  .choice-card { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
