body {
  font-family: -apple-system, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  background: #0f1720;
  color: #e8edf2;
}
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}
.login-box {
  background: #182533;
  padding: 40px;
  border-radius: 16px;
  text-align: center;
  width: 300px;
}
.login-box h1 { margin: 0 0 4px; font-size: 28px; }
.subtitle { color: #8fa3b8; margin-bottom: 24px; }
.login-box input {
  width: 100%;
  padding: 10px;
  margin-bottom: 12px;
  border-radius: 8px;
  border: 1px solid #2a3b4d;
  background: #0f1720;
  color: #e8edf2;
  box-sizing: border-box;
}
.login-box button {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: none;
  background: #ff6b35;
  color: white;
  font-weight: bold;
  cursor: pointer;
}
.error { color: #ff6b6b; }

/* ---- Layout general ---- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: #182533;
  border-bottom: 1px solid #24344a;
}
.topbar a {
  color: #e8edf2;
  text-decoration: none;
  margin-left: 20px;
  font-weight: 600;
}
.topbar a.active { color: #ff6b35; }
.logo { font-size: 20px; font-weight: bold; }
.container { max-width: 900px; margin: 0 auto; padding: 24px; }

/* ---- Cards ---- */
.card {
  background: #182533;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 18px;
}
.card h2 { margin-top: 0; font-size: 18px; color: #ff6b35; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ---- Rachas / stats ---- */
.stat-box {
  text-align: center;
  background: #0f1720;
  border-radius: 12px;
  padding: 16px;
}
.stat-box .num { font-size: 32px; font-weight: bold; color: #ff6b35; }
.stat-box .label { color: #8fa3b8; font-size: 13px; }

.alerta {
  background: #3d1f1f;
  border: 1px solid #a33;
  border-radius: 10px;
  padding: 12px;
  color: #ffb3b3;
  margin-bottom: 16px;
}

/* ---- Lists ---- */
.opcion-lista { list-style: none; padding: 0; }
.opcion-lista li {
  background: #0f1720;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.opcion-lista button {
  background: #24344a;
  border: none;
  color: #e8edf2;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.opcion-lista button:hover { background: #ff6b35; }
.cumplido-tag { color: #6ee7a0; font-weight: bold; }

.progress-bar-bg {
  background: #0f1720;
  border-radius: 20px;
  height: 20px;
  overflow: hidden;
  margin: 8px 0;
}
.progress-bar-fill {
  background: linear-gradient(90deg, #ff6b35, #ffab6b);
  height: 100%;
  transition: width 0.3s;
}

input, select, textarea {
  background: #0f1720;
  border: 1px solid #2a3b4d;
  color: #e8edf2;
  padding: 8px;
  border-radius: 8px;
  box-sizing: border-box;
}
button.primary {
  background: #ff6b35;
  border: none;
  color: white;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 8px;
}
.ejercicio-item {
  background: #0f1720;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}
.ejercicio-item label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.ejercicio-item .nota { color: #8fa3b8; font-size: 13px; margin-top: 4px; margin-left: 30px; }

/* ---- Recetas expandibles ---- */
.receta-item { flex-direction: column; align-items: stretch !important; }
.receta-cabecera {
  display: flex; justify-content: space-between; align-items: center; cursor: pointer;
}
.ver-receta { color: #8fa3b8; font-size: 12px; white-space: nowrap; }
.alergenos-tag { color: #d99a5b; font-size: 11px; margin-left: 8px; }
.receta-detalle {
  margin-top: 10px; padding-top: 10px; border-top: 1px solid #24344a;
  color: #c3d0dc; font-size: 14px; line-height: 1.5;
}
.receta-detalle p { margin: 6px 0; }

/* ---- Logros / insignias ---- */
.logros-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px; }
.logro {
  text-align: center; padding: 10px 4px; border-radius: 12px; background: #0f1720;
  opacity: 0.35; filter: grayscale(1);
}
.logro.conseguido { opacity: 1; filter: none; background: linear-gradient(160deg, #24344a, #182533); }
.logro .icono { font-size: 26px; }
.logro .nombre { font-size: 11px; color: #c3d0dc; margin-top: 4px; }

/* ---- Responsive móvil ---- */
@media (max-width: 640px) {
  .container { padding: 14px; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 16px; }
  .topbar a { margin-left: 0; margin-right: 16px; }
  .receta-cabecera { flex-direction: column; align-items: flex-start; gap: 8px; }
  .card { padding: 16px; }
  table { font-size: 13px; }
}
