:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --text: #211b16;
  --text-muted: #7a6f63;
  --border: #e8e2da;
  --accent: #c1541c;
  --accent-text: #ffffff;
  --danger: #b3261e;
  --success: #2e7d32;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(33, 27, 22, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17140f;
    --surface: #221e18;
    --text: #f2ede4;
    --text-muted: #a89d8e;
    --border: #362f26;
    --accent: #e0783f;
    --accent-text: #1a1208;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.45;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px 96px;
}

header.site-header {
  padding: 20px 16px 8px;
  text-align: center;
}

header.site-header h1 {
  margin: 0 0 4px;
  font-size: 1.4rem;
  letter-spacing: 0.01em;
}

header.site-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

header.site-header p.notice {
  margin-top: 8px;
  font-size: 0.78rem;
}

header.site-header p.notice a {
  color: var(--accent);
}

h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 24px 0 10px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.menu-item:last-child {
  border-bottom: none;
}

.menu-item-info {
  min-width: 0;
}

.menu-item-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.menu-item-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 2px;
}

.menu-item-price {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 2px;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.qty-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.qty-btn:active {
  transform: scale(0.95);
}

.qty-value {
  min-width: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.add-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}

.add-btn:active {
  transform: scale(0.97);
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 12px 0 6px;
}

input[type='text'],
input[type='tel'],
input[type='number'],
input[type='password'],
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
}

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

.btn-primary {
  display: block;
  width: 100%;
  padding: 14px;
  margin-top: 16px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-text);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  display: inline-block;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
}

.btn-danger {
  border-color: var(--danger);
  color: var(--danger);
}

.cart-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
}

.cart-bar[hidden] {
  display: none;
}

.cart-bar-summary {
  font-size: 0.9rem;
}

.cart-bar-total {
  font-weight: 700;
  font-size: 1.05rem;
}

.cart-bar button {
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
  cursor: pointer;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 16px;
}

.message {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-top: 12px;
}

.message.error {
  background: rgba(179, 38, 30, 0.1);
  color: var(--danger);
}

.message.success {
  background: rgba(46, 125, 50, 0.12);
  color: var(--success);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 20;
}

.modal-backdrop[hidden] {
  display: none;
}

@media (min-width: 520px) {
  .modal-backdrop {
    align-items: center;
  }
}

.modal {
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
}

@media (min-width: 520px) {
  .modal {
    border-radius: var(--radius);
  }
}

.modal h2 {
  margin-top: 0;
}

.confirmation {
  text-align: center;
  padding: 48px 16px;
}

.confirmation .icon {
  font-size: 2.5rem;
}

.admin-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.admin-item:last-child {
  border-bottom: none;
}

.admin-item.unavailable {
  opacity: 0.5;
}

.admin-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.icon-btn {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 6px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 0.9rem;
}

.top-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--border);
  color: var(--text-muted);
  margin-left: 6px;
}

.tabs {
  display: flex;
  gap: 6px;
}

.tab-btn {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.order-day {
  margin-bottom: 20px;
}

.order-day-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0 6px;
}

.order-day-header .date {
  font-weight: 700;
}

.order-day-header .summary {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.order-entry {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.order-entry:last-child {
  border-bottom: none;
}

.order-entry-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.order-entry-flat {
  font-weight: 600;
}

.order-entry-time {
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.order-entry-items {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

.order-entry-note {
  font-size: 0.82rem;
  margin-top: 4px;
  font-style: italic;
  color: var(--text-muted);
}

.order-entry-total {
  font-weight: 700;
  margin-top: 4px;
}

.payment-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin: 16px 0;
  text-align: left;
}

.payment-card[hidden] {
  display: none;
}

.payment-card img {
  width: 84px;
  height: 84px;
  border-radius: 6px;
  background: #fff;
  flex-shrink: 0;
}

.payment-card-title {
  font-weight: 700;
}

.payment-card-sub {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 2px;
}

.payment-card-upi {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 4px;
  font-family: monospace;
}

.payment-card-sub a {
  color: var(--accent);
}

.pay-app-btn {
  display: inline-block;
  width: auto;
  margin-top: 10px;
  padding: 8px 16px;
  font-size: 0.85rem;
  text-decoration: none;
}

#confirmation-payment {
  text-align: left;
  margin-top: 20px;
}
