/* AdminGrid: ajustes sobre el tema Bootstrap 4 de Tabulator para que combine con los admin
   (header rosa, filas compactas, bordes y hover iguales a admin-table). */

.admin-tabulator.tabulator {
    font-size: 0.88rem;
    border: 1px solid var(--pink-light);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(225,155,157,0.1);
    background: white;
    overflow: hidden;
}

.admin-tabulator .tabulator-header,
.admin-tabulator .tabulator-header .tabulator-col {
    background: var(--pink-accent);
    color: white;
    border-color: rgba(255,255,255,0.25);
}

.admin-tabulator .tabulator-header .tabulator-col .tabulator-col-content {
    padding: 8px 10px;
}

.admin-tabulator .tabulator-header .tabulator-col .tabulator-col-title {
    font-weight: bold;
}

/* Debe superar la especificidad de tabulator_bootstrap4 (.tabulator-col-sorter-element:hover). */
.admin-tabulator.tabulator .tabulator-header .tabulator-col.tabulator-sortable.tabulator-col-sorter-element:hover {
    background-color: #d78d95;
}

.admin-tabulator .tabulator-header .tabulator-col .tabulator-col-sorter .tabulator-arrow {
    border-bottom-color: rgba(255,255,255,0.7);
}

.admin-tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="ascending"] .tabulator-col-sorter .tabulator-arrow,
.admin-tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort="descending"] .tabulator-col-sorter .tabulator-arrow {
    border-top-color: white;
    border-bottom-color: white;
}

.admin-tabulator.tabulator .tabulator-header .tabulator-col .tabulator-header-filter {
    margin-top: 4px;
}

/* Misma especificidad que el tema Bootstrap 4 (+1) para ganarle al padding grande del form-control. */
.admin-tabulator.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input,
.admin-tabulator.tabulator .tabulator-header .tabulator-col .tabulator-header-filter select {
    width: 100%;
    height: 26px;
    padding: 2px 8px;
    border: 1px solid #dfe3e8;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: normal;
    line-height: 1.2;
    box-sizing: border-box;
    background: white;
    color: var(--brown-text);
}

.admin-tabulator.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input:focus,
.admin-tabulator.tabulator .tabulator-header .tabulator-col .tabulator-header-filter select:focus {
    outline: none;
    border-color: white;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.4);
}

.admin-tabulator .tabulator-row {
    min-height: 0;
    border-bottom: 1px solid rgba(225,155,157,0.2);
    color: var(--brown-text);
}

/* Mismo tamaño que .admin-table tbody td (0.82rem); el header se queda en 0.88rem. */
.admin-tabulator .tabulator-row .tabulator-cell {
    padding: 6px 10px;
    border-right: none;
    font-size: 0.82rem;
}

.admin-tabulator .tabulator-row.tabulator-row-even {
    background: white;
}

.admin-tabulator .tabulator-row.tabulator-selectable:hover {
    background: #fff5f5;
}

.admin-tabulator .tabulator-row.tabulator-selected,
.admin-tabulator .tabulator-row.tabulator-selected:hover {
    background: #fbe4e6;
}

/* inline-flex: las celdas de Tabulator son inline-block; con display:flex la celda salta a otra línea. */
.admin-tabulator .tabulator-row .tabulator-cell.admin-actions-cell {
    display: inline-flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    vertical-align: middle;
}

.admin-tabulator .tabulator-cell.admin-grid-select-cell input[type="checkbox"],
.admin-tabulator .tabulator-col.admin-grid-select-cell input[type="checkbox"] {
    accent-color: var(--pink-accent);
    cursor: pointer;
}

.admin-tabulator .tabulator-tableholder .tabulator-placeholder .tabulator-placeholder-contents {
    color: #7a5246;
    font-size: 0.9rem;
    font-weight: normal;
}

.admin-tabulator.tabulator .tabulator-footer {
    background: #fdf0f1;
    border-top: 1px solid rgba(225,155,157,0.3);
    color: var(--brown-text);
    font-size: 0.74rem;
    font-weight: normal;
    padding: 3px 10px;
    line-height: 1.3;
    text-align: left;
}

/* Barra "Seleccionar varios" pegada al grid: sin margen inferior y esquinas unidas. */
.admin-grid-toolbar.admin-multi-select-toolbar {
    margin-top: 0;
    margin-bottom: 0;
    border-radius: 8px 8px 0 0;
}

.admin-grid-toolbar + .admin-tabulator.tabulator {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-top: none;
}

.admin-tabulator .admin-grid-count strong {
    color: var(--brown-text);
}

.admin-tabulator .tabulator-footer .tabulator-page.active {
    background: var(--pink-accent);
    color: white;
    border-color: var(--pink-accent);
}

/* Botón de imagen dentro del grid (misma apariencia que en admin-table). */
.admin-tabulator .admin-table-img-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 6px;
    border: 1px solid var(--pink-light);
    background: #fff3f6;
    color: var(--pink-accent);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    line-height: 1;
}

.admin-tabulator .admin-table-img-btn:hover {
    background: #fff8fa;
    border-color: #f5c9d0;
    color: #d78d95;
}

/* Barra de búsqueda general sobre el grid. */
.admin-grid-search {
    margin: 0 0 10px;
}

.admin-grid-search input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 7px 12px;
    border: 1px solid #dfe3e8;
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--brown-text);
    background: white;
}

.admin-grid-search input:focus {
    outline: none;
    border-color: var(--pink-accent);
    box-shadow: 0 0 0 2px rgba(225,155,157,0.15);
}
