/* ===============================
   HEADER MIS ACTIVIDADES
   =============================== */

.sa-my-activity-header {
    width: 100%;
    background: #ffffff;
    border-radius: 20px;
    padding: 32px 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    text-align: center;
    margin-bottom: 40px;
}

.sa-my-activity-header__title {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
}

.sa-my-activity-header__subtitle {
    margin-top: 10px;
    font-size: 15px;
    color: #6b7280;
}

/* ===============================
   NAVEGACIÓN
   =============================== */

.sa-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
}

.sa-back-link:hover {
    text-decoration: underline;
}

/* ===============================
   GRID DE ACTIVIDADES
   =============================== */

.sa-my-activities {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: 28px;
    /* separación horizontal */
    row-gap: 14px;
    /* 👈 separación vertical (filas) */
}

.sa-my-activities__empty {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

@media (max-width: 1224px) {
    .sa-my-activities {
        grid-template-columns: 1fr;
    }
}

/* ===============================
   CARD ACTIVIDAD
   =============================== */

.sa-my-activity-card {
    background: #fff;
    border-radius: 20px;
    padding: 22px;
    padding-bottom: 5px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .06);
    display: flex;
    flex-direction: column;
    transition: all .25s ease;
}

/* 🔥 IMAGEN */
.sa-my-activity-card__image {
    width: 100%;
    height: 140px;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 10px;
}

.sa-my-activity-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Header */

.sa-my-activity-card__header {
    margin-bottom: 12px;
}

.sa-my-activity-card__title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

/* 🔥 BADGES */
.sa-my-activity-card__badges {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    margin-left: 10px;

}

.sa-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #374151;
}

.sa-badge--price {
    background: #fff4e6;
    color: #d9480f;
}

/* ocultamos meta antiguo */
.sa-my-activity-card__meta {
    display: none;
}

/* ===============================
   ALUMNOS
   =============================== */

.sa-my-activity-card__students {
    margin-left: -14px;
    margin-right: -14px;
}

.sa-my-activity-table {
    margin-top: 10px;
    border-radius: 14px;
    overflow: visible;
    border: none !important;
}

.sa-my-activity-table__head {
    display: grid;
    grid-template-columns: 1fr 120px 160px;
    gap: 16px;
    padding: 12px 16px;
    background: #f1f1f1;
    font-size: .75rem;
    font-weight: 700;
    color: #6b7280;
}

.sa-my-activity-table__head span:nth-child(2) {
    text-align: center;
}

.sa-my-activity-table__head {
    display: none;
}

.sa-students {
    border: none;
    border-radius: 14px;
    overflow: visible;
    /* 🔥 clave */
}

.sa-student {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 16px;
    transition: background .2s ease;
}

.sa-student {
    border-bottom: 1px solid #f1f1f1;
}

.sa-student:hover {
    background: #f3f4f6;
}

.sa-student {
    width: 100%;
}



/* 🔥 AVATAR */

.sa-my-activity-student__info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.sa-my-activity-student__avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #f1f1f1;
}

.sa-my-activity-student__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: none !important;
    transition: none !important;
}

.sa-my-activity-student__name {
    font-weight: 600;
    color: #111;
}

.sa-my-activity-student__tarifa {
    font-size: .8rem;
    color: #777;
    margin-left: 4px;
}

.sa-my-activity-student__state {
    display: flex;
    justify-content: center;
}

.sa-my-activity-student__action {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.sa-my-activity-student__controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

/* 🔥 ESTADOS */

.sa-my-activity-student__status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    padding: 0 20px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 999px;
    white-space: nowrap;
}

.sa-my-activity-student__status--active {
    background: #d3f9d8;
    color: #2b8a3e;
}

.sa-my-activity-student__status--trial {
    background: #fff3cd;
    color: #856404;
}

.sa-my-activity-student__status--cancel {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 6px 10px;
    border-radius: 999px;

    background: #ffe3e3;
    color: #c92a2a;

    font-size: 13px;
    font-weight: 600;
}

.sa-my-activity-student__until {
    font-size: 13px;
    color: #666;
    text-align: right;
}


/* La píldora ahora es flex */
.sa-my-activity-student__status--pending {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 6px 10px;
    border-radius: 999px;

    background: #b91c1c;
    color: #fee2e2;

    font-size: 13px;
    font-weight: 600;
}

/* Icono dentro */
.sa-my-activity-student__status--pending .sa-info-icon {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 16px;
    height: 16px;
    border-radius: 50%;

    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;

    font-size: 11px;
    font-weight: 700;

    cursor: help;
}
.sa-my-activity-student__status--cancel .sa-info-icon {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 16px;
    height: 16px;
    border-radius: 50%;

    background: rgb(253, 206, 206); /* 🔥 diferente al rojo */
    color: #c92a2a;

    font-size: 11px;
    font-weight: 700;

    cursor: help;
}

/* Tooltip */
.sa-tooltip {
    position: absolute;
    bottom: 140%;
    right: 0;

    background: #111827;
    color: #ffffff;

    padding: 8px 10px;
    border-radius: 6px;

    font-size: 12px;
    line-height: 1.4;

    width: 220px;

    opacity: 0;
    pointer-events: none;
    transform: translateY(5px);

    transition: all 0.2s ease;
    z-index: 9999;

    white-space: normal;
    /* 🔥 permite varias líneas */
    word-break: break-word;
    /* 🔥 rompe palabras largas si hace falta */
    overflow-wrap: break-word;
    /* 🔥 fallback moderno */
}

/* Flecha */
.sa-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    right: 10px;

    border-width: 5px;
    border-style: solid;
    border-color: #111827 transparent transparent transparent;
}

/* Hover */
.sa-info-icon:hover .sa-tooltip {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 640px) {

    .sa-tooltip {
        left: 50%;
        transform: translateX(-50%) translateY(5px);

        width: 260px;
        max-width: calc(100vw - 32px);

        /* 🔥 CLAVE */
        margin-left: 16px;
        margin-right: 16px;
    }

      .sa-tooltip-wrapper {
        padding: 0 16px;
    }

    .sa-info-icon:hover .sa-tooltip {
        transform: translateX(-50%) translateY(0);
    }

   .sa-tooltip::after {
    content: "";
    position: absolute;

    top: 100%;
    left: 45%;
    transform: translateX(-50%);

    width: 0;
    height: 0;

    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #111827; /* mismo color que el tooltip */

    right: auto;
}
}

/* ===============================
   BOTÓN CANCELAR
   =============================== */

.sa-my-activity-student__cancel {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ef4444;
    color: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: .75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s ease;
}

.sa-my-activity-student__cancel::before {
    content: "✕";
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    font-size: .65rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sa-my-activity-student__cancel:hover {
    background: #dc2626;
}

.sa-my-activity-student__text {
    display: flex;
    flex-direction: column;
}

.sa-my-activity-student__schedule {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 2px;
}


/* ===============================
   RESPONSIVE
   =============================== */

@media (max-width:640px) {

    .sa-my-activity-table__head {
        display: none;
    }

    .sa-my-activity-student {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 16px;
    }

    .sa-my-activity-student__controls {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
        width: 100%;
    }

}

/* ===============================
   FOOTER
   =============================== */

.sa-my-activity-card__footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 10px;
}

.sa-my-activity-card__footer .sa-btn--ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #2563eb;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 999px;
    transition: all 0.2s ease;
}

.sa-my-activity-card__footer .sa-btn--ghost::after {
    content: "→";
    transition: transform 0.2s ease;
}

.sa-my-activity-card__footer .sa-btn--ghost:hover {
    background: #eff6ff;
}

.sa-my-activity-card__footer .sa-btn--ghost:hover::after {
    transform: translateX(3px);
}

/* ===============================
   MODAL HORARIO
   =============================== */

.sa-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sa-modal[hidden] {
    display: none;
}

.sa-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .45);
}

.sa-modal__content {
    position: relative;
    max-width: 760px;
    width: calc(100% - 32px);
    background: #fff;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .25);
}

.sa-modal__close {
    position: absolute;
    top: 8px;
    right: 12px;
    border: none;
    background: transparent;
    padding: 4px;
    font-size: 1.4rem;
    font-weight: 600;
    color: #9ca3af;
    cursor: pointer;
    transition: color .2s ease, transform .15s ease;
}

.sa-modal__close:hover {
    color: #111;
    transform: scale(1.1);
}

.sa-modal__title {
    margin: 0 0 16px;
    padding-bottom: 10px;
}

/* ===============================
   HORARIO
   =============================== */

.sa-schedule-grid {
    display: grid;
    gap: 20px;
}

.sa-schedule-grid--double {
    grid-template-columns: repeat(2, 1fr);
}

.sa-schedule-grid--single {
    grid-template-columns: 1fr;
}

.sa-schedule-column {
    background: #f7f7f8;
    border-radius: 16px;
    padding: 16px;
}

.sa-schedule-column__title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.sa-schedule-day-row {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px dashed #e5e7eb;
}

.sa-schedule-day-row:last-child {
    border-bottom: none;
}

.sa-schedule-day {
    font-weight: 600;
    color: #374151;
}

.sa-schedule-slots {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sa-schedule-slot {
    background: #fff;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: .9rem;
}

.sa-schedule-group {
    color: #6b7280;
    font-size: .85em;
}

/* ===============================
   MODAL CANCELACIÓN
   =============================== */

.sa-modal--cancel .sa-modal__content {
    padding: 36px;
}

.sa-modal--cancel .sa-modal__title {
    margin-bottom: 20px;
}

.sa-modal--cancel .sa-modal__body {
    margin-bottom: 36px;
    line-height: 1.5;
}

.sa-modal--cancel .sa-modal__footer {
    display: flex;
    gap: 14px;
    justify-content: flex-end;
}

.sa-modal--cancel .sa-btn {
    min-width: 140px;
    padding: 10px 18px;
}

.sa-modal--cancel .sa-modal__close {
    top: 18px;
    right: 18px;
}

.sa-modal__close {
    background: transparent !important;
}

.sa-modal__close:hover {
    background: transparent !important; 
    color: #111; 
    transform: scale(1.1);
}

.sa-modal--cancel #sa-cancel-text {
    color: #000000 !important;
    font-size: 15px;
}

/* ===============================
   AVISO SUCCESS (CANCELACIÓN)
   =============================== */

.sa-activity-success {
    width: 100%;
    margin-bottom: 15px;
    padding: 8px 8px;
    background: #e8f7ef;
    color: #1e7f52;
    font-size: .85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-sizing: border-box;
}

/* El mensaje ocupa todo */
.sa-activity-success__text {
    flex: 1;
}

/* Botón cerrar */
.sa-activity-success__close {
    background: transparent;
    border: none;
    color: #1e7f52;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.sa-activity-success__close:hover {
    color: #145c3c;
}

/* ===============================
   LOADING BOTÓN CANCELAR
   =============================== */

/* Botón base */
.sa-btn--cancel-confirm {
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 10px; /* 🔥 menos redondeado que pills */
    font-weight: 600;
    transition: all .2s ease;
}

.sa-btn--cancel-confirm:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.sa-btn--cancel-back {
    background: transparent;
    color: #6b7280;
    border: none;
    font-weight: 600;
    cursor: pointer;
}

.sa-btn--cancel-back:hover {
    background: transparent;
    color: #111;
    transform: translateY(-1px);
}

/* Texto normal */
.sa-btn__text {
    display: inline-block;
}

/* Loading oculto por defecto */
.sa-btn__loading {
    display: none;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #ffffff;
}

/* Spinner */
.sa-btn__spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: sa-spin 0.8s linear infinite;
}

/* Animación */
@keyframes sa-spin {
    to {
        transform: rotate(360deg);
    }
}

/* 🔥 ESTADO ACTIVO (cuando cancela) */
.sa-btn--loading .sa-btn__text {
    display: none;
}

.sa-btn--loading .sa-btn__loading {
    display: inline-flex;
}

/* ===============================
   FIX DEFINITIVO HEADER
   =============================== */

/* asegurar layout limpio */
.sa-my-activity-card__header {
    display: block !important;
}

/* línea título + badges */
.sa-my-activity-card__header-top {
    display: flex !important;
    align-items: center;
    justify-content: flex-start !important;
    gap: 20px;
}

/* 🔥 RESET COMPLETO DE BADGES */
.sa-my-activity-card__badges,
.sa-my-activity-card__badges * {
    position: static !important;
    float: none !important;
    margin: 0 !important;
}

/* badges en fila */
.sa-my-activity-card__badges {
    display: flex !important;
    gap: 8px;
    flex-wrap: nowrap;
    margin-left: 10px;
}


.sa-my-activity-student__avatar,
.sa-my-activity-student__avatar img {
    transform: translateZ(0);
}

@media (max-width:640px) {
    .sa-my-activity-card__header {
        padding: 0;
        margin-bottom: 8px;
    }

    .sa-my-activity-card__header-top {
        gap: 6px;
    }

    .sa-badge--price {
        white-space: nowrap;
    }

    .sa-student {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px 16px;
    }

    /* ❌ avatar fuera */
    .sa-my-activity-student__avatar {
        display: none;
    }

    /* 👉 bloque info en columna */
    .sa-my-activity-student__info {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    /* 👉 nombre arriba */
    .sa-my-activity-student__name {
        display: block;
        font-weight: 600;
    }

    /* 👉 tarifa debajo del nombre */
    .sa-my-activity-student__tarifa {
        display: block;
        font-size: 0.8rem;
        color: #6b7280;
        margin-left: 0;
        padding-left: 0;
    }

    /* 👉 horario debajo */
    .sa-my-activity-student__schedule {
        display: block;
        font-size: 0.8rem;
        color: #6b7280;
    }

    /* 👉 controles centrados y juntos */
    .sa-my-activity-student__controls {
        padding-top: 6px;
        justify-content: flex-start;
        gap: 20px;
    }

    .sa-my-activity-student__state {
        justify-content: center;
    }

    .sa-my-activity-student__action {
        justify-content: center;
    }
}