/* CSS Variables */
:root {
  --color-bg: #FDF6F0;
  --color-bg-warm: #F5EBE0;
  --color-surface: #FFFFFF;
  --color-primary: #2C1810;
  --color-primary-light: #4A3228;
  --color-accent: #D4A574;
  --color-accent-light: #E8CDB0;
  --color-success: #4A7C59;
  --color-warning: #D4A574;
  --color-error: #C75146;
  --color-text: #2C1810;
  --color-text-muted: #6B5B54;
  --color-border: #E8DDD4;
  
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 50px;
  
  --shadow-sm: 0 2px 8px rgba(44, 24, 16, 0.06);
  --shadow-md: 0 4px 16px rgba(44, 24, 16, 0.1);
  --shadow-lg: 0 8px 32px rgba(44, 24, 16, 0.12);
  
  --nav-height: 64px;
  --header-height: 60px;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* App Container */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background: 
    radial-gradient(ellipse at top right, rgba(212, 165, 116, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at bottom left, rgba(212, 165, 116, 0.1) 0%, transparent 50%),
    var(--color-bg);
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--color-primary);
  color: white;
  height: var(--header-height);
  padding: 0 var(--space-md);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.notification-btn {
  position: relative;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: var(--radius-full);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: background 0.2s;
}

.notification-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--color-error);
  color: white;
  font-size: 0.625rem;
  font-weight: 600;
  min-width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Main Content */
.main-content {
  flex: 1;
  padding-top: calc(var(--header-height) + var(--space-md));
  padding-bottom: calc(var(--nav-height) + var(--space-xl));
  padding-left: var(--space-md);
  padding-right: var(--space-md);
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

/* Pages */
.page {
  display: none;
  animation: fadeIn 0.3s ease;
}

.page.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-header {
  margin-bottom: var(--space-lg);
}

.page-header h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--space-xs);
}

.subtitle {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

/* Sections */
.section {
  margin-bottom: var(--space-xl);
}

.section-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  color: var(--color-primary);
}

.section-icon {
  font-size: 1.25rem;
}

/* Menu Grid */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

/* Menu Card */
.menu-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

.menu-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.menu-card.selected {
  border-color: var(--color-accent);
  background: linear-gradient(135deg, var(--color-surface) 0%, rgba(212, 165, 116, 0.1) 100%);
}

.menu-card-emoji {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
  display: block;
}

.menu-card-name {
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: var(--space-xs);
  color: var(--color-primary);
}

.menu-card-tags {
  display: flex;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
  flex-wrap: wrap;
}

.menu-tag {
  font-size: 0.6875rem;
  background: var(--color-bg-warm);
  color: var(--color-text-muted);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.menu-card-quantity {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  background: var(--color-accent);
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.75rem;
  min-width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Quantity Controls */
.quantity-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-border);
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-primary);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.qty-btn:hover {
  background: var(--color-accent-light);
  border-color: var(--color-accent);
}

.qty-btn:active {
  transform: scale(0.95);
}

.qty-value {
  font-weight: 600;
  min-width: 24px;
  text-align: center;
}

/* Filter Chips */
.filter-chips {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-md);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex-shrink: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: var(--space-sm) var(--space-md);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.chip:hover {
  border-color: var(--color-accent);
}

.chip.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

/* Order Summary */
.order-summary {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--space-md));
  left: var(--space-md);
  right: var(--space-md);
  max-width: calc(600px - var(--space-md) * 2);
  margin: 0 auto;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-md);
  animation: slideUp 0.3s ease;
  z-index: 50;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
  gap: var(--space-sm);
}

.summary-header h3 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  flex: 1;
}

.collapse-btn {
  background: var(--color-bg-warm);
  border: none;
  border-radius: var(--radius-full);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: all 0.2s;
  flex-shrink: 0;
}

.collapse-btn:hover {
  background: var(--color-border);
  color: var(--color-primary);
}

.collapse-btn svg {
  transition: transform 0.2s;
}

.order-summary.collapsed .collapse-btn svg {
  transform: rotate(180deg);
}

.clear-btn {
  background: none;
  border: none;
  color: var(--color-error);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.clear-btn:hover {
  background: rgba(199, 81, 70, 0.1);
}

.summary-body {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s ease;
}

.order-summary.collapsed .summary-body {
  display: none;
}

.summary-items {
  max-height: 120px;
  overflow-y: auto;
  margin-bottom: var(--space-md);
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.875rem;
  gap: var(--space-sm);
}

.summary-item:last-child {
  border-bottom: none;
}

.summary-item-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex: 1;
  min-width: 0;
}

.summary-item-name {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex: 1;
  min-width: 0;
}

.summary-item-name span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-item-qty {
  background: var(--color-bg-warm);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.summary-item-remove {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: var(--space-xs);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}

.summary-item-remove:hover {
  background: rgba(199, 81, 70, 0.1);
  color: var(--color-error);
}

/* Collapsed State */
.summary-collapsed {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) 0;
}

.order-summary:not(.collapsed) .summary-collapsed {
  display: none;
}

.order-summary.collapsed .summary-collapsed {
  display: flex;
}

.collapsed-info {
  font-weight: 500;
  color: var(--color-text-muted);
}

.expand-btn {
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.expand-btn:hover {
  background: var(--color-primary-light);
}

.customer-name {
  margin-bottom: var(--space-md);
}

.customer-name label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.customer-name input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.customer-name input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.submit-btn {
  width: 100%;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  transition: all 0.2s;
}

.submit-btn:hover {
  background: var(--color-primary-light);
}

.submit-btn:active {
  transform: scale(0.98);
}

/* My Orders (Customer View) */
.my-orders-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.my-order-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--color-border);
}

.my-order-card[data-status="pending"] {
  border-left-color: var(--color-warning);
}

.my-order-card[data-status="in-progress"] {
  border-left-color: var(--color-accent);
  background: linear-gradient(135deg, var(--color-surface) 0%, rgba(212, 165, 116, 0.08) 100%);
}

.my-order-card[data-status="done"] {
  border-left-color: var(--color-success);
}

.my-order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.my-order-time {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.my-order-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.my-order-status.pending {
  background: rgba(212, 165, 116, 0.2);
  color: #8B6914;
}

.my-order-status.in-progress {
  background: rgba(212, 165, 116, 0.3);
  color: #6B4F14;
}

.my-order-status.done {
  background: rgba(74, 124, 89, 0.2);
  color: var(--color-success);
}

.my-order-status .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.my-order-status.in-progress .status-dot {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.my-order-items {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* Order Filters (Maker Page) */
.order-filters {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  overflow-x: auto;
  padding-bottom: var(--space-sm);
  -webkit-overflow-scrolling: touch;
}

.order-filter {
  flex-shrink: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: var(--space-sm) var(--space-md);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.order-filter.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

/* Orders List */
.orders-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.order-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--color-border);
  transition: all 0.2s;
}

.order-card[data-status="pending"] {
  border-left-color: var(--color-warning);
}

.order-card[data-status="in-progress"] {
  border-left-color: var(--color-accent);
  background: linear-gradient(135deg, var(--color-surface) 0%, rgba(212, 165, 116, 0.05) 100%);
}

.order-card[data-status="done"] {
  border-left-color: var(--color-success);
  opacity: 0.7;
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-sm);
}

.order-card-customer {
  font-weight: 600;
  font-size: 1rem;
}

.order-card-time {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.order-card-status {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.order-card-status.pending {
  background: rgba(212, 165, 116, 0.2);
  color: #8B6914;
}

.order-card-status.in-progress {
  background: rgba(212, 165, 116, 0.3);
  color: #6B4F14;
}

.order-card-status.done {
  background: rgba(74, 124, 89, 0.2);
  color: var(--color-success);
}

.order-card-items {
  margin: var(--space-md) 0;
  padding: var(--space-sm) 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.order-card-item {
  display: flex;
  justify-content: space-between;
  padding: var(--space-xs) 0;
  font-size: 0.875rem;
}

.order-card-item span:first-child {
  color: var(--color-text-muted);
}

.order-card-actions {
  display: flex;
  gap: var(--space-sm);
}

.action-btn {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.action-btn:hover {
  background: var(--color-bg-warm);
}

.action-btn.primary {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.action-btn.primary:hover {
  background: var(--color-primary-light);
}

.action-btn.success {
  background: var(--color-success);
  color: white;
  border-color: var(--color-success);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
  color: var(--color-text-muted);
}

.empty-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.empty-hint {
  font-size: 0.8125rem;
  margin-top: var(--space-sm);
  opacity: 0.7;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  padding: var(--space-sm) var(--space-md);
  padding-bottom: max(var(--space-sm), env(safe-area-inset-bottom));
  height: var(--nav-height);
  z-index: 100;
}

.nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  background: none;
  border: none;
  padding: var(--space-sm) var(--space-lg);
  color: var(--color-text-muted);
  font-size: 0.6875rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s;
  border-radius: var(--radius-md);
}

.nav-item:hover {
  color: var(--color-primary);
}

.nav-item.active {
  color: var(--color-primary);
  background: var(--color-bg-warm);
}

.nav-badge {
  position: absolute;
  top: 0;
  right: var(--space-md);
  background: var(--color-error);
  color: white;
  font-size: 0.625rem;
  font-weight: 600;
  min-width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + var(--space-md));
  left: var(--space-md);
  right: var(--space-md);
  max-width: 400px;
  margin: 0 auto;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  background: var(--color-primary);
  color: white;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
  pointer-events: auto;
}

.toast.success {
  background: var(--color-success);
}

.toast.error {
  background: var(--color-error);
}

.toast-title {
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.toast-message {
  font-size: 0.875rem;
  opacity: 0.9;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-10px); }
}

/* Notification Panel */
.notification-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 360px;
  background: var(--color-surface);
  z-index: 300;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.notification-panel:not([hidden]) {
  transform: translateX(0);
}

.panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 250;
  opacity: 0;
  transition: opacity 0.3s;
}

.panel-backdrop:not([hidden]) {
  opacity: 1;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.panel-header h3 {
  font-family: var(--font-display);
  font-size: 1.125rem;
}

.close-panel {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--color-text-muted);
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
}

.close-panel:hover {
  background: var(--color-bg-warm);
}

.panel-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
}

.notification-item {
  padding: var(--space-md);
  background: var(--color-bg);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
}

.notification-item.unread {
  background: var(--color-accent-light);
}

.notification-item-title {
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.notification-item-message {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.notification-item-time {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: var(--space-sm);
}

/* Responsive */
@media (min-width: 480px) {
  .menu-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 600px) {
  :root {
    --space-md: 1.25rem;
    --space-lg: 2rem;
  }
  
  .page-header h2 {
    font-size: 2rem;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus States */
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Recipes Page */
.recipe-input-container {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.recipe-url-input {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.recipe-url-input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.add-recipe-btn {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.add-recipe-btn:hover:not(:disabled) {
  background: var(--color-primary-light);
}

.add-recipe-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.add-recipe-btn svg.spinning {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Recipes Grid */
.recipes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

@media (min-width: 480px) {
  .recipes-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Recipe Card */
.recipe-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.recipe-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.recipe-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-sm);
}

.recipe-card-name {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-primary);
  flex: 1;
  margin: 0;
  line-height: 1.3;
}

.recipe-delete-btn {
  background: rgba(199, 81, 70, 0.1);
  border: none;
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-error);
  transition: all 0.2s;
  flex-shrink: 0;
}

.recipe-delete-btn:hover {
  background: rgba(199, 81, 70, 0.2);
  transform: scale(1.05);
}

.recipe-card-time {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.recipe-card-ingredients {
  flex: 1;
}

.recipe-card-ingredients h4 {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.recipe-card-ingredients ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text);
  line-height: 1.6;
}

.recipe-card-ingredients li {
  padding: var(--space-xs) 0;
  padding-left: var(--space-md);
  position: relative;
}

.recipe-card-ingredients li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-weight: bold;
}

.recipe-card-ingredients li.recipe-more {
  color: var(--color-text-muted);
  font-style: italic;
}

.recipe-card-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--color-primary);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  margin-top: var(--space-xs);
  transition: color 0.2s;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  width: 100%;
  justify-content: flex-start;
}

.recipe-card-link:hover {
  color: var(--color-accent);
}

/* Recipe Detail Modal */
.recipe-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  pointer-events: none;
}

.recipe-modal:not([hidden]) {
  pointer-events: auto;
}

.recipe-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease;
}

.recipe-modal-content {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalSlideUp 0.3s ease;
  z-index: 1;
}

/* Mobile: Full screen modal */
@media (max-width: 600px) {
  .recipe-modal {
    padding: 0;
    align-items: stretch;
  }
  
  .recipe-modal-backdrop {
    background: rgba(0, 0, 0, 0.8);
  }
  
  .recipe-modal-content {
    max-width: none;
    width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
    animation: modalSlideUpMobile 0.3s ease;
  }
  
  .recipe-modal-header {
    padding: var(--space-md);
  }
  
  .recipe-modal-header h2 {
    font-size: 1.25rem;
  }
  
  .recipe-modal-body {
    padding: var(--space-md);
  }
  
  @keyframes modalSlideUpMobile {
    from {
      opacity: 0;
      transform: translateY(100%);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.recipe-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.recipe-modal-header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0;
  flex: 1;
  padding-right: var(--space-md);
}

.recipe-modal-close {
  background: var(--color-bg-warm);
  border: none;
  border-radius: var(--radius-full);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: all 0.2s;
  flex-shrink: 0;
}

.recipe-modal-close:hover {
  background: var(--color-border);
  color: var(--color-primary);
}

.recipe-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.recipe-detail-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.recipe-detail-time {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1rem;
  color: var(--color-text);
  padding: var(--space-md);
  background: var(--color-bg-warm);
  border-radius: var(--radius-md);
}

.recipe-detail-time svg {
  color: var(--color-accent);
  flex-shrink: 0;
}

.recipe-detail-heading {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-primary);
  margin: 0;
}

.recipe-detail-ingredients {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.recipe-detail-ingredients li {
  padding: var(--space-sm) var(--space-md);
  padding-left: calc(var(--space-md) + var(--space-md));
  background: var(--color-bg-warm);
  border-radius: var(--radius-sm);
  position: relative;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.recipe-detail-ingredients li::before {
  content: '•';
  position: absolute;
  left: var(--space-md);
  color: var(--color-accent);
  font-weight: bold;
  font-size: 1.2em;
}

.recipe-detail-instructions {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: step-counter;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.recipe-detail-instructions li {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md);
  padding-left: calc(28px + var(--space-md) + var(--space-md));
  background: var(--color-bg-warm);
  border-radius: var(--radius-sm);
  position: relative;
  counter-increment: step-counter;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--color-text);
}

.recipe-detail-instructions li::before {
  content: counter(step-counter);
  position: absolute;
  left: var(--space-md);
  top: var(--space-md);
  background: var(--color-accent);
  color: var(--color-primary);
  font-weight: 700;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.875rem;
}

.recipe-detail-instructions li.no-instructions {
  padding-left: var(--space-md);
  font-style: italic;
  color: var(--color-text-muted);
}

.recipe-detail-instructions li.no-instructions::before {
  display: none;
}

.recipe-detail-source-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--color-primary);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  padding: var(--space-md);
  background: var(--color-primary);
  color: white;
  border-radius: var(--radius-md);
  transition: all 0.2s;
  justify-content: center;
  margin-top: var(--space-sm);
}

.recipe-detail-source-link:hover {
  background: var(--color-primary-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.recipe-detail-source-link svg {
  flex-shrink: 0;
}

/* ============================================
   Tasks Page
   ============================================ */

/* Task Input */
.task-input-container {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: var(--space-xs);
}

.task-input-container::-webkit-scrollbar {
  display: none;
}

/* Prevent inputs from shrinking too small */
.task-input-container .task-name-input {
  flex: 1 0 180px;
  min-width: 180px;
}

.task-input-container .task-person-input {
  flex: 0 0 auto;
  width: 120px;
}

.task-input-container .task-frequency-select {
  flex: 0 0 auto;
}

.task-input-container .add-task-btn {
  flex: 0 0 48px;
}

.task-name-input {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: inherit;
  background: var(--color-surface);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.task-name-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.15);
}

.task-name-input::placeholder {
  color: var(--color-text-muted);
}

.task-frequency-select {
  padding: var(--space-sm) var(--space-md);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-family: inherit;
  font-weight: 500;
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition: border-color 0.2s;
  min-width: 100px;
}

.task-frequency-select:focus {
  outline: none;
  border-color: var(--color-accent);
}

.add-task-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  width: 48px;
  height: 48px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  flex-shrink: 0;
}

.add-task-btn:hover {
  background: var(--color-primary-light);
}

.add-task-btn:active {
  transform: scale(0.95);
}

/* Person Input */
.task-person-input {
  width: 120px;
  padding: var(--space-sm) var(--space-md);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-family: inherit;
  background: var(--color-surface);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.task-person-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.15);
}

.task-person-input::placeholder {
  color: var(--color-text-muted);
}

/* Person Filter */
.person-filter-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.person-filter-label {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.person-chips {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  padding-bottom: var(--space-xs);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.person-chips::-webkit-scrollbar {
  display: none;
}

.person-chip {
  flex-shrink: 0;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: var(--space-sm) var(--space-md);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  color: var(--color-text);
}

.person-chip:hover {
  border-color: var(--color-accent);
  background: rgba(212, 165, 116, 0.1);
}

.person-chip.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

/* Person Tag on Task Item */
.task-person-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #E0E7FF 0%, #C7D2FE 100%);
  color: #4338CA;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.task-person-tag svg {
  width: 10px;
  height: 10px;
}

/* Notification Toggle */
.notification-toggle-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.notification-toggle-info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.notification-toggle-icon {
  font-size: 1.5rem;
}

.notification-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notification-toggle-label {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-text);
}

.notification-toggle-hint {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.notification-toggle-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.notification-toggle-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.toggle-track {
  display: block;
  width: 52px;
  height: 28px;
  background: var(--color-border);
  border-radius: 14px;
  position: relative;
  transition: background 0.2s ease;
}

.notification-toggle-btn.active .toggle-track {
  background: var(--color-success);
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.notification-toggle-btn.active .toggle-thumb {
  transform: translateX(24px);
}

/* Task Sections */
.task-section {
  margin-bottom: var(--space-xl);
}

.task-section-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.task-count {
  margin-left: auto;
  background: var(--color-bg-warm);
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
}

.task-count.has-tasks {
  background: var(--color-accent);
  color: var(--color-primary);
}

/* Task List */
.task-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.empty-task-state {
  text-align: center;
  padding: var(--space-lg) var(--space-md);
  color: var(--color-text-muted);
  font-size: 0.875rem;
  background: var(--color-bg-warm);
  border-radius: var(--radius-md);
  border: 2px dashed var(--color-border);
}

/* Task Item */
.task-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  border-left: 4px solid var(--color-accent);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.task-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(74, 124, 89, 0.1) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.task-item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.task-item.completing {
  animation: taskComplete 0.5s ease forwards;
}

.task-item.completing::before {
  opacity: 1;
}

@keyframes taskComplete {
  0% {
    transform: translateX(0);
    opacity: 1;
  }
  50% {
    transform: translateX(8px);
    background: linear-gradient(135deg, var(--color-surface) 0%, rgba(74, 124, 89, 0.15) 100%);
  }
  100% {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Task Checkbox */
.task-checkbox {
  position: relative;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.task-checkbox input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 1;
}

.task-checkbox-visual {
  position: absolute;
  inset: 0;
  border: 2px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-surface);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.task-checkbox-visual svg {
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s ease;
  color: white;
}

.task-checkbox input:hover + .task-checkbox-visual {
  border-color: var(--color-accent);
  background: rgba(212, 165, 116, 0.1);
}

.task-checkbox input:checked + .task-checkbox-visual {
  background: var(--color-success);
  border-color: var(--color-success);
}

.task-checkbox input:checked + .task-checkbox-visual svg {
  opacity: 1;
  transform: scale(1);
}

/* Task Content */
.task-content {
  flex: 1;
  min-width: 0;
}

.task-name {
  font-weight: 500;
  font-size: 1rem;
  color: var(--color-text);
  margin-bottom: 2px;
  word-break: break-word;
}

.task-meta {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.task-next-due {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Task Actions */
.task-actions {
  display: flex;
  gap: var(--space-xs);
  opacity: 0;
  transition: opacity 0.2s;
}

.task-item:hover .task-actions {
  opacity: 1;
}

.task-delete-btn {
  background: rgba(199, 81, 70, 0.1);
  border: none;
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-error);
  transition: all 0.2s;
}

.task-delete-btn:hover {
  background: rgba(199, 81, 70, 0.2);
  transform: scale(1.05);
}

/* Frequency-specific styling */
.task-item[data-frequency="daily"] {
  border-left-color: #F59E0B;
}

.task-item[data-frequency="weekly"] {
  border-left-color: #3B82F6;
}

.task-item[data-frequency="monthly"] {
  border-left-color: #8B5CF6;
}

/* Mobile touch optimization */
@media (hover: none) {
  .task-actions {
    opacity: 1;
  }
  
  .task-item:hover {
    transform: none;
  }
}

/* Hidden utility */
[hidden] {
  display: none !important;
}
