:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #183020;
  background: #f4f1e8;
  line-height: 1.5;
  color-scheme: light;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button:disabled { cursor: wait; opacity: .65; }
.shell { max-width: 1220px; margin: auto; padding: 28px 20px 48px; }
.eyebrow { margin: 0 0 8px; color: #1d6c45; font-size: .78rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.brand { color: #fff; font-weight: 900; letter-spacing: .04em; }
.muted { color: #647268; }
.pre-line { white-space: pre-line; }
.help-text { margin-top: 24px; color: #6d776f; font-size: .9rem; }
.notice { padding: 12px 14px; border-radius: 10px; background: #fff1cf; color: #6e4d00; }
.success-message { padding: 12px 14px; border-radius: 10px; background: #e4f4e8; color: #1b663c; }

.button, button {
  display: inline-block;
  padding: 11px 16px;
  border: 0;
  border-radius: 10px;
  background: #1d6c45;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}

.button.secondary, button.secondary { background: #e6eee8; color: #193021; }
.button.danger, button.danger { background: #a6382c; color: #fff; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 20px; border-radius: 16px; background: #163020; }

.hero, .customer-card, .public-card, .qr-sheet {
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 14px 45px rgba(24, 48, 32, .09);
}

.hero { max-width: 720px; margin: 64px auto; padding: 48px; }
.hero h1, .customer-card h1, .public-card h1 { margin: 0 0 16px; font-size: clamp(2rem, 6vw, 3.5rem); line-height: 1.05; }
.customer-login { max-width: 760px; }
.customer-card { max-width: 900px; margin: 34px auto; padding: 38px; }
.public-card { max-width: 620px; margin: 7vh auto; padding: 42px; text-align: center; }
.success-card { border-top: 8px solid #1d6c45; }
.owner-link { display: inline-block; margin-top: 26px; color: #667269; font-size: .88rem; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form-grid .full { grid-column: 1 / -1; }
.form-section { margin-top: 8px; padding-top: 16px; border-top: 1px solid #e0e7e1; }
.form-section h3 { margin: 0; }
.form-section p { margin: 5px 0 0; }
label { display: grid; gap: 6px; color: #243c2b; font-size: .9rem; font-weight: 750; }
input, select, textarea { width: 100%; padding: 11px; border: 1px solid #c8d4ca; border-radius: 9px; background: #fff; color: #183020; }
input:focus, select:focus, textarea:focus { border-color: #1d6c45; outline: 3px solid rgba(29, 108, 69, .12); }
textarea { min-height: 88px; resize: vertical; }
.menu-editor { min-height: 180px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .85rem; }
small { color: #6d786f; font-weight: 500; }
.check-row { display: flex; align-items: center; gap: 10px; }
.check-row input { width: 18px; height: 18px; }

.admin-main { margin-top: 28px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 20px 0; }
.toolbar h1, .toolbar h2 { margin: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin: 24px 0; }
.stats-grid article { padding: 18px; border: 1px solid #dde6df; border-radius: 15px; background: #fff; }
.stats-grid span { display: block; min-height: 38px; color: #6a776d; font-size: .82rem; }
.stats-grid strong { display: block; font-size: 1.8rem; }
.list-controls { display: grid; grid-template-columns: minmax(240px, 1fr) 240px; gap: 12px; margin: 20px 0 12px; }
.display-list { display: grid; gap: 12px; }
.display-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px; border: 1px solid #e0e7e1; border-radius: 15px; background: #fff; }
.display-main { min-width: 0; }
.display-row h3 { margin: 6px 0 2px; }
.display-row p { margin: 3px 0; color: #69756c; font-size: .9rem; }
.status-line { display: flex; align-items: center; gap: 10px; }
.display-code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .08em; }
.status-badge { padding: 4px 9px; border-radius: 999px; font-size: .76rem; font-weight: 900; }
.status-inventory { background: #e9edf0; color: #44525d; }
.status-sold { background: #fff1c9; color: #765400; }
.status-active { background: #dcf4e3; color: #17623a; }
.status-suspended { background: #f7deda; color: #8b2f25; }
.empty-state { padding: 38px; border: 2px dashed #cad5cc; border-radius: 16px; text-align: center; }

.modal { position: fixed; inset: 0; z-index: 5; display: grid; place-items: center; padding: 18px; background: rgba(19, 41, 26, .58); }
.modal-card { width: min(700px, 100%); max-height: 92vh; overflow: auto; padding: 28px; border-radius: 20px; background: #fff; }
.wide-modal { width: min(900px, 100%); }

.business-profile { --business-color: #1d6c45; border-top: 8px solid var(--business-color); }
.business-profile .eyebrow { color: var(--business-color); }
.logo, .logo-placeholder { width: 104px; height: 104px; margin: 0 auto 20px; border-radius: 24px; object-fit: cover; background: color-mix(in srgb, var(--business-color) 15%, white); }
.logo-placeholder { display: grid; place-items: center; color: var(--business-color); font-size: 2.5rem; font-weight: 900; }
.profile-description { color: #536158; font-size: 1.05rem; }
.profile-detail { color: #48564d; }
.link-list { display: grid; gap: 10px; margin-top: 26px; }
.link-list a { padding: 14px; border-radius: 11px; background: #edf3ee; color: #183020; font-weight: 800; text-decoration: none; }
.link-list .primary-business-link { background: var(--business-color); color: #fff; }
.menu-section { margin-top: 34px; padding-top: 26px; border-top: 1px solid #dfe7e1; text-align: left; }
.menu-section > h2 { text-align: center; }
.menu-category { margin-top: 24px; }
.menu-category h3 { padding-bottom: 8px; border-bottom: 2px solid color-mix(in srgb, var(--business-color) 40%, white); color: var(--business-color); }
.menu-item { display: flex; justify-content: space-between; gap: 20px; padding: 12px 0; border-bottom: 1px solid #edf1ee; }
.menu-item p { margin: 4px 0 0; color: #6b756e; font-size: .9rem; }
.menu-item span { flex: 0 0 auto; color: var(--business-color); font-weight: 900; }

.qr-sheet { max-width: 820px; margin: 24px auto; padding: 40px; text-align: center; }
.qr-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 30px; }
.qr-box { padding: 20px; border: 2px dashed #356448; border-radius: 16px; }
.qr-box p, .secret-url { overflow-wrap: anywhere; font-size: .76rem; }
.qr-code img { margin: auto; }
.activation-card { max-width: 560px; margin: 38px auto 0; padding: 24px; border: 2px solid #1d6c45; border-radius: 16px; background: #f1f8f3; }
.used-card { border-color: #b6c1b8; background: #f6f7f6; }
.small-qr { margin: 18px 0; }
.print-actions { justify-content: center; margin-top: 28px; }

@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .display-row { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 620px) {
  .shell { padding: 14px; }
  .hero, .customer-card, .public-card { margin: 24px auto; padding: 26px; }
  .topbar, .toolbar { align-items: flex-start; flex-direction: column; }
  .form-grid, .qr-pair, .list-controls { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .modal { padding: 8px; }
  .modal-card { padding: 20px; }
}

@media print {
  .topbar, .no-print, .print-actions { display: none !important; }
  body, .shell { background: #fff; }
  .shell { max-width: none; padding: 0; }
  .qr-sheet { max-width: none; margin: 0; padding: 16px; box-shadow: none; }
  .qr-box, .activation-card { border-color: #000; break-inside: avoid; }
}
