:root {
  --espresso: #3e2723;
  --mocha: #5d4037;
  --cream: #fff8f0;
  --latte: #d7ccc8;
  --caramel: #c17817;
  --mint: #6b8f71;
  --white: #ffffff;
  --shadow: 0 8px 32px rgba(62, 39, 35, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "DM Sans", system-ui, sans-serif;
  background: linear-gradient(145deg, var(--cream), #f5e6d3 50%, var(--latte));
  color: var(--espresso);
  min-height: 100dvh;
}

#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; }

.screen { display: none; padding: 20px 20px 90px; animation: fade 0.25s ease; }
.screen.active { display: block; }

@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.hero { padding: 40px 0 32px; }
.logo { font-family: "Cormorant Garamond", serif; font-size: 3.5rem; letter-spacing: 0.15em; line-height: 1; }
.logo-sub { font-family: "Cormorant Garamond", serif; font-size: 1.8rem; color: var(--caramel); letter-spacing: 0.4em; margin-bottom: 16px; }
.tagline { opacity: 0.75; line-height: 1.5; }

.card-btn {
  display: flex; align-items: center; gap: 16px; width: 100%;
  background: var(--white); border: none; border-radius: 20px;
  padding: 20px; margin-bottom: 14px; box-shadow: var(--shadow);
  cursor: pointer; text-align: left; font: inherit; color: inherit;
  transition: transform 0.15s;
}
.card-btn:active { transform: scale(0.98); }
.card-icon { font-size: 2rem; width: 52px; height: 52px; display: grid; place-items: center;
  background: rgba(93, 64, 55, 0.08); border-radius: 14px; }
.card-btn small { display: block; opacity: 0.65; margin-top: 4px; font-size: 0.85rem; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; padding-top: 8px;
}
.topbar h2 { font-family: "Cormorant Garamond", serif; font-size: 1.6rem; }
.btn-text { background: none; border: none; color: var(--mocha); font-weight: 600; cursor: pointer; font-size: 0.9rem; }

.tabs {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; display: flex; background: var(--white);
  border-top: 1px solid var(--latte); padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 100;
}
.tab {
  flex: 1; border: none; background: none; padding: 10px;
  font-size: 0.75rem; color: var(--mocha); opacity: 0.5; cursor: pointer;
}
.tab.active { opacity: 1; color: var(--caramel); font-weight: 700; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 0.8rem; margin-bottom: 6px; opacity: 0.7; }
.field input, .field textarea, .field select {
  width: 100%; padding: 14px 16px; border: none; border-radius: 14px;
  background: var(--white); font: inherit; box-shadow: var(--shadow);
}

.btn {
  width: 100%; padding: 16px; border: none; border-radius: 16px;
  background: var(--mocha); color: white; font-weight: 600; font-size: 1rem;
  cursor: pointer; margin-top: 8px;
}
.btn.secondary { background: var(--latte); color: var(--espresso); }
.btn.success { background: var(--mint); }
.btn.danger { background: #c45c5c; }

.list-card {
  background: var(--white); border-radius: 18px; padding: 16px;
  margin-bottom: 12px; box-shadow: var(--shadow); cursor: pointer;
}
.list-card h3 { font-size: 1.05rem; margin-bottom: 4px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 600;
}
.badge.on { background: rgba(107, 143, 113, 0.2); color: var(--mint); }
.badge.off { background: var(--latte); color: var(--mocha); }
.badge-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.menu-row { display: flex; gap: 12px; align-items: flex-start; }
.menu-img {
  width: 72px; height: 72px; border-radius: 12px; object-fit: cover;
  background: var(--latte); flex-shrink: 0;
}
.menu-img.placeholder { display: grid; place-items: center; font-size: 1.5rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  padding: 8px 14px; border-radius: 20px; border: 1px solid var(--latte);
  background: var(--cream); font-size: 0.85rem; cursor: pointer;
}
.chip.selected { background: var(--mocha); color: white; border-color: var(--mocha); }

.avatar-wrap { text-align: center; margin: 16px 0; }
.avatar {
  width: 100px; height: 100px; border-radius: 50%; object-fit: cover;
  background: var(--latte); border: 3px solid var(--caramel);
  cursor: pointer;
}
.avatar.empty { display: inline-grid; place-items: center; font-size: 2.5rem; }

.cart-bar {
  position: fixed; bottom: 70px; left: 50%; transform: translateX(-50%);
  width: calc(100% - 40px); max-width: 440px; z-index: 50;
}
.loyalty {
  background: rgba(193, 120, 23, 0.12); border-radius: 16px;
  padding: 14px 16px; margin-bottom: 16px; display: flex; gap: 10px; align-items: center;
}

.order-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.order-actions button { flex: 1; min-width: 80px; padding: 10px; font-size: 0.8rem; }

.shift-card {
  text-align: center; padding: 32px 20px; background: var(--white);
  border-radius: 24px; box-shadow: var(--shadow);
}
.shift-card .big-icon { font-size: 4rem; margin-bottom: 12px; }

#toast {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%) translateY(-120%);
  background: var(--espresso); color: white; padding: 12px 20px;
  border-radius: 12px; font-size: 0.9rem; z-index: 200; transition: transform 0.3s;
  max-width: 90%;
}
#toast.show { transform: translateX(-50%) translateY(0); }

.empty { text-align: center; padding: 48px 20px; opacity: 0.6; }

.order-progress {
  margin-top: 12px;
  height: 4px;
  background: var(--latte);
  border-radius: 4px;
  overflow: hidden;
}
.order-progress-bar {
  height: 100%;
  background: var(--caramel);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.order-status-steps {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-top: 12px;
}

.order-status-steps .step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.order-status-steps .step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--latte);
  color: var(--mocha);
  border: 1px solid var(--latte);
}

.order-status-steps .step.active .step-dot {
  background: rgba(193, 120, 23, 0.2);
  border-color: var(--caramel);
  color: var(--espresso);
}

.order-status-steps .step.done .step-dot {
  background: rgba(193, 120, 23, 0.15);
  border-color: var(--caramel);
  color: var(--caramel);
}

.order-status-steps .step-label {
  font-size: 0.65rem;
  text-align: center;
  opacity: 0.65;
}

.order-status-steps .step.active .step-label {
  font-weight: 700;
  opacity: 1;
  color: var(--espresso);
}

.order-status-steps .step-line {
  flex: 0 0 20px;
  width: 20px;
  height: 2px;
  background: var(--latte);
  margin-top: 14px;
  align-self: flex-start;
}

.order-status-steps .step-line.done {
  background: var(--caramel);
}

.badge.status-preparing { background: rgba(193, 120, 23, 0.2); color: var(--caramel); }
.badge.status-ready { background: rgba(107, 143, 113, 0.2); color: var(--mint); }
.badge.status-completed { background: var(--latte); color: var(--mocha); }
.badge.status-cancelled { background: rgba(196, 92, 92, 0.15); color: #a04040; }

.order-as-usual {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  text-align: left;
  border: none;
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 16px;
  background: rgba(93, 64, 55, 0.06);
  box-shadow: var(--shadow);
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.order-as-usual:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.order-as-usual strong { display: block; margin-bottom: 4px; }
.order-as-usual small { opacity: 0.7; font-size: 0.85rem; }

.location-closed-banner {
  background: var(--latte);
  color: var(--mocha);
  padding: 14px 16px;
  border-radius: 16px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.chip.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.prepare-time { margin-top: 16px; }
.prepare-time > label { display: block; font-weight: 600; margin-bottom: 4px; }
.prepare-time-hint { font-size: 0.8rem; opacity: 0.65; margin-bottom: 12px; }

.time-chips {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.time-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 2px;
  border: none;
  border-radius: 12px;
  background: var(--white);
  color: var(--espresso);
  font: inherit;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.15s, color 0.15s;
}

.time-chip .chip-mins { font-weight: 700; font-size: 0.95rem; line-height: 1; }
.time-chip .chip-unit { font-size: 0.6rem; opacity: 0.7; }
.time-chip .chip-clock {
  font-size: 0.58rem;
  opacity: 0.55;
  margin-top: 2px;
}

.time-chip.active {
  background: var(--mocha);
  color: var(--white);
}
.time-chip.active .chip-unit,
.time-chip.active .chip-clock { opacity: 0.85; color: inherit; }

.ready-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  padding: 16px;
  background: rgba(193, 120, 23, 0.12);
  border-radius: 16px;
  font-size: 1.5rem;
}

.ready-caption {
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.7;
  margin-top: 6px;
}
