/* =====================================================
   RECEITAS — Main Stylesheet
   ===================================================== */

:root {
  --primary:      #f97316;
  --primary-dark: #ea580c;
  --secondary:    #1e293b;
  --success:      #22c55e;
  --danger:       #ef4444;
  --warning:      #f59e0b;
  --bg:           #f8fafc;
  --white:        #ffffff;
  --text:         #1e293b;
  --text-muted:   #64748b;
  --border:       #e2e8f0;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.07);
  --shadow:       0 4px 16px rgba(0,0,0,.1);
  --shadow-lg:    0 12px 40px rgba(0,0,0,.15);
  --radius:       12px;
  --radius-sm:    7px;
  --transition:   .2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a    { color: inherit; text-decoration: none; }
img  { max-width: 100%; display: block; }
input, textarea, select, button { font-family: inherit; }

/* ── Container ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.flash-container { margin-top: 1rem; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .6rem 1.3rem;
  border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 600;
  cursor: pointer; border: 2px solid transparent;
  transition: var(--transition); white-space: nowrap; line-height: 1.4;
}
.btn-primary              { background: var(--primary);      color: #fff; border-color: var(--primary); }
.btn-primary:hover        { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-secondary            { background: var(--secondary);    color: #fff; border-color: var(--secondary); }
.btn-secondary:hover      { background: #0f172a; border-color: #0f172a; }
.btn-outline              { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover        { background: var(--primary); color: #fff; }
.btn-danger               { background: var(--danger);  color: #fff; border-color: var(--danger); }
.btn-danger:hover         { background: #dc2626; border-color: #dc2626; }
.btn-success              { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover        { background: #16a34a; }
.btn-ghost                { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover          { background: var(--bg); color: var(--text); }
.btn-sm  { padding: .35rem .85rem; font-size: .8rem; }
.btn-lg  { padding: .8rem 2rem;   font-size: 1.05rem; }
.btn-block { width: 100%; justify-content: center; }

/* ── Navbar ── */
.navbar {
  background: var(--white); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 1000; box-shadow: var(--shadow-sm);
}
.navbar-inner {
  display: flex; align-items: center; gap: 1rem; height: 64px;
}
.navbar-brand {
  font-size: 1.4rem; font-weight: 800; color: var(--primary);
  display: flex; align-items: center; gap: .35rem; flex-shrink: 0;
}
.navbar-brand span { color: var(--secondary); }
.navbar-nav         { display: flex; align-items: center; gap: .15rem; list-style: none; }
.navbar-nav a {
  padding: .4rem .85rem; border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 500; color: var(--text-muted); transition: var(--transition);
}
.navbar-nav a:hover, .navbar-nav a.active { background: var(--bg); color: var(--primary); }
.navbar-actions  { display: flex; align-items: center; gap: .5rem; margin-left: auto; }

/* ── User Dropdown ── */
.user-menu { position: relative; }
.user-menu-btn {
  display: flex; align-items: center; gap: .5rem;
  padding: .4rem .85rem; border-radius: var(--radius-sm);
  cursor: pointer; font-weight: 600; color: var(--text);
  background: none; border: 2px solid var(--border); font-size: .9rem;
  transition: var(--transition);
}
.user-menu-btn:hover { background: var(--bg); border-color: var(--primary); }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem; flex-shrink: 0;
}
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  min-width: 190px; overflow: hidden;
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: var(--transition); z-index: 200;
}
.dropdown-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-menu a {
  display: flex; align-items: center; gap: .6rem;
  padding: .75rem 1rem; font-size: .9rem; color: var(--text); transition: var(--transition);
}
.dropdown-menu a:hover  { background: var(--bg); color: var(--primary); }
.dropdown-divider       { border-top: 1px solid var(--border); }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, var(--secondary) 0%, #334155 100%);
  color: #fff; padding: 4rem 0 3rem; text-align: center;
}
.hero h1       { font-size: 2.6rem; font-weight: 800; margin-bottom: .75rem; }
.hero h1 span  { color: var(--primary); }
.hero p        { font-size: 1.05rem; color: rgba(255,255,255,.7); margin-bottom: 2rem; }
.hero-subtitle {
  font-size: 1.25rem;
  font-weight: 500;
  margin: 1rem auto 2rem;
  max-width: 600px;
  line-height: 1.4;
}
.search-box {
  display: flex; max-width: 560px; margin: 0 auto;
  background: var(--white); border-radius: 50px;
  overflow: hidden; box-shadow: var(--shadow-lg);
}
.search-box input {
  flex: 1; padding: .9rem 1.5rem; border: none; outline: none;
  font-size: 1rem; color: var(--text);
}
.search-box button {
  padding: .9rem 1.75rem; background: var(--primary); color: #fff;
  border: none; font-weight: 700; cursor: pointer; transition: var(--transition);
  border-radius: 0 50px 50px 0;
}
.search-box button:hover { background: var(--primary-dark); }

/* ── Filters Bar ── */
.filters {
  background: var(--white); border-bottom: 1px solid var(--border);
  padding: .75rem 0; position: sticky; top: 64px; z-index: 900;
}
.filters-inner {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  flex-wrap: wrap; padding: .25rem 0;
}
.filters-inner-diff {
  padding-top: .5rem; /* add breathing room above */
  border-top: 1px solid var(--border);
  margin-top: .1rem;
  padding-bottom: .25rem;
}
.filter-chip {
  padding: .4rem 1rem; border-radius: 50px;
  background: var(--bg); border: 1px solid var(--border);
  font-size: .82rem; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: var(--transition); color: var(--text-muted);
}
/* difficulty-specific chips get a slightly darker border */
.diff-chip {
  border-color: var(--primary);
}
.diff-chip:hover {
  border-color: var(--primary-dark);
}

.filter-chip:hover         { border-color: var(--primary); color: var(--primary); }
.filter-chip.active        { background: var(--primary); border-color: var(--primary); color: #fff; }
.filter-separator          { width: 1px; height: 20px; background: var(--border); flex-shrink: 0; }

/* ── Main ── */
main { flex: 1; padding: 2.5rem 0; }

/* ── Section Header ── */
.section-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem;
}
.section-title { font-size: 1.35rem; font-weight: 700; color: var(--secondary); }
.section-count { font-size: .85rem; color: var(--text-muted); }

/* ── Recipe Grid ── */
.recipes-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1.5rem;
}
.recipe-card {
  background: var(--white); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex; flex-direction: column; cursor: pointer;
}
.recipe-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.recipe-card a     { display: flex; flex-direction: column; flex: 1; color: inherit; }
.recipe-card-img   { width: 100%; height: 195px; object-fit: cover; }
.recipe-card-img-placeholder {
  width: 100%; height: 195px;
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  display: flex; align-items: center; justify-content: center; font-size: 3.5rem;
}
.recipe-card-body  { padding: 1.2rem; flex: 1; display: flex; flex-direction: column; }
.recipe-card-category {
  font-size: .72rem; font-weight: 700; color: var(--primary);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: .3rem;
}
.recipe-card-title {
  font-size: 1.05rem; font-weight: 700; color: var(--text);
  margin-bottom: .45rem; line-height: 1.4;
}
.recipe-card-desc  {
  font-size: .83rem; color: var(--text-muted); line-height: 1.5; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.recipe-card-meta  {
  display: flex; align-items: center; gap: .85rem; flex-wrap: wrap;
  margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--border);
  font-size: .78rem; color: var(--text-muted);
}
.recipe-card-meta span { display: flex; align-items: center; gap: .25rem; }

/* ── Difficulty Badge ── */
.difficulty-badge    { padding: .2rem .65rem; border-radius: 50px; font-size: .73rem; font-weight: 700; }
.difficulty-facil    { background: #dcfce7; color: #166534; }
.difficulty-media    { background: #fef9c3; color: #854d0e; }
.difficulty-dificil  { background: #fee2e2; color: #991b1b; }

/* ── Recipe Detail ── */
.recipe-detail { max-width: 950px; margin: 0 auto; }
.breadcrumb    { font-size: .85rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.breadcrumb a  { color: var(--primary); }
.breadcrumb span { margin: 0 .4rem; }

.recipe-header {
  background: var(--white); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  margin-bottom: 2rem;
}
.recipe-hero-img         { width: 100%; height: 400px; object-fit: cover; }
.recipe-hero-placeholder {
  width: 100%; height: 400px;
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  display: flex; align-items: center; justify-content: center; font-size: 6rem;
}
.recipe-header-body      { padding: 2rem; }
.recipe-title            { font-size: 2rem; font-weight: 800; margin-bottom: .75rem; line-height: 1.3; }
.recipe-desc             { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 1rem; line-height: 1.75; }

.recipe-stats   {
  display: flex; flex-wrap: wrap; gap: .75rem;
  padding: 1.25rem; background: var(--bg); border-radius: var(--radius-sm); margin-bottom: 1.5rem;
}
.recipe-stat {
  display: flex; flex-direction: column; align-items: center; gap: .2rem;
  flex: 1; min-width: 90px; text-align: center;
}
.recipe-stat-value { font-size: 1.15rem; font-weight: 800; color: var(--primary); }
.recipe-stat-label { font-size: .7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.recipe-actions    { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }

.recipe-content  { display: grid; grid-template-columns: 295px 1fr; gap: 1.5rem; }
.recipe-sidebar  { display: flex; flex-direction: column; gap: 1.5rem; }
.recipe-main     { display: flex; flex-direction: column; gap: 1.5rem; }

/* ── Card ── */
.card          { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.card-header   { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: .5rem; }
.card-header h3{ font-size: .95rem; font-weight: 700; color: var(--secondary); }
.card-body     { padding: 1.25rem; }

/* ── Ingredients ── */
.ingredients-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.ingredients-list li {
  display: flex; align-items: baseline; gap: .5rem;
  font-size: .9rem; padding-bottom: .5rem; border-bottom: 1px dashed var(--border);
}
.ingredients-list li:last-child { border-bottom: none; padding-bottom: 0; }
.ingredient-qty  { font-weight: 700; color: var(--primary); min-width: 70px; flex-shrink: 0; }
.ingredient-unit { color: var(--text-muted); font-size: .8rem; }

/* ── Preparation ── */
.preparation-text { font-size: .95rem; line-height: 1.8; color: var(--text); white-space: pre-line; }

/* ── Info List ── */
.info-list         { list-style: none; display: flex; flex-direction: column; gap: .65rem; }
.info-list li      { display: flex; justify-content: space-between; align-items: center; font-size: .88rem; }
.info-list .label  { color: var(--text-muted); }
.info-list .value  { font-weight: 600; text-align: right; }

/* ── Savers List ── */
.savers-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.savers-list li { font-size: .85rem; color: var(--text-muted); display: flex; align-items: center; gap: .4rem; }

/* ── Forms ── */
.form-group  { margin-bottom: 1.25rem; }
.form-label  { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .4rem; color: var(--secondary); }
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-control {
  width: 100%; padding: .65rem 1rem;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  font-size: .95rem; color: var(--text); background: var(--white);
  transition: border-color var(--transition); outline: none;
}
.form-control:focus       { border-color: var(--primary); }
.form-control::placeholder{ color: var(--text-muted); }
textarea.form-control     { resize: vertical; min-height: 110px; }
select.form-control       { cursor: pointer; }
.form-hint   { font-size: .78rem; color: var(--text-muted); margin-top: .3rem; }
.form-row    { display: grid; grid-template-columns: 1fr 1fr;      gap: 1rem; }
.form-row-3  { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.form-row-4  { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 1rem; }

/* ── Auth Page ── */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--secondary), #334155); padding: 2rem;
}
.auth-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 2.5rem; width: 100%; max-width: 440px;
}
.auth-logo     { text-align: center; font-size: 2rem; font-weight: 800; color: var(--primary); margin-bottom: .25rem; }
.auth-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 2rem; font-size: .9rem; }
.auth-divider  { text-align: center; color: var(--text-muted); margin: 1.25rem 0; font-size: .85rem; }
.auth-footer   { text-align: center; margin-top: 1.5rem; font-size: .9rem; color: var(--text-muted); }
.auth-footer a { color: var(--primary); font-weight: 600; }

/* ── Alerts ── */
.alert {
  padding: .85rem 1.1rem; border-radius: var(--radius-sm);
  margin-bottom: 1.25rem; font-size: .9rem;
  display: flex; align-items: flex-start; gap: .6rem;
}
.alert-success { background: #dcfce7; color: #166534; border-left: 4px solid #22c55e; }
.alert-danger  { background: #fee2e2; color: #991b1b; border-left: 4px solid #ef4444; }
.alert-warning { background: #fef9c3; color: #854d0e; border-left: 4px solid #f59e0b; }
.alert-info    { background: #dbeafe; color: #1e40af; border-left: 4px solid #3b82f6; }

/* ── Save Button ── */
.save-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .6rem 1.3rem; border-radius: var(--radius-sm);
  border: 2px solid var(--border); background: none;
  font-size: .9rem; font-weight: 600; color: var(--text-muted);
  cursor: pointer; transition: var(--transition);
}
.save-btn:hover        { border-color: var(--primary); color: var(--primary); background: #fff7ed; }
.save-btn.saved        { border-color: var(--primary); color: var(--primary); background: #fff7ed; }
.save-btn.saved .heart { color: var(--danger); }

/* ── Admin Layout ── */
.admin-layout    { display: flex; min-height: calc(100vh - 64px); }
.admin-sidebar   {
  width: 240px; background: var(--secondary); flex-shrink: 0;
  padding: 1.5rem 0; position: sticky; top: 64px;
  height: calc(100vh - 64px); overflow-y: auto;
}
.admin-sidebar-brand {
  padding: 0 1.25rem 1rem; font-size: 1rem; font-weight: 800; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: .75rem;
}
.admin-sidebar-title {
  padding: .75rem 1.25rem .35rem;
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .12em; color: rgba(255,255,255,.35);
}
.admin-nav a {
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem 1.25rem; color: rgba(255,255,255,.65);
  font-size: .88rem; font-weight: 500; transition: var(--transition);
}
.admin-nav a:hover  { background: rgba(255,255,255,.08); color: #fff; }
.admin-nav a.active { background: var(--primary); color: #fff; }
.admin-nav .icon    { font-size: 1rem; width: 18px; text-align: center; flex-shrink: 0; }
.admin-content { flex: 1; padding: 2rem; overflow-x: hidden; }
.admin-content-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 2rem; gap: 1rem; flex-wrap: wrap;
}
.admin-title    { font-size: 1.6rem; font-weight: 800; color: var(--secondary); }
.admin-subtitle { font-size: .88rem; color: var(--text-muted); margin-top: .15rem; }

/* ── Stat Cards ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.stat-card  {
  background: var(--white); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  display: flex; align-items: center; gap: 1rem;
}
.stat-icon  { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; }
.stat-icon.orange { background: #fff7ed; color: var(--primary); }
.stat-icon.blue   { background: #dbeafe; color: #2563eb; }
.stat-icon.green  { background: #dcfce7; color: #16a34a; }
.stat-icon.red    { background: #fee2e2; color: #dc2626; }
.stat-value { font-size: 1.9rem; font-weight: 800; color: var(--secondary); line-height: 1; }
.stat-label { font-size: .78rem; color: var(--text-muted); margin-top: .2rem; }

/* ── Table ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--white); }
table       { width: 100%; border-collapse: collapse; font-size: .88rem; }
thead th {
  background: var(--bg); padding: .8rem 1rem; text-align: left;
  font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted); white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
tbody td   { padding: .85rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafafa; }
.table-img { width: 46px; height: 46px; border-radius: var(--radius-sm); object-fit: cover; }
.table-actions { display: flex; gap: .5rem; }

/* ── Ingredient Builder (Admin Form) ── */
.ingredients-builder { border: 2px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.ingredients-header  {
  display: grid; grid-template-columns: 1fr 120px 110px 42px;
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.ingredients-header span {
  padding: .55rem 1rem; font-size: .72rem; font-weight: 700; text-transform: uppercase;
  color: var(--text-muted); border-right: 1px solid var(--border);
}
.ingredients-header span:last-child { border-right: none; }
.ingredient-row { display: grid; grid-template-columns: 1fr 120px 110px 42px; border-bottom: 1px solid var(--border); }
.ingredient-row:last-child { border-bottom: none; }
.ingredient-row input {
  padding: .65rem 1rem; border: none; border-right: 1px solid var(--border);
  outline: none; font-size: .88rem; color: var(--text); width: 100%; background: #fff;
  transition: background var(--transition);
}
.ingredient-row input:focus  { background: #fffbf5; }
.ingredient-row input:last-of-type { border-right: none; }
.btn-remove-row {
  background: none; border: none; color: var(--danger); cursor: pointer;
  font-size: 1.2rem; display: flex; align-items: center; justify-content: center;
  transition: var(--transition); width: 42px;
}
.btn-remove-row:hover { background: var(--danger); color: #fff; }

/* ── Image Upload Preview ── */
.image-upload-wrap { position: relative; }
.image-preview {
  width: 100%; height: 210px; border: 2px dashed var(--border);
  border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: .5rem; cursor: pointer; transition: var(--transition);
  overflow: hidden; background: var(--bg);
}
.image-preview:hover       { border-color: var(--primary); background: #fff7ed; }
.image-preview img         { width: 100%; height: 100%; object-fit: cover; }
.image-preview-text        { font-size: .85rem; color: var(--text-muted); }
.image-upload-input        { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 1; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 2000; display: flex; align-items: center; justify-content: center;
  padding: 1rem; opacity: 0; visibility: hidden; transition: var(--transition);
}
.modal-overlay.open      { opacity: 1; visibility: visible; }
.modal {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 2rem; max-width: 430px; width: 100%;
  transform: scale(.95); transition: transform var(--transition);
}
.modal-overlay.open .modal { transform: scale(1); }
.modal h3   { font-size: 1.15rem; font-weight: 700; margin-bottom: .65rem; }
.modal p    { color: var(--text-muted); margin-bottom: 1.5rem; font-size: .9rem; }
.modal-actions { display: flex; gap: .75rem; justify-content: flex-end; }

/* ── Toasts ── */
.toasts {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  z-index: 3000; display: flex; flex-direction: column; gap: .5rem; pointer-events: none;
}
.toast {
  background: var(--secondary); color: #fff;
  padding: .75rem 1.25rem; border-radius: var(--radius-sm);
  box-shadow: var(--shadow); font-size: .88rem; font-weight: 500;
  display: flex; align-items: center; gap: .5rem;
  animation: toastIn .3s ease;
}
.toast.success { background: #166534; }
.toast.error   { background: #991b1b; }
.toast.info    { background: #1e40af; }
@keyframes toastIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Pagination ── */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: .4rem; margin-top: 2.5rem; flex-wrap: wrap;
}
.page-link {
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); font-size: .88rem; font-weight: 600;
  color: var(--text-muted); border: 2px solid var(--border); transition: var(--transition);
}
.page-link:hover  { border-color: var(--primary); color: var(--primary); }
.page-link.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-link.disabled { opacity: .4; pointer-events: none; }

/* ── Empty State ── */
.empty-state      { text-align: center; padding: 4rem 2rem; color: var(--text-muted); }
.empty-state .icon{ font-size: 4rem; margin-bottom: 1rem; }
.empty-state h3   { font-size: 1.2rem; font-weight: 700; color: var(--secondary); margin-bottom: .5rem; }
.empty-state p    { font-size: .9rem; margin-bottom: 1.5rem; }

/* ── Footer ── */
footer {
  background: var(--secondary); color: rgba(255,255,255,.55);
  text-align: center; padding: 1.5rem; font-size: .85rem;
}
footer strong { color: var(--primary); }

/* ── PDF / Print ── */
.pdf-page    { max-width: 800px; margin: 2rem auto; padding: 2rem; }
.pdf-header  { border-bottom: 3px solid var(--primary); padding-bottom: 1rem; margin-bottom: 2rem; }

@media print {
  .navbar, .filters, .recipe-actions, footer, .save-btn,
  .btn, .toasts, .modal-overlay, .pdf-actions, nav { display: none !important; }
  body      { background: #fff; font-size: 12pt; }
  .recipe-detail, .pdf-page { max-width: 100%; margin: 0; }
  .recipe-content  { grid-template-columns: 1fr; }
  .recipe-header, .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .recipe-hero-img { height: 250px; }
  a[href]::after   { content: none; }
}

/* ── Recipe Form Grid ── */
.recipe-form-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  align-items: start;
}

/* ── Admin Mobile Nav ── */
.admin-mobile-nav {
  display: none;
  background: var(--secondary);
  position: sticky; top: 64px; z-index: 950;
  max-height: 0; overflow: hidden;
  transition: max-height .3s ease;
}
.admin-mobile-nav.open { max-height: 600px; overflow-y: auto; }
.admin-mobile-nav .mobile-nav-inner { padding: .5rem 0 1rem; }
.admin-mobile-nav-section {
  padding: .65rem 1.25rem .3rem;
  font-size: .65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .12em; color: rgba(255,255,255,.35);
}
.admin-mobile-nav .mobile-nav-list a {
  color: rgba(255,255,255,.7); padding: .75rem 1.5rem;
  border-left-color: transparent;
}
.admin-mobile-nav .mobile-nav-list a:hover,
.admin-mobile-nav .mobile-nav-list a.active {
  background: rgba(255,255,255,.08); color: #fff;
  border-left-color: var(--primary);
}
.admin-mobile-nav .mobile-nav-divider { border-color: rgba(255,255,255,.1); }

/* ── Hamburger Button ── */
.navbar-toggler {
  display: none;
  flex-direction: column; justify-content: center; align-items: center; gap: 5px;
  width: 40px; height: 40px; flex-shrink: 0; margin-left: auto;
  background: none; border: 2px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; transition: var(--transition);
}
.navbar-toggler:hover { border-color: var(--primary); }
.navbar-toggler span {
  display: block; width: 18px; height: 2px;
  background: var(--text); border-radius: 2px; transition: var(--transition);
}
.navbar-toggler.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar-toggler.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.navbar-toggler.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile Nav ── */
.mobile-nav {
  display: none;
  background: var(--white); border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 20px rgba(0,0,0,.1);
  position: sticky; top: 64px; z-index: 950;
  max-height: 0; overflow: hidden;
  transition: max-height .3s ease;
}
.mobile-nav.open { max-height: 520px; overflow-y: auto; }
.mobile-nav-inner { padding: .5rem 0 1rem; }
.mobile-nav-list  { list-style: none; }
.mobile-nav-list a {
  display: block; padding: .8rem 1.5rem;
  color: var(--text); font-size: .95rem; font-weight: 500;
  transition: var(--transition);
  border-left: 3px solid transparent;
}
.mobile-nav-list a:hover  { background: var(--bg); color: var(--primary); border-left-color: var(--primary); }
.mobile-nav-divider       { border-top: 1px solid var(--border); margin: .4rem 0; }
.mobile-nav-user-info {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1.5rem; color: var(--text-muted); font-size: .88rem;
}
.mobile-nav-logout {
  display: block; padding: .8rem 1.5rem;
  color: var(--danger); font-size: .9rem; font-weight: 600;
  transition: var(--transition);
}
.mobile-nav-logout:hover { background: #fee2e2; }
.mobile-nav-auth {
  display: flex; gap: .75rem; padding: .75rem 1.5rem;
}
.mobile-nav-auth .btn { flex: 1; justify-content: center; }

/* ── Responsive ── */
/* 900px: recipe detail → 1 col, admin sidebar narrows */
@media (max-width: 900px) {
  .recipe-content { grid-template-columns: 1fr; }
  .admin-sidebar  { width: 200px; }
}

/* 768px: tablet + mobile */
@media (max-width: 768px) {
  /* Navbar: show hamburger, hide desktop links + actions */
  .navbar-toggler { display: flex; }
  .navbar-nav     { display: none; }
  .navbar-actions { display: none; }
  .admin-navbar-actions { display: flex !important; }  /* admin sempre visível */
  .admin-navbar-actions .user-menu-name { display: none; } /* esconde nome, mantém avatar */
  .admin-navbar-actions .btn-ghost      { display: none; } /* esconde "← Ver Site" (está no mobile nav) */
  .admin-toggler  { display: flex; }
  .mobile-nav     { display: block; }
  .admin-mobile-nav { display: block; }

  /* Hero */
  .hero           { padding: 2.5rem 0 2rem; }
  .hero h1        { font-size: 1.75rem; }
  .hero p         { font-size: .9rem; margin-bottom: 1.5rem; }
  .search-box input  { padding: .75rem 1.25rem; font-size: .9rem; }
  .search-box button { padding: .75rem 1.25rem; }

  /* Filters */
  .filter-chip    { font-size: .79rem; padding: .35rem .85rem; }

  /* Main */
  main            { padding: 1.75rem 0; }

  /* Recipe Grid */
  .recipes-grid   { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }

  /* Recipe Detail */
  .recipe-hero-img, .recipe-hero-placeholder { height: 240px; }
  .recipe-header-body { padding: 1.25rem; }
  .recipe-title   { font-size: 1.55rem; }
  .recipe-stats   { gap: .5rem; padding: 1rem; }
  .recipe-stat    { min-width: 75px; }
  .recipe-actions { gap: .5rem; }

  /* Forms */
  .form-row, .form-row-3, .form-row-4 { grid-template-columns: 1fr; }

  /* Recipe form: 1 column */
  .recipe-form-grid { grid-template-columns: 1fr; }

  /* Admin */
  .admin-sidebar  { display: none; }
  .admin-layout   { flex-direction: column; }
  .admin-content  { padding: 1rem; }
  .admin-title    { font-size: 1.3rem; }
  .stats-grid     { grid-template-columns: 1fr 1fr; }

  /* Ingredient builder: hide column labels, stack name full-width */
  .ingredients-header { display: none; }
  .ingredient-row {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }
  .ingredient-row input:nth-child(1) {
    grid-column: 1 / -1;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .ingredient-row input:nth-child(2) { border-right: 1px solid var(--border); }
  .ingredient-row input:nth-child(3) { border-right: none; }
  .btn-remove-row { border-top: 1px solid var(--border); width: 100%; grid-column: 1 / -1; height: 36px; }

  /* Section header stackable */
  .section-header { flex-wrap: wrap; gap: .5rem; }

  /* Admin content header */
  .admin-content-header { flex-direction: column; align-items: flex-start; }
}

/* 480px: small phones */
@media (max-width: 480px) {
  .container     { padding: 0 .85rem; }

  /* Navbar */
  .navbar-inner  { height: 56px; }
  .navbar-brand  { font-size: 1.15rem; }
  .filters       { top: 56px; }
  .mobile-nav    { top: 56px; }

  /* Hero */
  .hero          { padding: 2rem 0 1.5rem; }
  .hero h1       { font-size: 1.4rem; }
  .hero p        { font-size: .85rem; }
  .search-box    { border-radius: var(--radius-sm); }
  .search-box input  { padding: .65rem .9rem; font-size: .88rem; }
  .search-box button { padding: .65rem 1rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

  /* Filters */
  .filter-chip   { font-size: .75rem; padding: .3rem .7rem; }

  /* Main */
  main           { padding: 1.25rem 0; }

  /* Recipe grid → 1 col */
  .recipes-grid  { grid-template-columns: 1fr; gap: .75rem; }

  /* Recipe detail */
  .recipe-hero-img, .recipe-hero-placeholder { height: 190px; }
  .recipe-header-body { padding: 1rem; }
  .recipe-title  { font-size: 1.25rem; }
  .recipe-desc   { font-size: .88rem; }
  .recipe-stats  { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; padding: .75rem; }
  .recipe-stat   { min-width: unset; }
  .recipe-stat-value { font-size: 1rem; }
  .recipe-actions { flex-direction: column; }
  .recipe-actions .btn,
  .recipe-actions .save-btn { width: 100%; justify-content: center; }

  /* Breadcrumb */
  .breadcrumb    { font-size: .78rem; }

  /* Cards */
  .card-header   { padding: .8rem 1rem; }
  .card-body     { padding: 1rem; }

  /* Admin */
  .admin-content { padding: .75rem; }
  .stats-grid    { grid-template-columns: 1fr; }

  /* Auth */
  .auth-page     { padding: 1rem; }
  .auth-card     { padding: 1.5rem 1.25rem; }

  /* Pagination */
  .page-link     { width: 34px; height: 34px; font-size: .8rem; }

  /* Toasts */
  .toasts        { bottom: 1rem; right: .75rem; left: .75rem; }
  .toast         { font-size: .82rem; }

  /* Modal */
  .modal         { padding: 1.5rem 1.25rem; }
}

/* 360px: very small phones */
@media (max-width: 360px) {
  .hero h1              { font-size: 1.2rem; }
  .hero p               { display: none; }
  .filter-chip          { font-size: .72rem; padding: .28rem .6rem; }
  .recipe-card-title    { font-size: .95rem; }
  .btn                  { padding: .5rem .9rem; font-size: .85rem; }
  .recipe-stats         { grid-template-columns: repeat(2, 1fr); }
}

