/* ======================
   VARIABLES DE COLOR
====================== */
:root {
  --bg: #050507;
  --bg-card: #120b0f;
  --bg-soft: #1a0f13;

  --accent: #b11226;        /* sangre oscura */
  --accent-soft: #8e0e1f;
  --accent-light: #ff3b3b;
  --accent-glow: rgba(177,18,38,.45);

  --text-main: #f2e9ec;
  --text-muted: #9a8a8f;

  --spacing: 16px;
  --radius: 14px;
  --shadow: 0 20px 50px rgba(0,0,0,.7);
}

.screen-header {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(90deg, #fff, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
  letter-spacing: 0.5px;
}

/* ======================
   LOGOUT
====================== */
#app-header {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
}

#logout-btn {
   font-size: 1.2rem;
   padding: 0.4rem 0.6rem;
   border-radius: 8px;
   cursor: pointer;
   margin-left: auto;
}

#logout-btn:hover {
  background: rgba(255,255,255,0.1);
}
/* ======================
   RESET
====================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont;
  color: var(--text-main);
}

body {
  background: radial-gradient(circle at top, #111 0%, #000 60%);
  min-height: 100vh;
}

body.human {
  --accent: #7c8cff;
  --accent-light: #5f6bff;
  --accent-glow: rgba(124,140,255,.4);
}

.hidden {
  display: none !important;
}

.separator {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent),
    transparent
  );
  box-shadow: 0 0 12px var(--accent-glow);
}

.spacer {
  height: 1.5rem;
}

/* ======================
   TIPOGRAFÍA
====================== */
h1 {
  text-align: center;
  padding: 20px 0 10px;
  font-size: 28px;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #fff, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ======================
   ELEMENTOS BÁSICOS
====================== */
button {
   background: linear-gradient(135deg, var(--accent), var(--accent-light));
   border: none;
   color: white;
   padding: 14px;
   gap: 8px;
   border-radius: var(--radius);
   font-weight: 700;
   letter-spacing: .5px;
   cursor: pointer;
   box-shadow: 0 10px 30px var(--accent-glow);
   transition: .2s;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 40px var(--accent-glow);
}

button:active {
  transform: scale(.97);
}

input,
select {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--bg-soft);
  color: var(--text-main);
  font-size: 15px;
  margin-bottom: 12px;
  border: none;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
}

input:focus,
select:focus {
  box-shadow: 0 0 0 2px var(--accent);
}

/* ======================
   LAYOUT
====================== */
section {
  padding: var(--spacing);
}

.center {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ======================
   VISTAS
====================== */
#login-view, 
#app-view { 
   max-width: 1000px; 
   margin: 0 auto; 
}

/* ======================
   LOADER
====================== */
.loader {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255,255,255,.15);
  border-top-color: var(--accent-light);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 1rem auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ======================
   TABS
====================== */
#tabs {
  display: flex;
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.tab-btn {
  flex: 1;
  background: transparent;
  color: var(--text-muted);
  padding: 12px;
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  color: white;
  box-shadow: 0 0 20px var(--accent-glow);
}

.tab-content {
  animation: fade .3s ease-out;
}

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

/* ======================
   HISTORIAL / CARDS
====================== */
.history-card,
.stat-card,
.mesocycle-history-card,
.exercise-volume-card {
  background: linear-gradient(180deg, var(--bg-card), #0b0b10);
  border-radius: var(--radius);
  padding: var(--spacing);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,.04);
  margin-bottom: var(--spacing);
}

.exercise-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0.7;
  margin-top: 4px;
}

.exercise-label.hidden {
  display: none;
}

.history-card {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.template-name {
  font-size: .9rem;
  color: var(--text-muted);
}

/* ======================
   REGISTRO
====================== */
.registro-container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing);
}

.registro-editor {
  background: linear-gradient(180deg, #141418, #0c0c10);
  padding: 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.registro-editor input {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
}

/* ======================
   DÍAS
====================== */
.day-buttons {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
   gap: 8px;
   margin-top: 10px;
}

.day-buttons button {
  padding: 16px 0; /* 🔥 más alto */
  border-radius: 14px;
  font-size: 15px;
}

.day-buttons button.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  box-shadow: 0 0 25px var(--accent-glow);
}

/* ======================
   SUBGRUPOS
====================== */
.subgroup-section {
  margin-top: 1.25rem;
  padding-top: .5rem;
  border-top: 1px solid rgba(255,255,255,.05);
}

.subgroup-section h4 {
  color: var(--accent);
  font-size: .95rem;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ======================
   CHIPS EJERCICIOS
====================== */
.exercise-chip {
  background: linear-gradient(135deg, #1c1c26, #0e0e13);
  padding: 10px 14px;
  border-radius: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 6px 0;
}

.exercise-chip:hover {
  background: #2a2a32;
}

.chip-delete {
  background: transparent;
  border: none;
  color: #ff6b6b;
  cursor: pointer;
}

/* ======================
   MODAL
====================== */
#exercise-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.6);
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: .75rem;
  width: 280px;
  margin: 10vh auto;
  z-index: 2;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal.hidden {
  display: none;
}

.modal-card {
  background: #141418;
  padding: 1.5rem;
  border-radius: 16px;
  width: 90%;
  max-width: 420px;
}

/* ======================
   ESTADÍSTICAS
====================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px,1fr));
  gap: 14px;
  margin: 20px 0;
}

.stat-card strong {
  font-size: 26px;
}

.stat-card span {
  font-size: 13px;
  color: var(--text-muted);
}

.stats-subtitle {
  font-size: 1.2rem;
  font-weight: 500;
  margin-top: 4px;
  color: #333;

  opacity: 1;               
  transition: opacity 0.3s ease-in-out; 
}

.no-data-badge {
  display: inline-block;
  margin: 10px 0;
  padding: 8px 12px;
  background-color: #f8d7da;
  color: #842029;
  border-radius: 5px;
  font-weight: bold;
  font-size: 0.95rem;
}

.back-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #b11226;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transition: opacity 0.3s ease;
}

.back-badge.hidden {
  opacity: 0;
  pointer-events: none;
}

.back-badge.visible {
  opacity: 1;
  pointer-events: auto;
}

.exercise-label.warning {
  color: #fff;
  background-color: #e74c3c;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 1rem; /* un poco más grande que texto normal */
  display: inline-block;
  margin-left: 10px;
}

/* ======================
   PR TOAST
====================== */
.pr-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) scale(.9);
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  padding: 20px 30px;
  border-radius: 20px;
  box-shadow: 0 0 40px var(--accent-glow);
  opacity: 0;
  transition: .4s;
}

.pr-toast.show {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* ======================
   RESPONSIVE
====================== */
@media (max-width: 768px) {
  .day-buttons {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .pr-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .pr-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  #tutorial-title {
    font-size: 16px;
  }

  #tutorial-cues {
    font-size: 13px;
  }

  #tutorial-modal .modal-content {
    width: 95%;   /* ocupa casi toda la pantalla en celular */
    padding: 12px;
  }
}
@media (max-width: 768px) {
  .search-box input {
    max-width: 100%;
    font-size: 1rem;
  }
}

@media (max-width: 600px) {
  .tutorial-card {
    padding: 0.3 rem;
  }

  .tutorial-actions {
    gap: 8px;
  }
}

@media (max-width: 900px) {
  #strength-trends {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  #strength-trends {
    grid-template-columns: 1fr;
  }
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .hero-actions {
    flex-direction: column;
  }

  .cta-btn {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 600px) {
  /* Asegura que la lista siga vertical */
  #strength-trends {
    gap: 16px;
  }

  .strength-row {
    padding: 1rem 1.5rem;
  }

  .strength-row .exercise {
    font-size: 1rem;
  }

  .strength-row .avg {
    font-size: 1.1rem;
  }

  .strength-row .trend {
    font-size: 1.4rem;
  }
}

/* ======================
   LOGIN — VAMPIRO
====================== */

.login-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: radial-gradient(circle at top, #2a0a0a, #000);
}

/* CARD */
.auth-card {
  background: #120b0f;
  border-radius: 18px;
  padding: 3rem;
  width: 100%;
  max-width: 420px;
  box-shadow:
    0 30px 80px rgba(0,0,0,0.85),
    0 0 40px rgba(177,18,38,0.15);
  text-align: center;
  border: 1px solid #2a0f14;
}

/* HEADER */
.auth-header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #b11226, #ff3b3b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-header p {
  color: #9a8a8f;
  margin-bottom: 2rem;
}

/* FORM */
.auth-form {
  text-align: left;
}

.auth-form label {
  font-size: 0.8rem;
  color: #8a6a72;
  display: block;
  margin-bottom: 0.25rem;
  letter-spacing: 0.05em;
}

.auth-form input {
  width: 100%;
  padding: 0.8rem 1rem;
  background: #080406;
  border: 1px solid #2a0f14;
  border-radius: 10px;
  color: #fff;
  margin-bottom: 1.3rem;
  transition: all 0.25s ease;
}

.auth-form input:focus {
  outline: none;
  border-color: #b11226;
  box-shadow:
    0 0 0 2px rgba(177,18,38,0.35),
    inset 0 0 10px rgba(177,18,38,0.15);
}

/* BUTTON */
.auth-form .primary {
  width: 100%;
  padding: 0.95rem;
  background: linear-gradient(135deg, #8e0e1f, #ff3b3b);
  border: none;
  border-radius: 12px;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  margin-top: 0.75rem;
  letter-spacing: 0.05em;
  transition: all 0.25s ease;
}

.auth-form .primary:hover {
  transform: translateY(-2px);
  box-shadow:
    0 12px 40px rgba(177,18,38,0.45);
}

/* FOOTER */
.auth-footer {
  margin-top: 1.8rem;
  text-align: center;
  font-size: 0.85rem;
  color: #8a6a72;
}

.auth-footer a {
  color: #ff3b3b;
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* MESSAGE */
.auth-message {
  min-height: 1.2em;
  margin-top: 0.75rem;
  color: #ff4d4d;
  text-align: center;
}

/* ======================
   DETALLES FINOS
====================== */

@keyframes pulse {
  0% { box-shadow: 0 0 15px rgba(177,18,38,.25); }
  50% { box-shadow: 0 0 30px rgba(177,18,38,.45); }
  100% { box-shadow: 0 0 15px rgba(177,18,38,.25); }
}

.pr-toast.show {
  animation: pulse 2.5s infinite;
}

#back-to-general {
  margin-top: 10px;
  padding: 6px 12px;
  font-size: 0.9rem;
  cursor: pointer;
}

#back-to-general.hidden {
  display: none;
}

/* ======================
   KPIs
====================== */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: #141418;
  border-radius: 16px;
  padding: 1.4rem;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
}

.kpi-card h4 {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-bottom: 0.4rem;
}

.kpi-card strong {
  font-size: 2rem;
  color: #ff3b3b;
}

.kpi-sub {
  display: block;
  font-size: 0.7rem;
  opacity: 0.5;
}

.strength-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

#strength-trends {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 1.2rem;
}

.strength-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1rem;
  align-items: center;
  background: #141418;
  padding: 0.9rem 1.2rem;
  border-radius: 12px;
}

.strength-row.clickable {
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.strength-row.clickable:hover {
  background: #1b1b22;
  transform: translateY(-2px);
}

.exercise {
  font-weight: 500;
}

.avg {
  opacity: 0.8;
}

/* ======================
   TENDENCIA
====================== */
#strength-trends {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0;
  margin: 0;
}

/* Cada fila - caja tipo card */
.strength-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #1a0f13;
  border-radius: 12px;
  padding: 1rem 1.5rem;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease;
}

/* Hover (opcional) */
.strength-row:hover {
  background-color: #2a1a20;
}

/* Nombre del ejercicio */
.strength-row .exercise {
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
  flex-grow: 1;        /* para que tome todo el espacio posible */
}

/* Promedio de peso */
.strength-row .avg {
  font-weight: 700;
  font-size: 1.1rem;
  color: #ccc;
  margin-left: 1rem;
  white-space: nowrap;
}

/* Icono tendencia */
.strength-row .trend {
  font-size: 1.4rem;
  margin-left: 0.75rem;
  color: #ccc;
  opacity: 0.8;
  white-space: nowrap;
}

/* Colores para las tendencias */
.trend.up {
  color: #4ade80;
}

.trend.down {
  color: #f87171;
}

.trend.flat {
  color: #9ca3af;
}


/* ======================
   PR TABLE – HALL OF FAME
====================== */

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

.pr-row {
  background: linear-gradient(180deg, #1a0f13, #0b0608);
  border-radius: 16px;
  padding: 1rem 1.2rem;
  text-align: center;
  box-shadow: 0 15px 40px rgba(0,0,0,.6);
  border: 1px solid rgba(255,255,255,.05);
  position: relative;
  overflow: hidden;
}

.pr-row::before {
  content: "🏆";
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 1.4rem;
  opacity: 0.15;
}

.pr-row strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

.pr-row span {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent-light);
}

.pr-row small {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.7rem;
  opacity: 0.5;
  text-transform: uppercase;
}

/* ======================
   MESOCYCLE COMPARISON
====================== */

#mesocycle-comparison {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-top: 1rem;
}

.mesocycle-stat-card {
  background: linear-gradient(180deg, #141418, #0a0a0f);
  border-radius: 18px;
  padding: 1.4rem;
  box-shadow:
    0 20px 50px rgba(0,0,0,.7),
    inset 0 0 0 1px rgba(255,255,255,.04);
  position: relative;
}

.mesocycle-stat-card h4 {
  margin-bottom: 0.8rem;
  font-size: 1rem;
  background: linear-gradient(90deg, #fff, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.mesocycle-stat-card p {
  font-size: 0.85rem;
  margin: 0.35rem 0;
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
}

.mesocycle-stat-card strong {
  color: var(--text-main);
}

.mesocycle-stat-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 25px rgba(177,18,38,.08);
  pointer-events: none;
}

h3 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  letter-spacing: .03em;
  color: #f5e6ea;
}

/* ======================
   PR TABLE – CARDS
====================== */
#pr-table {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-top: 1rem;
}

.pr-card {
  background: linear-gradient(180deg, #141418, #0a0a0f);
  border-radius: 18px;
  padding: 1.4rem;
  box-shadow:
    0 20px 50px rgba(0,0,0,.7),
    inset 0 0 0 1px rgba(255,255,255,.04);
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}

.pr-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 25px 60px rgba(177,18,38,.45);
}

.pr-card h4 {
  margin-bottom: 0.8rem;
  font-size: 1rem;
  background: linear-gradient(90deg, #fff, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.pr-card p {
  font-size: 0.85rem;
  margin: 0.35rem 0;
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
}

.pr-card strong {
  color: var(--text-main);
}

.pr-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 25px rgba(177,18,38,.08);
  pointer-events: none;
}

.forgot-link {
  margin-top: 12px;
  display: block;
  font-size: 0.9rem;
  color: #7c8cff;
  text-align: center;
  text-decoration: none;
}

.forgot-link:hover {
  text-decoration: underline;
}

/* ======================
   VOLUME LIST
====================== */

#exercise-volume-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-top: 1rem;
}

.exercise-volume-card {
  background: linear-gradient(180deg, #141418, #0a0a0f);
  border-radius: 18px;
  padding: 1.4rem;
  box-shadow: 0 20px 50px rgba(0,0,0,.7),
              inset 0 0 0 1px rgba(255,255,255,.04);
  position: relative;
}

.stats-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.kpi-card {
  background: #141418;
  border-radius: 16px;
  padding: 18px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.kpi-card span {
  font-size: 0.8rem;
  color: #aaa;
}

.kpi-card strong {
  display: block;
  font-size: 1.6rem;
  margin-top: 6px;
}

.kpi-card.highlight {
  background: linear-gradient(135deg, #ff3c3c, #ff1f1f);
}

/* =====================
   HAMBURGER MENU
===================== */
.menu-toggle {
  font-size: 1.6rem;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  user-select: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 130;
  background: #141418;
  color: #fff;
}

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

/* Sidebar */
.side-menu {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 220px;
  padding: 70px 8px 8px 8px; 
  background: #141418;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 120;
}

.side-menu.open {
  transform: translateX(0);
}

/* Menu items */
.menu-item {
  position: relative; /* para ::before si quieres indicador */
  width: 100%;
  background: none;
  border: none;
  color: #eaeaea;
  text-align: left;
  padding: 12px 14px;
  font-size: 0.95rem;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 4px;
  transition: background 0.2s ease, color 0.2s ease;
}

.menu-item:hover {
  background: rgba(255,255,255,0.06); /* gris plano */
  color: #fff;
}

.menu-item.active {
  background: rgba(177, 18, 38, 0.2); /* rojo suave */
  color: #fff;
  font-weight: 600;
}

.menu-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  background: var(--accent);
  border-radius: 4px;
}

/* Contenido principal */
#main-content {
  transition: margin-left 0.3s ease;
  margin-left: 0;
  padding: 20px;
}

/* Empujar contenido cuando sidebar abierto */
.side-menu.open ~ #main-content {
  margin-left: 220px;
}

/* Tabs ocultos por defecto */
.tab-content.hidden {
  display: none;
}

/* ================= MODAL ================= */

#tutorial-modal .modal-content {
  background: #fff;
  color: #000;
  width: 100%;
  max-width: 720px;

  max-height: 90vh;        /* 👈 clave */
  overflow-y: auto;        /* scroll si hace falta */

  border-radius: 12px;
  padding: 1rem 1.25rem;
}

#tutorial-modal.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

#tutorial-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 999;
}

/* ================= TUTORIALES ================= */

.tutorial-list {
  display: grid;
  gap: 2rem;              /* separación entre cards */
  margin-top: 1.5rem;
}

#tutorial-title {
  color: #111;
  font-weight: 600;
  font-size: 18px;
  margin-bottom: 24px;
}

/* ===== VIDEO ===== */
.video-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.video-wrapper iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ===== CONSEJOS ===== */
#tutorial-cues {
  color: #000;
  font-size: 0.95rem;
  line-height: 1.5;
  background: #f9f9f9;
  border-left: 4px solid #f5c518;
  padding: 10px 12px;
  border-radius: 6px;
}

/* ===== BOTÓN CERRAR ===== */
#close-tutorial-modal-btn {
  margin-top: 14px;
  padding: 10px;
  border-radius: 8px;
  border: none;
  background: #111;
  color: #fff;
  cursor: pointer;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  #tutorial-modal {
    padding: 6px;
  }

  #tutorial-modal .modal-content {
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }

  #tutorial-title {
    font-size: 16px;
  }

  #tutorial-cues {
    font-size: 13px;
  }
}

@media (max-width: 600px) {
  .trend-main {
    flex-direction: column;   /* 👈 apila verticalmente */
    align-items: flex-start;  /* empieza desde la izquierda */
    gap: 8px;                 /* un poco de espacio entre valor e icono */
  }

  /* Valor principal más grande y legible */
  .trend-value {
    font-size: 1.4rem;
    font-weight: 800;
  }

  /* Icono decorativo más discreto y alineado a la derecha */
  .trend-icon {
    align-self: flex-end;
    font-size: 1.6rem;
    opacity: 0.12;
  }
}

@media (max-width: 600px) {
  #tutorial-modal .modal-content {
    padding: 0.75rem;
  }

  #tutorial-title {
    font-size: 1.1rem;
  }
}

/* ================= CARDS ================= */

.tutorial-card {
  background: #120b0f;
  border: 1px solid #fff;
  border-radius: 18px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  justify-content: space-between;
  padding: 15px;
  margin-bottom: 5px;
  cursor: pointer;
}

.tutorial-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 50px rgba(177, 18, 38, 0.35);
}

.tutorial-card h4 {
  margin-bottom: 0.75rem;
  font-size: 1.05rem;
}

.tutorial-card span {
  display: block;
  font-size: 0.85rem;
  color: #9a8a8f;
  line-height: 1.4;
}

/* ================= ACCIONES ================= */

.tutorial-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto; /* mantiene botones a la derecha */
}

.clear-btn {
  padding: 8px 14px;
  border-radius: 6px;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  cursor: pointer;
}

.clear-btn:hover {
  background: #ddd;
}

.play-btn {
  background: linear-gradient(135deg, #b11226, #ff3b3b);
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.2rem;
  color: white;
  font-weight: 700;
  cursor: pointer;
}

!-- ================= FAVORITOS ================= -->
.fav-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid #ddd;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fav-btn .star {
  font-size: 18px;
  color: #bbb;
  transition: transform 0.2s ease, color 0.2s ease;
}

/* Hover */
.fav-btn:hover {
  border-color: #f5c518;
  background: #fff8dc;
}

.fav-btn:hover .star {
  color: #f5c518;
  transform: scale(1.1);
}

/* Activo (favorito) */
.fav-btn.active {
  background: #f5c518;
  border-color: #f5c518;
}

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

/* Click animation */
.fav-btn:active .star {
  transform: scale(0.9);
}

.favorites-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

/* Oculta el checkbox nativo */
.favorites-filter input {
  display: none;
}

/* Cuadro custom */
.checkmark {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid #ccc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

/* Check */
.checkmark::after {
  content: '';
  width: 10px;
  height: 6px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg);
  opacity: 0;
}

/* Activo */
.favorites-filter input:checked + .checkmark {
  background: #f5c518;
  border-color: #f5c518;
}

.favorites-filter input:checked + .checkmark::after {
  opacity: 1;
}

/* Hover */
.favorites-filter:hover .checkmark {
  border-color: #f5c518;
}

.filter-options label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  cursor: pointer;
  font-size: 14px;
}

.filter-options label:hover {
  background: #f5f5f5;
  border-radius: 4px;
}

.filter-options input {
  cursor: pointer;
}


!-- ================= WRAPPER Y MODAL ================= -->
/* Animation */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.video-wrapper iframe {
  pointer-events: auto;
}

.modal {
  pointer-events: all;
}

#tutorial-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;          /* 👈 MÁS separación entre tarjetas */
  margin-top: 2rem;
}

.tutorial-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px;
  border-radius: 10px;
  background: #f5f5f5;
  cursor: pointer;
  transition: background 0.2s;
}

.tutorial-item:hover {
  background: #eaeaea;
}

.tutorial-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tutorial-info span {
  font-size: 0.85rem;
  color: #666;
}

.tutorial-play {
  font-size: 1.2rem;
}

/* Modal fondo */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
.filters-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.search-box input {
  padding: 8px 12px;
  width: 100%;
  max-width: 600px;
  box-sizing: border-box;
}


.favorites-filter {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.filter-dropdown {
  position: relative;
  display: inline-block;
}

.filter-btn {
  cursor: pointer;
  padding: 5px 10px;
}

.filter-dropdown-content {
  display: none;
  position: absolute;
  background-color: white;
  min-width: 150px;
  border: 1px solid #ccc;
  z-index: 10;
  max-height: 200px;
  overflow-y: auto;
  padding: 5px;
}

.filter-dropdown.open .filter-dropdown-content {
  display: block;
}

.filter-option {
  display: block;
  margin-bottom: 5px;
  cursor: pointer;
}

.tutorial-actions button {
  margin-left: 5px;
}

/* Contenido del modal */
.modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  max-width: 90%; /* Ajusta al 90% del ancho de la pantalla */
  width: 900px;    /* Tamaño máximo en escritorio */
  box-sizing: border-box;
}

/* Video wrapper con proporción 16:9 */
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  margin-bottom: 15px;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Botón de cerrar */
.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  background: none;
  border: none;
  cursor: pointer;
}

.subtitle {
  font-weight: normal;
  font-size: 1.2rem;
  color: #555;
  margin-bottom: 15px;
}

.search-input {
  width: 100%;
  max-width: 400px;
  padding: 8px 12px;
  margin-bottom: 20px;
  border-radius: 5px;
  border: 1px solid #ccc;
  font-size: 1rem;
}

!-- ================= FILTRO ================= -->

.multi-filter {
  position: relative;
}

.filter-btn {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
}
.multi-filter {
  position: relative;
}

.filter-options {
  position: absolute;
  top: 110%;
  left: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px;
  display: none;
  z-index: 100;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

/* 🔥 AQUÍ ESTÁ LA CLAVE */
.multi-filter.open .filter-options {
  display: block;
}

.filter-dropdown {
  position: absolute;
  top: 110%;
  left: 0;
  min-width: 180px;
  max-height: 220px;
  overflow-y: auto;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 8px;
  display: none;
  z-index: 20;
}

.multi-filter.open .filter-dropdown {
  display: block;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 14px;
}

.filter-option input {
  accent-color: #f5c518;
}

.filter-option:hover {
  background: #f5f5f5;
}

/* ===== MODAL TUTORIAL ===== */
#tutorial-modal .modal-content {
  background: #fff;
  color: #000;
}

/* "Consejo:" en negrita */
#tutorial-cues strong {
  color: #000;
  font-weight: 600;
}

#tutorial-cues {
  color: #000 !important;      /* texto negro */
  background: #f9f9f9;         /* fondo claro */
  border-left: 4px solid #f5c518;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-top: 12px;
}

#tutorial-cues strong {
  color: #000 !important;
  font-weight: 600;
}


#tutorial-modal iframe {
  display: block;
  margin: 0 auto;
}

/* =========================
   COACH CARD
========================= */

.coach-section {
  margin: 2rem 0 3rem;
}

.coach-card {
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
  padding: 1.6rem 1.8rem;
  border-radius: 18px;
  background: linear-gradient(180deg, #120b0f, #080406);
  border: 1px solid #2a0f14;
  box-shadow:
    0 25px 60px rgba(0,0,0,0.6),
    inset 0 0 0 1px rgba(255,255,255,0.04);
  animation: fadeUp 0.5s ease;
   opacity: 0.3;
   transition: 0.2s;
}

.coach-card.active {
  opacity: 1;
  border: 2px solid var(--accent);
}

.coach-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.coach-content h4 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
  color: #f2e9ec;
  text-transform: uppercase;
}

.coach-content p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #9a8a8f;
}

/* STATES */

.coach-card.success {
  border-color: rgba(92, 255, 141, 0.35);
}

.coach-card.success .coach-icon {
  color: #5cff8d;
}

.coach-card.warning {
  border-color: rgba(255, 200, 87, 0.4);
}

.coach-card.warning .coach-icon {
  color: #ffc857;
}

.coach-card.danger {
  border-color: rgba(255, 77, 77, 0.4);
}

.coach-card.danger .coach-icon {
  color: #ff4d4d;
}

/* Animation reuse */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.volume-section {
  margin: 3rem 0;
}

.volume-section h3 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.volume-table {
  width: 100%;
  border-collapse: collapse;
  background: #120b0f;
  border-radius: 14px;
  overflow: hidden;
}

.pdf-mode {
  background: #111 !important;
  color: #fff !important;
}

.volume-table th,
.volume-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #2a0f14;
  font-size: 0.9rem;
}

.volume-table th {
  text-align: left;
  color: #9a8a8f;
  font-weight: 600;
}

.volume-table tr:last-child td {
  border-bottom: none;
}

.trend.up {
  color: #5cff8d;
  font-weight: 700;
}

.trend.down {
  color: #ff4d4d;
  font-weight: 700;
}

.trend.flat {
  color: #ffc857;
  font-weight: 700;
}

.muscle-table {
  width: 100%;
  border-collapse: collapse;
  background: #120b0f;
  border-radius: 16px;
  overflow: hidden;
}

.muscle-table th,
.muscle-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #2a0f14;
  font-size: 0.9rem;
}

.status.below { color: #ff6b6b; }
.status.optimal { color: #5cff8d; font-weight: 700; }
.status.high { color: #ffc857; }
.status.over { color: #ff3b3b; font-weight: 700; }

/* =========================
   RELOJ
========================= */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.tool-card h3 {
  margin-bottom: 12px;
}

.tool-display {
  font-size: 1.8rem;
  font-weight: 700;
  text-align: center;
  margin: 12px 0;
}

.tool-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.tool-actions button {
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}

.time-history {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.time-entry {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  opacity: 0.9;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
}

.time-entry small {
  opacity: 0.6;
}

.time-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.time-info {
  display: flex;
  flex-direction: column;
}

.delete-time {
  background: transparent;
  border: none;
  color: #f87171;
  font-size: 1.1rem;
  cursor: pointer;
}

.delete-time:hover {
  color: #ef4444;
}

.timer-modal {
   display:none;
   position:fixed;
   top:0; left:0; right:0; bottom:0;
   background:rgba(0,0,0,0.7);
   color:white;
   font-size:1.5rem;
   display:flex;
   align-items:center;
   justify-content:center;
   flex-direction:column;
   z-index:9999;
}

.timer-inputs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.timer-inputs input {
  width: 60px;
  text-align: center;
  padding: 6px;
  border-radius: 6px;
  border: none;
  font-size: 1rem;
}

.timer-inputs span {
  font-weight: bold;
}
/* ================== DELOAD SECTION ================== */
#deloadSection {
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  background: #fff3cd;                /* fondo tipo alerta */
  border-left: 5px solid #f5c518;     /* énfasis */
  border-radius: 10px;
  color: #111;
  max-width: 100%;
}

/* Título */
#deloadSection h3 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
}

/* Contenedor de tabla / contenido dinámico */
#deloadTable {
  width: 100%;
  overflow-x: auto;        /* 👈 clave para móvil */
}

/* Si el JS inyecta una tabla */
#deloadTable table {
  width: 100%;
  min-width: 480px;        /* evita que se aplaste */
  border-collapse: collapse;
}

/* Celdas */
#deloadTable th,
#deloadTable td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-size: 0.9rem;
  border-bottom: 1px solid #ddd;
}

/* Encabezados */
#deloadTable th {
  background: #f5c518;
  color: #111;
  font-weight: 600;
}

/* Filas alternas */
#deloadTable tr:nth-child(even) {
  background: #fff8dc;
}

#deloadSection {
  margin-top: 2.5rem;
  padding: 1.5rem;
  border-radius: 16px;
  background: linear-gradient(180deg, #120b0f, #080406);
  border: 1px solid #2a0f14;
}

#deloadSection h3 {
  margin-bottom: 1rem;
  color: #ffb3b3;
  font-size: 1.1rem;
}


/* ================== PASSWORD ================== */

.password-wrapper {
  position: relative;
}

.password-wrapper input {
  width: 100%;
  padding-right: 40px; /* espacio para el ojito */
}

.password-wrapper button {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
}

/* ================== PLANTILLA TABLA ================== */

.template-table{
  width:100%;
  border-collapse:collapse;
  margin:20px 0;
  font-size:14px;
  background: linear-gradient(180deg, #141418, #0a0a0f);
  border-radius: 14px;
  overflow:hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,.7);
}

/* Header */
.template-table th{
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  color:white;
  padding:12px 14px;
  text-align:left;
  font-weight:600;
  letter-spacing:.4px;
}

/* Celdas */
.template-table td{
  padding:12px 14px;
  border-bottom:1px solid rgba(255,255,255,.05);
  color:var(--text-main);
}

/* Filas alternas */
.template-table tr:nth-child(even){
  background: rgba(255,255,255,0.02);
}

/* Hover */
.template-table tr:hover{
  background: rgba(177,18,38,0.08);
}

/* Última fila sin borde */
.template-table tr:last-child td{
  border-bottom:none;
}

.exercise-search{
  margin:15px 0;
}

.exercise-search input{
  width:100%;
  padding:8px 10px;
  border-radius:6px;
  border:1px solid #ccc;
  font-size:14px;
}

/* ================== NOTAS ================== */
.notes-area {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  padding: 10px;
  font-size: 14px;

  background: #ffffff;
  color: #111;        /* color del texto */

  border-radius: 8px;
  border: 1px solid #ccc;
  margin-top: 10px;
}

.notes-area::placeholder {
  color: #888;
}

/* ================== CONVERSOR ================== */
.tool-inputs {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.tool-inputs input,
.tool-inputs select {
  flex: 1;
  padding: 8px;
}

.result-small {
  font-size: 18px;
}

/* ================== RESULTADOS ================== */
.results-box {
  border: 1px solid #ccc;
  max-height: 150px;
  overflow-y: auto;
  background: white;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  z-index: 999;
}

.result-item {
  padding: 8px;
  cursor: pointer;
}

.result-item:hover {
  background-color: #eee;
}

.select-dropdown {
  max-height: 220px;
  overflow-y: auto;

  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,.05);

  box-shadow: var(--shadow);
  z-index: 9999;

  display: none;
}

.select-dropdown::-webkit-scrollbar {
  width: 6px;
}

.select-dropdown::-webkit-scrollbar-thumb {
  background: #aaa;
  border-radius: 10px;
}

.select-dropdown::-webkit-scrollbar-thumb:hover {
  background: #777;
}

.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: "▾";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0.6;
}

.select-input {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--bg-soft);
  color: var(--text-main);
  font-size: 15px;
  border: none;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
  cursor: pointer;
}

.select-input:focus {
  box-shadow: 0 0 0 2px var(--accent);
}

.select-item {
  padding: 12px 14px;
  cursor: pointer;
  color: var(--text-main);
  transition: 0.15s;
}

.select-item:hover {
  background: rgba(255,255,255,0.05);
}

.select-item.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  color: white;
}
