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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f8f7f5;
  color: #444;
  line-height: 1.6;
}

.contenedor {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

/* CABECERA */
.cabecera {
  background-color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin-bottom: 20px;
}

.cabecera_inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
}

.cabecera_titulo {
  font-size: 28px;
  color: #333;
  margin: 0;
  font-weight: 500;
}

.btn-volver {
  background-color: #bbb;
  color: white;
  padding: 10px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
}

.btn-volver:hover {
  background-color: #999;
}

/* TÍTULO CON MICRÓFONO */
.titulo-con-microfono {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-microfono {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.btn-microfono:hover {
  background-color: #f0f0f0;
  color: #8ab4d5;
}

.btn-microfono.grabando {
  background-color: #ff6b6b;
  color: white;
  animation: pulse 1s infinite;
}

/* CRÉDITO */
.credito {
  border: 3px double #999;
  padding: 15px;
  text-align: center;
  margin: 0 20px 20px 20px;
  font-size: 12px;
  background-color: #fafaf8;
  color: #666;
}

.credito p {
  margin: 0;
  line-height: 1.4;
}

/* ACCIONES */
.acciones {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

/* BOTONES */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.btn-primario {
  background-color: #8ab4d5;
  color: white;
}

.btn-primario:hover {
  background-color: #6a94b5;
}

.btn-secundario {
  background-color: #ddd;
  color: #666;
}

.btn-secundario:hover {
  background-color: #bbb;
  color: #333;
}

.btn-pequeno {
  padding: 8px 12px;
  font-size: 12px;
}

.btn-eliminar-fragmento,
.btn-eliminar-sesion {
  background-color: #c89999;
  color: white;
  padding: 6px 10px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
}

.btn-eliminar-fragmento:hover,
.btn-eliminar-sesion:hover {
  background-color: #a87777;
}

/* TARJETAS */
.tarjeta {
  background-color: #fff;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.tarjeta h2 {
  font-size: 20px;
  margin-bottom: 15px;
  color: #333;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 10px;
  font-weight: 500;
}

.tarjeta h3 {
  font-size: 16px;
  margin-top: 20px;
  margin-bottom: 10px;
  color: #333;
  font-weight: 500;
}

.tarjeta h4 {
  font-size: 14px;
  margin-top: 15px;
  margin-bottom: 8px;
  color: #666;
  font-weight: 500;
}

.tarjeta_cuerpo {
  margin-bottom: 15px;
}

.tarjeta_cuerpo label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: #555;
  font-size: 14px;
}

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

/* INPUTS */
.input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  background-color: #fafaf8;
}

.input:focus {
  outline: none;
  border-color: #8ab4d5;
  background-color: #fff;
  box-shadow: 0 0 5px rgba(138, 180, 213, 0.3);
}

textarea.input {
  resize: vertical;
  min-height: 80px;
}

/* PESTAÑAS */
.pestanas {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  border-bottom: 1px solid #e0e0e0;
}

.btn-vista {
  background-color: transparent;
  color: #888;
  border: none;
  padding: 10px 15px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
}

.btn-vista:hover {
  color: #555;
}

.btn-vista.activo {
  color: #8ab4d5;
  border-bottom-color: #8ab4d5;
}

.btn-vista:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  color: #ccc;
}

.vista-contenido {
  animation: fadeIn 0.3s ease;
}

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

/* TIEMPO TOTAL */
.tiempo-total-pieza {
  background-color: #f5f9fc;
  border-left: 3px solid #8ab4d5;
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 4px;
  font-size: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tiempo-total-pieza strong {
  font-size: 20px;
  color: #8ab4d5;
}

/* FRAGMENTOS */
.lista-fragmentos {
  margin-top: 20px;
}

.fragmento-item {
  background-color: #f9f8f7;
  border-left: 3px solid #8ab4d5;
  padding: 12px;
  margin-bottom: 10px;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fragmento-header {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fragmento-compases {
  background-color: #8ab4d5;
  color: white;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 12px;
  margin-left: 10px;
}

/* SESIONES */
.temporizador-contenedor {
  background-color: #f5f9fc;
  padding: 20px;
  border-radius: 6px;
  margin-bottom: 20px;
}

.temporizador {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

#tiempoDisplay {
  font-size: 48px;
  font-weight: bold;
  color: #8ab4d5;
  font-family: 'Courier New', monospace;
}

.temporizador-botones {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* METRÓNOMO */
.metronomo {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1rem;
  background-color: #f0f0f0;
  border-radius: 8px;
}

.metronomo-controles {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.metronomo-controles label {
  font-weight: bold;
  margin: 0;
}

.input-bpm {
  width: 80px;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  text-align: center;
  font-size: 1rem;
}

#btnMetronomo {
  background-color: #6bd4f3;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
}

#btnMetronomo:hover {
  background-color: #5ab8d8;
}

#btnMetronomo.activo {
  background-color: #ff6b6b;
  font-weight: bold;
}

/* Indicador visual de pulsos */
.metronomo-pulsos {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.pulso {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: #ddd;
  border: 2px solid #999;
  transition: all 0.1s;
}

.pulso.fuerte {
  background-color: #666;
  border-color: #333;
}

.pulso.activo {
  background-color: #ffff00;
  box-shadow: 0 0 10px rgba(255, 255, 0, 0.8);
  transform: scale(1.2);
}

.pulso.fuerte.activo {
  background-color: #ff9900;
  box-shadow: 0 0 15px rgba(255, 153, 0, 0.9);
}

/* GRABACIÓN DE SESIÓN */
.grabacion-sesion {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.btn-microfono-sesion {
  background: none;
  border: 2px solid #ddd;
  color: #666;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.btn-microfono-sesion:hover {
  border-color: #8ab4d5;
  color: #8ab4d5;
  background-color: #f5f9fc;
}

.btn-microfono-sesion.grabando {
  background-color: #ff6b6b;
  color: white;
  border-color: #ff6b6b;
  animation: pulse 1s infinite;
}

.btn-reproducir {
  background-color: #27ae60;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.btn-reproducir:hover {
  background-color: #229954;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* BOTONES DE PROGRESO */
.botones-progreso {
  display: flex;
  gap: 30px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.boton-progreso-grupo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.btn-progreso {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #ddd;
  background-color: #f9f8f7;
  color: #888;
  cursor: pointer;
  font-size: 20px;
  transition: all 0.3s ease;
  padding: 0;
}

.btn-progreso:hover {
  border-color: #8ab4d5;
  color: #8ab4d5;
}

.btn-progreso.activo {
  background-color: #8ab4d5;
  color: white;
  border-color: #8ab4d5;
}

.btn-progreso[data-progreso="En proceso"].activo {
  background-color: #e74c3c;
  border-color: #e74c3c;
}

.btn-progreso[data-progreso="Sale mejor"].activo {
  background-color: #f39c12;
  border-color: #f39c12;
}

.btn-progreso[data-progreso="Dominado"].activo {
  background-color: #27ae60;
  border-color: #27ae60;
}

.titulo-progreso {
  font-size: 12px;
  color: #888;
  font-weight: 600;
  text-align: center;
  width: 70px;
}

.checkbox-grupo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  font-weight: normal;
  cursor: pointer;
  color: #666;
}

.checkbox-label input {
  margin-right: 8px;
  cursor: pointer;
}

.lista-sesiones {
  margin-top: 20px;
}

.sesion-item {
  background-color: #f9f8f7;
  border-left: 3px solid #8ab4d5;
  padding: 15px;
  margin-bottom: 15px;
  border-radius: 4px;
}

.sesion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.sesion-tiempo {
  background-color: #8ab4d5;
  color: white;
  padding: 6px 12px;
  border-radius: 3px;
  font-weight: 600;
  font-size: 14px;
}

.sesion-detalle {
  margin-bottom: 10px;
}

.sesion-detalle p {
  margin: 5px 0;
  font-size: 13px;
  color: #666;
}

.celda-notas {
  max-width: 200px;
  word-wrap: break-word;
}

/* INFORME */
.tabla-informe {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 13px;
}

.tabla-informe thead {
  background-color: #f5f9fc;
  color: #333;
  border-bottom: 2px solid #8ab4d5;
}

.tabla-informe th,
.tabla-informe td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}

.tabla-informe tbody tr:hover {
  background-color: #fafaf8;
}

.tabla-informe tbody tr:nth-child(even) {
  background-color: #f9f8f7;
}

.resumen-informe {
  background-color: #f5f9fc;
  padding: 20px;
  border-radius: 6px;
  margin-bottom: 20px;
  border-left: 3px solid #8ab4d5;
}

.resumen-informe h3 {
  color: #333;
  margin-bottom: 15px;
  font-weight: 500;
}

.resumen-informe h4 {
  color: #666;
  margin-top: 15px;
  margin-bottom: 10px;
  font-weight: 500;
}

.resumen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.resumen-item {
  background-color: white;
  padding: 15px;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.resumen-label {
  display: block;
  font-size: 12px;
  color: #888;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.resumen-valor {
  display: block;
  font-size: 18px;
  font-weight: bold;
  color: #8ab4d5;
}

.resumen-seccion {
  margin-top: 15px;
}

.resumen-lista {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.badge {
  background-color: #e8f1f7;
  color: #8ab4d5;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid #8ab4d5;
}

.graficos-informe {
  margin-top: 30px;
}

.graficos-informe h3 {
  color: #333;
  margin-bottom: 20px;
  font-weight: 500;
}

.grafico-contenedor {
  background-color: white;
  padding: 20px;
  border-radius: 6px;
  margin-bottom: 30px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.grafico-contenedor h4 {
  color: #333;
  margin-bottom: 15px;
  font-weight: 500;
}

.canvas-informe {
  max-width: 100%;
  height: auto;
}

/* PIE DE PÁGINA */
.pie {
  background-color: #f5f4f2;
  color: #888;
  text-align: center;
  padding: 20px;
  margin-top: 40px;
  border-top: 1px solid #e0e0e0;
}

.pie p {
  margin: 0;
  font-size: 13px;
}

/* LISTADO DE PIEZAS - LISTA VERTICAL */
#listaPiezas {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.pieza-card {
  background-color: white;
  border-radius: 6px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 4px solid #8ab4d5;
}

.pieza-card:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.pieza-info-contenedor {
  flex: 1;
}

.pieza-titulo {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

.pieza-compositor {
  font-size: 13px;
  color: #888;
  margin-bottom: 6px;
}

.pieza-info {
  font-size: 12px;
  color: #aaa;
  margin-bottom: 8px;
}

.pieza-tiempo {
  background-color: #f5f9fc;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  color: #8ab4d5;
  font-weight: 600;
  border-left: 2px solid #8ab4d5;
}

.pieza-acciones {
  display: flex;
  gap: 8px;
  margin-left: 15px;
}

.pieza-acciones a,
.pieza-acciones button {
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.btn-abrir {
  background-color: #8ab4d5;
  color: white;
}

.btn-abrir:hover {
  background-color: #6a94b5;
}

.btn-eliminar {
  background-color: #c89999;
  color: white;
}

.btn-eliminar:hover {
  background-color: #a87777;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .cabecera_inner {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .cabecera_titulo {
    font-size: 22px;
  }

  #tiempoDisplay {
    font-size: 36px;
  }

  .tabla-informe {
    font-size: 11px;
  }

  .tabla-informe th,
  .tabla-informe td {
    padding: 8px;
  }

  .resumen-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .pestanas {
    flex-direction: column;
  }

  .btn-vista {
    width: 100%;
    text-align: left;
    border-left: 3px solid transparent;
    border-bottom: none;
    padding-left: 15px;
  }

  .btn-vista.activo {
    border-left-color: #8ab4d5;
    border-bottom: none;
  }

  .pieza-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .pieza-acciones {
    margin-left: 0;
    margin-top: 10px;
    width: 100%;
  }

  .pieza-acciones a,
  .pieza-acciones button {
    flex: 1;
  }

  .botones-progreso {
    gap: 20px;
  }

  .metronomo-controles {
    flex-direction: column;
  }

  .grabacion-sesion {
    flex-wrap: wrap;
  }

  .btn-reproducir {
    flex: 1;
  }
}
