/* Reset ligero */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f9fafb;
    color: #111827;
}

/* Layout base */

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 1rem 1.25rem;
}

.site-main {
    padding-top: 4.5rem;
    padding-bottom: 3rem;
}

/* Header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

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

.logo-link {
    display: inline-flex;
    align-items: center;
}

.logo-img {
    height: 100px;
    width: auto;
}

.main-nav a {
    margin-left: 1rem;
    font-size: 0.9rem;
    color: #4b5563;
    text-decoration: none;
}

.main-nav a:hover {
    color: #111827;
}

/* Footer */

.site-footer {
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
    padding: 0.75rem 0;
    font-size: 0.85rem;
}

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

.footer-muted {
    color: #6b7280;
}

.footer-brand {
    font-weight: 600;
}

/* Hero */

.hero {
    margin-bottom: 2rem;
    padding: 1.5rem 1.75rem;
    background: #ffffff;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
}

.hero-text h1 {
    margin: 0 0 0.5rem;
    font-size: 1.7rem;
}

.hero-subtitle {
    margin: 0;
    font-size: 0.95rem;
    color: #4b5563;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.75rem;
    color: #16a34a;
    margin: 0 0 0.3rem;
}

/* Secciones */

.section {
    margin-bottom: 2.5rem;
}

.section-header h2 {
    margin: 0 0 0.25rem;
    font-size: 1.3rem;
}

.section-subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: #4b5563;
}

/* Workouts */

.workout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}

.workout-card {
    background: #ffffff;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    padding: 0.9rem 1rem;
}

.workout-title {
    margin: 0 0 0.4rem;
    font-size: 1rem;
}

.workout-period {
    margin: 0 0 0.7rem;
    font-size: 0.85rem;
    color: #4b5563;
}

/* Botones */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color 0.1s ease, color 0.1s ease, border-color 0.1s ease;
}

.btn-primary {
    background: #16a34a;
    color: #ffffff;
    border-color: #16a34a;
}

.btn-primary:hover {
    background: #15803d;
    border-color: #15803d;
}

.btn-secondary {
    background: #ffffff;
    color: #111827;
    border-color: #d1d5db;
}

.btn-secondary:hover {
    background: #f3f4f6;
}

/* Ranking – columnas por peso */

.ranking-weight-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}

.weight-column {
    background: #ffffff;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
}

.weight-column-header {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid #e5e7eb;
}

.weight-column-header h3 {
    margin: 0;
    font-size: 1rem;
}

.weight-column-body {
    padding: 0.75rem 0.9rem 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    flex: 1;
}

.weight-group h4 {
    margin: 0 0 0.35rem;
    font-size: 0.9rem;
    color: #4b5563;
}

.ranking-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ranking-row {
    display: grid;
    grid-template-columns: 2.2rem 1fr auto;
    column-gap: 0.5rem;
    align-items: center;
    padding: 0.3rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.ranking-row:last-child {
    border-bottom: none;
}

.ranking-pos {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: #6b7280;
}

.ranking-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.ranking-meta {
    font-size: 0.8rem;
    color: #6b7280;
}

.ranking-time {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.9rem;
}

/* Varios */

.empty {
    font-size: 0.9rem;
    color: #6b7280;
}

.section-actions {
    margin-top: 1.5rem;
}

/* Responsive */

@media (max-width: 640px) {
    .header-flex {
        flex-direction: row;
    }

    .main-nav a {
        margin-left: 0.5rem;
    }
}

/* Filtros ranking */

.ranking-filters {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.filter-label {
    color: #6b7280;
}

.filter-pill {
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    text-decoration: none;
    color: #374151;
    font-size: 0.8rem;
}

.filter-pill-active {
    background: #16a34a;
    border-color: #16a34a;
    color: #ffffff;
}

/** Tablas (admin, full ranking, etc.) */

.full-table-wrapper {
    overflow-x: auto;
    margin-top: 1rem;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: #ffffff;
    border-radius: 0.5rem;
    overflow: hidden;
}

.ranking-table th,
.ranking-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.ranking-table thead {
    background: #f3f4f6;
}

.ranking-table tbody tr:nth-child(even) {
    background: #f9fafb;
}

.pagination {
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
}

.page-link {
    text-decoration: none;
    color: #16a34a;
}

.page-link:hover {
    text-decoration: underline;
}

.page-info {
    color: #6b7280;
}

/* Podio */

.ranking-row-1 {
    background: #ecfdf3;
}

.ranking-row-2 {
    background: #eff6ff;
}

.ranking-row-3 {
    background: #fefce8;
}

/* Workout columns – footer */

.weight-column-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem 0.6rem;
    border-top: 1px solid #e5e7eb;
}

.weight-more-link {
    font-size: 0.8rem;
    text-decoration: none;
    color: #2563eb;
}

.weight-more-link:hover {
    text-decoration: underline;
}

.weight-add-link {
    font-size: 0.8rem;
    text-decoration: none;
    color: #16a34a;
    font-weight: 500;
}

.weight-add-link:hover {
    text-decoration: underline;
}

/* Descripción workout */

.workout-summary {
    margin-top: 0.75rem;
    margin-bottom: 1.25rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 0.75rem 0.9rem;
}

.workout-summary-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #6b7280;
    margin-bottom: 0.35rem;
}

.workout-summary-body {
    font-size: 0.9rem;
    color: #111827;
    line-height: 1.4;
}

.workout-summary-body ul {
    margin: 0.25rem 0 0;
    padding-left: 1.1rem;
}

.workout-summary-body li {
    margin-bottom: 0.15rem;
}

/* Filtros full ranking */

.full-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
}

.filter-group label {
    margin-bottom: 0.2rem;
    color: #6b7280;
}

.filter-select {
    padding: 0.25rem 0.5rem;
    border-radius: 0.4rem;
    border: 1px solid #d1d5db;
    font-size: 0.85rem;
    background: #ffffff;
}

.filter-static {
    padding: 0.25rem 0.5rem;
    border-radius: 0.4rem;
    border: 1px solid transparent;
    background: #f9fafb;
    font-size: 0.9rem;
}

.btn-filter {
    padding-inline: 0.8rem;
    font-size: 0.85rem;
}

.table-title {
    margin-top: 1.25rem;
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.table-title-secondary {
    margin-top: 1.75rem;
}

/* Nombre + icono sexo */

.ranking-main {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.sex-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    line-height: 1;
    opacity: 0.40;
}

.sex-icon-male {
    color: #2563eb;
}

.sex-icon-female {
    color: #d946ef;
}

.user-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* Medallas Font Awesome */

.fa-medal {
    font-size: 1rem;
    opacity: 1;
}

.medal-gold {
    color: #d4af37; /* dorado clásico */
}

.medal-silver {
    color: #c0c0c0; /* plateado */
}

.medal-bronze {
    color: #cd7f32; /* bronce */
}


/* Tabs oficiales / no oficiales */

.weight-tabs-header {
    display: inline-flex;
    border-radius: 999px;
    background: #e5e7eb;
    padding: 0.15rem;
    margin-bottom: 0.6rem;
}

.weight-tab-button {
    border: 1px solid transparent;
    background: transparent;
    padding: 0.25rem 0.9rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    color: #4b5563;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: background-color 0.1s ease, color 0.1s ease, border-color 0.1s ease, opacity 0.1s ease;
}

.weight-tab-button:not(.is-disabled):hover {
    background: #d1d5db;
}

.weight-tab-button.is-active {
    background: #ffffff;
    border-color: #16a34a;
    color: #111827;
}

.weight-tab-button.is-disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.tab-count {
    font-size: 0.75rem;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    background: #d1d5db;
}

.weight-tab-button.is-active .tab-count {
    background: #16a34a;
    color: #ffffff;
}

/* Ocultamos por defecto los grupos y usamos .is-active para mostrar */
.weight-tabs-body .weight-group {
    display: none;
}

.weight-tabs-body .weight-group.is-active {
    display: block;
}

/* Nuevo registro de puntuación */

.feedback-banner {
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.6rem 0.8rem;
    border-radius: 0.6rem;
    background: #ecfdf3;
    border: 1px solid #bbf7d0;
    font-size: 0.9rem;
    color: #166534;
}

.feedback-banner strong {
    font-weight: 600;
}

.row-highlight {
    background: #fef9c3;
    box-shadow: 0 0 0 1px #facc15 inset;
}

.ranking-table tbody tr.row-highlight {
    background: #fef9c3 !important;
    box-shadow: 0 0 0 1px #facc15 inset;
}

/* Botón CTA superior en secciones */

.section-actions-top {
    display: flex;
    justify-content: flex-end;
    margin: 0.75rem 0 0.75rem;
}

.btn-cta {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* En móvil, que el CTA ocupe todo el ancho */
@media (max-width: 768px) {
    .section-actions-top {
        justify-content: stretch;
    }

    .section-actions-top .btn-cta {
        width: 100%;
        text-align: center;
    }
}

/* Formulario submit result */

.form-card {
    background: #ffffff;
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    max-width: 640px;
    margin: 0 auto 2rem;
}

.form-layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-row-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.form-group {
    flex: 1 1 160px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
}

.form-group-compact {
    flex: none;          /* evita que estire la columna */
    margin-bottom: 0.6rem;  /* más pequeño que el default */
}

.form-group-compact input[type="date"] {
    max-width: 180px;    /* opcional, para que quede más limpio */
}

input[type="date"],
input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"],
select {
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    padding: 0.45rem 0.6rem;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.1s ease, box-shadow 0.1s ease;
}

input[type="date"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.2);
}

.time-inputs {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.time-field {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.time-field input {
    width: 4rem;
    text-align: right;
}

.time-field span {
    font-size: 0.8rem;
    color: #6b7280;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .form-card {
        padding: 1rem 1rem;
        margin: 0 0 1.5rem;
    }

    .form-row-inline {
        flex-direction: column;
    }

    .time-field input {
        width: 3.5rem;
    }
}

.admin-input-block {
    font-size: 0.8rem;
    color: #374151;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

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

.badge {
    display: inline-flex;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.badge-ongoing {
    background: #dcfce7;
    color: #166534;
}

.badge-closed {
    background: #fee2e2;
    color: #b91c1c;
}

.badge-upcoming {
    background: #e0f2fe;
    color: #1d4ed8;
}

.workout-actions {
    margin-top: 0.6rem;
    display: flex;
    gap: 0.5rem;
}

.feedback-banner {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
}

.feedback-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.feedback-error {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* Fila de Peso + Clubbell oficial */
.form-row-two-cols {
    display: grid;
    grid-template-columns: 2fr 1.8fr;
    gap: 1.5rem;
}

@media (max-width: 640px) {
    .form-row-two-cols {
        grid-template-columns: 1fr;
    }
}

/* Grupo del checkbox a la derecha */
.form-group-checkbox {
    margin-top: 1.3rem; /* para alinearlo más con el input de peso */
}

/* Estilo del checkbox y texto */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: #374151;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.field-hint {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #6b7280;
}

/* ---- Panel del jefe / estadísticas ---- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    margin-bottom: 2rem;
}

.card {
    background: #ffffff;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}


.card .label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    margin-bottom: 0.3rem;
}

.card .big-number {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.1;
    color: #111827;
    margin-bottom: 0.25rem;
}

.card .help-text {
    font-size: 0.85rem;
    color: #4b5563;
}

.section-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 2.25rem 0;
}

/* Grid específico para las tarjetas de gráficos */

.cards-grid-charts .card {
    max-width: 100%;   /* que ocupen toda la columna */
    margin: 0;         /* fuera centrado con auto */
}

/* 1 columna en móvil, 2 columnas a partir de 768px */

.cards-grid-charts {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .cards-grid-charts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ---- Grid específico para las tarjetas de gráficos del panel ---- */

.stats-charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
    margin-bottom: 2rem;
    align-items: flex-start;
}

/* A partir de 768px, fuerza 2 columnas sí o sí */
@media (min-width: 768px) {
    .stats-charts-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.stats-card {
    background: #ffffff;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}
.stats-card .label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    margin-bottom: 0.3rem;
}
.stats-card .help-text {
    font-size: 0.85rem;
    color: #4b5563;
}

/* Contenedor y tamaño del gráfico dentro de la tarjeta */

/* Auth.css */
.auth-section {
    display: flex;
    justify-content: center;
    padding: 2.5rem 1.5rem;
}

.auth-wrapper {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

/* Usamos tu fondo global / color de tarjetas:
   - no metemos #111 ni gradients nuevos
*/
.auth-card {
    border-radius: 0.75rem;
    padding: 2rem 1.5rem;
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    /* si ya tienes .card en tu CSS, puedes incluso añadir class="card auth-card"
       en el HTML y quitar este fondo/borde para heredar todo */
}

/* Cabecera con marca, pero sin colores propios */
.auth-header-centered {
    text-align: center;
    margin-bottom: 1.5rem;
}

.brand-centered {
    display: flex;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.logo-login {
    height: 150px;       /* Ajusta si quieres */
    width: auto;
    display: block;
}

.auth-header {
    margin-bottom: 1.5rem;
}

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

.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    /* sin círculo de color, dejamos el icono tal cual */
}

.brand-icon {
    font-size: 1.5rem;
}

.brand-eyebrow {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.16em;
    opacity: 0.7;
    margin: 0;
}

.brand-text h1 {
    font-size: 1.3rem;
    margin: 0;
}

.auth-subtitle {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Mensajes de error: solo un recuadro discreto */
.auth-alert {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    border-radius: 0.6rem;
    margin-bottom: 1rem;
}

.auth-alert-error {
    background: var(--danger-bg-soft, rgba(220, 38, 38, 0.08));
    border: 1px solid var(--danger-border, rgba(220, 38, 38, 0.5));
}

/* Formulario: solo espaciar, inputs heredan tu estilo global */
.auth-form .form-group {
    margin-bottom: 1rem;
}

.auth-form label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
}

/* Si ya tienes .input o similar, quita esto o déjalo mínimo */
.auth-form input {
    width: 100%;
    display: block;
}

/* Pie del formulario */
.form-footer {
    margin-top: 1.2rem;
}

/* Solo hacemos el botón full-width. El estilo viene de .btn / .btn-primary */
.btn-full {
    width: 100%;
}

/* Textos auxiliares */
.auth-hint {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    opacity: 0.85;
}

.auth-hint-muted {
    opacity: 0.6;
}

.auth-meta {
    margin-top: 1.25rem;
    font-size: 0.75rem;
    opacity: 0.8;
    text-align: center;
}

/* --- Header: zona derecha (nav + usuario) --- */

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Botón Entrar en el header */
.btn-login {
    font-size: 0.85rem;
    padding-inline: 0.9rem;
}

/* Pill de usuario loggeado */

.user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e5e7eb;
    font-size: 0.8rem;
    color: #111827;
}

.header-user {
    display: flex;
    align-items: center;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.user-link {
    color: #4b5563;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.user-link:hover {
    background: #f3f4f6;
    color: #111827;
}

.logout-link {
    color: #dc2626;
}

.logout-link:hover {
    background: #fee2e2;
    color: #b91c1c;
}

.user-greeting strong {
    font-weight: 600;
}

.profile-medals {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.medal-card {
    background: var(--surface-elevated, #fff);
    border-radius: 1rem;
    padding: 1.25rem 1rem;
    text-align: center;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.medal-card .fa-medal {
    font-size: 2rem;
}

.medal-icon {
    font-size: 2.5rem;
    margin-bottom: 0.25rem;
}

.medal-count {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.1;
}

.medal-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.7;
    margin-top: 0.35rem;
}

.medal-hint {
    margin-top: 0.35rem;
    font-size: 0.75rem;
    opacity: 0.75;
}

/* Colores específicos por tipo de medalla (opcional) */
.medal-gold .medal-icon { filter: drop-shadow(0 0 6px rgba(234, 179, 8, 0.4)); }
.medal-silver .medal-icon { filter: drop-shadow(0 0 6px rgba(148, 163, 184, 0.4)); }
.medal-bronze .medal-icon { filter: drop-shadow(0 0 6px rgba(180, 83, 9, 0.4)); }

/* Mobile: apilar en 1 o 2 columnas si quieres */
@media (max-width: 768px) {
    .profile-medals {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .profile-medals {
        grid-template-columns: 1fr;
    }
}

/* --- HEADER RESPONSIVE PRO SIN JS --- */

/* Layout base del header */
.header-flex {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

/* Ocultamos el checkbox */
.nav-toggle {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Botón hamburguesa */
.menu-toggle {
    border: none;
    background: transparent;
    padding: 0.35rem;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.menu-toggle i {
    font-size: 1.2rem;
    color: #4b5563;
}

.menu-toggle:hover {
    background: #f3f4f6;
}

/* Panel de menú: estado base (cerrado) */
.header-right {
    overflow: hidden;
    max-height: 0;
    transition: max-height 180ms ease-out, padding 180ms ease-out;
    border-top: 1px solid transparent;
    padding: 0;              /* CLAVE: sin padding cuando está cerrado */
}

/* Cuando el checkbox está marcado, abrimos el menú */
.nav-toggle:checked ~ .header-right {
    max-height: 600px;       /* suficiente para todo el contenido */
    border-top-color: #e5e7eb;
    padding-top: 0.9rem;     /* el aire que querías */
    padding-bottom: 1rem;
}

/* MOBILE */
@media (max-width: 768px) {
    .logo-img {

    }

    .header-right {
        margin-top: 0.5rem;
    }

    .main-nav,
    .header-user,
    .user-pill {
        width: 100%;
    }

    .user-pill {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.65rem;
    }

    .user-link {
        width: 100%;
        justify-content: flex-start;
        padding: 0.6rem 0.6rem;
    }

    .btn-login {
        width: 100%;
        justify-content: center;
        text-align: center;
        margin-top: 0.5rem;
        padding: 0.6rem 1rem;
    }
}

/* DESKTOP */
@media (min-width: 769px) {
    .header-flex {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .header-right {
        max-height: none;
        overflow: visible;
        margin-top: 0;
        border-top: none;
        padding: 0;   /* sin padding extra en desktop */
    }

    .menu-toggle {
        display: none;
    }

    .nav-toggle {
        display: none;
    }

    .header-user {
        display: flex;
        align-items: center;
    }
}

.stats-charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
    margin-bottom: 2rem;
}

@media (min-width: 900px) {
    .stats-charts-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Estas tarjetas ocupan las 2 columnas */
    .stats-card-wide {
        grid-column: span 2;
    }
}
/*.chart-container {
    position: relative;
    width: 100%;
    max-width: 340px;
    height: 220px;
    margin: 0.5rem auto 0;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}*/
.chart-container {
    position: relative;
    width: 100%;
    margin-top: 0.5rem;
}

/* El canvas ocupa el ancho del contenedor sin reescalar raro */
.chart-container canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Tarjetas "normales" (una columna) → altura más baja */
.stats-card:not(.stats-card-wide) .chart-container {
    aspect-ratio: 4 / 3;   /* ej. 4:3, compacto */
}

/* Tarjetas anchas (dos columnas) → más horizontales */
.stats-card-wide .chart-container {
    aspect-ratio: 16 / 7;  /* más panorámico */
}