/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #E8521A;
  --primary-light: #FF7A45;
  --primary-dark: #C0420F;
  --amber: #F5A623;
  --bg: #FFF8F2;
  --card: #FFFFFF;
  --text: #1C1C1C;
  --text-muted: #6B6B6B;
  --border: #E8D5C4;
  --success: #27AE60;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-hover: 0 6px 24px rgba(0,0,0,0.14);
  --radius: 16px;
  --radius-sm: 10px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ===== ORDER PAGE ===== */
.order-page header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  padding: 24px 20px 20px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(232,82,26,0.3);
}

.order-page header .logo {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.order-page header .logo span {
  opacity: 0.85;
  font-weight: 400;
}

.order-page header .tagline {
  font-size: 0.9rem;
  opacity: 0.88;
  margin-top: 2px;
}

.order-page main {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 16px 120px;
}

/* Section titles */
.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 14px;
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title:first-of-type { margin-top: 4px; }

/* Menu cards */
.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (min-width: 480px) {
  .menu-grid { grid-template-columns: 1fr 1fr 1fr; }
}

.menu-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 12px;
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  transition: all 0.2s ease;
  text-align: center;
  cursor: default;
}

.menu-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.menu-card.has-items { border-color: var(--primary); }

.menu-card .food-emoji {
  font-size: 2.4rem;
  line-height: 1;
  margin-bottom: 8px;
  display: block;
}

.menu-card .food-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 4px;
}

.menu-card .food-price {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.qty-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.qty-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: white;
  color: var(--primary);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  line-height: 1;
  padding-bottom: 1px;
}

.qty-btn:hover { background: var(--primary); color: white; }
.qty-btn:active { transform: scale(0.92); }

.qty-value {
  font-size: 1.1rem;
  font-weight: 700;
  min-width: 24px;
  text-align: center;
  color: var(--text);
}

.qty-input {
  width: 48px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  border: 1.5px solid #E5E7EB;
  border-radius: 8px;
  padding: 4px 2px;
  background: white;
  outline: none;
  -moz-appearance: textfield;
}
.qty-input:focus { border-color: var(--primary); }
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Combo section */
.combo-grid {
  display: grid;
  gap: 10px;
}

.combo-card {
  background: linear-gradient(135deg, #FFF3E8, #FFE4CC);
  border: 2px solid var(--amber);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.combo-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }

.combo-info .combo-name { font-weight: 700; font-size: 0.95rem; }
.combo-info .combo-desc { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.combo-price {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--primary);
  white-space: nowrap;
}

.combo-btn {
  background: var(--amber);
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s;
  color: white;
}
.combo-btn:hover { background: #e0941a; }

/* Uitverkocht */
.menu-card.out-of-stock {
  opacity: 0.55;
  pointer-events: none;
}
.out-of-stock-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #E53E3E;
  background: #FEE2E2;
  border-radius: 8px;
  padding: 4px 10px;
  display: inline-block;
}

/* Sauce section */
.sauce-info-bar {
  background: #FFF3CD;
  border: 1px solid #F0C040;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.83rem;
  color: #7A5700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sauce-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.sauce-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  user-select: none;
}

.sauce-card:hover { border-color: var(--primary-light); transform: translateY(-1px); }
.sauce-card.selected { border-color: var(--primary); background: #FFF0EB; }

.sauce-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--primary);
  color: white;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 10px;
  padding: 2px 6px;
}

.sauce-badge.free { background: var(--success); }

.sauce-emoji { font-size: 2rem; display: block; margin-bottom: 6px; }
.sauce-name { font-size: 0.8rem; font-weight: 600; }
.sauce-price { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

/* Order summary */
.order-summary {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-top: 8px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.summary-row:last-of-type { border-bottom: none; }
.summary-row.total {
  font-weight: 700;
  font-size: 1.1rem;
  padding-top: 10px;
  margin-top: 4px;
  border-top: 2px solid var(--border);
  border-bottom: none;
}

.summary-row.discount-row {
  color: var(--success);
  font-weight: 600;
  border-bottom: none;
}

.summary-empty {
  color: var(--text-muted);
  font-size: 0.88rem;
  text-align: center;
  padding: 8px;
}

/* Table / Name input */
.order-info {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
  background: white;
}

.form-group input:focus { outline: none; border-color: var(--primary); }
.form-group input.input-error { border-color: #E53E3E; animation: shake 0.3s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-6px); }
  75%       { transform: translateX(6px); }
}

/* Order button */
.order-btn-wrapper {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, var(--bg) 30%);
  padding: 20px 16px 24px;
  z-index: 50;
}

.order-btn {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  display: block;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 16px 24px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(232,82,26,0.4);
  letter-spacing: 0.3px;
}

.order-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(232,82,26,0.5);
}

.order-btn:disabled {
  background: #CCCCCC;
  box-shadow: none;
  cursor: not-allowed;
}

/* Success overlay */
.success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.success-overlay.show { opacity: 1; pointer-events: all; }

.success-card {
  background: white;
  border-radius: 24px;
  padding: 40px 32px;
  text-align: center;
  max-width: 340px;
  width: 90%;
  transform: scale(0.8);
  transition: transform 0.3s;
}

.success-overlay.show .success-card { transform: scale(1); }

.success-icon { font-size: 4rem; margin-bottom: 12px; }
.success-title { font-size: 1.4rem; font-weight: 800; margin-bottom: 8px; }
.success-msg { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 24px; }
.success-order-nr { font-size: 2.5rem; font-weight: 900; color: var(--primary); }
.success-order-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

.success-new-btn {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 28px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 16px;
  transition: background 0.2s;
}

.success-new-btn:hover { background: var(--primary-dark); }

/* ===== KITCHEN PAGE ===== */
.kitchen-page {
  background: #111827;
  color: #F3F4F6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.kitchen-header {
  background: #1F2937;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #374151;
  flex-shrink: 0;
}

.kitchen-header .kh-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #F9FAFB;
}

.kitchen-header .kh-subtitle {
  font-size: 0.78rem;
  color: #9CA3AF;
  margin-top: 2px;
}

.kitchen-stats {
  display: flex;
  gap: 12px;
}

.kstat {
  text-align: center;
  background: #374151;
  border-radius: 10px;
  padding: 7px 16px;
}

.kstat .kstat-nr { font-size: 1.4rem; font-weight: 800; line-height: 1; }
.kstat .kstat-label { font-size: 0.68rem; color: #9CA3AF; margin-top: 2px; }
.kstat.new .kstat-nr     { color: #F59E0B; }
.kstat.cooking .kstat-nr { color: #F97316; }
.kstat.ready .kstat-nr   { color: #34D399; }

.kitchen-clock {
  font-size: 1.3rem;
  font-weight: 700;
  color: #D1D5DB;
  font-variant-numeric: tabular-nums;
}

/* ===== 3-COLUMN LAYOUT ===== */
.kitchen-columns {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  flex: 1;
  overflow: hidden;
}

.kitchen-column {
  display: flex;
  flex-direction: column;
  border-right: 1px solid #1F2937;
  overflow: hidden;
}

.kitchen-column:last-child { border-right: none; }

.col-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 12px;
  border-bottom: 2px solid #1F2937;
  flex-shrink: 0;
}

.col-new     .col-header { background: #1a1600; border-bottom-color: #78350F; }
.col-cooking .col-header { background: #1a0e00; border-bottom-color: #9A3412; }
.col-ready   .col-header { background: #001a0d; border-bottom-color: #065F46; }

.col-icon  { font-size: 1.2rem; }
.col-title { font-size: 1rem; font-weight: 800; color: #F9FAFB; flex: 1; }

.col-count {
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 20px;
  padding: 2px 9px;
}

.col-new     .col-count { background: #78350F; color: #FCD34D; }
.col-cooking .col-count { background: #9A3412; color: #FED7AA; }
.col-ready   .col-count { background: #065F46; color: #6EE7B7; }

.col-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.col-body::-webkit-scrollbar { width: 4px; }
.col-body::-webkit-scrollbar-track { background: transparent; }
.col-body::-webkit-scrollbar-thumb { background: #374151; border-radius: 4px; }

.col-empty {
  display: none;
  text-align: center;
  color: #4B5563;
  font-size: 0.85rem;
  padding: 24px 16px;
}

/* ===== ORDER CARD ===== */
.order-card {
  background: #1F2937;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid #374151;
  animation: slideIn 0.35s ease;
  flex-shrink: 0;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.status-new     { border-color: #D97706; }
.status-cooking { border-color: #EA580C; }
.status-ready   { border-color: #10B981; background: #052e1c; }

.order-card-header {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #374151;
}

.order-nr {
  font-size: 1.4rem;
  font-weight: 900;
  color: #F9FAFB;
  line-height: 1;
}

.order-table-badge {
  font-size: 0.78rem;
  font-weight: 600;
  color: #9CA3AF;
  margin-top: 2px;
}

.order-timer {
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 5px 12px;
  border-radius: 8px;
  background: #374151;
  color: #F9FAFB;
}

.order-timer.warning { background: #78350F; color: #FCD34D; }
.order-timer.urgent  { background: #7F1D1D; color: #FCA5A5; animation: pulse 1s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.65; }
}

.order-card-body { padding: 10px 14px 8px; }

.order-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 8px;
  margin-bottom: 4px;
}

.item-emoji { font-size: 1.2rem; line-height: 1; }
.item-name  { font-size: 0.9rem; font-weight: 500; flex: 1; color: #E5E7EB; }
.item-qty {
  background: #374151;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #D1D5DB;
}

.order-sauces {
  border-top: 1px solid #2D3748;
  margin-top: 6px;
  padding-top: 8px;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.sauce-chip {
  background: #374151;
  border-radius: 20px;
  padding: 3px 9px;
  font-size: 0.74rem;
  color: #D1D5DB;
  display: flex;
  align-items: center;
  gap: 3px;
}

.order-card-footer {
  padding: 10px 14px 12px;
  border-top: 1px solid #374151;
  display: flex;
  gap: 8px;
}

.btn-action {
  flex: 1;
  border: none;
  border-radius: 10px;
  padding: 11px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
}

.btn-action:hover  { filter: brightness(1.15); }
.btn-action:active { transform: scale(0.97); }

.btn-start { background: #D97706; color: #FFF7E6; }
.btn-ready { background: #10B981; color: #ECFDF5; }
.btn-serve { background: #1D4ED8; color: #EFF6FF; }

.btn-print {
  background: #374151;
  color: #D1D5DB;
  border: none;
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}
.btn-print:hover { background: #4B5563; }

/* Connection indicator */
.connection-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #EF4444;
  display: inline-block;
  margin-right: 6px;
  transition: background 0.3s;
}

.connection-dot.connected { background: #10B981; box-shadow: 0 0 6px #10B981; }
