#sports-content {
    width: 95%;
    max-width: 1200px;
    margin: 0 auto 2rem auto;
    /* Aseguramos que ocupe el ancho disponible */
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

/* --- DASHBOARD BAR (Capsula Superior) --- */
.sports-dashboard-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 2rem;
    margin-bottom: 2rem;
}

.quick-stats {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stat-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 1.2rem;
    color: #fff;
    font-weight: bold;
}

.stat-item i {
    color: #f5c842;
    /* Dorado CULI */
}

.stat-divider {
    width: 1px;
    height: 25px;
    background: rgba(255, 255, 255, 0.2);
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.action-btn.strava {
    background: rgba(252, 76, 2, 0.2);
    border: 1px solid #fc4c02;
    color: #fc4c02;
}

.action-btn.strava:hover {
    background: #fc4c02;
    color: white;
}

/* --- CONTROLES CALENDARIO --- */
.calendar-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.nav-arrow {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #1cb495;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s;
}

.nav-arrow:hover {
    background: #1cb495;
    color: #000;
}

.date-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px 15px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-input {
    background: transparent;
    border: none;
    color: #fff;
    font-family: inherit;
    outline: none;
    color-scheme: dark;
}

/* --- CALENDARIO GRID --- */
.calendar-grid-wrapper {
    width: 100%;
    /* Forzar ancho completo */
    padding: 0 !important;
    overflow: hidden;
    /* Asegurar que el grid interno se expanda */
    display: flex;
    flex-direction: column;
}

.calendar-header,
.calendar-body {
    width: 100%;
    /* Forzar ancho de la rejilla */
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: rgba(0, 0, 0, 0.3);
    text-align: center;
    padding: 10px 0;
    font-weight: bold;
    color: #f5c842;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.calendar-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    /* Fijamos una altura total para obligar a las filas a tener tamaño fijo */
    height: 600px;
    grid-template-rows: repeat(5, 1fr);
}

.calendar-day {
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2px 4px;
    /* Padding reducido para aprovechar espacio */
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: hidden;
    min-height: 0;
    background: rgba(0, 0, 0, 0.2);
    /* Fondo base de celda */
}

.calendar-day:hover {
    background: rgba(255, 255, 255, 0.02);
}

.day-number {
    text-align: right;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 0px;
    padding-right: 2px;
}

.calendar-day.other-month {
    background: rgba(0, 0, 0, 0.2);
    opacity: 0.5;
}

/* --- CHIPS DE ACTIVIDAD --- */
.activity-chip {
    border-radius: 3px;
    /* Bordes un poco más rectos */
    padding: 1px 4px;
    /* MENOS PADDING (Antes 3px 6px) */
    color: #fff;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);

    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0px;
    /* Sin hueco entre líneas */

    width: 100%;
    margin-bottom: 2px;
    /* Separación mínima entre actividades */
    border-left-width: 3px;
    border-left-style: solid;
    background-color: rgba(30, 30, 30, 0.9);
    transition: transform 0.2s, filter 0.2s;

    /* Altura de línea compacta */
    line-height: 1.1;
}

.activity-chip:hover {
    transform: scale(1.02);
    filter: brightness(1.3);
    z-index: 10;
}

/* Ajuste interno del chip para mostrar Nombre.... Distancia */
.activity-chip span.act-name {
    font-weight: 600;
}

.activity-chip span.act-dist {
    font-size: 0.65rem;
    opacity: 0.8;
    margin-left: 5px;
}

.chip-header {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.65rem;
    /* Letra un pelín más pequeña */
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    margin-bottom: 1px;
    /* Separación mínima con la segunda línea */
}

.chip-header i {
    font-size: 0.6rem;
    /* Icono pequeño */
}

.chip-header span {
    text-overflow: ellipsis;
    overflow: hidden;
}

.chip-meta {
    font-size: 0.6rem;
    opacity: 0.8;
    display: flex;
    gap: 3px;
    white-space: nowrap;
}

/* Colores por tipo */
/* Ciclismo (Cyan) */
.chip-cycling {
    border-left-color: #00f2ff;
    background: linear-gradient(90deg, rgba(0, 242, 255, 0.15) 0%, rgba(30, 30, 30, 0.9) 100%);
}

.chip-cycling i {
    color: #00f2ff;
}

/* Running (Naranja) */
.chip-running {
    border-left-color: #ff9f43;
    background: linear-gradient(90deg, rgba(255, 159, 67, 0.15) 0%, rgba(30, 30, 30, 0.9) 100%);
}

.chip-running i {
    color: #ff9f43;
}

/* Natación (Azul) */
.chip-swimming {
    border-left-color: #54a0ff;
    background: linear-gradient(90deg, rgba(84, 160, 255, 0.15) 0%, rgba(30, 30, 30, 0.9) 100%);
}

.chip-swimming i {
    color: #54a0ff;
}

/* Caminata (Verde) */
.chip-walking {
    border-left-color: #1dd1a1;
    background: linear-gradient(90deg, rgba(29, 209, 161, 0.15) 0%, rgba(30, 30, 30, 0.9) 100%);
}

.chip-walking i {
    color: #1dd1a1;
}

/* Otros/Gym (Morado) */
.chip-other,
.chip-gym {
    border-left-color: #a55eea;
    background: linear-gradient(90deg, rgba(165, 94, 234, 0.15) 0%, rgba(30, 30, 30, 0.9) 100%);
}

.chip-other i {
    color: #a55eea;
}


.more-activities-btn {
    font-size: 0.65rem;
    text-align: center;
    color: #f5c842;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 2px 0;
    margin-top: auto;
}

.more-activities-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* --- MODALES --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #151515;
    border: 1px solid #1cb495;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 0 30px rgba(28, 180, 149, 0.2);
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    color: #aaa;
    cursor: pointer;
}

.form-group {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.form-group label {
    font-size: 0.8rem;
    color: #f5c842;
    margin-bottom: 5px;
}

.form-group input,
.form-group select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px;
    border-radius: 6px;
    color: #fff;
}

.full-width {
    width: 100%;
    margin-top: 1rem;
}

/* Lista de "Ver más" */
.day-list-container {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .calendar-header div {
        font-size: 0.7rem;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .calendar-body {
        grid-template-rows: repeat(5, minmax(80px, 1fr));
    }

    .activity-chip {
        font-size: 0.6rem;
        padding: 2px 4px;
    }
}

/* Estilos para el Modal de Detalle (Tabla simple) */
.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: #aaa;
    font-size: 0.9rem;
}

.detail-val {
    color: #fff;
    font-weight: bold;
    font-size: 0.95rem;
}

.detail-highlight {
    color: #f5c842;
}

/* --- ESTILOS PARA LA LISTA DE STRAVA (NUEVO) --- */
.strava-list-container {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.5);
}

.strava-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
}

.strava-item:hover {
    background: rgba(252, 76, 2, 0.15);
    /* Naranja Strava suave */
}

.strava-name {
    font-weight: bold;
    color: #fff;
    font-size: 0.85rem;
    display: block;
}

.strava-meta {
    font-size: 0.75rem;
    color: #aaa;
    margin-top: 2px;
    display: block;
}

.strava-select-icon {
    color: #fc4c02;
}

/* Estilos para botones dentro del modal de detalle */
.modal-actions {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
    /* Alineado a la derecha */
    gap: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

.delete-btn {
    background-color: rgba(255, 62, 77, 0.15);
    border: 1px solid #ff3e4d;
    color: #ff3e4d;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.delete-btn:hover {
    background-color: #ff3e4d;
    color: white;
}

/* Peso / Weight (Gris/Plata) */
.chip-weight {
    border-left-color: #bdc3c7;
    background: linear-gradient(90deg, rgba(189, 195, 199, 0.15) 0%, rgba(30, 30, 30, 0.9) 100%);
}

.chip-weight i {
    color: #bdc3c7;
}

/* Toggle Fitness Button */
.fitness-toggle {
    transition: all 0.3s;
    opacity: 0.6;
}

.fitness-toggle.active {
    background: #e74c3c;
    /* Rojo/Rosado fitness */
    color: white;
    border-color: #e74c3c;
    opacity: 1;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.4);
}

/* Chip Comida (Verde/Esmeralda) */
.chip-food {
    border-left-color: #2ecc71;
    background: linear-gradient(90deg, rgba(46, 204, 113, 0.15) 0%, rgba(30, 30, 30, 0.9) 100%);
}

.chip-food i {
    color: #2ecc71;
}

/* Estilos para inputs de comida avanzados */
.meal-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meal-select {
    flex-grow: 1;
    /* El select ocupa el espacio disponible */
}

.btn-small-plus {
    background: rgba(46, 204, 113, 0.2);
    border: 1px solid #2ecc71;
    color: #2ecc71;
    width: 35px;
    height: 38px;
    /* Altura similar al input */
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-small-plus:hover {
    background: #2ecc71;
    color: #fff;
}

.btn-small-plus:active {
    transform: scale(0.95);
}

.extra-badge {
    font-size: 0.8rem;
    color: #f5c842;
    /* Dorado */
    font-weight: bold;
    min-width: 40px;
    text-align: right;
}

/* --- VISTA GRÁFICOS --- */
.chart-controls-bar {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.chart-canvas-wrapper {
    position: relative;
    height: 400px;
    /* Altura fija para el gráfico */
    width: 100%;
}

/* Ajuste para el botón de cambio de vista */
#btnViewMode {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
}

#btnViewMode:hover {
    background: rgba(255, 255, 255, 0.2);
}

#btnViewMode.active {
    background: #f5c842;
    /* Dorado activo */
    color: #000;
    border-color: #f5c842;
}

/* --- VISTA GRÁFICOS MEJORADA --- */

/* Contenedor flexible para la barra de herramientas */
.chart-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.chart-filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.chart-filter-group label {
    font-size: 0.75rem;
    color: #aaa;
    margin-left: 2px;
}

/* Selectores Resaltados */
.accent-select,
.accent-date {
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: #fff !important;
    font-weight: bold;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s;
    min-width: 140px;
}

.accent-select:hover,
.accent-date:hover {
    border-color: #f5c842 !important;
    /* Dorado al hover */
    background: rgba(255, 255, 255, 0.05) !important;
}

.accent-select:focus,
.accent-date:focus {
    border-color: #00f2ff !important;
    /* Cyan al foco */
    outline: none;
}

.chart-canvas-wrapper {
    position: relative;
    height: 450px;
    /* Un poco más alto */
    width: 100%;
}

/* Ocultar elementos cuando sea necesario */
.hidden {
    display: none !important;
}

.sports-dashboard-bar.compact-bar {
    margin-bottom: 10px;
    /* Antes era 2rem */
    padding-bottom: 0.5rem;
}

/* Centrar botones y dar más aire */
.center-actions {
    margin: 0 auto;
    /* Centrado horizontal */
    gap: 15px;
    /* Más separación entre botones */
}

/* Navegador de Meses del Gráfico */
.chart-nav-group {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px 15px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chart-month-label {
    font-weight: bold;
    color: #f5c842;
    min-width: 100px;
    text-align: center;
    text-transform: capitalize;
}

.nav-arrow-small {
    background: transparent;
    border: none;
    color: #1cb495;
    cursor: pointer;
    font-size: 1rem;
    padding: 0 5px;
}

.nav-arrow-small:hover {
    color: #fff;
}

.chart-select-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-select-group label {
    font-size: 0.8rem;
    color: #aaa;
    margin: 0;
}

.compact-select {
    padding: 5px 10px;
    font-size: 0.9rem;
    max-width: 160px;
    /* Ancho máximo limitado */
}

/* Ajuste responsive para que no se rompa en móvil */
@media (max-width: 768px) {
    .chart-toolbar {
        flex-direction: column;
    }

    .compact-select {
        max-width: 100%;
    }
}

/* Añadir a sports.css */

.range-select {
    background: rgba(255, 255, 255, 0.05) !important;
    border: none !important;
    color: #f5c842 !important;
    /* Dorado */
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    appearance: none;
    padding-right: 15px;
}

.range-select:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

.chart-range-label {
    font-size: 0.8rem;
    color: #aaa;
    white-space: nowrap;
    margin-left: 10px;
    font-style: italic;
}

/* Ajuste para que la barra de herramientas no se desborde en móvil */
@media (max-width: 768px) {
    .chart-range-label {
        display: none;
        /* Ocultar el texto de rango en móvil para ahorrar espacio */
    }
}