/**
 * CashFlag UI Library v4.0
 * Basado en el mockup de rediseño — Fintech Emerald
 *
 * Paleta: Esmeralda (#10b981) + Slate oscuro (#0f172a)
 * Fuente:  Plus Jakarta Sans
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ─────────────────────────────────────────────────────────────
   1. VARIABLES
────────────────────────────────────────────────────────────── */
:root {
  /* Brand — Esmeralda */
  --brand-50:   #ecfdf5;
  --brand-100:  #d1fae5;
  --brand-200:  #a7f3d0;
  --brand-400:  #34d399;
  --brand-500:  #10b981;
  --brand-600:  #059669;
  --brand-700:  #047857;
  --brand-dark: #0f172a;
  --brand-navy: #1e293b;

  /* Slate */
  --slate-50:   #f8fafc;
  --slate-100:  #f1f5f9;
  --slate-200:  #e2e8f0;
  --slate-300:  #cbd5e1;
  --slate-400:  #94a3b8;
  --slate-500:  #64748b;
  --slate-600:  #475569;
  --slate-700:  #334155;
  --slate-800:  #1e293b;
  --slate-900:  #0f172a;

  /* Amber / Premio */
  --amber-100:  #fef3c7;
  --amber-400:  #fbbf24;
  --amber-500:  #f59e0b;
  --amber-700:  #b45309;

  /* Semánticos */
  --color-primary:     var(--brand-500);
  --color-primary-dk:  var(--brand-600);
  --color-primary-bg:  var(--brand-50);
  --color-text:        var(--slate-900);
  --color-text-2:      var(--slate-500);
  --color-text-3:      var(--slate-400);
  --color-bg:          var(--slate-50);
  --color-surface:     #ffffff;
  --color-border:      var(--slate-200);
  --color-border-2:    var(--slate-300);

  /* Fuente */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Radios */
  --r-sm:   8px;
  --r:      12px;
  --r-lg:   16px;
  --r-xl:   20px;
  --r-2xl:  24px;
  --r-full: 9999px;

  /* Sombras */
  --shadow-xs:  0 1px 2px rgba(0,0,0,.05);
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow:     0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.04);
  --shadow-md:  0 6px 16px -2px rgba(0,0,0,.10), 0 3px 6px -3px rgba(0,0,0,.04);
  --shadow-lg:  0 10px 24px -4px rgba(0,0,0,.12), 0 4px 8px -4px rgba(0,0,0,.04);
  --shadow-xl:  0 20px 48px -8px rgba(0,0,0,.16), 0 8px 16px -8px rgba(0,0,0,.06);
  --shadow-brand: 0 8px 24px rgba(16,185,129,.28);

  /* Transición */
  --t:    150ms ease;
  --t-md: 250ms ease;

  /* Layout */
  --max-w: 1280px;
  --nav-h: 60px;
  --bottom-nav-h: 64px;
}

/* ─────────────────────────────────────────────────────────────
   2. RESET & BASE
────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font-family: var(--font-sans); font-size: inherit; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--brand-500); color: #fff; }

/* ─────────────────────────────────────────────────────────────
   3. TIPOGRAFÍA
────────────────────────────────────────────────────────────── */
.cf-h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; }
.cf-h2 { font-size: 1.3rem;  font-weight: 700; letter-spacing: -.02em; line-height: 1.3; }
.cf-h3 { font-size: 1rem;    font-weight: 700; letter-spacing: -.01em; line-height: 1.4; }
.cf-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--slate-500); }
.cf-text-sm   { font-size: .87rem; }
.cf-text-xs   { font-size: .78rem; }
.cf-muted     { color: var(--color-text-2); }
.cf-center    { text-align: center; }

/* ─────────────────────────────────────────────────────────────
   4. LAYOUT
────────────────────────────────────────────────────────────── */
.cf-wrap {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: 24px;
}

/* App shell centrado (max-md) */
.cf-app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 448px;
  margin-inline: auto;
  background: var(--color-surface);
  box-shadow: var(--shadow-xl);
  border-inline: 1px solid var(--slate-100);
}

/* Página de formulario centrada */
.cf-page-auth {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--slate-50);
}

/* Panel de auth */
.cf-auth-panel {
  width: 100%;
  max-width: 420px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-lg);
  padding: 36px 32px;
}

/* Utilities */
.cf-flex          { display: flex; }
.cf-col           { flex-direction: column; }
.cf-items-center  { align-items: center; }
.cf-justify-between { justify-content: space-between; }
.cf-justify-center  { justify-content: center; }
.cf-gap-2  { gap: 8px; }
.cf-gap-3  { gap: 12px; }
.cf-gap-4  { gap: 16px; }
.cf-gap-6  { gap: 24px; }
.cf-mt-4   { margin-top: 16px; }
.cf-mt-6   { margin-top: 24px; }
.cf-mb-4   { margin-bottom: 16px; }
.cf-mb-6   { margin-bottom: 24px; }
.cf-w-full { width: 100%; }
.cf-hidden { display: none !important; }

/* ─────────────────────────────────────────────────────────────
   5. HEADER / NAVBAR
────────────────────────────────────────────────────────────── */
.cf-header {
  height: var(--nav-h);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--slate-100);
  box-shadow: var(--shadow-xs);
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
}

.cf-header-inner {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Logo brand pill */
.cf-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cf-brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-400));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(16,185,129,.3);
  flex-shrink: 0;
}
.cf-brand-icon svg { width: 22px; height: 22px; stroke: #fff; fill: none; }
.cf-brand-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--slate-900);
  letter-spacing: -.02em;
}
.cf-brand-name em { color: var(--brand-600); font-style: normal; }
.cf-brand-badge {
  font-size: .65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--brand-50);
  color: var(--brand-700);
  border: 1px solid var(--brand-200);
  padding: 1px 6px;
  border-radius: var(--r-full);
}

/* ─────────────────────────────────────────────────────────────
   6. BOTONES
────────────────────────────────────────────────────────────── */
.cf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 18px;
  font-size: .87rem;
  font-weight: 700;
  border-radius: var(--r);
  border: 1.5px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  letter-spacing: .01em;
  transition: background var(--t), border-color var(--t), color var(--t),
              box-shadow var(--t), transform var(--t);
}
.cf-btn:hover { text-decoration: none; transform: translateY(-1px); }
.cf-btn:active { transform: translateY(0) scale(.98); }
.cf-btn:disabled { opacity: .5; pointer-events: none; }

/* Primario — esmeralda */
.cf-btn-primary {
  background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
  border-color: var(--brand-600);
  color: var(--slate-900);
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(16,185,129,.3);
}
.cf-btn-primary:hover { background: linear-gradient(135deg, var(--brand-700), var(--brand-600)); box-shadow: var(--shadow-brand); color: var(--slate-900); }

/* Secundario / outline */
.cf-btn-outline {
  background: var(--color-surface);
  border-color: var(--color-border-2);
  color: var(--slate-700);
}
.cf-btn-outline:hover { background: var(--slate-50); border-color: var(--brand-500); color: var(--brand-600); }

/* Oscuro */
.cf-btn-dark {
  background: var(--slate-900);
  border-color: var(--slate-900);
  color: #fff;
}
.cf-btn-dark:hover { background: var(--slate-800); color: #fff; }

/* Ghost */
.cf-btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--brand-600);
}
.cf-btn-ghost:hover { background: var(--brand-50); }

/* Amber */
.cf-btn-amber {
  background: var(--amber-400);
  border-color: var(--amber-400);
  color: var(--slate-900);
  font-weight: 800;
}
.cf-btn-amber:hover { background: var(--amber-500); border-color: var(--amber-500); color: var(--slate-900); }

/* Tamaños */
.cf-btn-sm  { height: 32px; padding: 0 12px; font-size: .8rem; border-radius: var(--r-sm); }
.cf-btn-lg  { height: 48px; padding: 0 28px; font-size: .95rem; border-radius: var(--r-lg); }
.cf-btn-xl  { height: 52px; padding: 0 32px; font-size: 1rem;   border-radius: var(--r-lg); }
.cf-btn-full { width: 100%; }

/* Role switcher pill */
.cf-role-pill {
  background: var(--slate-100);
  padding: 4px;
  border-radius: 14px;
  display: inline-flex;
  font-size: .78rem;
  font-weight: 700;
}
.cf-role-btn {
  padding: 6px 14px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: .78rem;
  font-weight: 700;
  transition: all var(--t);
  color: var(--slate-500);
  background: transparent;
}
.cf-role-btn.active {
  background: #fff;
  color: var(--slate-900);
  box-shadow: var(--shadow-sm);
}

/* ─────────────────────────────────────────────────────────────
   7. FORMULARIOS
────────────────────────────────────────────────────────────── */
.cf-form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; }
.cf-form-label { font-size: .78rem; font-weight: 700; color: var(--slate-600); }

.cf-input, .cf-select, .cf-textarea {
  height: 42px;
  width: 100%;
  padding: 0 14px;
  font-size: .9rem;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-surface);
  border: 1.5px solid var(--color-border-2);
  border-radius: var(--r);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.cf-input:focus, .cf-select:focus, .cf-textarea:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(16,185,129,.12);
}
.cf-input::placeholder { color: var(--slate-400); }
.cf-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394a3b8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.cf-textarea { height: auto; min-height: 80px; padding: 12px 14px; resize: vertical; }

/* Fila label + campo (legado) */
.cf-field-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.cf-field-label { min-width: 38%; font-size: .82rem; font-weight: 600; color: var(--slate-500); text-align: right; flex-shrink: 0; }
.cf-field-input { flex: 1; }

.cf-form-actions { display: flex; gap: 10px; margin-top: 20px; }

/* ─────────────────────────────────────────────────────────────
   8. CARDS
────────────────────────────────────────────────────────────── */
/* Card base */
.cf-card {
  background: var(--color-surface);
  border: 1px solid var(--slate-100);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--t-md), transform var(--t-md), border-color var(--t-md);
}
.cf-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--slate-200); }
.cf-card-body   { padding: 20px; }
.cf-card-header { padding: 14px 20px; border-bottom: 1px solid var(--slate-100); font-weight: 700; font-size: .9rem; }

/* Glass card — wallet oscuro */
.cf-glass-card {
  background: linear-gradient(135deg, rgba(15,23,42,.96) 0%, rgba(30,41,59,.98) 100%);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(100,116,139,.3);
  border-radius: var(--r-2xl);
  color: #fff;
  padding: 24px;
  box-shadow: var(--shadow-xl);
  position: relative;
  overflow: hidden;
}
.cf-glass-card::before,
.cf-glass-card::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.cf-glass-card::before {
  width: 180px; height: 180px;
  background: rgba(16,185,129,.18);
  filter: blur(40px);
  right: -48px; bottom: -48px;
}
.cf-glass-card::after {
  width: 140px; height: 140px;
  background: rgba(6,182,212,.10);
  filter: blur(40px);
  left: -40px; top: -40px;
}

/* Store card */
.cf-store-card {
  background: var(--color-surface);
  border: 1px solid var(--slate-100);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color var(--t-md), box-shadow var(--t-md);
}
.cf-store-card:hover { border-color: var(--brand-200); box-shadow: var(--shadow-md); }

/* Menu action card */
.cf-menu-card {
  background: var(--color-surface);
  border: 1px solid var(--slate-100);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xs);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: all var(--t-md);
}
.cf-menu-card:hover { border-color: var(--brand-200); background: var(--brand-50); box-shadow: var(--shadow); transform: translateY(-2px); text-decoration: none; }
.cf-menu-card:hover .cf-menu-card-label { color: var(--brand-600); }

.cf-menu-card-icon {
  width: 44px; height: 44px;
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: transform var(--t-md);
}
.cf-menu-card:hover .cf-menu-card-icon { transform: scale(1.1); }
.cf-menu-card-label { font-size: .78rem; font-weight: 700; color: var(--slate-700); line-height: 1.2; }

/* Quick action button */
.cf-quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-radius: var(--r-xl);
  background: var(--color-surface);
  border: 1px solid var(--slate-100);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: all var(--t-md);
  gap: 6px;
  text-decoration: none;
}
.cf-quick-action:hover { border-color: var(--brand-200); background: var(--brand-50); transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.cf-quick-action-icon {
  width: 42px; height: 42px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--t-md);
}
.cf-quick-action:hover .cf-quick-action-icon { transform: scale(1.1); }
.cf-quick-action-label { font-size: .74rem; font-weight: 700; color: var(--slate-700); text-align: center; }

/* Merchant tile (catálogo tarjetero) */
.cf-merchant-tile {
  background: var(--color-surface);
  border: 1px solid var(--slate-200);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  padding: 20px 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all var(--t-md);
  gap: 10px;
  user-select: none;
}
.cf-merchant-tile:hover {
  box-shadow: 0 8px 28px rgba(16,185,129,.16);
  transform: translateY(-4px);
  border-color: var(--brand-200);
}
.cf-merchant-tile-logo {
  width: 84px; height: 84px;
  object-fit: contain;
  border-radius: 14px;
  background: var(--slate-50);
  padding: 6px;
  border: 1.5px solid var(--slate-200);
  transition: transform var(--t-md);
}
.cf-merchant-tile:hover .cf-merchant-tile-logo { transform: scale(1.06); }
.cf-merchant-tile-name {
  font-size: .84rem;
  font-weight: 700;
  color: var(--slate-800);
  text-align: center;
  line-height: 1.3;
}

/* Reward card */
.cf-reward-card {
  background: var(--color-surface);
  border: 1px solid var(--slate-100);
  border-radius: var(--r-xl);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-xs);
}
.cf-reward-card.can-afford { border-color: var(--amber-100); }

/* ─────────────────────────────────────────────────────────────
   9. TABLAS
────────────────────────────────────────────────────────────── */
.cf-table-wrap {
  background: var(--color-surface);
  border: 1px solid var(--slate-100);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.cf-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.cf-table thead th {
  background: var(--brand-50);
  color: var(--brand-700);
  font-size: .73rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1.5px solid var(--brand-100);
}
.cf-table tbody td { padding: 12px 16px; border-bottom: 1px solid var(--slate-50); color: var(--slate-800); vertical-align: middle; }
.cf-table tbody tr:last-child td { border-bottom: none; }
.cf-table tbody tr:hover td { background: var(--brand-50); }
.cf-table tbody tr:nth-child(even) td { background: var(--slate-50); }
.cf-table tbody tr:nth-child(even):hover td { background: var(--brand-50); }

/* Filas flex legado */
.fila { display: flex; align-items: stretch; border-bottom: 1px solid var(--slate-100); transition: background var(--t); }
.fila.titulo, .titulo {
  background: var(--brand-50) !important;
  color: var(--brand-700) !important;
  font-size: .73rem !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: .07em !important;
  border-bottom: 1.5px solid var(--brand-100) !important;
}
.par   { background: var(--color-surface) !important; }
.impar { background: var(--slate-50) !important; }
.fila:not(.titulo):hover { background: var(--brand-50) !important; }
[class^="columna"], [class*=" columna"] {
  padding: 12px 16px;
  font-size: .85rem;
  color: var(--slate-800);
  display: flex;
  align-items: center;
}

/* ─────────────────────────────────────────────────────────────
   10. MODALES
────────────────────────────────────────────────────────────── */
.cf-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(15,23,42,.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.cf-modal-overlay.open { display: flex; }

.cf-modal {
  background: var(--color-surface);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 400px;
  padding: 28px;
  position: relative;
  text-align: center;
  animation: cf-modal-in .22s cubic-bezier(.34,1.4,.64,1);
}
@keyframes cf-modal-in {
  from { opacity: 0; transform: scale(.88) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.cf-modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--slate-100);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--slate-500);
  font-size: .9rem;
  transition: background var(--t), color var(--t);
}
.cf-modal-close:hover { background: var(--slate-200); color: var(--slate-900); }

/* ─────────────────────────────────────────────────────────────
   11. BADGES / TAGS
────────────────────────────────────────────────────────────── */
.cf-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-full);
  font-size: .71rem;
  font-weight: 800;
  letter-spacing: .02em;
}
.cf-badge-brand  { background: var(--brand-50);   color: var(--brand-700);  border: 1px solid var(--brand-200); }
.cf-badge-amber  { background: var(--amber-100);  color: var(--amber-700);  border: 1px solid #fde68a; }
.cf-badge-green  { background: var(--brand-50);   color: var(--brand-600); }
.cf-badge-dark   { background: var(--slate-800);  color: #fff; }
.cf-badge-gray   { background: var(--slate-100);  color: var(--slate-600); }

/* ─────────────────────────────────────────────────────────────
   12. ALERTAS / MENSAJES
────────────────────────────────────────────────────────────── */
.cf-alert {
  padding: 12px 16px;
  border-radius: var(--r);
  font-size: .87rem;
  font-weight: 500;
  border: 1px solid transparent;
  margin: 12px 0;
}
.cf-alert-success { background: var(--brand-50);  color: var(--brand-700); border-color: var(--brand-200); }
.cf-alert-error   { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.cf-alert-info    { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.cf-alert-amber   { background: var(--amber-100); color: var(--amber-700); border-color: #fde68a; }

/* Toast */
.cf-toast {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  background: var(--slate-900);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--slate-800);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .83rem;
  font-weight: 600;
  max-width: 340px;
  transition: opacity var(--t-md), transform var(--t-md);
}
.cf-toast.hidden { display: none; }

/* Spinner */
@keyframes cf-spin { to { transform: rotate(360deg); } }
.cf-spinner {
  width: 22px; height: 22px;
  border: 2.5px solid var(--slate-200);
  border-top-color: var(--brand-500);
  border-radius: 50%;
  animation: cf-spin .6s linear infinite;
  margin: 16px auto;
}

/* ─────────────────────────────────────────────────────────────
   13. BOTTOM NAV (mobile)
────────────────────────────────────────────────────────────── */
.cf-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0; right: 0;
  height: var(--bottom-nav-h);
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
  z-index: 100;
  max-width: var(--max-w);
  margin-inline: auto;
}

.cf-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 12px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--slate-400);
  transition: color var(--t);
  font-family: var(--font-sans);
  font-size: .68rem;
  font-weight: 700;
  text-decoration: none;
}
.cf-nav-item:hover { color: var(--slate-700); }
.cf-nav-item.active { color: var(--brand-600); }
.cf-nav-item svg { width: 20px; height: 20px; stroke: currentColor; fill: none; }

/* FAB QR central */
.cf-nav-fab {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-400));
  border: 4px solid #fff;
  box-shadow: 0 4px 16px rgba(16,185,129,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-top: -12px;
  transition: box-shadow var(--t), transform var(--t);
}
.cf-nav-fab:hover { box-shadow: var(--shadow-brand); transform: scale(1.05); }
.cf-nav-fab svg { width: 22px; height: 22px; stroke: var(--slate-900); fill: none; }

/* ─────────────────────────────────────────────────────────────
   14. CATÁLOGO HOMEPAGE
────────────────────────────────────────────────────────────── */
.cf-catalog-page { min-height: 100vh; background: var(--slate-50); }

.cf-catalog-toolbar {
  max-width: var(--max-w);
  margin-inline: auto;
  padding: 20px 24px 8px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.cf-catalog-title    { font-size: 1.15rem; font-weight: 800; color: var(--slate-900); }
.cf-catalog-subtitle { font-size: .82rem; color: var(--slate-500); margin-top: 2px; }

.cf-catalog-filter { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.cf-catalog-filter label { font-size: .82rem; font-weight: 600; color: var(--slate-500); white-space: nowrap; }
.cf-catalog-filter select {
  height: 36px;
  padding: 0 28px 0 12px;
  border: 1.5px solid var(--slate-300);
  border-radius: var(--r);
  background: var(--color-surface)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394a3b8'/%3E%3C/svg%3E")
    no-repeat right 10px center;
  font-family: var(--font-sans);
  font-size: .84rem;
  color: var(--slate-800);
  appearance: none;
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
  cursor: pointer;
}
.cf-catalog-filter select:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(16,185,129,.12); }

.cf-catalog-grid {
  max-width: var(--max-w);
  margin-inline: auto;
  padding: 16px 24px 80px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}

.cf-catalog-footer {
  max-width: var(--max-w);
  margin-inline: auto;
  padding: 16px 24px;
  border-top: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.cf-catalog-footer span { font-size: .78rem; color: var(--slate-400); }
.cf-catalog-footer img  { height: 22px; opacity: .6; }

/* ─────────────────────────────────────────────────────────────
   15. MENÚ
────────────────────────────────────────────────────────────── */
.cf-menu-page {
  min-height: 100vh;
  background: var(--slate-50);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 40px;
}
.cf-menu-logo {
  padding: 32px 0 16px;
  text-align: center;
}
.cf-menu-logo img { height: 48px; margin: 0 auto; }
.cf-menu-logo h2 { font-size: 1.05rem; font-weight: 800; color: var(--slate-800); margin-top: 10px; }
.cf-menu-grid {
  width: 100%;
  max-width: 680px;
  padding-inline: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.cf-menu-section {
  grid-column: 1 / -1;
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--slate-400);
  padding: 16px 0 8px;
  border-bottom: 1px solid var(--slate-200);
}

/* ─────────────────────────────────────────────────────────────
   16. COMPATIBILIDAD LEGADO
────────────────────────────────────────────────────────────── */
body { background: var(--color-bg) !important; }

/* #container — neutral por defecto; form-page lo convierte en panel */
#container {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
}

body.form-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--slate-50);
  padding-bottom: 32px;
}
body.form-page #container,
body.form-page #div1 {
  background: var(--color-surface) !important;
  border: 1px solid var(--color-border) !important;
  border-radius: var(--r-2xl) !important;
  box-shadow: var(--shadow-lg) !important;
  padding: 32px !important;
  width: min(440px, 94vw) !important;
  max-width: min(440px, 94vw) !important;
  margin: 28px auto !important;
}

/* Campos legado */
.cmps { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.etiq {
  min-width: 38%;
  font-size: .82rem;
  font-weight: 600;
  color: var(--slate-500) !important;
  text-align: right;
  background: none !important;
  white-space: nowrap;
  flex-shrink: 0;
}
.campo {
  flex: 1;
  height: 40px;
  padding: 0 12px;
  font-size: .88rem;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-surface);
  border: 1.5px solid var(--slate-300);
  border-radius: var(--r);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
  width: 100%;
}
.campo:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(16,185,129,.12); }

.btns, .btns2 {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

button, input[type="submit"], input[type="button"] {
  font-family: var(--font-sans);
  height: 40px;
  padding: 0 20px;
  font-size: .87rem;
  font-weight: 700;
  border-radius: var(--r);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all var(--t);
  background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
  color: var(--slate-900);
  box-shadow: 0 2px 8px rgba(16,185,129,.25);
}
button:hover { background: linear-gradient(135deg, var(--brand-700), var(--brand-600)); transform: translateY(-1px); box-shadow: var(--shadow-brand); }
button:active { transform: translateY(0) scale(.98); }

/* Catálogo .item legado */
.item {
  background: var(--color-surface) !important;
  border: 1px solid var(--slate-200) !important;
  border-radius: var(--r-xl) !important;
  box-shadow: var(--shadow-sm) !important;
  padding: 20px 14px 16px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  cursor: pointer !important;
  transition: all var(--t-md) !important;
  text-align: center !important;
  gap: 8px !important;
}
.item:hover { box-shadow: 0 8px 28px rgba(16,185,129,.16) !important; transform: translateY(-4px) !important; border-color: var(--brand-200) !important; }
.item a { color: var(--slate-800) !important; font-weight: 700 !important; }

.logo img, .img-logo { max-height: 52px; display: block; }
.logo { text-align: center; padding: 24px 0 12px; }

/* Blink → pulse */
.blink_me { animation: cf-pulse 2s ease-in-out infinite; color: var(--brand-600); font-weight: 600; }
@keyframes cf-pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

/* ─────────────────────────────────────────────────────────────
   17. SCROLLBAR
────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--slate-100); }
::-webkit-scrollbar-thumb { background: var(--slate-300); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--slate-400); }

/* ─────────────────────────────────────────────────────────────
   18. RESPONSIVE
────────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .cf-catalog-grid { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 12px; padding: 12px 16px 80px; }
  .cf-catalog-toolbar { padding-inline: 16px; }
  .cf-menu-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); padding-inline: 16px; }
  .cf-wrap { padding-inline: 16px; }
  body.form-page #container, body.form-page #div1 { padding: 24px 20px !important; }
}

@media (max-width: 560px) {
  .cf-catalog-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .cf-menu-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 380px) {
  .cf-catalog-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; padding-inline: 12px; }
  .cf-menu-grid { grid-template-columns: repeat(2, 1fr); }
}
