:root {
  /* Paleta clara con tab inferior ligeramente grisáceo */
  --brand: #0b7a48;             /* verde principal */
  --brand-700: #0a6b3f;         /* verde más oscuro */
  --brand-500: #0e9b5a;         /* verde medio */
  --brand-100: #e9f5ee;         /* blanco verdoso (para tabbar) */
  --text: #212529;              /* texto oscuro */
  --muted: #6c757d;             /* texto secundario */
  --bg: #fafafa;                /* fondo principal blanco */
  --card: #ffffff;              /* tarjetas también blancas */
  --border: #dee2e6;            /* bordes suaves */
  --chart-grid: rgba(0,0,0,.08);
  --chart-text: rgba(33,37,41,.9);
}

html, body {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body {
  background: var(--bg);
  margin: 0;
  padding-bottom: 80px;
  color: var(--text);
}

/* Auth gating: mientras no hay sesión, sólo mostrar Login */
#app[data-auth="unknown"] .mobile-tabbar,
#app[data-auth="out"] .mobile-tabbar {
  display: none !important;
}

#app[data-auth="unknown"] .screen:not(#screen-login),
#app[data-auth="out"] .screen:not(#screen-login) {
  display: none !important;
}

#app[data-auth="unknown"] #screen-login,
#app[data-auth="out"] #screen-login {
  display: block !important;
}

#desktop-blocker {
  display: none;
  position: fixed; inset: 0; z-index: 9999;
  background: #fff; color: var(--text);
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 24px; border: 0;
}
#desktop-blocker .card {
  border: 1px solid var(--border); border-radius: 1rem;
  padding: 24px 28px; max-width: 520px;
  background: #fff; color: var(--text);
  box-shadow: 0 10px 24px rgba(0,0,0,.06);
}
#desktop-blocker h1 { font-size: 1.25rem; margin-bottom: .5rem; }
#desktop-blocker p { margin: 0; color: var(--muted); }

/* --- Tabbar inferior (flotante, redondeada, blanco roto) --- */
.mobile-tabbar {
  position: fixed;
  /* antes estaba calc(12px + env(...)) */
  bottom: calc(22px + env(safe-area-inset-bottom)); /* ← sube un poco más */
  left: 50%;
  transform: translateX(-50%);
  height: auto;
  width: min(520px, calc(100% - 24px));
  background: #f7f7f7;
  border: 1px solid #e5e5e5;
  border-radius: 18px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
  padding: 8px;
  z-index: 1000;
}
.mobile-tabbar .container { padding: 0; }
.mobile-tabbar .d-flex { gap: 6px; }

.mobile-tabbar .tab-btn {
  flex: 1 1 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  height: 48px;
  text-decoration: none;
  color: var(--muted);
  background: transparent; /* pastilla sólo cuando está activo */
  border-radius: 12px;
  transition: background-color .2s ease, color .2s ease, transform .08s ease;
}
.mobile-tabbar .tab-btn:hover { background: #eef2f5; color: var(--text); }
.mobile-tabbar .tab-btn:active { transform: translateY(1px); }
.mobile-tabbar .tab-btn div, .mobile-tabbar .tab-btn i { line-height: 1; }

/* Mostrar la etiqueta SOLO en el activo */
.mobile-tabbar .tab-btn small { display: none; font-weight: 600; }
.mobile-tabbar .tab-btn.active small { display: block; color: #fff; }




/* Estado activo como pastilla */
.mobile-tabbar .tab-btn.active {
  background-color: var(--brand);
  color: #fff;
}

.app-header {
  position: sticky; top: 0; z-index: 100;
  background: #fff; border-bottom: 1px solid var(--border);
  color: var(--text);
}
.app-header .title { padding: 12px 0; }

.back-btn {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  text-decoration: none; color: var(--text); font-size: 22px;
  transition: opacity 0.2s ease, color .2s ease;
}
.back-btn:hover { opacity: 0.7; color: var(--brand); }

.chart-card {
  background: var(--card);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid var(--border);
}
.chart-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
  color: var(--text);
}
.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.chart-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.chart-nav-label {
  font-weight: 700;
  font-size: .95rem;
  color: var(--text);
  white-space: nowrap;
}
.chart-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #f1f5f3;
  color: var(--brand-700);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color .2s ease, color .2s ease, opacity .2s ease;
}
.chart-nav-btn:hover { background: #e7f0eb; color: var(--brand); }
.chart-nav-btn:active { transform: translateY(1px); }
.chart-nav-btn:disabled {
  opacity: .35;
  pointer-events: none;
}

.feature-card {
  background: var(--card);
  border-radius: 12px;
  padding: 20px 10px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid var(--border);
  cursor: pointer;
  height: 160px; /* Altura fija idéntica para todas */
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color .2s ease;
}
.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  border-color: var(--brand);
}
.feature-icon { font-size: 2.5rem; margin-bottom: 8px; color: var(--brand); }
.feature-label {
  font-size: 0.75rem;     /* antes 0.875rem → un poco más pequeño */
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.3px;  /* opcional: da un poco de aire al texto */
}

small, .muted { color: var(--muted); }

/* Sólo la pantalla .active debe mostrarse. */
.screen[aria-hidden="true"],
.screen[inert],
.screen:not(.active) { display: none !important; }
.screen.active { display: block !important; }



/* Por defecto: azul (mismo que el brand) */
.mobile-tabbar .tab-btn i,
.mobile-tabbar .tab-btn small {
  color: var(--brand);
  transition: color 0.2s ease;
}

/* Hover o pulsado (sin estar activo): azul más oscuro para feedback */
.mobile-tabbar .tab-btn:hover i,
.mobile-tabbar .tab-btn:hover small,
.mobile-tabbar .tab-btn:active i,
.mobile-tabbar .tab-btn:active small {
  color: var(--brand-700);
}

/* Activo (píldora azul): icono y texto blancos */
.mobile-tabbar .tab-btn.active i,
.mobile-tabbar .tab-btn.active small {
  color: #ffffff;
}


/* --- Cartas horizontales de entrenamiento --- */
.train-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #fafafa; /* blanco roto como las otras cards */
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 14px;
  min-height: 140px; /* igual altura que las diet-card */
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.train-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  background-color: #edf6f0;
  border-color: var(--brand);
}

.train-icon {
  font-size: 2rem;
  color: var(--brand);
}

.train-text {
  font-size: 1rem;
  font-weight: 700;
  color: #212529;
  text-align: center;
}
/* --- Estilo de iconos para días de rutina --- */
.day-card {
  display: flex;
  align-items: center;
  background: #fafafa;
  border: 1px solid #e5e5e5;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  height: 90px;
}

.day-card:hover {
  transform: translateY(-3px);
  background-color: #edf6f0;
  border-color: var(--brand);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.day-card.rest:hover {
  background-color: #f5f5f5;
  border-color: #ddd;
}

/* Iconos */
.day-icon {
  font-size: 1.8rem;
  margin-right: 16px;
  color: var(--brand);
}

.day-card.rest .day-icon {
  color: #9ca3af; /* gris más suave para descanso */
}

.day-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 4px;
}

.day-card.rest .day-title {
  color: #9ca3af;
}

.day-subtitle {
  font-size: 0.9rem;
  color: #212529;
}

.day-card.rest .day-subtitle {
  color: #6c757d;
}


/* ===== Explicación de ejercicios ===== */
.exercise-search input.form-control {
  height: 44px;
  border-radius: 12px;
  border: 1px solid #e5e5e5;
}

.exercise-list { display: grid; gap: 12px; }

/* Carta colapsada / expandida */
.exercise-card {
  background: #fafafa; /* blanco roto como las otras */
  border: 1px solid #e5e5e5;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  transition: box-shadow .2s ease, border-color .2s ease, transform .1s ease;
}
.exercise-card:focus-within,
.exercise-card:hover { box-shadow: 0 4px 10px rgba(0,0,0,0.08); border-color: var(--brand); }

/* Cabecera clickable */
.exercise-head {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
}
.exercise-icon { font-size: 1.25rem; color: var(--brand); }
.exercise-title { font-weight: 700; color: #212529; }
.exercise-meta { color: #6c757d; font-size: .875rem; }

/* Contenido expandido */
.exercise-body { display: none; padding: 0 16px 16px; }
.exercise-card[aria-expanded="true"] .exercise-body { display: block; }

/* Video responsive */
.exercise-video {
  position: relative; width: 100%; padding-top: 56.25%; border-radius: 12px; overflow: hidden; background: #000;
  margin-top: 10px; margin-bottom: 10px;
}
.exercise-video iframe, .exercise-video video {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}

/* Etiquetas */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag {
  font-size: .75rem; color: #1f2a37; background: #eef6ff; border: 1px solid #d6eafe; border-radius: 999px;
  padding: 4px 8px;
}

/* Botón accesible para expandir */
.exercise-toggle {
  border: 0; background: transparent; color: var(--brand); font-weight: 600;
}

/* --- Cabecera del Home centrada con texto + logo --- */
.home-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.home-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.home-left,
.home-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.home-title {
  flex: 1;
  text-align: center;
  letter-spacing: 0.04em;
}

.home-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-header .title {
  font-weight: 700;
  color: #000;
  font-size: 1.1rem;
}

.home-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e5e5e5;
  margin-left: 8px; /* separación del texto */
}


/* --- Mini EChart de progreso pasos --- */
.steps-chart {
  width: 100%;
  height: 60px;       /* alto compacto en la card */
  margin-top: 6px;
}

.steps-amount {
  font-size: 0.8rem;
  color: #6c757d;
  margin-top: 6px;
}

/* Opcional: icono algo más pequeño en esta card */
#home-steps-card .feature-icon { font-size: 2rem; }

/* ===== Rutina · Día 1 (tarjetas de ejercicio) ===== */
.workout-list { display: grid; gap: 12px; }

.workout-card {
  background: #fafafa;        /* blanco roto */
  border: 1px solid #e5e5e5;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  transition: box-shadow .2s ease, border-color .2s ease, transform .1s ease;
  padding: 12px;
}

.workout-card:hover { box-shadow: 0 4px 10px rgba(0,0,0,0.08); border-color: var(--brand); }

.workout-head {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: center;
}

.workout-thumb {
  width: 72px; height: 72px; border-radius: 12px; background: #e9eef5;
  object-fit: cover; display: block;
}

.workout-thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef6ff;
  border: 1px solid #d6eafe;
  color: var(--brand);
  font-weight: 900;
  letter-spacing: 0.02em;
}

.workout-thumb-fallback span {
  font-size: 1.35rem;
  line-height: 1;
}

.workout-info .workout-title {
  font-weight: 700; color: #111; margin: 0;
}
.workout-info .workout-meta {
  margin-top: 4px; font-size: .875rem; color: #6c757d;
}
.workout-info .workout-meta i { color: var(--brand); margin-right: 6px; }

.workout-rest {
  margin-top: 8px; font-size: .85rem; color: #1f2a37;
  background: #eef6ff; border: 1px solid #d6eafe; border-radius: 8px; padding: 6px 8px;
  display: inline-flex; align-items: center; gap: 6px;
}
.workout-rest i { color: var(--brand); }

.workout-inputs {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.workout-inputs .field {
  display: flex; flex-direction: column; gap: 4px;
}

.workout-inputs label {
  font-size: .75rem; color: #6c757d;
}

.workout-inputs .input-unit {
  position: relative;
}

.workout-inputs input[type="number"],
.workout-inputs input[type="text"] {
  width: 100%; height: 40px; border: 1px solid #e5e5e5; border-radius: 10px;
  padding: 0 12px; font-size: .95rem;
}

.input-unit .unit {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  color: #6c757d; font-size: .8rem; pointer-events: none;
}

/* Compacto en pantallas estrechas */
@media (max-width: 380px) {
  .workout-inputs { grid-template-columns: 1fr 1fr; }
}

/* === Series (rutina): cabecera con chips + inputs === */
.set-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  background: #fff;
  border: 1px solid #eaeaea;
  border-radius: 10px;
  padding: 18px 12px 12px;
}

.set-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.set-badge {
  font-size: .68rem;
  font-weight: 800;
  color: #1f2a37;
  background: #eef6ff;
  border: 1px solid #d6eafe;
  border-radius: 999px;
  padding: 3px 8px;
}

.set-chips {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  align-items: center;
  min-width: 0;
}

.set-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  color: #111827;
  font-size: .68rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

/* Chips por tipo */
.set-chip-desc,
.set-chip-tempo {
  background: rgba(11, 122, 72, 0.10);
  border-color: rgba(11, 122, 72, 0.24);
  color: #0b5d3a;
}

.set-chip-rir { font-weight: 800; }
.set-chip-rir-85 {
  background: rgba(234, 179, 8, 0.22);
  border-color: rgba(234, 179, 8, 0.42);
  color: #92400e;
}
.set-chip-rir-95 {
  background: rgba(249, 115, 22, 0.22);
  border-color: rgba(249, 115, 22, 0.42);
  color: #9a3412;
}
.set-chip-rir-100 {
  background: rgba(239, 68, 68, 0.20);
  border-color: rgba(239, 68, 68, 0.42);
  color: #991b1b;
}

/* Inputs y labels (ya definidos; repetimos por claridad) */
.set-col { display: flex; flex-direction: column; gap: 4px; }
.set-col label { font-size: .75rem; color: #6c757d; }
.set-col input[type="number"], .set-col input[type="text"] {
  width: 100%; height: 40px; border: 1px solid #e5e5e5; border-radius: 10px;
  padding: 0 12px; font-size: .95rem;
}

@media (min-width: 420px){
  .set-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.set-col input:disabled {
  background: #f3f4f6;
  color: #111827;
  opacity: 1;
}


/* ===== Toast global ===== */
.app-toast {
  position: fixed;
  left: 50%;
  bottom: calc(90px + env(safe-area-inset-bottom)); /* por encima de tu tab flotante */
  transform: translateX(-50%) translateY(10px);
  background: #0b1220;        /* fondo oscuro */
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 8px 30px rgba(0,0,0,.18);
  font-size: 0.95rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  z-index: 2000;
  transition: opacity .25s ease, transform .25s ease;
}
.app-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.app-toast i { margin-right: 8px; }

/* --- Compat: mantener padding coherente --- */
.set-row{
  padding: 18px 12px 12px !important;
}

/* --- FIX: que el 'kg' no se salga del input --- */
.set-col .input-unit{
  position: relative;        /* asegura contenedor de posicionamiento */
  display: block;
}

.set-col .input-unit input{
  width: 100%;
  padding-right: 38px !important; /* deja espacio para el 'kg' dentro del campo */
  box-sizing: border-box;
}

.set-col .input-unit .unit{
  position: absolute;
  right: 10px;               /* dentro del input */
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  color: #6c757d;
  pointer-events: none;
}

/* Si el layout pasa a 2 columnas en pantallas muy estrechas, evita que el 'kg' se solape */
@media (max-width: 380px){
  .set-row{ padding-top: 18px !important; }
}

/* ===== Botón guardar día ===== */
.save-bar {
  margin-top: 20px;
  display: flex;
  justify-content: center; /* centra el botón horizontalmente */
  margin-bottom: 50px;
}

.btn-save-all {
  width: 80%;                  /* 80% del contenedor */
  max-width: 400px;            /* opcional: evita que crezca mucho en pantallas grandes */
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  transition: transform .06s ease, filter .15s ease;

}

.btn-save-all:active {
  transform: translateY(1px);
}

.btn-save-all:hover {
  filter: brightness(1.05);
}

/* === Pantalla DIETA === */
.diet-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 16px;
}

.diet-card {
  background: #fafafa;
  border: 1px solid #e5e5e5;
  border-radius: 16px;
  height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.diet-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.diet-icon {
  font-size: 2rem;
  color: var(--brand);
  margin-bottom: 10px;
}

.diet-title {
  font-weight: 600;
  font-size: 1rem;
  color: #111;
}

/* Si estás en pantallas más grandes, que se vean 3 en una fila */
@media (min-width: 768px) {
  .diet-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

/* === Mi Dieta · días + comidas expandibles === */
.diet-days {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.diet-day-card {
  background: #fafafa;
  border: 1px solid #e5e5e5;
  border-radius: 14px;
  padding: 20px 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.diet-day-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  border-color: var(--brand);
  background-color: #edf6f0;
}

.diet-day-card.rest {
  border-style: dashed;
  border-color: #d1d5db;
  background-color: #f9fafb;
}

.diet-day-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.diet-day-icon {
  font-size: 1.8rem;
  color: var(--brand);
  flex-shrink: 0;
}

.diet-day-card.rest .diet-day-icon {
  color: #9ca3af;
}

.diet-day-info {
  flex: 1;
}

.diet-day-title {
  font-weight: 700;
  font-size: 1rem;
  color: #111827;
}

.diet-day-subtitle {
  font-size: 0.85rem;
  color: #6b7280;
}

.diet-day-toggle {
  border: 0;
  background: transparent;
  color: #9ca3af;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* cuerpo expandible */
.diet-day-body {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e5e5e5;
}

/* listado de comidas */
.diet-meals {
  display: grid;
  gap: 8px;
}

.diet-meal-row {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #e5e5e5;
  padding: 8px 10px;
}

.diet-meal-row.done {
  opacity: 0.6;
}

.diet-meal-main {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.diet-meal-main input {
  margin-top: 3px;
}

.diet-meal-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.diet-meal-meta {
  margin-top: 2px;
  display: flex;
  gap: 10px;
  font-size: 0.8rem;
  color: #6b7280;
}

.diet-meal-meta i {
  margin-right: 4px;
}

.diet-meal-notes {
  margin-top: 6px;
  font-size: 0.8rem;
  color: #4b5563;
}

/* caja de día de descanso */
.diet-rest-box {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 10px;
  background: #f9fafb;
  border: 1px dashed #d1d5db;
}

.diet-rest-box i {
  font-size: 1.6rem;
  color: #9ca3af;
}

.diet-rest-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.diet-rest-text {
  font-size: 0.8rem;
  color: #6b7280;
}

/* Lista de alimentos dentro de cada comida */
.diet-food-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: grid;
  gap: 2px;
  font-size: 0.8rem;
  color: #4b5563;
}

.diet-food-item {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.diet-food-name {
  font-weight: 500;
}

.diet-food-amount {
  color: #6b7280;
}

.diet-food-kcal {
  font-variant-numeric: tabular-nums;
}
/* ==== Alimentos dentro de cada comida ==== */
.diet-food-item {
  display: grid;
  grid-template-columns: 1fr 1fr 60px; /* nombre | cantidad | kcal */
  align-items: center;                 /* centra verticalmente */
  gap: 4px 8px;
  padding: 2px 0;
}

.diet-food-name {
  font-weight: 500;
  text-align: left;
}

.diet-food-amount {
  text-align: left;        /* 👈 cantidad alineada a la izquierda */
  color: #6b7280;
}

.diet-food-kcal {
  text-align: right;       /* kcal alineado a la derecha */
  font-variant-numeric: tabular-nums;
}

/* === Lista de la compra === */
.shopping-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.shopping-item {
  background: #fafafa;
  border: 1px solid #e5e5e5;
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  transition: background-color .15s ease, opacity .15s ease, border-color .15s ease;
}

.shopping-item.checked {
  background: #eef6ff;
  border-color: var(--brand);
  opacity: .7;
}

.shopping-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.shopping-name {
  font-weight: 600;
  font-size: .95rem;
  color: #111827;
}

.shopping-amount {
  font-size: .85rem;
  color: #6b7280;
}

.shopping-check-btn {
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  color: #9ca3af;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.shopping-item.checked .shopping-check-btn {
  color: var(--brand);
}

.shopping-check-btn:active {
  transform: translateY(1px);
}

/* === Acciones de lista de compra === */
.shopping-actions {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-shopping-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  border: 0;
  font-weight: 600;
  font-size: 0.95rem;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: transform 0.1s ease, filter 0.15s ease;
}

.btn-shopping-action.secondary {
  background: #e5e7eb;
  color: #111;
}

.btn-shopping-action:active {
  transform: translateY(1px);
}

.btn-shopping-action:hover {
  filter: brightness(1.05);
}

/* === Convalidación de alimentos === */
.conv-card {
  background: #fafafa;
  border: 1px solid #e5e5e5;
  border-radius: 16px;
  padding: 16px 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.conv-section-label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: #111827;
}

/* grid de alimentos base */
.conv-food-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.conv-food-card {
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 10px 8px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease, transform .07s ease;
}

.conv-food-card.active {
  border-color: var(--brand);
  background: #eef6ff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.conv-food-card:active {
  transform: translateY(1px);
}

.conv-food-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  color: var(--brand);
}

.conv-food-name {
  font-size: 0.85rem;
  text-align: center;
}

.conv-food-tag {
  margin-top: 2px;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 999px;
  background: #dcfce7;
  color: #0b7a48;
}

/* input gramos */
.conv-input-row .input-unit {
  position: relative;
}

.conv-input-row .input-unit .unit {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  color: #6b7280;
  pointer-events: none;
}

/* resultados */
.conv-results-intro {
  font-size: 0.85rem;
  color: #4b5563;
  margin-bottom: 8px;
}

.conv-results-list {
  display: grid;
  gap: 8px;
}

.conv-result-item {
  border-radius: 12px;
  border: 1px solid #e5e5e5;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  transition: background-color .15s ease, border-color .15s ease, opacity .15s ease;
}

.conv-result-item.checked {
  background: #eef6ff;
  border-color: var(--brand);
  opacity: 0.8;
}

.conv-result-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.conv-result-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.conv-result-amount {
  font-size: 0.8rem;
  color: #4b5563;
}

.conv-result-factor {
  font-size: 0.75rem;
  color: #6b7280;
  margin-left: 4px;
}

.conv-result-check {
  border: 0;
  background: transparent;
  font-size: 1.3rem;
  color: #9ca3af;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.conv-result-item.checked .conv-result-check {
  color: var(--brand);
}

.conv-result-check:active {
  transform: translateY(1px);
}

@media (min-width: 768px) {
  .conv-food-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* === Ranking === */
.ranking-podium {
  display: flex;
  justify-content: center;
  align-items: flex-start;  /* 👈 ahora se alinean por arriba */
  gap: 16px;
  margin-top: 0;
  margin-bottom: 16px;
}

.podium-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  
}

/* alturas distintas para 1º 2º 3º */



.podium-first .podium-flag{
  position: relative;
  height: 250px;
  width: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 10px 6px 18px;
  z-index: 10;
  background: linear-gradient(
    90deg,
    #b8860b 0%,
    #caa92b 25%,
    #fff5b0 50%,   /* reflejo brillante central */
    #caa92b 75%,
    #b8860b 100%
  );
  background-size: 200% 100%;
  background-position: 50% 0;
  animation: brilloOscilante 3s ease-in-out infinite alternate;
}

.podium-triangle1 {
  width: 71px;
  height: 71px;
  rotate: 45deg;
  position: relative;
  top: -35px;
  left: 14.8px;
   background: linear-gradient(
    45deg,
    #b8860b 0%,
    #caa92b 25%,
    #fff5b0 50%,   /* reflejo brillante central */
    #caa92b 75%,
    #b8860b 100%
  );
  background-size: 200% 130%;
  background-position: 50% 50%;
  animation: brilloOscilante2 3s ease-in-out infinite alternate;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.podium-second .podium-flag{
  position: relative;
  width: 100px;
  height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 10px 6px 18px;
  z-index: 10;
  background: linear-gradient(
    90deg,
    #7d7d7d 0%,
    #bfbfbf 25%,
    #f2f2f2 50%,   /* brillo */
    #bfbfbf 75%,
    #7d7d7d 100%
  );
  background-size: 200% 100%;
  background-position: 50% 0;
  animation: brilloOscilante 3s ease-in-out infinite alternate;
}

.podium-triangle2{
  width: 70px;
  height: 70px;
  rotate: 45deg;
  position: relative;
  top: -35px;
  left: 15px;
   background: linear-gradient(
    45deg,
    #7d7d7d 0%,
    #bfbfbf 25%,
    #f2f2f2 50%,   /* brillo */
    #bfbfbf 75%,
    #7d7d7d 100%
  );
  background-size: 200% 130%;
  background-position: 50% 50%;
  animation: brilloOscilante2 3s ease-in-out infinite alternate;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.podium-third .podium-flag{
  position: relative;
  width: 100px;
  height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 10px 6px 18px;
  z-index: 10;
  background: linear-gradient(
    90deg,
  #7b3f00 0%,
  #b87333 25%,
  #ffd2a1 50%,   /* brillo cálido */
  #b87333 75%,
  #7b3f00 100%
  );
  background-size: 200% 100%;
  background-position: 50% 0;
  animation: brilloOscilante 3s ease-in-out infinite alternate;
}

.podium-triangle3{
  width: 70px;
  height: 70px;
  rotate: 45deg;
  position: relative;
  top: -35px;
  left: 15px;
   background: linear-gradient(
    45deg,
  #7b3f00 0%,
  #b87333 25%,
  #ffd2a1 50%,   /* brillo cálido */
  #b87333 75%,
  #7b3f00 100%
  );
  background-size: 200% 130%;
  background-position: 50% 50%;
  animation: brilloOscilante2 3s ease-in-out infinite alternate;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

@keyframes brilloOscilante2 {
  0%   { background-position: 45% 50%; }
  50%  { background-position: 55% 50%; }
  100% { background-position: 45% 50%; }
}

@keyframes brilloOscilante {
  0%   { background-position: 45% 0%; }
  50%  { background-position: 55% 0%; }
  100% { background-position: 45% 0%; }
}


.podium-rank {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--brand);
}

.podium-avatar {
  width: 70px;
  height: 70px;
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid #ffffff;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  font-weight: 800;
}

.podium-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.podium-avatar.fallback span {
  font-size: 1.4rem;
  line-height: 1;
}

.podium-name {
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

/* Lista de ranking */
.ranking-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #e5e5e5;
  background: #ffffff;
}

.ranking-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #e5e5e5;
}

.ranking-row:last-child {
  border-bottom: none;
}

.ranking-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.ranking-position {
  width: 22px;
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: #6b7280;
}

.ranking-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  overflow: hidden;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--brand);
}

.ranking-avatar .avatar-initial,
.ranking-avatar.fallback span {
  font-size: 1.2rem;
  line-height: 1;
}

.ranking-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ranking-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.ranking-level {
  font-size: 0.8rem;
  color: #6b7280;
}

/* cambio de ranking */
.ranking-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
}

.ranking-change.up {
  color: #16a34a; /* verde */
}

.ranking-change.down {
  color: #dc2626; /* rojo */
}

.ranking-change i {
  font-size: 0.9rem;
}

.ranking-change.same {
  color: #6b7280; /* gris cuando no cambia */
}

.margin0{
  padding-top: 0 !important;
}

/* === Caja usuario actual en ranking === */
.ranking-current-wrapper {
  margin-top: 8px;
  margin-bottom: 16px;
}

.ranking-current-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
  border: 1px solid #e5e5e5;
}

.ranking-current-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.ranking-current-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ranking-avatar.big {
  width: 44px;
  height: 44px;
}

.ranking-avatar.big img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ranking-position-text {
  font-size: 0.8rem;
  color: #6b7280;
}

.ranking-current-grade {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef2ff;
  color: var(--brand);
}

/* barra de progreso */
.ranking-progress-wrapper {
  margin-top: 4px;
}

.ranking-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #6b7280;
  margin-bottom: 4px;
}

.ranking-progress-label span {
  font-variant-numeric: tabular-nums;
}

.ranking-progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.ranking-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #60a5fa);
  transition: width 0.3s ease-out;
}

.podium-name {
  margin-top: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #111827;
  text-align: center;
}

.podium-rank-text {
  font-size: 0.8rem;
  color: #6b7280;
  text-align: center;
  margin-top: 2px;
}
/* === Pantalla Usuario === */
.user-profile-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 16px 14px 18px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
  border: 1px solid #e5e5e5;
  text-align: center;
  margin-bottom: 16px;
}

.user-avatar-large {
  width: 90px;
  height: 90px;
  margin: 0 auto 8px;
  border-radius: 999px;
  overflow: hidden;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.18);
}

.user-avatar-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Modal datos diarios */
.missing-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}
.missing-dialog {
  background: #fff;
  border-radius: 16px;
  padding: 20px 18px;
  width: min(420px, 92%);
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}
.missing-icon-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
}
.missing-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
}
.missing-icon.steps { background: #0b7a48; }
.missing-icon.weight { background: #10b981; }
.missing-title {
  text-align: center;
  font-weight: 800;
  margin: 0;
}
.missing-subtitle {
  text-align: center;
  color: #6b7280;
  margin: 4px 0 12px;
}
.missing-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}
.missing-field label { font-weight: 600; color: #374151; }
.missing-field input {
  width: 100%;
  height: 44px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 0 12px;
  font-size: 1rem;
}
.missing-error {
  min-height: 20px;
  color: #b91c1c;
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
}

.user-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.user-level-text {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 10px;
}

/* progreso nivel */
.user-progress-wrapper {
  margin-top: 4px;
}

.user-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #6b7280;
  margin-bottom: 4px;
}

.user-progress-label span {
  font-variant-numeric: tabular-nums;
}

.user-progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.user-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #60a5fa);
  transition: width 0.3s ease-out;
}

/* grid 2x2 de acciones */
.user-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.user-action-card {
  border-radius: 16px;
  border: 1px solid #e5e5e5;
  background: #ffffff;
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #111827;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.12s ease, border-color 0.12s ease, background-color 0.12s ease;
}

.user-action-card i {
  font-size: 1.4rem;
  color: var(--brand);
}

.user-action-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
  border-color: var(--brand);
}

.user-action-card:active {
  transform: translateY(1px);
}

.user-action-card.danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.user-action-card.danger i {
  color: #b91c1c;
}

/* === Desafios === */
.challenge-list {
  display: grid;
  gap: 12px;
}

.challenge-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.challenge-top {
  display: flex;
  gap: 12px;
}

.challenge-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #e5f3ea;
  border: 1px solid #c8e7d4;
  display: grid;
  place-items: center;
  font-size: 22px;
  flex-shrink: 0;
}

.challenge-headings {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.challenge-title-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.challenge-title {
  font-weight: 800;
  font-size: 1rem;
  color: #0f172a;
  margin: 0 0 2px;
}

.challenge-desc {
  font-size: 0.9rem;
  color: #6b7280;
  margin: 0;
}

.challenge-status {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  color: #6b7280;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.challenge-status.approved {
  background: #ecfdf3;
  border-color: #bbf7d0;
  color: #166534;
}
.challenge-status.pending {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
}

.challenge-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  color: #4b5563;
}

.challenge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  font-weight: 600;
  color: #0f172a;
}

.challenge-pill .muted {
  color: #6b7280;
  font-weight: 500;
}

.challenge-actions {
  margin-top: 12px;
  text-align: center;
}

.challenge-actions .btn {
  border-radius: 999px;
  padding: 8px 14px;
}

.swipe-track {
  position: relative;
  width: min(360px, 100%);
  margin: 0 auto;
  height: 72px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 0 10px;
  user-select: none;
}

.swipe-handle {
  position: absolute;
  left: 2.5px;
  top: 2.5px;
  width: 65px;
  height: 65px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0e9b5a, #0b7a48);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
  transition: transform 0.2s ease;
}

.swipe-text {
  flex: 1;
  text-align: center;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.2px;
}

.swipe-track.completed .swipe-text {
  color: #16a34a;
}

/* Toggle filtros desafíos */
.desafio-filter-group {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 0 auto;
  padding: 6px 0;
  width: auto;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.desafio-filter {
  border: 0;
  background: transparent;
  padding: 10px 16px;
  font-weight: 800;
  color: #4b5563;
  transition: background 0.15s ease, color 0.15s ease;
  border-radius: 999px;
  min-width: 110px;
}
.desafio-filter + .desafio-filter {
  border-left: 0;
}
.desafio-filter.active {
  background: var(--brand);
  color: #fff;
  border-radius: 999px;
}

/* Override filtros desafíos: botones sueltos sin separadores */
.desafio-filter-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  margin: 0 auto;
}
.desafio-filter {
  border: 0;
  background: transparent;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 800;
  color: #4b5563;
  transition: background 0.15s ease, color 0.15s ease;
  min-width: 110px;
}
.desafio-filter + .desafio-filter {
  border-left: 0 !important;
}
.desafio-filter.active {
  background: var(--brand);
  color: #fff;
}



/* === Notificaciones Home === */
.home-header {
  position: relative;
}

.home-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notif-btn {
  position: relative;
  border: 0;
  background: transparent;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #4b5563;
  cursor: pointer;
}

.notif-btn i {
  transition: transform 0.1s ease;
}

.notif-btn:active i {
  transform: scale(0.9);
}

.notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* cajita desplegable */
.notif-panel {
  position: absolute;
  right: 14px;
  top: 100%;
  margin-top: 8px;
  width: 280px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
  border: 1px solid #e5e7eb;
  z-index: 80;
}

.notif-panel-header {
  padding: 8px 10px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 600;
}

.notif-clear-btn {
  border: 0;
  background: transparent;
  font-size: 0.8rem;
  color: #6b7280;
  cursor: pointer;
}

.notif-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  max-height: 260px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.85rem;
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notif-icon i {
  font-size: 1rem;
  color: #ffffff;
}

.notif-content {
  flex: 1;
  min-width: 0;
}

.notif-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.notif-meta {
  font-size: 0.75rem;
  color: #6b7280;
}

/* colores por tipo */
.notif-type-dieta .notif-icon {
  background: #22c55e;
}

.notif-type-entreno .notif-icon {
  background: #0b7a48;
}

.notif-type-desafio .notif-icon {
  background: #f97316;
}

.notif-type-rutina .notif-icon {
  background: #0b7a48;
}
/* === Avatar pequeño en el header del Home === */
.home-avatar {
  width: 36px;
  height: 36px;
  display: inline-block;
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.home-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

.home-user-menu {
  position: relative;
  display: flex;
  align-items: center;
}

.home-avatar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 999px;
}

.home-avatar-btn:focus-visible {
  outline: 2px solid rgba(17, 0, 95, .45);
  outline-offset: 3px;
}

.user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 190px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(0,0,0,.12);
  padding: 8px;
  z-index: 1200;
}

.user-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  border-radius: 12px;
  color: var(--text);
  font-weight: 600;
}

.user-menu-item:hover {
  background: rgba(17, 0, 95, .06);
}

.user-menu-item.danger {
  color: #b91c1c;
}

.user-menu-item.danger:hover {
  background: rgba(185, 28, 28, .08);
}

/* ===== Login ===== */
.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 18px;
  box-shadow: 0 10px 24px rgba(0,0,0,.06);
  max-width: 420px;
  margin: 0 auto;
}

.login-brand {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.login-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.login-title {
  font-weight: 800;
  color: var(--text);
}

.login-subtitle {
  font-size: .875rem;
  color: var(--muted);
  text-align: center;
}

.login-error {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, .35);
  background: rgba(239, 68, 68, .08);
  color: #991b1b;
  font-size: .875rem;
}

.login-submit {
  border-radius: 12px;
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.login-submit:hover,
.login-submit:focus {
  background: var(--brand-700);
  border-color: var(--brand-700);
  box-shadow: none;
}
.login-submit:active {
  background: var(--brand-700);
  border-color: var(--brand-700);
}

.login-submit.btn-primary,
.login-submit.btn-primary:focus,
.login-submit.btn-primary:active,
.login-submit.btn-primary:focus-visible,
.login-submit.btn-primary:hover {
  background: var(--brand-700) !important;
  border-color: var(--brand-700) !important;
  color: #fff !important;
  box-shadow: none !important;
}

.login-submit:disabled {
  opacity: .7;
}


