/* =====================================================
   Rezeptritter – Design System
   ===================================================== */

/* --- Variables --- */
:root {
  --primary:        #FF6B35;
  --primary-dark:   #E55525;
  --primary-light:  #FF8C61;
  --secondary:      #4CAF50;
  --secondary-dark: #388E3C;
  --secondary-light:#81C784;
  --accent:         #FFD700;
  --accent-dark:    #FFC107;
  --danger:         #F44336;
  --success:        #4CAF50;
  --warning:        #FFC107;
  --info:           #2196F3;

  --bg:       #FAFAFA;
  --bg-2:     #F0F2F5;
  --surface:  #FFFFFF;
  --surface-2:#F5F5F5;
  --border:   #E0E0E0;
  --text:     #212121;
  --text-2:   #757575;
  --text-3:   #BDBDBD;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow:    0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --shadow-xl: 0 16px 40px rgba(0,0,0,0.16);

  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --sidebar-w:  220px;
  --header-h:   60px;
  --transition: 0.2s ease;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, sans-serif;
}

[data-theme="dark"] {
  --primary:        #8B0000;
  --primary-dark:   #5C0000;
  --primary-light:  #C54E4E;
  --secondary:      #2C3E50;
  --secondary-dark: #1A252F;
  --secondary-light:#34495E;
  --accent:         #FFD700;
  --accent-dark:    #FFC107;
  --danger:         #EF5350;
  --success:        #66BB6A;
  --warning:        #FFCA28;
  --info:           #42A5F5;

  --bg:       #121212;
  --bg-2:     #1A1A1A;
  --surface:  #1E1E1E;
  --surface-2:#242424;
  --border:   #333333;
  --text:     #E0E0E0;
  --text-2:   #B0B0B0;
  --text-3:   #616161;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow:    0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.4);
  --shadow-xl: 0 16px 40px rgba(0,0,0,0.5);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

h1, h2, h3, h4, h5, h6 { line-height: 1.3; color: var(--text); font-weight: 700; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }

/* --- App Shell --- */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  white-space: nowrap;
}
.header-brand:hover { text-decoration: none; opacity: .9; }
.header-logo { height: 38px; }

.header-spacer { flex: 1; }

.header-search {
  flex: 1;
  max-width: 360px;
  position: relative;
  display: flex;
  align-items: center;
}
.header-search input {
  width: 100%;
  padding: 7px 12px 7px 36px;
  border: none;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: background var(--transition);
}
.header-search input::placeholder { color: rgba(255,255,255,0.7); }
.header-search input:focus { background: rgba(255,255,255,0.3); }
.header-search .search-icon {
  position: absolute;
  left: 10px;
  color: rgba(255,255,255,0.8);
  font-size: 20px;
}

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

.icon-btn {
  background: none;
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition);
  position: relative;
  flex-shrink: 0;
}
.icon-btn:hover { background: rgba(255,255,255,0.15); }
.icon-btn .material-symbols-rounded { font-size: 22px; }

.notif-badge {
  position: absolute;
  top: 4px; right: 4px;
  background: var(--accent);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  color: #fff;
  transition: background var(--transition);
}
.header-user:hover { background: rgba(255,255,255,0.15); text-decoration: none; }
.header-user-name { font-weight: 600; font-size: 14px; white-space: nowrap; }

.hamburger-btn {
  display: none;
}

/* --- Sidebar --- */
.app-sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: background var(--transition);
}
.sidebar-user:hover { background: var(--bg-2); text-decoration: none; }

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-level {
  font-size: 12px;
  color: var(--text-2);
}

.sidebar-nav { flex: 1; padding: 8px 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  margin: 2px 8px;
  transition: all var(--transition);
  position: relative;
}
.nav-item .material-symbols-rounded { font-size: 20px; flex-shrink: 0; }
.nav-item:hover { background: var(--bg-2); color: var(--text); text-decoration: none; }
.nav-item.active { background: rgba(255,107,53,0.12); color: var(--primary); font-weight: 600; }
[data-theme="dark"] .nav-item.active { background: rgba(139,0,0,0.2); color: var(--primary-light); }
.nav-item.active .material-symbols-rounded { color: var(--primary); }
[data-theme="dark"] .nav-item.active .material-symbols-rounded { color: var(--primary-light); }

.nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.nav-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  padding: 12px 24px 4px;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 90;
}

/* --- Main Content --- */
.app-main {
  margin-top: var(--header-h);
  margin-left: var(--sidebar-w);
  padding: 28px;
  min-height: calc(100vh - var(--header-h));
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title { font-size: 1.6rem; font-weight: 800; }
.page-subtitle { color: var(--text-2); margin-top: 4px; font-size: 14px; }

/* --- Avatar --- */
.avatar {
  border-radius: var(--radius-full);
  object-fit: cover;
  background: var(--bg-2);
  flex-shrink: 0;
}
.avatar-xs { width: 24px; height: 24px; }
.avatar-sm { width: 32px; height: 32px; }
.avatar-md { width: 44px; height: 44px; }
.avatar-lg { width: 64px; height: 64px; }
.avatar-xl { width: 96px; height: 96px; }

.avatar-placeholder {
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

/* --- Cards --- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-body { padding: 20px; }
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

/* --- Stat Cards (Dashboard) --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); }
.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.stat-icon.orange { background: rgba(255,107,53,.12); color: var(--primary); }
.stat-icon.green  { background: rgba(76,175,80,.12);  color: var(--secondary); }
.stat-icon.gold   { background: rgba(255,215,0,.15);  color: #B8860B; }
.stat-icon.blue   { background: rgba(33,150,243,.12); color: var(--info); }
.stat-icon.red    { background: rgba(244,67,54,.12);  color: var(--danger); }
.stat-value { font-size: 2rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: 13px; color: var(--text-2); font-weight: 500; }

/* --- Recipe Cards --- */
.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.recipe-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition);
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
}
.recipe-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); text-decoration: none; color: var(--text); }

.recipe-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: var(--bg-2);
}
.recipe-card-img-placeholder {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, var(--bg-2), var(--surface-2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 48px;
}

.recipe-card-body { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.recipe-card-title { font-weight: 700; font-size: 15px; line-height: 1.3; }
.recipe-card-meta { display: flex; gap: 10px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.recipe-card-meta span { display: flex; align-items: center; gap: 3px; }
.recipe-card-meta .material-symbols-rounded { font-size: 14px; }
.recipe-card-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .material-symbols-rounded { font-size: 18px; }

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-sm .material-symbols-rounded { font-size: 16px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }

.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { background: var(--secondary-dark); color: #fff; }

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

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c62828; color: #fff; }

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

.btn-outline-primary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-outline-primary:hover { background: var(--primary); color: #fff; }

.btn-full { width: 100%; }

/* --- Forms --- */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.form-input, .form-select, .form-textarea {
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,107,53,0.12);
}
.form-textarea { resize: vertical; min-height: 100px; }
.form-select { cursor: pointer; }
.form-hint { font-size: 12px; color: var(--text-2); }
.form-error { font-size: 12px; color: var(--danger); }

.input-group { display: flex; gap: 8px; }
.input-group .form-input { flex: 1; }

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-primary   { background: rgba(255,107,53,.15); color: var(--primary); }
.badge-success   { background: rgba(76,175,80,.15);  color: var(--success); }
.badge-danger    { background: rgba(244,67,54,.15);  color: var(--danger); }
.badge-warning   { background: rgba(255,193,7,.2);   color: #7a5900; }
[data-theme="dark"] .badge-warning { color: var(--warning); }
.badge-info      { background: rgba(33,150,243,.15); color: var(--info); }
.badge-neutral   { background: var(--bg-2);          color: var(--text-2); }
.badge-accent    { background: rgba(255,215,0,.2);   color: #7a5900; }
[data-theme="dark"] .badge-accent { color: var(--accent); }

/* --- Chips / Pills --- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { border-color: var(--primary); background: rgba(255,107,53,.1); color: var(--primary); font-weight: 600; }

/* --- Tabs --- */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
  gap: 0;
  overflow-x: auto;
}
.tab-btn {
  padding: 10px 20px;
  border: none;
  background: none;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* --- Stars (Rating) --- */
.stars { display: inline-flex; gap: 2px; }
.star { color: var(--border); font-size: 18px; cursor: pointer; transition: color .1s; }
.star.filled, .star:hover { color: var(--accent); }
.stars.readonly .star { cursor: default; }

/* --- Progress Bar --- */
.progress-bar {
  height: 8px;
  background: var(--bg-2);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--primary);
  transition: width .4s ease;
}
.progress-fill.green  { background: var(--success); }
.progress-fill.orange { background: var(--warning); }
.progress-fill.red    { background: var(--danger); }

/* --- Alerts --- */
.alert {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}
.alert .material-symbols-rounded { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: rgba(76,175,80,.1);  color: var(--success); border: 1px solid rgba(76,175,80,.3); }
.alert-danger  { background: rgba(244,67,54,.1);  color: var(--danger);  border: 1px solid rgba(244,67,54,.3); }
.alert-warning { background: rgba(255,193,7,.1);  color: #7a5900;        border: 1px solid rgba(255,193,7,.3); }
[data-theme="dark"] .alert-warning { color: var(--warning); }
.alert-info    { background: rgba(33,150,243,.1); color: var(--info);    border: 1px solid rgba(33,150,243,.3); }

/* --- Toast Notifications --- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
}
.toast {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 500;
  border-left: 4px solid var(--primary);
  min-width: 260px;
  max-width: 380px;
  transform: translateX(120%);
  transition: transform .3s ease;
  pointer-events: all;
}
.toast.show { transform: translateX(0); }
.toast.success { border-left-color: var(--success); }
.toast.danger  { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

/* --- Modal --- */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn .2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(.95) translateY(8px); } to { opacity: 1; transform: none; } }
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 17px;
  font-weight: 700;
}
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* --- Loading / Spinner --- */
.loading { display: flex; align-items: center; justify-content: center; padding: 48px; }
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton {
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--surface-2) 50%, var(--bg-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* --- Divider --- */
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.divider-text {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-2);
  font-size: 13px;
  margin: 16px 0;
}
.divider-text::before, .divider-text::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* --- List items --- */
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: var(--bg-2); }

/* --- Empty state --- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  text-align: center;
  color: var(--text-2);
  gap: 12px;
}
.empty-state .material-symbols-rounded { font-size: 64px; color: var(--text-3); }
.empty-state h3 { color: var(--text); }

/* --- Hero (Landing) --- */
.hero {
  background: linear-gradient(135deg, #FFD6C9, #F7B39E);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}
[data-theme="dark"] .hero { background: linear-gradient(135deg, #3d0000, #1a0000); }
.hero-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; }
.hero-eyebrow { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--primary); margin-bottom: 8px; }
.hero h1 { font-size: 2.8rem; margin-bottom: 12px; }
.hero p { font-size: 16px; color: var(--text-2); max-width: 440px; margin-bottom: 24px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-img { width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow-xl); }
.hero-features { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
.hero-feature { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; }
.hero-feature .material-symbols-rounded { color: var(--secondary); font-size: 20px; }

/* --- Section --- */
.section { margin-bottom: 36px; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title { font-size: 1.15rem; font-weight: 700; }

/* --- Ingredient list --- */
.ingredient-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.ingredient-row:last-child { border-bottom: none; }
.ingredient-amount { font-weight: 700; min-width: 80px; color: var(--primary); }

/* --- Step list --- */
.step-item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.step-item:last-child { border-bottom: none; }
.step-number {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.step-text { font-size: 14px; line-height: 1.7; flex: 1; }

/* --- Nutrition grid --- */
.nutrition-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.nutrition-item {
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}
.nutrition-value { font-size: 1.3rem; font-weight: 800; color: var(--primary); }
.nutrition-label { font-size: 11px; color: var(--text-2); margin-top: 2px; }

/* --- Chat --- */
.message-list { display: flex; flex-direction: column; gap: 8px; padding: 16px; }
.message-row { display: flex; gap: 8px; align-items: flex-end; }
.message-row.own { flex-direction: row-reverse; }
.message-bubble {
  max-width: 65%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
}
.message-row:not(.own) .message-bubble { background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.message-row.own .message-bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.message-time { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.message-sender { font-size: 11px; font-weight: 700; color: var(--primary); margin-bottom: 2px; }

.chat-input-bar {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  align-items: flex-end;
}
.chat-input { flex: 1; resize: none; max-height: 120px; }

/* --- Pantry item --- */
.expiry-bar { height: 4px; border-radius: var(--radius-full); background: var(--bg-2); overflow: hidden; margin-top: 4px; }
.expiry-fill { height: 100%; border-radius: var(--radius-full); }
.expiry-ok     { background: var(--success); }
.expiry-soon   { background: var(--warning); }
.expiry-danger { background: var(--danger); }

/* --- Meal planner --- */
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
}
.day-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.day-header {
  padding: 8px 12px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  text-align: center;
}
.day-slot {
  padding: 10px;
  min-height: 72px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  cursor: pointer;
  transition: background var(--transition);
  position: relative;
}
.day-slot:hover { background: var(--bg-2); }
.day-slot:last-child { border-bottom: none; }
.day-slot-label { font-size: 11px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.day-slot-recipe { font-weight: 600; color: var(--text); }
.day-slot.empty { color: var(--text-3); }

/* --- XP Bar (Profile) --- */
.xp-bar-wrap { display: flex; align-items: center; gap: 10px; }
.xp-bar { flex: 1; }
.xp-label { font-size: 12px; color: var(--text-2); white-space: nowrap; }
.level-circle {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* --- Watermark --- */
.watermark {
  position: fixed;
  bottom: 16px;
  right: 20px;
  opacity: 0.04;
  pointer-events: none;
  z-index: 0;
}
.watermark img { height: 120px; }

/* --- Scrollbars --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* === RESPONSIVE === */
@media (max-width: 1023px) {
  .week-grid { grid-template-columns: repeat(4, 1fr); }
  .nutrition-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
  .hamburger-btn { display: flex; }

  .header-search { display: none; }
  .header-user-name { display: none; }

  .app-sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-xl);
  }
  .app-sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }

  .app-main {
    margin-left: 0;
    padding: 16px;
  }

  .hero { padding: 28px 20px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-img { display: none; }
  .hero h1 { font-size: 2rem; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .recipes-grid { grid-template-columns: 1fr; }
  .week-grid { grid-template-columns: repeat(2, 1fr); }
  .nutrition-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-features { grid-template-columns: 1fr; }

  .modal { max-height: 95vh; border-radius: var(--radius) var(--radius) 0 0; }
  .modal-backdrop { align-items: flex-end; }
}

@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr; }
}
