/* ─────────────────────────────────────────────────────────────────────────────
   FRIGG - Design System
   Paleta ODIN: Deep Orchid #6A1B9A | Fuchsia #C2185B | Magenta #E91E63
                Orange #FF5722 | Yellow #FFEB3B
   Dark base: Cosmic Depth #1A1A2E | Cyan #00E5FF
   Typography: system-ui (native mobile feel, zero FOUT)
   ───────────────────────────────────────────────────────────────────────────── */

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

/* ── Tokens ──────────────────────────────────────────────────────────────── */
:root {
  /* Surfaces */
  --bg:          #0F0F1A;
  --surface:     #1A1A2E;
  --surface-up:  #222238;
  --surface-hi:  #2A2A42;
  --border:      rgba(255, 255, 255, 0.07);
  --border-md:   rgba(255, 255, 255, 0.12);

  /* Brand palette */
  --orchid:      #6A1B9A;
  --fuchsia:     #C2185B;
  --magenta:     #E91E63;
  --orange:      #FF5722;
  --yellow:      #F0D060;
  --cyan:        #00E5FF;

  /* Semantic */
  --accent:      #E91E63;
  --accent-grad: linear-gradient(135deg, #9C27B0 0%, #E91E63 60%, #C2185B 100%);
  --success:     #4ADE80;
  --warn:        #FF5722;

  /* Text */
  --text-1:  #F2F0F5;
  --text-2:  rgba(240, 240, 248, 0.55);
  --text-3:  rgba(240, 240, 248, 0.42);

  /* Spacing & Shape */
  --r-card:  14px;
  --r-input: 10px;
  --r-pill:  999px;
  --r-sm:    8px;

  /* Aliases */
  --primary:   #E91E63;
  --surface-2: #222238;
  --nav-h:   60px;
  --top-h:   52px;
  --safe-b:  env(safe-area-inset-bottom, 0px);
}

/* ── Base ────────────────────────────────────────────────────────────────── */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg);
  color: var(--text-1);
  min-height: 100dvh;
  overflow-x: hidden;
  /* Subtle radial glow at top center */
  background-image: radial-gradient(
    ellipse 80% 40% at 50% 0%,
    rgba(106, 27, 154, 0.24) 0%,
    transparent 70%
  );
  background-attachment: fixed;
}

/* ── Top Bar ─────────────────────────────────────────────────────────────── */
.top-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 160;
  height: var(--top-h);
  display: flex; align-items: center; justify-content: flex-start;
  gap: 14px;
  padding: 0 20px;
  background: rgba(15, 15, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.logo-badge {
  display: flex;
  align-items: center;
  height: 34px;
  padding: 4px 10px;
  background: #fff;
  border-radius: 9px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.logo-img { height: 100%; width: auto; display: block; }

/* ── Main ────────────────────────────────────────────────────────────────── */
.app-main {
  margin-top: var(--top-h);
  padding-bottom: calc(16px + var(--safe-b));
  min-height: calc(100dvh - var(--top-h));
}

/* ── Views ───────────────────────────────────────────────────────────────── */
.view {
  display: none;
  animation: viewIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.view.active { display: block; }

@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.view-content {
  max-width: 600px; margin: 0 auto;
  padding: 20px 16px;
  display: flex; flex-direction: column; gap: 16px;
}

/* ── Hamburger (solo mobile) ─────────────────────────────────────────────── */
.hamburger-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-1); padding: 6px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.hamburger-btn:hover { background: rgba(255,255,255,0.08); }

/* ── Sidebar Backdrop (mobile only) ─────────────────────────────────────── */
.sidebar-backdrop {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,0.6);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
body.sidebar-open .sidebar-backdrop {
  opacity: 1; pointer-events: auto;
}

/* ── Bottom Navigation / Sidebar ────────────────────────────────────────── */
.bottom-nav {
  position: fixed; left: 0; top: 0; bottom: 0; right: auto;
  width: 260px; height: 100dvh; z-index: 1000;
  padding: 16px 10px calc(16px + var(--safe-b));
  display: flex; flex-direction: column; align-items: stretch;
  justify-content: flex-start; gap: 4px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}
body.sidebar-open .bottom-nav {
  transform: translateX(0);
}
/* Sidebar brand always visible since sidebar always has brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand .logo-badge { height: 42px; padding: 5px 9px; }
.sidebar-brand-name {
  font-size: 1.15rem; font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text-1);
}

/* Tabs look like sidebar rows at all breakpoints */
.tab {
  flex: none;
  flex-direction: row;
  justify-content: flex-start;
  padding: 8px 10px;
  gap: 12px;
  border-radius: 10px;
  width: 100%; height: auto;
  color: var(--text-2);
  border: none;
  background: none; cursor: pointer;
  display: flex; align-items: center;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.tab:hover:not(.active) {
  background: rgba(255,255,255,0.04); color: var(--text-1);
}
.tab.active { color: var(--text-1); }
.tab-indicator { display: none; }
.tab-icon-wrap {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 9px; flex-shrink: 0;
  transition: background 0.18s, box-shadow 0.18s;
}
.tab.active .tab-icon-wrap {
  background: var(--accent-grad);
  box-shadow: 0 4px 12px rgba(233, 30, 99, 0.35);
}
.tab svg       { width: 18px; height: 18px; flex-shrink: 0; }
.tab.active svg { transform: none; }
.tab-label     { font-size: 0.86rem; font-weight: 600; }
.tab.active .tab-label { color: var(--magenta); }


/* ── Greeting ────────────────────────────────────────────────────────────── */
.greeting { padding: 8px 0 4px; }
.greeting-time {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--magenta);
  margin-bottom: 8px;
}
.greeting-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-1);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

/* ── Bento Stats ─────────────────────────────────────────────────────────── */
.bento-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.bento-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 18px 16px;
  display: flex; flex-direction: column; gap: 4px;
}
.bento-cell--accent {
  border-color: rgba(233, 30, 99, 0.2);
}
.bento-num {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
}
.bento-lbl {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-2);
}

/* ── Session Card ────────────────────────────────────────────────────────── */
.session-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 16px;
  display: flex; flex-direction: column; gap: 14px;
}
.session-options { display: flex; flex-direction: column; }
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.toggle-row:last-child { border-bottom: none; padding-bottom: 0; }
.toggle-label { font-size: 0.88rem; color: var(--text-1); font-weight: 500; }
.toggle-row input[type=checkbox] { display: none; }
.toggle {
  width: 44px; height: 26px; border-radius: 13px;
  background: var(--surface-hi);
  border: 1px solid var(--border-md);
  position: relative; flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}
.toggle::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--text-3);
  top: 2px; left: 2px;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.toggle-row input:checked ~ .toggle {
  background: rgba(233, 30, 99, 0.25);
  border-color: rgba(233, 30, 99, 0.5);
}
.toggle-row input:checked ~ .toggle::after {
  transform: translateX(18px);
  background: var(--magenta);
}
.session-filters { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Section Label ───────────────────────────────────────────────────────── */
.section-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-2);
  padding: 4px 0 2px;
}

/* ── Sugerencias ─────────────────────────────────────────────────────────── */
.sugerencias-list { display: flex; flex-direction: column; gap: 10px; }

.sug-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color 0.18s, background 0.18s;
  -webkit-tap-highlight-color: transparent;
}
.sug-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 0 2px 2px 0;
}
.sug-card.puedo_cocinar::before  { background: var(--success); }
.sug-card.casi_puedo::before     { background: var(--warn); }
.sug-card--plan::before          { background: var(--cyan); }
.sug-card--plan                  { border-color: rgba(0, 229, 255, 0.25); background: rgba(0, 229, 255, 0.04); }
.sug-card:active { background: var(--surface-up); }

.sug-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.sug-card.puedo_cocinar .sug-badge { background: rgba(74,222,128,0.14); color: var(--success); }
.sug-card.casi_puedo    .sug-badge { background: rgba(255,87,34,0.14);  color: var(--warn); }
.sug-badge--plan { background: rgba(0, 229, 255, 0.14); color: var(--cyan); }

.sug-name { font-size: 1rem; font-weight: 700; color: var(--text-1); line-height: 1.3; margin-bottom: 5px; }
.sug-meta { font-size: 0.78rem; color: var(--text-2); }
.sug-faltantes {
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--warn);
  line-height: 1.4;
}
.sug-faltantes strong { font-weight: 700; }

/* Score ring (SVG inline, generated by JS) */
.score-ring-wrap { flex-shrink: 0; }

/* ── Page Header ─────────────────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 0 8px;
}
.page-title {
  font-size: 1.6rem; font-weight: 800;
  color: var(--text-1); letter-spacing: -0.02em;
  text-wrap: balance;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px;
  padding: 13px 22px;
  border: none; border-radius: var(--r-pill);
  cursor: pointer;
  font-size: 0.9rem; font-weight: 700; letter-spacing: 0.01em;
  white-space: nowrap;
  transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active  { transform: scale(0.96); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 4px 20px rgba(233, 30, 99, 0.35);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 28px rgba(233, 30, 99, 0.5);
}

.btn-accent {
  background: rgba(233, 30, 99, 0.15);
  color: var(--magenta);
  border: 1px solid rgba(233, 30, 99, 0.3);
}
.btn-accent:hover { background: rgba(233, 30, 99, 0.22); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border-md);
}

.btn-full { width: 100%; }
.btn-sm   { padding: 9px 16px; font-size: 0.8rem; }

#btn-guardar-hogar,
#btn-guardar-perfil,
#btn-cambiar-password {
  margin-top: 16px;
}

/* ── Inputs ──────────────────────────────────────────────────────────────── */
.input-field {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface-up);
  border: 1.5px solid var(--border-md);
  border-radius: var(--r-input);
  color: var(--text-1);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input-field::placeholder { color: var(--text-3); }
.input-field:focus {
  border-color: rgba(233, 30, 99, 0.5);
  box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.12);
}
.input-sm { padding: 10px 12px; font-size: 0.88rem; }

/* ── Search Input ────────────────────────────────────────────────────────── */
.search-wrap {
  position: relative;
}
.search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); pointer-events: none;
}
.input-search {
  width: 100%;
  padding: 12px 14px 12px 42px;
  background: var(--surface-up);
  border: 1.5px solid var(--border);
  border-radius: var(--r-pill);
  color: var(--text-1);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input-search::placeholder { color: var(--text-3); }
.input-search:focus {
  border-color: rgba(233, 30, 99, 0.4);
  box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.1);
}

/* ── Selects ─────────────────────────────────────────────────────────────── */
.select-pill {
  padding: 8px 14px;
  background: var(--surface-up);
  border: 1.5px solid var(--border-md);
  border-radius: var(--r-pill);
  color: var(--text-2);
  font-size: 0.82rem; font-weight: 600;
  font-family: inherit;
  cursor: pointer; outline: none;
  transition: border-color 0.15s;
  -webkit-appearance: none; appearance: none;
}
.select-pill:focus { border-color: rgba(233, 30, 99, 0.4); }
.select-full { width: 100%; border-radius: var(--r-input); padding: 12px 14px; font-size: 0.92rem; }

.form-group { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.form-group:last-of-type { margin-bottom: 0; }
.form-label { font-size: 0.82rem; font-weight: 600; color: var(--text-2); }
.form-row { display: flex; gap: 10px; align-items: center; }
.form-row .input-field { flex: 1; }

/* ── Chip Toggles ────────────────────────────────────────────────────────── */
.chip-toggle input { display: none; }
.chip-toggle span {
  display: inline-block;
  padding: 7px 14px;
  border: 1.5px solid var(--border-md);
  border-radius: var(--r-pill);
  font-size: 0.8rem; font-weight: 600;
  color: var(--text-2); cursor: pointer;
  transition: all 0.15s;
}
.chip-toggle input:checked + span {
  background: rgba(233, 30, 99, 0.15);
  border-color: rgba(233, 30, 99, 0.45);
  color: var(--magenta);
}
.filter-strip { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── Autocomplete ────────────────────────────────────────────────────────── */
.autocomplete-wrap { position: relative; }
.autocomplete-list {
  position: absolute; z-index: 200; width: 100%;
  background: var(--surface-hi);
  border: 1px solid var(--border-md);
  border-radius: var(--r-card);
  list-style: none;
  max-height: 240px; overflow-y: auto;
  margin-top: 6px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
}
.autocomplete-list li {
  padding: 12px 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem; color: var(--text-1);
  transition: background 0.12s;
}
.autocomplete-list li:last-child { border-bottom: none; }
.autocomplete-list li:hover { background: rgba(233, 30, 99, 0.08); }
.ing-cat {
  font-size: 0.72rem; font-weight: 600;
  color: var(--text-3);
}

/* ── Panel Agregar ───────────────────────────────────────────────────────── */
.panel-agregar {
  background: var(--surface);
  border: 1px solid var(--border-md);
  border-radius: var(--r-card);
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.ing-selected-label {
  font-weight: 700;
  color: var(--magenta);
  font-size: 0.95rem;
}
.ing-form { display: flex; flex-direction: column; gap: 10px; }

/* ── Surface Card ────────────────────────────────────────────────────────── */
.surface-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 20px;
}

/* ── Ingredient List ─────────────────────────────────────────────────────── */
.ingredient-list { display: flex; flex-direction: column; gap: 6px; }
.ing-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-input);
  padding: 13px 14px;
  transition: border-color 0.15s;
}
.ing-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-3);
}
.ing-dot[data-cat="verdura"]             { background: #4ADE80; }
.ing-dot[data-cat="fruta"]               { background: #FB923C; }
.ing-dot[data-cat="proteína animal"]     { background: #F87171; }
.ing-dot[data-cat="mariscos y pescados"] { background: #60A5FA; }
.ing-dot[data-cat="lácteo"]              { background: #FDE68A; }
.ing-dot[data-cat="cereal"]              { background: #C084FC; }
.ing-dot[data-cat="legumbre"]            { background: #A3E635; }
.ing-dot[data-cat="condimento"]          { background: #00E5FF; }
.ing-dot[data-cat="especias"]            { background: #F59E0B; }
.ing-dot[data-cat="salsa"]               { background: #EC4899; }
.ing-body { flex: 1; min-width: 0; }
.ing-name {
  font-size: 0.9rem; font-weight: 600; color: var(--text-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ing-qty  { font-size: 0.75rem; color: var(--text-3); margin-top: 2px; }
.ing-item-del, .ing-item-edit {
  background: none; border: none; cursor: pointer;
  color: var(--text-3); padding: 6px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.ing-item-del:hover  { color: var(--warn); background: rgba(255, 87, 34, 0.12); }
.ing-item-edit:hover { color: var(--accent); background: rgba(var(--accent-rgb, 99,102,241), 0.12); }
.ing-item-del svg, .ing-item-edit svg { width: 16px; height: 16px; fill: currentColor; }

.inline-edit-lote {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-card); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
  margin: 4px 0 8px;
}
.inline-edit-title { font-size: 0.85rem; color: var(--text-2); margin: 0; }

/* ── Ingredient Groups (multi-lote) ─────────────────────────────────────── */
.ing-group { display: flex; flex-direction: column; }

.ing-group-header {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 13px 14px;
  cursor: pointer; user-select: none;
  transition: border-color 0.15s, border-radius 0.15s;
}
.ing-group--open .ing-group-header {
  border-radius: var(--r-card) var(--r-card) 0 0;
  border-bottom-color: var(--surface-2);
}

.ing-lotes {
  display: none; flex-direction: column;
  background: var(--surface-2);
  border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 var(--r-card) var(--r-card);
  overflow: hidden;
}
.ing-group--open .ing-lotes { display: flex; }

.ing-lote-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px 9px 34px;
  border-top: 1px solid var(--border);
}
.ing-lote-info { flex: 1; display: flex; align-items: center; gap: 8px; }
.ing-lote-qty  { font-size: 0.82rem; color: var(--text-2); }

.ing-lotes-count {
  font-size: 0.7rem; font-weight: 600;
  color: var(--accent);
  background: rgba(var(--accent-rgb, 99,102,241), 0.12);
  padding: 2px 8px; border-radius: 20px; flex-shrink: 0;
}
.ing-chevron {
  color: var(--text-3); display: flex; align-items: center; flex-shrink: 0;
  transition: transform 0.2s;
}

/* ── Confirm-button pulse (directo mode hint) ───────────────────────────── */
@keyframes btnPulse {
  0%   { box-shadow: 0 0 0 0 rgba(var(--accent-rgb, 99,102,241), 0.55); }
  60%  { box-shadow: 0 0 0 8px rgba(var(--accent-rgb, 99,102,241), 0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb, 99,102,241), 0); }
}
.btn-pulse { animation: btnPulse 0.6s ease-out 2; }

/* ── Recetas ─────────────────────────────────────────────────────────────── */
.recetas-grid { display: flex; flex-direction: column; gap: 8px; }
.receta-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.receta-card:active { background: var(--surface-up); }
.receta-body { flex: 1; min-width: 0; }
.receta-nombre {
  font-size: 0.92rem; font-weight: 700; color: var(--text-1);
  margin-bottom: 5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.receta-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 5px; }
.tag {
  display: inline-block; padding: 3px 8px;
  border-radius: var(--r-pill);
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.03em;
}
.tag.facil     { background: rgba(74,222,128,0.14);  color: #4ADE80; }
.tag.media     { background: rgba(251,191,36,0.14);  color: #FDE68A; }
.tag.dificil   { background: rgba(248,113,113,0.14); color: #F87171; }
.tag.vegano    { background: rgba(74,222,128,0.12);  color: #4ADE80; }
.tag.sin-gluten { background: rgba(96,165,250,0.12); color: #60A5FA; }
.receta-tiempo { font-size: 0.75rem; color: var(--text-3); }
.receta-arrow  { color: var(--text-3); flex-shrink: 0; font-size: 1.1rem; }

/* ── Pagination ──────────────────────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 8px 0;
}
.pagination button {
  padding: 9px 16px;
  background: var(--surface-up);
  border: 1px solid var(--border-md);
  border-radius: var(--r-pill);
  color: var(--text-2); font-size: 0.82rem; font-weight: 600;
  cursor: pointer; transition: border-color 0.15s, color 0.15s;
  font-family: inherit;
}
.pagination button:hover:not(:disabled) { border-color: var(--magenta); color: var(--magenta); }
.pagination button:disabled { opacity: 0.35; cursor: not-allowed; }
.page-info { font-size: 0.82rem; color: var(--text-3); }

/* ── Profile ─────────────────────────────────────────────────────────────── */
.profile-hero {
  display: flex; justify-content: center;
  padding: 8px 0 4px;
}
.avatar-ring {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--accent-grad);
  padding: 3px;
  display: flex; align-items: center; justify-content: center;
}
.avatar-ring::before {
  content: '';
  position: absolute;
  width: 80px; height: 80px; border-radius: 50%;
  box-shadow: 0 0 28px rgba(233, 30, 99, 0.4);
}
.avatar-initial {
  width: 74px; height: 74px; border-radius: 50%;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 900; color: var(--magenta);
  letter-spacing: -0.02em;
}

/* ── Tags ────────────────────────────────────────────────────────────────── */
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-item {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px;
  background: rgba(233, 30, 99, 0.12);
  border: 1px solid rgba(233, 30, 99, 0.3);
  border-radius: var(--r-pill);
  font-size: 0.78rem; font-weight: 600; color: var(--magenta);
}
.tag-item button {
  background: none; border: none; cursor: pointer;
  color: rgba(233, 30, 99, 0.6); font-size: 0.9rem;
  display: flex; align-items: center; line-height: 1;
  padding: 0;
}
.tag-item button:hover { color: var(--magenta); }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 1100;
  display: flex; align-items: flex-end;
}
.modal.hidden { display: none; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal-sheet {
  position: relative; z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border-md);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  width: 100%; max-width: 600px; margin: 0 auto;
  max-height: 90dvh; overflow-y: auto;
  padding: 16px 24px calc(36px + var(--safe-b));
  animation: sheetUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes sheetUp {
  from { transform: translateY(60px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.modal-handle {
  width: 36px; height: 4px;
  background: var(--border-md);
  border-radius: 2px;
  margin: 0 auto 20px;
}
.modal-header {
  margin-bottom: 20px;
  padding-right: 40px; /* espacio para el botón cerrar */
}
.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-1);
  margin: 0;
  line-height: 1.3;
}
.modal-close {
  position: absolute; top: 18px; right: 18px;
  background: var(--surface-hi);
  border: 1px solid var(--border);
  border-radius: 50%; width: 32px; height: 32px;
  cursor: pointer; color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.modal-close:hover { background: var(--surface-up); color: var(--text-1); }
.modal-body { padding-top: 8px; }

/* Modal recipe content */
.modal-rec-name {
  font-size: 1.4rem; font-weight: 800;
  color: var(--text-1); letter-spacing: -0.02em;
  line-height: 1.2; margin-bottom: 8px;
  text-wrap: balance;
}
.modal-rec-desc {
  font-size: 0.88rem; color: var(--text-2); line-height: 1.55;
  margin-bottom: 16px;
}
.modal-meta-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin-bottom: 20px;
}
.meta-cell {
  background: var(--surface-up);
  border: 1px solid var(--border);
  border-radius: var(--r-input);
  padding: 12px 10px; text-align: center;
}
.meta-val { font-size: 1.1rem; font-weight: 800; color: var(--magenta); font-variant-numeric: tabular-nums; }
.meta-lbl { font-size: 0.68rem; color: var(--text-3); margin-top: 3px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.modal-section-title {
  font-size: 0.8rem; font-weight: 700;
  color: var(--text-2);
  margin-bottom: 10px; margin-top: 4px;
}
.ing-modal-list { list-style: none; display: flex; flex-direction: column; gap: 0; }
.ing-modal-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.ing-modal-list li:last-child { border-bottom: none; }
.ing-modal-name { color: var(--text-1); font-weight: 500; }
.ing-modal-qty  { color: var(--text-3); font-size: 0.8rem; }
.ing-status-ok   { color: var(--success); font-size: 0.8rem; margin-left: 5px; }
.ing-status-no   { color: var(--warn);    font-size: 0.8rem; margin-left: 5px; }
.pasos-list {
  list-style: none;
  padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 8px;
  counter-reset: paso;
}
.pasos-list li {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 16px;
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.875rem; color: var(--text-2); line-height: 1.65;
  counter-increment: paso;
}
.pasos-list li::before {
  content: counter(paso);
  min-width: 28px; height: 28px;
  background: var(--primary); color: #fff;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 800; flex-shrink: 0;
  margin-top: 1px;
}
.ing-opt-label   { color: var(--text-3);  font-size: 0.72rem; margin-left: 5px; }

/* ── Edición de recetas (admin) ──────────────────────────────────────────── */
.modal-rec-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.modal-rec-header-row .modal-rec-name { flex: 1; margin-bottom: 0; }

.edit-ing-rows, .edit-pasos-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.edit-ing-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface-up);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.edit-ing-nombre {
  flex: 1;
  min-width: 0;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.edit-ing-cantidad { width: 64px; flex-shrink: 0; }
.edit-ing-unidad   { width: 80px; flex-shrink: 0; }
.edit-ing-opcional {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--text-2);
  white-space: nowrap;
  flex-shrink: 0;
}

.edit-paso-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  background: var(--surface-up);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.edit-paso-num {
  min-width: 24px; height: 24px;
  background: var(--primary); color: #fff;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.68rem; font-weight: 800; flex-shrink: 0;
  margin-top: 4px;
}
.edit-paso-text { flex: 1; resize: vertical; }

.edit-receta-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

/* ── Toast ───────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(var(--safe-b) + 16px);
  left: 50%; transform: translateX(-50%);
  background: var(--surface-hi);
  border: 1px solid var(--border-md);
  color: var(--text-1);
  padding: 11px 20px;
  border-radius: var(--r-pill);
  font-size: 0.85rem; font-weight: 600;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 1000;
  white-space: nowrap;
  max-width: calc(100vw - 32px);
  animation: fadeUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Empty ───────────────────────────────────────────────────────────────── */
.empty-msg {
  text-align: center;
  color: var(--text-3);
  padding: 32px 16px;
  font-size: 0.88rem;
  line-height: 1.7;
}

/* ── Skeleton loader ─────────────────────────────────────────────────────── */
@keyframes shimmer {
  from { background-position: -200% 0; }
  to   { background-position:  200% 0; }
}
.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-up) 25%,
    var(--surface-hi) 50%,
    var(--surface-up) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--r-input);
}
.skeleton-card {
  height: 90px;
  border-radius: var(--r-card);
}

/* ── Utility ─────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Scrollbar (webkit) ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.32); }

/* ── Reduced motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .view, .modal-sheet, .toast { animation: none !important; }
  .toggle::after  { transition: none !important; }
  .toggle         { transition: none !important; }
  .btn            { transition: none !important; }
}

/* ── Auth Screen ─────────────────────────────────────────────────────────── */
.auth-screen {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  background: var(--bg);
  background-image: radial-gradient(
    ellipse 80% 50% at 50% 0%,
    rgba(106, 27, 154, 0.28) 0%,
    transparent 70%
  );
  overflow-y: auto;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: 20px;
  padding: 36px 28px 32px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.auth-logo-badge {
  display: flex;
  justify-content: center;
  margin: 0 auto 16px;
  padding: 10px 18px;
  background: #fff;
  border-radius: 14px;
  width: fit-content;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.auth-logo-img { height: 48px; width: auto; display: block; }

.auth-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 24px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-error {
  font-size: 0.83rem;
  color: var(--warn);
  background: rgba(255, 87, 34, 0.1);
  border: 1px solid rgba(255, 87, 34, 0.25);
  border-radius: var(--r-input);
  padding: 10px 14px;
  margin-bottom: 4px;
}

.auth-switch {
  font-size: 0.83rem;
  color: var(--text-2);
  text-align: center;
  margin-top: 4px;
}

.btn-link {
  background: none;
  border: none;
  color: var(--cyan);
  font-size: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-link:hover { color: var(--text-1); }

/* Disgust tag variant */
.tag-item--disgust {
  background: rgba(255, 87, 34, 0.12);
  border-color: rgba(255, 87, 34, 0.3);
  color: #FF8A65;
}
.tag-item--disgust button:hover { color: var(--orange); }

/* ── Tablet (600px) - minor tweaks ───────────────────────────────────────── */
@media (min-width: 600px) {
  .greeting-title { font-size: 2.4rem; }
}

/* ── Desktop/tablet (768px+) - sidebar siempre visible (patrón Forseti) ──── */
@media (min-width: 768px) {
  :root { --sidebar-w: 240px; }

  /* sidebar siempre visible y no tapa el main */
  .top-bar { display: none; }
  .hamburger-btn { display: none; }
  .sidebar-backdrop { display: none !important; }
  .bottom-nav {
    width: var(--sidebar-w);
    transform: none !important;
    z-index: 200;
  }

  /* main content: siempre desplazado */
  .app-main {
    margin-top: 0;
    margin-left: var(--sidebar-w);
    padding-bottom: 40px;
  }

  /* uncap view width, more padding */
  .view-content {
    max-width: none;
    padding: 32px 40px;
    gap: 20px;
  }

  /* toast no longer needs to clear bottom nav */
  .toast { bottom: 24px; }

  /* === Dashboard: 2-column grid === */
  #view-dashboard .view-content {
    display: grid;
    grid-template-columns: 1fr 280px;
    column-gap: 28px;
    row-gap: 0;
    align-items: start;
  }
  .greeting              { grid-column: 1; grid-row: 1; padding-bottom: 20px; }
  .bento-stats           { grid-column: 2; grid-row: 1 / span 4; position: sticky; top: 24px; gap: 12px; }
  .session-card          { grid-column: 1; grid-row: 2; margin-bottom: 20px; }
  #sugerencias-container { grid-column: 1; grid-row: 3; }

  .greeting-title { font-size: 2.8rem; }
  .bento-num      { font-size: 2.6rem; }
  .bento-cell     { padding: 22px 18px; }

  /* 2-col suggestion cards */
  .sugerencias-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  /* === Despensa: 2-col ingredient grid === */
  .ingredient-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  /* === Recetas: 2-col cards === */
  .recetas-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  /* === Admin: KPIs en una sola fila === */
  .admin-kpis { grid-template-columns: repeat(4, 1fr); }

  /* === Hogar: 2-col — datos del hogar a la izq., cuenta personal a la der. === */
  #view-hogar .view-content { max-width: none; }
  .hogar-columns {
    display: flex;
    align-items: flex-start;
    gap: 24px;
  }
  .hogar-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  /* page title bigger */
  .page-title { font-size: 2rem; }

  /* === Modal: centered dialog instead of bottom sheet === */
  .modal { align-items: center; }
  .modal-sheet {
    border-radius: 16px;
    max-width: 600px;
    max-height: 84dvh;
    margin: 0 auto;
    padding: 28px 32px 36px;
    border: 1px solid var(--border-md);
    animation: modalIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .modal-handle { display: none; }
  @keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
  }
}

/* ── Wide desktop (1200px+) - more columns ───────────────────────────────── */
@media (min-width: 1200px) {
  :root { --sidebar-w: 260px; }

  .view-content { padding: 36px 52px; }

  #view-dashboard .view-content {
    grid-template-columns: 1fr 320px;
    column-gap: 36px;
  }

  /* 3-col on wide viewport */
  .recetas-grid     { grid-template-columns: repeat(3, 1fr); }
  .ingredient-list  { grid-template-columns: repeat(3, 1fr); }
  .sugerencias-list { grid-template-columns: repeat(3, 1fr); }

  /* === Admin: secciones en 2 columnas === */
  #view-admin .view-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 24px;
    row-gap: 20px;
    align-items: start;
  }
  #view-admin .page-header,
  #view-admin #admin-kpis { grid-column: 1 / -1; }
  #view-admin #card-admin-hogares,
  #view-admin #card-admin-config { grid-column: 1; }
  #view-admin #card-admin-usuarios,
  #view-admin #card-admin-log { grid-column: 2; }
}

/* ── Alertas de vencimiento (dashboard) ─────────────────────────────────── */
#alertas-section { margin-bottom: 12px; }

.alertas-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.alertas-titulo { font-size: 0.82rem; font-weight: 700; color: var(--text-2); }
.alertas-dias-picker { display: flex; gap: 4px; }
.dias-pill {
  padding: 2px 10px; border-radius: var(--r-pill);
  font-size: 0.72rem; font-weight: 600;
  background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--border); cursor: pointer; transition: background 0.15s;
}
.dias-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.alertas-empty-msg { font-size: 0.8rem; color: var(--text-3); padding: 6px 0; }

.alerta-strip {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 12px 14px;
  background: rgba(255, 87, 34, 0.08);
  border: 1px solid rgba(255, 87, 34, 0.25);
  border-radius: var(--r-card);
}

.alerta-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.8rem; color: var(--text-2);
}

.alerta-item.alerta-urgente { color: var(--warn); }
.alerta-item.alerta-stock   { color: #f59e0b; }

.alerta-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 20px; padding: 0 5px;
  background: rgba(255, 87, 34, 0.18);
  border-radius: var(--r-pill);
  font-size: 0.7rem; font-weight: 700; color: var(--warn);
}
.alerta-badge--stock {
  background: rgba(245, 158, 11, 0.18); color: #f59e0b;
}

/* ── Vencimiento badge (despensa) ────────────────────────────────────────── */
.venc-badge {
  display: inline-flex; align-items: center;
  padding: 1px 7px; border-radius: var(--r-pill);
  font-size: 0.65rem; font-weight: 700;
  background: rgba(255, 235, 59, 0.12);
  color: var(--yellow);
  margin-top: 3px;
}
.venc-badge.venc-urgente {
  background: rgba(255, 87, 34, 0.15);
  color: var(--warn);
}
.venc-badge.venc-vencido {
  background: rgba(239, 83, 80, 0.15);
  color: #EF5350;
}

/* ── Modal comensales ────────────────────────────────────────────────────── */
.modal-sheet--sm .modal-sheet {
  max-height: 60vh;
}

.comensales-list {
  display: flex; flex-direction: column; gap: 10px;
  padding: 4px 0;
}

.comensal-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: var(--surface-up);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.comensal-nombre {
  font-size: 0.9rem; color: var(--text-1);
}

/* ── Post-cocina modal ───────────────────────────────────────────────────── */
.postcook-intro {
  font-size: 0.875rem; color: var(--text-2);
  margin-bottom: 12px;
}

.postcook-list {
  list-style: none; padding: 0; margin: 0 0 16px;
  display: flex; flex-direction: column; gap: 8px;
}

.postcook-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--surface-up);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.postcook-check {
  width: 18px; height: 18px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.postcook-ing {
  font-size: 0.875rem; color: var(--text-1);
}

/* ── Miembros del hogar ──────────────────────────────────────────────────── */
.section-header-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}

.miembros-list {
  display: flex; flex-direction: column; gap: 10px;
}

.miembro-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: var(--surface-up);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.miembro-avatar {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-hi);
  border-radius: 50%;
  font-size: 0.95rem; font-weight: 700; color: var(--text-1);
  flex-shrink: 0;
}

.miembro-info {
  flex: 1; display: flex; align-items: center; gap: 8px;
}

.miembro-nombre {
  font-size: 0.875rem; color: var(--text-1);
}

.miembro-badge {
  font-size: 0.65rem; font-weight: 700;
  padding: 2px 7px; border-radius: var(--r-pill);
  background: rgba(233, 30, 99, 0.15);
  color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.04em;
}

.btn-ghost-sm {
  background: none; border: none;
  color: var(--text-3); cursor: pointer;
  font-size: 0.8rem; padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.btn-ghost-sm:hover { color: var(--warn); background: rgba(255,87,34,0.1); }

/* ── Invite form (Mi Hogar) ──────────────────────────────────────────────── */
#invite-section { margin-top: 16px; }

.invite-form {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px;
  background: var(--surface-up);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
}

.invite-hogar-label {
  font-size: 0.8rem; color: var(--text-2);
  text-align: center; margin-bottom: 4px;
}

.invite-result {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  background: rgba(74, 222, 128, 0.07);
  border: 1px solid rgba(74, 222, 128, 0.2);
  border-radius: 10px;
  font-size: 0.78rem;
}

#invite-link {
  flex: 1; color: var(--success);
  word-break: break-all;
  font-size: 0.75rem;
}

/* ── Vencimiento input row (despensa form) ───────────────────────────────── */
.form-row--venc {
  display: flex; align-items: center; gap: 10px;
  margin-top: 8px;
}

.form-label-inline {
  font-size: 0.8rem; color: var(--text-2);
  white-space: nowrap;
}

/* ── Post-cocina multi-step ──────────────────────────────────────────────── */
.postcook-step-meta {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-3);
  margin-bottom: 6px;
}

.postcook-step-title {
  font-size: 1.05rem; font-weight: 700; color: var(--text-1);
  margin-bottom: 4px;
}

/* Cocinero selection cards */
.cocinero-list {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding: 4px 0; margin-top: 12px;
}

.cocinero-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 16px;
  background: var(--surface-up);
  border: 2px solid var(--border);
  border-radius: var(--r-card);
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
  min-width: 80px;
}

.cocinero-card.selected {
  border-color: var(--accent);
  background: rgba(233, 30, 99, 0.08);
}

.cocinero-nombre {
  font-size: 0.8rem; color: var(--text-1); text-align: center;
}

/* Ingredient rows with qty input */
.postcook-ing-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}

.postcook-controls {
  display: flex; align-items: center; gap: 4px; flex-shrink: 0;
}

.postcook-qty-input {
  width: 72px; padding: 4px 8px;
  background: var(--surface-hi);
  border: 1px solid var(--border-md);
  border-radius: var(--r-input);
  color: var(--text-1); font-size: 0.85rem;
  text-align: right;
}

.postcook-qty-input:disabled {
  opacity: 0.35; cursor: not-allowed;
}

.postcook-unit {
  font-size: 0.75rem; color: var(--text-3); min-width: 24px;
}

.postcook-agotado-label {
  display: flex; align-items: center; gap: 7px;
  margin-top: 6px; cursor: pointer;
  font-size: 0.78rem; color: var(--text-2);
}

.postcook-row {
  display: flex; flex-direction: column;
  padding: 10px 14px;
  background: var(--surface-up);
  border: 1px solid var(--border);
  border-radius: 10px;
}

/* ── Despensa header actions ──────────────────────────────────────────────── */
.header-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}
/* Narrow mobile: hide button labels, keep icons only */
@media (max-width: 460px) {
  .header-actions .btn-sm .btn-label { display: none; }
  .header-actions .btn-sm { padding: 8px 10px; }
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-md);
  color: var(--text-2);
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  gap: 5px;
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--text-1);
}

/* ── Modal wide variant ───────────────────────────────────────────────────── */
.modal-sheet--wide {
  max-width: 500px;
  width: min(500px, 100%);
}

/* ── Compra: steps ────────────────────────────────────────────────────────── */
.compra-step {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 8px;
}

.compra-step-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
}

.compra-step-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.compra-step-footer:has(#btn-compra-back.hidden) {
  justify-content: flex-end;
}

/* ── Catálogo de productos ───────────────────────────────────────────────── */
.catalogo-search-wrap { margin-bottom: 12px; }
.comercios-search-wrap { margin: 12px 0 8px; }

.catalogo-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.catalogo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 8px;
  border-bottom: 1px solid var(--border);
}
.catalogo-row:last-child { border-bottom: none; }

.catalogo-row-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.catalogo-row-nombre {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.catalogo-row-meta {
  font-size: 0.75rem;
  color: var(--text-2);
}
.catalogo-row-ing {
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 500;
}
.catalogo-row-sku {
  font-size: 0.7rem;
  color: var(--text-3);
  font-family: monospace;
}

.catalogo-row-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Comercios list ───────────────────────────────────────────────────────── */
.comercios-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.comercio-card {
  background: var(--surface-up);
  border: 1.5px solid var(--border);
  border-radius: var(--r-card);
  padding: 10px 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.comercio-card:hover        { border-color: var(--border-md); background: var(--surface-hi); }
.comercio-card.selected,
.comercio-card.comercio-card-active {
  border-color: var(--accent);
  background: rgba(233, 30, 99, 0.08);
}

.pin-filter-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(233, 30, 99, 0.08);
  border: 1px solid rgba(233, 30, 99, 0.25);
  border-radius: var(--r-sm);
  font-size: 0.8rem;
  color: var(--text-2);
  margin-bottom: 4px;
}

.comercio-card-name { font-weight: 600; font-size: 0.9rem; }
.comercio-card-sub  { font-size: 0.75rem; color: var(--text-2); margin-top: 2px; }
.comercio-card-despues { opacity: 0.75; border-style: dashed; }
.comercio-card-despues.selected { opacity: 1; }

/* ── Compras sin comercio asignado ──────────────────────────────────────── */
.compras-pendientes-section {
  margin-top: 24px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.compras-pendientes-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.compras-pendientes-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-2);
}
.compras-pendientes-badge {
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
}
.compra-pendiente-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-up);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.compra-pendiente-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.compra-pendiente-fecha { font-size: 0.85rem; font-weight: 600; }
.compra-pendiente-items { font-size: 0.8rem; color: var(--text-2); }
.compra-pendiente-quien { font-size: 0.75rem; color: var(--text-3); }
.compra-pendiente-assign {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.comercio-card-row  { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.comercio-card-info { flex: 1; min-width: 0; }

/* ── Comercios: mapa Leaflet ──────────────────────────────────────────────── */
.comercios-map {
  width: 100%;
  height: 280px;
  border-radius: var(--r-card);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--surface-up);
}

/* ── Modal comercio: espaciado ───────────────────────────────────────────── */
#modal-comercio .modal-body {
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#modal-comercio .form-group { margin-bottom: 12px; }
#modal-comercio .form-label { margin-bottom: 2px; }
#geocode-status { margin-top: 2px; font-size: 11px; line-height: 1.2; min-height: 0; }
#geocode-status:empty { margin: 0; }
#modal-comercio .form-group:has(#geocode-status:empty) { margin-bottom: 12px; }
#modal-comercio .form-group:has(#geocode-status:not(:empty)) { margin-bottom: 4px; }

/* ── Comercios: chips de filtro ──────────────────────────────────────────── */
.comercios-filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--border-md);
  background: var(--surface-up);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  white-space: nowrap;
}
.filter-chip:hover { border-color: var(--accent); color: var(--text-1); }
.filter-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.filter-chip .chip-x { font-size: 0.68rem; opacity: 0.8; }

/* ── Autocomplete dirección ──────────────────────────────────────────────── */
.autocomplete-wrap { position: relative; }
.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 0; right: 0;
  z-index: 500;
  background: var(--surface);
  border: 1.5px solid var(--border-md);
  border-radius: 10px;
  max-height: 220px;
  overflow-y: auto;
  list-style: none;
  margin: 0; padding: 4px 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.autocomplete-dropdown.hidden { display: none; }
.autocomplete-dropdown li {
  padding: 9px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  line-height: 1.35;
}
.autocomplete-dropdown li:last-child { border-bottom: none; }
.autocomplete-dropdown li:hover,
.autocomplete-dropdown li.ac-active { background: var(--surface-hi); }
.autocomplete-dropdown .ac-main { font-size: 0.875rem; font-weight: 500; color: var(--text-1); }
.autocomplete-dropdown .ac-sub  { font-size: 0.75rem; color: var(--text-2); margin-top: 2px; }

/* ── Lista detalle: pantalla completa en mobile ───────────────────────────── */
@media (max-width: 767px) {
  #modal-lista-detalle {
    align-items: flex-start;
  }
  #modal-lista-detalle .modal-sheet {
    height: 96dvh;
    max-height: 96dvh;
    border-radius: 0 0 20px 20px;
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
  }
  .lista-items {
    max-height: none;
    overflow-y: visible;
  }
}

/* ── Comercios: desktop map taller ───────────────────────────────────────── */
@media (min-width: 768px) {
  .comercios-map { height: 360px; }
}

.nuevo-comercio-toggle { text-align: center; }

.form-nuevo-comercio {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--surface-up);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
}

/* ── SKU search wrapper ───────────────────────────────────────────────────── */
.compra-search-wrap {
  position: relative;
}

/* ── Nuevo SKU form ───────────────────────────────────────────────────────── */
.form-nuevo-sku {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--surface-up);
  border: 1px solid var(--border-md);
  border-radius: var(--r-card);
}
.form-nuevo-sku-title {
  font-size: 0.8rem;
  color: var(--text-2);
  font-weight: 500;
}

/* ── Inline add-to-cart form ──────────────────────────────────────────────── */
.inline-add-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  background: var(--surface-hi);
  border: 1px solid var(--accent);
  border-radius: var(--r-card);
  animation: slideDown 0.18s ease;
}
.inline-add-title {
  font-size: 0.85rem;
  color: var(--text-1);
}
/* form helper text — shown below inputs */
.form-hint {
  font-size: 0.72rem;
  color: var(--text-3);
  line-height: 1.4;
  margin-top: -4px;
}

/* Umbral threshold field with inline unit display */
.umbral-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.umbral-row .input-field { flex: 1; }
.umbral-unit-badge {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface-hi);
  border: 1px solid var(--border);
  border-radius: var(--r-input);
  padding: 0 12px;
  height: 42px;
  display: flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
}

.inline-add-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

/* ── Cart ─────────────────────────────────────────────────────────────────── */
.compra-carrito {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 44px;
  max-height: 220px;
  overflow-y: auto;
}
.compra-carrito-empty {
  font-size: 0.82rem;
  color: var(--text-3);
  text-align: center;
  padding: 16px 0;
}

.carrito-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  background: var(--surface-up);
  border: 1px solid var(--border);
  border-radius: 10px;
  animation: slideDown 0.16s ease;
}
.carrito-item-info    { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.carrito-item-nombre  { font-size: 0.88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.carrito-item-detalle { font-size: 0.75rem; color: var(--text-2); }

/* ── Misc form helpers ────────────────────────────────────────────────────── */
.form-row-inline {
  display: flex;
  gap: 8px;
  align-items: center;
}
.form-row-inline > .form-group {
  margin-bottom: 0;
  align-self: flex-start;
}
.form-row-inline .input-field { flex: 1; }
.form-row-inline .select-pill { flex-shrink: 0; }
/* .select-full dentro de una fila (ej. País/Región) debe repartirse el ancho
   igual que los inputs, no quedar fijo ni desbordar la fila */
.form-row-inline .select-full { flex: 1; min-width: 0; flex-shrink: 1; }

.form-row--fecha {
  display: flex;
  align-items: center;
  gap: 10px;
}
.form-label-inline {
  font-size: 0.8rem;
  color: var(--text-2);
  white-space: nowrap;
}

.loading-sm { font-size: 0.8rem; color: var(--text-3); padding: 8px 0; }
.text-muted-sm { font-size: 0.82rem; color: var(--text-3); text-align: center; padding: 10px 0; }
.text-muted { color: var(--text-2); }

.autocomplete-item--action { font-size: 0.85rem; color: var(--accent); }
.autocomplete-item--generico { font-style: italic; color: var(--text-2); }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Listas de compra: selector ───────────────────────────────────────────── */
.listas-compra-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.lista-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface-up);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.lista-card:hover { border-color: var(--border-md); background: var(--surface-hi); }
.lista-card svg { color: var(--text-3); flex-shrink: 0; }

.lista-card-nombre { font-weight: 600; font-size: 0.92rem; }
.lista-card-sub    { font-size: 0.78rem; color: var(--text-2); margin-top: 2px; }

.lista-card--seleccionable { cursor: pointer; }
.lista-card--seleccionada  { border-color: var(--accent); background: rgba(233, 30, 99, 0.08); }
.lista-card-check {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--accent);
  pointer-events: none;
}

.fusion-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--surface-up);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.fusion-bar-actions { display: flex; gap: 8px; }

.fusion-destino-panel { margin-top: 12px; }
.fusion-destino-opcion {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 6px;
  background: var(--surface-up);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.88rem;
  cursor: pointer;
}
.fusion-destino-opcion input { accent-color: var(--accent); }

/* ── Listas de compra: detalle ────────────────────────────────────────────── */
.lista-detalle-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.lista-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 50vh;
  overflow-y: auto;
}

.lista-item-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-up);
  border: 1px solid var(--border);
  border-radius: 10px;
  animation: slideDown 0.16s ease;
}
.lista-item-row--comprado {
  border-color: var(--success);
  background: rgba(74, 222, 128, 0.06);
}
.lista-item-row--comprado .lista-item-nombre {
  text-decoration: line-through;
  color: var(--text-2);
}

.lista-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lista-item-nombre {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lista-item-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.lista-item-cantidad {
  width: 56px;
  padding: 4px 6px;
  background: var(--surface-hi);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-1);
  font-size: 0.78rem;
}
.lista-item-estado {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--warn);
}
.lista-item-estado--completo { color: var(--success); }

.lista-item-parciales {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}
.lista-item-parcial {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 8px;
  background: var(--surface-hi);
  border-radius: 6px;
  font-size: 0.74rem;
  color: var(--text-2);
}

.lista-item-add-parcial {
  flex-shrink: 0;
  font-weight: 800;
  color: var(--accent);
}

.lista-total-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}
.lista-total-bar strong { font-size: 1.1rem; color: var(--accent); }

/* ── Mi Cuenta: Seguridad + Actividad ─────────────────────────────────────── */
.text-success { color: var(--success); }
.text-danger  { color: var(--warn); }

.actividad-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
}

.actividad-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  background: var(--surface-up);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.actividad-row--error { border-color: var(--warn); }
.actividad-tipo  { font-size: 0.85rem; font-weight: 600; }
.actividad-fecha { font-size: 0.75rem; white-space: nowrap; }

/* ── Panel Admin ──────────────────────────────────────────────────────────── */
.admin-kpis {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.admin-kpi-card {
  background: var(--surface-up);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 14px;
  text-align: center;
}
.admin-kpi-value { font-size: 1.6rem; font-weight: 700; color: var(--accent); }
.admin-kpi-label { font-size: 0.75rem; color: var(--text-2); margin-top: 2px; }

.admin-table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.admin-table th {
  text-align: left;
  font-size: 0.75rem;
  color: var(--text-3);
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }

.admin-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--surface-hi);
  color: var(--text-2);
}
.admin-badge--success { background: rgba(74, 222, 128, 0.15); color: var(--success); }
.admin-badge--warn     { background: rgba(255, 87, 34, 0.15); color: var(--warn); }

.admin-btn {
  background: var(--surface-hi);
  border: 1px solid var(--border-md);
  color: var(--text-1);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s;
}
.admin-btn:hover { border-color: var(--accent); color: var(--text-1); }

.admin-btn--icon {
  width: 32px; height: 32px;
  padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  flex-shrink: 0;
}
.admin-btn--icon svg { pointer-events: none; }

.admin-btn--accent {
  background: rgba(156, 39, 176, 0.15);
  border-color: rgba(156, 39, 176, 0.35);
  color: #CE93D8;
}
.admin-btn--accent:hover { background: rgba(156, 39, 176, 0.25); border-color: #9C27B0; color: #E1BEE7; }

.admin-btn--success {
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.3);
  color: var(--success);
}
.admin-btn--success:hover { background: rgba(74, 222, 128, 0.22); border-color: var(--success); }

.admin-btn--danger {
  background: rgba(255, 87, 34, 0.12);
  border-color: rgba(255, 87, 34, 0.3);
  color: var(--warn);
}
.admin-btn--danger:hover { background: rgba(255, 87, 34, 0.22); border-color: var(--warn); }

.admin-usr-nombre  { font-weight: 600; font-size: 0.85rem; }
.admin-usr-acciones { display: flex; gap: 6px; flex-wrap: wrap; }

.admin-config-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.admin-config-info { flex: 1; min-width: 140px; }
.admin-config-desc { font-size: 0.85rem; font-weight: 500; }
.admin-config-edit {
  display: flex;
  align-items: center;
  gap: 6px;
}
.admin-config-edit .input-field { width: 110px; text-align: center; }

.btn-icon-save {
  background: var(--accent-grad);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Planificador de comidas ──────────────────────────────────────────────── */
.planes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.plan-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  background: var(--surface-up);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.plan-card:hover { border-color: var(--border-md); background: var(--surface-hi); }
.plan-card-fechas { font-weight: 700; font-size: 0.95rem; }

.plan-detalle { margin-top: 4px; }
.plan-dias-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.plan-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-up);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
}
.plan-item-fecha {
  min-width: 64px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-2);
  text-align: center;
  flex-shrink: 0;
}
.plan-item-info { flex: 1; min-width: 0; cursor: pointer; }
.plan-item-slot {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--magenta);
  margin-bottom: 2px;
}
.plan-item-receta {
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plan-day-card {
  background: var(--surface-up);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  overflow: hidden;
}
.plan-day-header {
  padding: 8px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
}
.plan-day-slots {
  display: flex;
  flex-direction: column;
}
.plan-day-slot {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.plan-day-slot + .plan-day-slot {
  border-top: 1px solid var(--border);
}
.plan-day-slot-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.plan-day-slot-body {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}
.plan-day-slot-body .plan-item-receta {
  flex: 1;
  min-width: 0;
}
.plan-day-multi {
  font-size: 0.68rem;
  color: var(--text-3);
}
.plan-detalle-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

/* Wizard: nuevo plan */
.plan-estructura-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.plan-estructura-row {
  padding: 10px 12px;
  background: var(--surface-up);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.plan-estructura-dia {
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.plan-estructura-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.plan-multidia-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.plan-multidia-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface-up);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--text-2);
  cursor: pointer;
}
.plan-multidia-row--disabled { opacity: 0.5; cursor: not-allowed; }
.plan-multidia-row input { accent-color: var(--accent); }

.plan-disgustos-toggle {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--text-2);
  cursor: pointer;
}
.plan-disgustos-toggle input { accent-color: var(--accent); margin-top: 2px; }

/* ── Touch devices (pointer: coarse) ────────────────────────────────────── */
@media (pointer: coarse) {
  /* Scroll momentum en iOS */
  .view-content,
  .modal-sheet,
  .autocomplete-list,
  .bottom-nav { -webkit-overflow-scrolling: touch; }

  /* Feedback táctil en tarjetas interactivas */
  .receta-card,
  .sug-card,
  .comercio-card,
  .cocinero-card {
    transition: transform 0.12s cubic-bezier(0.2, 0, 0, 1),
                border-color 0.15s, background 0.15s;
  }
  .receta-card:active,
  .sug-card:active,
  .comercio-card:active,
  .cocinero-card:active { transform: scale(0.98); }

  /* Hit areas mínimos 44px */
  .modal-close { width: 44px; height: 44px; }
  .ing-item-del,
  .ing-item-edit { padding: 10px; }
  .dias-pill { padding: 5px 12px; }
  .btn-ghost-sm { padding: 8px 12px; }
  .hamburger-btn { padding: 10px; }

  /* Catalog action buttons */
  .catalogo-row-actions .btn-ghost,
  .catalogo-row-actions .btn-warn {
    min-width: 44px; min-height: 44px;
    display: flex; align-items: center; justify-content: center;
  }

  /* Tab targets */
  .tab { min-height: 44px; }
}

/* ── Narrow mobile (< 480px) ────────────────────────────────────────────── */
@media (max-width: 480px) {
  /* Tighter view padding on very small screens */
  .view-content { padding: 16px 12px; }

  /* Modal sheet: reduce horizontal padding, keep generous bottom */
  .modal-sheet {
    padding: 16px 16px calc(28px + var(--safe-b));
    border-radius: 16px 16px 0 0;
  }

  /* Inline row fields stack vertically (cantidad+unidad, contenido+unidad) */
  .form-row-inline {
    flex-direction: column;
    align-items: stretch;
  }
  .form-row-inline .select-pill { width: 100%; }
  .form-row-inline .select-full { width: 100%; }

  /* Give the modal form a bit more air between groups */
  .modal-body .form-group { margin-bottom: 20px; }
}

/* ── Evaluación del cocinero — banner ──────────────────────────────────────── */

.eval-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, rgba(233,30,99,.15), rgba(106,27,154,.15));
  border: 1px solid rgba(233,30,99,.3);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.eval-banner.hidden { display: none; }

.eval-banner-body {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.eval-banner-icon { font-size: 1.4rem; flex-shrink: 0; }
.eval-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.eval-banner-text strong {
  color: var(--fg);
  font-size: .9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.eval-banner-sub {
  color: var(--fg2);
  font-size: .78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Star rating widget ────────────────────────────────────────────────────── */

.star-rating {
  display: flex;
  gap: 6px;
  margin: 16px 0 4px;
}
.star-rating--sm { margin: 0; gap: 4px; }

.star-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 2rem;
  color: var(--border);
  padding: 0;
  line-height: 1;
  transition: color .12s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.star-rating--sm .star-btn { font-size: 1.25rem; }

.star-btn.active { color: #F59E0B; }
.star-btn:hover  { color: #F59E0B; transform: scale(1.15); }

.eval-nota-label,
.eval-step-nota {
  font-size: .82rem;
  color: var(--fg2);
  min-height: 1.2em;
}

/* ── Reveal de evaluaciones ────────────────────────────────────────────────── */

.reveal-promedio {
  font-size: 2rem;
  letter-spacing: .1em;
  color: #F59E0B;
  margin: 8px 0 2px;
}
.reveal-score {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--fg);
  margin: 0;
}
.reveal-sub {
  font-size: .82rem;
  color: var(--fg2);
  margin: 2px 0 16px;
}
.reveal-voto {
  background: var(--surface2);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.reveal-autor {
  font-size: .78rem;
  font-weight: 600;
  color: var(--accent);
  display: block;
  margin-bottom: 4px;
}
.reveal-comentario {
  font-size: .88rem;
  color: var(--fg);
  margin: 0;
}

/* ── Calificación en modal de receta ───────────────────────────────────────── */

.receta-cal-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.receta-cal-label {
  font-size: .82rem;
  color: var(--fg2);
  white-space: nowrap;
}
.receta-cal-avg {
  font-size: .82rem;
  color: var(--fg2);
  margin-left: auto;
}

/* ── Mis recetas compartidas ───────────────────────────────────────────────── */

.mis-recetas-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}
.propuesta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface2);
  border-radius: 8px;
}
.propuesta-nombre {
  font-size: .88rem;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Badge de estado ───────────────────────────────────────────────────────── */

.badge-estado {
  font-size: .72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
}
.badge-estado--pending { background: rgba(251,191,36,.2); color: #D97706; }
.badge-estado--ok      { background: rgba(34,197,94,.2);  color: #16A34A; }
.badge-estado--err     { background: rgba(239,68,68,.2);  color: #DC2626; }

/* ── Admin propuestas ──────────────────────────────────────────────────────── */

/* ── Comercios: coords / medios de pago / horarios ───────────────────────── */
.coords-gmaps-row { display: flex; gap: 8px; }
.coords-gmaps-row .input-field { flex: 1; }
.ubicacion-switch-row { border-bottom: none !important; padding: 2px 0 10px !important; }

/* ── Mapa: panel de visualización + leyenda ──────────────────────────────── */
.map-viz-wrap { position: relative; }
.map-viz-btn {
  width: 32px; height: 32px; border-radius: 6px;
  background: var(--surface-up); border: 1px solid var(--border-md);
  color: var(--text-1); font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}
.map-viz-btn:hover { background: var(--surface-hi); }
.map-viz-panel {
  position: absolute; right: 0; top: 36px; min-width: 200px;
  background: var(--surface-up); border: 1px solid var(--border-md);
  border-radius: 10px; padding: 10px 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  z-index: 1000;
}
.map-viz-title {
  font-size: 0.75rem; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px;
}
.map-viz-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.88rem; color: var(--text-1); cursor: pointer; padding: 4px 0;
}
.map-viz-row input[type=checkbox] { accent-color: var(--magenta); width: 15px; height: 15px; cursor: pointer; }
.map-legend {
  background: var(--surface-up); border: 1px solid var(--border-md);
  border-radius: 8px; padding: 8px 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.map-legend-item { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--text-1); padding: 2px 0; }
.map-legend-item span { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; display: inline-block; }

/* ── Popup enriquecido de pin ───────────────────────────────────────────── */
.comercio-popup-wrap .leaflet-popup-content-wrapper {
  background: var(--surface-up);
  color: var(--ink, #f0f0f0);
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.45);
  padding: 0;
}
.comercio-popup-wrap .leaflet-popup-content { margin: 0; }
.comercio-popup-wrap .leaflet-popup-tip-container { filter: drop-shadow(0 2px 4px rgba(0,0,0,0.35)); }
.comercio-popup-wrap .leaflet-popup-tip { background: var(--surface-up); }
.comercio-popup-wrap .leaflet-popup-close-button { color: var(--ink-muted, #aaa) !important; top: 6px !important; right: 8px !important; }
.cpopup { padding: 12px 14px; min-width: 160px; }
.cpopup-nombre { font-weight: 700; font-size: 14px; line-height: 1.3; padding-right: 14px; }
.cpopup-sucursal { font-size: 12px; color: var(--ink-muted, #aaa); margin-top: 1px; }
.cpopup-tipo {
  display: inline-block; margin-top: 7px;
  padding: 2px 9px; border-radius: 10px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  background: rgba(168,85,247,0.15); color: #c084fc;
}
.cpopup-dir { margin-top: 8px; font-size: 12px; color: var(--ink-muted, #aaa); line-height: 1.4; }
.cpopup-dist { margin-top: 7px; font-size: 12px; font-weight: 600; color: #E91E63; }

.medios-pago-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.medios-pago-section { padding: 12px 0 8px; border-top: 1px solid var(--border); }
.medios-pago-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-medio {
  padding: 5px 14px; border-radius: 20px; font-size: 0.84rem; cursor: pointer;
  border: 1.5px solid var(--border-md); background: var(--surface-up);
  color: var(--text-1); transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.chip-medio.active {
  background: rgba(233,30,99,0.15); border-color: #E91E63; color: #E91E63; font-weight: 600;
}
.medio-pago-check { display: flex; align-items: center; gap: 6px; font-size: 0.88rem;
  background: var(--surface-up); border: 1.5px solid var(--border-md);
  border-radius: 20px; padding: 5px 12px; cursor: pointer; transition: border-color .15s; }
.medio-pago-check:has(input:checked) { border-color: rgba(233,30,99,.6); background: rgba(233,30,99,.08); }
.medio-pago-check input { display: none; }

.horarios-section { display: flex; flex-direction: column; gap: 6px; }
.horario-row { display: grid; grid-template-columns: 80px 1fr 1fr 1fr; align-items: center; gap: 8px; }
.horario-dia { font-size: 0.85rem; font-weight: 600; color: var(--text-2); }
.horario-cerrado-label { font-size: 0.82rem; white-space: nowrap; }
@media (max-width: 480px) {
  .horario-row { grid-template-columns: 70px 1fr; row-gap: 4px; }
  .horario-row .horario-ap, .horario-row .horario-ci { grid-column: span 1; }
}

/* ── Admin: medios de pago ───────────────────────────────────────────────── */
.admin-medios-pago-list { display: flex; flex-direction: column; gap: 6px; }
.admin-medio-pago-row { display: flex; align-items: center; justify-content: space-between;
  padding: 6px 0; border-bottom: 1px solid var(--border); }
.admin-medio-pago-row:last-child { border-bottom: none; }
.medio-nombre { font-size: 0.92rem; }
.medio-nombre.inactive { opacity: .45; text-decoration: line-through; }
.badge-sistema { font-size: 0.7rem; background: var(--surface-up); border-radius: 6px;
  padding: 1px 6px; color: var(--text-3); margin-left: 4px; }

.tab-logout { margin-top: auto; }
.tab-logout .tab-icon-wrap, .tab-logout .tab-label { color: var(--text-3); }
.tab-logout:hover .tab-icon-wrap, .tab-logout:hover .tab-label { color: #e57373; }
.admin-canonico-form { display: flex; flex-direction: column; gap: 16px; }
.admin-canonico-form .form-field { display: flex; flex-direction: column; gap: 6px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .form-row-2 { grid-template-columns: 1fr; } }
.alergeno-row { display: flex; align-items: center; gap: 10px; }
.alergeno-row .input-field { flex: 1; }
.toggle-label { display: flex; align-items: center; gap: 6px; white-space: nowrap;
  font-size: .85rem; color: var(--text-secondary); cursor: pointer; }
.toggle-label input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }

.admin-propuestas-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.propuesta-admin-card {
  background: var(--surface2);
  border-radius: 10px;
  padding: 12px 14px;
}
.propuesta-admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.propuesta-admin-nombre {
  font-size: .9rem;
  color: var(--fg);
}
.propuesta-admin-meta {
  font-size: .78rem;
  color: var(--fg2);
  margin: 0 0 6px;
}
.propuesta-admin-desc {
  font-size: .83rem;
  color: var(--fg);
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.propuesta-admin-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* ── Modal propuesta — ingredient / step rows ──────────────────────────────── */

.modal-sheet--wide { max-height: 90dvh; overflow-y: auto; }

.prop-ing-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.prop-ing-row .input-field { padding: 7px 10px; }

.prop-paso-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}
.prop-paso-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: .75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 9px;
}
.prop-paso-texto { flex: 1; resize: vertical; }

@media (max-width: 480px) {
  .prop-ing-row { flex-wrap: wrap; }
  .prop-ing-row .prop-ing-cant  { width: 64px; }
  .prop-ing-row .prop-ing-unidad { width: 72px; }
}

/* ── Plan Plus / Upgrade ─────────────────────────────────────────────────── */

/* Upgrade modal sheet */
.modal-sheet--upgrade {
  max-width: 480px;
  padding: 24px 24px 32px;
}

.upgrade-header { text-align: center; margin-bottom: 20px; }
.upgrade-crown  { font-size: 2rem; line-height: 1; margin-bottom: 8px; color: #F59E0B; }
.upgrade-title  {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.upgrade-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Period toggle */
.upgrade-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}
.upgrade-period-btn {
  background: var(--surface-hi);
  border: 1px solid var(--border-md);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 6px 18px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.upgrade-period-btn.active {
  background: var(--orchid);
  border-color: var(--orchid);
  color: #fff;
}
.upgrade-badge-ahorro {
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.18);
  color: #F59E0B;
  border-radius: 20px;
  padding: 3px 10px;
}

/* Price block */
.upgrade-price-block { text-align: center; margin-bottom: 20px; }
.upgrade-price { display: flex; align-items: baseline; justify-content: center; gap: 4px; }
.upgrade-price-amount {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.upgrade-price-period { font-size: 1rem; color: var(--text-muted); font-weight: 500; }
.upgrade-price-sub  { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }
.upgrade-savings    { font-size: 0.82rem; color: #F59E0B; margin-top: 4px; font-weight: 500; }

/* Features */
.upgrade-features {
  list-style: none;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.upgrade-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.upgrade-check {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(106, 27, 154, 0.25);
  color: var(--fuchsia);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Upgrade CTA button */
.btn-upgrade {
  background: linear-gradient(135deg, var(--orchid) 0%, var(--fuchsia) 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  padding: 14px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-upgrade:hover  { opacity: 0.9; }
.btn-upgrade:disabled { opacity: 0.5; cursor: not-allowed; }

.upgrade-legal {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Plan status card in Hogar view */
.plan-status-card {
  margin-bottom: 16px;
}
.plan-active-row, .plan-free-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.plan-active-meta { font-size: 0.8rem; color: var(--text-muted); }
.plan-active-sub, .plan-free-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.plan-badge {
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 20px;
  padding: 3px 12px;
}
.plan-badge--plus {
  background: linear-gradient(135deg, var(--orchid), var(--fuchsia));
  color: #fff;
}
.plan-badge--free {
  background: var(--surface-hi);
  color: var(--text-muted);
  border: 1px solid var(--border-md);
}
.plan-hist-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.plan-hist-row:last-child { border-bottom: none; }

/* Pago result toast */
.pago-toast {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 72px);
  left: 50%;
  transform: translateX(-50%);
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 2000;
  white-space: nowrap;
  max-width: 90vw;
  text-align: center;
  animation: toast-in 0.25s ease-out;
}
.pago-toast--ok  { background: #16a34a; color: #fff; }
.pago-toast--err { background: #dc2626; color: #fff; }

/* ── Admin config — precio inputs ────────────────────────────────────────── */
.admin-config-group { }
.admin-config-edit  { display: flex; align-items: center; gap: 6px; }
.cfg-prefix {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}
.input-price {
  width: 100px;
  text-align: right;
}

/* ── Módulo Ayuda ─────────────────────────────────────────────────────────── */

/* Inner tab strip */
.help-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 4px;
  margin-bottom: 20px;
}
.help-tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-2);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  font-family: inherit;
}
.help-tab.active {
  background: var(--accent-grad);
  color: #fff;
}

/* Panels */
.help-panel { display: flex; flex-direction: column; gap: 8px; }
.help-panel.hidden { display: none; }

/* Accordion sections */
.help-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  overflow: hidden;
}
.help-accordion {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: none;
  border: none;
  color: var(--text-1);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  gap: 8px;
}
.help-accordion:hover { background: var(--surface-up); }
.help-accordion span:first-child { display: flex; align-items: center; gap: 8px; }
.help-icon { font-size: 1.05rem; line-height: 1; }
.help-chevron {
  flex-shrink: 0;
  color: var(--text-3);
  transition: transform 0.22s ease;
}
.help-section.open .help-chevron { transform: rotate(180deg); }

.help-accordion-body {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
  color: var(--text-2);
  font-size: 0.88rem;
  line-height: 1.6;
}
.help-section.open .help-accordion-body { display: block; }
.help-accordion-body p { margin-bottom: 8px; }
.help-accordion-body ul {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}
.help-accordion-body strong { color: var(--text-1); }
.help-note {
  margin-top: 8px !important;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
}
.help-badge-plus {
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--accent-grad);
  color: #fff;
  padding: 2px 6px;
  border-radius: var(--r-pill);
  vertical-align: middle;
  margin-left: 4px;
}

/* Acerca de */
.help-about-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  margin-bottom: 8px;
}
.help-logo-wrap {
  width: 64px; height: 64px;
  border-radius: 18px;
  background: var(--surface-up);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.help-logo { width: 54px; height: 54px; object-fit: contain; }
.help-app-name {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.help-app-tagline {
  font-size: 0.88rem;
  color: var(--text-2);
  text-align: center;
}

.help-about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 16px;
  margin-bottom: 8px;
  font-size: 0.88rem;
  color: var(--text-2);
  line-height: 1.65;
}
.help-about-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 10px;
}
.help-about-card strong { color: var(--text-1); }

/* Changelog */
.help-changelog { display: flex; flex-direction: column; gap: 0; }
.changelog-entry {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.changelog-entry:last-child { border-bottom: none; padding-bottom: 0; }
.changelog-version {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent);
  padding-top: 2px;
}
.changelog-date {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-bottom: 2px;
}
.changelog-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 6px;
}
.changelog-content ul {
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.82rem;
  color: var(--text-2);
}

.help-footer-credit {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-3);
  padding: 16px 0 4px;
}
