/* ==========================================================================
   Calculadora de ergonomía y alivio de espalda para oficina
   Diseño corporativo fijate.com • Temas oscuro y claro • 100% responsivo
   ========================================================================== */

:root {
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Paleta en modo oscuro */
  --bg-app: #090d16;
  --bg-card: #111827;
  --bg-card-subtle: #1a2234;
  --bg-input: #1e293b;
  --border-card: #2d3748;
  --border-focus: #3b82f6;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-secondary: #cbd5e1;

  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: rgba(59, 130, 246, 0.15);

  --accent-green: #10b981;
  --accent-green-bg: rgba(16, 185, 129, 0.12);
  --accent-amber: #f59e0b;
  --accent-amber-bg: rgba(245, 158, 11, 0.12);
  --accent-purple: #8b5cf6;
  --accent-purple-bg: rgba(139, 92, 246, 0.12);
  --accent-rose: #f43f5e;

  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

[data-theme="light"] {
  --bg-app: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-subtle: #f8fafc;
  --bg-input: #f1f5f9;
  --border-card: #e2e8f0;
  --border-focus: #2563eb;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-secondary: #334155;

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: rgba(37, 99, 235, 0.1);

  --accent-green: #059669;
  --accent-green-bg: rgba(5, 150, 105, 0.1);
  --accent-amber: #d97706;
  --accent-amber-bg: rgba(217, 119, 6, 0.1);
  --accent-purple: #7c3aed;
  --accent-purple-bg: rgba(124, 58, 237, 0.1);
  --accent-rose: #e11d48;

  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.06), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-app);
  color: var(--text-main);
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}

.mono-num {
  font-family: var(--font-mono);
}

/* Layout canónico */
.main-wrapper.tool-layout {
  max-width: 1200px;
  width: 100%;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  flex: 1 0 auto;
}

.tool-with-sidebar {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  width: 100%;
}

.tool-main-content {
  flex: 1 1 0%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Barra de navegación por pestañas de la herramienta */
.tool-nav-tabs {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 0.35rem;
  overflow-x: auto;
}

.tool-nav-btn {
  flex: 1 1 0%;
  min-width: 140px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tool-nav-btn:hover {
  color: var(--text-main);
  background: var(--primary-light);
}

.tool-nav-btn.nav-tab-active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.tool-tab-panel {
  display: none;
  flex-direction: column;
  gap: 1.5rem;
}

.tool-tab-panel.tab-panel-active {
  display: flex;
}

/* Tarjetas principales */
.card-main {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}

.card-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.card-title-group h2 {
  font-size: 1.35rem;
  margin-bottom: 0.25rem;
}

.card-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Grid de calculadora: Formulario + Resultados */
.calc-layout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 900px) {
  .calc-layout-grid {
    grid-template-columns: 380px 1fr;
  }
}

/* Panel de controles (formulario) */
.calc-controls-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.slider-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.slider-range {
  flex: 1 1 0%;
  height: 8px;
  border-radius: 4px;
  background: var(--border-card);
  outline: none;
  cursor: pointer;
  accent-color: var(--primary);
}

.number-input-unit {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 0 0.5rem;
  height: 42px;
  width: 90px;
}

.number-input-unit input {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  text-align: right;
  outline: none;
}

.number-input-unit .unit {
  margin-left: 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Botones conmutadores de modo */
.toggle-group-duo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.btn-toggle-option {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--bg-input);
  color: var(--text-muted);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-toggle-option:hover {
  border-color: var(--border-focus);
  color: var(--text-main);
}

.btn-toggle-option.btn-toggle-active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Selects accesibles */
.custom-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 42px;
  background-color: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 0 40px 0 0.75rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  appearance: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

.custom-select:focus {
  outline: 2px solid var(--border-focus);
}

.custom-select option,
.custom-select optgroup {
  background-color: var(--bg-card);
  color: var(--text-main);
}

/* Radios estilizados de tipo de visión / gafas */
.radio-cards-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.radio-card-label {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  transition: border-color 0.2s;
}

.radio-card-label:hover {
  border-color: var(--border-focus);
}

.radio-card-label input[type="radio"] {
  margin-top: 0.2rem;
  accent-color: var(--primary);
  width: 17px;
  height: 17px;
  cursor: pointer;
}

.radio-card-content {
  display: flex;
  flex-direction: column;
}

.radio-card-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.radio-card-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Panel de resultados métricos */
.calc-results-box {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

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

.metric-pill-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  position: relative;
  overflow: hidden;
}

.metric-pill-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary);
}

.metric-pill-card.metric-highlight::before {
  background: var(--accent-green);
}

.metric-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-main);
}

.metric-note {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* Caja de alerta ergonómica para gafas progresivas */
.ergonomic-alert-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: var(--accent-green-bg);
  border: 1px solid var(--accent-green);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  color: var(--text-main);
}

.ergonomic-alert-icon {
  flex-shrink: 0;
  color: var(--accent-green);
  margin-top: 0.15rem;
}

.ergonomic-alert-body h4 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  color: var(--accent-green);
}

.ergonomic-alert-body p {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

/* Diagrama SVG interactivo */
.diagram-container-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.diagram-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.visor-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulseDot 1.8s infinite alternate ease-in-out;
}

@keyframes pulseDot {
  from { opacity: 0.5; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1.2); }
}

.visor-badge-norm {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-card);
}

/* Viewport del visor 3D */
.visor-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #050811;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.visor-bg-render {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: contrast(1.04) brightness(1.02);
  transition: opacity 0.35s ease;
}

/* Capa HUD */
.visor-hud-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hud-marker {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hud-badge {
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(56, 189, 248, 0.5);
  border-radius: 8px;
  padding: 4px 10px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.hud-badge-accent {
  border-color: rgba(16, 185, 129, 0.6);
}

.hud-label {
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.4px;
}

.hud-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: #38bdf8;
  line-height: 1.2;
}

.hud-badge-accent .hud-val {
  color: #34d399;
}

.hud-pin-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8;
  flex-shrink: 0;
}

.hud-badge-accent + .hud-pin-dot {
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
}

/* Posiciones en visor */
.hud-marker-monitor {
  top: 9%;
  right: 28%;
}

.hud-marker-desk {
  top: 49%;
  right: 27%;
}

.hud-marker-chair {
  top: 67%;
  left: 36%;
  flex-direction: row-reverse;
}

.hud-marker-distance {
  top: 25%;
  right: 39%;
}

.hud-optic-pill {
  position: absolute;
  bottom: 12px;
  left: 14px;
  background: rgba(16, 185, 129, 0.16);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(16, 185, 129, 0.45);
  border-radius: 20px;
  padding: 5px 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #34d399;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

@media (max-width: 640px) {
  .hud-badge {
    padding: 3px 6px;
  }
  .hud-label {
    font-size: 0.58rem;
  }
  .hud-val {
    font-size: 0.85rem;
  }
  .hud-optic-pill {
    font-size: 0.68rem;
    padding: 4px 8px;
    bottom: 6px;
    left: 8px;
  }
}

/* Catálogo de estiramientos */
.stretches-filter-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
}

.btn-filter-zone {
  min-height: 38px;
  padding: 0.4rem 0.9rem;
  background: var(--bg-card-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-filter-zone:hover {
  color: var(--text-main);
  border-color: var(--border-focus);
}

.btn-filter-zone.btn-filter-active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.stretches-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .stretches-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .stretches-cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.stretch-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform 0.2s, border-color 0.2s;
}

.stretch-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

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

.stretch-zone-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  letter-spacing: 0.4px;
}

.stretch-zone-cervical {
  background: var(--primary-light);
  color: var(--primary);
}

.stretch-zone-dorsal {
  background: var(--accent-purple-bg);
  color: var(--accent-purple);
}

.stretch-zone-lumbar {
  background: var(--accent-amber-bg);
  color: var(--accent-amber);
}

.stretch-zone-munecas {
  background: var(--accent-green-bg);
  color: var(--accent-green);
}

.stretch-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stretch-card-title {
  font-size: 1.1rem;
}

.stretch-target-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.stretch-purpose {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.stretch-meta-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.meta-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.stretch-details-accordion {
  border-top: 1px solid var(--border-card);
  padding-top: 0.75rem;
  margin-top: auto;
}

.stretch-details-summary {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  user-select: none;
}

.stretch-steps-list {
  margin: 0.75rem 0 0.5rem 1.1rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.stretch-tip-box {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.6rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.stretch-tip-box svg {
  flex-shrink: 0;
  color: var(--accent-amber);
  margin-top: 2px;
}

/* Reproductor de Rutina Guiada (3 min exprés) */
.routine-player-box {
  background: linear-gradient(145deg, var(--bg-card-subtle), var(--bg-card));
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.routine-header-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 600px;
}

.routine-badge-live {
  background: var(--primary-light);
  color: var(--primary);
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.routine-counter-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Temporizador circular SVG */
.routine-timer-container {
  position: relative;
  width: 150px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.5rem 0;
}

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

.routine-circle-bg {
  fill: none;
  stroke: var(--border-card);
  stroke-width: 8;
}

.routine-circle-bar {
  fill: none;
  stroke: var(--primary);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 402.12;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.3s;
}

.routine-player-box.routine-active .routine-circle-bar {
  stroke: var(--accent-green);
}

.routine-timer-inner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.routine-timer-seconds {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.routine-timer-unit {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.routine-exercise-card {
  width: 100%;
  max-width: 650px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.routine-zone-pill {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
}

.routine-ex-title {
  font-size: 1.3rem;
  color: var(--text-main);
}

.routine-ex-target {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.routine-ex-steps {
  margin: 0.5rem 0 0 1.25rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.routine-ex-tip {
  font-size: 0.82rem;
  color: var(--accent-amber);
  background: var(--accent-amber-bg);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  margin-top: 0.35rem;
}

.routine-controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  width: 100%;
  max-width: 500px;
}

.btn-routine-action {
  min-height: 46px;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s;
  border: none;
}

.btn-routine-primary {
  background: var(--primary);
  color: #ffffff;
  flex: 1 1 180px;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.btn-routine-primary:hover {
  background: var(--primary-hover);
}

.btn-routine-primary.btn-active-running {
  background: var(--accent-amber);
  color: #ffffff;
}

.btn-routine-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-card);
  flex: 0 1 120px;
}

.btn-routine-secondary:hover {
  border-color: var(--border-focus);
}

/* Checklist de ergonomía */
.checklist-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 860px) {
  .checklist-card-grid {
    grid-template-columns: 320px 1fr;
  }
}

.checklist-score-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
}

.score-circle-display {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.score-number {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-main);
}

.score-progress-bar-container {
  width: 100%;
  height: 10px;
  background: var(--border-card);
  border-radius: 5px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.score-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: 5px;
  transition: width 0.3s ease, background 0.3s;
}

.score-badge {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
}

.badge-optimal {
  background: var(--accent-green-bg);
  color: var(--accent-green);
  border: 1px solid var(--accent-green);
}

.badge-good {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary);
}

.badge-warning {
  background: var(--accent-amber-bg);
  color: var(--accent-amber);
  border: 1px solid var(--accent-amber);
}

.badge-danger {
  background: rgba(244, 63, 94, 0.12);
  color: var(--accent-rose);
  border: 1px solid var(--accent-rose);
}

.checklist-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.checklist-item-row {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: border-color 0.2s;
}

.checklist-item-row:hover {
  border-color: var(--border-focus);
}

.checklist-item-checkbox {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  margin-top: 2px;
  cursor: pointer;
}

.checklist-item-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.checklist-item-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
}

.checklist-item-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Modales (Sin alerts) */
.modal-backdrop-generic,
.modal-report-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop-generic.modal-open,
.modal-report-overlay.modal-open {
  display: flex;
}

.modal-card-generic,
.modal-report-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  max-width: 550px;
  width: 100%;
  padding: 1.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: modalScaleUp 0.2s ease-out;
}

.modal-report-card {
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title-generic {
  font-size: 1.25rem;
}

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

.modal-btn-close:hover {
  color: var(--text-main);
}

.modal-body-generic {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.modal-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.btn-primary-generic {
  min-height: 42px;
  padding: 0.5rem 1.2rem;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
}

/* Informe imprimible */
.report-header-card {
  border-bottom: 1px solid var(--border-card);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.report-logo-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

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

.report-section-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 600px) {
  .report-section-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.report-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.report-box h4 {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  color: var(--primary);
}

.report-data-list,
.report-tips-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.report-alert-box {
  background: var(--accent-green-bg);
  border: 1px solid var(--accent-green);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  line-height: 1.4;
}

/* Responsive para pantallas móviles */
@media (max-width: 640px) {
  .main-wrapper.tool-layout {
    padding: 0 0.75rem;
    margin: 1rem auto 2rem;
  }

  .card-main {
    padding: 1.15rem;
  }

  .calc-controls-box {
    padding: 1rem;
  }

  .routine-player-box {
    padding: 1.25rem 1rem;
  }

  .btn-routine-action {
    width: 100%;
    flex: 1 1 100%;
  }

  .tool-nav-tabs {
    flex-wrap: nowrap;
  }

  .tool-nav-btn {
    min-width: 120px;
    font-size: 0.88rem;
  }
}

/* Reglas de impresión limpias */
@media print {
  .app-header,
  .fijate-footer,
  .tool-ad-sidebar,
  .tools-ad-banner-section,
  .tool-nav-tabs,
  .calc-controls-box,
  .modal-card-actions,
  .btn-routine-action,
  .modal-btn-close {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .modal-report-overlay {
    position: static !important;
    background: none !important;
    padding: 0 !important;
    display: block !important;
  }

  .modal-report-card {
    max-width: 100% !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  .report-box {
    border: 1px solid #cccccc !important;
    background: #fafafa !important;
  }
}
