.tabla-wrapper-obligaciones {
    overflow: auto;
    max-height: 70vh;
    min-height: 220px;
    border: 1px solid #dce6e9;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(24, 54, 64, 0.08);
}

.tabla-wrapper-obligaciones .tabla-obligaciones {
    width: 100%;
    min-width: 1160px;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    color: #21343b;
    font-size: 13px;
}

.tabla-obligaciones thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 13px 12px;
    border-bottom: 3px solid #02a5e2;
    background: #25667b;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
}

.tabla-obligaciones thead th:first-child {
    left: 0;
    z-index: 4;
    width: 48px;
}

.tabla-obligaciones tbody tr:not(.fila-detalle):not(.tr-pagination) > td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #fff;
}

.detalles .recientes .tabla-obligaciones tbody tr:not(.fila-detalle):not(.tr-pagination):nth-child(4n + 1) > td:first-child {
    background: #f7fafb;
}

.detalles .recientes .tabla-obligaciones tbody tr:not(.fila-detalle):not(.tr-pagination):hover > td:first-child {
    background: #eaf7fa;
}

.detalles .recientes .tabla-obligaciones tbody tr:not(.fila-detalle):not(.tr-pagination) {
    border-bottom: 1px solid #e8eef0;
    background: #fff;
    transition: background-color 140ms ease;
}

.detalles .recientes .tabla-obligaciones tbody tr:not(.fila-detalle):not(.tr-pagination):nth-child(4n + 1) {
    background: #f7fafb;
}

.detalles .recientes .tabla-obligaciones tbody tr:not(.fila-detalle):not(.tr-pagination):hover {
    background: #eaf7fa;
    color: #21343b;
}

.tabla-obligaciones tbody td {
    height: 58px;
    padding: 9px 12px;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.tabla-obligaciones tbody td:nth-child(1),
.tabla-obligaciones tbody td:nth-child(8),
.tabla-obligaciones tbody td:nth-child(9) {
    text-align: center;
}

.tabla-obligaciones tbody td:nth-child(7) input,
.tabla-obligaciones tbody td:nth-child(8) input,
.tabla-obligaciones tbody td:nth-child(9) input,
.tabla-obligaciones tbody td:nth-child(10) input,
.tabla-obligaciones tbody td:nth-child(11) input,
.tabla-obligaciones tbody td:nth-child(12) input,
.tabla-obligaciones tbody td:nth-child(13) input {
    height: 34px;
    padding: 6px 8px;
    border: 1px solid #d5e0e3;
    border-radius: 6px;
    background: #fff;
    color: #21343b;
    font: inherit;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.tabla-obligaciones tbody td:nth-child(6) select {
    width: 200px;
    height: 34px;
    padding: 6px 8px;
    border: 1px solid #d5e0e3;
    border-radius: 6px;
    background: #fff;
    color: #21343b;
    font: inherit;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.tabla-obligaciones tbody td:nth-child(7) input {
    width: 145px;
}

.tabla-obligaciones tbody td:nth-child(13) input {
    width: 200px;
}

.tabla-obligaciones input[data-derived-date]:disabled {
    background: #f0f4f5;
    color: #334a52;
    opacity: 1;
    cursor: not-allowed;
}

.tabla-obligaciones tbody td.acciones-obligacion {
    min-width: 170px;
    white-space: normal;
}

.btn-guardar-obligacion,
.btn-cancelar-obligacion {
    margin: 2px;
    padding: 7px 10px;
    border: 0;
    border-radius: 6px;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.btn-guardar-obligacion {
    background: #087f5b;
    color: #fff;
}

.btn-cancelar-obligacion {
    background: #e8eef0;
    color: #334a52;
}

.btn-guardar-obligacion:disabled,
.btn-cancelar-obligacion:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.estado-guardado-obligacion {
    display: block;
    min-height: 16px;
    margin: 3px 2px 0;
    color: #087f5b;
    font-size: 11px;
    white-space: normal;
}

.estado-guardado-obligacion.tiene-error {
    color: #b42318;
}

.tabla-obligaciones tbody input:focus,
.tabla-obligaciones tbody select:focus {
    border-color: #02a5e2;
    outline: none;
    box-shadow: 0 0 0 3px rgba(2, 165, 226, 0.14);
}

.tabla-obligaciones input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: #0786ad;
    vertical-align: middle;
    cursor: pointer;
}

.tabla-obligaciones .btn-expand {
    display: inline-grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid #d7e5e9;
    border-radius: 7px;
    background: #fff;
    color: #166b80;
    cursor: pointer;
    transition: background-color 140ms ease, transform 140ms ease;
}

.tabla-obligaciones .btn-expand:hover {
    background: #eaf7fa;
}

.tabla-obligaciones .btn-expand ion-icon {
    transition: transform 140ms ease;
}

.tabla-obligaciones .btn-expand[aria-expanded="true"] ion-icon {
    transform: rotate(180deg);
}

.tabla-obligaciones .btn-expand:focus-visible {
    outline: 3px solid rgba(2, 165, 226, 0.25);
    outline-offset: 2px;
}

.tabla-obligaciones .fila-detalle,
.detalles .recientes .tabla-obligaciones tbody tr.fila-detalle:hover {
    background: #eef5f6;
    color: #21343b;
}

.tabla-obligaciones .fila-detalle td {
    height: auto;
    padding: 0;
    white-space: normal;
}

.detalle-obligacion {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    padding: 16px;
}

.detalle-obligacion label,
.detalle-obligacion > div {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border: 1px solid #dfe9eb;
    border-radius: 7px;
    background: #fff;
    color: #334a52;
    font-size: 12px;
}

.detalle-obligacion > div {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.detalle-obligacion input[type="date"] {
    width: 100%;
    min-width: 0;
    height: 32px;
    padding: 5px 7px;
    border: 1px solid #d5e0e3;
    border-radius: 5px;
    background: #fff;
    color: #21343b;
    font: inherit;
}

.tabla-obligaciones .tr-pagination td {
    background: #fff;
}

@media (max-width: 700px) {
    .tabla-wrapper-obligaciones {
        max-height: 65vh;
        border-radius: 9px;
    }

    .tabla-obligaciones thead th,
    .tabla-obligaciones tbody td {
        padding-inline: 9px;
    }

    .detalle-obligacion {
        grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
        padding: 11px;
    }
}

.detalles .recientes .tabla-obligaciones tbody tr:hover .btn-expand ion-icon {
  color: #166b80;
}

.dialogo-confirmacion-obligacion {
    position: fixed;
    inset: 0;
    width: min(440px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    margin: auto;
    padding: 30px;
    border: 1px solid #e2eaed;
    border-radius: 16px;
    background: #fff;
    color: #21343b;
    box-shadow: 0 24px 70px rgba(24, 54, 64, 0.25);
    font-family: inherit;
}

.dialogo-confirmacion-obligacion[open] {
    animation: aparecer-dialogo-obligacion 180ms ease-out;
}

.dialogo-confirmacion-obligacion::backdrop {
    background: rgba(20, 39, 46, 0.48);
    backdrop-filter: blur(3px);
}

.dialogo-confirmacion-obligacion__icono {
    display: grid;
    width: 44px;
    height: 44px;
    margin: 0 auto 14px;
    place-items: center;
    border-radius: 50%;
    background: #fff4e5;
    color: #a45b00;
    font-size: 24px;
    font-weight: 700;
}

.dialogo-confirmacion-obligacion h2 {
    margin: 0;
    color: #21343b;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
}

.dialogo-confirmacion-obligacion p {
    margin: 10px 0 24px;
    color: #52666e;
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
}

.dialogo-confirmacion-obligacion__acciones {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.dialogo-confirmacion-obligacion__acciones button {
    min-height: 40px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 140ms ease, box-shadow 140ms ease;
}

.dialogo-confirmacion-obligacion__acciones button:focus-visible {
    outline: 3px solid rgba(2, 165, 226, 0.35);
    outline-offset: 2px;
}

.dialogo-confirmacion-obligacion__cancelar {
    border-color: #d5e0e3;
    background: #fff;
    color: #334a52;
}

.dialogo-confirmacion-obligacion__cancelar:hover {
    background: #f4f7f8;
}

.dialogo-confirmacion-obligacion__confirmar {
    background: #b42318;
    color: #fff;
}

.dialogo-confirmacion-obligacion__confirmar:hover {
    background: #912018;
    box-shadow: 0 4px 12px rgba(180, 35, 24, 0.2);
}

@keyframes aparecer-dialogo-obligacion {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 480px) {
    .dialogo-confirmacion-obligacion {
        padding: 24px 20px;
    }

    .dialogo-confirmacion-obligacion__acciones {
        flex-direction: column-reverse;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dialogo-confirmacion-obligacion[open] {
        animation: none;
    }
}