/* ==========================================================
   MI COOPERADORA
   FICHA DE FAMILIA
   ========================================================== */

.familia {
    max-width: 1050px;
    margin: 0 auto;
}


/* ==========================================================
   CABECERA
   ========================================================== */

.familia__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;

    margin-bottom: 20px;
}


.familia__header > div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}


.familia__header [data-route="familias"] {
    margin: 0 0 14px;
    padding: 0;

    background: transparent !important;
    color: #d36f48 !important;

    border: 0;
    box-shadow: none !important;

    font-size: 13px;
}


.familia__header [data-route="familias"]:hover {
    background: transparent !important;
    color: #b85c38 !important;
    transform: translateX(-3px);
}


.familia__header h1 {
    margin: 0;

    font-size: 30px;
    line-height: 1.15;
}


#editar-familia {
    min-height: 42px;
    padding: 0 18px;

    background: white;
    color: #d36f48;

    border: 1px solid #efc5b1;
    border-radius: 11px;

    box-shadow: none;
}


#editar-familia:hover {
    background: #fff1e9;
    color: #bd603c;
}


/* ==========================================================
   DATOS DE LA FAMILIA
   ========================================================== */

.familia__datos {
    margin-bottom: 18px;
    padding: 0;

    overflow: hidden;

    background: white;

    border: 1px solid #eadfd9;
    border-radius: 18px;

    box-shadow:
        0 3px 12px rgba(0,0,0,.05);
}


.familia__datos > h2 {
    margin: 0;
    padding: 17px 20px;

    background:
        linear-gradient(
            90deg,
            #fff1e9,
            #fff8f4
        );

    border-bottom: 1px solid #f1d8ca;

    font-size: 17px;
}


.familia__datos-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 0;

    padding: 6px 20px 18px;
}


.familia__datos-grid > div {
    padding: 16px 12px;

    border-bottom: 1px solid #eeeeee;
}


.familia__datos-grid span {
    display: block;

    margin-bottom: 5px;

    color: #7b8186;

    font-size: 11px;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: .05em;
}


.familia__datos-grid strong {
    display: block;

    color: #252b30;

    font-size: 14px;
    font-weight: 600;

    overflow-wrap: anywhere;
}


/* ==========================================================
   ALUMNOS / PAGOS
   ========================================================== */

.familia__alumnos,
.familia__pagos {
    margin-bottom: 18px;

    overflow: hidden;

    background: white;

    border: 1px solid #e3e5e7;
    border-radius: 18px;

    box-shadow:
        0 3px 12px rgba(0,0,0,.045);
}


.familia__section-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 15px;

    padding: 16px 20px;

    background: #fffaf7;

    border-bottom: 1px solid #eeeeee;
}


.familia__section-header h2 {
    margin: 0;

    font-size: 17px;
}


.familia__section-header button {
    min-height: 37px;

    padding: 0 14px;

    border-radius: 9px;

    font-size: 12px;

    box-shadow: none;
}


#familia-alumnos,
#familia-pagos {
    padding: 0;
}


#familia-alumnos > p,
#familia-pagos > p {
    margin: 0;

    padding: 28px 20px;

    color: #7b8186;

    text-align: center;
}


/* ==========================================================
   TABLAS
   ========================================================== */

.familia table {
    width: 100%;

    border-collapse: collapse;
}


.familia table thead {
    background: #fafafa;
}


.familia table th {
    padding: 12px 15px;

    color: #806d63;

    font-size: 10px;
    font-weight: 800;

    text-align: left;

    text-transform: uppercase;

    letter-spacing: .06em;
}


.familia table td {
    padding: 13px 15px;

    border-top: 1px solid #eeeeee;

    font-size: 13px;
}


.familia table tbody tr:hover {
    background: #fffaf7;
}


/* ==========================================================
   RESUMEN
   ========================================================== */

.familia__resumen {
    margin-bottom: 30px;
}


.familia__resumen > h2 {
    margin: 0 0 12px;

    font-size: 17px;
}


#familia-resumen {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 14px;
}


#familia-resumen > div {
    padding: 18px 20px;

    background:
        linear-gradient(
            145deg,
            #ffffff,
            #fff7f2
        );

    border: 1px solid #eadfd9;

    border-radius: 15px;

    box-shadow:
        0 3px 10px rgba(0,0,0,.04);
}


#familia-resumen span {
    display: block;

    margin-bottom: 7px;

    color: #7b8186;

    font-size: 11px;
    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: .05em;
}


#familia-resumen strong {
    display: block;

    color: #252b30;

    font-size: 22px;
}


/* TOTAL PAGADO */

#familia-resumen > div:last-child {
    background:
        linear-gradient(
            135deg,
            #fff1e9,
            #fff8f4
        );
}


#familia-resumen > div:last-child strong {
    color: #d36f48;
}


/* ==========================================================
   RESPONSIVE
   ========================================================== */

@media (max-width: 800px) {

    .familia__datos-grid {
        grid-template-columns:
            repeat(2, 1fr);
    }


    .familia__header {
        align-items: stretch;
        flex-direction: column;
    }


    #editar-familia {
        width: 100%;
    }


    .familia__alumnos,
    .familia__pagos {
        overflow-x: auto;
    }


    .familia table {
        min-width: 700px;
    }

}


@media (max-width: 550px) {

    .familia__datos-grid,
    #familia-resumen {
        grid-template-columns: 1fr;
    }


    .familia__section-header {
        align-items: stretch;
        flex-direction: column;
    }


    .familia__section-header button {
        width: 100%;
    }

}
/* ==========================================================
   ESTADOS Y ACCIONES DE ALUMNOS
   ========================================================== */

.estado-badge {
    display: inline-flex;
    align-items: center;

    padding: 5px 10px;

    border-radius: 20px;

    font-size: 11px;
    font-weight: 700;
}


/* ACTIVO */

.estado-badge--activo {
    color: #247557;
    background: #e9f6ef;
    border: 1px solid #cce9da;
}


/* INACTIVO */

.estado-badge--inactivo {
    color: #8a5555;
    background: #fff0f0;
    border: 1px solid #efd1d1;
}


/* ACCIONES */

.tabla-acciones {
    display: flex;
    align-items: center;

    gap: 7px;
}


.tabla-acciones button {
    min-height: 32px;

    padding: 0 11px;

    border-radius: 8px;

    font-size: 11px;

    box-shadow: none;
}


/* EDITAR */

.btn-editar-alumno {
    color: #d46d45 !important;
    background: #fff2eb !important;

    border: 1px solid #f0cdbc !important;
}


.btn-editar-alumno:hover {
    background: #ffe6da !important;
}


/* BAJA / REACTIVAR */

.btn-estado-alumno {
    color: #687077 !important;
    background: #ffffff !important;

    border: 1px solid #dfe2e4 !important;
}


.btn-estado-alumno:hover {
    background: #f5f6f6 !important;
}
/* ==========================================================
   ESTADO DE CUOTAS
   ========================================================== */

.familia__cuotas {

    margin-bottom: 22px;

    padding: 22px;

    background: #ffffff;

    border: 1px solid #e3e5e7;

    border-radius: 18px;

    box-shadow:
        0 3px 12px rgba(0,0,0,.045);
}


/* CABECERA */

.familia__cuotas-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 20px;

}


.familia__cuotas-eyebrow {

    display: block;

    margin-bottom: 4px;

    color: #d36f48;

    font-size: 11px;

    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: .07em;

}


.familia__cuotas-header h2 {

    margin: 0;

    font-size: 19px;

}


/* RESUMEN PAGADAS / PENDIENTES */

.familia__cuotas-resumen {

    display: flex;

    gap: 10px;

}


.familia__cuotas-resumen > span {

    display: inline-flex;

    align-items: center;

    gap: 5px;

    padding: 7px 11px;

    border-radius: 999px;

    font-size: 11px;

    font-weight: 600;

}


.cuotas-resumen__pagadas {

    color: #28795a;

    background: #e9f6ef;

    border: 1px solid #cfe9db;

}


.cuotas-resumen__pendientes {

    color: #a55c4f;

    background: #fff0ec;

    border: 1px solid #f0d1c8;

}


/* GRILLA DE MESES */

.familia__cuotas-grid {

    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 12px;

}


/* TARJETA MENSUAL */

.cuota-mes {

    position: relative;

    overflow: hidden;

    min-height: 105px;

    padding: 15px;

    background: #ffffff;

    border: 1px solid #e4e6e8;

    border-radius: 13px;

    transition:
        transform .15s ease,
        box-shadow .15s ease;

}


.cuota-mes:hover {

    transform:
        translateY(-2px);

    box-shadow:
        0 5px 14px rgba(0,0,0,.06);

}


/* Línea superior */

.cuota-mes::before {

    content: "";

    position: absolute;

    top: 0;
    left: 0;

    width: 100%;

    height: 4px;

}


/* PAGADA */

.cuota-mes--pagada {

    background:
        linear-gradient(
            145deg,
            #ffffff,
            #f5fbf8
        );

    border-color:
        #cfe7da;

}


.cuota-mes--pagada::before {

    background:
        #58ad83;

}


/* PENDIENTE */

.cuota-mes--pendiente {

    background:
        linear-gradient(
            145deg,
            #ffffff,
            #fff7f3
        );

    border-color:
        #efd8cc;

}


.cuota-mes--pendiente::before {

    background:
        #e58a63;

}


/* CABECERA MES */

.cuota-mes__cabecera {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 8px;

    margin-bottom: 16px;

}


.cuota-mes__cabecera > strong {

    color: #252b30;

    font-size: 14px;

}


/* ESTADO */

.cuota-mes__estado {

    padding:
        4px 7px;

    border-radius: 999px;

    font-size: 9px;

    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: .04em;

}


.cuota-mes--pagada
.cuota-mes__estado {

    color: #28795a;

    background: #e6f5ed;

}


.cuota-mes--pendiente
.cuota-mes__estado {

    color: #a95d49;

    background: #ffebe4;

}


/* DETALLE */

.cuota-mes__detalle {

    display: flex;

    align-items: flex-end;

    justify-content: space-between;

    gap: 8px;

}


.cuota-mes__detalle span {

    color: #7b8186;

    font-size: 11px;

}


.cuota-mes__detalle strong {

    color: #28795a;

    font-size: 15px;

}


/* RESPONSIVE */

@media (max-width: 900px) {

    .familia__cuotas-grid {

        grid-template-columns:
            repeat(2, 1fr);

    }

}


@media (max-width: 560px) {

    .familia__cuotas-header {

        align-items: flex-start;

        flex-direction: column;

    }


    .familia__cuotas-resumen {

        width: 100%;

    }


    .familia__cuotas-grid {

        grid-template-columns:
            1fr;

    }

}