/* ============================================================================
   Modern! Fusion Catering — Internal Recipe System
   Luxury dark palette with gold accents. Playfair Display + Lato.
   ========================================================================== */

:root {
  --bg:            #080705;
  --bg-elev-1:     #110c08;
  --bg-elev-2:     #1b1510;
  --bg-elev-3:     #231b14;
  --border:        #2a2017;
  --border-strong: #3d2f20;
  --cream:         #f5edd8;
  --cream-dim:     #cfc3a4;
  --muted:         #8c7f63;
  --gold:          #d4a843;
  --gold-bright:   #e8c063;
  --gold-deep:     #9c7a2a;
  --danger:        #c25450;
  --success:       #6fa25a;

  --sidebar-w:     260px;
  --radius:        10px;
  --radius-lg:     14px;
  --shadow-lg:     0 20px 60px rgba(0, 0, 0, 0.6);
  --shadow-gold:   0 0 24px rgba(212, 168, 67, 0.18);

  --font-display:  'Playfair Display', 'Cormorant Garamond', Georgia, serif;
  --font-body:     'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--cream);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Noise/grain overlay for warmth */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.35;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.08  0 0 0 0 0.06  0 0 0 0 0.04  0 0 0 0.35 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--cream);
  letter-spacing: 0.01em;
  margin: 0 0 0.5em;
}

a { color: var(--gold); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--gold-bright); }

button { font-family: inherit; cursor: pointer; }

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #0d0907 0%, #080604 100%);
  border-right: 1px solid var(--border);
  padding: 28px 20px 20px;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 6px 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.logo-mark {
  width: 44px; height: 44px;
  border: 1.5px solid var(--gold);
  color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.04em;
  border-radius: 4px;
  background: radial-gradient(circle at 30% 20%, rgba(212, 168, 67, 0.12), transparent 60%);
}
.logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.logo-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--cream);
  letter-spacing: 0.02em;
}
.logo-sub {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--muted);
  margin-top: 2px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 6px;
  color: var(--cream-dim);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.02em;
  transition: all 0.18s ease;
  position: relative;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.8; }
.nav-item:hover {
  background: rgba(212, 168, 67, 0.06);
  color: var(--cream);
}
.nav-item.active {
  background: linear-gradient(90deg, rgba(212, 168, 67, 0.14), rgba(212, 168, 67, 0.02));
  color: var(--gold);
  border-left: 2px solid var(--gold);
  padding-left: 12px;
}
.nav-item.active svg { opacity: 1; }

.sidebar-footer {
  padding: 16px 8px 4px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99;
  backdrop-filter: blur(2px);
}

/* ── Main content ─────────────────────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  position: relative;
  z-index: 2;
}

.mobile-header {
  display: none;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev-1);
}
.menu-toggle {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
}
.menu-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--cream);
}
.mobile-logo {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--gold);
  font-size: 16px;
}

.page-container {
  padding: 40px 56px 80px;
  max-width: 1400px;
  margin: 0 auto;
}

/* ── Page headers ─────────────────────────────────────────────────────────── */
.page-header { margin-bottom: 32px; }
.page-eyebrow {
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 10px;
}
.page-title {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 10px;
}
.page-title .accent { color: var(--gold); font-style: italic; font-weight: 400; }
.page-subtitle {
  font-size: 15px;
  color: var(--cream-dim);
  max-width: 620px;
  line-height: 1.55;
}

/* ── Toolbar ──────────────────────────────────────────────────────────────── */
.toolbar {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.search-box {
  flex: 1;
  min-width: 240px;
  position: relative;
}
.search-box input {
  width: 100%;
  padding: 11px 14px 11px 40px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--cream);
  font-family: inherit;
  font-size: 14px;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s;
}
.search-box input::placeholder { color: var(--muted); }
.search-box input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.1);
}
.search-box::before {
  content: "";
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238c7f63' stroke-width='2'><circle cx='11' cy='11' r='7'/><path d='m21 21-4.3-4.3'/></svg>") center/contain no-repeat;
}

.filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chip {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--cream-dim);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.04em;
  border-radius: 999px;
  transition: all 0.18s;
  font-family: inherit;
}
.chip:hover { color: var(--cream); border-color: var(--gold-deep); }
.chip.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #1a1208;
  font-weight: 700;
}

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

.recipe-card {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 24px 22px;
  position: relative;
  cursor: pointer;
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 200px;
}
.recipe-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.recipe-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold-deep);
  background: var(--bg-elev-3);
}
.recipe-card:hover::before { opacity: 1; }

.recipe-card-category {
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 10px;
}
.recipe-card-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--cream);
  line-height: 1.2;
  margin-bottom: 10px;
}
.recipe-card-desc {
  font-size: 13.5px;
  color: var(--cream-dim);
  line-height: 1.55;
  margin-bottom: 16px;
  flex: 1;
}
.recipe-card-meta {
  display: flex;
  gap: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.recipe-card-meta span { display: inline-flex; align-items: center; gap: 5px; }
.recipe-card-meta .dot { color: var(--gold); }

/* ── Recipe detail ────────────────────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream-dim);
  margin-bottom: 24px;
  transition: color 0.15s;
}
.back-link:hover { color: var(--gold); }

.detail-header { margin-bottom: 36px; }
.detail-category {
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 10px;
}
.detail-title {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 700;
  line-height: 1.08;
  margin: 0 0 14px;
  max-width: 800px;
}
.detail-desc {
  font-size: 17px;
  color: var(--cream-dim);
  line-height: 1.55;
  max-width: 760px;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 40px;
  align-items: start;
}
@media (max-width: 1024px) { .detail-grid { grid-template-columns: 1fr; } }

.detail-section { margin-bottom: 36px; }
.section-heading {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}

.video-frame {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: #000;
}
.video-frame iframe { width: 100%; height: 100%; border: 0; }
.video-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: repeating-linear-gradient(45deg, var(--bg-elev-2), var(--bg-elev-2) 10px, var(--bg-elev-1) 10px, var(--bg-elev-1) 20px);
}

.instructions-list {
  padding: 0; margin: 0;
  list-style: none;
  counter-reset: step;
}
.instructions-list li {
  counter-increment: step;
  padding: 14px 0 14px 56px;
  border-bottom: 1px solid var(--border);
  position: relative;
  color: var(--cream-dim);
  font-size: 14.5px;
  line-height: 1.6;
}
.instructions-list li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0; top: 14px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  font-style: italic;
  color: var(--gold);
}
.instructions-list li:last-child { border-bottom: none; }

/* ── Calculator card ──────────────────────────────────────────────────────── */
.calculator-card {
  background: linear-gradient(145deg, var(--bg-elev-2), var(--bg-elev-1));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 28px 26px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: 30px;
}
.calculator-card::after {
  content: "";
  position: absolute;
  top: -60px; right: -60px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(212, 168, 67, 0.25) 0%, transparent 65%);
  pointer-events: none;
}
.calculator-card > * { position: relative; z-index: 1; }
.calc-label {
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 16px;
  text-align: center;
}
.calc-input-wrap {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
}
.calc-input {
  width: 140px;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--gold);
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 700;
  text-align: center;
  outline: none;
}
.calc-input::-webkit-outer-spin-button,
.calc-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.calc-input-suffix {
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream-dim);
}
.calc-result {
  text-align: center;
  padding: 18px 0 20px;
  margin: 14px 0 18px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.calc-result-num {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 700;
  font-style: italic;
  color: var(--gold);
  line-height: 1;
}
.calc-result-label {
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--cream-dim);
  margin-top: 6px;
}
.calc-helper {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.ingredient-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
}
.ingredient-table th {
  text-align: left;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--border);
}
.ingredient-table td {
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--cream);
  vertical-align: top;
}
.ingredient-table td.ing-amount {
  color: var(--gold);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
  text-align: right;
  padding-right: 12px;
}
.ingredient-table td.ing-notes {
  color: var(--muted);
  font-size: 12.5px;
  font-style: italic;
}
.ingredient-table tr:last-child td { border-bottom: none; }

/* ── Planner ──────────────────────────────────────────────────────────────── */
.planner-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 1100px) { .planner-grid { grid-template-columns: 1fr; } }

.planner-controls {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}
.planner-controls label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
  font-weight: 700;
}
.planner-guests-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  border-radius: 6px;
  outline: none;
}
.planner-guests-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.1);
}

.planner-selectable {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  max-height: 640px;
  overflow-y: auto;
}
.planner-recipe-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.planner-recipe-row:hover { background: rgba(212, 168, 67, 0.05); }
.planner-recipe-row input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--gold);
  cursor: pointer;
  flex-shrink: 0;
}
.planner-recipe-info { flex: 1; min-width: 0; }
.planner-recipe-name {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--cream);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.planner-recipe-cat {
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 3px;
}

.shopping-list-card {
  background: linear-gradient(145deg, var(--bg-elev-2), var(--bg-elev-1));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: sticky;
  top: 30px;
}
.shopping-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.shopping-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  margin: 0;
}
.shopping-meta {
  font-size: 11.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cream-dim);
}
.shopping-meta b { color: var(--gold); font-family: var(--font-display); }

.shopping-section { margin-bottom: 22px; }
.shopping-section-heading {
  font-family: var(--font-display);
  font-size: 12.5px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 10px;
}
.shopping-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 14px;
}
.shopping-item:last-child { border-bottom: none; }
.shopping-item-name { color: var(--cream); }
.shopping-item-amount {
  font-family: var(--font-display);
  color: var(--gold);
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
  padding-left: 14px;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid transparent;
  transition: all 0.18s;
  cursor: pointer;
  background: none;
  color: var(--cream);
}
.btn-primary {
  background: var(--gold);
  color: #1a1208;
  border-color: var(--gold);
}
.btn-primary:hover {
  background: var(--gold-bright);
  box-shadow: var(--shadow-gold);
}
.btn-ghost {
  border-color: var(--border-strong);
  color: var(--cream-dim);
}
.btn-ghost:hover {
  color: var(--cream);
  border-color: var(--gold-deep);
}
.btn-danger {
  color: var(--danger);
  border-color: var(--danger);
}
.btn-danger:hover {
  background: var(--danger);
  color: var(--cream);
}
.btn-sm { padding: 6px 12px; font-size: 11px; }

/* ── Admin table ──────────────────────────────────────────────────────────── */
.admin-table-wrap {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table th {
  text-align: left;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  padding: 16px 18px;
  background: var(--bg-elev-1);
  border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--cream);
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(212, 168, 67, 0.03); }
.admin-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.badge {
  display: inline-block;
  padding: 3px 9px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  border-radius: 3px;
  border: 1px solid;
}
.badge-active { color: var(--success); border-color: rgba(111, 162, 90, 0.35); background: rgba(111, 162, 90, 0.08); }
.badge-hidden { color: var(--muted); border-color: var(--border-strong); background: transparent; }

.warning-banner {
  background: rgba(212, 168, 67, 0.08);
  border: 1px solid var(--gold-deep);
  border-left: 3px solid var(--gold);
  color: var(--cream);
  padding: 16px 20px;
  border-radius: 6px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ── Modal ────────────────────────────────────────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 40px 16px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--bg-elev-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  max-width: 760px;
  width: 100%;
  padding: 36px 36px 32px;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.22s ease;
}
@keyframes modalIn {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modal-close {
  position: absolute;
  top: 16px; right: 18px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  padding: 4px 8px;
  cursor: pointer;
}
.modal-close:hover { color: var(--gold); }
.modal-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 6px;
}
.modal-subtitle {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr 1fr;
}
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.form-group { display: flex; flex-direction: column; }
.form-label {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 7px;
}
.form-control {
  padding: 10px 12px;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  color: var(--cream);
  font-family: inherit;
  font-size: 14px;
  border-radius: 5px;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
.form-control:focus { border-color: var(--gold); }
textarea.form-control {
  min-height: 120px;
  resize: vertical;
  font-family: var(--font-body);
  line-height: 1.55;
}

.ing-editor {
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-top: 8px;
}
.ing-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.ing-editor-header h4 {
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0;
}
.ing-row {
  display: grid;
  grid-template-columns: 2fr 100px 90px 2fr 30px;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}
.ing-row input {
  padding: 8px 10px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--cream);
  font-size: 13px;
  border-radius: 4px;
  font-family: inherit;
  outline: none;
  width: 100%;
}
.ing-row input:focus { border-color: var(--gold); }
.ing-remove-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
}
.ing-remove-btn:hover { color: var(--danger); }
@media (max-width: 640px) {
  .ing-row { grid-template-columns: 1fr 70px 70px 30px; }
  .ing-row .ing-notes-col { grid-column: 1 / -1; }
}

/* ── Loading & empty ──────────────────────────────────────────────────────── */
.loading-state, .empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}
.empty-state h3 {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--cream-dim);
  margin-bottom: 8px;
}
.spinner {
  width: 42px; height: 42px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toasts ───────────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 300;
}
.toast {
  background: var(--bg-elev-3);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  padding: 12px 18px;
  color: var(--cream);
  font-size: 13.5px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.25s ease;
  min-width: 240px;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
@keyframes toastIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .recipe-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar.open ~ .sidebar-overlay { display: block; }
  .main { margin-left: 0; }
  .mobile-header { display: flex; position: sticky; top: 0; z-index: 50; }
  .page-container { padding: 22px 18px 60px; }
  .page-title { font-size: 26px; line-height: 1.15; }
  .page-subtitle { font-size: 14px; }
  .page-header { margin-bottom: 22px; }

  /* Calculator / shopping unstick on mobile so user can scroll naturally */
  .calculator-card, .shopping-list-card { position: static; padding: 22px 20px; }
  .calculator-card::after { width: 160px; height: 160px; top: -40px; right: -40px; }
  .calc-input { width: 110px; font-size: 40px; }
  .calc-result-num { font-size: 34px; }

  /* Toolbar: vertical stack, chips scroll horizontally */
  .toolbar { gap: 12px; padding-bottom: 16px; margin-bottom: 20px; }
  .search-box { flex-basis: 100%; min-width: 0; }
  .filter-chips {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .filter-chips::-webkit-scrollbar { display: none; }
  .chip { flex-shrink: 0; min-height: 40px; padding: 9px 16px; }

  /* Recipe grid: tighter single-col on phones */
  .recipe-grid { grid-template-columns: 1fr; gap: 14px; }
  .recipe-card { padding: 20px; min-height: auto; }
  .recipe-card-title { font-size: 20px; }
  .recipe-card-desc { font-size: 13.5px; }

  /* Recipe Detail */
  .detail-title { font-size: 28px; }
  .detail-desc { font-size: 15px; }
  .detail-grid { gap: 24px; }
  .detail-section { margin-bottom: 26px; }
  .instructions-list li { padding: 12px 0 12px 46px; font-size: 14px; }
  .instructions-list li::before { font-size: 18px; top: 12px; }

  /* Ingredient table: compact and prevent horizontal overflow */
  .ingredient-table td { padding: 11px 0; font-size: 13.5px; }
  .ingredient-table td.ing-amount { font-size: 15px; padding-right: 0; }

  /* Planner — show shopping list BEFORE selectable on mobile so Angelo sees
     his output without scrolling past the whole recipe list first */
  .planner-grid { display: flex; flex-direction: column; gap: 20px; }
  .planner-grid > div:first-child { order: 2; }
  .planner-grid > div:last-child { order: 1; }
  .planner-controls { padding: 20px; margin-bottom: 16px; }
  .planner-selectable { max-height: 440px; padding: 14px; }
  .planner-recipe-row { padding: 14px 10px; }
  .planner-recipe-row input[type="checkbox"] { width: 22px; height: 22px; }
  .shopping-list-card { padding: 22px 20px; }
  .shopping-title { font-size: 22px; }

  /* Admin table → card layout */
  .admin-table-wrap { background: transparent; border: none; overflow: visible; }
  .admin-table, .admin-table thead, .admin-table tbody,
  .admin-table th, .admin-table td, .admin-table tr { display: block; width: 100%; }
  .admin-table thead { display: none; }
  .admin-table tr {
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    padding: 14px 16px 12px;
  }
  .admin-table tr:hover td { background: transparent; }
  .admin-table td {
    border: none !important;
    padding: 7px 0 !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 13.5px;
  }
  .admin-table td[data-label]::before {
    content: attr(data-label);
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
    flex-shrink: 0;
  }
  .admin-table td:first-child {
    padding-bottom: 10px !important;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--border) !important;
    display: block;
  }
  .admin-table td:first-child strong {
    font-family: var(--font-display);
    font-size: 18px;
    color: var(--cream);
  }
  .admin-table td.admin-actions-cell { padding-top: 12px !important; }
  .admin-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; gap: 8px; }
  .admin-actions .btn { flex: 1 1 auto; min-height: 40px; }

  /* Modal: tight padding, bigger close button */
  .modal-backdrop { padding: 12px 10px; }
  .modal { padding: 26px 20px 22px; border-radius: 10px; }
  .modal-title { font-size: 22px; }
  .modal-close { top: 8px; right: 8px; padding: 10px 14px; font-size: 20px; }
  .modal-actions { flex-wrap: wrap; gap: 8px; }
  .modal-actions .btn { flex: 1 1 auto; min-height: 42px; }

  /* Ingredient editor rows — stack properly on small screens */
  .ing-editor { padding: 14px; }
  .ing-row {
    grid-template-columns: 1fr 1fr auto;
    grid-template-areas:
      "name name remove"
      "amt  unit ."
      "notes notes notes";
    gap: 6px;
    padding: 10px;
    background: var(--bg-elev-2);
    border-radius: 6px;
    margin-bottom: 10px;
  }
  .ing-row input[data-f="name"]   { grid-area: name; }
  .ing-row input[data-f="amount"] { grid-area: amt; }
  .ing-row input[data-f="unit"]   { grid-area: unit; }
  .ing-row input[data-f="notes"]  { grid-area: notes; }
  .ing-row .ing-remove-btn {
    grid-area: remove;
    font-size: 22px;
    padding: 6px 10px;
    align-self: start;
  }
  .ing-row input { font-size: 14px; padding: 10px 12px; }

  /* Warning banner stack */
  .warning-banner { flex-direction: column; align-items: flex-start; padding: 14px 16px; }

  /* Form controls have bigger touch targets */
  .form-control { font-size: 15px; padding: 12px 14px; }

  /* Toasts on mobile */
  .toast-container { bottom: 14px; right: 14px; left: 14px; }
  .toast { min-width: 0; width: 100%; font-size: 14px; }

  /* Nav item bigger tap targets */
  .nav-item { padding: 13px 14px; min-height: 48px; font-size: 15px; }

  /* Back link — bigger hit area */
  .back-link { padding: 10px 0; min-height: 40px; font-size: 12px; }

  /* Chips as buttons should hit 44px vertical */
  .chip { min-height: 44px; display: inline-flex; align-items: center; }

  /* Menu toggle tap target */
  .menu-toggle { padding: 10px; min-width: 44px; min-height: 44px; }

  /* Inputs don't zoom on iOS (>= 16px font) */
  .search-box input,
  .planner-guests-input,
  .calc-input,
  .form-control,
  .ing-row input { font-size: 16px; }
  .calc-input { font-size: 40px; }
  .planner-guests-input { font-size: 24px; }
}

@media (max-width: 420px) {
  .page-container { padding: 18px 14px 60px; }
  .page-title { font-size: 24px; }
  .detail-title { font-size: 24px; }
  .recipe-card { padding: 16px 18px; }
  .recipe-card-title { font-size: 19px; }
  .shopping-title { font-size: 20px; }
  .calc-input { width: 96px; font-size: 34px; }
  .calc-result-num { font-size: 30px; }
  .modal { padding: 22px 16px 18px; }
  .shopping-item { font-size: 13.5px; }
  .shopping-item-amount { font-size: 14.5px; padding-left: 8px; }
}

/* ── Print ────────────────────────────────────────────────────────────────── */
@media print {
  body { background: #fff; color: #000; }
  body::before { display: none; }
  .sidebar, .sidebar-overlay, .mobile-header, .toolbar, .back-link,
  .btn, .modal-backdrop, .toast-container { display: none !important; }
  .main { margin-left: 0; }
  .page-container { padding: 20px; max-width: 100%; }
  .recipe-card, .calculator-card, .shopping-list-card,
  .admin-table-wrap, .planner-controls, .planner-selectable {
    background: #fff !important;
    border: 1px solid #ccc !important;
    color: #000 !important;
    box-shadow: none !important;
  }
  h1, h2, h3, h4, .detail-title, .page-title, .recipe-card-title,
  .shopping-title, .calc-result-num, .shopping-item-name,
  .ingredient-table td, .detail-desc { color: #000 !important; }
  .calc-result-num,
  .ing-amount,
  .shopping-item-amount,
  .section-heading,
  .detail-category,
  .page-eyebrow,
  .shopping-section-heading,
  .recipe-card-category { color: #9c7a2a !important; }
}
