:root {
  --bg: #f1f0e6;
  --surface: #f7f6ee;
  --surface-alt: #e7e8df;
  --sage: #c0c3bc;
  --sage-dark: #8e928a;
  --ink: #111110;
  --ink-muted: #5c5c55;
  --border: #d7d5ca;
  --border-strong: #111110;
  --success: #2f4b36;
  --success-bg: #e3ece4;
  --danger: #8b2e2e;
  --danger-bg: #f4e3e3;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --display: 'owners-wide', 'Archivo Black', Impact, sans-serif;
  --serif: 'Malayalam MN', 'Optima', 'Belleza', Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

.page-shell {
  min-height: 100vh;
  padding: 2rem 1rem 3.5rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* ==================== CLIENT MENU SHEET ==================== */
.menu-sheet {
  width: 100%;
  max-width: 560px;
  padding: 1.5rem 1.5rem 2.25rem;
  background: var(--bg);
}

.menu-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 2.25rem;
}

.lunchbox-badge {
  position: relative;
  width: 224px;
  height: 224px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.lunchbox-svg,
.lunchbox-img {
  width: 94%;
  height: 94%;
  display: block;
  object-fit: contain;
}

.badge-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: rotate(-12.6deg);
  pointer-events: none;
  padding-top: 6px;
}

.badge-title {
  font-family: var(--display);
  font-weight: 900;
  font-style: italic;
  font-size: 1.9rem;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-week {
  font-family: var(--display);
  font-weight: 900;
  font-style: italic;
  font-size: 1.8rem;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--ink);
  margin-top: 0.55rem;
}

.hero-subtitle {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin: 0.35rem 0 0;
  letter-spacing: 0.01em;
}

.closed-banner {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--danger);
  background: var(--danger-bg);
  color: var(--danger);
  font-family: var(--mono);
  font-size: 0.82rem;
  border-radius: 4px;
  width: 100%;
}

/* Menu List */
.menu-section {
  margin-bottom: 2rem;
}

.menu-col-header {
  display: flex;
  justify-content: flex-end;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--ink);
  padding-bottom: 0.65rem;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 1rem;
}

.menu-list {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.menu-item {
  padding: 0.9rem 0.95rem;
  border: 1px solid transparent;
  border-radius: 6px;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.menu-item.has-qty {
  background-color: var(--surface-alt);
  border-color: var(--sage-dark);
}

.menu-item.sold-out {
  opacity: 0.58;
}

.menu-item-top {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.94rem;
  line-height: 1.48;
}

.dish-name {
  flex: 1 1 auto;
  color: var(--ink);
  word-break: break-word;
}

.dish-tag {
  display: inline-block;
  margin-left: 0.45rem;
  padding: 0.05rem 0.4rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  border: 1px solid var(--ink-muted);
  border-radius: 3px;
  color: var(--ink-muted);
  vertical-align: middle;
}

.dish-tag.sold-out-tag {
  border-color: var(--danger);
  color: var(--danger);
}

.dish-dots {
  flex: 0 1 48px;
  min-width: 18px;
  border-bottom: 2px dotted var(--ink-muted);
  margin-bottom: 5px;
}

.dish-prices {
  flex: 0 0 auto;
  font-weight: 500;
  white-space: nowrap;
}

.stepper-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px dashed rgba(17, 17, 16, 0.12);
}

.stepper-group {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: var(--surface);
  overflow: hidden;
}

.stepper button {
  width: 30px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.12s ease;
}

.stepper button:hover:not(:disabled) {
  background: var(--sage);
}

.stepper button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.stepper .qty-val {
  min-width: 26px;
  text-align: center;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--ink);
  border-left: 1px solid rgba(17, 17, 16, 0.15);
  border-right: 1px solid rgba(17, 17, 16, 0.15);
  padding: 0 0.35rem;
  line-height: 28px;
}

/* Order Panel */
.order-panel {
  border-top: 1.5px solid var(--ink);
  padding-top: 1.35rem;
  margin-top: 1rem;
}

.order-summary-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 1.25rem;
}

.summary-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.summary-detail {
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 500;
  margin-top: 0.1rem;
}

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

.summary-amount {
  font-family: var(--mono);
  font-size: 1.3rem;
  font-weight: 600;
}

.order-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.form-grid.three-col {
  grid-template-columns: 1.1fr 0.8fr 1.1fr;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--ink-muted);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 0.62rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.86rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  outline: none;
  transition: border-color 0.15s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--ink);
}

.payment-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill {
  padding: 0.42rem 0.85rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.14s ease;
}

.pill.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.payment-note {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--ink-muted);
  background: var(--surface-alt);
  padding: 0.65rem 0.85rem;
  border-radius: 4px;
}

.form-error {
  padding: 0.65rem 0.85rem;
  border-radius: 4px;
  background: var(--danger-bg);
  color: var(--danger);
  font-family: var(--mono);
  font-size: 0.8rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.72rem 1.15rem;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--ink);
  transition: transform 0.08s ease, background-color 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
}

.btn-primary:hover:not(:disabled) {
  background: #2b2b28;
}

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

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
}

.btn-secondary:hover {
  background: var(--surface-alt);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: var(--ink);
}

.btn-block {
  width: 100%;
}

/* Confirmation Panel */
.confirmation-panel {
  border: 1.5px solid var(--ink);
  background: var(--surface);
  border-radius: 6px;
  padding: 1.5rem 1.25rem;
  margin-top: 1rem;
  text-align: center;
}

.confirm-check {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  background: var(--success-bg);
  color: var(--success);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  border-radius: 999px;
  margin-bottom: 0.65rem;
}

.confirmation-panel h2 {
  margin: 0 0 0.25rem;
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 600;
}

.confirm-id {
  margin: 0 0 1.2rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.confirm-lines {
  text-align: left;
  border-top: 1px dashed var(--border);
  border-bottom: 1px dashed var(--border);
  padding: 0.85rem 0;
  margin-bottom: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.82rem;
}

.confirm-line {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.confirm-total-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.confirmation-panel .payment-note {
  text-align: left;
  margin-bottom: 1.1rem;
}

/* Brand Footer */
.brand-footer {
  margin-top: 3rem;
  text-align: center;
}

.wordmark-img {
  width: min(230px, 68%);
  height: auto;
  display: inline-block;
}

.wordmark-main {
  font-family: var(--serif);
  font-size: 2.35rem;
  font-weight: 500;
  letter-spacing: 0.11em;
  line-height: 1;
  color: var(--ink);
}

.wordmark-sub {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  margin-top: 0.2rem;
  color: var(--ink);
}

.footer-links {
  margin-top: 1.4rem;
}

.text-link {
  background: none;
  border: none;
  padding: 0.25rem 0.5rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--ink-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.text-link:hover {
  color: var(--ink);
}

/* ==================== CHEF ADMIN PORTAL ==================== */
.admin-sheet {
  width: 100%;
  max-width: 980px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1.5px solid var(--ink);
  margin-bottom: 1.5rem;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.wordmark-mini {
  font-family: var(--serif);
  font-size: 1.3rem;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.admin-badge {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.55rem;
  background: var(--sage);
  border-radius: 4px;
}

.pin-gate {
  max-width: 420px;
  margin: 3.5rem auto;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: center;
}

.pin-gate h2 {
  margin: 0 0 0.4rem;
  font-family: var(--serif);
}

.muted-text {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.pin-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.15rem;
}

.pin-form input {
  flex: 1;
  padding: 0.65rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
}

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.week-switcher {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.week-switcher label {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--ink-muted);
}

.week-switcher select {
  padding: 0.58rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.84rem;
  background: var(--surface);
  border: 1px solid var(--ink);
  border-radius: 4px;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.toast {
  padding: 0.65rem 0.95rem;
  margin-bottom: 1rem;
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.8rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.95rem 1rem;
}

.stat-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.stat-value {
  display: block;
  font-family: var(--mono);
  font-size: 1.4rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

.admin-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.tab-btn {
  padding: 0.65rem 1.05rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--mono);
  font-size: 0.84rem;
  color: var(--ink-muted);
  cursor: pointer;
}

.tab-btn.active {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--ink);
}

.panel-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.panel-header h3 {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.82rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.65rem 0.6rem;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.data-table th.num,
.data-table td.num {
  text-align: right;
}

.data-table tfoot td {
  font-weight: 600;
  border-top: 1.5px solid var(--ink);
  border-bottom: none;
}

.orders-cards {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.order-card {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 6px;
  padding: 0.95rem 1rem;
}

.order-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.order-customer {
  font-family: var(--mono);
  font-size: 0.9rem;
}

.order-meta {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
  margin-top: 0.15rem;
}

.order-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.order-total-pill {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.92rem;
}

.status-select {
  padding: 0.32rem 0.55rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  border-radius: 4px;
  border: 1px solid var(--ink);
  background: var(--surface);
}

.status-select.status-Paid,
.status-select.status-Fulfilled {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success);
}

.status-select.status-Cancelled {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger);
}

.order-items-ul {
  margin: 0;
  padding-left: 1.1rem;
  font-family: var(--mono);
  font-size: 0.8rem;
}

.order-note-line {
  margin-top: 0.55rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border);
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--ink-muted);
}

/* Menu Editor */
.editor-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.editor-item-card {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 6px;
  padding: 0.9rem;
  display: grid;
  grid-template-columns: 1fr 100px 100px 110px auto;
  gap: 0.75rem;
  align-items: end;
}

.editor-item-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-end;
}

.toggle-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  cursor: pointer;
}

.editor-footer {
  margin-top: 1.25rem;
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 760px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .form-grid,
  .form-grid.three-col {
    grid-template-columns: 1fr;
  }
  .editor-item-card {
    grid-template-columns: 1fr 1fr;
  }
  .editor-item-card > :first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .menu-sheet {
    padding: 0.75rem 0.5rem 2rem;
  }
  .lunchbox-badge {
    width: 192px;
    height: 192px;
  }
  .badge-title {
    font-size: 1.63rem;
  }
  .badge-week {
    font-size: 1.54rem;
    margin-top: 0.45rem;
  }
}
