/**
 * Listado Escrituras - Estilos
 * Hereda tipografía y colores del tema activo de WordPress.
 */

.le-container {
    max-width: 100%;
    margin: 1.5em 0;
    font: inherit;
    color: inherit;
}

.le-title {
    margin: 0 0 1em 0;
}

/* ===== GRID DE FILTROS ===== */
.le-filtros {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px 16px;
    padding: 1em;
    margin-bottom: 1.5em;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.02);
}

.le-filtro {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.le-filtro label {
    font-size: 0.875em;
    font-weight: 600;
    margin-bottom: 4px;
}

.le-filtro input[type="text"],
.le-filtro input[type="number"],
.le-filtro input[type="date"],
.le-filtro select {
    padding: 7px 10px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 3px;
    font: inherit;
    font-size: 0.9375em;
    color: inherit;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
}

.le-filtro input:focus,
.le-filtro select:focus {
    outline: 2px solid currentColor;
    outline-offset: 1px;
}

/* ===== BOTONES ===== */
.le-acciones {
    justify-content: flex-end;
    flex-direction: row;
    align-items: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.le-btn {
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 3px;
    font: inherit;
    font-size: 0.9375em;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.15s;
}

.le-btn-primary {
    background: var(--wp--preset--color--primary, #2b2d2f);
    color: var(--wp--preset--color--background, #fff);
    border-color: var(--wp--preset--color--primary, #2b2d2f);
}

.le-btn-primary:hover {
    opacity: 0.85;
}

.le-btn-secondary {
    background: transparent;
    color: inherit;
    border-color: currentColor;
    opacity: 0.7;
}

.le-btn-secondary:hover {
    opacity: 1;
}

/* ===== MENSAJE INICIAL ===== */
.le-mensaje {
    padding: 30px 20px;
    text-align: center;
    color: rgba(0, 0, 0, 0.55);
    font-style: italic;
    border: 1px dashed rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    margin-bottom: 1em;
}

/* ===== TABLA ===== */
.le-tabla-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

#le-tabla {
    width: 100% !important;
    font: inherit;
    min-width: 600px;
}

#le-tabla thead th {
    font-weight: 600;
    white-space: nowrap;
}

#le-tabla tbody td {
    word-break: break-word;
}

/* DataTables hereda del tema */
.dataTables_wrapper,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    font: inherit;
    color: inherit;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    margin: 8px 0 !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .le-filtros {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .le-acciones {
        flex-direction: row;
        justify-content: space-between;
    }

    .le-btn {
        flex: 1;
        padding: 10px 12px;
        font-size: 0.875em;
    }

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        text-align: center !important;
        float: none !important;
    }

    .dataTables_wrapper .dataTables_paginate .paginate_button {
        padding: 4px 8px !important;
        margin: 0 1px !important;
    }
}
