/* ==========================================================================
   Informe de Ventas Brutas Vinculadas
   Prefijo ivb- (informe ventas brutas). Hoja global, no ".razor.css", porque
   los desplegables de filtro se construyen con RenderTreeBuilder y esos
   elementos no reciben el atributo de aislamiento de Blazor.
   ========================================================================== */

.ivb {
    --ivb-ink: #1d1d26;
    --ivb-ink-soft: #475569;
    --ivb-ink-faint: #94a3b8;
    --ivb-line: #e5e7ef;
    --ivb-line-strong: #cbd5e1;
    --ivb-soft: #f6f7fb;
    --ivb-accent: var(--brand-primary, #FF6600);
    --ivb-accent-strong: var(--brand-primary-dark, #E55A00);
    --ivb-ring: rgba(var(--brand-primary-rgb, 255, 102, 0), .22);
    --ivb-ok: #12805c;
    --ivb-warn: #b45309;
    --ivb-ko: #c62828;

    /* Anchos de las cuatro columnas congeladas: la tabla los reutiliza para
       calcular los desplazamientos sticky, así que se declaran una sola vez. */
    --ivb-w1: 140px;   /* Corresponde a */
    --ivb-w2: 230px;   /* ID Ope */
    --ivb-w3: 120px;   /* FchActoComercial */
    --ivb-w4: 100px;   /* FechaActC */

    /* Altura fija de la fila de cabeceras: fija el `top` de la fila de filtros. */
    --ivb-head-h: 38px;

    color: var(--ivb-ink);
}


/* ── Cabecera de la pantalla ─────────────────────────────────────────────── */

.ivb .ivb-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.4rem;
    border-radius: var(--radius-lg, .75rem);
    background: linear-gradient(135deg, #1d1d26 0%, #2b2b38 55%, var(--ivb-accent) 165%);
    color: #fff;
    box-shadow: 0 6px 20px rgba(15, 23, 42, .18);
    margin-bottom: 1rem;
}

.ivb .ivb-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .14em;
    font-weight: var(--font-weight-semibold, 600);
    color: rgba(255, 255, 255, .62);
}

.ivb .ivb-title {
    margin: .2rem 0 .15rem;
    font-size: 1.35rem;
    font-weight: var(--font-weight-bold, 700);
    letter-spacing: -.01em;
}

.ivb .ivb-subtitle {
    margin: 0;
    font-size: .84rem;
    color: rgba(255, 255, 255, .72);
}

.ivb .ivb-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

/* Botones sobre el fondo oscuro de la cabecera. */
.ivb .ivb-btn-hero {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    border: 1px solid rgba(255, 255, 255, .28);
    background: rgba(255, 255, 255, .10);
    color: #fff;
    border-radius: var(--radius-md, .5rem);
    padding: .42rem .85rem;
    font-size: .82rem;
    font-weight: var(--font-weight-semibold, 600);
    transition: background var(--duration-fast, 150ms) var(--ease-out, ease),
                border-color var(--duration-fast, 150ms) var(--ease-out, ease),
                transform var(--duration-fast, 150ms) var(--ease-out, ease);
}

.ivb .ivb-btn-hero:hover:not(:disabled) {
    background: rgba(255, 255, 255, .2);
    border-color: rgba(255, 255, 255, .45);
}

.ivb .ivb-btn-hero:active:not(:disabled) {
    transform: translateY(1px);
}

.ivb .ivb-btn-hero:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.ivb .ivb-btn-hero:focus-visible {
    outline: none;
    box-shadow: 0 0 0 .2rem rgba(255, 255, 255, .35);
}


/* ── Pestañas ────────────────────────────────────────────────────────────── */

/* Control segmentado: dos vistas del mismo mes, no dos secciones distintas. */
.ivb .ivb-tabs {
    display: inline-flex;
    gap: .25rem;
    padding: .25rem;
    background: var(--ivb-soft);
    border: 1px solid var(--ivb-line);
    border-radius: 999px;
    margin-bottom: .9rem;
}

.ivb .ivb-tab {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    border: 0;
    background: transparent;
    color: var(--ivb-ink-soft);
    border-radius: 999px;
    padding: .4rem 1rem;
    font-size: .84rem;
    font-weight: var(--font-weight-semibold, 600);
    transition: background var(--duration-fast, 150ms) var(--ease-out, ease),
                color var(--duration-fast, 150ms) var(--ease-out, ease);
}

.ivb .ivb-tab:hover:not(.is-active) {
    background: #fff;
    color: var(--ivb-ink);
}

.ivb .ivb-tab.is-active {
    background: #fff;
    color: var(--ivb-accent-strong);
    box-shadow: 0 1px 4px rgba(15, 23, 42, .12);
}

.ivb .ivb-tab:focus-visible {
    outline: none;
    box-shadow: 0 0 0 .2rem var(--ivb-ring);
}

.ivb .ivb-tab-count {
    font-size: .68rem;
    font-weight: var(--font-weight-bold, 700);
    background: var(--ivb-soft);
    color: var(--ivb-ink-soft);
    border-radius: 999px;
    padding: .05rem .45rem;
    font-variant-numeric: tabular-nums;
}

.ivb .ivb-tab.is-active .ivb-tab-count {
    background: rgba(var(--brand-primary-rgb, 255, 102, 0), .14);
    color: var(--ivb-accent-strong);
}


/* ── Paneles y barra de herramientas ─────────────────────────────────────── */

.ivb .ivb-panel {
    background: var(--color-surface, #fff);
    border: 1px solid var(--ivb-line);
    border-radius: var(--radius-lg, .75rem);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .05);
}

.ivb .ivb-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: .75rem;
    padding: .8rem 1rem;
    margin-bottom: .9rem;
}

.ivb .ivb-field {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.ivb .ivb-field > label {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: var(--font-weight-semibold, 600);
    color: var(--ivb-ink-faint);
}

.ivb .ivb-field select {
    border: 1px solid var(--ivb-line-strong);
    border-radius: var(--radius-sm, .375rem);
    padding: .34rem 1.9rem .34rem .6rem;
    font-size: .84rem;
    font-weight: var(--font-weight-semibold, 600);
    color: var(--ivb-ink);
    background-color: #fff;
}

.ivb .ivb-field select:focus {
    outline: none;
    border-color: var(--ivb-accent);
    box-shadow: 0 0 0 .2rem var(--ivb-ring);
}

/* Separador vertical entre "qué cargo" y "qué hago con lo cargado". */
.ivb .ivb-toolbar-sep {
    width: 1px;
    align-self: stretch;
    min-height: 2rem;
    background: var(--ivb-line);
    margin: 0 .15rem;
}

.ivb .ivb-toolbar-spacer {
    flex: 1 1 auto;
}

.ivb .ivb-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    border-radius: var(--radius-sm, .375rem);
    padding: .4rem .85rem;
    font-size: .82rem;
    font-weight: var(--font-weight-semibold, 600);
    border: 1px solid transparent;
    transition: background var(--duration-fast, 150ms) var(--ease-out, ease),
                border-color var(--duration-fast, 150ms) var(--ease-out, ease),
                transform var(--duration-fast, 150ms) var(--ease-out, ease);
}

.ivb .ivb-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.ivb .ivb-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.ivb .ivb-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 .2rem var(--ivb-ring);
}

.ivb .ivb-btn-primary {
    background: var(--ivb-accent);
    border-color: var(--ivb-accent);
    color: #fff;
}

.ivb .ivb-btn-primary:hover:not(:disabled) {
    background: var(--ivb-accent-strong);
    border-color: var(--ivb-accent-strong);
}

.ivb .ivb-btn-soft {
    background: #fff;
    border-color: var(--ivb-line-strong);
    color: var(--ivb-ink-soft);
}

.ivb .ivb-btn-soft:hover:not(:disabled) {
    background: var(--ivb-soft);
    border-color: var(--ivb-ink-faint);
    color: var(--ivb-ink);
}

/* Guardar cambia de tono según haya o no algo que guardar: el botón es el
   propio aviso de "tienes trabajo pendiente". */
.ivb .ivb-btn-guardar {
    background: #fff;
    border-color: var(--ivb-line-strong);
    color: var(--ivb-ink-faint);
}

.ivb .ivb-btn-guardar.is-dirty {
    background: #f97316;
    border-color: #ea580c;
    color: #fff;
    animation: ivb-pulso 2.4s ease-in-out infinite;
}

.ivb .ivb-btn-guardar.is-dirty:hover:not(:disabled) {
    background: #ea580c;
}

@keyframes ivb-pulso {
    0%, 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, .0); }
    50%      { box-shadow: 0 0 0 .28rem rgba(249, 115, 22, .22); }
}

@media (prefers-reduced-motion: reduce) {
    .ivb .ivb-btn-guardar.is-dirty { animation: none; }
}


/* ── Indicadores ─────────────────────────────────────────────────────────── */

.ivb .ivb-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: .6rem;
    margin-bottom: .9rem;
}

/* Cada indicador es además un atajo de filtrado: se comporta como botón. */
.ivb .ivb-kpi {
    position: relative;
    overflow: hidden;
    text-align: left;
    background: var(--color-surface, #fff);
    border: 1px solid var(--ivb-line);
    border-radius: var(--radius-md, .5rem);
    padding: .55rem .8rem .6rem;
    transition: border-color var(--duration-fast, 150ms) var(--ease-out, ease),
                box-shadow var(--duration-fast, 150ms) var(--ease-out, ease),
                transform var(--duration-fast, 150ms) var(--ease-out, ease);
}

.ivb .ivb-kpi::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--ivb-kpi-color, var(--ivb-line-strong));
}

.ivb .ivb-kpi:hover {
    border-color: var(--ivb-line-strong);
    box-shadow: 0 4px 12px rgba(15, 23, 42, .09);
    transform: translateY(-1px);
}

.ivb .ivb-kpi:focus-visible {
    outline: none;
    box-shadow: 0 0 0 .2rem var(--ivb-ring);
}

.ivb .ivb-kpi.is-active {
    border-color: var(--ivb-kpi-color, var(--ivb-accent));
    box-shadow: inset 0 0 0 1px var(--ivb-kpi-color, var(--ivb-accent));
}

.ivb .ivb-kpi-label {
    display: block;
    font-size: .66rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: var(--font-weight-semibold, 600);
    color: var(--ivb-ink-faint);
}

.ivb .ivb-kpi-valor {
    display: block;
    font-size: 1.25rem;
    font-weight: var(--font-weight-bold, 700);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    color: var(--ivb-kpi-color, var(--ivb-ink));
}

.ivb .ivb-kpi-pie {
    font-size: .68rem;
    color: var(--ivb-ink-faint);
}


/* ── Buscador rápido y chips de filtros activos ──────────────────────────── */

.ivb .ivb-filtrobar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    padding: .6rem .8rem;
    margin-bottom: .6rem;
}

.ivb .ivb-buscador {
    position: relative;
    flex: 0 1 24rem;
    min-width: 14rem;
}

.ivb .ivb-buscador > i {
    position: absolute;
    left: .65rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ivb-ink-faint);
    font-size: .8rem;
    pointer-events: none;
}

.ivb .ivb-buscador input {
    width: 100%;
    border: 1px solid var(--ivb-line-strong);
    border-radius: 999px;
    padding: .35rem 2rem .35rem 2rem;
    font-size: .82rem;
    background: #fff;
}

.ivb .ivb-buscador input:focus {
    outline: none;
    border-color: var(--ivb-accent);
    box-shadow: 0 0 0 .2rem var(--ivb-ring);
}

.ivb .ivb-buscador-limpiar {
    position: absolute;
    right: .35rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--ivb-ink-faint);
    line-height: 1;
    padding: .2rem .35rem;
    border-radius: 50%;
}

.ivb .ivb-buscador-limpiar:hover {
    color: var(--ivb-ko);
    background: var(--ivb-soft);
}

.ivb .ivb-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem;
}

.ivb .ivb-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: var(--ivb-soft);
    border: 1px solid var(--ivb-line);
    border-radius: 999px;
    padding: .12rem .3rem .12rem .55rem;
    font-size: .72rem;
    color: var(--ivb-ink-soft);
    max-width: 18rem;
}

.ivb .ivb-chip b {
    color: var(--ivb-ink);
    font-weight: var(--font-weight-semibold, 600);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ivb .ivb-chip-x {
    border: 0;
    background: transparent;
    color: var(--ivb-ink-faint);
    line-height: 1;
    padding: .1rem .25rem;
    border-radius: 50%;
}

.ivb .ivb-chip-x:hover {
    background: #fee2e2;
    color: var(--ivb-ko);
}

.ivb .ivb-chips-todos {
    border: 0;
    background: transparent;
    color: var(--ivb-accent-strong);
    font-size: .72rem;
    font-weight: var(--font-weight-semibold, 600);
    text-decoration: underline;
    padding: 0 .25rem;
}

.ivb .ivb-contador {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: var(--font-weight-bold, 700);
    padding: .15rem .6rem;
    font-variant-numeric: tabular-nums;
    background: var(--ivb-soft);
    color: var(--ivb-ink-soft);
    border: 1px solid var(--ivb-line);
}

.ivb .ivb-contador-dirty {
    background: #ffedd5;
    color: #9a3412;
    border-color: #fdba74;
}


/* ── Estados vacíos ──────────────────────────────────────────────────────── */

.ivb .ivb-estado {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .4rem;
    text-align: center;
    padding: 2.6rem 1.5rem;
    border: 1px dashed var(--ivb-line-strong);
    border-radius: var(--radius-lg, .75rem);
    background: var(--color-surface, #fff);
    color: var(--ivb-ink-soft);
}

.ivb .ivb-estado i {
    font-size: 1.8rem;
    color: var(--ivb-ink-faint);
}

.ivb .ivb-estado-titulo {
    font-weight: var(--font-weight-bold, 700);
    color: var(--ivb-ink);
}

.ivb .ivb-estado-texto {
    font-size: .84rem;
    margin: 0;
    max-width: 34rem;
}

.ivb .ivb-estado.is-error {
    border-style: solid;
    border-color: #fca5a5;
    background: #fef2f2;
}

.ivb .ivb-estado.is-error i,
.ivb .ivb-estado.is-error .ivb-estado-titulo {
    color: var(--ivb-ko);
}

.ivb .ivb-estado.is-ok {
    border-style: solid;
    border-color: #86efac;
    background: #f0fdf4;
}

.ivb .ivb-estado.is-ok i,
.ivb .ivb-estado.is-ok .ivb-estado-titulo {
    color: var(--ivb-ok);
}

/* Barra de progreso indeterminada mientras se consulta el mes. */
.ivb .ivb-progreso {
    height: 3px;
    border-radius: 999px;
    background: var(--ivb-soft);
    overflow: hidden;
    margin-bottom: .8rem;
}

.ivb .ivb-progreso::after {
    content: "";
    display: block;
    height: 100%;
    width: 35%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--ivb-accent), var(--ivb-accent-strong));
    animation: ivb-progreso 1.1s ease-in-out infinite;
}

@keyframes ivb-progreso {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(320%); }
}


/* ── Tabla ───────────────────────────────────────────────────────────────── */

.ivb .ivb-tabla-wrap {
    overflow: auto;
    max-height: 68vh;
    min-height: 360px;
    border-radius: var(--radius-lg, .75rem) var(--radius-lg, .75rem) 0 0;
    /* El arrastre con el ratón mueve el scroll: el cursor lo anuncia. */
    cursor: grab;
}

.ivb .ivb-tabla {
    width: 100%;
    table-layout: fixed;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .82rem;
}

/* Anchos de columna: utilidades sobre <col> para no repetir estilos en línea. */
.ivb .ivb-tabla col.ivb-w80  { width: 80px; }
.ivb .ivb-tabla col.ivb-w90  { width: 90px; }
.ivb .ivb-tabla col.ivb-w100 { width: 100px; }
.ivb .ivb-tabla col.ivb-w110 { width: 110px; }
.ivb .ivb-tabla col.ivb-w115 { width: 115px; }
.ivb .ivb-tabla col.ivb-w120 { width: 120px; }
.ivb .ivb-tabla col.ivb-w130 { width: 130px; }
.ivb .ivb-tabla col.ivb-w140 { width: 140px; }
.ivb .ivb-tabla col.ivb-w150 { width: 150px; }
.ivb .ivb-tabla col.ivb-w160 { width: 160px; }
.ivb .ivb-tabla col.ivb-w170 { width: 170px; }
.ivb .ivb-tabla col.ivb-w180 { width: 180px; }
.ivb .ivb-tabla col.ivb-w230 { width: 230px; }

.ivb .ivb-tabla th,
.ivb .ivb-tabla td {
    padding: .34rem .5rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--ivb-line);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Cabecera pegada arriba; la fila de filtros se pega justo debajo. */
.ivb .ivb-tabla thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    height: var(--ivb-head-h);
    background: #f1f3f8;
    border-bottom: 1px solid var(--ivb-line-strong);
    font-size: .7rem;
    font-weight: var(--font-weight-bold, 700);
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--ivb-ink-soft);
    user-select: none;
}

.ivb .ivb-tabla thead .ivb-filtros td {
    position: sticky;
    top: var(--ivb-head-h);
    z-index: 3;
    background: #fafbfe;
    border-bottom: 2px solid var(--ivb-line-strong);
    padding: .25rem .35rem;
    overflow: visible;
}

/* Cabecera ordenable: la flecha aparece al pasar y se queda en la activa. */
.ivb .ivb-tabla th.ivb-th-sort {
    cursor: pointer;
    transition: background var(--duration-fast, 150ms) var(--ease-out, ease),
                color var(--duration-fast, 150ms) var(--ease-out, ease);
}

.ivb .ivb-tabla th.ivb-th-sort:hover {
    background: #e6e9f2;
    color: var(--ivb-ink);
}

.ivb .ivb-tabla th.ivb-th-sort .fa-sort {
    opacity: 0;
    transition: opacity var(--duration-fast, 150ms) var(--ease-out, ease);
}

.ivb .ivb-tabla th.ivb-th-sort:hover .fa-sort {
    opacity: .55;
}

.ivb .ivb-tabla th.is-sorted {
    color: var(--ivb-accent-strong);
    background: #fff3e9;
    box-shadow: inset 0 -2px 0 var(--ivb-accent);
}

/* Columnas congeladas a la izquierda. */
.ivb .ivb-fz {
    position: sticky;
    z-index: 1;
    background: var(--bs-table-bg, #fff);
}

.ivb .ivb-tabla thead .ivb-fz {
    z-index: 5;
}

/* La fila de filtros pone z-index a todas sus celdas con más peso que la regla
   de arriba, así que las congeladas quedaban al mismo nivel que las que
   scrollean y éstas, por ir después en el marcado, las pintaban encima: parecía
   que la parte fija se movía. Se las vuelve a subir con la misma especificidad. */
.ivb .ivb-tabla thead .ivb-filtros td.ivb-fz {
    z-index: 5;
}

.ivb .ivb-fz1 { left: 0; }
.ivb .ivb-fz2 { left: var(--ivb-w1); }
.ivb .ivb-fz3 { left: calc(var(--ivb-w1) + var(--ivb-w2)); }
.ivb .ivb-fz4 { left: calc(var(--ivb-w1) + var(--ivb-w2) + var(--ivb-w3)); }

/* Sombra en la última columna congelada: marca dónde empieza lo que scrollea. */
.ivb .ivb-fz4::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: -1px;
    right: -10px;
    width: 10px;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(15, 23, 42, .10), transparent);
}

/* Filas */
.ivb .ivb-tabla tbody tr {
    transition: background var(--duration-fast, 150ms) var(--ease-out, ease);
}

.ivb .ivb-tabla tbody tr > td:first-child {
    box-shadow: inset 3px 0 0 var(--ivb-acento, transparent);
}

.ivb .ivb-tabla tbody tr:hover > td {
    background: #eef2ff;
}

.ivb .ivb-tabla tbody tr:hover > td.ivb-fz {
    background: #eef2ff;
}

/* Informe sin operación vinculada: se lee como un hueco, no como un dato. */
.ivb .ivb-tabla tbody tr.is-suelto > td:first-child {
    box-shadow: inset 3px 0 0 #cbd5e1;
}

.ivb .ivb-tabla tbody tr.is-suelto {
    color: var(--ivb-ink-faint);
}

/* Fila con cambios sin guardar: ésta sí tiene que cantar. */
.ivb .ivb-tabla tbody tr.is-dirty > td,
.ivb .ivb-tabla tbody tr.is-dirty:hover > td {
    background: #fff1e4;
}

.ivb .ivb-tabla tbody tr.is-dirty > td:first-child {
    box-shadow: inset 3px 0 0 #ea580c;
}

.ivb .ivb-tabla tbody tr.is-revisada .ivb-check-label {
    color: var(--ivb-ok);
    font-weight: var(--font-weight-semibold, 600);
}

/* Enlaces a la operación en ControlGo. */
.ivb .ivb-link {
    color: var(--ivb-ink);
    font-weight: var(--font-weight-semibold, 600);
    text-decoration: none;
    border-bottom: 1px dotted var(--ivb-line-strong);
}

.ivb .ivb-link:hover {
    color: var(--ivb-accent-strong);
    border-bottom-color: var(--ivb-accent);
}

.ivb .ivb-vacio {
    color: var(--ivb-ink-faint);
}

/* Etiqueta de "Corresponde a": tinte de la propia regla de vinculación. */
.ivb .ivb-etiqueta {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: .7rem;
    font-weight: var(--font-weight-bold, 700);
    letter-spacing: .02em;
    color: var(--ivb-acento, var(--ivb-ink));
}

/* Botones-icono de la celda ID Ope: discretos hasta que se pasa por la fila. */
.ivb .ivb-icono {
    border: 0;
    background: transparent;
    color: var(--ivb-ink-faint);
    padding: .1rem .25rem;
    border-radius: var(--radius-sm, .375rem);
    line-height: 1;
    opacity: .25;
    transition: opacity var(--duration-fast, 150ms) var(--ease-out, ease),
                color var(--duration-fast, 150ms) var(--ease-out, ease),
                background var(--duration-fast, 150ms) var(--ease-out, ease);
}

.ivb .ivb-tabla tbody tr:hover .ivb-icono,
.ivb .ivb-icono:focus-visible {
    opacity: 1;
}

.ivb .ivb-icono:hover {
    background: var(--ivb-soft);
}

.ivb .ivb-icono-vincular:hover  { color: var(--ivb-ok); }
.ivb .ivb-icono-editar:hover    { color: var(--ivb-accent-strong); }
.ivb .ivb-icono-desvincular:hover { color: var(--ivb-ko); }

/* Celda de edición de vinculación: crece sobre el resto de la fila. */
.ivb .ivb-editor {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    white-space: normal;
}

.ivb .ivb-aviso {
    border-radius: var(--radius-sm, .375rem);
    padding: .35rem .5rem;
    font-size: .72rem;
    line-height: 1.35;
    white-space: normal;
}

.ivb .ivb-aviso-error { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.ivb .ivb-aviso-ojo   { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }

/* Interruptor de revisado */
.ivb .ivb-check {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin: 0;
    cursor: pointer;
}

.ivb .ivb-check input.form-check-input {
    margin: 0;
    cursor: pointer;
}

.ivb .ivb-check input.form-check-input:checked {
    background-color: var(--ivb-ok);
    border-color: var(--ivb-ok);
}

.ivb .ivb-check input.form-check-input:focus {
    box-shadow: 0 0 0 .2rem var(--ivb-ring);
    border-color: var(--ivb-accent);
}

.ivb .ivb-check-label {
    font-size: .72rem;
    color: var(--ivb-ink-faint);
}

/* Campos dentro de la tabla (comentario, búsquedas por columna). */
.ivb .ivb-input {
    width: 100%;
    border: 1px solid transparent;
    background: #fff;
    border-radius: var(--radius-sm, .375rem);
    padding: .2rem .45rem;
    font-size: .78rem;
    color: var(--ivb-ink);
    box-shadow: inset 0 0 0 1px var(--ivb-line);
}

.ivb .ivb-input::placeholder {
    color: var(--ivb-ink-faint);
}

.ivb .ivb-input:hover {
    box-shadow: inset 0 0 0 1px var(--ivb-line-strong);
}

.ivb .ivb-input:focus {
    outline: none;
    border-color: var(--ivb-accent);
    box-shadow: 0 0 0 .2rem var(--ivb-ring);
}

.ivb .ivb-input:disabled {
    background: var(--ivb-soft);
    color: var(--ivb-ink-faint);
}

.ivb .ivb-badge-informe {
    display: inline-block;
    background: #e0f2fe;
    color: #075985;
    border: 1px solid #bae6fd;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: var(--font-weight-semibold, 600);
    padding: .05rem .45rem;
}


/* ── Desplegables de filtro (construidos con RenderTreeBuilder) ──────────── */

.ivb .ivb-filtro {
    position: relative;
}

.ivb .ivb-filtro > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .3rem;
    width: 100%;
    border: 1px solid var(--ivb-line);
    background: #fff;
    border-radius: var(--radius-sm, .375rem);
    padding: .18rem .45rem;
    font-size: .72rem;
    color: var(--ivb-ink-faint);
    transition: border-color var(--duration-fast, 150ms) var(--ease-out, ease),
                background var(--duration-fast, 150ms) var(--ease-out, ease);
}

.ivb .ivb-filtro > summary::-webkit-details-marker { display: none; }

.ivb .ivb-filtro > summary:hover {
    border-color: var(--ivb-line-strong);
    color: var(--ivb-ink);
}

.ivb .ivb-filtro > summary::after {
    content: "\25BE";
    font-size: .6rem;
    opacity: .6;
}

.ivb .ivb-filtro[open] > summary {
    border-color: var(--ivb-accent);
    box-shadow: 0 0 0 .15rem var(--ivb-ring);
}

/* Con filtro puesto, el resumen se pinta con el acento: se ve de un vistazo
   qué columnas están recortando la tabla. */
.ivb .ivb-filtro.is-activo > summary {
    background: rgba(var(--brand-primary-rgb, 255, 102, 0), .12);
    border-color: var(--ivb-accent);
    color: var(--ivb-accent-strong);
    font-weight: var(--font-weight-bold, 700);
}

.ivb .ivb-filtro-panel {
    position: absolute;
    top: calc(100% + 3px);
    left: 0;
    z-index: var(--z-dropdown, 1050);
    min-width: 205px;
    max-width: 320px;
    max-height: 280px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--ivb-line-strong);
    border-radius: var(--radius-md, .5rem);
    box-shadow: var(--shadow-dropdown, 0 4px 16px rgba(0, 0, 0, .12));
    padding: .35rem;
}

.ivb .ivb-filtro-buscar {
    width: 100%;
    border: 1px solid var(--ivb-line);
    border-radius: var(--radius-sm, .375rem);
    padding: .2rem .45rem;
    font-size: .74rem;
    margin-bottom: .3rem;
}

.ivb .ivb-filtro-buscar:focus {
    outline: none;
    border-color: var(--ivb-accent);
    box-shadow: 0 0 0 .15rem var(--ivb-ring);
}

.ivb .ivb-filtro-acciones {
    display: flex;
    justify-content: space-between;
    gap: .3rem;
    border-bottom: 1px solid var(--ivb-line);
    padding-bottom: .3rem;
    margin-bottom: .25rem;
}

.ivb .ivb-filtro-accion {
    border: 0;
    background: transparent;
    color: var(--ivb-accent-strong);
    font-size: .7rem;
    font-weight: var(--font-weight-semibold, 600);
    padding: .1rem .25rem;
    border-radius: var(--radius-sm, .375rem);
}

.ivb .ivb-filtro-accion:hover {
    background: var(--ivb-soft);
}

.ivb .ivb-filtro-opcion {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: .75rem;
    padding: .16rem .3rem;
    border-radius: var(--radius-sm, .375rem);
    cursor: pointer;
    white-space: nowrap;
    color: var(--ivb-ink-soft);
}

.ivb .ivb-filtro-opcion:hover {
    background: var(--ivb-soft);
    color: var(--ivb-ink);
}

.ivb .ivb-filtro-opcion input {
    flex-shrink: 0;
    margin: 0;
    cursor: pointer;
}

.ivb .ivb-filtro-opcion input:checked {
    background-color: var(--ivb-accent);
    border-color: var(--ivb-accent);
}

.ivb .ivb-filtro-vacio {
    font-size: .72rem;
    color: var(--ivb-ink-faint);
    padding: .3rem;
}


/* ── Pie: paginación ─────────────────────────────────────────────────────── */

.ivb .ivb-pie {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    padding: .5rem .85rem;
    background: #fff;
    border-top: 1px solid var(--ivb-line);
    border-radius: 0 0 var(--radius-lg, .75rem) var(--radius-lg, .75rem);
}

.ivb .ivb-pie-info {
    font-size: .76rem;
    color: var(--ivb-ink-soft);
    font-variant-numeric: tabular-nums;
}

.ivb .ivb-pie-info strong {
    color: var(--ivb-ink);
}

.ivb .ivb-pag {
    display: flex;
    align-items: center;
    gap: .2rem;
}

.ivb .ivb-pag button {
    min-width: 1.85rem;
    height: 1.85rem;
    border: 1px solid var(--ivb-line);
    background: #fff;
    border-radius: var(--radius-sm, .375rem);
    font-size: .76rem;
    color: var(--ivb-ink-soft);
    font-variant-numeric: tabular-nums;
    transition: background var(--duration-fast, 150ms) var(--ease-out, ease),
                border-color var(--duration-fast, 150ms) var(--ease-out, ease);
}

.ivb .ivb-pag button:hover:not(:disabled) {
    background: var(--ivb-soft);
    border-color: var(--ivb-line-strong);
    color: var(--ivb-ink);
}

.ivb .ivb-pag button:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.ivb .ivb-pag button.is-active {
    background: var(--ivb-accent);
    border-color: var(--ivb-accent);
    color: #fff;
    font-weight: var(--font-weight-bold, 700);
}

.ivb .ivb-pag button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 .2rem var(--ivb-ring);
}


/* ── Pantallas estrechas ─────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .ivb .ivb-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .ivb .ivb-tabla-wrap {
        max-height: 60vh;
    }

    /* En móvil las columnas congeladas estorban más de lo que ayudan. */
    .ivb .ivb-fz {
        position: static;
    }

    .ivb .ivb-fz4::after {
        display: none;
    }
}

/* Mientras se edita la vinculación, la celda deja de recortar: el aviso de
   confirmación tiene que verse entero por encima del resto de la fila. */
.ivb .ivb-tabla td.is-editando {
    overflow: visible;
    white-space: normal;
    z-index: 6;
}

.ivb .ivb-editor-linea {
    display: flex;
    align-items: center;
    gap: .25rem;
}

.ivb .ivb-editor-linea input[type="number"] {
    width: 6.5rem;
}
