/* Buscador DataTables — selectores nativos, sin clases nuevas */

/* Búsqueda + filtros juntos a la izquierda; bloque X debajo */
.dataTables_wrapper > .row:first-child {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px;
    padding-top: 8px;
    margin-bottom: 1rem;
}

.dataTables_wrapper > .row:first-child > .col-sm-12.col-md-5,
.dataTables_wrapper > .row:first-child > .col-sm-12.col-md-1,
.dataTables_wrapper > .row:first-child > .col-sm-12.col-md-6 {
    display: flex;
    align-items: center;
}

.dataTables_wrapper > .row:first-child > .col-sm-12.col-md-5 {
    order: 1;
    flex: 0 1 360px;
    width: auto !important;
    max-width: 100%;
    padding: 0;
}

.dataTables_wrapper > .row:first-child > .col-sm-12.col-md-1 {
    order: 2;
    flex: 0 0 auto;
    width: auto !important;
    padding: 0;
}

.dataTables_wrapper > .row:first-child > .col-sm-12.col-md-6 {
    order: 3;
    flex: 1 1 auto;
    width: auto !important;
    min-width: 0;
    justify-content: flex-end;
    padding: 0;
}

.dataTables_wrapper > .row:first-child > .col-sm-12.col-md-6:first-child {
    order: 1;
    flex: 0 1 360px;
    max-width: 360px;
    justify-content: flex-start;
}

.dataTables_wrapper > .row:first-child .mi-contenido {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 42px;
}

.dataTables_wrapper > .row:first-child .mi-contenido .d-flex {
    width: 100%;
    margin-top: 0 !important;
    align-items: center;
    justify-content: flex-end;
}

.dataTables_wrapper > .row:first-child .mi-contenido .btn-primary,
.dataTables_wrapper > .row:first-child .mi-contenido a.btn.text-white,
.dataTables_wrapper > .row:first-child .mi-contenido .crearAlumno {
    background-color: #015bbd !important;
    border-color: #015bbd !important;
    border-radius: 8px !important;
    padding: 0 16px !important;
    height: 42px !important;
    min-height: 42px !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    box-shadow: none !important;
    color: #fff !important;
}

.dataTables_wrapper > .row:first-child .mi-contenido .btn-primary:hover,
.dataTables_wrapper > .row:first-child .mi-contenido .btn-primary:focus,
.dataTables_wrapper > .row:first-child .mi-contenido a.btn.text-white:hover,
.dataTables_wrapper > .row:first-child .mi-contenido a.btn.text-white:focus,
.dataTables_wrapper > .row:first-child .mi-contenido .crearAlumno:hover,
.dataTables_wrapper > .row:first-child .mi-contenido .crearAlumno:focus {
    background-color: #014a9a !important;
    border-color: #014a9a !important;
    color: #fff !important;
}

.dataTables_wrapper > .row:first-child .dt-buttons {
    margin: 0;
    width: auto;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}

.dataTables_wrapper .dataTables_filter {
    position: relative;
    float: none;
    margin-bottom: 0;
    text-align: left;
}

.dataTables_wrapper > .row:first-child .dataTables_filter {
    width: 100%;
    max-width: 360px;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.dataTables_wrapper .dataTables_filter label {
    position: relative;
    display: block;
    width: 100%;
    height: 42px;
    margin: 0;
    font-size: 0;
    line-height: 0;
    color: transparent;
}

.dataTables_wrapper .dataTables_filter label::before {
    content: "\f002";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa3b2;
    font-size: 0.95rem;
    line-height: 1;
    z-index: 2;
    pointer-events: none;
}

.dataTables_wrapper .dataTables_filter input {
    height: 42px;
    padding: 0 16px 0 2.75rem;
    margin: 0;
    font-size: 0.95rem;
    color: #51586c;
    background-color: #fff;
    border: 1px solid #e0e4ea;
    border-radius: 8px;
    box-shadow: none;
    width: 100%;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: #b8c4d4;
    box-shadow: none;
    outline: 0;
}

.dataTables_wrapper .dataTables_filter input::placeholder {
    color: #9aa3b2;
    font-style: normal;
    opacity: 1;
}

@media (max-width: 768px) {
    .dataTables_wrapper > .row:first-child {
        flex-wrap: wrap;
        gap: 10px;
    }

    .dataTables_wrapper > .row:first-child > .col-sm-12.col-md-5,
    .dataTables_wrapper > .row:first-child > .col-sm-12.col-md-6:first-child {
        flex: 1 1 100%;
        max-width: none;
    }

    .dataTables_wrapper > .row:first-child > .col-sm-12.col-md-6:nth-child(2),
    .dataTables_wrapper > .row:first-child > .col-sm-12.col-md-6:nth-child(3) {
        flex: 1 1 100%;
        justify-content: flex-start;
    }

    .dataTables_wrapper > .row:first-child .dataTables_filter {
        max-width: none;
    }
}

/* alumnos.php — toolbar según diseño */
.page-alumnos #tablaListado_wrapper > .row:first-child {
    flex-wrap: nowrap;
    gap: 12px;
    align-items: center;
}

.page-alumnos #tablaListado_wrapper > .row:first-child > .col-sm-12.col-md-5 {
    order: 1;
    flex: 0 0 240px;
    width: auto !important;
    max-width: 240px;
    padding: 0;
}

.page-alumnos #tablaListado_wrapper > .row:first-child > .col-sm-12.col-md-1 {
    order: 2;
}

.page-alumnos #tablaListado_wrapper > .row:first-child > .col-sm-12.col-md-6 {
    order: 3;
    flex: 1 1 auto;
    width: auto !important;
    min-width: 0;
    padding: 0;
    display: flex;
}

.page-alumnos #tablaListado_wrapper > .row:first-child .dataTables_filter {
    max-width: none;
}

.page-alumnos #tablaListado_wrapper > .row:first-child .mi-contenido {
    align-items: center;
    min-height: 42px;
}

.page-alumnos #tablaListado_wrapper .nav-pills {
    gap: 4px;
    margin-right: 12px;
}

.page-alumnos #tablaListado_wrapper .nav-pills .nav-link {
    color: #51586c;
    border-radius: 8px;
    padding: 0 14px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
}

.page-alumnos #tablaListado_wrapper .nav-pills .nav-link:hover {
    color: #0099e2;
    background-color: #f8fafc;
}

.page-alumnos #tablaListado_wrapper .nav-pills .nav-link.active {
    background-color: #e8f4fc;
    color: #0099e2;
}

.page-alumnos #tablaListado_wrapper .crearAlumno {
    background-color: #015bbd;
    border-color: #015bbd;
    border-radius: 8px;
    padding: 0 16px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
}

.page-alumnos #tablaListado_wrapper .crearAlumno:hover,
.page-alumnos #tablaListado_wrapper .crearAlumno:focus {
    background-color: #014a9a;
    border-color: #014a9a;
    color: #fff;
}

@media (max-width: 1200px) {
    .page-alumnos #tablaListado_wrapper > .row:first-child {
        flex-wrap: wrap;
    }

    .page-alumnos #tablaListado_wrapper > .row:first-child > .col-sm-12.col-md-6 {
        flex: 1 1 100%;
        order: 4;
    }
}
