
.historial-contenedor {
    margin-top: 28px;
    margin-bottom: 40px;
}

/* Filtros */
.historial-filtros {
    display: grid;
    grid-template-columns: minmax(200px, 2fr) repeat(2, minmax(150px, 1fr)) auto;
    gap: 14px;
    align-items: end;
    padding: 20px;
    margin-bottom: 22px;
    background: #fff;
    border: 1px solid #dce4ec;
    border-radius: 12px;
}

.historial-filtros label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
}

.historial-filtros input {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid #ccd7e2;
    border-radius: 7px;
    font: inherit;
    box-sizing: border-box;
}

.historial-boton {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 42px;
    padding: 10px 16px;
    border: 0;
    border-radius: 7px;
    background: #183b55;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.historial-boton:hover {
    background: #245477;
}

.historial-resumen {
    margin: 0 0 14px;
    color: #526579;
}

/* Tabla: ocupa el ancho disponible */
.tabla-historial-contenedor {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    background: #fff;
    border: 1px solid #dce4ec;
    border-radius: 12px;
    box-sizing: border-box;
}

.tabla-historial {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 11px;
}

.tabla-historial th,
.tabla-historial td {
    padding: 9px 5px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid #e5ebf0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    line-height: 1.35;
}

.tabla-historial th {
    background: #183b55;
    color: #fff;
    font-weight: 600;
    font-size: 10px;
}

.tabla-historial tbody tr:nth-child(even) {
    background: #f7f9fb;
}

.tabla-historial tbody tr:hover {
    background: #edf4f8;
}

/* Mensajes */
.historial-vacio,
.historial-error {
    padding: 18px;
    border-radius: 9px;
    margin-bottom: 18px;
}

.historial-vacio {
    background: #fff;
    border: 1px solid #dce4ec;
}

.historial-error {
    background: #fff0f0;
    border: 1px solid #e7b4b4;
    color: #9b2525;
}

/* Botones superiores */
.historial-acciones {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

/* Pantallas medianas */
@media (max-width: 1100px) {
    .tabla-historial {
        font-size: 10px;
    }

    .tabla-historial th {
        font-size: 9px;
    }

    .tabla-historial th,
    .tabla-historial td {
        padding: 7px 3px;
    }
}

/* Pantallas pequeñas */
@media (max-width: 850px) {
    .historial-filtros {
        grid-template-columns: 1fr;
    }

    .historial-acciones {
        justify-content: flex-start;
    }

    .tabla-historial {
        font-size: 9px;
    }

    .tabla-historial th {
        font-size: 8px;
    }

    .tabla-historial th,
    .tabla-historial td {
        padding: 6px 2px;
    }
}
