:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --card-bg: #1e293b;
  --card-border: #334155;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-green: #10b981;
  --accent-green-hover: #059669;
  --accent-green-light: rgba(16, 185, 129, 0.15);

  --accent-amber: #f59e0b;
  --accent-amber-hover: #d97706;
  --accent-amber-light: rgba(245, 158, 11, 0.15);

  --accent-blue: #38bdf8;
  --accent-blue-light: rgba(56, 189, 248, 0.15);

  --danger-red: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.15);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-main: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
  --shadow-btn: 0 4px 12px rgba(0, 0, 0, 0.3);

  --btn-height: 72px;
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.4;
  overflow-x: hidden;
  height: 100vh;
  width: 100vw;
}

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 16px 24px;
  max-width: 1600px;
  margin: 0 auto;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

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

.app-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 26px;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-primary);
}

.header-datetime {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-full);
}

.dot-separator {
  color: var(--text-muted);
}

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

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

.status-indicator.offline .status-dot {
  background: var(--danger-red);
  box-shadow: 0 0 8px var(--danger-red);
}

.icon-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-btn:active {
  transform: scale(0.92);
  background: var(--bg-tertiary);
}

/* Main Layout */
.main-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding-top: 14px;
  gap: 16px;
  overflow: hidden;
}

/* Hero Section */
.hero-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.hero-card {
  background: linear-gradient(145deg, #1e293b 0%, #172033 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-main);
  height: 100%;
  justify-content: space-between;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-tag {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--accent-blue);
  text-transform: uppercase;
}

.status-badge {
  font-size: 14px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.planned {
  background: var(--accent-blue-light);
  color: var(--accent-blue);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.status-badge.made {
  background: var(--accent-green-light);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.status-badge.rescheduled {
  background: var(--accent-amber-light);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.card-body {
  display: flex;
  align-items: center;
  gap: 28px;
  flex: 1;
  min-height: 0;
}

.recipe-visual {
  width: 170px;
  height: 170px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-tertiary);
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

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

.recipe-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
}

.recipe-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.recipe-title {
  font-family: var(--font-heading);
  font-size: 38px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 12px;
  line-height: 1.15;
  text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.recipe-metadata {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.meta-item {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.06);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
}

.meta-item.date-pill {
  color: var(--accent-blue);
  background: var(--accent-blue-light);
  font-weight: 700;
}

.recipe-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Primary Kitchen Touch Action Buttons */
.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 18px;
  flex-shrink: 0;
}

.touch-btn {
  height: var(--btn-height);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: all 0.12s ease;
  position: relative;
  overflow: hidden;
}

.touch-btn:active {
  transform: scale(0.97);
}

.touch-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-made {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
}

.btn-made:active {
  background: #059669;
}

.btn-skip {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #1e1b18;
}

.btn-skip:active {
  background: #d97706;
}

.btn-icon {
  font-size: 26px;
  font-weight: 900;
}

/* Inline feedback banner */
.banner-feedback {
  margin-top: 14px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: var(--accent-green-light);
  border: 1px solid var(--accent-green);
  color: var(--accent-green);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  animation: fadeIn 0.3s ease;
}

/* Upcoming Section */
.upcoming-section {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.upcoming-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.upcoming-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
}

.upcoming-hint {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.upcoming-carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.upcoming-carousel::-webkit-scrollbar {
  display: none;
}

.upcoming-card {
  flex: 0 0 210px;
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 110px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.upcoming-card:active {
  transform: scale(0.96);
  background: var(--bg-tertiary);
}

.upcoming-card.active-selected {
  border: 2px solid var(--accent-blue);
  background: rgba(56, 189, 248, 0.08);
}

.upcoming-card-date {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.upcoming-card-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 6px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.upcoming-card-badge {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 650px;
  padding: 28px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-wide {
  max-width: 850px;
  max-height: 85vh;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 800;
  color: #ffffff;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

.modal-prompt {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.move-comparison-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.move-recipe-name {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
}

.move-dates-flow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.date-step {
  display: flex;
  flex-direction: column;
}

.step-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.step-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.step-val.highlight {
  color: var(--accent-amber);
}

.step-delta {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-amber);
}

.step-arrow {
  font-size: 24px;
  color: var(--text-muted);
  font-weight: 900;
}

.move-note {
  font-size: 14px;
  color: var(--text-muted);
}

.modal-actions {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 16px;
  margin-top: 10px;
}

.btn-modal-confirm {
  background: var(--accent-amber);
  color: #1e1b18;
  height: 64px;
  font-size: 20px;
}

.btn-modal-confirm:active {
  background: var(--accent-amber-hover);
}

.btn-modal-cancel {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  height: 64px;
  font-size: 18px;
}

.btn-modal-cancel:active {
  background: rgba(255, 255, 255, 0.15);
}

/* History Modal */
.history-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}

.history-tabs {
  display: flex;
  gap: 10px;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 8px;
}

.tab-btn {
  background: transparent;
  border: none;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.history-list {
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  background: rgba(0, 0, 0, 0.2);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 4px solid var(--accent-green);
}

.history-item.reschedule-item {
  border-left-color: var(--accent-amber);
}

.history-item-left {
  display: flex;
  flex-direction: column;
}

.history-item-title {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 16px;
}

.history-item-sub {
  font-size: 13px;
  color: var(--text-secondary);
}

.history-item-time {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 200;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  min-width: 300px;
  max-width: 450px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  animation: slideIn 0.25s ease;
}

.toast.toast-error {
  border-color: var(--danger-red);
  background: #2a1518;
}

.toast.toast-success {
  border-color: var(--accent-green);
  background: #112822;
}

.toast-msg {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
}

/* Utilities & Animations */
.hidden {
  display: none !important;
}

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

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
