/* ══════════════════════════════════════════════════════════════════════════
   02-admin-modals-forms.css — PlantPure Kitchen stylesheet 2 of 6
   Extracted verbatim from index.html lines 805-1340 (baseline fa8b59c).
   Contents: admin panel, modals, forms/editors, buttons. Contains the
   orphaned parse-error block at baseline lines 1265-1270 (a rule body with
   no selector, under the "── EDITOR PREP HINT ──" banner comment) — it is
   PRESERVED BROKEN on purpose, kept in-file with its following rule;
   do not "fix" it.

   DO NOT REORDER these six CSS files, their <link> tags in index.html, or
   any rules within them: the cascade depends on source order. Do not edit
   or reformat the rules below — scripts/check-css.mjs byte-compares the
   concatenation of all six files (headers stripped) in <link> order
   against baseline fa8b59c lines 28-3410.
   ─── end header — verbatim baseline CSS begins on the next line ─── */

/* ── ADMIN PANEL ── */
.admin-login {
  max-width: 400px;
  margin: 3rem auto;
  background: white;
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 2.5rem;
  box-shadow: 0 4px 20px rgba(107,37,16,0.1);
  text-align: center;
}
.admin-login h2 {
  font-family: 'Playfair Display', serif;
  color: var(--terra-dark);
  margin-bottom: 0.5rem;
}
.admin-login p { color: var(--warm-gray); font-size: 0.9rem; margin-bottom: 1.5rem; }
.admin-login input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  margin-bottom: 1rem;
  outline: none;
  transition: border-color 0.2s;
}
.admin-login input:focus { border-color: var(--terra); }
.admin-login .btn-primary {
  width: 100%;
  background: var(--terra);
  color: white;
  border: none;
  padding: 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  transition: background 0.15s;
}
.admin-login .btn-primary:hover { background: var(--terra-dark); }
.admin-login .error { color: #C0392B; font-size: 0.85rem; margin-top: 0.5rem; }

.admin-panel { display: none; }
.admin-panel.visible { display: block; }

.admin-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.admin-tab {
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: white;
  color: var(--warm-gray);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.15s;
}
.admin-tab.active {
  background: var(--terra);
  border-color: var(--terra);
  color: white;
}
.admin-content-panel { display: none; }
.admin-content-panel.active { display: block; }

/* PPK-1.1.5 — Mobile admin layout: stack sub-tabs as full-width column
   instead of wrapping awkwardly. Active tab gets a thicker terra
   background; left border emphasizes the active state in the vertical list. */
@media (max-width: 640px) {
  .admin-tabs {
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
  }
  .admin-tab {
    width: 100%;
    text-align: left;
    padding: 0.7rem 1rem;
    font-size: 0.92rem;
    border-left: 4px solid transparent;
  }
  .admin-tab.active {
    border-left-color: var(--terra-deeper, var(--terra));
  }
  /* Tighten the top-level Immersion/Kitchen Admin toggle on narrow screens */
  .admin-section-btn {
    padding: 0.45rem 0.7rem !important;
    font-size: 0.82rem !important;
  }
}

.recipe-list-admin {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.recipe-list-item {
  display: flex;
  align-items: center;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  gap: 1rem;
  transition: background 0.1s;
}
.recipe-list-item:hover { background: var(--terra-xlight); }
.recipe-list-item:last-child { border-bottom: none; }
.recipe-list-item h4 { flex: 1; font-size: 0.95rem; }
.recipe-list-item .recipe-type-badge {
  font-size: 0.72rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  background: var(--terra-xlight);
  color: var(--terra-dark);
  font-weight: 500;
}
.btn-edit, .btn-delete {
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  transition: all 0.15s;
}
.btn-edit { background: var(--terra-xlight); color: var(--terra-dark); border: 1px solid var(--border); }
.btn-edit:hover { background: var(--terra); color: white; border-color: var(--terra); }
.btn-delete { background: #FEE; color: #C0392B; border: 1px solid #FCC; }
.btn-delete:hover { background: #C0392B; color: white; border-color: #C0392B; }

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.admin-toolbar h3 { font-family: 'Playfair Display', serif; color: var(--terra-dark); }
.btn-add-recipe {
  background: var(--terra);
  color: white;
  border: none;
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  transition: background 0.15s;
}
.btn-add-recipe:hover { background: var(--terra-dark); }

/* ── MODAL ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(44,26,14,0.5);
  z-index: 1000;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-overlay.open { display: flex; }
.modal {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 680px;
  box-shadow: 0 20px 60px rgba(44,26,14,0.25);
  margin: auto;
  display: flex;
  flex-direction: column;
  max-height: 85vh;
}
.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.modal-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--terra-dark);
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--warm-gray);
  padding: 0.25rem;
  line-height: 1;
}
.modal-close:hover { color: var(--espresso); }
.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
}
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}
/* PPK-1.3.8 — Roomier footer buttons in the saved-recipe modal so text isn't
   cramped against the borders. Scoped to this modal only. */
#viewSavedRecipeModal .modal-footer .btn {
  padding: 0.7rem 1.35rem;
  font-size: 0.92rem;
  line-height: 1.2;
}
/* PPK-1.3.8 — Clean, asterisk-free recipe edit form. */
.edit-recipe-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--espresso);
  margin: 0 0 0.35rem;
}
.edit-recipe-hint { font-weight: 400; color: var(--warm-gray); font-size: 0.8rem; }
.edit-recipe-input, .edit-recipe-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--espresso);
  margin-bottom: 1.1rem;
}
.edit-recipe-textarea { line-height: 1.6; resize: vertical; }
.edit-recipe-input:focus, .edit-recipe-textarea:focus {
  outline: none;
  border-color: var(--terra);
}
.edit-recipe-note { font-size: 0.78rem; color: var(--warm-gray); margin: 0.2rem 0 0; line-height: 1.5; }

/* ── SWAP MODAL specific ── */
/* ── RECIPE DETAIL MODAL ── */
.recipe-detail-ingredients { margin-bottom: 1.25rem; }
.recipe-detail-ingredients h4,
.recipe-detail-steps h4 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--terra);
  margin-bottom: 0.6rem;
}
.recipe-detail-steps p {
  font-size: 0.9rem;
  line-height: 1.7;
  white-space: pre-line;
  color: var(--espresso-light);
}

/* ── FORM ELEMENTS ── */
.form-row {
  margin-bottom: 1rem;
}
.form-row label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--espresso);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--espresso);
  outline: none;
  transition: border-color 0.2s;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus { border-color: var(--terra); }
.form-row textarea { min-height: 120px; resize: vertical; }
.form-row-inline { display: grid; grid-template-columns: 1fr 80px 90px auto; gap: 0.5rem; align-items: end; }

.ingredients-editor { margin-bottom: 1rem; }
.ingredient-row {
  display: grid;
  grid-template-columns: 1fr 70px 80px 52px 32px;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
  align-items: center;
}
.ingredient-row input {
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.85rem;
  font-family: inherit;
}
.ingredient-row input:focus { border-color: var(--terra); outline: none; }
.ing-reorder-btns {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ing-reorder-btn {
  background: var(--cream);
  border: 1px solid var(--border);
  color: var(--warm-gray);
  width: 24px;
  height: 14px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.55rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s;
  padding: 0;
}
.ing-reorder-btn:hover { background: var(--terra-xlight); color: var(--terra); border-color: var(--terra); }
.btn-remove-ing {
  background: #FEE;
  border: none;
  color: #C0392B;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-remove-ing:hover { background: #C0392B; color: white; }
.btn-add-ingredient {
  font-size: 0.82rem;
  padding: 0.4rem 0.85rem;
  background: var(--terra-xlight);
  border: 1px solid var(--border);
  color: var(--terra-dark);
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
}
.btn-add-ingredient:hover { background: var(--terra); color: white; border-color: var(--terra); }

/* ── BACK BUTTON (desktop — shown when navigating via in-page links) ── */
.section-back-btn {
  display: none; /* shown via JS when history available */
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  color: var(--terra);
  font-size: 0.88rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  padding: 0 0 0.75rem;
  letter-spacing: 0.01em;
}
.section-back-btn:hover { color: var(--terra-dark); }

/* Sticky floating back button — mobile only */


@media (max-width: 640px) { .section-back-btn { display: none !important; } }

/* ── MOBILE NAV — hidden on desktop, shown via media query on mobile ── */
.mobile-nav-wrap { display: none; }

/* ── FRIDGE NOTICE ── */
.fridge-notice {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: #EBF7FF;
  border: 1px solid #90CAE8;
  border-left: 4px solid #2196A8;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.fridge-notice-icon { font-size: 1.6rem; flex-shrink: 0; margin-top: 0.1rem; }
.fridge-notice strong { display: block; color: #1A4F6E; font-size: 0.95rem; margin-bottom: 0.3rem; }
.fridge-notice p { font-size: 0.93rem; color: #2A6080; line-height: 1.55; margin: 0; }

/* ── STEP EDITOR ── */
.steps-editor {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.step-editor-row {
  display: grid;
  grid-template-columns: 28px 1fr 32px;
  gap: 0.5rem;
  align-items: flex-start;
}
.step-editor-num {
  background: var(--terra);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 0.45rem;
}
.step-editor-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.88rem;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}
.step-editor-input:focus { border-color: var(--terra); }

/* ── EDITOR PREP HINT ── */
  font-size: 0.78rem;
  color: var(--warm-gray);
  font-style: italic;
  margin-bottom: 0.4rem;
}

/* ── BUTTONS ── */
.btn {
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s;
}
.btn-primary { background: var(--terra); color: white; }
.btn-primary:hover { background: var(--terra-dark); }
.btn-secondary { background: white; color: var(--warm-gray); border: 1px solid var(--border); }
.btn-secondary:hover { color: var(--espresso); border-color: var(--warm-gray); }
.btn-outline-terra { background: transparent; color: var(--terra); border: 1px solid var(--terra); }
.btn-outline-terra:hover { background: var(--terra); color: white; }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.82rem; }

/* ── EXPORT/IMPORT ── */
.data-mgmt-card {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.data-mgmt-card h4 { font-family: 'Playfair Display', serif; color: var(--terra-dark); margin-bottom: 0.5rem; }
.data-mgmt-card p { font-size: 0.92rem; color: var(--espresso-light); margin-bottom: 1rem; }

/* ── DEFAULT MEAL PLAN EDITOR ── */
.default-plan-grid {
  display: grid;
  gap: 0.75rem;
}
.default-plan-row {
  display: grid;
  grid-template-columns: 80px 1fr 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  background: white;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.default-plan-row select {
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
}
.default-plan-row select:focus { border-color: var(--terra); }
.default-plan-day-label { font-weight: 600; font-size: 0.9rem; color: var(--terra-dark); }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--warm-gray);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 { font-family: 'Playfair Display', serif; margin-bottom: 0.5rem; color: var(--espresso-light); }

/* ── PRINT STYLES ── */
/* ══════════════════════════════════════════
   MOBILE — comprehensive responsive styles
   ══════════════════════════════════════════ */
