:root {
  --bg: #f4f1ea;
  --paper: #fffcf7;
  --ink: #171412;
  --muted: #6b635c;
  --accent: #0c7c59;
  --accent-2: #f09d51;
  --danger: #a63d40;
  --line: #e7dbcf;
  --card-shadow: 0 18px 38px rgba(28, 26, 24, 0.08);
  --radius-lg: 18px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: 'Avenir Next', 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top right, #f6dcc1 0%, var(--bg) 45%, #ece7de 100%);
}

body {
  min-height: 100vh;
}

.app-shell {
  width: min(1100px, 94vw);
  margin: 26px auto 40px;
}

.hero {
  background: linear-gradient(130deg, #1f363d 0%, #185b63 48%, #158068 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--card-shadow);
}

.hero h1 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: 0.02em;
}

.hero p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.88);
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 18px;
}

@media (min-width: 920px) {
  .grid.cols-2 {
    grid-template-columns: 1.25fr 0.75fr;
  }

  .grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--card-shadow);
}

.card h2,
.card h3 {
  margin: 0;
}

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

.menu-list {
  display: grid;
  gap: 12px;
}

.menu-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  background: #fff;
}

.menu-title-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.price {
  font-weight: 700;
  color: #0e6d5f;
}

.qty-controls {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

button {
  border: none;
  background: var(--ink);
  color: #fff;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
}

button:hover {
  opacity: 0.92;
}

button.secondary {
  background: #3f5f56;
}

button.light {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

button.warn {
  background: var(--danger);
}

a.button-link {
  display: inline-block;
  text-decoration: none;
  border-radius: 10px;
  padding: 9px 12px;
  color: #fff;
  background: #3f5f56;
}

a.button-link.light {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #d5c8ba;
  border-radius: 10px;
  padding: 9px 10px;
  background: #fff;
}

textarea {
  min-height: 86px;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.row.wrap {
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.86rem;
  background: #e8f4f1;
  color: #19594a;
}

.order-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  background: #fff;
}

.order-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.status-new {
  background: #ffefc8;
  color: #835600;
}

.status-preparing {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-ready {
  background: #dcfce7;
  color: #166534;
}

.status-served {
  background: #f1f5f9;
  color: #334155;
}

.status-cancelled {
  background: #fee2e2;
  color: #b91c1c;
}

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

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 6px;
  text-align: left;
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-weight: 600;
}

.notice {
  border-left: 4px solid var(--accent-2);
  padding: 10px 12px;
  background: #fff6eb;
  border-radius: 10px;
}

.qr-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  background: #fff;
}

.qr-card img {
  width: 220px;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 6px;
}

hr.soft {
  border: 0;
  border-top: 1px dashed #d7cabd;
  margin: 14px 0;
}

.text-right {
  text-align: right;
}

.small {
  font-size: 0.92rem;
}

.zone-title.completed {
  color: #8f8a84;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.zone-meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.zone-done-note {
  color: #8f8a84;
  font-size: 0.88rem;
}

/* Front user mobile-first layout */
.user-page .user-shell {
  width: min(980px, 94vw);
  margin: 16px auto 120px;
}

.user-page .user-hero {
  border-radius: 20px;
  padding: 18px;
}

.user-page .access-gate {
  margin-top: 12px;
  border-color: #f0d8b6;
  background: #fff7eb;
}

.user-page .access-gate h2 {
  margin: 0;
  font-size: 1.05rem;
}

.user-page .category-tabs-wrap {
  margin-top: 14px;
  padding: 10px;
  position: sticky;
  top: 8px;
  z-index: 12;
  background: rgba(255, 252, 247, 0.94);
  backdrop-filter: blur(4px);
}

.user-page .category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.user-page .category-tabs::-webkit-scrollbar {
  display: none;
}

.user-page .cat-tab {
  border: 1px solid var(--line);
  background: #fff;
  color: #22322f;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.9rem;
  flex: 0 0 auto;
}

.user-page .cat-tab.active {
  background: #1f5f57;
  color: #fff;
  border-color: #1f5f57;
}

.user-page .menu-sections {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.user-page .category-section {
  scroll-margin-top: 92px;
  padding: 14px;
}

.user-page .category-section h2 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

.user-page .user-menu-item {
  padding: 10px;
}

.user-page .cart-fab {
  position: fixed;
  right: 14px;
  bottom: 18px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  background: #113f3a;
  color: #fff;
  padding: 10px 14px;
  box-shadow: 0 14px 30px rgba(16, 42, 40, 0.35);
}

.user-page .cart-fab-label {
  font-weight: 700;
}

.user-page .cart-fab-count {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f59f57;
  color: #1f1a16;
  font-size: 0.82rem;
  font-weight: 700;
}

.user-page .cart-fab-total {
  opacity: 0.92;
  font-weight: 700;
}

.user-page .cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 16, 16, 0.34);
  z-index: 31;
}

.user-page .cart-drawer {
  position: fixed;
  right: 0;
  bottom: 0;
  width: min(420px, 100vw);
  max-height: 82vh;
  background: #fffaf4;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  border: 1px solid #dccfbe;
  padding: 14px;
  z-index: 32;
  transform: translateY(104%);
  transition: transform 0.25s ease;
  overflow-y: auto;
}

.user-page .cart-drawer.open {
  transform: translateY(0);
}

.user-page .cart-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.user-page .cart-drawer-head h2 {
  margin: 0;
  font-size: 1.2rem;
}

.user-page .cart-drawer-footer {
  margin-top: 10px;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}

.user-page .checkout-breakdown {
  display: grid;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.user-page .checkout-breakdown-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.88rem;
  color: #4f4a43;
}

.user-page .checkout-breakdown-row.total {
  margin-top: 3px;
  padding-top: 5px;
  border-top: 1px dashed #d7cabd;
  font-size: 0.95rem;
  color: #1c1a19;
}

.user-page .cart-item-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 9px;
  background: #fff;
  margin-bottom: 8px;
}

.user-page .cart-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-page .cart-item-breakdown {
  margin-top: 6px;
  display: grid;
  gap: 2px;
}

.user-page .cart-item-breakdown > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.83rem;
  color: #5d574f;
}

.user-page .cart-item-breakdown .line-total {
  margin-top: 2px;
  padding-top: 3px;
  border-top: 1px dashed #e1d6ca;
  color: #1f1b18;
}

.user-page .cart-item-breakdown strong,
.user-page .checkout-breakdown strong {
  font-weight: 700;
}

@media (min-width: 860px) {
  .user-page .user-shell {
    margin-bottom: 70px;
  }

  .user-page .menu-sections {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .user-page .category-section {
    scroll-margin-top: 106px;
  }

  .user-page .cart-drawer {
    border-radius: 18px;
    right: 18px;
    bottom: 18px;
    max-height: 76vh;
    transform: translateY(110%);
  }

  .user-page .cart-drawer.open {
    transform: translateY(0);
  }
}
