/* ===================================================================
   InviteGym - Rediseño con Paleta Oficial de Colores
   Inspirado en la imagen de marca:
   - Naranja Intenso (#EA571D) [Extraído del banner VALORES y ● GIMNASIO]
   - Negro Profundo (#000000 / #0a0a0f)
   - Blanco Puro (#FFFFFF) de alto contraste
   - Tarjeta cálida marfil (#FAF6F0) de la ficha de entrenamiento
   =================================================================== */

:root {
  --bg-primary: #000000;          /* Fondo negro puro de la imagen */
  --bg-secondary: #0c0c11;        /* Contenedores y barras de herramientas */
  --bg-tertiary: #16161d;         /* Tarjetas secundarias e inputs */
  --bg-card: #121217;             /* Tarjetas de ejercicios */
  --bg-card-hover: #191922;

  --text-main: #ffffff;           /* Blanco puro de alto contraste */
  --text-muted: #a1a1aa;          /* Gris neutro para subtítulos */
  --text-dim: #71717a;            /* Gris tenue para etiquetas pequeñas */

  /* Paleta oficial de la imagen */
  --brand-orange: #ea571d;        /* #EA571D exacto de VALORES y el punto de GIMNASIO */
  --brand-orange-hover: #ff6d33;  /* Naranja brillante interactivo */
  --brand-orange-glow: rgba(234, 87, 29, 0.45);
  --brand-orange-bg: rgba(234, 87, 29, 0.14);

  --accent-primary: #ea571d;
  --accent-primary-hover: #ff6d33;
  --accent-cyan: #38bdf8;         /* Toque cian para agua */
  --accent-red: #ef4444;          /* Alertas */

  --border-color: #262630;
  --border-subtle: #1c1c24;
  --border-orange: #ea571d;

  --card-light-bg: #faf6f0;       /* Tono marfil/blanco de la tarjeta de la foto */

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.6);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.8);
  --shadow-orange: 0 4px 18px rgba(234, 87, 29, 0.35);
  --shadow-orange-lg: 0 8px 30px rgba(234, 87, 29, 0.45);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-main);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  padding-bottom: 90px;
}

/* Contenedor Principal */
.app-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ================= HEADER ================= */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--brand-orange); /* Línea naranja de acento superior */
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.header-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-dots {
  color: var(--brand-orange);
  font-size: 1.3rem;
  line-height: 1;
  filter: drop-shadow(0 0 6px var(--brand-orange-glow));
}

.logo-name {
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.5px;
  color: #ffffff;
  text-transform: lowercase;
}

.logo-bold {
  font-weight: 900;
  color: var(--brand-orange);
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.user-icon {
  color: var(--brand-orange);
}

.header-quick-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: var(--border-color);
  border-color: var(--brand-orange);
}

.icon-btn.active {
  border-color: var(--brand-orange);
  color: var(--brand-orange);
  background: var(--brand-orange-bg);
}

.water-btn {
  border-color: var(--border-color);
  color: var(--accent-cyan);
}

.water-btn:hover {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.12);
}

.water-count {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.95rem;
}

/* ================= ROUTINE TABS ================= */
.routine-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: var(--bg-secondary);
  padding: 6px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 12px 6px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: var(--font-main);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-transform: uppercase;
}

.tab-letter {
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1;
}

.tab-text {
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  letter-spacing: 0.5px;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

/* Pestaña activa inspirada en el bloque rectangular "VALORES" de la imagen */
.tab-btn.active {
  background: var(--brand-orange);
  color: #ffffff;
  box-shadow: var(--shadow-orange);
  font-weight: 900;
}

.tab-card-btn.active {
  background: #ffffff;
  color: #000000;
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.25);
}

/* ================= SESSION BAR ================= */
.session-bar {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.session-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
}

.session-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Badge con el formato de la etiqueta "VALORES" de la foto */
.routine-tag {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 1px;
  color: #ffffff;
  background: var(--brand-orange);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.session-title {
  font-size: 1.35rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.session-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.stat-pill {
  background: var(--bg-tertiary);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-color);
}

.stat-label {
  color: var(--text-muted);
  font-weight: 600;
}

.stat-value {
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--text-main);
}

.stat-pill.highlight {
  border-color: rgba(234, 87, 29, 0.4);
}

.stat-pill.highlight .stat-value {
  color: var(--brand-orange);
}

.session-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.action-btn {
  padding: 11px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 0.92rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  letter-spacing: 0.3px;
}

.action-btn:active {
  transform: scale(0.97);
}

/* Botón primario con el naranja oficial #EA571D */
.primary-btn {
  background: var(--brand-orange);
  color: #ffffff;
  box-shadow: var(--shadow-orange);
}

.primary-btn:hover {
  background: var(--brand-orange-hover);
  box-shadow: var(--shadow-orange-lg);
}

.secondary-btn {
  background: var(--bg-tertiary);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.secondary-btn:hover {
  background: #20202a;
  border-color: var(--brand-orange);
}

.voice-announce-btn {
  background: #1e1e28;
  color: #ffffff;
  border: 1px solid var(--brand-orange);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.voice-announce-btn:hover {
  background: var(--brand-orange);
  color: #ffffff;
  box-shadow: var(--shadow-orange);
}

.danger-outline-btn {
  background: transparent;
  color: var(--accent-red);
  border: 1px solid var(--accent-red);
}

.danger-outline-btn:hover {
  background: rgba(239, 68, 68, 0.12);
}

.full-width {
  width: 100%;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff8a50, var(--brand-orange));
  box-shadow: 0 0 10px var(--brand-orange-glow);
  transition: width 0.3s ease;
}

/* ================= EXERCISES LIST ================= */
.exercises-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.exercise-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s ease;
}

.exercise-card:hover {
  border-color: rgba(234, 87, 29, 0.3);
}

.exercise-card.completed {
  border-color: rgba(234, 87, 29, 0.6);
  background: #0f0f14;
}

.exercise-card:focus-within {
  border-color: var(--brand-orange);
}

.exercise-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.exercise-card-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.exercise-num-badge {
  background: var(--bg-tertiary);
  color: var(--brand-orange);
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 0.95rem;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
}

.exercise-name {
  font-size: 1.18rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.exercise-meta-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.target-badge {
  background: var(--brand-orange-bg);
  color: var(--brand-orange);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(234, 87, 29, 0.35);
  letter-spacing: 0.3px;
}

.history-weight-badge {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.exercise-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.round-action-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.round-action-btn:hover {
  background: var(--border-color);
  color: #ffffff;
  border-color: var(--brand-orange);
}

.round-action-btn.speak-btn:hover {
  color: var(--brand-orange);
  border-color: var(--brand-orange);
}

/* Tabla de Series / Sets dentro de la tarjeta */
.sets-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
}

.sets-table th {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  font-weight: 800;
  text-align: center;
}

.sets-table th.th-set {
  text-align: left;
  width: 60px;
}

.sets-table td {
  padding: 4px;
  vertical-align: middle;
}

.set-row {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.set-row.completed {
  background: rgba(234, 87, 29, 0.08);
  border: 1px solid rgba(234, 87, 29, 0.25);
}

.set-number {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-muted);
  padding-left: 12px;
}

.input-num-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.set-input {
  width: 76px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 800;
  text-align: center;
  padding: 8px 4px;
  transition: all 0.2s ease;
}

.set-input:focus {
  outline: none;
  border-color: var(--brand-orange);
  background: #1c1c24;
  box-shadow: 0 0 8px var(--brand-orange-glow);
}

.input-unit {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 700;
}

/* Botón de Checkmark / Serie Completada con Naranja */
.btn-complete-set {
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  color: transparent;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  font-size: 1.3rem;
  font-weight: 900;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-complete-set:hover {
  border-color: var(--brand-orange);
  transform: scale(1.05);
}

.btn-complete-set.completed {
  background: var(--brand-orange);
  border-color: var(--brand-orange);
  color: #ffffff;
  box-shadow: var(--shadow-orange);
}

/* ================= FICHA INVITEGYM (MATRIX TABLE) ================= */
.sheet-view-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
}

.gym-card-sheet {
  background: var(--card-light-bg); /* Marfil original de la foto */
  color: #000000;
  border-radius: var(--radius-md);
  padding: 20px;
  border: 2px solid #e2d7c7;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.04);
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #000000;
  padding-bottom: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.sheet-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sheet-dots {
  color: var(--brand-orange);
  font-size: 1.5rem;
}

.sheet-title {
  font-size: 1.8rem;
  font-weight: 500;
  color: #000000;
  letter-spacing: -0.5px;
}

.sheet-bold {
  font-weight: 900;
  color: var(--brand-orange);
}

.sheet-member-info, .sheet-notes {
  font-size: 0.95rem;
  color: #1a1a1a;
}

.sheet-member-info strong {
  font-size: 1.18rem;
  color: #000000;
  text-transform: uppercase;
}

.sheet-notes strong {
  background: var(--brand-orange);
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 800;
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.invitegym-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  background: #ffffff;
  border: 2px solid #000000;
}

.invitegym-table th {
  background: #000000;
  color: #ffffff;
  font-weight: 800;
  padding: 10px 10px;
  border: 1px solid #333333;
  text-align: left;
  letter-spacing: 0.5px;
}

.invitegym-table th small {
  color: var(--brand-orange);
  font-weight: 800;
  display: block;
}

.invitegym-table td {
  padding: 8px 10px;
  border: 1px solid #d4c7b5;
  color: #000000;
}

.invitegym-table tr:nth-child(even) {
  background: #fbf7f0;
}

/* Separador de rutina estilo banner "VALORES" */
.invitegym-table tr.category-separator td {
  background: var(--brand-orange);
  font-weight: 900;
  color: #ffffff;
  padding: 8px 12px;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 1px;
}

.col-num {
  width: 34px;
  text-align: center !important;
  font-family: var(--font-mono);
  font-weight: 800;
}

.col-target {
  text-align: center !important;
  font-weight: 900;
  width: 50px;
}

.col-session {
  min-width: 95px;
  text-align: center !important;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.cell-r-kg {
  display: inline-block;
  padding: 3px 8px;
  background: #000000;
  border-radius: 4px;
  font-weight: 800;
  color: #ffffff;
  border-left: 3px solid var(--brand-orange);
}

.sheet-footer {
  margin-top: 20px;
  border-top: 2px solid #000000;
  padding-top: 16px;
}

/* Banner motivacional con el naranja oficial de la foto */
.water-reminder-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--brand-orange);
  color: #ffffff;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-weight: 900;
  letter-spacing: 0.8px;
  box-shadow: var(--shadow-orange);
  flex-wrap: wrap;
  gap: 12px;
}

.banner-water-icon {
  font-size: 1.6rem;
}

.banner-text {
  font-size: 1.1rem;
  text-transform: uppercase;
}

.water-interactive-tracker {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.25);
  padding: 5px 12px;
  border-radius: var(--radius-full);
}

.water-sub-btn, .water-add-btn {
  background: #ffffff;
  color: #000000;
  border: none;
  font-weight: 900;
  font-size: 0.95rem;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.water-sub-btn:active, .water-add-btn:active {
  transform: scale(0.92);
}

.water-display {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1rem;
  color: #ffffff;
}

/* ================= REST TIMER (FLOATING BANNER) ================= */
.timer-banner {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 600px;
  background: rgba(12, 12, 17, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--brand-orange);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.85), var(--shadow-orange);
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.timer-banner.hidden {
  display: none !important;
}

.timer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.timer-circle-wrap {
  position: relative;
  width: 54px;
  height: 54px;
  flex-shrink: 0;
}

.timer-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-bg {
  fill: none;
  stroke: var(--bg-tertiary);
  stroke-width: 8;
}

.timer-progress {
  fill: none;
  stroke: var(--brand-orange);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.5s ease;
}

.timer-digits {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 0.9rem;
  color: #ffffff;
}

.timer-info-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-grow: 1;
}

.timer-badge {
  font-size: 0.72rem;
  font-weight: 900;
  color: var(--brand-orange);
  letter-spacing: 0.8px;
}

.timer-next-hint {
  font-size: 0.88rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.timer-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.timer-adj-btn, .timer-play-btn, .timer-skip-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.timer-adj-btn:hover, .timer-play-btn:hover {
  background: var(--border-color);
  border-color: var(--brand-orange);
}

.timer-play-btn {
  font-size: 0.95rem;
  padding: 6px 10px;
}

.timer-skip-btn {
  background: var(--brand-orange);
  color: #ffffff;
  border: none;
  font-family: var(--font-main);
  font-weight: 800;
}

.timer-skip-btn:hover {
  background: var(--brand-orange-hover);
}

/* ================= MODALES ================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 2000;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.hidden {
  display: none !important;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-top: 4px solid var(--brand-orange);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: #ffffff;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover {
  color: var(--brand-orange);
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.setting-group label {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

.setting-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.setting-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.setting-col label {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-muted);
}

.gym-input, .gym-select {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 0.95rem;
  padding: 10px 14px;
}

.gym-input:focus, .gym-select:focus {
  outline: none;
  border-color: var(--brand-orange);
  box-shadow: 0 0 8px var(--brand-orange-glow);
}

.rest-presets {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.preset-btn {
  flex: 1;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.85rem;
}

.preset-btn.active {
  background: var(--brand-orange);
  color: #ffffff;
  border-color: var(--brand-orange);
  box-shadow: var(--shadow-orange);
}

.range-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.range-wrap input[type="range"] {
  flex-grow: 1;
  accent-color: var(--brand-orange);
}

.range-wrap span {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--brand-orange);
  width: 45px;
  font-weight: 800;
}

.backup-section {
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
}

.btn-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ================= TOAST NOTIFICATION ================= */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(12, 12, 17, 0.96);
  border: 1px solid var(--brand-orange);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), var(--shadow-orange);
  z-index: 3000;
  animation: slideDown 0.3s ease;
}

.toast-container.hidden {
  display: none !important;
}

/* Animaciones */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideDown {
  from { transform: translate(-50%, -20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* ================= RESPONSIVE MÓVIL ================= */
@media (max-width: 600px) {
  .app-container {
    padding: 8px 10px;
    gap: 12px;
  }

  .main-header {
    padding: 10px 14px;
  }

  .logo-name {
    font-size: 1.3rem;
  }

  .session-bar {
    padding: 14px;
  }

  .session-title {
    font-size: 1.15rem;
  }

  .exercise-name {
    font-size: 1.08rem;
  }

  .set-input {
    width: 64px;
    padding: 6px 2px;
    font-size: 0.95rem;
  }

  .btn-complete-set {
    width: 38px;
    height: 38px;
    font-size: 1.15rem;
  }

  .water-reminder-banner {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .timer-banner {
    width: calc(100% - 16px);
    bottom: 8px;
    padding: 10px 14px;
  }

  .timer-next-hint {
    max-width: 120px;
    font-size: 0.75rem;
  }

/* ================= CORRECCIÓN Y GESTIÓN DE FICHA ================= */
.sheet-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #d4c7b5;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.sheet-toolbar-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sheet-toolbar-tag {
  background: var(--brand-orange);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
}

.sheet-toolbar-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1a1a1a;
}

.col-session-header-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.col-session-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
}

.btn-col-action {
  background: #181820;
  border: 1px solid #444450;
  color: #ffffff;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.72rem;
  transition: all 0.15s ease;
}

.btn-col-action:hover {
  background: var(--brand-orange);
  border-color: var(--brand-orange);
}

.btn-col-action.btn-del:hover {
  background: var(--accent-red);
  border-color: var(--accent-red);
}

.modal-card-large {
  max-width: 640px !important;
}

.modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.manage-sessions-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.sessions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

.session-item-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: border-color 0.2s ease;
}

.session-item-card:hover {
  border-color: var(--brand-orange);
}

.session-item-card.is-duplicate {
  border-color: rgba(234, 87, 29, 0.7);
  background: rgba(234, 87, 29, 0.08);
}

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

.session-item-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 0.95rem;
  color: #ffffff;
}

.duplicate-badge {
  background: var(--brand-orange);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.session-item-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.session-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-small-action {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border-color);
  background: #20202a;
  color: #ffffff;
  transition: all 0.2s ease;
}

.btn-small-action:hover {
  background: var(--border-color);
  border-color: var(--brand-orange);
}

.btn-small-delete {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.btn-small-delete:hover {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: #ffffff;
}

/* Edición de sesión */
.edit-session-exercises-wrap {
  margin-top: 14px;
}

.section-heading {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 8px;
}

.edit-session-table-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.edit-ex-row {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.edit-ex-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: #ffffff;
  min-width: 140px;
}

.edit-ex-sets {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.edit-set-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card);
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  font-size: 0.78rem;
}

.edit-set-label {
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--brand-orange);
}

.edit-set-input {
  width: 52px;
  background: #000000;
  border: 1px solid var(--border-color);
  color: #ffffff;
  border-radius: 4px;
  padding: 3px 2px;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
}

.edit-set-input:focus {
  border-color: var(--brand-orange);
  outline: none;
}

