:root {
  --bg: #fff8ef;
  --panel: #fff;
  --ink: #23170f;
  --muted: #7b6d64;
  --brand: #f16623;
  --brand-dark: #c94913;
  --accent: #168457;
  --danger: #d43b2f;
  --line: #ead8c7;
  --shadow: 0 20px 60px rgba(61, 31, 9, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(241, 102, 35, 0.18), transparent 34rem),
    linear-gradient(180deg, #fff8ef, #fffdf8);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 52px);
  background: rgba(255, 248, 239, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
}

.brand small {
  display: block;
  color: var(--muted);
}

#topNav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: end;
}

#topNav a {
  padding: 10px 12px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.62);
}

.shell {
  padding: clamp(20px, 4vw, 52px);
}

.loading,
.panel,
.cart,
.hero-box,
.order-card,
.menu-item,
.menu-edit-card,
.kitchen-order {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.loading {
  padding: 40px;
}

.restaurant-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 24px;
  align-items: stretch;
  margin-bottom: 26px;
}

.hero-box {
  padding: 24px;
}

.hero-box p {
  color: var(--muted);
  line-height: 1.6;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(2.3rem, 5vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

h2 {
  letter-spacing: -0.04em;
}

.lead,
.muted {
  color: var(--muted);
}

.info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}

.info-row span,
.pill {
  display: inline-flex;
  padding: 8px 11px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-weight: 900;
}

.info-row span:first-child {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.customer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: start;
}

.cart,
.panel {
  position: sticky;
  top: 92px;
  padding: 20px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.section-heading.compact {
  margin-bottom: 14px;
}

.menu-list,
.orders-list,
.form-stack,
.menu-editor,
.cart-items {
  display: grid;
  gap: 12px;
}

.menu-list {
  margin-top: 16px;
}

.menu-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  box-shadow: none;
}

.menu-editor {
  margin-bottom: 26px;
}

.menu-edit-card {
  padding: 16px;
  box-shadow: none;
}

.menu-edit-form {
  display: grid;
  grid-template-columns: minmax(160px, 1.1fr) minmax(120px, 0.7fr) minmax(90px, 0.4fr) auto;
  gap: 10px;
  align-items: end;
}

.menu-edit-form .wide {
  grid-column: 1 / -1;
}

.menu-edit-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-item p {
  margin: 6px 0 0;
  color: var(--muted);
}

.price {
  font-size: 1.12rem;
  font-weight: 900;
}

.button {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 10px 26px rgba(61, 31, 9, 0.1);
  cursor: pointer;
  font-weight: 900;
}

.button.primary {
  background: var(--brand);
  color: #fff;
}

.button.danger {
  color: var(--danger);
  background: #fff0ec;
}

.button.full {
  width: 100%;
}

.cart-row,
.total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cart-row {
  padding: 10px;
  border-radius: 14px;
  background: #fff8ef;
}

.cart-row button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

.order-info {
  display: grid;
  gap: 6px;
  margin: 10px 0 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff8ef;
}

.order-info p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.order-status {
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 900;
}

.order-status.open {
  color: #12613f;
  background: #eaf8f0;
}

.order-status.closed {
  color: var(--danger);
  background: #fff0ec;
}

.cart-notice {
  margin: 10px 0;
  padding: 12px;
  border-radius: 14px;
  background: #f7efe2;
  color: var(--muted);
  font-weight: 900;
}

.cart-notice.warning {
  color: var(--danger);
  background: #fff0ec;
}

.small-note {
  margin: 0;
  font-size: 0.84rem;
}

.legal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin: 28px 0 0;
  color: var(--muted);
  font-weight: 900;
}

.legal-footer a {
  color: inherit;
  text-decoration: none;
}

.legal-footer a:hover {
  color: var(--brand);
}

.legal-textarea {
  min-height: 170px;
  font-family: inherit;
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.total-row {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.total-row.grand {
  font-size: 1.2rem;
  font-weight: 900;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 72px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(241, 102, 35, 0.13);
}

.message {
  margin-top: 14px;
  padding: 13px;
  border-radius: 16px;
  background: #eaf8f0;
  color: #12613f;
  font-weight: 900;
}

.message.error {
  background: #fff0ec;
  color: var(--danger);
}

.message.success {
  background: #eaf8f0;
  color: #12613f;
}

.soft-line {
  width: 100%;
  margin: 22px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.data-actions {
  display: grid;
  gap: 10px;
}

.data-actions a.button {
  display: inline-grid;
  place-items: center;
  text-decoration: none;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.report-card {
  display: grid;
  gap: 7px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 30px rgba(61, 31, 9, 0.08);
}

.report-card.highlight {
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
}

.report-card.wide {
  grid-column: 1 / -1;
}

.report-card span,
.report-card small {
  color: inherit;
  opacity: 0.78;
  font-weight: 900;
}

.report-card strong {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  letter-spacing: -0.05em;
}

.report-list {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.report-list li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.hidden {
  display: none !important;
}

.admin-grid {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  margin-top: 22px;
}

.order-card {
  padding: 18px;
  box-shadow: none;
}

.order-top,
.order-actions,
.order-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.kitchen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

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

.admin-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.kitchen-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(61, 31, 9, 0.08);
}

.stat-card strong {
  display: block;
  font-size: 2rem;
}

.kitchen-orders {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
}

.kitchen-order {
  padding: 22px;
}

.kitchen-order.new {
  border-color: var(--brand);
  box-shadow: 0 0 0 5px rgba(241, 102, 35, 0.12), var(--shadow);
}

.kitchen-order h2 {
  font-size: 2rem;
}

.kitchen-order .customer-line {
  font-size: 1.25rem;
  font-weight: 900;
}

.kitchen-items {
  margin: 16px 0;
  padding: 0;
  list-style: none;
}

.kitchen-items li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 1.18rem;
  font-weight: 900;
}

.kitchen-order .order-actions .button {
  min-height: 54px;
  padding-inline: 20px;
  font-size: 1.05rem;
}

.order-meta {
  justify-content: flex-start;
  margin: 10px 0;
}

.order-meta span {
  padding: 6px 9px;
  border-radius: 999px;
  background: #fff8ef;
  color: var(--muted);
  font-weight: 900;
  font-size: 0.84rem;
}

.order-card ul {
  margin: 12px 0;
  padding-left: 20px;
  line-height: 1.8;
}

.order-actions a.button {
  text-decoration: none;
}

.switch-row {
  display: flex;
  justify-content: space-between;
  grid-template-columns: none;
  align-items: center;
  padding: 11px;
  border-radius: 14px;
  background: #fff8ef;
}

.switch-row input {
  width: auto;
  transform: scale(1.2);
}

.hours-editor {
  display: grid;
  gap: 10px;
}

.hours-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 8px;
  align-items: center;
}

.hours-row .switch-row {
  margin: 0;
}

.share-tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.share-card {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(61, 31, 9, 0.08);
}

.share-card img {
  width: 92px;
  height: 92px;
  border-radius: 14px;
  background: #fff;
}

.share-card a {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--brand-dark);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-card-actions,
.office-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.qr-page {
  max-width: 1120px;
  margin: 0 auto;
}

.qr-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(230px, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.qr-card {
  min-height: 520px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #fff;
  box-shadow: var(--shadow);
  text-align: center;
}

.qr-card h2 {
  min-height: 72px;
}

.qr-card img {
  width: min(100%, 280px);
  height: auto;
  margin: 22px auto;
  border: 12px solid #fff7ee;
  border-radius: 24px;
}

.qr-card a {
  display: block;
  color: var(--muted);
  overflow-wrap: anywhere;
  text-decoration: none;
}

.office-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) 420px;
  gap: 24px;
  align-items: center;
  min-height: calc(100vh - 110px);
}

.office-hero h1 {
  font-size: clamp(2.5rem, 6vw, 5.4rem);
  line-height: 0.92;
}

.office-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.office-card li {
  margin: 12px 0;
  font-weight: 800;
}

.office-card img {
  display: block;
  width: 220px;
  height: 220px;
  margin: 24px auto 0;
  border-radius: 22px;
  background: #fff;
}

.setup-page {
  max-width: 1180px;
  margin: 0 auto;
}

.setup-grid {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  margin-top: 20px;
}

.setup-result {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.setup-links {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.setup-created,
.setup-link-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
}

.setup-link-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.setup-link-card a {
  display: block;
  max-width: 100%;
  margin-top: 5px;
  overflow: hidden;
  color: var(--brand-dark);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setup-created code {
  padding: 3px 7px;
  border-radius: 8px;
  background: #fff8ef;
}

.login-page {
  display: grid;
  min-height: calc(100vh - 130px);
  place-items: center;
}

.login-card {
  width: min(100%, 440px);
  position: static;
}

.track-page {
  display: grid;
  min-height: calc(100vh - 130px);
  place-items: center;
}

.track-card {
  width: min(100%, 620px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.legal-page {
  display: grid;
  min-height: calc(100vh - 130px);
  place-items: center;
}

.legal-card {
  width: min(100%, 760px);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.legal-content {
  margin: 18px 0;
  line-height: 1.7;
  color: var(--ink);
}

.legal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.legal-actions .button {
  text-decoration: none;
}

.track-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.track-actions .button {
  text-decoration: none;
}

.track-pill {
  display: inline-block;
  margin: 10px 0;
  padding: 10px 16px;
  border-radius: 999px;
  background: #fff8ef;
  color: var(--brand-dark);
  font-weight: 900;
}

.track-pill.accepted,
.track-pill.ready,
.track-pill.on_the_way,
.track-pill.delivered {
  background: #eaf8f0;
  color: #12613f;
}

.track-pill.cancelled {
  background: #fff0ec;
  color: var(--danger);
}

@media (max-width: 1000px) {
  .restaurant-hero,
  .customer-grid,
  .admin-grid,
  .office-hero,
  .setup-grid {
    grid-template-columns: 1fr;
  }

  .cart,
  .panel {
    position: static;
  }
}

@media (max-width: 700px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .menu-item {
    grid-template-columns: 1fr;
  }

  .menu-edit-form {
    grid-template-columns: 1fr;
  }

  .menu-edit-form .wide {
    grid-column: auto;
  }

  .kitchen-stats,
  .kitchen-orders,
  .qr-grid {
    grid-template-columns: 1fr;
  }

  .share-card {
    grid-template-columns: 1fr;
  }

  .report-grid {
    grid-template-columns: 1fr;
  }

  .track-actions {
    display: grid;
  }

  .track-actions .button {
    width: 100%;
  }

  .hours-row {
    grid-template-columns: 1fr;
  }

  .setup-link-card {
    grid-template-columns: 1fr;
  }
}

@media print {
  .topbar,
  .button,
  .admin-actions,
  .kitchen-actions,
  .panel,
  .menu-editor,
  .section-heading.compact {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .shell {
    padding: 0;
  }

  .order-card {
    border: 0;
    box-shadow: none;
    page-break-inside: avoid;
  }

  .qr-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10mm;
  }

  .qr-card {
    min-height: auto;
    box-shadow: none;
    break-inside: avoid;
  }
}
