/* ── Tokens ──────────────────────────────────────────────────────────────── */
:root {
  --primary:        #FF5722;
  --primary-dark:   #E64A19;
  --primary-light:  #FFCCBC;
  --bg:             #F5F5F0;
  --surface:        #FFFFFF;
  --surface-2:      #F8F7F4;
  --text:           #1C1C1E;
  --text-secondary: #6E6E73;
  --text-light:     #AEAEB2;
  --border:         #E5E5EA;
  --success:        #34C759;
  --error:          #FF3B30;
  --warning:        #FF9500;
  --radius-sm:      8px;
  --radius:         12px;
  --radius-lg:      20px;
  --shadow-sm:      0 1px 4px rgba(0,0,0,.08);
  --shadow:         0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:      0 8px 32px rgba(0,0,0,.14);
  --nav-height:     64px;
  --bar-height:     56px;
  --font:           -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --transition:     0.2s ease;
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
ul, ol { list-style: none; }

/* ── Utility ─────────────────────────────────────────────────────────────── */
.text-secondary { color: var(--text-secondary); }
.text-center    { text-align: center; }
.mb-2  { margin-bottom: 8px; }
.mb-4  { margin-bottom: 16px; }
.mb-6  { margin-bottom: 24px; }
.mt-2  { margin-top: 8px; }
.mt-4  { margin-top: 16px; }
.mt-6  { margin-top: 24px; }
.link  { color: var(--primary); font-weight: 500; }
.link:hover { text-decoration: underline; }
.required { color: var(--error); }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.main-content {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 0 calc(var(--nav-height) + 16px);
}

.is-authenticated .main-content {
  padding-top: calc(var(--bar-height) + 8px);
}

/* ── App Bar ─────────────────────────────────────────────────────────────── */
.app-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--bar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.app-bar__inner {
  max-width: 640px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}
.app-bar__logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -.3px;
}
.app-bar__actions { display: flex; gap: 4px; align-items: center; }
.app-bar__icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
  position: relative;
}
.app-bar__icon-btn:hover { background: var(--surface-2); color: var(--text); }
.app-bar__icon-btn svg { width: 22px; height: 22px; }
.app-bar__icon-btn.has-badge::after {
  content: '';
  position: absolute;
  top: 6px; right: 6px;
  width: 9px; height: 9px;
  background: var(--error);
  border-radius: 50%;
  border: 2px solid var(--surface);
}

/* ── Bottom Navigation ────────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 100;
}
.bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  color: var(--text-light);
  transition: color var(--transition);
  position: relative;
  min-height: 100%;
  font-size: 10px;
  font-weight: 500;
}
.bottom-nav__item svg { width: 24px; height: 24px; fill: none; stroke: currentColor; }
.bottom-nav__item.is-active { color: var(--primary); }
.bottom-nav__badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 18px);
  background: var(--error);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--surface);
}
.bottom-nav__item--add {
  width: 48px; height: 48px;
  max-width: 48px;
  flex: 0 0 48px;
  background: var(--primary);
  border-radius: 16px;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(255,87,34,.35);
  margin: 0 8px;
}
.bottom-nav__item--add svg { width: 26px; height: 26px; }

/* ── Toast ───────────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: calc(var(--bar-height) + 8px);
  left: 50%; transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: calc(100% - 32px);
  max-width: 520px;
}
.toast {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: slideDown .3s ease forwards;
}
.toast--success { background: var(--success); color: #fff; }
.toast--error   { background: var(--error);   color: #fff; }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  line-height: 1;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn--primary  { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(255,87,34,.3); }
.btn--primary:hover  { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(255,87,34,.4); }
.btn--secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn--secondary:hover { background: var(--border); }
.btn--outline  { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn--outline:hover { background: var(--primary-light); }
.btn--ghost    { background: transparent; color: var(--text-secondary); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--danger   { background: var(--error); color: #fff; }
.btn--danger:hover { opacity: .9; }
.btn--full     { width: 100%; }
.btn--sm       { padding: 8px 14px; font-size: 13px; }
.btn--xs       { padding: 5px 10px; font-size: 12px; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-page { padding: 0 16px 32px; }
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.form-hint { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,87,34,.12);
}
.form-input::placeholder { color: var(--text-light); }
.form-textarea { resize: vertical; min-height: 88px; line-height: 1.5; }
.form-select { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236E6E73' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 40px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; gap: 12px; margin-top: 8px; }
.form-actions .btn { flex: 1; }
.input-with-toggle { position: relative; }
.input-with-toggle .form-input { padding-right: 48px; }
.input-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--text-light); padding: 4px;
}
.input-toggle svg { width: 20px; height: 20px; display: block; }
.form-input--code {
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 12px;
  padding: 20px;
  font-variant-numeric: tabular-nums;
}

/* ── Image Upload ─────────────────────────────────────────────────────────── */
.img-upload {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition);
  background: var(--surface);
  aspect-ratio: 16/9;
}
.img-upload:hover { border-color: var(--primary); }
.img-upload__input {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.img-upload__placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px; color: var(--text-secondary);
  pointer-events: none;
}
.img-upload__placeholder svg { width: 40px; height: 40px; opacity: .5; }
.img-upload__placeholder span { font-weight: 500; font-size: 15px; }
.img-upload__placeholder small { font-size: 12px; color: var(--text-light); }
.img-upload__preview { width: 100%; height: 100%; object-fit: cover; }
.img-upload__remove {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0,0,0,.5); color: #fff;
  border: none; border-radius: 50%;
  width: 28px; height: 28px;
  cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.current-img-wrap { border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 16/9; }
.current-img { width: 100%; height: 100%; object-fit: cover; }

/* ── Dynamic Lists (ingredients / steps) ─────────────────────────────────── */
.dynamic-list { display: flex; flex-direction: column; gap: 8px; }
.dynamic-list__item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.dynamic-list__item .form-input { flex: 1; }
.dynamic-list--steps .dynamic-list__item { align-items: flex-start; }
.dynamic-list__remove {
  flex-shrink: 0;
  width: 32px; height: 32px; margin-top: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.dynamic-list__remove:hover { background: var(--error); color: #fff; border-color: var(--error); }
.step-number-label {
  flex-shrink: 0;
  width: 28px; height: 28px; margin-top: 12px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}

/* ── Login Page ───────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  gap: 24px;
  background: var(--bg);
}
.login-hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.login-hero__icon { font-size: 56px; line-height: 1; }
.login-hero__title { font-size: 32px; font-weight: 800; color: var(--primary); letter-spacing: -.5px; }
.login-hero__sub { color: var(--text-secondary); font-size: 16px; }
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow);
}
.login-card__heading { font-size: 20px; font-weight: 700; margin-bottom: 20px; }

/* ── Page Header ─────────────────────────────────────────────────────────── */
.page-header {
  padding: 20px 16px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.page-header--with-back { padding-top: 12px; }
.page-title { font-size: 22px; font-weight: 700; letter-spacing: -.3px; }
.back-link {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  flex-shrink: 0;
}
.back-link svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.5; }

/* ── Search Bar ──────────────────────────────────────────────────────────── */
.search-bar { padding: 8px 16px; }
.search-form { position: relative; }
.search-input-wrap { position: relative; }
.search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--text-light); pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 11px 40px 11px 40px;
  border: none;
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 15px;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.search-input:focus { outline: none; box-shadow: 0 0 0 2px var(--primary); }
.search-clear {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: 16px; color: var(--text-light); line-height: 1;
}

/* ── Category Chips ──────────────────────────────────────────────────────── */
.chip-scroll {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.chip-scroll::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 99px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all var(--transition);
}
.chip:hover    { border-color: var(--primary); color: var(--primary); }
.chip--active  { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ── Recipe Grid ─────────────────────────────────────────────────────────── */
.recipe-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 8px 16px;
}
.recipe-grid--compact { padding: 0; }

/* ── Recipe Card ─────────────────────────────────────────────────────────── */
.recipe-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition);
}
.recipe-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.recipe-card__img-link { display: block; position: relative; }
.recipe-card__img {
  width: 100%; aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--surface-2);
}
.recipe-card__badge {
  position: absolute; top: 8px; left: 8px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}
.badge--variation { background: rgba(255,87,34,.9); color: #fff; }
.badge--draft     { background: rgba(110,110,115,.85); color: #fff; }
.badge--pending   { background: var(--warning); color: #fff; }
.badge--active    { background: var(--success); color: #fff; }
.badge--inactive  { background: var(--text-light); color: #fff; }
.badge--admin     { background: var(--primary); color: #fff; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.badge--primary   { background: var(--primary); color: #fff; }
.badge--secondary { background: var(--text-light); color: #fff; }
.badge--success   { background: var(--success); color: #fff; }
.badge--danger    { background: var(--error); color: #fff; }
.badge--warning   { background: var(--warning); color: #fff; }
.recipe-card__body { padding: 10px 12px 12px; flex: 1; }
.recipe-card__cat { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--primary); display: block; margin-bottom: 4px; }
.recipe-card__title { font-size: 14px; font-weight: 700; line-height: 1.3; margin-bottom: 6px; }
.recipe-card__title a { color: var(--text); }
.recipe-card__meta { font-size: 11px; color: var(--text-secondary); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.recipe-card__author { color: var(--text-secondary); font-weight: 500; }
.recipe-card__dot { color: var(--text-light); }
.recipe-card__fav { position: absolute; top: 8px; right: 8px; }
.fav-btn {
  width: 32px; height: 32px;
  background: rgba(255,255,255,.85);
  border: none; border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: transform var(--transition);
}
.fav-btn:active { transform: scale(1.2); }
.fav-btn svg { width: 16px; height: 16px; fill: none; stroke: var(--text-secondary); }
.fav-btn.is-faved svg { fill: var(--error); stroke: var(--error); }

/* ── Recipe Page ─────────────────────────────────────────────────────────── */
.recipe-hero { position: relative; aspect-ratio: 4/3; max-height: 320px; overflow: hidden; background: var(--surface-2); }
.recipe-hero__img { width: 100%; height: 100%; object-fit: cover; }
.recipe-hero__overlay {
  position: absolute; inset: 0;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 16px;
  background: linear-gradient(to bottom, rgba(0,0,0,.3) 0%, transparent 50%);
}
.back-btn {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.9);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.back-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; }
.recipe-page { padding: 20px 16px 32px; }
.recipe-page__header { margin-bottom: 16px; }
.recipe-page__badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-secondary); }
.recipe-page__title { font-size: 26px; font-weight: 800; line-height: 1.2; letter-spacing: -.4px; margin-bottom: 12px; }
.recipe-page__meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; font-size: 14px; }
.recipe-meta-author { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.avatar {
  width: 32px; height: 32px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.fav-btn-lg {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 99px;
  cursor: pointer;
  font-size: 14px; font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.fav-btn-lg svg { width: 18px; height: 18px; fill: none; stroke: currentColor; }
.fav-btn-lg.is-faved { background: #FFF0EE; border-color: var(--error); color: var(--error); }
.fav-btn-lg.is-faved svg { fill: var(--error); stroke: var(--error); }
.recipe-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tag { background: var(--surface-2); color: var(--text-secondary); padding: 4px 10px; border-radius: 99px; font-size: 13px; }
.recipe-description { color: var(--text-secondary); line-height: 1.6; margin-bottom: 24px; }
.variation-banner {
  display: flex; align-items: center; gap: 10px;
  background: #FFF8F6;
  border: 1px solid var(--primary-light);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 14px; color: var(--text-secondary);
}
.variation-banner svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--primary); }
.recipe-section { margin-bottom: 28px; }
.recipe-section__title { font-size: 18px; font-weight: 700; margin-bottom: 14px; letter-spacing: -.2px; }
.ingredient-list { display: flex; flex-direction: column; gap: 2px; }
.ingredient-list__item { border-radius: var(--radius-sm); overflow: hidden; }
.ingredient-check { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; border-radius: var(--radius-sm); transition: background var(--transition); }
.ingredient-check:hover { background: var(--surface-2); }
.ingredient-check__input { display: none; }
.ingredient-check__box {
  flex-shrink: 0;
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-radius: 6px;
  transition: all var(--transition);
  position: relative;
}
.ingredient-check__input:checked ~ .ingredient-check__box {
  background: var(--success); border-color: var(--success);
}
.ingredient-check__input:checked ~ .ingredient-check__box::after {
  content: '✓';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 700;
}
.ingredient-check__input:checked ~ .ingredient-check__text {
  text-decoration: line-through; color: var(--text-light);
}
.ingredient-check__text { font-size: 15px; }
.step-list { display: flex; flex-direction: column; gap: 16px; }
.step-list__item { display: flex; gap: 14px; align-items: flex-start; }
.step-number {
  flex-shrink: 0;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.step-text { font-size: 15px; line-height: 1.6; padding-top: 4px; }
.recipe-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }

/* ── Info / Variation banner ──────────────────────────────────────────────── */
.info-banner {
  display: flex; align-items: flex-start; gap: 12px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 14px; color: #1D4ED8;
  line-height: 1.5;
}
.info-banner svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }

/* ── Profile ─────────────────────────────────────────────────────────────── */
.profile-header {
  display: flex; flex-direction: column; align-items: center;
  padding: 24px 16px 16px;
  gap: 8px;
}
.profile-avatar {
  width: 72px; height: 72px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 50%;
  font-size: 30px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}
.profile-name { font-size: 22px; font-weight: 700; }
.profile-meta { color: var(--text-secondary); font-size: 14px; }

/* ── Settings Toggles ─────────────────────────────────────────────────────── */
.settings-section { background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.settings-section__title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--text-secondary); padding: 14px 16px 8px; }
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  cursor: pointer;
}
.toggle-row__label { font-weight: 600; font-size: 15px; }
.toggle-row__desc { font-size: 13px; color: var(--text-secondary); }
.toggle { position: relative; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle__slider {
  display: block;
  width: 48px; height: 28px;
  background: var(--border);
  border-radius: 99px;
  position: relative;
  transition: background var(--transition);
  cursor: pointer;
}
.toggle__slider::after {
  content: '';
  position: absolute;
  left: 3px; top: 3px;
  width: 22px; height: 22px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle input:checked + .toggle__slider { background: var(--success); }
.toggle input:checked + .toggle__slider::after { transform: translateX(20px); }

/* ── Notifications ───────────────────────────────────────────────────────── */
.notification-list { padding: 8px 16px; display: flex; flex-direction: column; gap: 8px; }
.notification-item {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: background var(--transition);
}
.notification-item:hover { background: var(--surface-2); }
.notification-item.is-unread { border-left: 3px solid var(--primary); }
.notification-icon { font-size: 24px; flex-shrink: 0; }
.notification-body { flex: 1; }
.notification-msg { font-size: 14px; line-height: 1.4; margin-bottom: 4px; }
.notification-time { font-size: 12px; color: var(--text-light); }

/* ── Admin ───────────────────────────────────────────────────────────────── */
.card { background: var(--surface); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); margin: 0 16px; }
.card__title { font-size: 17px; font-weight: 700; margin-bottom: 20px; }
.user-table { display: flex; flex-direction: column; }
.user-row {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}
.user-row:last-child { border-bottom: 1px solid var(--border); }
.user-avatar {
  width: 40px; height: 40px;
  background: var(--primary-light); color: var(--primary-dark);
  border-radius: 50%; font-weight: 700; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.user-email { font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; }
.user-row__meta {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap; margin-top: 6px;
}
.user-row__meta .badge { font-size: 10px; padding: 2px 7px; }
.user-row__meta .user-meta-text { font-size: 11px; color: var(--text-secondary); }
.user-meta { display: flex; gap: 4px; flex-wrap: wrap; }
.user-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.user-meta-text { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.user-avatar--lg { width: 56px; height: 56px; font-size: 22px; }
.user-profile-header { display: flex; align-items: center; gap: 16px; }
.user-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── Filter Form (admin search) ───────────────────────────────────────────── */
.filter-form { display: flex; flex-direction: column; gap: 12px; }
.filter-form__search { }
.filter-form__bottom {
  display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap;
}
.filter-form__field { flex: 1; min-width: 120px; margin: 0; }
.filter-form__actions { display: flex; gap: 8px; align-items: flex-end; flex-shrink: 0; }

/* ── Empty State ─────────────────────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  padding: 48px 24px;
  text-align: center;
  gap: 12px;
}
.empty-state__icon { font-size: 48px; line-height: 1; }
.empty-state__title { font-size: 18px; font-weight: 700; }
.empty-state__text { color: var(--text-secondary); font-size: 15px; max-width: 280px; }

/* ── Recipe Form ─────────────────────────────────────────────────────────── */
.recipe-form { display: flex; flex-direction: column; gap: 0; }

/* ── Recipe Detail (two-col on desktop) ───────────────────────────────────── */
.recipe-detail { display: flex; flex-direction: column; }
.recipe-detail__aside { /* between hero and body on mobile */ }
.recipe-detail__body  { }
.recipe-aside { padding: 20px 16px 8px; }
.recipe-detail__body  { padding: 0 16px 32px; }

/* ── Sidebar Navigation (desktop only) ───────────────────────────────────── */
.sidebar-nav { display: none; }
.sidebar-nav__item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 14px; font-weight: 500;
  transition: background var(--transition), color var(--transition);
  position: relative;
  text-decoration: none;
}
.sidebar-nav__item svg { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; }
.sidebar-nav__item:hover  { background: var(--surface-2); color: var(--text); }
.sidebar-nav__item.is-active { background: #FFF0EE; color: var(--primary); font-weight: 600; }
.sidebar-nav__item-badge {
  margin-left: auto;
  background: var(--error); color: #fff;
  font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 99px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px;
}
.sidebar-nav__add {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; margin: 8px 0 4px;
  border-radius: var(--radius);
  background: var(--primary); color: #fff;
  font-size: 14px; font-weight: 600;
  transition: background var(--transition), box-shadow var(--transition);
  box-shadow: 0 2px 8px rgba(255,87,34,.25);
  text-decoration: none;
}
.sidebar-nav__add:hover { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(255,87,34,.35); }
.sidebar-nav__add svg  { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2.5; }
.sidebar-nav__divider  { height: 1px; background: var(--border); margin: 8px 4px; }
.sidebar-nav__spacer   { flex: 1; }
.sidebar-nav__section  { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-light); padding: 14px 12px 4px; }
.sidebar-nav__logout   {
  background: none; border: none; cursor: pointer; width: 100%;
  text-align: left;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (min-width: 480px) {
  .recipe-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 640px) {
  .main-content { padding-left: 0; padding-right: 0; }
  .bottom-nav {
    width: 640px;
    left: 50%; transform: translateX(-50%);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border: 1px solid var(--border);
    border-bottom: none;
  }
  .toast-container { width: 520px; }
}

@media (min-width: 768px) {
  .main-content   { max-width: 880px; padding-left: 24px; padding-right: 24px; }
  .app-bar__inner { max-width: 880px; padding: 0 24px; }
  .recipe-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .recipe-grid--compact { grid-template-columns: repeat(3, 1fr); }
  .page-title { font-size: 26px; }
  .recipe-card__title { font-size: 15px; }
  .recipe-card__body  { padding: 12px 14px 14px; }
  .card { margin: 0; }
}

@media (min-width: 1024px) {
  :root { --sidebar-width: 240px; }

  /* Sidebar shown, bottom nav hidden */
  .sidebar-nav {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0; top: var(--bar-height);
    width: var(--sidebar-width);
    height: calc(100vh - var(--bar-height));
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 16px 10px 24px;
    z-index: 90;
    overflow-y: auto;
    gap: 2px;
  }
  .bottom-nav { display: none !important; }

  /* App bar: full width, wider inner */
  .app-bar__inner { max-width: none; padding: 0 40px; }

  /* Main content shifts right of sidebar */
  .is-authenticated .main-content {
    margin-left: var(--sidebar-width);
    max-width: none;
    padding: calc(var(--bar-height) + 36px) 48px 64px;
  }

  /* Toast: centered in content area */
  .toast-container { left: calc(50% + var(--sidebar-width) / 2); }

  /* Typography */
  .page-header { padding: 0 0 24px; }
  .page-title  { font-size: 30px; font-weight: 800; }
  body { line-height: 1.65; }

  /* Search & chips */
  .search-bar  { padding: 0 0 12px; }
  .chip-scroll { padding: 0 0 12px; }

  /* Recipe grid: 3 cols, more breathing room */
  .recipe-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 0 0 8px;
  }
  .recipe-grid--compact { grid-template-columns: repeat(3, 1fr); }
  .recipe-card { transition: transform .2s ease, box-shadow .2s ease; }
  .recipe-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
  .recipe-card__body  { padding: 14px 16px 16px; }
  .recipe-card__title { font-size: 15px; }

  /* Recipe detail: 2-column grid */
  .recipe-detail {
    display: grid;
    grid-template-columns: 1fr 360px;
    grid-template-areas:
      "hero aside"
      "body aside";
    grid-template-rows: auto 1fr;
    column-gap: 32px;
    align-items: start;
    padding: 0 0 64px;
  }
  .recipe-detail__hero  { grid-area: hero; }
  .recipe-detail__aside {
    grid-area: aside;
    padding: 0;
    position: sticky;
    top: calc(var(--bar-height) + 24px);
    align-self: start;
  }
  .recipe-detail__body  {
    grid-area: body;
    padding: 24px 0 0;
  }
  .recipe-detail__hero .recipe-hero {
    aspect-ratio: 16/9;
    max-height: none;
    border-radius: var(--radius-lg);
  }
  .recipe-aside {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 24px;
  }
  .recipe-aside .recipe-page__title  { font-size: 24px; }
  .recipe-aside .fav-btn-lg  { margin-bottom: 16px; }
  .recipe-aside .recipe-tags { margin-bottom: 12px; }

  /* Profile: horizontal layout */
  .profile-header {
    flex-direction: row; align-items: flex-start;
    padding: 0 0 28px; gap: 24px; text-align: left;
  }
  .profile-avatar { width: 80px; height: 80px; font-size: 32px; flex-shrink: 0; margin-bottom: 0; }
  .profile-name { font-size: 26px; }

  /* Notifications */
  .notification-list { padding: 0; }

  /* Admin */
  .card { margin: 0; padding: 28px; }
  .card__title { font-size: 18px; margin-bottom: 24px; }
  .user-row { padding: 18px 0; gap: 16px; }
  .user-name { font-size: 15px; }
  .user-actions { gap: 10px; }
}

/* ── Activity Log ────────────────────────────────────────────────────────── */
.activity-log { }
.activity-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.activity-row:last-child { border-bottom: none; }
.activity-row__badge { flex-shrink: 0; padding-top: 2px; min-width: 160px; }
.activity-row__info  { flex: 1; min-width: 0; }
.activity-row__who   { font-weight: 500; font-size: 14px; }
.activity-row__meta  { font-size: 12px; margin-top: 2px; display: flex; flex-wrap: wrap; gap: 8px; }
.activity-row__ip    { font-size: 11px; margin-top: 2px; font-family: monospace; }
.activity-row__time  { flex-shrink: 0; font-size: 12px; white-space: nowrap; padding-top: 3px; }

/* ── Pagination ───────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.pagination__info { flex: 1; text-align: center; font-size: 13px; }

/* ── Look & Feel — overview ──────────────────────────────────────────────── */
.laf-grid { display: flex; flex-direction: column; gap: 16px; margin: 0 16px; }
.laf-card {
  display: flex; align-items: center; gap: 20px;
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--shadow-sm);
  text-decoration: none; color: var(--text);
  transition: box-shadow var(--transition), transform var(--transition);
}
.laf-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.laf-card__icon {
  width: 52px; height: 52px; border-radius: var(--radius);
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.laf-card__body  { flex: 1; min-width: 0; }
.laf-card__title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.laf-card__desc  { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 8px; }
.laf-card__count { font-size: 12px; color: var(--primary); font-weight: 600; }
.laf-card__arrow { color: var(--text-light); flex-shrink: 0; }

/* ── E-mail template list ────────────────────────────────────────────────── */
.card__subtitle { font-size: 14px; color: var(--text-secondary); line-height: 1.5; }
.card__subtitle code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.template-list { display: flex; flex-direction: column; }
.template-row {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 0; border-top: 1px solid var(--border);
}
.template-row:last-child { border-bottom: 1px solid var(--border); }
.template-row__icon {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px;
}
.template-row__info  { flex: 1; min-width: 0; }
.template-row__name  { font-weight: 600; font-size: 14px; margin-bottom: 3px; }
.template-row__desc  { font-size: 13px; margin-bottom: 6px; }
.template-row__meta  { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.template-row__actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }

/* ── E-mail editor ───────────────────────────────────────────────────────── */
.breadcrumb { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--text-light); }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 16px 16px; }
.page-header__actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; padding-top: 4px; }

.email-editor {
  display: flex; flex-direction: column; gap: 0;
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); overflow: hidden; margin: 0 16px;
}
.email-editor__pane { display: flex; flex-direction: column; }
.email-editor__pane--code { border-bottom: 1px solid var(--border); }
.email-editor__pane-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.email-editor__pane-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); }
.email-editor__pane-actions { display: flex; gap: 6px; }
.email-editor__textarea {
  width: 100%; min-height: 420px; padding: 16px;
  font-family: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', Consolas, monospace;
  font-size: 13px; line-height: 1.6; color: var(--text);
  background: var(--surface); border: none; resize: vertical;
  outline: none; tab-size: 2;
}
.email-editor__preview-wrap { overflow: hidden; background: #E8E8E3; }
.email-editor__iframe { width: 100%; height: 500px; border: none; display: block; transition: width var(--transition), max-width var(--transition); }

/* ── Shortcodes ──────────────────────────────────────────────────────────── */
.shortcode-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.shortcode-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 10px;
  cursor: pointer; font-size: 13px; text-align: left;
  transition: background var(--transition), border-color var(--transition);
}
.shortcode-chip:hover { background: var(--primary-light); border-color: var(--primary); }
.shortcode-chip code { font-size: 12px; color: var(--primary); font-weight: 600; }
.shortcode-chip__label { font-size: 12px; color: var(--text-secondary); }
.shortcode-chip--copied { background: #E8F8EE; border-color: var(--success); }
.shortcode-chip--copied code { color: var(--success); }
.shortcode-chip--copied::after { content: '✓ Gekopieerd'; font-size: 11px; color: var(--success); font-weight: 600; }
.shortcode-chip--copied .shortcode-chip__label { display: none; }

/* ── Editor actions ──────────────────────────────────────────────────────── */
.editor-actions { display: flex; gap: 10px; align-items: center; padding: 0 16px 24px; }
.editor-test-bar { padding: 0 16px 32px; }
.mt-4 { margin-top: 16px; }

/* ── Desktop: two-column editor ──────────────────────────────────────────── */
@media (min-width: 1024px) {
  .laf-grid { margin: 0; max-width: 680px; }
  .email-editor { flex-direction: row; margin: 0; }
  .email-editor__pane { flex: 1; min-width: 0; }
  .email-editor__pane--code { border-bottom: none; border-right: 1px solid var(--border); }
  .email-editor__textarea { min-height: 580px; resize: none; height: 100%; }
  .email-editor__iframe { height: 580px; }
  .editor-actions { padding: 0 0 24px; }
  .editor-test-bar { padding: 0 0 32px; }
  .template-row__desc { font-size: 14px; }
}

/* ── Print / A11y ─────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
