/* Tema común de tablas AquaGest: cabecera, filtros, datos y totales. */
.ag-workspace .rz-grid-table thead:has(th[data-ag-columna]) th:not([data-ag-columna]) .rz-column-resizer {
    display: none;
}

/* Selección común: contraste visible, también en filas alternas y con estado de factura. */
.ag-workspace {
    --ag-grid-selection-bg: #acd8ec;
    --ag-grid-selection-hover-bg: #97cde5;
    --ag-grid-selection-color: #123b50;
}

.ag-workspace .rz-grid-table tbody > tr:is(.rz-state-highlight, [aria-selected="true"], :has(input[type="checkbox"][aria-label^="Seleccionar "]:checked)) > td,
.ag-workspace .rz-datatable-data > tr.rz-state-highlight > td {
    background-color: var(--ag-grid-selection-bg) !important;
    color: var(--ag-grid-selection-color) !important;
}

.ag-workspace .rz-grid-table tbody > tr:is(.rz-state-highlight, [aria-selected="true"], :has(input[type="checkbox"][aria-label^="Seleccionar "]:checked)):hover > td,
.ag-workspace .rz-datatable-data > tr.rz-state-highlight:hover > td {
    background-color: var(--ag-grid-selection-hover-bg) !important;
}

.ag-workspace .rz-grid-table tbody > tr:is(.rz-state-highlight, [aria-selected="true"], :has(input[type="checkbox"][aria-label^="Seleccionar "]:checked)) > td:first-child {
    box-shadow: inset 4px 0 #087f8e;
}

.ag-workspace .rz-data-grid,
.ag-workspace .rz-datatable {
    --rz-grid-header-background-color: #173d52;
    --rz-grid-header-color: #ffffff;
    --rz-grid-header-font-weight: 650;
    --rz-grid-header-font-size: 13px;
    --rz-grid-foot-background-color: #e3f2ee;
    --rz-grid-foot-cell-color: #123f48;
    border-color: #cbdde6;
    border-radius: 9px;
}

.ag-workspace .rz-grid-table thead > tr:first-child > th {
    background: #173d52;
    color: #fff;
    border-bottom: 3px solid #008e9c;
    border-inline-end-color: #365b6e;
}

.ag-workspace .rz-grid-table thead > tr:first-child .rz-column-title {
    color: #fff;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.5;
}

.ag-workspace .rz-grid-table thead > tr:first-child .rz-sortable-column-icon,
.ag-workspace .rz-grid-table thead > tr:first-child .rz-column-title .rzi {
    color: #bce7eb;
}

.ag-workspace .rz-grid-table thead > tr:not(:first-child) > th {
    background: #eaf2f6;
    border-bottom: 2px solid #c2d7e1;
    border-inline-end-color: #d8e5ec;
}

.ag-workspace .rz-grid-table thead .rz-cell-filter input,
.ag-workspace .rz-grid-table thead .rz-cell-filter .rz-numeric,
.ag-workspace .rz-grid-table thead .rz-cell-filter .rz-dropdown {
    background-color: #fff;
    border-color: #b9cedb;
}

.ag-workspace .rz-grid-table tbody > tr > td {
    color: #24465b;
    font-size: 13px;
    border-bottom-color: #e0e9ef;
}

.ag-workspace .rz-grid-table tbody > tr:nth-child(even):not(.rz-state-highlight) > td {
    background-color: #f6f9fb;
}

.ag-workspace .rz-grid-table tbody > tr:not(.ag-invoice-pending):not(.rz-state-highlight):hover > td {
    background-color: #eaf6f7;
}

.ag-workspace .rz-grid-table tfoot > tr > td {
    background-color: #e3f2ee;
    color: #123f48;
    font-size: 14px;
    font-weight: 700;
    border-top: 2px solid #008e9c;
    border-bottom: 1px solid #b4d8d2;
    padding-top: 14px;
    padding-bottom: 14px;
    font-variant-numeric: tabular-nums;
}

.ag-workspace .rz-grid-table tfoot > tr > td:has(.ag-grid-total) {
    background-color: #d0eae3;
}

.ag-grid-total {
    color: #0e4145;
    font-size: 15px;
    font-weight: 750;
}

.ag-grid-total-label {
    font-size: 11px;
    font-weight: 700;
    white-space: normal;
    letter-spacing: .35px;
    text-transform: uppercase;
}

.ag-workspace .rz-grid-table thead .ag-pending-header label {
    border-radius: 4px;
    background: #ffffff;
}

.ag-workspace .rz-grid-table thead .ag-pending-header label:focus-within {
    outline: 2px solid #62d7df;
    outline-offset: 3px;
}

.ag-workspace .rz-paginator {
    background-color: #f5f9fb;
    border-top-color: #cbdde6;
}

/* Herramientas del listado, fuera de las columnas de datos. */
.ag-workspace .rz-data-grid .rz-group-header{background:#f3f8fa;color:#355769;padding:10px 14px;gap:10px;border-bottom:1px solid #d8e5ec;min-height:58px;flex-wrap:wrap}
.ag-workspace .rz-data-grid .rz-custom-header{flex:1;min-width:180px}
.ag-grid-export-bar{display:flex;align-items:center;justify-content:flex-end;gap:12px;flex-wrap:wrap}
.ag-grid-excel{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:36px;padding:5px 12px;border:1px solid #bad9c9;border-radius:6px;background:#fff;color:#176c48;font-family:inherit;font-size:12px;font-weight:600;cursor:pointer;white-space:nowrap}
.ag-grid-excel svg{width:24px;height:24px}
.ag-grid-excel:hover{background:#e4f3eb;border-color:#499b71}
.ag-grid-excel:focus-visible{outline:2px solid #087f91;outline-offset:2px}
.ag-grid-excel:disabled{opacity:.45;cursor:wait}
.ag-grid-export-status{font-size:12px;color:#355769}
.ag-workspace .rz-data-grid .rz-group-header .rz-dropdown{background:#fff;border-color:#c7d9e3;min-height:36px;max-width:260px;color:#355769;font-size:12px}
@media(max-width:600px){.ag-workspace .rz-data-grid .rz-custom-header{flex-basis:100%}.ag-grid-export-bar{justify-content:flex-start}.ag-grid-export-status{flex-basis:100%}}/* Títulos y estados de los grids. */
.ag-grid-title{margin:0 auto 0 0;color:#173d52;font-size:16px;font-weight:700;line-height:1.4;text-align:left}
.ag-grid-focus-anchor{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.ag-invoices-workspace tr.ag-invoice-agreement-pending>td{background-color:#f2eafa!important}
.ag-invoices-workspace tr.ag-invoice-agreement-pending:hover>td{background-color:#e9dcf5!important}
@media(max-width:600px){.ag-grid-title{flex-basis:100%}}
/* Facturas: anchos ajustados y filtros monetarios compactos. */
.ag-invoices-workspace .rz-grid-table th,.ag-invoices-workspace .rz-grid-table td{padding-left:8px;padding-right:8px}
.ag-invoices-workspace .rz-grid-table .ag-pending-header{gap:5px}
.ag-invoices-workspace .rz-grid-table .ag-pending-header label{padding:1px}
.ag-invoices-workspace .rz-grid-table .ag-pending-header input[type=checkbox]{width:15px;height:15px}
.ag-invoices-workspace .rz-grid-table .rz-cell-filter .rz-numeric{min-width:0;width:100%;max-width:100%}
.ag-invoices-workspace .rz-grid-table tfoot .ag-grid-total{font-size:13px;white-space:nowrap}
.ag-invoices-workspace .rz-grid-table .ag-pending-header{font-size:12px;gap:3px}.ag-invoices-workspace .rz-grid-table .ag-pending-header label{flex-shrink:0}
/* Parcelas: prioridad a la identificación y acceso a la ficha. */
.ag-workspace .ag-parcel-grid .rz-grid-table th,.ag-workspace .ag-parcel-grid .rz-grid-table td{padding-left:7px;padding-right:7px}
.ag-workspace .ag-parcel-grid .rz-grid-table thead .rz-column-title{white-space:normal;line-height:1.35}
.ag-parcel-grid .ag-parcel-identification{display:block;white-space:normal;overflow-wrap:anywhere;line-height:1.45;font-weight:600}
.ag-parcel-grid .rz-cell-filter .rz-numeric{min-width:0;width:100%;max-width:100%}
.ag-workspace .ag-parcel-grid .rz-grid-table tfoot td{font-size:12px;white-space:nowrap}

.ag-grid-title-block { margin-right:auto; display:flex; flex-direction:column; align-items:flex-start; gap:8px; }
.ag-grid-title-block .ag-grid-title { margin:0; }
.ag-grid-select-all { display:flex; align-items:center; gap:8px; color:#24465b; font-size:12px; font-weight:400; cursor:pointer; }
.ag-grid-select-all input[type=checkbox] { width:17px; height:17px; margin:0; accent-color:#087f8e; }



/* El visor del lote mantiene el desplazamiento dentro del grid y la ficha completa. */
.ag-workspace .ag-lot-invoices-grid { width:100%; max-width:100%; min-width:0; }
.ag-workspace .ag-lot-invoices-grid .rz-data-grid-data { min-width:0; max-width:100%; overflow-x:auto; }
.ag-workspace .ag-lot-invoices-grid .rz-grid-table td:last-child .rz-button { white-space:nowrap; }

