* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f5f5;
  color: #222;
  min-height: 100vh;
}

/* ── Header ── */
header {
  background: #1a1a1a;
  color: #fff;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 32px;
  height: 56px;
}
header h1 { font-size: 1.1rem; font-weight: 700; white-space: nowrap; }

nav { display: flex; gap: 4px; }
.nav-btn {
  background: none;
  border: none;
  color: #aaa;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.nav-btn:hover { background: #2a2a2a; color: #fff; }
.nav-btn.active { background: #333; color: #fff; }

/* ── Pages ── */
.page { max-width: 860px; margin: 0 auto; padding: 36px 24px; }
.page.hidden { display: none; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.page-header h2 { font-size: 1.4rem; font-weight: 700; }

/* ── Buttons ── */
.btn {
  padding: 9px 22px;
  border: none;
  border-radius: 7px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; }
.btn:active { opacity: 0.7; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: #1a7a4a; color: #fff; }

/* ── Recipe grid ── */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.recipe-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.recipe-card h3 { font-size: 1rem; font-weight: 700; }

.recipe-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.meta-pill {
  font-size: 0.72rem;
  background: #f0f0f0;
  color: #555;
  padding: 2px 9px;
  border-radius: 20px;
}

.recipe-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #555;
  border-left: 3px solid #e0a800;
  padding-left: 7px;
}
.recipe-card ul {
  padding-left: 16px;
  font-size: 0.83rem;
  color: #444;
  line-height: 1.6;
}
.recipe-card p.instructions {
  font-size: 0.83rem;
  color: #444;
  line-height: 1.5;
}

.empty-state {
  grid-column: 1 / -1;
  color: #aaa;
  font-size: 0.9rem;
  padding: 40px 0;
  text-align: center;
}
.error-state { color: #b32020; }

/* ── Create form ── */
.recipe-form {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  padding: 28px;
  max-width: 580px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group { display: flex; flex-direction: column; gap: 5px; }

label { font-size: 0.82rem; font-weight: 600; color: #444; }
.required { color: #c0392b; }
.field-hint { font-size: 0.75rem; color: #aaa; margin-top: -2px; }

input[type="text"],
input[type="number"],
textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #ddd;
  border-radius: 7px;
  font-size: 0.85rem;
  font-family: inherit;
  background: #fafafa;
  transition: border-color 0.15s;
  resize: vertical;
}
input:focus, textarea:focus {
  outline: none;
  border-color: #1a7a4a;
  background: #fff;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.feedback {
  font-size: 0.83rem;
  padding: 10px 14px;
  border-radius: 7px;
  font-weight: 500;
}
.feedback.hidden { display: none; }
.feedback.success { background: #dff0e8; color: #1a7a4a; }
.feedback.error   { background: #fde8e8; color: #b32020; }
