:root {
  --cream-50: #fffdf8;
  --cream-100: #fbf7ef;
  --cream-200: #f2eadc;
  --sage-50: #f2f6f0;
  --sage-100: #e4eddf;
  --sage-300: #abc09e;
  --sage-500: #718c68;
  --sage-600: #5d7755;
  --sage-700: #465e40;
  --coral-50: #fff5ef;
  --coral-200: #f7d5c2;
  --coral-400: #e99972;
  --coral-500: #db7e58;
  --apricot: #f3c990;
  --ink-900: #2f382f;
  --ink-700: #4d594d;
  --ink-500: #707a70;
  --ink-400: #8c948c;
  --white: #ffffff;
  --danger: #c96a61;
  --danger-soft: #fff0ec;
  --success-soft: #eef6eb;
  --shadow-sm: 0 6px 20px rgba(77, 70, 54, 0.07);
  --shadow-md: 0 16px 44px rgba(77, 70, 54, 0.11);
  --shadow-lg: 0 24px 70px rgba(61, 57, 46, 0.17);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-xl: 34px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink-900);
  background: var(--cream-100);
  font-family: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.no-scroll {
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none !important;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(113, 140, 104, 0.25);
  outline-offset: 2px;
}

svg {
  display: block;
}

.mobile-only {
  display: none !important;
}

.site-header,
.chef-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  padding: 0 clamp(22px, 4vw, 72px);
  border-bottom: 1px solid rgba(90, 101, 86, 0.1);
  background: rgba(255, 253, 248, 0.88);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-900);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 15px;
  color: var(--sage-700);
  background: var(--sage-100);
}

.brand-mark svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 19px;
  letter-spacing: 0.08em;
}

.brand small {
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.header-note,
.prototype-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--sage-700);
  font-size: 13px;
}

.status-dot,
.prototype-badge span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #87a57d;
  box-shadow: 0 0 0 5px rgba(135, 165, 125, 0.13);
}

.prototype-badge.is-offline span {
  background: var(--coral-400);
  box-shadow: 0 0 0 5px rgba(233, 153, 114, 0.14);
}

.customer-page {
  background:
    radial-gradient(circle at 3% 6%, rgba(243, 201, 144, 0.14), transparent 25%),
    radial-gradient(circle at 88% 22%, rgba(171, 192, 158, 0.15), transparent 24%),
    var(--cream-100);
}

.customer-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: clamp(28px, 4vw, 60px);
  width: min(1440px, calc(100% - 8vw));
  margin: 0 auto;
  padding: 40px 0 70px;
}

.menu-content {
  min-width: 0;
}

.welcome-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 250px;
  padding: clamp(32px, 5vw, 58px);
  overflow: hidden;
  border: 1px solid rgba(105, 129, 96, 0.08);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(128deg, rgba(255, 255, 255, 0.8), rgba(242, 246, 240, 0.88)),
    var(--sage-50);
  box-shadow: var(--shadow-sm);
}

.welcome-panel::before,
.welcome-panel::after {
  position: absolute;
  content: '';
  border-radius: 50%;
}

.welcome-panel::before {
  top: -80px;
  right: -45px;
  width: 270px;
  height: 270px;
  background: rgba(243, 201, 144, 0.23);
}

.welcome-panel::after {
  right: 150px;
  bottom: -100px;
  width: 210px;
  height: 210px;
  background: rgba(171, 192, 158, 0.17);
}

.welcome-copy {
  position: relative;
  z-index: 2;
}

.eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--sage-600);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.welcome-copy h1,
.chef-welcome h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 47px);
  line-height: 1.22;
  letter-spacing: -0.04em;
}

.welcome-copy p,
.chef-welcome p {
  margin: 18px 0 0;
  color: var(--ink-500);
  font-size: 15px;
  line-height: 1.85;
}

.welcome-illustration {
  position: relative;
  z-index: 2;
  flex: 0 0 250px;
}

.welcome-illustration svg {
  width: 100%;
  overflow: visible;
}

.welcome-illustration .plate-shadow {
  fill: none;
  stroke: rgba(70, 94, 64, 0.15);
  stroke-width: 8;
  stroke-linecap: round;
}

.welcome-illustration .plate { fill: #fffaf1; }
.welcome-illustration .bowl { fill: #d9e7d3; }
.welcome-illustration .food { fill: #efb87c; }
.welcome-illustration .pea { fill: #75966d; }

.steam {
  position: absolute;
  top: -2px;
  width: 2px;
  height: 39px;
  border-radius: 50%;
  background: linear-gradient(transparent, rgba(93, 119, 85, 0.42), transparent);
  animation: steam 3s ease-in-out infinite;
}

.steam-one { left: 105px; }
.steam-two { left: 143px; animation-delay: -1.4s; }

@keyframes steam {
  0%, 100% { opacity: 0; transform: translateY(8px) rotate(5deg); }
  45% { opacity: 1; }
  75% { opacity: 0.5; transform: translateY(-9px) rotate(-8deg); }
}

.section-heading,
.view-toolbar,
.selection-heading,
.editor-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.section-heading {
  margin: 44px 2px 20px;
}

.section-heading h2,
.selection-heading h2,
.view-toolbar h2 {
  margin: 0;
  font-size: 25px;
  line-height: 1.25;
}

.quiet-label {
  color: var(--ink-400);
  font-size: 13px;
}

.filter-row {
  display: flex;
  gap: 9px;
  margin-bottom: 22px;
  padding: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar { display: none; }

.filter-button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 16px;
  border: 1px solid var(--cream-200);
  border-radius: 999px;
  color: var(--ink-500);
  background: rgba(255, 255, 255, 0.62);
  cursor: pointer;
  transition: 180ms ease;
}

.filter-button:hover,
.filter-button.is-active {
  border-color: var(--sage-300);
  color: var(--sage-700);
  background: var(--sage-100);
}

.dish-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.dish-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(85, 94, 81, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 7px 24px rgba(77, 70, 54, 0.055);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.dish-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(77, 70, 54, 0.1);
}

.dish-card.is-selected {
  border-color: var(--sage-500);
  box-shadow: 0 0 0 2px rgba(113, 140, 104, 0.1), var(--shadow-sm);
}

.dish-image-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  margin: 8px 8px 0;
  overflow: hidden;
  border-radius: 20px;
  background: var(--cream-100);
}

.dish-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 350ms ease;
}

.dish-card:hover .dish-image-wrap img { transform: scale(1.03); }

.selected-check {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: white;
  background: var(--sage-600);
  box-shadow: 0 5px 14px rgba(70, 94, 64, 0.3);
  opacity: 0;
  transform: scale(0.7);
  transition: 180ms ease;
}

.is-selected .selected-check {
  opacity: 1;
  transform: scale(1);
}

.selected-check svg,
.icon-button svg,
.primary-button svg,
.secondary-button svg,
.back-link svg,
.mobile-selection-icon svg,
.chef-tab svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dish-card-body {
  padding: 16px 17px 18px;
}

.dish-category {
  color: var(--coral-500);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.dish-card h3 {
  margin: 6px 0 7px;
  overflow: hidden;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dish-card p {
  display: -webkit-box;
  min-height: 42px;
  margin: 0;
  overflow: hidden;
  color: var(--ink-500);
  font-size: 13px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.select-dish-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  margin-top: 14px;
  border: 1px solid var(--sage-100);
  border-radius: 13px;
  color: var(--sage-700);
  background: var(--sage-50);
  cursor: pointer;
  transition: 180ms ease;
}

.select-dish-button:hover { background: var(--sage-100); }
.is-selected .select-dish-button { color: var(--ink-500); background: var(--cream-100); }

.selection-panel {
  position: sticky;
  top: 24px;
  align-self: start;
  max-height: calc(100vh - 48px);
  padding: 28px;
  overflow-y: auto;
  border: 1px solid rgba(85, 94, 81, 0.09);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 248, 0.92);
  box-shadow: var(--shadow-md);
  scrollbar-width: thin;
}

.selection-heading {
  align-items: flex-start;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--cream-200);
}

.selection-heading h2 { font-size: 21px; }

.selected-list {
  display: grid;
  gap: 10px;
  min-height: 135px;
  padding: 18px 0;
}

.empty-selection,
.empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
}

.empty-selection {
  min-height: 135px;
  color: var(--ink-400);
}

.empty-icon,
.empty-state-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 10px;
  border-radius: 18px;
  color: var(--sage-500);
  background: var(--sage-50);
}

.empty-icon svg,
.empty-state-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty-selection strong,
.empty-selection span { display: block; }
.empty-selection strong { color: var(--ink-700); font-size: 14px; }
.empty-selection span { margin-top: 5px; font-size: 12px; }

.selected-item {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 11px;
  padding: 8px;
  border-radius: 16px;
  background: var(--cream-50);
}

.selected-item img {
  width: 50px;
  height: 50px;
  border-radius: 13px;
  object-fit: cover;
}

.selected-item strong,
.selected-item small { display: block; }
.selected-item strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.selected-item small { margin-top: 3px; color: var(--ink-400); font-size: 11px; }

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  color: var(--ink-500);
  background: transparent;
  cursor: pointer;
}

.icon-button:hover { color: var(--danger); background: var(--danger-soft); }
.remove-selected svg { width: 18px; height: 18px; }

.order-form {
  padding-top: 20px;
  border-top: 1px solid var(--cream-200);
}

.field-group {
  margin-bottom: 18px;
}

.field-group label,
.login-form > label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-700);
  font-size: 13px;
  font-weight: 600;
}

.field-group label span {
  color: var(--ink-400);
  font-size: 11px;
  font-weight: 400;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #e4ded2;
  border-radius: 13px;
  color: var(--ink-900);
  background: var(--white);
  transition: 160ms ease;
}

input,
select {
  height: 47px;
  padding: 0 14px;
}

textarea {
  min-height: 80px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.6;
}

input::placeholder,
textarea::placeholder { color: #adb3ab; }

input:focus,
textarea:focus,
select:focus {
  border-color: var(--sage-500);
  outline: none;
  box-shadow: 0 0 0 4px rgba(113, 140, 104, 0.11);
}

input.is-invalid,
textarea.is-invalid { border-color: var(--danger); }

.field-error {
  min-height: 17px;
  margin: 5px 2px 0;
  color: var(--danger);
  font-size: 11px;
}

.field-hint {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 5px 2px 0;
  color: var(--ink-400);
  font-size: 10px;
}

.field-hint .field-error { margin: 0; }

.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button {
  border: 1px solid var(--sage-600);
  color: white;
  background: var(--sage-600);
  box-shadow: 0 8px 19px rgba(93, 119, 85, 0.21);
}

.primary-button:hover { background: var(--sage-700); transform: translateY(-1px); }
.primary-button:active,
.secondary-button:active,
.danger-button:active { transform: translateY(1px); }

.secondary-button {
  border: 1px solid #ded8cc;
  color: var(--ink-700);
  background: var(--white);
}

.secondary-button:hover { border-color: var(--sage-300); background: var(--sage-50); }

.danger-button {
  border: 1px solid var(--danger);
  color: white;
  background: var(--danger);
}

.submit-order { width: 100%; }
.submit-order svg { width: 18px; height: 18px; }

.prototype-note {
  margin: 10px 0 0;
  color: var(--ink-400);
  font-size: 10px;
  text-align: center;
}

.toast-region {
  position: fixed;
  z-index: 100;
  top: 22px;
  left: 50%;
  display: grid;
  gap: 10px;
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  padding: 13px 17px;
  border: 1px solid rgba(73, 85, 71, 0.1);
  border-radius: 14px;
  color: var(--ink-700);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow-md);
  animation: toast-in 250ms ease both;
}

.toast.is-leaving { animation: toast-out 220ms ease both; }
.toast::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--sage-500); }
.toast.is-error::before { background: var(--danger); }

@keyframes toast-in { from { opacity: 0; transform: translateY(-12px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px); } }

.dialog-backdrop {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(42, 49, 41, 0.38);
  backdrop-filter: blur(7px);
}

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

.success-dialog,
.confirm-dialog {
  width: min(420px, 100%);
  padding: 36px;
  border-radius: 28px;
  background: var(--cream-50);
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: dialog-in 260ms ease both;
}

@keyframes dialog-in { from { opacity: 0; transform: translateY(14px) scale(0.97); } }

.success-bell,
.warning-icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin: 0 auto 20px;
  border-radius: 24px;
}

.success-bell { color: var(--sage-600); background: var(--sage-100); }
.warning-icon { color: var(--danger); background: var(--danger-soft); }

.success-bell svg,
.warning-icon svg {
  width: 38px;
  height: 38px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.success-bell .check { stroke: var(--coral-500); stroke-width: 2.4; }
.success-dialog h2,
.confirm-dialog h2 { margin: 0; font-size: 23px; }
.success-dialog p,
.confirm-dialog p { margin: 13px 0 25px; color: var(--ink-500); font-size: 14px; line-height: 1.7; }
.success-dialog .primary-button { min-width: 140px; }

.sheet-backdrop { display: none; }

/* 厨师端登录 */
.chef-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 20%, rgba(243, 201, 144, 0.18), transparent 26%),
    radial-gradient(circle at 83% 80%, rgba(171, 192, 158, 0.2), transparent 28%),
    var(--cream-100);
}

.chef-page.is-locked { overflow: hidden; }

.chef-login {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  min-width: 320px;
  padding: 24px;
  overflow: auto;
  background:
    radial-gradient(circle at 12% 12%, rgba(243, 201, 144, 0.24), transparent 27%),
    radial-gradient(circle at 88% 85%, rgba(171, 192, 158, 0.23), transparent 30%),
    var(--cream-100);
}

.login-card {
  position: relative;
  z-index: 2;
  width: min(445px, 100%);
  padding: 42px;
  border: 1px solid rgba(85, 94, 81, 0.09);
  border-radius: 32px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: var(--shadow-lg);
}

.brand-centered { justify-content: center; width: 100%; }

.login-copy {
  margin: 36px 0 25px;
  text-align: center;
}

.login-copy h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.35;
}

.login-copy p { margin: 10px 0 0; color: var(--ink-500); font-size: 14px; }

.password-input-wrap { position: relative; }
.password-input-wrap input { padding-right: 66px; }

.text-button {
  position: absolute;
  top: 50%;
  right: 7px;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  color: var(--sage-600);
  background: transparent;
  transform: translateY(-50%);
  cursor: pointer;
}

.login-form .primary-button { width: 100%; margin-top: 5px; }

.demo-password {
  margin: 18px 0 0;
  padding: 10px;
  border-radius: 12px;
  color: var(--ink-500);
  background: var(--sage-50);
  font-size: 12px;
  text-align: center;
}

.demo-password span { color: var(--coral-500); }

.back-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 24px;
  color: var(--ink-500);
  font-size: 12px;
  text-decoration: none;
}

.back-link:hover { color: var(--sage-700); }
.back-link svg { width: 15px; height: 15px; }

.login-decoration {
  position: absolute;
  width: 180px;
  height: 90px;
  border: 1px solid rgba(113, 140, 104, 0.13);
  border-radius: 100% 0;
  transform: rotate(30deg);
}

.login-leaf-one { top: 10%; left: 7%; }
.login-leaf-two { right: 7%; bottom: 10%; transform: rotate(210deg); }

/* 厨师端应用 */
.chef-header {
  position: sticky;
  top: 0;
}

.chef-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.prototype-badge {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--sage-50);
}

.compact-button { min-height: 40px; padding: 0 16px; font-size: 13px; }

.chef-main {
  width: min(1520px, calc(100% - 7vw));
  margin: 0 auto;
  padding: 42px 0 70px;
}

.chef-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.chef-welcome h1 { font-size: clamp(27px, 3.3vw, 41px); }

.date-card {
  flex: 0 0 auto;
  padding: 15px 22px;
  border: 1px solid rgba(85, 94, 81, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-sm);
  color: var(--ink-500);
  font-size: 12px;
  text-align: center;
}

.date-card strong { display: block; margin-bottom: 3px; color: var(--ink-900); font-size: 17px; }

.chef-tabs {
  display: flex;
  gap: 8px;
  margin: 38px 0 32px;
  padding: 5px;
  border: 1px solid rgba(85, 94, 81, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow-sm);
}

.chef-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 13px;
  color: var(--ink-500);
  background: transparent;
  cursor: pointer;
}

.chef-tab:hover { color: var(--sage-700); }
.chef-tab.is-active { color: var(--sage-700); background: var(--sage-100); font-weight: 600; }
.chef-tab svg { width: 18px; height: 18px; }

.tab-badge {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  color: white;
  background: var(--coral-500);
  font-size: 11px;
}

.chef-view { display: none; }
.chef-view.is-active { display: block; }

.view-toolbar { margin-bottom: 22px; }
.view-toolbar h2 { font-size: 25px; }

.segmented-control {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid #e8e0d4;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
}

.segmented-control button {
  min-height: 38px;
  padding: 0 15px;
  border: 0;
  border-radius: 10px;
  color: var(--ink-500);
  background: transparent;
  cursor: pointer;
}

.segmented-control button.is-active {
  color: var(--sage-700);
  background: var(--sage-100);
  font-weight: 600;
}

.segmented-control span { margin-left: 3px; font-size: 11px; }

.orders-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.order-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 22px;
  border: 1px solid rgba(85, 94, 81, 0.09);
  border-radius: 23px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-sm);
}

.order-card.is-completed { background: rgba(255, 253, 248, 0.68); box-shadow: none; }

.order-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--cream-200);
}

.guest-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 43px;
  height: 43px;
  border-radius: 16px;
  color: var(--sage-700);
  background: var(--sage-100);
  font-size: 16px;
  font-weight: 700;
}

.guest-info { display: flex; align-items: center; gap: 11px; min-width: 0; }
.guest-info h3 { margin: 0; font-size: 17px; }
.guest-info time { display: block; margin-top: 3px; color: var(--ink-400); font-size: 11px; }

.order-status {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--coral-500);
  background: var(--coral-50);
  font-size: 10px;
  font-weight: 600;
}

.order-card.is-completed .order-status { color: var(--sage-600); background: var(--sage-50); }

.order-dishes { margin: 17px 0; }
.order-dishes span { display: block; margin-bottom: 9px; color: var(--ink-400); font-size: 11px; }
.order-dishes ul { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.order-dishes li { position: relative; padding-left: 15px; color: var(--ink-700); font-size: 14px; }
.order-dishes li::before { position: absolute; top: 8px; left: 1px; width: 5px; height: 5px; border-radius: 50%; background: var(--apricot); content: ''; }

.order-note {
  margin: 0 0 17px;
  padding: 11px 13px;
  border-radius: 13px;
  color: var(--ink-500);
  background: var(--cream-100);
  font-size: 12px;
  line-height: 1.6;
}

.order-note strong { color: var(--ink-700); font-weight: 600; }
.no-note { color: var(--ink-400); }

.complete-order {
  width: 100%;
  margin-top: auto;
}

.completed-time {
  margin-top: auto;
  color: var(--ink-400);
  font-size: 11px;
  text-align: right;
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 300px;
  padding: 36px;
  border: 1px dashed #ddd7cc;
  border-radius: 24px;
  color: var(--ink-500);
  background: rgba(255, 255, 255, 0.48);
}

.empty-state h3 { margin: 0 0 7px; color: var(--ink-700); font-size: 17px; }
.empty-state p { margin: 0; font-size: 13px; }

.menu-management-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  align-items: start;
  gap: 26px;
}

.dish-management-area {
  min-width: 0;
}

.menu-list-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  margin-bottom: 14px;
  color: var(--ink-500);
  font-size: 12px;
}

.menu-list-summary p { margin: 0; }
.menu-list-summary strong { color: var(--ink-900); }

.availability-legend { display: flex; gap: 15px; }
.availability-legend span { display: flex; align-items: center; gap: 6px; }
.availability-legend i { width: 7px; height: 7px; border-radius: 50%; background: #c8c9c4; }
.availability-legend i.online { background: var(--sage-500); }

.managed-dish-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.managed-dish-card {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(85, 94, 81, 0.09);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 5px 17px rgba(77, 70, 54, 0.05);
}

.managed-dish-card.is-unavailable { background: rgba(249, 247, 242, 0.74); }

.managed-dish-image {
  position: relative;
  width: 116px;
  height: 116px;
  overflow: hidden;
  border-radius: 15px;
  background: var(--cream-100);
}

.managed-dish-image img { width: 100%; height: 100%; object-fit: cover; }
.is-unavailable .managed-dish-image img { filter: saturate(0.55); opacity: 0.78; }

.availability-label {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 7px;
  border-radius: 999px;
  color: white;
  background: rgba(93, 119, 85, 0.88);
  backdrop-filter: blur(5px);
  font-size: 9px;
}

.is-unavailable .availability-label { background: rgba(93, 96, 91, 0.78); }

.managed-dish-content { display: flex; flex-direction: column; min-width: 0; padding: 3px 2px 2px 0; }
.managed-dish-content h3 { margin: 4px 0 5px; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.managed-dish-content > p { display: -webkit-box; margin: 0; overflow: hidden; color: var(--ink-500); font-size: 11px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }

.managed-actions {
  display: flex;
  gap: 5px;
  margin-top: auto;
}

.small-action {
  min-height: 31px;
  padding: 0 9px;
  border: 1px solid #e4ded2;
  border-radius: 10px;
  color: var(--ink-500);
  background: var(--white);
  font-size: 10px;
  cursor: pointer;
}

.small-action:hover { border-color: var(--sage-300); color: var(--sage-700); }
.small-action.delete:hover { border-color: #ecc0ba; color: var(--danger); background: var(--danger-soft); }

.dish-editor {
  position: sticky;
  top: 98px;
  padding: 25px;
  border: 1px solid rgba(85, 94, 81, 0.09);
  border-radius: 24px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: var(--shadow-md);
}

.editor-heading { align-items: flex-start; margin-bottom: 20px; }
.editor-heading h3 { margin: 0; font-size: 20px; }

.image-picker { margin-bottom: 20px; }

.image-preview {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px dashed #d8d1c5;
  border-radius: 17px;
  background: var(--cream-100);
}

.image-preview img { width: 100%; height: 100%; object-fit: cover; }

.image-placeholder { display: grid; place-items: center; padding: 20px; color: var(--ink-400); text-align: center; }
.image-placeholder svg { width: 28px; height: 28px; margin-bottom: 8px; fill: none; stroke: var(--sage-500); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.image-placeholder strong { color: var(--ink-700); font-size: 12px; font-weight: 600; }
.image-placeholder span { margin-top: 4px; font-size: 9px; }

.image-button { width: 100%; min-height: 39px; margin-top: 8px; font-size: 12px; }
.image-process-info { margin: 6px 1px 0; color: var(--ink-400); font-size: 9px; }
.image-process-info.is-success { color: var(--sage-600); }
.image-process-info.is-error { color: var(--danger); }

.switch-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  margin: 4px 0 20px;
  padding: 13px 0;
  cursor: pointer;
}

.switch-row strong,
.switch-row small { display: block; }
.switch-row strong { font-size: 13px; }
.switch-row small { margin-top: 4px; color: var(--ink-400); font-size: 10px; font-weight: 400; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }

.switch-control {
  position: relative;
  width: 45px;
  height: 26px;
  border-radius: 999px;
  background: #d8d7d1;
  transition: 180ms ease;
}

.switch-control::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
  content: '';
  transition: 180ms ease;
}

.switch-row input:checked + .switch-control { background: var(--sage-500); }
.switch-row input:checked + .switch-control::after { transform: translateX(19px); }

.editor-actions,
.dialog-actions { display: grid; grid-template-columns: 1fr 1.45fr; gap: 10px; }

.mobile-add-button { display: none; }

.confirm-dialog .warning-icon { width: 60px; height: 60px; border-radius: 20px; }
.confirm-dialog .warning-icon svg { width: 31px; height: 31px; }
.confirm-dialog .dialog-actions { grid-template-columns: 1fr 1fr; }

@media (max-width: 1240px) {
  .customer-shell { grid-template-columns: minmax(0, 1fr) 330px; width: min(1180px, calc(100% - 48px)); gap: 28px; }
  .dish-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .welcome-illustration { flex-basis: 210px; }
  .orders-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .managed-dish-grid { grid-template-columns: 1fr; }
  .menu-management-layout { grid-template-columns: minmax(0, 1fr) 370px; }
}

@media (max-width: 820px) {
  .desktop-only { display: none; }
  .mobile-only { display: inline-grid !important; }
  .site-header,
  .chef-header { height: 66px; padding: 0 18px; }
  .header-note { font-size: 11px; }
  .brand-mark { width: 38px; height: 38px; border-radius: 13px; }
  .brand-mark svg { width: 24px; height: 24px; }
  .brand strong { font-size: 17px; }
  .brand small { font-size: 9px; }

  .customer-shell { display: block; width: auto; padding: 18px 16px 108px; }
  .welcome-panel { min-height: 210px; padding: 28px 26px; border-radius: 26px; }
  .welcome-copy { max-width: 64%; }
  .welcome-copy h1 { font-size: clamp(27px, 7vw, 36px); }
  .welcome-copy p { margin-top: 12px; font-size: 13px; line-height: 1.7; }
  .welcome-illustration { position: absolute; right: -7px; bottom: 16px; width: 45%; max-width: 220px; }
  .welcome-panel::before { width: 220px; height: 220px; }
  .section-heading { margin-top: 34px; }
  .dish-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

  .selection-panel {
    position: fixed;
    z-index: 72;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    max-height: min(88vh, 760px);
    padding: 12px 20px calc(20px + env(safe-area-inset-bottom));
    border-radius: 26px 26px 0 0;
    transform: translateY(105%);
    transition: transform 280ms cubic-bezier(.2,.8,.2,1);
  }

  .selection-panel.is-open { transform: translateY(0); }
  .mobile-sheet-handle { width: 40px; height: 4px; margin: 0 auto 16px; border-radius: 999px; background: #d8d4ca; }
  .selection-heading { padding-bottom: 16px; }
  .selected-list { max-height: 220px; min-height: 100px; overflow-y: auto; }
  .sheet-backdrop { position: fixed; z-index: 70; inset: 0; display: block; background: rgba(42,49,41,0.32); backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: opacity 220ms ease; }
  .sheet-backdrop.is-open { opacity: 1; pointer-events: auto; }

  .mobile-selection-bar {
    position: fixed;
    z-index: 60;
    right: 13px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    left: 13px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 66px;
    padding: 10px 13px;
    border: 1px solid rgba(85, 94, 81, 0.09);
    border-radius: 20px;
    color: var(--ink-900);
    background: rgba(255, 253, 248, 0.96);
    box-shadow: 0 13px 38px rgba(61, 57, 46, 0.2);
    backdrop-filter: blur(12px);
    text-align: left;
  }

  .mobile-selection-icon { position: relative; display: grid; place-items: center; width: 43px; height: 43px; border-radius: 14px; color: var(--sage-700); background: var(--sage-100); }
  .mobile-selection-icon b { position: absolute; top: -5px; right: -5px; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border: 2px solid var(--cream-50); border-radius: 999px; color: white; background: var(--coral-500); font-size: 9px; }
  .mobile-selection-bar strong,
  .mobile-selection-bar small { display: block; }
  .mobile-selection-bar strong { font-size: 13px; }
  .mobile-selection-bar small { margin-top: 2px; color: var(--ink-400); font-size: 10px; }
  .mobile-bar-action { padding: 8px 12px; border-radius: 11px; color: white; background: var(--sage-600); font-size: 11px; }

  .chef-main { width: auto; padding: 26px 17px 55px; }
  .chef-welcome { align-items: flex-start; }
  .chef-welcome h1 { font-size: 28px; }
  .chef-welcome p { font-size: 12px; }
  .date-card { display: none; }
  .chef-tabs { position: sticky; z-index: 18; top: 76px; margin: 28px 0 26px; background: rgba(255,253,248,0.91); backdrop-filter: blur(12px); }
  .chef-tab { flex: 1; padding: 0 10px; }
  .view-toolbar { align-items: flex-start; }
  .orders-grid { grid-template-columns: 1fr; }
  .menu-toolbar { align-items: center; }
  .mobile-add-button { display: inline-flex; flex: 0 0 auto; }
  .menu-management-layout { display: block; }
  .managed-dish-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .managed-dish-card { grid-template-columns: 92px minmax(0, 1fr); gap: 12px; }
  .managed-dish-image { width: 92px; height: 105px; }

  .dish-editor {
    position: fixed;
    z-index: 72;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    max-height: 91vh;
    padding: 12px 20px calc(22px + env(safe-area-inset-bottom));
    overflow-y: auto;
    border-radius: 26px 26px 0 0;
    transform: translateY(105%);
    transition: transform 280ms cubic-bezier(.2,.8,.2,1);
  }

  .dish-editor.is-open { transform: translateY(0); }
  .editor-heading { margin-bottom: 16px; }
}

@media (max-width: 560px) {
  .site-header .header-note { display: none; }
  .welcome-panel { min-height: 228px; padding: 26px 22px; }
  .welcome-copy { max-width: 70%; }
  .welcome-copy p { max-width: 210px; }
  .welcome-illustration { right: -29px; bottom: 10px; width: 55%; }
  .section-heading h2 { font-size: 22px; }
  .dish-card { border-radius: 20px; }
  .dish-image-wrap { margin: 6px 6px 0; border-radius: 16px; }
  .dish-card-body { padding: 13px 12px 14px; }
  .dish-category { font-size: 9px; }
  .dish-card h3 { margin: 5px 0; font-size: 14px; }
  .dish-card p { min-height: 35px; font-size: 11px; line-height: 1.55; }
  .select-dish-button { min-height: 37px; margin-top: 11px; font-size: 12px; }
  .selected-check { top: 10px; right: 10px; width: 27px; height: 27px; }
  .selected-check svg { width: 16px; height: 16px; }

  .login-card { padding: 32px 22px; border-radius: 27px; }
  .login-copy { margin: 29px 0 22px; }
  .login-copy h1 { font-size: 24px; }
  .login-decoration { display: none; }

  .chef-header .brand small { display: none; }
  .prototype-badge { display: none; }
  .chef-header-actions { gap: 7px; }
  .chef-welcome h1 { font-size: 25px; }
  .chef-tabs { top: 72px; }
  .chef-tab { font-size: 13px; }
  .chef-tab svg { display: none; }
  .view-toolbar { display: block; }
  .view-toolbar h2 { font-size: 22px; }
  .segmented-control { width: 100%; margin-top: 16px; }
  .segmented-control button { flex: 1; }
  .menu-toolbar { display: flex; }
  .menu-toolbar .compact-button { padding: 0 12px; }
  .menu-toolbar .compact-button svg { width: 16px; height: 16px; }
  .managed-dish-grid { grid-template-columns: 1fr; }
  .managed-dish-card { grid-template-columns: 104px minmax(0, 1fr); }
  .managed-dish-image { width: 104px; height: 112px; }
  .availability-legend { gap: 9px; }
  .success-dialog,
  .confirm-dialog { padding: 30px 22px; border-radius: 25px; }
}

@media (max-width: 360px) {
  .customer-shell { padding-right: 12px; padding-left: 12px; }
  .welcome-panel { padding: 24px 18px; }
  .welcome-copy { max-width: 76%; }
  .welcome-copy h1 { font-size: 25px; }
  .welcome-copy p { font-size: 12px; }
  .welcome-illustration { right: -37px; width: 58%; }
  .dish-grid { gap: 9px; }
  .dish-card-body { padding-right: 10px; padding-left: 10px; }
  .selection-panel,
  .dish-editor { padding-right: 16px; padding-left: 16px; }
  .mobile-selection-bar { right: 9px; left: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
