/* =========================================================================
   style.css — tema oscuro estilo gimnasio, responsive mobile-first
========================================================================= */

:root {
  --bg: #0e0f12;
  --bg-alt: #15171c;
  --card: #1b1e25;
  --card-border: #2a2e37;
  --text: #e9eaed;
  --text-muted: #9aa0ab;
  --accent: #b3413c;
  --accent-hover: #96322e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent); }

.topbar {
  background: #000;
  color: white;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--card-border);
}

.brand {
  color: white;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.03em;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
}

.nav a, .nav .link-button {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.nav a:hover, .nav .link-button:hover { color: var(--accent); }

.logout-form { display: inline; }

.link-button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.25rem 1rem;
}

.container-full {
  max-width: none;
  margin: 0;
  padding: 0;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.92rem;
  border: 1px solid transparent;
}
.alert-success { background: #16321f; color: #7fd99a; border-color: #234d2d; }
.alert-error { background: #3a1a1a; color: #f3948c; border-color: #542424; }

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.stat { text-align: center; }
.stat .num { font-size: 2rem; font-weight: 700; color: var(--accent); }
.stat .label { color: var(--text-muted); font-size: 0.88rem; }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  overflow: hidden;
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}
th, td {
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--card-border);
  font-size: 0.9rem;
}
th { background: var(--bg-alt); color: var(--text-muted); font-weight: 600; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.65rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
}
.btn:hover { background: var(--accent-hover); color: white; }

.btn-secondary { background: #343943; }
.btn-secondary:hover { background: #40465280; }

.btn-danger { background: #7a2a2a; }
.btn-danger:hover { background: #942f2f; }

.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.85rem; }

.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.actions form { display: inline; }

.form-group { margin-bottom: 1rem; }
label { display: block; margin-bottom: 0.35rem; font-weight: 600; font-size: 0.88rem; color: var(--text-muted); }

input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;
  background: var(--bg-alt);
  border: 1px solid var(--card-border);
  color: var(--text);
  border-radius: 8px;
  font-size: 0.95rem;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

/* ---------- Login (pantalla completa) ---------- */
.login-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background-image: linear-gradient(rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.45)), url('/images/iniciologin.jpg');
  background-size: cover;
  background-position: center;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: rgba(20, 22, 27, 0.88);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 2rem 1.75rem;
  backdrop-filter: blur(6px);
}

.login-logo { text-align: center; margin-bottom: 1.75rem; }
.login-logo-icon { font-size: 2.5rem; }
.login-logo h1 { margin: 0.4rem 0 0.2rem; letter-spacing: 0.08em; font-size: 1.5rem; }
.login-tagline { color: var(--text-muted); font-size: 0.85rem; margin: 0; }

.btn-login { width: 100%; padding: 0.8rem; font-size: 1rem; margin-top: 0.25rem; }

/* ---------- Rutinas / slots ---------- */
.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.slot-card { text-align: center; padding: 1.5rem 1rem; }
.slot-card.tiene-contenido { border-color: var(--accent); }
.slot-card .badge {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.78rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--bg-alt);
  color: var(--text-muted);
}
.slot-card.tiene-contenido .badge { background: #3a1f1e; color: #e0a29d; }

.exercise-row { border-bottom: 1px solid var(--card-border); padding: 0.75rem 0; }
.exercise-row:last-child { border-bottom: none; }

.muted { color: var(--text-muted); font-size: 0.88rem; }

/* Responsive: en celular, menos padding y stats mas chicos */
@media (max-width: 480px) {
  .container { padding: 1rem 0.85rem; }
  .topbar { padding: 0.7rem 1rem; }
  .stat .num { font-size: 1.6rem; }
  .login-card { padding: 1.5rem 1.25rem; }
}

.login-brand {
  text-align: center;
  margin-bottom: 2rem;
}

.login-title {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
  margin: 0;
}

.login-tagline {
  font-size: 0.95rem;
  color: #9a9a9a;
  margin-top: 0.4rem;
  font-style: italic;
}

.navbar-brand {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
}

/* =========================================================
   NIVEL PRO — tipografía, transiciones y efectos globales
   ========================================================= */

body {
  font-family: 'Poppins', -apple-system, sans-serif;
  animation: fadeInPage 0.5s ease;
}

   h1, h2, h3, .navbar-brand, .brand, .btn {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
}

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

/* Transición suave para casi todo lo interactivo */
a, button, .btn, .card, input, select, textarea, .badge {
  transition: all 0.25s ease;
}

/* --- Navbar con vidrio esmerilado y borde con brillo --- */
   nav, .navbar, .topbar {
  backdrop-filter: blur(10px);
  background: rgba(20, 21, 26, 0.85);
  border-bottom: 1px solid rgba(179, 65, 60, 0.25);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
   z-index: 100;
}

   nav a, .navbar a, .topbar a {
  position: relative;
}

   nav a::after, .navbar a::after, .topbar a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0%;
  height: 2px;
  background: var(--accent, #b3413c);
  transition: width 0.25s ease;
}

   nav a:hover::after, .navbar a:hover::after, .topbar a:hover::after {
  width: 100%;
}

/* --- Tarjetas con efecto "levantado" al pasar el mouse --- */
.card {
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
  border-color: rgba(179, 65, 60, 0.35);
}

/* --- Botones con más presencia --- */
.btn {
  border: none;
  cursor: pointer;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 12px rgba(179, 65, 60, 0.25);
}

.btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 20px rgba(179, 65, 60, 0.4);
  filter: brightness(1.1);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

/* --- Tablas con filas resaltadas al pasar el mouse --- */
table tr {
  transition: background 0.2s ease;
}

table tbody tr:hover {
  background: rgba(179, 65, 60, 0.08);
}

/* --- Badges con más vida --- */
.badge {
  border-radius: 20px;
  padding: 0.3rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* --- Scrollbar a juego con el tema oscuro --- */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg, #0e0f12);
}
::-webkit-scrollbar-thumb {
  background: rgba(179, 65, 60, 0.5);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(179, 65, 60, 0.8);
}

/* --- Preparación para las tarjetas de estadísticas
       del dashboard (las usamos en el próximo paso) --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: linear-gradient(145deg, var(--card, #1b1e25), rgba(255,255,255,0.02));
  border-radius: 14px;
  padding: 1.4rem;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.06);
}

.stat-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent, #b3413c);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.85rem;
  color: #9a9a9a;
  margin-top: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- Menú hamburguesa --- */
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 26px;
  height: 3px;
  background: #fff;
  border-radius: 3px;
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 768px) {
     .navbar, .topbar {
     display: flex;
     justify-content: space-between;
     align-items: center;
     position: relative;
   }

  .hamburger {
    display: flex;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    background: rgba(20, 21, 26, 0.98);
    position: absolute;
    top: 100%;
    left: 0;
    padding: 1rem 1.5rem;
    gap: 0.9rem;
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
    z-index: 1000;
  }

  .nav-links.open {
    display: flex;
  }
}

/* --- Links del menú, versión profesional --- */
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  border-left: 3px solid transparent;
  color: #d8d8d8;
  font-weight: 600;
  font-size: 0.95rem;
  background: none;
  text-align: left;
  cursor: pointer;
}

.nav-link .nav-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.nav-link:hover {
  background: rgba(179, 65, 60, 0.1);
  border-left-color: var(--accent, #b3413c);
  color: #fff;
  transform: translateX(4px);
}

/* Botón de logout, separado visualmente */
.logout-form {
  width: 100%;
  margin-top: 0.5rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-logout {
  color: #e07a76;
}

.nav-logout:hover {
  background: rgba(224, 122, 118, 0.12);
  border-left-color: #e07a76;
  color: #ff9d99;
}

/* En escritorio, el subrayado (::after) que ya tenías no aplica bien
   con los iconos — lo desactivamos solo para .nav-link y usamos el
   fondo/borde de arriba en su lugar */
.nav-link::after {
  display: none;
}

/* Animación de entrada cuando se abre el menú en celular */
@media (max-width: 768px) {
  .nav-links.open {
    animation: slideDownMenu 0.25s ease;
  }

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

  .logout-form button {
    justify-content: flex-start;
  }
}

/* En escritorio los links van en fila, no en columna, así que
   ajustamos el logout-form para que no se vea como bloque separado */
@media (min-width: 769px) {
  .logout-form {
    width: auto;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
  }
}

/* --- Tabla en escritorio / tarjetas en celular --- */
.desktop-only { display: block; }
.mobile-only { display: none; }

@media (max-width: 768px) {
  .desktop-only { display: none; }
  .mobile-only { display: block; }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.badge-success {
  background: rgba(76, 175, 80, 0.15);
  color: #7fd88f;
}

.badge-muted {
  background: rgba(255, 255, 255, 0.08);
  color: #9a9a9a;
}

/* --- Tarjetas de usuario (celular) --- */
.user-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.user-card {
  background: var(--card, #1b1e25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
}

.user-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

.user-card-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.user-card-meta {
  margin: 0.4rem 0 1rem;
  color: #9a9a9a;
  font-size: 0.88rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.user-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.action-form {
  display: contents;
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.7rem 0.5rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e0e0e0;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.action-btn-primary {
  grid-column: span 2;
  background: rgba(179, 65, 60, 0.18);
  border-color: rgba(179, 65, 60, 0.4);
  color: #ff9d99;
}

.action-btn-danger {
  grid-column: span 2;
  color: #e07a76;
  border-color: rgba(224, 122, 118, 0.3);
}

.action-btn-danger:hover {
  background: rgba(224, 122, 118, 0.12);
}

/* --- Botones de acción (mismos en escritorio y celular) --- */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e0e0e0;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.action-btn-primary {
  background: rgba(179, 65, 60, 0.18);
  border-color: rgba(179, 65, 60, 0.4);
  color: #ff9d99;
}

.action-btn-danger {
  color: #e07a76;
  border-color: rgba(224, 122, 118, 0.3);
}

.action-btn-danger:hover {
  background: rgba(224, 122, 118, 0.12);
}

.action-form {
  display: contents;
}

.badge-success {
  background: rgba(76, 175, 80, 0.15);
  color: #7fd88f;
}

.badge-muted {
  background: rgba(255, 255, 255, 0.08);
  color: #9a9a9a;
}

/* --- En celular: la misma tabla se convierte en tarjetas --- */
@media (max-width: 768px) {
  .users-table thead {
    display: none;
  }

  .users-table, .users-table tbody, .users-table tr, .users-table td {
    display: block;
    width: 100%;
  }

  .users-table tr {
    background: var(--card, #1b1e25);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
  }

  .users-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    border: none;
    text-align: right;
  }

  .users-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #9a9a9a;
    text-align: left;
    margin-right: 1rem;
  }

  .users-table td.actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    text-align: left;
    margin-top: 0.6rem;
  }

  .users-table td.actions::before {
    content: attr(data-label);
    grid-column: 1 / -1;
    text-align: left;
    margin-bottom: 0.2rem;
  }

  .users-table .action-btn {
    padding: 0.7rem 0.5rem;
    font-size: 0.85rem;
  }

  .users-table .action-btn-primary,
  .users-table .action-btn-danger {
    grid-column: span 2;
  }
}

.page-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.user-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card, #1b1e25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
}

.user-row-info {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.user-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(179, 65, 60, 0.2);
  color: #ff9d99;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.user-row-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-row-name {
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-row-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: #9a9a9a;
}

.user-row-menu-wrap {
  position: relative;
  flex-shrink: 0;
}

.menu-toggle {
  background: none;
  border: none;
  color: #cfcfcf;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  line-height: 1;
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}

.user-menu {
  display: none;
  flex-direction: column;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: #22252d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  min-width: 190px;
  padding: 0.4rem;
  z-index: 50;
}

.user-menu.open {
  display: flex;
}

.user-menu a,
.user-menu button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem 0.6rem;
  border-radius: 7px;
  color: #e0e0e0;
  font-size: 0.85rem;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}

.user-menu a:hover,
.user-menu button:hover {
  background: rgba(255, 255, 255, 0.07);
}

.user-menu form {
  width: 100%;
}

.menu-danger {
  color: #ff8f8a !important;
}

.menu-danger:hover {
  background: rgba(224, 122, 118, 0.12) !important;
}

/* --- Acordeón de grupos musculares --- */
.muscle-groups {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.muscle-group {
  background: var(--card, #1b1e25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  
}

.muscle-group-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}

.muscle-group-name {
  flex: 1;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
}

.muscle-group-count {
  background: rgba(179, 65, 60, 0.18);
  color: #ff9d99;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
}

.muscle-group-arrow {
  color: #9a9a9a;
  transition: transform 0.25s ease;
}

.muscle-group-header.open .muscle-group-arrow {
  transform: rotate(180deg);
}

.muscle-group-body {
  display: none;
  padding: 0 0.7rem 0.7rem;
}

.muscle-group-body.open {
  display: block;
}

.muscle-group-body .user-list {
  gap: 0.35rem;
}

.muscle-group-body .user-row {
  background: rgba(255, 255, 255, 0.03);
  padding: 0.45rem 0.6rem;
}

/* --- Selección de ejercicios al armar rutina --- */
.exercise-pick {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  margin-bottom: 0.35rem;
}

.exercise-pick-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

.exercise-pick-header input[type="checkbox"] {
  width: auto;
}

.exercise-pick-details {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.6rem;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.exercise-pick-details.open {
  display: grid;
}

/* --- Selector de kg / lbs junto al número --- */
.peso-input-group {
  display: flex;
  gap: 0.4rem;
}

.peso-input-group input {
  flex: 1;
  min-width: 0;
}

.peso-input-group select {
  width: auto;
  flex-shrink: 0;
}

.exercise-log-card {
  margin-bottom: 1.2rem;
}

.exercise-log-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.6rem;
}

.sets-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.set-row {
  display: grid;
  grid-template-columns: 60px 1fr auto 1fr;
  gap: 0.5rem;
  align-items: center;
}

.set-number {
  font-size: 0.8rem;
  color: #9a9a9a;
  font-weight: 600;
}

.btn-link-small {
  display: inline-block;
  background: none;
  border: none;
  color: var(--accent, #b3413c);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.4rem 0;
  margin-top: 0.4rem;
}

.btn-link-small:hover {
  text-decoration: underline;
}

.historial-exercise {
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.historial-exercise:last-child {
  border-bottom: none;
}

.historial-exercise-name {
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.historial-sets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.set-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 0.25rem 0.7rem;
  font-size: 0.8rem;
  color: #d8d8d8;
}

.historial-comment {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: #9a9a9a;
  font-style: italic;
}

/* ================= PORTADA (LANDING) ================= */
.landing {
  width: 100%;
  overflow-x: hidden;
}

.landing-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem;
  background: linear-gradient(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.25)), url('/images/inicioportada.jpeg');

  background-size: cover;
  background-position: center;
}

 .landing-hero-img {
  display: none; /* en escritorio seguimos usando la imagen de fondo */
}


.landing-hero-content {
  max-width: 700px;
  animation: fadeInPage 0.7s ease;
}

.landing-logo {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: 1px;
  margin: 0;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.landing-tagline {
  font-size: clamp(1rem, 3vw, 1.4rem);
  color: #e8e8e8;
  font-style: italic;
  margin: 0.6rem 0 2.2rem;
}

.landing-hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.btn-hero {
  padding: 0.9rem 2rem;
  font-size: 1rem;
  border-radius: 10px;
}

.btn-hero-outline {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.6);
  color: #fff;
  box-shadow: none;
}

.btn-hero-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #fff;
}

.landing-scroll-hint {
  position: absolute;
  bottom: 1.8rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(14, 15, 18, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: 30px;
  text-decoration: none;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.landing-scroll-hint:hover {
  background: rgba(14, 15, 18, 0.75);
  border-color: rgba(255, 255, 255, 0.5);
}

.landing-scroll-hint .scroll-arrow {
  display: inline-block;
  animation: bounceHint 1.4s infinite;
}

@keyframes bounceHint {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

.landing-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4.5rem 1.5rem;
  text-align: center;
}

.landing-section-alt {
  background: rgba(255, 255, 255, 0.02);
  max-width: 100%;
}

.landing-section-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.6rem;
}

.landing-section-subtitle {
  color: #9a9a9a;
  max-width: 600px;
  margin: 0 auto 2.5rem;
  font-size: 1rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.3rem;
}

.feature-card {
  background: var(--card, #1b1e25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 2rem 1.4rem;
  text-align: left;
}

.feature-icon {
  font-size: 2.2rem;
  margin-bottom: 0.8rem;
}

.feature-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.feature-card p {
  color: #9a9a9a;
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.5;
}

.cardio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 1rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.cardio-card {
  background: var(--card, #1b1e25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.88rem;
}

.cardio-icon {
  font-size: 2rem;
}

.landing-cta {
  text-align: center;
  padding: 5rem 1.5rem;
}

.landing-cta h2 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin-bottom: 0.5rem;
}

.landing-cta .landing-hero-buttons {
  margin-top: 1.5rem;
}

.landing-cta .btn-hero-outline {
  border-color: rgba(255, 255, 255, 0.25);
  color: #e0e0e0;
}

.landing-footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: #6a6a6a;
  font-size: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* --- Modal de registro --- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  z-index: 1000;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: var(--card, #1b1e25);
  border-radius: 16px;
  padding: 2rem;
  max-width: 480px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
  animation: fadeInPage 0.3s ease;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: #9a9a9a;
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: #fff;
}

.registro-step {
  display: flex;
  gap: 1rem;
  margin-top: 1.4rem;
}

.registro-step-number {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(179, 65, 60, 0.2);
  color: #ff9d99;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.registro-step h3 {
  margin: 0 0 0.3rem;
  font-size: 0.95rem;
}

.registro-step p {
  margin: 0;
  color: #9a9a9a;
  font-size: 0.85rem;
  line-height: 1.5;
}

@media (max-width: 600px) {
  .landing-hero-buttons {
    flex-direction: column;
    width: 100%;
  }

  .btn-hero {
    width: 100%;
  }

  .landing-section {
    padding: 3rem 1.2rem;
  }
}

@media (max-width: 768px) {
  .landing-hero {
    background: none;
    min-height: 0;
    padding: 0 0 2.5rem;
  }

  .landing-hero-img {
    display: block;
    width: 100%;
    height: auto;
  }

  .landing-hero-content {
    padding: 2rem 1.5rem 0;
  }

  
}

@media (max-width: 768px) {
  .landing-hero {
    background: none;
    min-height: 100vh;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
  }

  .landing-hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }

  .landing-hero-content {
    position: relative;
    z-index: 1;
    max-width: 320px;
    width: 100%;
    background: rgba(14, 15, 18, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.6rem 1.2rem;
  }

}

html {
  scroll-behavior: smooth;
}

.login-back-link {
  text-align: center;
  margin-top: 1.2rem;
}

.login-back-link a {
  color: #9a9a9a;
  font-size: 0.85rem;
  text-decoration: none;
}

.login-back-link a:hover {
  color: #fff;
  text-decoration: underline;
}

.admin-banner {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  min-height: 260px;
  padding: 2.5rem 1.5rem;
  margin-bottom: 1.8rem;
  background: linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.65)), url('/images/inicioadmin.jpeg');
  background-size: cover;
  background-position: center;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-banner-content h1 {
  color: #fff;
  margin: 0 0 0.4rem;
}

.admin-banner-content .muted {
  color: #e0e0e0;
  margin: 0;
}

@media (max-width: 600px) {
  .admin-banner {
    padding: 1.8rem 1.2rem;
  }
}

.info-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(179, 65, 60, 0.12);
  border: 1px solid rgba(179, 65, 60, 0.3);
  color: #ff9d99;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  cursor: pointer;
  margin: 0.6rem 0;
}

.info-toggle:hover {
  background: rgba(179, 65, 60, 0.2);
}

.exercise-info {
  display: none;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 0.8rem;
}

.exercise-info.open {
  display: block;
}

.exercise-info-img {
  width: 100%;
  max-width: 320px;
  border-radius: 8px;
  margin-bottom: 0.8rem;
  display: block;
}

.exercise-info p {
  margin: 0 0 0.6rem;
  font-size: 0.88rem;
  color: #d8d8d8;
  line-height: 1.5;
}

.exercise-info p:last-child {
  margin-bottom: 0;
}


input[type="file"] {
  border: none;
  background: none;
  padding: 0;
  font-size: 0.9rem;
  color: #6b7280;
}

input[type="file"]::file-selector-button {
  background: #2563eb;
  color: white;
  border: none;
  padding: 0.55rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  margin-right: 0.75rem;
  transition: background 0.15s ease;
}

input[type="file"]::file-selector-button:hover {
  background: #1d4ed8;
}

/* Safari un poco más viejo usa este otro nombre para lo mismo */
input[type="file"]::-webkit-file-upload-button {
  background: #2563eb;
  color: white;
  border: none;
  padding: 0.55rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  margin-right: 0.75rem;
  transition: background 0.15s ease;
}

input[type="file"]::-webkit-file-upload-button:hover {
  background: #1d4ed8;
}

.measures-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.measure-chart-card h4 {
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 600;
}

.exercise-thumb-mini {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.exercise-hero-img {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: 12px;
  margin-bottom: 0.9rem;
  display: block;
  background: rgba(255, 255, 255, 0.03);
}

.historial-faltantes {
  margin-top: 0.8rem;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  background: rgba(255, 176, 32, 0.1);
  border-left: 3px solid #ffb020;
  color: #ffcb73;
  font-size: 0.85rem;
  line-height: 1.4;
}

.cardio-oculto { 
  display: none; 
}

/* =========================================================
   NIVEL PRO 2 — header fijo con vidrio + barra inferior móvil
   ========================================================= */

/* El header ya tenía el efecto "vidrio" (blur) pero le faltaba
   quedarse pegado arriba al hacer scroll — sin eso el blur casi
   no se nota porque no hay nada detrás que se mueva */
.topbar {
  position: sticky;
  top: 0;
  z-index: 200;
}

/* En celular quitamos el menú hamburguesa/dropdown: lo reemplaza
   la barra inferior de abajo, el patrón que usan casi todas las
   apps (Instagram, apps bancarias, etc.) */
@media (max-width: 768px) {
  .hamburger,
  .nav-links {
    display: none !important;
  }
}

/* Barra de navegación inferior — solo visible en celular */
.bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  .bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    background: rgba(20, 21, 26, 0.92);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(179, 65, 60, 0.25);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    padding: 0.4rem 0.2rem;
    padding-bottom: calc(0.4rem + env(safe-area-inset-bottom));
  }

  /* Para que el contenido no quede tapado detrás de la barra fija */
  .container,
  .container-full {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.35rem 0.2rem;
  border-radius: 10px;
  color: var(--text-muted, #9aa0ab);
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.15s ease, transform 0.1s ease;
}

.bottom-nav-item:hover {
  color: #d8d8d8;
}

.bottom-nav-item:active {
  transform: scale(0.92);
}

.bottom-nav-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.bottom-nav-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.bottom-nav-logout {
  color: #e07a76;
}

.bottom-nav-form {
  flex: 1;
  display: flex;
}

.bottom-nav-form .bottom-nav-item {
  width: 100%;
}