@charset "UTF-8";
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-family: inherit;
  vertical-align: baseline;
}

/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
  display: block;
}

ol, ul {
  list-style: none;
}

blockquote, q {
  quotes: none;
}

blockquote:before, blockquote:after,
q:before, q:after {
  content: "";
  content: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/*colors*/
/* Variables globales */
:root {
  --primary-color: #0056b3;
  --light-primary-color: #448aff;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --border-color: #e9ecef;
  --primary-txt-color: #212529;
  --secondary-txt-color: #6c757d;
  --muted-color: #6c757d;
}

/* Reset y base */
* {
  box-sizing: border-box;
}

body {
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  color: var(--primary-txt-color);
  background: #f5f7fb;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Estado cuando el menú móvil está abierto */
body.nav-open {
  overflow: hidden;
}

/* Personalización de barras de scroll */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: #0056b3;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #004494;
}

::-webkit-scrollbar-corner {
  background: #f1f1f1;
}

/* Para Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #0056b3 #f1f1f1;
}

/* Utilidades */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.muted {
  color: var(--muted-color);
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 36px;
  gap: 6px;
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn.btn-primary {
  background: var(--primary-color);
  color: #fff;
}
.btn.btn-primary:hover:not(:disabled) {
  background: #004494;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 86, 179, 0.3);
}
.btn.btn-secondary {
  background: var(--secondary-color);
  color: #fff;
}
.btn.btn-secondary:hover:not(:disabled) {
  background: #5a6268;
}
.btn.btn-danger {
  background: var(--danger-color);
  color: #fff;
}
.btn.btn-danger:hover:not(:disabled) {
  background: #c82333;
}
.btn.btn-success {
  background: var(--success-color);
  color: #fff;
}
.btn.btn-success:hover:not(:disabled) {
  background: #218838;
}

/* Loader */
.loader {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.modal-content {
  position: relative;
  background: #fff;
  border-radius: 12px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-handle {
  display: none;
}

@media (max-width: 767px) {
  .modal {
    align-items: flex-end;
    justify-content: center;
    padding: 0;
  }
  .modal.is-hidden {
    display: flex;
    visibility: hidden;
    pointer-events: none;
  }
  .modal.is-hidden .modal-backdrop {
    opacity: 0;
  }
  .modal.is-hidden .modal-content {
    transform: translateY(100%);
  }
  .modal-handle {
    display: block;
    width: 40px;
    height: 4px;
    background: #ccc;
    border-radius: 2px;
    margin: 10px auto 0;
    flex-shrink: 0;
  }
  .modal-content {
    position: relative;
    width: 100%;
    max-width: none;
    height: 90vh;
    max-height: 90vh;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(0);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  }
  .modal-body {
    max-height: calc(90vh - 140px);
    padding: 16px 20px;
    -webkit-overflow-scrolling: touch;
  }
  .modal-header {
    padding: 12px 20px 14px;
    flex-shrink: 0;
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border-color);
}
.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--secondary-txt-color);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}
.modal-close:hover {
  background-color: #f8f9fa;
}

.modal-body {
  padding: 20px;
  max-height: calc(90vh - 120px);
  overflow-y: auto;
}

/* Modal de acciones específico */
.modal-content.small {
  max-width: 400px;
  overflow: hidden;
}
.modal-content.small .modal-header {
  text-align: center;
  justify-content: center;
  position: relative;
  padding: 20px 24px;
}
.modal-content.small .modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
}
.modal-content.small .modal-header .modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--secondary-txt-color);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background-color 0.2s ease;
  z-index: 10;
}
.modal-content.small .modal-header .modal-close:hover {
  background-color: #f8f9fa;
}
.modal-content.small .modal-header .modal-close .material-symbols-outlined {
  font-size: 20px;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}
.modal-content.small .modal-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
}
.modal-content.small .modal-actions .menu-action {
  width: 100%;
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.modal-content.small .modal-actions .menu-action:hover {
  background: #004494;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 86, 179, 0.3);
}
.modal-content.small .modal-actions .menu-action:active {
  transform: translateY(0);
}
.modal-content.small {
  /* Responsive para móvil */
}
@media (max-width: 767px) {
  .modal-content.small {
    max-width: 90vw;
    margin: 20px;
  }
  .modal-content.small .modal-header {
    padding: 16px 20px;
  }
  .modal-content.small .modal-header h3 {
    font-size: 16px;
  }
  .modal-content.small .modal-header .modal-close {
    top: 8px;
    right: 8px;
    padding: 6px;
  }
  .modal-content.small .modal-header .modal-close .material-symbols-outlined {
    font-size: 18px;
  }
  .modal-content.small .modal-actions {
    gap: 10px;
  }
  .modal-content.small .modal-actions .menu-action {
    padding: 12px;
    font-size: 14px;
  }
}

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1002;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.toast {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  min-width: 300px;
  max-width: 90vw;
  text-align: center;
  animation: slideInFromTop 0.3s ease;
}
.toast.toast-success {
  border-left: 4px solid var(--success-color);
  background: linear-gradient(135deg, #fff, #f8fff8);
  border-color: var(--success-color);
  box-shadow: 0 6px 20px rgba(40, 167, 69, 0.15);
}
.toast.toast-success .material-symbols-outlined {
  color: var(--success-color);
}
.toast.toast-error {
  border-left: 4px solid var(--danger-color);
}
.toast.toast-warning {
  border-left: 4px solid var(--warning-color);
}
.toast.toast-info {
  border-left: 4px solid var(--info-color);
}

@keyframes slideInFromTop {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
@media (max-width: 380px) {
  .modal-header {
    padding: 10px 12px;
  }
  .modal-body {
    padding: 12px;
  }
}
/* Header */
/* Layout */
.app-header {
  padding: 20px 24px;
  background: linear-gradient(90deg, #0056b3, #448AFF);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-header h1 {
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-align: center;
}

/* Botón de menú móvil */
.menu-toggle {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background-color 0.2s ease;
  display: none;
}
.menu-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
}
.menu-toggle .material-symbols-outlined {
  font-size: 24px;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

/* States / Variants */
/* (agregar variantes del header aquí si fueran necesarias) */
/* Utilities */
/* (no se requieren utilidades específicas para header por ahora) */
/* Media queries */
@media (max-width: 767px) {
  .menu-toggle {
    display: block;
  }
}
/* Navegación (tabs) */
/* Layout */
.tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 16px 0;
  background: #fff;
  border: 1px solid #e0e0e0;
  padding: 6px;
  border-radius: 12px;
  position: sticky;
  top: 0;
  z-index: 5;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab {
  display: inline-block;
  padding: 8px 12px;
  color: #3b3b3b;
  text-decoration: none;
  border-radius: 10px;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

/* States */
.tab:hover {
  background: #f5f7fb;
}

.tab.is-active {
  background: #0056b3;
  color: #fff;
  box-shadow: 0 6px 14px rgba(0, 86, 179, 0.25);
}

/* Menú móvil desplegable */
.mobile-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-nav-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.mobile-nav {
  position: fixed;
  top: 0;
  left: -100%;
  width: 80%;
  max-width: 300px;
  height: 100%;
  background: #fff;
  z-index: 1001;
  transition: left 0.3s ease;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
}

.mobile-nav.is-active {
  left: 0;
}

.mobile-nav-header {
  padding: 20px 24px;
  background: linear-gradient(90deg, #0056b3, #448AFF);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.mobile-nav-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}
.mobile-nav-header .mobile-nav-close {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}
.mobile-nav-header .mobile-nav-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
}
.mobile-nav-header .mobile-nav-close .material-symbols-outlined {
  font-size: 24px;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

.mobile-nav-content {
  padding: 16px 0;
}
.mobile-nav-content .mobile-tab {
  display: block;
  padding: 16px 24px;
  color: #3b3b3b;
  text-decoration: none;
  border-bottom: 1px solid #e0e0e0;
  transition: background-color 0.2s ease;
}
.mobile-nav-content .mobile-tab:hover {
  background: #f5f7fb;
}
.mobile-nav-content .mobile-tab.is-active {
  background: #0056b3;
  color: #fff;
}

/* Utilities */
.is-hidden {
  display: none;
}

/* Media queries */
@media (max-width: 767px) {
  .tabs {
    display: none;
  }
}
/* Musculación */
/* Layout base de la sección */
.app-container {
  padding: 16px;
}

/* Filtros */
.filters .filters-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  flex-direction: column;
  margin-bottom: 20px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

/* Controles de formulario */
label {
  color: #5a6268;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}

input,
textarea,
select {
  color: #3b3b3b;
  font-size: 14px;
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 8px 10px;
  min-width: 0;
  width: 100%;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #448AFF;
  box-shadow: 0 0 0 3px rgba(68, 138, 255, 0.2);
}

/* Grid y tarjetas */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 14px;
  padding: 16px 16px 8px 16px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
}

.card h2 {
  margin-top: 0;
  margin-bottom: 12px;
}

/* Header del día con progreso */
.dia-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e0e0e0;
}
.dia-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #3b3b3b;
}

.progress-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-text {
  font-size: 12px;
  font-weight: 600;
  color: #5a6268;
  min-width: 30px;
}

.progress-bar {
  width: 60px;
  height: 4px;
  background: #f0f0f0;
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff6b35, #ff8c42);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.reset-progress-btn {
  background: transparent;
  border: 1px solid #e0e0e0;
  color: #5a6268;
  padding: 4px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  width: 24px;
  height: 24px;
}
.reset-progress-btn:hover {
  background: #f8f9fa;
  border-color: #5a6268;
  color: #3b3b3b;
}
.reset-progress-btn:active {
  transform: scale(0.95);
}
.reset-progress-btn .material-symbols-outlined {
  font-size: 16px;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

/* Tarjetas de ejercicios */
.ejercicios-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ejercicio-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.2s ease;
}
.ejercicio-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.ejercicio-card.completed {
  background: #f8fff8;
  border-color: #28a745;
}
.ejercicio-card.completed .ejercicio-nombre {
  text-decoration: line-through;
  color: #5a6268;
}
.ejercicio-card.completed .series-reps {
  color: #5a6268;
}

.ejercicio-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid #e0e0e0;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
}
.ejercicio-checkbox:checked {
  background: #0056b3;
  border-color: #0056b3;
}

.card-content {
  flex: 1;
  min-width: 0;
}

.ejercicio-nombre {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 600;
  color: #3b3b3b;
  line-height: 1.3;
}

.series-reps {
  margin: 0;
  font-size: 14px;
  color: #5a6268;
  font-weight: 500;
}

/* Tablas (mantener para compatibilidad) */
.tabla-ejercicios,
.tabla-progresion {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  table-layout: fixed;
  min-width: 520px;
}

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

.tabla-ejercicios thead,
.tabla-progresion thead {
  background: #f4f7ff;
}

.tabla-ejercicios th,
.tabla-ejercicios td,
.tabla-progresion th,
.tabla-progresion td {
  border-bottom: 1px solid #e0e0e0;
  padding: 10px 12px;
  text-align: center;
}

/* Anchos de columnas */
.tabla-ejercicios col.col-ejercicio {
  width: 56%;
}

.tabla-ejercicios col.col-series {
  width: 12%;
}

.tabla-ejercicios col.col-reps {
  width: 12%;
}

.tabla-ejercicios col.col-acciones {
  width: 20%;
}

.tabla-progresion col.col-fase {
  width: 18%;
}

.tabla-progresion col.col-duracion {
  width: 18%;
}

.tabla-progresion col.col-peso {
  width: 16%;
}

.tabla-progresion col.col-seriesreps {
  width: 28%;
}

.tabla-progresion col.col-otros {
  width: 20%;
}

.tabla-ejercicios tbody tr:hover {
  background: #fafafa;
}

/* Vista cards de progreso (móvil) */
.progreso-cards {
  display: none;
}

.progreso-cards .subtle {
  text-align: center;
  padding: 8px 0;
}

.progreso-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.progreso-card:last-child {
  margin-bottom: 0;
}

.progreso-card-header {
  display: block;
  background: #f4f7ff;
  color: #3b3b3b;
  font-weight: 700;
  font-size: 15px;
  padding: 12px 16px;
  margin: 0;
  border-bottom: 1px solid #e0e0e0;
}

.progreso-card-sets {
  padding: 12px 16px;
}

.progreso-card-set-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.progreso-card-set-row:last-child {
  border-bottom: none;
}

.progreso-card-set-label {
  color: #5a6268;
  font-weight: 500;
  min-width: 50px;
}

.progreso-card-set-value {
  color: #3b3b3b;
  font-weight: 600;
}

.progreso-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  padding: 10px 16px;
  font-size: 12px;
  color: #5a6268;
  background: #fafafa;
  border-top: 1px solid #e0e0e0;
}

.progreso-card-meta .progreso-card-meta-item strong {
  color: #3b3b3b;
  font-weight: 600;
  margin-right: 4px;
}

.progreso-card-notas {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  font-size: 13px;
  border-top: 1px solid #e0e0e0;
}

.progreso-card-notas .progreso-card-notas-label {
  font-weight: 600;
  color: #5a6268;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.progreso-card-notas .progreso-card-notas-value {
  color: #3b3b3b;
  line-height: 1.4;
}

.progreso-card-actions {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid #e0e0e0;
  background: #fff;
}

.progreso-card-actions .btn {
  flex: 1;
}

/* Tarjetas de días como contenedores grandes */
.dia {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.dia + .dia {
  margin-top: 0;
}

/* Acciones por fila */
.acciones {
  display: inline-flex;
  gap: 6px;
}

.menu-acciones {
  position: relative;
  display: inline-block;
}

.menu-trigger {
  background: #5a6268;
  color: #fff;
  border: 0;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.menu-trigger svg {
  width: 22px;
  height: 22px;
  display: block;
}
.menu-trigger svg path {
  fill: #fff;
}
.menu-trigger .material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  font-size: 22px;
  line-height: 1;
  display: block;
  color: #fff;
}

.menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  padding: 6px;
  z-index: 5;
  display: none;
}

.menu-acciones.is-open .menu-dropdown {
  display: block;
}

.menu-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: #3b3b3b;
  padding: 10px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.menu-item:hover {
  background: #f5f7fb;
}

/* Layout del formulario de Progreso (misma línea para campos) */
.form-grid {
  margin-top: 20px;
}
.form-grid .form-row {
  margin-bottom: 20px;
  display: grid;
  grid-template-rows: auto auto;
  gap: 4px;
}
.form-grid .form-row label {
  margin-bottom: 0;
}
.form-grid .sets-list {
  display: grid;
  gap: 20px;
  margin-bottom: 20px;
}
.form-grid .sets-list .set-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 12px;
}
.form-grid .sets-list .set-card .set-head {
  font-weight: 600;
  margin-bottom: 10px;
}
.form-grid .sets-list .set-card .set-fields {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  align-items: end;
}
.form-grid .sets-list .set-card .set-fields .form-row {
  margin-bottom: 0;
}
.form-grid .form-actions {
  display: flex;
  gap: 20px;
  justify-content: flex-end;
}

/* Chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 10px 0;
}

.chip {
  background: #eef3ff;
  color: #0056b3;
  border: 1px solid rgb(66.8, 157.2201117318, 255);
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

/* Utilidades */
.subtle {
  color: #5a6268;
}

.demo-title {
  text-align: center;
}

.info {
  color: #097c93;
}

/* Modal de confirmación de reset */
.reset-confirmation {
  text-align: center;
}
.reset-confirmation p {
  margin-bottom: 16px;
  font-size: 16px;
  line-height: 1.5;
}
.reset-confirmation p.warning-text {
  color: #dc3545;
  font-size: 14px;
  font-weight: 500;
}
.reset-confirmation .modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}
.reset-confirmation .modal-actions .btn {
  min-width: 120px;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s ease;
}
.reset-confirmation .modal-actions .btn.btn-secondary {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  color: #6c757d;
}
.reset-confirmation .modal-actions .btn.btn-secondary:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}
.reset-confirmation .modal-actions .btn.btn-danger {
  background: #dc3545;
  border: 1px solid #dc3545;
  color: #fff;
}
.reset-confirmation .modal-actions .btn.btn-danger:hover {
  background: #c82333;
  border-color: #bd2130;
}

/* Media queries */
@media (min-width: 640px) {
  .filters .filters-row {
    flex-direction: row;
    align-items: center;
  }
  input[type=text],
  select,
  .btn-primary {
    width: auto;
    font-size: 14px;
  }
}
@media (min-width: 920px) {
  .grid {
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
  }
  #sec-rutina {
    grid-column: span 12;
  }
  #sec-cardio {
    grid-column: span 6;
  }
  #sec-progresion {
    grid-column: span 6;
  }
  #sec-notas {
    grid-column: span 12;
  }
  #sec-asistente {
    grid-column: 2/12;
    background: transparent;
    padding: 0;
    box-shadow: none;
    border: none;
  }
}
/* Estilos específicos para móvil (380px) */
@media (max-width: 767px) {
  .app-container {
    padding: 12px;
  }
  .filters .filters-row {
    padding: 16px;
    gap: 12px;
  }
  .card {
    padding: 16px;
    border-radius: 12px;
  }
  .card h2 {
    font-size: 18px;
    margin-bottom: 16px;
  }
  /* Header del día en móvil */
  .dia-header {
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
  }
  .dia-header h3 {
    font-size: 18px;
  }
  .progress-container {
    align-self: flex-end;
    gap: 6px;
  }
  .reset-progress-btn {
    width: 22px;
    height: 22px;
  }
  .reset-progress-btn .material-symbols-outlined {
    font-size: 14px;
  }
  /* Tarjetas de ejercicios en móvil */
  .ejercicio-card {
    padding: 14px;
    gap: 10px;
  }
  .ejercicio-nombre {
    font-size: 15px;
  }
  .series-reps {
    font-size: 13px;
  }
  /* Progreso: cards en móvil, tabla oculta */
  .progreso-content .progreso-table {
    display: none;
  }
  .progreso-content .progreso-cards {
    display: block;
  }
  /* Tablas en móvil: scroll horizontal para mostrar todas las columnas */
  .table-wrapper {
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .tabla-ejercicios,
  .tabla-progresion {
    min-width: 650px;
    width: max-content;
    table-layout: auto;
    font-size: 13px;
  }
  .tabla-ejercicios th,
  .tabla-ejercicios td,
  .tabla-progresion th,
  .tabla-progresion td {
    padding: 8px 10px;
    white-space: nowrap;
  }
  /* Ajustes para formularios en móvil */
  .form-grid .form-row {
    margin-bottom: 16px;
  }
  .form-grid .sets-list {
    gap: 16px;
  }
  .form-grid .sets-list .set-card {
    padding: 16px;
  }
  .form-grid .sets-list .set-card .set-fields {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .form-grid .form-actions {
    flex-direction: column;
    gap: 12px;
  }
  .form-grid .form-actions .btn {
    width: 100%;
  }
  /* Mejoras para chips en móvil */
  .chips {
    gap: 6px;
    margin: 12px 0;
  }
  .chips .chip {
    font-size: 11px;
    padding: 6px 10px;
  }
  /* Ajustes para menús de acciones */
  .menu-dropdown {
    min-width: 180px;
    right: -10px;
  }
  .menu-item {
    padding: 12px 10px;
    font-size: 14px;
  }
}
/* Estilos específicos para pantallas muy pequeñas (380px) */
@media (max-width: 380px) {
  .app-container {
    padding: 8px;
  }
  .filters .filters-row {
    padding: 12px;
    gap: 10px;
  }
  .card {
    padding: 0px;
    background-color: transparent;
    border: none;
    box-shadow: none;
  }
  .card h2 {
    font-size: 16px;
    margin-bottom: 12px;
  }
  /* Header del día en pantallas muy pequeñas */
  .dia-header {
    margin-bottom: 16px;
    flex-direction: row;
  }
  .dia-header h3 {
    font-size: 16px;
  }
  .reset-progress-btn {
    width: 20px;
    height: 20px;
  }
  .reset-progress-btn .material-symbols-outlined {
    font-size: 12px;
  }
  /* Tarjetas de ejercicios en pantallas muy pequeñas */
  .ejercicio-card {
    padding: 12px;
    gap: 8px;
  }
  .ejercicio-nombre {
    font-size: 14px;
  }
  .series-reps {
    font-size: 12px;
  }
  .tabla-ejercicios,
  .tabla-progresion {
    min-width: 600px;
    font-size: 12px;
  }
  .tabla-ejercicios th,
  .tabla-ejercicios td,
  .tabla-progresion th,
  .tabla-progresion td {
    padding: 6px 8px;
  }
  .form-grid .sets-list .set-card {
    padding: 12px;
  }
  .form-grid .sets-list .set-card .set-fields {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .chips .chip {
    font-size: 10px;
    padding: 4px 8px;
  }
  /* Modal de confirmación en pantallas muy pequeñas */
  .reset-confirmation .modal-actions {
    flex-direction: column;
    gap: 8px;
  }
  .reset-confirmation .modal-actions .btn {
    min-width: auto;
    width: 100%;
    padding: 12px 16px;
  }
}
/* Cardio */
#sec-cardio {
  min-height: 1px;
}

/* Media queries */
/* (agregar estilos responsivos específicos si aplica) */
/* Progresión */
#sec-progresion {
  min-height: 1px;
}

/* Chart wrapper - scroll horizontal en móvil */
.chart-wrapper {
  position: relative;
  width: 100%;
  min-height: 260px;
  margin-top: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 767px) {
  .chart-wrapper {
    min-width: 400px;
    min-height: 240px;
  }
}

/* Media queries */
/* (agregar estilos responsivos específicos si aplica) */
/* Nutrición */
#sec-notas {
  min-height: 1px;
}

/* Media queries */
/* (agregar estilos responsivos específicos si aplica) */
/* Asistente */
.assistant-grid {
  display: grid;
  grid-template-columns: 4fr 6fr;
  gap: 16px;
}

@media (max-width: 920px) {
  .assistant-grid {
    grid-template-columns: 1fr;
  }
}
.chat {
  display: grid;
  grid-template-rows: auto 1fr auto;
  /* header, log, form */
  gap: 12px;
  min-height: 360px;
  background: #fff;
  padding: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
}

.chat-log {
  max-height: none;
  overflow: auto;
}

.chat-history {
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 20px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 0 5px 0;
  border-bottom: 1px solid #e0e0e0;
  font-weight: 600;
}

.panel-header .btn-clear-history {
  padding: 6px 10px;
}

.muted {
  color: #5a6268;
  font-weight: 500;
}

.trash-btn {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
}

.trash-btn:hover {
  background: #fff0f0;
}

.trash-btn .material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  font-size: 18px;
  line-height: 1;
  color: #d11528;
  display: block;
}

.history-list {
  padding: 10px 12px;
  overflow: auto;
  max-height: 100%;
  color: #3b3b3b;
}

.history-item {
  padding: 8px 10px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 14px;
}

.history-item:hover {
  background: #f7f9fc;
}

.history-item.is-new {
  animation: fadeInHistory 300ms ease-in, flashHistory 900ms ease-out;
}

@keyframes fadeInHistory {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes flashHistory {
  0% {
    background-color: rgba(0, 183, 74, 0.5);
  }
  100% {
    background-color: transparent;
  }
}
.history-date {
  font-size: 10px;
  font-style: italic;
  color: #3b3b3b;
  font-weight: 600;
  margin-top: 4px;
}

.chat-msg {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.chat-msg.user {
  justify-content: flex-end;
}

.chat-bubble {
  padding: 10px 12px;
  border-radius: 12px;
  max-width: 82%;
  font-size: 14px;
  color: #3b3b3b;
  font-family: inherit;
  line-height: 160%;
}

.chat-msg.user .chat-bubble {
  background: #e8f0ff;
}

.chat-msg.assistant .chat-bubble {
  background: #f5f5f5;
}

.typing-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  background: #5a6268;
  animation: typingBlink 1s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typingBlink {
  0%, 80%, 100% {
    opacity: 0.2;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-2px);
  }
}
.chat-form {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
  gap: 8px;
}

.chat-form .btn-primary {
  width: 100%;
}

.chat-form textarea#chat-input {
  background-color: transparent;
  resize: none;
  overflow: auto;
  min-height: 42px;
  /* ~1 línea */
  max-height: calc(7.2em + 16px);
  /* 6 líneas aprox + padding */
  line-height: 1.2em;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 8px 10px;
  min-width: 0;
  width: 100%;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  color: #3b3b3b;
  font-size: 14px;
  font-family: inherit;
}

/* Estilos para el efecto de confeti */
/* Canvas del confeti */
#confetti-canvas {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none !important;
  z-index: 9999 !important;
  mix-blend-mode: normal;
  filter: contrast(1.2) brightness(1.1);
}

/* Efecto de brillo en el elemento completado */
.dia.completed {
  animation: celebration-glow 2s ease-in-out;
  position: relative;
}
.dia.completed::before {
  content: "";
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  background: linear-gradient(45deg, #FF6B35, #FF8C42, #28A745, #20C997, #FFC107, #FFCA2C, #6F42C1, #E83E8C);
  background-size: 400% 400%;
  border-radius: 16px;
  z-index: -1;
  animation: rainbow-border 2s ease-in-out;
  opacity: 0.3;
}

@keyframes celebration-glow {
  0% {
    box-shadow: 0 0 0 rgba(40, 167, 69, 0);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 30px rgba(40, 167, 69, 0.8), 0 0 60px rgba(255, 107, 53, 0.4);
    transform: scale(1.02);
  }
  100% {
    box-shadow: 0 0 0 rgba(40, 167, 69, 0);
    transform: scale(1);
  }
}
@keyframes rainbow-border {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
/* Efecto de vibración para la celebración */
@keyframes celebration-vibrate {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-2px);
  }
  75% {
    transform: translateX(2px);
  }
}
/* Efecto de pulso en la barra de progreso al completar */
.progress-fill.completed {
  animation: progress-pulse 1s ease-in-out;
  box-shadow: 0 0 15px rgba(40, 167, 69, 0.8);
}

@keyframes progress-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 15px rgba(40, 167, 69, 0.8);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 25px rgb(40, 167, 69), 0 0 35px rgba(255, 107, 53, 0.6);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 15px rgba(40, 167, 69, 0.8);
  }
}
/* Mejoras para móvil */
@media (max-width: 767px) {
  #confetti-canvas {
    /* Reducir la intensidad en móvil para mejor rendimiento */
    opacity: 0.8;
  }
  .dia.completed {
    animation-duration: 1.5s;
  }
}
@media (max-width: 380px) {
  #confetti-canvas {
    opacity: 0.7;
  }
}