* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Sans-serif;
}

@media print {
    .table, .table__body {
        overflow: visible;
        height: auto !important;
        width: auto !important;
    }
}

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #ffffff;
}

main.table {
    width: 90vw; /* Cambiado de 45vw para mayor flexibilidad en pantallas pequeñas */
    max-width: 1200px; /* Establece un ancho máximo para grandes pantallas */
    height: 70vh;
    background-color: #fff5;
    backdrop-filter: blur(7px);
    box-shadow: 0 .5rem .8rem #7354d5bd;
    border-radius: .8rem;
    overflow: auto;
}

.table__header {
    width: 100%;
    height: 10%;
    background-color: #fff4;
    padding: .8rem 1rem;
    display: flex;
    justify-content: center; /* Cambiado de space-between a center para una mejor apariencia */
    align-items: center;
}

.table__body {
    background-color: #fffb;
    margin: .8rem auto;
    border-radius: .6rem;
    overflow: auto;
}

.table__body::-webkit-scrollbar {
    width: 0.5rem;
    height: 0.5rem;
}

.table__body::-webkit-scrollbar-thumb {
    border-radius: .5rem;
    background-color: #0004;
    visibility: hidden;
}

.table__body:hover::-webkit-scrollbar-thumb { 
    visibility: visible;
}

table {
    width: 100%;
    border-collapse: collapse; /* Mejor para la presentación de tablas */
}

td img {
    width: 36px;
    height: 36px;
    margin-right: .5rem;
    border-radius: 50%;
    vertical-align: middle;
}

th, td {
    padding: 1.5rem; /* Reducido de 2rem para mejorar la legibilidad en pantallas pequeñas */
    text-align: inherit;
}

thead th {
    position: sticky;
    top: 0;
    background-color: #7354d5bd;
    text-transform: capitalize;
}

tbody tr:nth-child(even) {
    background-color: #0000000b;
}

tbody tr {
    --delay: .1s;
    transition: .5s ease-in-out var(--delay), background-color 0s;
}

tbody tr.hide {
    opacity: 0;
    transform: translateX(100%);
}

tbody tr:hover {
    background-color: #009AD9 !important;
}

tbody tr td,
tbody tr td p,
tbody tr td img {
    transition: .2s ease-in-out;
}

tbody tr.hide td,
tbody tr.hide td p {
    padding: 0;
    font: 0 / 0 sans-serif;
    transition: .2s ease-in-out .5s;
}

tbody tr.hide td img {
    width: 0;
    height: 0;
    transition: .2s ease-in-out .5s;
}

/* Responsividad para pantallas más pequeñas */
@media (max-width: 1000px) {
    td:not(:first-of-type) {
        min-width: 12.1rem;
    }
}

@media (max-width: 768px) {
    .table__header {
        flex-direction: column; /* Para mejorar la disposición en pantallas pequeñas */
        align-items: flex-start; /* Alinear elementos al principio */
    }

    main.table {
        width: 95vw; /* Aumentado para mejorar el uso del espacio en pantallas pequeñas */
    }

    th, td {
        padding: .5rem; /* Reducido para pantallas más pequeñas */
    }

    td:not(:first-of-type) {
        min-width: 8rem; /* Ajuste en pantallas más pequeñas */
    }
}
