:root {
  --bg: #f6f1ea;
  --card: #ffffff;
  --ink: #1e1b18;
  --muted: #6f655d;
  --teal: #0d6b6b;
  --accent: #d96b3f;
  --accent-soft: #f6d6c8;
  --shadow: 0 16px 40px rgba(16, 24, 40, 0.08);
  --radius: 18px;
  --radius-lg: 26px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top, #fff7ef, #f1ebe3 45%, #f7f2ea 100%);
  min-height: 100vh;
}

#app {
  padding: 20px 18px 120px;
  max-width: 980px;
  margin: 0 auto;
}

.tab-screens {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tab-screen {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #fff, #f9ede4 60%, #f4dccd 100%);
  box-shadow: var(--shadow);
}

.brand-mark {
  font-family: "Fraunces", serif;
  font-size: 28px;
  letter-spacing: 0.5px;
}

.brand-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.hero-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.hero-user {
  font-size: 13px;
  color: var(--muted);
}

.pill {
  background: #e8f2f2;
  color: var(--teal);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
}

.mode-card {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.mode-title {
  font-weight: 700;
  margin-bottom: 10px;
}

.mode-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.mode-btn {
  border: 1px solid #eadfd6;
  background: #fff;
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
}

.mode-btn.active {
  border-color: var(--teal);
  color: var(--teal);
  background: #e8f2f2;
}

.mode-info {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.mode-form {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mode-form input {
  flex: 1 1 140px;
  border: 1px solid #eadfd6;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
}

.primary-btn,
.ghost-btn {
  border-radius: 12px;
  padding: 10px 16px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
}

.primary-btn {
  background: var(--teal);
  color: #fff;
}

.ghost-btn {
  background: #f5efe8;
  color: var(--ink);
}

.mode-hint {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.category-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 20px 0 10px;
  padding-bottom: 6px;
}

.category-chip {
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #eadfd6;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.category-chip.active {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

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

.menu-skeleton {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.skeleton-card,
.skeleton-row {
  position: relative;
  overflow: hidden;
  background: #f2e9df;
  border-radius: var(--radius);
  min-height: 160px;
}

.skeleton-row {
  min-height: 68px;
}

.skeleton-card::after,
.skeleton-row::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0));
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

.loading {
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

.item-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.item-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.item-content {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.item-title {
  font-weight: 700;
  font-size: 16px;
}

.item-desc {
  color: var(--muted);
  font-size: 13px;
  min-height: 32px;
}

.item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.price {
  font-weight: 700;
  color: var(--teal);
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid #eadfd6;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}

.qty-value {
  min-width: 20px;
  text-align: center;
  font-weight: 600;
}

.empty-state {
  margin-top: 24px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  background: #fff;
  border-radius: var(--radius);
}

.orders-section {
  margin-top: 26px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.orders-header h3 {
  margin: 0 0 4px;
}

.orders-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.orders-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.orders-skeleton {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.orders-empty {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.order-card {
  background: #f8f3ee;
  border-radius: 16px;
  padding: 12px 14px;
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.order-card.highlight {
  box-shadow: 0 0 0 2px var(--teal);
}

.order-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.order-id {
  font-weight: 700;
  font-size: 14px;
}

.order-meta,
.order-date {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.order-status {
  font-size: 11px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e8f2f2;
  color: var(--teal);
  white-space: nowrap;
}

.status-new {
  background: #fff0d8;
  color: #a95a00;
}

.status-preparing {
  background: #e8f2f2;
  color: var(--teal);
}

.status-ready {
  background: #e4f1e8;
  color: #1b7d3b;
}

.status-delivered {
  background: #eef2ff;
  color: #3b5bcc;
}

.status-cancelled {
  background: #fde8e8;
  color: #b42318;
}

.order-bottom {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 13px;
}

.order-total {
  font-weight: 700;
  color: var(--teal);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 13, 0.6);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 18px;
  z-index: 50;
}

.modal-card {
  background: #fff;
  width: min(920px, 100%);
  max-height: 90vh;
  overflow: auto;
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.modal-title {
  font-weight: 700;
  font-size: 18px;
}

.modal-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.modal-status {
  margin: 12px 0;
  font-weight: 600;
  color: var(--teal);
}

.modal-body {
  display: grid;
  gap: 12px;
  font-size: 14px;
}

.modal-items {
  display: grid;
  gap: 8px;
}

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

.modal-total {
  font-weight: 700;
  color: var(--teal);
}

.cart-panel {
  background: #fff;
  width: min(920px, 100%);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.cart-page {
  max-height: none;
  overflow: visible;
}

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

.cart-count {
  font-size: 12px;
  color: var(--muted);
}

.cart-total {
  font-size: 18px;
  font-weight: 700;
  color: var(--teal);
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cart-header h2 {
  margin: 0 0 6px;
}

.cart-items {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-skeleton {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: #f8f3ee;
}

.cart-item-title {
  font-weight: 600;
}

.cart-item-meta {
  font-size: 12px;
  color: var(--muted);
}

.checkout {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #efe4da;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.checkout h3 {
  margin: 0;
}

.checkout-block {
  display: grid;
  gap: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 13px;
  color: var(--muted);
}

.field input,
.field textarea {
  border-radius: 12px;
  border: 1px solid #eadfd6;
  padding: 10px 12px;
  font-family: inherit;
}

.hint {
  font-size: 12px;
  color: var(--muted);
}

.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  display: none;
  z-index: 50;
}

.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px 12px 16px;
  background: rgba(246, 241, 234, 0.96);
  border-top: 1px solid #efe4da;
  backdrop-filter: blur(10px);
  z-index: 40;
}

.tab-btn {
  border: none;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  padding: 10px 12px;
  font-size: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.tab-btn.active {
  background: var(--teal);
  color: #fff;
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  padding: 0 6px;
}

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

  .hero-meta {
    align-items: flex-start;
  }

  .cart-panel {
    border-radius: 18px;
  }
}
