@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&family=Playfair+Display:wght@500;600;700&display=swap');

:root {
  --primary: #33691E;
  --primary-light: #558B2F;
  --primary-lighter: #689F38;
  --accent: #8BC34A;
  --accent-light: #F1F8E9;
  --accent-dark: #B8875A;
  --bg: #FAFAF7;
  --bg-warm: #F5F0EB;
  --surface: #FFFFFF;
  --surface-hover: #F9F6F2;
  --text: #1A1A1A;
  --text-secondary: #5C5C5C;
  --text-muted: #9A9A9A;
  --border: #E8E4DE;
  --border-light: #F0EDE8;
  --danger: #C1292E;
  --danger-light: #FDE8E8;
  --success: #2D6A4F;
  --success-light: #D8F3DC;
  --shadow-sm: 0 1px 3px rgba(27, 67, 50, 0.06);
  --shadow-md: 0 4px 12px rgba(27, 67, 50, 0.08);
  --shadow-lg: 0 8px 30px rgba(27, 67, 50, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', sans-serif;
}

::selection {
  background: var(--accent);
  color: var(--surface);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== App Shell ===== */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.92);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 1.5rem;
}

.app-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.view-toggle {
  display: flex;
  background: var(--bg-warm);
  border-radius: var(--radius-xl);
  padding: 4px;
  gap: 2px;
}

.toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  background: transparent;
  border-radius: var(--radius-xl);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s ease;
}

.toggle-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.toggle-btn:hover:not(.active) {
  color: var(--text);
}

.toggle-icon {
  font-size: 1rem;
}

.app-main {
  flex: 1;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
}

/* ===== Loading Skeleton ===== */
.loading-container,
.customer-loading {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px 0;
}

.skeleton-block {
  background: linear-gradient(90deg, var(--border-light) 25%, var(--bg-warm) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

.skeleton-wide { height: 60px; width: 100%; }
.skeleton-medium { height: 48px; width: 70%; }
.skeleton-narrow { height: 48px; width: 45%; }
.skeleton-hero { height: 120px; width: 100%; }
.skeleton-chip { height: 36px; width: 80px; border-radius: var(--radius-xl); }
.skeleton-card { height: 160px; width: 100%; }
.skeleton-row { display: flex; gap: 8px; }

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ===== Creator Tabs ===== */
.creator-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.creator-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 0;
}

.creator-tab {
  padding: 12px 20px;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
}

.creator-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.creator-tab:hover:not(.active) {
  color: var(--text-secondary);
}

/* ===== Section Header ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--primary);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.btn-primary:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-accent {
  background: var(--accent);
  color: white;
}

.btn-accent:hover {
  background: var(--accent-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--bg-warm);
  color: var(--text);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-icon {
  background: transparent;
  border: none;
  padding: 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.15s ease;
}

.btn-icon:hover {
  background: var(--bg-warm);
}

.btn-danger-icon:hover {
  background: var(--danger-light);
}

.btn-tiny {
  font-size: 0.75rem;
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-muted);
}

.btn-tiny:hover:not(:disabled) {
  background: var(--bg-warm);
  color: var(--text);
}

.btn-tiny:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border);
}

.empty-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 16px;
}

.empty-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.empty-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== Categories List ===== */
.categories-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.category-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  transition: all 0.2s ease;
  animation: fadeInUp 0.35s ease both;
}

.category-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.category-card:nth-child(1) { animation-delay: 0s; }
.category-card:nth-child(2) { animation-delay: 0.05s; }
.category-card:nth-child(3) { animation-delay: 0.1s; }
.category-card:nth-child(4) { animation-delay: 0.15s; }
.category-card:nth-child(5) { animation-delay: 0.2s; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.category-card-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.category-card-emoji {
  font-size: 1.8rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-warm);
  border-radius: var(--radius-sm);
}

.category-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.category-card-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
}

.category-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.category-card-count {
  font-size: 0.75rem;
  color: var(--accent-dark);
  font-weight: 500;
}

.category-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.reorder-btns {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-right: 4px;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 0;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
}

.modal-wide {
  max-width: 560px;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.modal-close:hover {
  background: var(--bg-warm);
  color: var(--text);
}

/* ===== Forms ===== */
.category-form,
.item-form {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.form-input:focus {
  border-color: var(--primary-lighter);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.1);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%239A9A9A'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-grow {
  flex: 1;
}

.form-price {
  width: 140px;
  flex-shrink: 0;
}

.price-input-wrap {
  position: relative;
}

.price-symbol {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-weight: 500;
  pointer-events: none;
}

.price-input {
  padding-left: 28px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 8px;
}

/* ===== Emoji Grid ===== */
.emoji-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.emoji-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.15s ease;
}

.emoji-btn:hover {
  border-color: var(--accent);
  background: var(--bg-warm);
}

.emoji-btn.selected {
  border-color: var(--primary);
  background: var(--success-light);
  box-shadow: 0 0 0 2px rgba(45, 106, 79, 0.15);
}

/* ===== Photo Upload ===== */
.photo-upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg);
}

.photo-upload-area:hover {
  border-color: var(--accent);
  background: var(--bg-warm);
}

.file-hidden {
  display: none;
}

.upload-icon {
  font-size: 1.5rem;
}

.upload-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.upload-status {
  font-size: 0.85rem;
  color: var(--accent-dark);
  font-weight: 500;
}

.photo-preview-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.photo-preview {
  width: 100%;
  max-width: 200px;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

/* ===== Availability Toggle ===== */
.availability-toggle {
  padding: 5px 12px;
  border: none;
  border-radius: var(--radius-xl);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.availability-toggle.available {
  background: var(--success-light);
  color: var(--success);
}

.availability-toggle.sold-out {
  background: var(--danger-light);
  color: var(--danger);
}

.availability-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text);
  padding: 4px 0;
}

.switch-track {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  position: relative;
  transition: all 0.25s ease;
}

.availability-switch.on .switch-track {
  background: var(--success);
}

.availability-switch.off .switch-track {
  background: var(--text-muted);
}

.switch-thumb {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  top: 2px;
  transition: all 0.25s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.availability-switch.on .switch-thumb {
  left: 22px;
}

.availability-switch.off .switch-thumb {
  left: 2px;
}

.switch-label {
  font-weight: 500;
}

/* ===== Items Section ===== */
.items-section {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.category-group {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 20px;
  animation: fadeInUp 0.35s ease both;
}

.category-group:nth-child(1) { animation-delay: 0s; }
.category-group:nth-child(2) { animation-delay: 0.08s; }
.category-group:nth-child(3) { animation-delay: 0.16s; }

.category-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.category-group-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-emoji {
  font-size: 1.4rem;
}

.category-group-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary);
}

.item-count-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  background: var(--bg-warm);
  border-radius: var(--radius-xl);
  color: var(--text-muted);
  font-weight: 500;
}

.no-items-msg {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
  padding: 12px 0;
}

.items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item-card {
  display: flex;
  gap: 14px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg);
  transition: all 0.2s ease;
  animation: fadeInUp 0.3s ease both;
}

.item-card:hover {
  border-color: var(--border);
}

.item-card.unavailable {
  opacity: 0.6;
}

.item-card-photo {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.item-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

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

.item-card-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.item-card-price {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary);
  white-space: nowrap;
}

.item-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

/* ===== Customer Menu ===== */
.customer-menu {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.customer-empty {
  text-align: center;
  padding: 80px 24px;
}

.customer-empty-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: 16px;
}

.customer-empty h2 {
  font-family: var(--font-display);
  color: var(--primary);
  margin-bottom: 8px;
}

.customer-empty p {
  color: var(--text-muted);
}

.customer-hero {
  text-align: center;
  padding: 40px 24px 20px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: var(--radius-xl);
  color: white;
  position: relative;
  overflow: hidden;
}

.customer-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(212, 165, 116, 0.2) 0%, transparent 70%);
  border-radius: 50%;
}

.customer-hero-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  position: relative;
}

.customer-hero-subtitle {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-top: 6px;
  position: relative;
}

.customer-filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.customer-filters::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.filter-chip:hover {
  border-color: var(--accent);
  color: var(--text);
}

.filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.customer-sections {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.customer-section {
  animation: fadeInUp 0.4s ease both;
}

.customer-section:nth-child(1) { animation-delay: 0s; }
.customer-section:nth-child(2) { animation-delay: 0.1s; }
.customer-section:nth-child(3) { animation-delay: 0.2s; }

.customer-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border-light);
}

.customer-section-emoji {
  font-size: 1.6rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-warm);
  border-radius: var(--radius-sm);
}

.customer-section-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--primary);
}

.customer-section-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.customer-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.customer-item {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  overflow: hidden;
  transition: all 0.25s ease;
  animation: fadeInUp 0.35s ease both;
}

.customer-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border);
}

.customer-item:nth-child(1) { animation-delay: 0s; }
.customer-item:nth-child(2) { animation-delay: 0.05s; }
.customer-item:nth-child(3) { animation-delay: 0.1s; }
.customer-item:nth-child(4) { animation-delay: 0.15s; }
.customer-item:nth-child(5) { animation-delay: 0.2s; }
.customer-item:nth-child(6) { animation-delay: 0.25s; }

.customer-item-unavailable {
  opacity: 0.55;
}

.customer-item-unavailable:hover {
  transform: none;
  box-shadow: none;
}

.customer-item-photo {
  width: 100%;
  height: 180px;
  position: relative;
  overflow: hidden;
}

.customer-item-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.customer-item:hover .customer-item-photo img {
  transform: scale(1.05);
}

.sold-out-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 26, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sold-out-overlay span {
  background: var(--danger);
  color: white;
  padding: 6px 16px;
  border-radius: var(--radius-xl);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.customer-item-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.customer-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.customer-item-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  line-height: 1.3;
}

.sold-out-tag {
  font-size: 0.65rem;
  padding: 2px 8px;
  background: var(--danger-light);
  color: var(--danger);
  border-radius: var(--radius-xl);
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.customer-item-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.customer-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.customer-item-price {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .app-header {
    padding: 12px 16px;
    flex-direction: column;
    gap: 12px;
  }

  .header-left {
    align-self: flex-start;
  }

  .view-toggle {
    width: 100%;
  }

  .toggle-btn {
    flex: 1;
    justify-content: center;
  }

  .app-main {
    padding: 16px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .section-header .btn {
    width: 100%;
    justify-content: center;
  }

  .form-row {
    flex-direction: column;
  }

  .form-price {
    width: 100%;
  }

  .category-group-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .category-group-header .btn {
    width: 100%;
    justify-content: center;
  }

  .customer-hero {
    padding: 32px 20px 16px;
  }

  .customer-hero-title {
    font-size: 1.6rem;
  }

  .customer-items-grid {
    grid-template-columns: 1fr;
  }

  .customer-item-photo {
    height: 160px;
  }

  .item-card {
    flex-direction: column;
  }

  .item-card-photo {
    width: 100%;
    height: 120px;
  }

  .item-card-actions {
    flex-wrap: wrap;
  }

  .category-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .category-card-actions {
    align-self: flex-end;
  }

  .modal-content,
  .modal-wide {
    max-width: 100%;
    max-height: 95vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    align-self: flex-end;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
}

/* ===== Focus Styles ===== */
.btn:focus-visible,
.toggle-btn:focus-visible,
.creator-tab:focus-visible,
.filter-chip:focus-visible,
.form-input:focus-visible {
  outline: 2px solid var(--primary-lighter);
  outline-offset: 2px;
}

.btn-icon:focus-visible,
.emoji-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
```

<!-- WALKTHROUGH_SCRIPT:
[
  {"step": 1, "narration": "Welcome to MenuCraft! You're in the Editor view where you'll build your digital menu. Let's start by creating some categories.", "view": "owner", "highlight_selector": ".creator-tabs", "wait_for": "tap_to_continue"},
  {"step": 2, "narration": "Click '+ New Category' to add your first category — like Appetizers, Mains, or Desserts.", "view": "owner", "highlight_selector": ".btn-primary", "wait_for": "user_interaction"},
  {"step": 3, "narration": "Pick an emoji icon, give your category a name and optional description, then click Create.", "view": "owner", "highlight_selector": ".modal-content", "wait_for": "user_interaction"},
  {"step": 4, "narration": "Great! Now switch to the Menu Items tab to add dishes to your categories.", "view": "owner", "highlight_selector": ".creator-tab:nth-child(2)", "wait_for": "user_interaction"},
  {"step": 5, "narration": "Click '+ Add Item' under a category to add a menu item with name, price, description, and an optional photo.", "view": "owner", "highlight_selector": ".btn-accent", "wait_for": "user_interaction"},
  {"step": 6, "narration": "You can toggle availability for any item — mark items as Sold Out when they're unavailable.", "view": "owner", "highlight_selector": ".availability-toggle", "wait_for": "tap_to_continue"},
  {"step": 7, "narration": "Switch to Preview mode to see how customers will view your menu — a beautiful, browsable layout with category filters.", "view": "owner", "highlight_selector": ".toggle-btn:nth-child(2)", "wait_for": "user_interaction"},
  {"step": 8, "narration": "Your menu is ready! Customers can filter by category and see all available items with photos and prices. Sold out items are clearly marked.", "view": "owner", "highlight_selector": ".customer-menu", "wait_for": "tap_to_continue"}
]
-->

.auth-shell {
  background: radial-gradient(circle at top, rgba(212, 165, 116, 0.12), transparent 40%), var(--bg);
}

.auth-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 36px 28px;
  text-align: center;
}

.auth-emoji {
  font-size: 2.8rem;
  display: block;
  margin-bottom: 14px;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 10px;
}

.auth-copy {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.auth-button {
  width: 100%;
  justify-content: center;
}

.auth-note {
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  margin: 0 auto 16px;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.owner-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-xl);
  background: var(--bg-warm);
  border: 1px solid var(--border-light);
}

.owner-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.owner-avatar-fallback {
  font-weight: 700;
  color: var(--primary);
}

.owner-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.owner-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.owner-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

@media (max-width: 640px) {
  .header-right {
    width: 100%;
    justify-content: space-between;
  }

  .owner-badge {
    flex: 1;
    min-width: 0;
  }

  .owner-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.rich-text-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rich-text-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rich-text-btn {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.rich-text-btn:hover {
  background: var(--bg-warm);
  color: var(--text);
}

.rich-text-area {
  min-height: 120px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.rich-text-area:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
}

.rich-text-area blockquote {
  margin: 8px 0;
  padding: 8px 12px;
  border-left: 3px solid var(--accent);
  background: var(--bg-warm);
  color: var(--text-secondary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.form-help-text {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.customer-qr-section {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.customer-qr-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.customer-qr-panel-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.customer-qr-title {
  font-family: var(--font-display);
  color: var(--primary);
  font-size: 1.15rem;
}

.customer-qr-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.customer-qr-url {
  font-size: 0.8rem;
  color: var(--text-muted);
  word-break: break-all;
}

.customer-qr-panel-code {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.customer-qr-image {
  width: 220px;
  height: 220px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: white;
  padding: 6px;
}

.customer-qr-caption {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-align: center;
}

.print-friendly-card {
  break-inside: avoid;
  page-break-inside: avoid;
}

.customer-qr-banner {
  gap: 16px;
}

@media print {
  .app-header,
  .customer-filters,
  .customer-sections {
    display: none !important;
  }

  .app-main {
    max-width: none;
    padding: 0;
  }

  .customer-menu {
    gap: 12px;
  }

  .customer-hero {
    color: #000;
    background: #fff !important;
    border: 1px solid #000;
    padding: 16px;
  }

  .customer-hero::before {
    display: none;
  }

  .customer-hero-title,
  .customer-hero-subtitle,
  .customer-qr-title,
  .customer-qr-description,
  .customer-qr-url,
  .customer-qr-caption {
    color: #000 !important;
  }

  .customer-qr-section {
    border: 1px solid #000;
    box-shadow: none;
  }

  .customer-qr-image {
    border: 1px solid #000;
  }
}

@media (max-width: 640px) {
  .customer-qr-panel {
    flex-direction: column;
    align-items: flex-start;
  }

  .customer-qr-panel-code {
    width: 100%;
  }

  .customer-qr-image {
    width: 180px;
    height: 180px;
  }
}

.menu-pdf-document {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 16px 0 24px;
}

.menu-pdf-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-light);
}

.menu-pdf-brand {
  font-family: var(--font-display);
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 0.95rem;
  text-transform: uppercase;
}

.menu-pdf-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--text);
  margin-top: 4px;
}

.menu-pdf-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 4px;
}

.menu-pdf-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: right;
  line-height: 1.5;
}

.menu-pdf-category {
  break-inside: avoid;
  page-break-inside: avoid;
  margin-bottom: 18px;
}

.menu-pdf-category-header {
  margin-bottom: 10px;
}

.menu-pdf-category-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-pdf-category-emoji {
  font-size: 1.4rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-warm);
  border-radius: var(--radius-sm);
}

.menu-pdf-category-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--primary);
}

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

.menu-pdf-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-pdf-item {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  background: var(--bg);
  break-inside: avoid;
  page-break-inside: avoid;
}

.menu-pdf-item-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.menu-pdf-item-name {
  font-size: 0.98rem;
  color: var(--text);
  font-weight: 700;
}

.menu-pdf-item-price {
  font-size: 0.95rem;
  color: var(--primary);
  font-weight: 700;
  white-space: nowrap;
}

.menu-pdf-item-description {
  margin-top: 4px;
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.menu-pdf-empty,
.menu-pdf-empty-state {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 8px 0;
}

.pdf-export-target {
  background: white;
}

@media print {
  .no-print {
    display: none !important;
  }

  .menu-pdf-document {
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
  }
}

.ai-assist-card {
  margin-bottom: 1.5rem;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.ai-textarea {
  min-height: 96px;
  resize: vertical;
}

.ai-suggestion {
  margin-top: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.12);
  color: inherit;
  font-size: 0.95rem;
}

.menu-item-description-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  margin-top: 1rem;
}

.menu-item-description-field {
  flex: 1;
}

.ai-suggest-btn {
  white-space: nowrap;
}

.menu-item-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.menu-cuisine-style {
  margin: 0.35rem 0 0.6rem;
  opacity: 0.8;
  font-size: 0.95rem;
}
