/* CIPAVI report polish: sticky header and responsive table scroll */
.cipavi-report-fixed-ready{
    overflow: visible !important;
}
.cipavi-report-fixed-ready .vue-bootstrap4-table,
.cipavi-report-fixed-ready .cipavi-vbt-report{
    width: 100%;
    max-width: 100%;
    overflow: visible !important;
    position: relative;
}
.cipavi-report-fixed-ready .vbt-table-responsive,
.cipavi-report-fixed-ready .vbt-table-wrapper,
.cipavi-report-fixed-ready .table-responsive,
.cipavi-report-fixed-ready .cipavi-report-scroll-zone{
    width: 100%;
    max-width: 100%;
    max-height: calc(100vh - 250px);
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
}
.cipavi-report-fixed-ready .cipavi-report-table,
.cipavi-report-fixed-ready table{
    border-collapse: separate !important;
    border-spacing: 0 !important;
    min-width: max-content;
}
/* El buscador global queda normal para no crear ancho/espacio blanco infinito al mover la tabla horizontalmente. */
.cipavi-report-fixed-ready .vbt-table-tools,
.cipavi-report-fixed-ready .vbt-global-search,
.cipavi-report-fixed-ready .global-search,
.cipavi-report-fixed-ready .vue-bootstrap4-table > .row:first-child{
    position: static !important;
    transform: none !important;
    left: auto !important;
    right: auto !important;
    z-index: 1;
    background: #f6f9fc !important;
}
.cipavi-report-fixed-ready .input-group,
.cipavi-report-fixed-ready input[placeholder=Buscar],
.cipavi-report-fixed-ready input[placeholder=Búsqueda]{
    position: static !important;
    transform: none !important;
    max-width: 260px;
}
.cipavi-report-fixed-ready .vue-bootstrap4-table > .row:first-child,
.cipavi-report-fixed-ready .vbt-table-tools{
    padding: 10px 0 8px;
    box-shadow: 0 1px 0 #dbe5f1;
}
.cipavi-report-fixed-ready table thead{
    position: sticky;
    top: 0;
    z-index: 70;
}
.cipavi-report-fixed-ready table thead tr:first-child th,
.cipavi-report-fixed-ready table thead tr:first-child td{
    position: sticky !important;
    top: 0;
    z-index: 72;
    background: #eef4fb !important;
    color: #0f172a !important;
    box-shadow: inset 0 -1px #cbd5e1;
}
.cipavi-report-fixed-ready table thead tr:nth-child(2) th,
.cipavi-report-fixed-ready table thead tr:nth-child(2) td,
.cipavi-report-fixed-ready table thead tr.filters th,
.cipavi-report-fixed-ready table thead tr.filters td{
    position: sticky !important;
    top: 42px;
    z-index: 71;
    background: #e5e7eb !important;
    box-shadow: inset 0 -1px #cbd5e1;
}
.cipavi-report-fixed-ready table thead input,
.cipavi-report-fixed-ready table thead select{
    min-width: 78px;
    max-width: 180px;
}
.cipavi-report-fixed-ready th,
.cipavi-report-fixed-ready td{
    vertical-align: middle !important;
    word-break: normal;
    font-size: 12px;
}
.cipavi-report-fixed-ready th:nth-child(n),
.cipavi-report-fixed-ready td:nth-child(n){
    min-width: 88px;
}

/* Observación: ancho medio real, texto hacia abajo y nunca en una línea gigante. */
.cipavi-report-fixed-ready th.cipavi-observation-column,
.cipavi-report-fixed-ready td.cipavi-observation-column{
    width: 380px !important;
    min-width: 340px !important;
    max-width: 420px !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    line-height: 1.35 !important;
    text-align: left !important;
}
.cipavi-report-fixed-ready td.cipavi-observation-column > .cipavi-observation-text,
.cipavi-report-fixed-ready th.cipavi-observation-column > .cipavi-observation-text{
    display: block !important;
    width: 380px !important;
    min-width: 0 !important;
    max-width: 380px !important;
    margin: 0 auto !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    line-height: 1.4 !important;
    text-align: left !important;
}
/* Si el reporte trae solamente observación, dejamos la fila de fondo completa, pero el texto vive dentro de una caja moderada. */
.cipavi-report-fixed-ready table.cipavi-observation-only-report{
    width: 100% !important;
    min-width: 640px !important;
    table-layout: fixed !important;
}
.cipavi-report-fixed-ready table.cipavi-observation-only-report th,
.cipavi-report-fixed-ready table.cipavi-observation-only-report td{
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    text-align: center !important;
    padding: 16px 20px !important;
}
.cipavi-report-fixed-ready table.cipavi-observation-only-report th.cipavi-observation-column,
.cipavi-report-fixed-ready table.cipavi-observation-only-report td.cipavi-observation-column{
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    text-align: center !important;
}
.cipavi-report-fixed-ready table.cipavi-observation-only-report .cipavi-observation-text{
    display: block !important;
    width: 520px !important;
    max-width: 520px !important;
    min-width: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    line-height: 1.45 !important;
    text-align: left !important;
}

@media (max-width: 768px){
    body{ overflow-x: hidden; }
    .container, .container-fluid{ padding-left: 10px !important; padding-right: 10px !important; }
    .card{ border-radius: 14px !important; }
    .card-body{ padding: 12px !important; }
    .cipavi-report-fixed-ready .vbt-table-responsive,
    .cipavi-report-fixed-ready .vbt-table-wrapper,
    .cipavi-report-fixed-ready .table-responsive,
    .cipavi-report-fixed-ready .cipavi-report-scroll-zone{
        max-height: calc(100vh - 210px);
        border-radius: 12px;
        border: 1px solid #dbe5f1;
    }
    .cipavi-report-fixed-ready table{ min-width: 980px; }
    .cipavi-report-fixed-ready table thead th{ font-size: 11px !important; }
    .cipavi-report-fixed-ready table td{ font-size: 11px !important; }
    .cipavi-report-fixed-ready .btn{ white-space: normal; }
    .cipavi-report-fixed-ready th.cipavi-observation-column,
    .cipavi-report-fixed-ready td.cipavi-observation-column{
        width: 280px !important;
        min-width: 250px !important;
        max-width: 300px !important;
    }
    .cipavi-report-fixed-ready td.cipavi-observation-column > .cipavi-observation-text,
    .cipavi-report-fixed-ready th.cipavi-observation-column > .cipavi-observation-text{
        width: 260px !important;
        max-width: 260px !important;
    }
    .cipavi-report-fixed-ready table.cipavi-observation-only-report{
        min-width: 360px !important;
    }
    .cipavi-report-fixed-ready table.cipavi-observation-only-report .cipavi-observation-text{
        width: 300px !important;
        max-width: 300px !important;
    }
}

/* CIPAVI 2026-07-21: observaciones legibles en varios renglones */
.vue-bootstrap4-table .table td.cipavi-observation-cell,
.vue-bootstrap4-table .table th.cipavi-observation-cell,
.cipavi-observation-cell {
    width: 320px !important;
    min-width: 260px !important;
    max-width: 380px !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    line-height: 1.35 !important;
    vertical-align: top !important;
}

/* ==========================================================
   CIPAVI 2026-07-27 - ANCHO EQUILIBRADO REAL DE REPORTES
   La tabla recibe desde cipavi-report-responsive.js un ancho exacto
   (suma de sus columnas). Así el navegador no reparte el espacio
   sobrante y no vuelve a crear columnas exageradamente anchas.
   ========================================================== */
#main-wrapper .cipavi-report-fixed-ready .vue-bootstrap4-table table.table.cipavi-report-table,
#main-wrapper .cipavi-report-fixed-ready .vbt-table-wrapper > table.cipavi-report-table,
#main-wrapper .cipavi-report-fixed-ready .vbt-table-responsive > table.cipavi-report-table {
    width: auto;
    min-width: 0 !important;
    max-width: none !important;
    table-layout: fixed !important;
    margin-right: auto !important;
}

#main-wrapper .cipavi-report-fixed-ready table.cipavi-report-table[data-cipavi-balanced-width] {
    min-width: 0;
    table-layout: fixed !important;
}

#main-wrapper .cipavi-report-fixed-ready table.cipavi-report-table th,
#main-wrapper .cipavi-report-fixed-ready table.cipavi-report-table td {
    min-width: 0 !important;
    padding: .55rem .44rem !important;
    line-height: 1.28 !important;
    box-sizing: border-box !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    vertical-align: middle !important;
}

/* El icono de ordenar queda junto al título; ya no parece una columna vacía. */
#main-wrapper .cipavi-report-fixed-ready table.cipavi-report-table th.vbt-column-header > .float-right {
    float: none !important;
    display: inline-block !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    margin-left: .28rem !important;
    vertical-align: middle !important;
    line-height: 1 !important;
}

#main-wrapper .cipavi-report-fixed-ready table.cipavi-report-table th.vbt-column-header {
    white-space: normal !important;
    overflow-wrap: normal !important;
    text-align: center !important;
    line-height: 1.2 !important;
}

/* Filtros compactos y completamente contenidos en su columna. */
#main-wrapper .cipavi-report-fixed-ready table.cipavi-report-table thead .form-group,
#main-wrapper .cipavi-report-fixed-ready table.cipavi-report-table thead .has-clear-right,
#main-wrapper .cipavi-report-fixed-ready table.cipavi-report-table thead .input-group {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

#main-wrapper .cipavi-report-fixed-ready table.cipavi-report-table thead input,
#main-wrapper .cipavi-report-fixed-ready table.cipavi-report-table thead select,
#main-wrapper .cipavi-report-fixed-ready table.cipavi-report-table thead .form-control {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 34px !important;
    padding-left: .48rem !important;
    padding-right: 1.72rem !important;
    box-sizing: border-box !important;
}

#main-wrapper .cipavi-report-fixed-ready table.cipavi-report-table thead .form-control-feedback,
#main-wrapper .cipavi-report-fixed-ready table.cipavi-report-table thead .vbt-simple-filter-clear {
    width: 1.68rem !important;
    height: 34px !important;
    line-height: 34px !important;
}

/* La segunda fila fija toma la altura real de la cabecera, incluso cuando un título usa dos renglones. */
.cipavi-report-fixed-ready table thead tr:nth-child(2) th,
.cipavi-report-fixed-ready table thead tr:nth-child(2) td,
.cipavi-report-fixed-ready table thead tr.filters th,
.cipavi-report-fixed-ready table thead tr.filters td {
    top: var(--cipavi-report-header-height, 42px) !important;
}

/* Columnas cortas: una línea. Columnas textuales: salto natural y legible. */
#main-wrapper .cipavi-report-fixed-ready table.cipavi-report-table .cipavi-col-index,
#main-wrapper .cipavi-report-fixed-ready table.cipavi-report-table .cipavi-col-code,
#main-wrapper .cipavi-report-fixed-ready table.cipavi-report-table .cipavi-col-date,
#main-wrapper .cipavi-report-fixed-ready table.cipavi-report-table .cipavi-col-id {
    white-space: nowrap !important;
    overflow-wrap: normal !important;
}

#main-wrapper .cipavi-report-fixed-ready table.cipavi-report-table .cipavi-col-contract,
#main-wrapper .cipavi-report-fixed-ready table.cipavi-report-table .cipavi-col-location,
#main-wrapper .cipavi-report-fixed-ready table.cipavi-report-table .cipavi-col-state,
#main-wrapper .cipavi-report-fixed-ready table.cipavi-report-table .cipavi-col-type,
#main-wrapper .cipavi-report-fixed-ready table.cipavi-report-table .cipavi-col-category,
#main-wrapper .cipavi-report-fixed-ready table.cipavi-report-table .cipavi-col-file,
#main-wrapper .cipavi-report-fixed-ready table.cipavi-report-table .cipavi-col-name,
#main-wrapper .cipavi-report-fixed-ready table.cipavi-report-table .cipavi-col-email,
#main-wrapper .cipavi-report-fixed-ready table.cipavi-report-table .cipavi-col-article,
#main-wrapper .cipavi-report-fixed-ready table.cipavi-report-table .cipavi-col-value,
#main-wrapper .cipavi-report-fixed-ready table.cipavi-report-table .cipavi-col-actions,
#main-wrapper .cipavi-report-fixed-ready table.cipavi-report-table .cipavi-col-text {
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
}

/* Neutraliza anchos internos antiguos que agrandaban contrato, locación y observación. */
#main-wrapper .cipavi-report-fixed-ready table.cipavi-report-table .th-contract,
#main-wrapper .cipavi-report-fixed-ready table.cipavi-report-table .th-location,
#main-wrapper .cipavi-report-fixed-ready table.cipavi-report-table .th-observation,
#main-wrapper .cipavi-report-fixed-ready table.cipavi-report-table .th-total {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
}

/* El reporte de una sola observación conserva el ancho completo. */
#main-wrapper .cipavi-report-fixed-ready table.cipavi-report-table.cipavi-observation-only-report {
    width: 100% !important;
    min-width: 360px !important;
    max-width: 100% !important;
    table-layout: fixed !important;
}

/* Informe de combustible por OC; también aplica al panel.js ya compilado. */
#main-wrapper .fuel-executive-strip { grid-template-columns: repeat(5, minmax(0,1fr)) !important; }
#main-wrapper .fuel-dashboard-table-wrap { max-height: 430px; overflow: auto; border: 1px solid #edf1f6; border-radius: 10px; }
#main-wrapper .fuel-dashboard-table-wrap thead th { position: sticky; top: 0; z-index: 2; background: #f4f8fd !important; }
#main-wrapper .fuel-order-table { width: max-content !important; min-width: 100% !important; table-layout: auto !important; }
#main-wrapper .fuel-order-table th { font-size: .7rem; text-transform: uppercase; color: #4b5e78; border-top: 0; white-space: nowrap; }
#main-wrapper .fuel-order-table td { vertical-align: middle; font-size: .82rem; white-space: nowrap; }
#main-wrapper .fuel-percentage-pill { display:inline-block; min-width:58px; padding:.22rem .45rem; border-radius:999px; background:#e8f2ff; color:#0b63ce; font-weight:800; }
#main-wrapper .fuel-order-selector { width: 320px; max-width: 100%; }
@media (max-width:1199px) { #main-wrapper .fuel-executive-strip { grid-template-columns:repeat(3,minmax(0,1fr)) !important; } }
@media (max-width:767px) { #main-wrapper .fuel-executive-strip { grid-template-columns:repeat(2,minmax(0,1fr)) !important; } #main-wrapper .fuel-order-selector { width:100%; } }

/* ==========================================================
   CIPAVI - Ingresos/Salidas: contenedor estable y OC primero
   Fix 2026-07-24
   ========================================================== */
.income-output-shell {
    width: 100%;
    max-width: 1500px;
    padding-left: 18px;
    padding-right: 18px;
}
.income-output-card {
    width: 100%;
    min-width: 0;
    border: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
}
.income-output-card .card-body,
.income-output-card .form-control,
.income-output-card .custom-select,
.income-output-card .input-group,
.income-output-card .table-responsive {
    min-width: 0;
}
.income-output-card .table-responsive { width: 100%; }
.income-output-card .oc-first-card { background: #f8fbff; }
@media (max-width: 991px) {
    .income-output-card form > .row { display: block; }
    .income-output-card form > .row > .col {
        width: 100%;
        max-width: 100%;
    }
}
@media (max-width: 768px) {
    .income-output-shell { padding-left: 8px; padding-right: 8px; }
    .income-output-card .card-body { padding: 12px; }
}

/* ==========================================================
   CIPAVI 2026-07-27.3 - compactación definitiva de reportes
   Se aplica después de cipavi-pro-ui.css y también funciona
   cuando el reporte no está envuelto exactamente por #main-wrapper.
   ========================================================== */
.cipavi-report-scroll-zone,
.vue-bootstrap4-table .vbt-table-responsive,
.vue-bootstrap4-table .vbt-table-wrapper,
.vue-bootstrap4-table .table-responsive {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
}

.vue-bootstrap4-table table.cipavi-balanced-table,
table.cipavi-report-table.cipavi-balanced-table {
    display: table !important;
    table-layout: fixed !important;
    min-width: 0;
    max-width: none;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.vue-bootstrap4-table table.cipavi-balanced-table th,
.vue-bootstrap4-table table.cipavi-balanced-table td,
table.cipavi-report-table.cipavi-balanced-table th,
table.cipavi-report-table.cipavi-balanced-table td {
    padding: .52rem .38rem !important;
    box-sizing: border-box !important;
    vertical-align: middle !important;
    line-height: 1.28 !important;
    text-align: center;
}

.vue-bootstrap4-table table.cipavi-balanced-table th.vbt-column-header > .float-right,
table.cipavi-report-table.cipavi-balanced-table th.vbt-column-header > .float-right {
    float: none !important;
    display: inline-block !important;
    width: auto !important;
    min-width: 0 !important;
    margin-left: .24rem !important;
    vertical-align: middle !important;
}

.vue-bootstrap4-table table.cipavi-balanced-table thead .form-group,
.vue-bootstrap4-table table.cipavi-balanced-table thead .input-group,
.vue-bootstrap4-table table.cipavi-balanced-table thead .has-clear-right,
.vue-bootstrap4-table table.cipavi-balanced-table thead input,
.vue-bootstrap4-table table.cipavi-balanced-table thead select,
.vue-bootstrap4-table table.cipavi-balanced-table thead .form-control {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

.vue-bootstrap4-table table.cipavi-balanced-table .cipavi-col-observation,
table.cipavi-report-table.cipavi-balanced-table .cipavi-col-observation {
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: anywhere !important;
    text-align: left !important;
}

.vue-bootstrap4-table table.cipavi-balanced-table .cipavi-col-contract,
.vue-bootstrap4-table table.cipavi-balanced-table .cipavi-col-location,
.vue-bootstrap4-table table.cipavi-balanced-table .cipavi-col-address,
.vue-bootstrap4-table table.cipavi-balanced-table .cipavi-col-name,
.vue-bootstrap4-table table.cipavi-balanced-table .cipavi-col-type,
.vue-bootstrap4-table table.cipavi-balanced-table .cipavi-col-category,
.vue-bootstrap4-table table.cipavi-balanced-table .cipavi-col-text,
.vue-bootstrap4-table table.cipavi-balanced-table .cipavi-col-file,
.vue-bootstrap4-table table.cipavi-balanced-table .cipavi-col-phone {
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
}

/* Ventana compacta con todas las OT de una OC. */
.cipavi-work-orders-overlay {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, .58);
}
.cipavi-work-orders-dialog {
    width: min(850px, 96vw);
    max-height: 88vh;
    overflow: hidden;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
}
.cipavi-work-orders-header,
.cipavi-work-orders-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid #e5e7eb;
}
.cipavi-work-orders-footer {
    justify-content: flex-end;
    border-top: 1px solid #e5e7eb;
    border-bottom: 0;
}
.cipavi-work-orders-body {
    max-height: calc(88vh - 130px);
    overflow-y: auto;
    padding: 14px 18px;
}
.cipavi-work-order-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 14px;
    margin-bottom: 10px;
    border: 1px solid #dbe5f1;
    border-radius: 10px;
    background: #f8fbff;
}
.cipavi-work-order-card:last-child { margin-bottom: 0; }
.cipavi-work-order-card-main { min-width: 0; flex: 1; }
.cipavi-work-order-card-main p { margin: 4px 0 0; white-space: normal; overflow-wrap: anywhere; }
.cipavi-work-order-card-actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
.cipavi-work-order-pdf-button { white-space: nowrap !important; }

@media (max-width: 640px) {
    .cipavi-work-order-card { flex-direction: column; }
    .cipavi-work-order-card-actions { width: 100%; justify-content: flex-start; }
}

/* ==========================================================
   CIPAVI 2026-07-27 - OPTIMIZACIÓN FINAL DE REPORTES
   - El buscador global conserva un ancho compacto.
   - El ajuste de columnas se realiza solo cuando la tabla cambia.
   - No se altera el buscador/filtro interno de cada columna.
   ========================================================== */
#main-wrapper .cipavi-vbt-report > .row.cipavi-report-tools-row:first-child {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 8px 0 !important;
    align-items: center !important;
}

#main-wrapper .cipavi-vbt-report > .row.cipavi-report-tools-row:first-child > .cipavi-report-search-holder {
    flex: 0 0 280px !important;
    width: 280px !important;
    max-width: 280px !important;
    padding-left: 0 !important;
    padding-right: 8px !important;
}

#main-wrapper .cipavi-vbt-report .cipavi-report-global-search,
#main-wrapper .cipavi-vbt-report .cipavi-report-global-search .input-group,
#main-wrapper .cipavi-vbt-report .cipavi-report-tools-row:first-child input[type="text"],
#main-wrapper .cipavi-vbt-report .cipavi-report-tools-row:first-child input.form-control {
    width: 270px !important;
    min-width: 0 !important;
    max-width: 270px !important;
    height: 34px !important;
    box-sizing: border-box !important;
}

#main-wrapper .cipavi-vbt-report .cipavi-report-tools-row:first-child input.form-control {
    padding-top: .35rem !important;
    padding-bottom: .35rem !important;
}

/* Neutraliza el mínimo general antiguo: cada columna usa su medida calculada. */
#main-wrapper .cipavi-report-fixed-ready table.cipavi-report-table th:nth-child(n),
#main-wrapper .cipavi-report-fixed-ready table.cipavi-report-table td:nth-child(n) {
    min-width: 0;
}

@media (max-width: 576px) {
    #main-wrapper .cipavi-vbt-report > .row.cipavi-report-tools-row:first-child > .cipavi-report-search-holder,
    #main-wrapper .cipavi-vbt-report .cipavi-report-global-search,
    #main-wrapper .cipavi-vbt-report .cipavi-report-global-search .input-group,
    #main-wrapper .cipavi-vbt-report .cipavi-report-tools-row:first-child input[type="text"],
    #main-wrapper .cipavi-vbt-report .cipavi-report-tools-row:first-child input.form-control {
        flex-basis: 100% !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* ==========================================================
   CIPAVI 2026-07-27.5 - ajustes puntuales sin afectar lógica
   - Buscador global compacto en todos los reportes.
   - Controles de Estado/Artículos visibles en requestApproval.
   - Generación de OC usa todo el ancho y conserva tablas de edición.
   ========================================================== */

/* El buscador global no debe ocupar toda la fila. Se limita por estructura,
   incluso antes de que JavaScript añada las clases auxiliares. */
#main-wrapper .vue-bootstrap4-table > .row:first-child,
#main-wrapper .vue-bootstrap4-table .vbt-table-tools,
#main-wrapper .vue-bootstrap4-table .row.cipavi-report-tools-row {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    justify-content: flex-start !important;
}

#main-wrapper .vue-bootstrap4-table > .row:first-child > [class*="col-"],
#main-wrapper .vue-bootstrap4-table .vbt-table-tools > [class*="col-"],
#main-wrapper .vue-bootstrap4-table .cipavi-report-search-holder {
    flex: 0 0 300px !important;
    width: 300px !important;
    max-width: 300px !important;
    padding-left: 0 !important;
    padding-right: 8px !important;
}

#main-wrapper .vue-bootstrap4-table > .row:first-child input[type="text"],
#main-wrapper .vue-bootstrap4-table .vbt-table-tools input[type="text"],
#main-wrapper .vue-bootstrap4-table .cipavi-report-global-search,
#main-wrapper .vue-bootstrap4-table .cipavi-report-global-search .input-group,
#main-wrapper .vue-bootstrap4-table input.cipavi-report-global-search-input {
    width: 285px !important;
    min-width: 0 !important;
    max-width: 285px !important;
    height: 36px !important;
    box-sizing: border-box !important;
}

/* requestApproval: el fondo blanco general no debe ocultar el texto blanco
   del botón secundario Artículos ni el texto del selector Estado. */
#main-wrapper .cipavi-request-approval-table tbody tr td button.btn.btn-secondary,
#main-wrapper .cipavi-request-approval-table tbody tr td a.btn.btn-secondary {
    background-color: #475569 !important;
    border-color: #475569 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
}

#main-wrapper .cipavi-request-approval-table tbody tr td button.btn.btn-secondary:hover,
#main-wrapper .cipavi-request-approval-table tbody tr td a.btn.btn-secondary:hover {
    background-color: #334155 !important;
    border-color: #334155 !important;
    color: #ffffff !important;
}

#main-wrapper .cipavi-request-approval-table thead .cipavi-col-state button,
#main-wrapper .cipavi-request-approval-table thead .cipavi-col-state .btn,
#main-wrapper .cipavi-request-approval-table thead .cipavi-col-state .dropdown-toggle,
#main-wrapper .cipavi-request-approval-table thead .cipavi-col-state .multiselect__tags,
#main-wrapper .cipavi-request-approval-table thead .cipavi-col-state .multiselect__placeholder {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #334155 !important;
    opacity: 1 !important;
}

/* El botón Artículos debe mostrar su texto completo sin que la compactación
   lo convierta en un rectángulo vacío. */
#main-wrapper .cipavi-request-approval-table tbody .cipavi-col-article .btn,
#main-wrapper .cipavi-request-approval-table tbody tr td:last-child .btn {
    width: auto !important;
    min-width: 88px !important;
    max-width: 100% !important;
    padding-left: .7rem !important;
    padding-right: .7rem !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

/* Generación de órdenes: es un formulario, no un reporte para compactar.
   Usa el ancho disponible y sus tablas permanecen editables y legibles. */
#main-wrapper .cipavi-generate-order-shell {
    width: 100% !important;
    max-width: none !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

#main-wrapper .cipavi-generate-order-shell > .row,
#main-wrapper .cipavi-generate-order-card,
#main-wrapper .cipavi-generate-order-card > .card-body,
#main-wrapper .cipavi-generate-order-card form {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
}

#main-wrapper .cipavi-generate-order-card {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

#main-wrapper .cipavi-generate-order-articles-wrap,
#main-wrapper .cipavi-generate-order-articles,
#main-wrapper .cipavi-generate-order-articles > div,
#main-wrapper .cipavi-generate-order-articles > .row,
#main-wrapper .cipavi-generate-order-articles .vbt-table-responsive,
#main-wrapper .cipavi-generate-order-articles .vbt-table-wrapper,
#main-wrapper .cipavi-generate-order-articles .table-responsive {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: 0 0 100% !important;
    align-self: stretch !important;
    box-sizing: border-box !important;
}

#main-wrapper .cipavi-generate-order-articles .vbt-table-responsive,
#main-wrapper .cipavi-generate-order-articles .vbt-table-wrapper,
#main-wrapper .cipavi-generate-order-articles .table-responsive {
    overflow-x: auto !important;
    overflow-y: visible !important;
}

#main-wrapper .cipavi-generate-order-articles > .row,
#main-wrapper .cipavi-generate-order-articles .vbt-table-tools,
#main-wrapper .cipavi-generate-order-articles .vbt-table-tools > .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

#main-wrapper .cipavi-generate-order-articles table,
#main-wrapper .cipavi-generate-order-articles table.table,
#main-wrapper .cipavi-generate-order-articles table.cipavi-report-table,
#main-wrapper .cipavi-generate-order-articles table.cipavi-balanced-table {
    width: 100% !important;
    min-width: 1180px !important;
    max-width: none !important;
    table-layout: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

#main-wrapper .cipavi-generate-order-articles table th,
#main-wrapper .cipavi-generate-order-articles table td {
    min-width: 0 !important;
    max-width: none !important;
    padding: .65rem .55rem !important;
    font-size: 13px !important;
    line-height: 1.3 !important;
}

#main-wrapper .cipavi-generate-order-articles table thead input,
#main-wrapper .cipavi-generate-order-articles table tbody input,
#main-wrapper .cipavi-generate-order-articles table .form-control {
    width: 100% !important;
    max-width: none !important;
    min-width: 70px !important;
}

/* Totales con tamaño acorde al resto del formulario. */
#main-wrapper .cipavi-generate-order-totals {
    width: 100% !important;
    align-items: flex-start !important;
}

#main-wrapper .cipavi-generate-order-totals > [class*="col-"] {
    font-size: 14px !important;
}

#main-wrapper .cipavi-generate-order-totals-table,
#main-wrapper .cipavi-generate-order-totals table {
    width: 100% !important;
    font-size: 14px !important;
}

#main-wrapper .cipavi-generate-order-totals-table td,
#main-wrapper .cipavi-generate-order-totals table td {
    padding: .6rem .75rem !important;
    font-size: 14px !important;
    vertical-align: middle !important;
}

#main-wrapper .cipavi-generate-order-totals-table td:first-child,
#main-wrapper .cipavi-generate-order-totals table td:first-child {
    width: 42% !important;
    color: #243047 !important;
    font-weight: 700 !important;
    white-space: normal !important;
}

#main-wrapper .cipavi-generate-order-totals-table .form-control,
#main-wrapper .cipavi-generate-order-totals table .form-control {
    min-height: 40px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}

@media (max-width: 576px) {
    #main-wrapper .vue-bootstrap4-table > .row:first-child > [class*="col-"],
    #main-wrapper .vue-bootstrap4-table .vbt-table-tools > [class*="col-"],
    #main-wrapper .vue-bootstrap4-table .cipavi-report-search-holder,
    #main-wrapper .vue-bootstrap4-table > .row:first-child input[type="text"],
    #main-wrapper .vue-bootstrap4-table .vbt-table-tools input[type="text"],
    #main-wrapper .vue-bootstrap4-table .cipavi-report-global-search,
    #main-wrapper .vue-bootstrap4-table .cipavi-report-global-search .input-group,
    #main-wrapper .vue-bootstrap4-table input.cipavi-report-global-search-input {
        flex-basis: 100% !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    #main-wrapper .cipavi-generate-order-shell {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
}


/* ===== Ajustes puntuales 2026-07-28 ===== */
#main-wrapper .cipavi-hidden-column {
    display: none !important;
}

/* requestRegister: la tabla editable de artículos debe ocupar todo el ancho disponible. */
#main-wrapper .cipavi-request-create-shell,
#main-wrapper .cipavi-request-create-card,
#main-wrapper .cipavi-request-create-card > .card-body,
#main-wrapper .cipavi-request-create-articles,
#main-wrapper .cipavi-request-create-articles > div,
#main-wrapper .cipavi-request-create-articles > .row,
#main-wrapper .cipavi-request-create-articles .vbt-table-responsive,
#main-wrapper .cipavi-request-create-articles .vbt-table-wrapper,
#main-wrapper .cipavi-request-create-articles .table-responsive {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}
#main-wrapper .cipavi-request-create-articles .vbt-table-responsive,
#main-wrapper .cipavi-request-create-articles .vbt-table-wrapper,
#main-wrapper .cipavi-request-create-articles .table-responsive {
    overflow-x: auto !important;
    overflow-y: visible !important;
}
#main-wrapper .cipavi-request-create-articles table {
    width: 100% !important;
    min-width: 1080px !important;
    max-width: none !important;
    table-layout: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}
#main-wrapper .cipavi-request-create-articles table thead th,
#main-wrapper .cipavi-request-create-articles table tbody td {
    vertical-align: middle !important;
    white-space: normal !important;
}

/* reportFuelConsumption: sin encabezado pegajoso y con un solo anexo visible. */
#main-wrapper .cipavi-fuel-report-card,
#main-wrapper .cipavi-fuel-report-card > .card-body,
#main-wrapper .cipavi-fuel-report-table,
#main-wrapper .cipavi-fuel-report-table > div,
#main-wrapper .cipavi-fuel-report-table .vbt-table-responsive,
#main-wrapper .cipavi-fuel-report-table .vbt-table-wrapper,
#main-wrapper .cipavi-fuel-report-table .table-responsive {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}
#main-wrapper .cipavi-fuel-report-table .vbt-table-responsive,
#main-wrapper .cipavi-fuel-report-table .vbt-table-wrapper,
#main-wrapper .cipavi-fuel-report-table .table-responsive {
    overflow-x: auto !important;
    overflow-y: visible !important;
}
#main-wrapper .cipavi-fuel-report-table table {
    width: 100% !important;
    min-width: 1600px !important;
    max-width: none !important;
    table-layout: auto !important;
}
#main-wrapper .cipavi-fuel-report-table table thead,
#main-wrapper .cipavi-fuel-report-table table thead tr:first-child th,
#main-wrapper .cipavi-fuel-report-table table thead tr:first-child td,
#main-wrapper .cipavi-fuel-report-table table thead tr:nth-child(2) th,
#main-wrapper .cipavi-fuel-report-table table thead tr:nth-child(2) td {
    position: static !important;
    top: auto !important;
}
#main-wrapper .cipavi-fuel-report-table .fuel-action-buttons {
    gap: 6px;
}

/* preventiveMaintenance: aprovechar mejor el ancho del panel principal. */
#main-wrapper .cipavi-preventive-shell,
#main-wrapper .cipavi-preventive-shell > .card-body,
#main-wrapper .cipavi-preventive-main-table,
#main-wrapper .cipavi-preventive-main-table > div,
#main-wrapper .cipavi-preventive-main-table .vbt-table-responsive,
#main-wrapper .cipavi-preventive-main-table .vbt-table-wrapper,
#main-wrapper .cipavi-preventive-main-table .table-responsive {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}
#main-wrapper .cipavi-preventive-main-table .vbt-table-responsive,
#main-wrapper .cipavi-preventive-main-table .vbt-table-wrapper,
#main-wrapper .cipavi-preventive-main-table .table-responsive {
    overflow-x: auto !important;
    overflow-y: visible !important;
}
#main-wrapper .cipavi-preventive-main-table table {
    width: 100% !important;
    min-width: 1150px !important;
    max-width: none !important;
    table-layout: auto !important;
}

/* reportOrder: contrato con tipografía alineada al resto. */
#main-wrapper .cipavi-order-report-table .th-contract,
#main-wrapper .cipavi-order-report-table .th-contract p,
#main-wrapper .th-contract,
#main-wrapper .th-contract p {
    font-size: 12px !important;
    line-height: 1.35 !important;
    font-weight: 500 !important;
    margin: 0 !important;
}

/* orderApproval: selector/botón de estado visible y legible. */
#main-wrapper .cipavi-order-approval-table thead .cipavi-col-state .multiselect,
#main-wrapper .cipavi-order-approval-table thead .cipavi-col-state .multiselect__tags,
#main-wrapper .cipavi-order-approval-table thead .cipavi-col-state .multiselect__content-wrapper,
#main-wrapper .cipavi-order-approval-table thead .cipavi-col-state .form-control,
#main-wrapper .cipavi-order-approval-table thead .cipavi-col-state button,
#main-wrapper .cipavi-order-approval-table thead .cipavi-col-state .btn,
#main-wrapper .cipavi-order-approval-table thead .cipavi-col-state .dropdown-toggle {
    background: #ffffff !important;
    color: #334155 !important;
    border-color: #cbd5e1 !important;
    opacity: 1 !important;
}
#main-wrapper .cipavi-order-approval-table thead .cipavi-col-state .multiselect__placeholder,
#main-wrapper .cipavi-order-approval-table thead .cipavi-col-state .multiselect__single,
#main-wrapper .cipavi-order-approval-table thead .cipavi-col-state .multiselect__input {
    color: #334155 !important;
    background: transparent !important;
}
#main-wrapper .cipavi-order-approval-table thead .cipavi-col-state .multiselect__select:before {
    border-color: #64748b transparent transparent !important;
}

/* FixedAssetAllocations: agrupar acciones en un solo botón desplegable. */
#main-wrapper .fixed-actions {
    position: relative;
    gap: 0 !important;
}
#main-wrapper .fixed-actions .cipavi-actions-original {
    display: none !important;
}
#main-wrapper .fixed-actions .cipavi-actions-menu {
    position: relative;
    width: 100%;
}
#main-wrapper .fixed-actions .cipavi-actions-menu > summary {
    list-style: none;
    width: 100%;
    cursor: pointer;
    user-select: none;
}
#main-wrapper .fixed-actions .cipavi-actions-menu > summary::-webkit-details-marker {
    display: none;
}
#main-wrapper .fixed-actions .cipavi-actions-popover {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 20;
    min-width: 220px;
    padding: 8px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid #dbe3ec;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
    display: grid;
    gap: 6px;
}
#main-wrapper .fixed-actions .cipavi-actions-item {
    width: 100%;
    text-align: left;
    border: 1px solid #dbe3ec;
    background: #f8fafc;
    color: #1f2937;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 600;
}
#main-wrapper .fixed-actions .cipavi-actions-item.is-warning { border-color: #f59e0b; color: #92400e; background: #fffbeb; }
#main-wrapper .fixed-actions .cipavi-actions-item.is-danger { border-color: #ef4444; color: #991b1b; background: #fef2f2; }
#main-wrapper .fixed-actions .cipavi-actions-item.is-success { border-color: #22c55e; color: #166534; background: #f0fdf4; }
#main-wrapper .fixed-actions .cipavi-actions-item.is-dark { border-color: #334155; color: #0f172a; background: #f8fafc; }
#main-wrapper .fixed-actions .cipavi-actions-item.is-info { border-color: #0ea5e9; color: #075985; background: #f0f9ff; }
#main-wrapper .fixed-actions .cipavi-actions-item:disabled {
    opacity: .55;
    cursor: not-allowed;
}

/* ===== Corrección final 2026-07-28.2: carga estable, alerta y acciones ===== */

/* requestRegister: no modificar el contenedor/card durante el montaje de Vue.
   Solo se expande la tabla de artículos una vez renderizada. */
html.cipavi-route-request-register #main-wrapper .cipavi-request-create-articles,
html.cipavi-route-request-register #main-wrapper .cipavi-request-create-articles > div,
html.cipavi-route-request-register #main-wrapper .cipavi-request-create-articles > .row,
html.cipavi-route-request-register #main-wrapper .cipavi-request-create-articles .vbt-table-responsive,
html.cipavi-route-request-register #main-wrapper .cipavi-request-create-articles .vbt-table-wrapper,
html.cipavi-route-request-register #main-wrapper .cipavi-request-create-articles .table-responsive {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

/* reportFuelConsumption: se aplica desde el HEAD para impedir el salto visual
   y el contenido detrás del encabezado antes de que termine de montar Vue. */
html.cipavi-route-report-fuel-consumption #main-wrapper .vue-bootstrap4-table table thead,
html.cipavi-route-report-fuel-consumption #main-wrapper .vue-bootstrap4-table table thead tr,
html.cipavi-route-report-fuel-consumption #main-wrapper .vue-bootstrap4-table table thead th,
html.cipavi-route-report-fuel-consumption #main-wrapper .vue-bootstrap4-table table thead td {
    position: static !important;
    top: auto !important;
    z-index: auto !important;
}

/* En la versión pública actualmente compilada, los anexos antiguos son las
   columnas 21, 22 y 23. Se conserva únicamente la columna 24 (Anexo actual). */
html.cipavi-route-report-fuel-consumption #main-wrapper .vue-bootstrap4-table table tr > :nth-child(21),
html.cipavi-route-report-fuel-consumption #main-wrapper .vue-bootstrap4-table table tr > :nth-child(22),
html.cipavi-route-report-fuel-consumption #main-wrapper .vue-bootstrap4-table table tr > :nth-child(23),
html.cipavi-route-report-fuel-consumption #main-wrapper .vue-bootstrap4-table table colgroup col:nth-child(21),
html.cipavi-route-report-fuel-consumption #main-wrapper .vue-bootstrap4-table table colgroup col:nth-child(22),
html.cipavi-route-report-fuel-consumption #main-wrapper .vue-bootstrap4-table table colgroup col:nth-child(23) {
    display: none !important;
}

/* Alerta automática visible sin tener que pulsar primero la tarjeta Vencidos. */
#main-wrapper .cipavi-preventive-overdue-auto-alert,
#main-wrapper .preventive-overdue-alert {
    border-radius: 14px !important;
    border-left: 5px solid #dc3545 !important;
    box-shadow: 0 10px 22px rgba(220, 53, 69, .12) !important;
    margin-bottom: 1rem !important;
}

/* FixedAssetAllocations: un único control "Acciones"; al abrirlo aparecen los
   botones Vue originales, por lo que se conservan permisos y funcionalidades. */
html.cipavi-route-fixed-assets #main-wrapper td.cipavi-fixed-actions-cell {
    position: relative;
    min-width: 125px !important;
    width: 125px !important;
    max-width: 150px !important;
    padding: 8px !important;
    cursor: pointer;
    vertical-align: top !important;
    outline: none;
}

html.cipavi-route-fixed-assets #main-wrapper td.cipavi-fixed-actions-cell::before {
    content: "Acciones ▾";
    display: block;
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #2361ce;
    border-radius: 7px;
    background: #ffffff;
    color: #164fae;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 700;
    text-align: center;
    box-sizing: border-box;
}

html.cipavi-route-fixed-assets #main-wrapper td.cipavi-fixed-actions-cell:hover::before,
html.cipavi-route-fixed-assets #main-wrapper td.cipavi-fixed-actions-cell:focus::before {
    background: #eef5ff;
}

html.cipavi-route-fixed-assets #main-wrapper td.cipavi-fixed-actions-cell.cipavi-fixed-actions-open::before {
    content: "Cerrar acciones ▴";
    margin-bottom: 7px;
    background: #2361ce;
    color: #ffffff;
}

html.cipavi-route-fixed-assets #main-wrapper td.cipavi-fixed-actions-cell .fixed-actions {
    display: none !important;
    width: 100% !important;
    gap: 5px !important;
}

html.cipavi-route-fixed-assets #main-wrapper td.cipavi-fixed-actions-cell.cipavi-fixed-actions-open .fixed-actions {
    display: flex !important;
}

html.cipavi-route-fixed-assets #main-wrapper td.cipavi-fixed-actions-cell.cipavi-fixed-actions-open .fixed-actions > button {
    width: 100% !important;
    white-space: normal !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
    padding: 6px 5px !important;
}

/* Versión fuente para futuras compilaciones npm. */
#main-wrapper .fixed-actions-dropdown .dropdown-toggle {
    width: 100% !important;
    white-space: nowrap !important;
}

#main-wrapper .fixed-actions-dropdown-menu {
    min-width: 230px !important;
    max-height: 420px !important;
    overflow-y: auto !important;
}

/* ===== Activos fijos 2026-07-28.3: ancho estable, acciones flotantes, historial y lote ===== */
html.cipavi-route-fixed-assets #main-wrapper .cipavi-report-scroll {
    position: relative !important;
    overflow: auto !important;
    max-width: 100% !important;
}

html.cipavi-route-fixed-assets #main-wrapper table.fixed-table.cipavi-fixed-table-stable {
    display: table !important;
    table-layout: fixed !important;
    width: 2700px !important;
    min-width: 2700px !important;
    max-width: 2700px !important;
    margin: 0 !important;
}

html.cipavi-route-fixed-assets #main-wrapper table.fixed-table.cipavi-fixed-table-stable col.col-cost-center { width: 160px !important; }
html.cipavi-route-fixed-assets #main-wrapper table.fixed-table.cipavi-fixed-table-stable col.col-actions { width: 125px !important; }
html.cipavi-route-fixed-assets #main-wrapper table.fixed-table.cipavi-fixed-table-stable th:last-child,
html.cipavi-route-fixed-assets #main-wrapper table.fixed-table.cipavi-fixed-table-stable td:last-child {
    width: 125px !important;
    min-width: 125px !important;
    max-width: 125px !important;
}

/* El menú original queda oculto: el helper lo presenta en un portal fijo fuera
   del contenedor con scroll, conservando los mismos clics y funciones de Vue. */
html.cipavi-route-fixed-assets #main-wrapper .fixed-actions-dropdown .dropdown-menu {
    display: none !important;
}

.cipavi-fixed-actions-portal {
    position: fixed;
    z-index: 3000;
    max-height: min(520px, calc(100vh - 24px));
    overflow-y: auto;
    padding: 8px;
    border: 1px solid #d8e1ec;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .24);
    display: grid;
    gap: 5px;
}

.cipavi-fixed-actions-portal-item {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 8px 10px;
    background: #f8fafc;
    color: #1f2937;
    text-align: left;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.25;
}

.cipavi-fixed-actions-portal-item:hover {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

.cipavi-fixed-actions-portal-item.is-danger {
    color: #b91c1c;
}

.cipavi-fixed-actions-portal-item.is-danger:hover {
    border-color: #fecaca;
    background: #fef2f2;
}

/* Historial completo: casi todo el ancho de la pantalla para tablas extensas. */
#modal-fixed-asset-history .modal-dialog,
.fixed-assets-history-modal,
.fixed-assets-history-modal.modal-xl {
    width: 96vw !important;
    max-width: 96vw !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

#modal-fixed-asset-history .modal-body {
    max-height: calc(100vh - 155px) !important;
}

body.cipavi-batch-modal-open {
    overflow: hidden !important;
}

.cipavi-batch-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2900;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 23, 42, .58);
}

.cipavi-batch-modal-backdrop.is-open {
    display: flex;
}

.cipavi-batch-modal-dialog {
    width: min(1500px, 97vw);
    max-height: 94vh;
    overflow: hidden;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .35);
    display: flex;
    flex-direction: column;
}

.cipavi-batch-modal-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    padding: 18px 22px;
    border-bottom: 1px solid #e2e8f0;
}

.cipavi-batch-modal-header h4 {
    margin: 0;
    color: #172033;
    font-weight: 800;
}

.cipavi-batch-modal-header p {
    margin: 4px 0 0;
    color: #64748b;
}

.cipavi-batch-close {
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.cipavi-batch-modal-body {
    padding: 18px 22px 20px;
    overflow-y: auto;
}

.cipavi-batch-selection-toolbar,
.cipavi-batch-summary,
.cipavi-batch-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.cipavi-batch-selection-toolbar {
    margin-top: 4px;
    margin-bottom: 10px;
}

.cipavi-batch-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

#cipavi-batch-search {
    width: min(390px, 40vw);
}

.cipavi-batch-table-wrap {
    max-height: 44vh;
    overflow: auto;
    border: 1px solid #dbe3ec;
    border-radius: 12px;
}

.cipavi-batch-table {
    min-width: 1050px;
}

.cipavi-batch-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #edf3fb;
    color: #172033;
    text-align: center;
    vertical-align: middle;
}

.cipavi-batch-table td {
    vertical-align: middle;
}

.cipavi-batch-summary {
    margin-top: 10px;
    padding: 10px 13px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #334155;
}

.cipavi-batch-modal-footer {
    justify-content: flex-end;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
}

@media (max-width: 768px) {
    .cipavi-batch-modal-backdrop { padding: 6px; }
    .cipavi-batch-modal-dialog { width: 99vw; max-height: 98vh; }
    .cipavi-batch-modal-header, .cipavi-batch-modal-body { padding-left: 12px; padding-right: 12px; }
    .cipavi-batch-selection-toolbar, .cipavi-batch-summary { align-items: stretch; flex-direction: column; }
    .cipavi-batch-toolbar-actions { width: 100%; flex-wrap: wrap; }
    #cipavi-batch-search { width: 100%; }
}

/* ===== 2026-07-30: ancho completo solo para los módulos solicitados ===== */
#main-wrapper.cipavi-targeted-wide-page .cipavi-targeted-full-card,
#main-wrapper.cipavi-targeted-wide-page .cipavi-targeted-full-card > .card-body,
#main-wrapper.cipavi-targeted-wide-page .cipavi-targeted-full-report,
#main-wrapper.cipavi-targeted-wide-page .cipavi-targeted-full-report > div,
#main-wrapper.cipavi-targeted-wide-page .cipavi-targeted-full-report > .row,
#main-wrapper.cipavi-targeted-wide-page .cipavi-targeted-full-report .vbt-table-responsive,
#main-wrapper.cipavi-targeted-wide-page .cipavi-targeted-full-report .vbt-table-wrapper,
#main-wrapper.cipavi-targeted-wide-page .cipavi-targeted-full-report .table-responsive {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

#main-wrapper.cipavi-targeted-wide-page .cipavi-targeted-full-report > .row,
#main-wrapper.cipavi-targeted-wide-page .cipavi-targeted-full-report .vbt-table-tools,
#main-wrapper.cipavi-targeted-wide-page .cipavi-targeted-full-report .vbt-table-tools > .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

#main-wrapper.cipavi-targeted-wide-page .cipavi-targeted-full-report .vbt-table-responsive,
#main-wrapper.cipavi-targeted-wide-page .cipavi-targeted-full-report .vbt-table-wrapper,
#main-wrapper.cipavi-targeted-wide-page .cipavi-targeted-full-report .table-responsive {
    overflow-x: auto !important;
    overflow-y: visible !important;
}

#main-wrapper.cipavi-targeted-wide-page table.cipavi-targeted-full-table,
#main-wrapper.cipavi-targeted-wide-page table.cipavi-targeted-full-table.table {
    display: table !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: none !important;
    table-layout: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

#main-wrapper.cipavi-targeted-wide-page table.cipavi-targeted-full-table th,
#main-wrapper.cipavi-targeted-wide-page table.cipavi-targeted-full-table td {
    vertical-align: middle !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
}

/* Los reportes con muchas columnas conservan desplazamiento horizontal,
   pero aprovechan todo el ancho visible antes de necesitarlo. */
#main-wrapper.cipavi-wide-route-inventory-game table.cipavi-targeted-full-table {
    min-width: 1320px !important;
}

#main-wrapper.cipavi-wide-route-inventory-contract-location table.cipavi-targeted-full-table {
    min-width: 1260px !important;
}

/* Activos menores: locación y centro de costo opcionales sin tocar históricos. */
html.cipavi-route-fixed-assets .cipavi-minor-location-fields {
    padding-top: 2px;
}

html.cipavi-route-fixed-assets .cipavi-minor-location-fields .form-control:disabled {
    background-color: #f8fafc !important;
    color: #334155 !important;
}

/* Activos fijos: centro de costo individual por partida e historial. */
.cipavi-partition-cc-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 23, 42, .58);
}
.cipavi-partition-cc-dialog {
    width: min(720px, 96vw);
    max-height: 92vh;
    overflow: auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 26px 70px rgba(15, 23, 42, .3);
}
.cipavi-partition-cc-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    padding: 18px 20px;
    border-bottom: 1px solid #e2e8f0;
}
.cipavi-partition-cc-header h4 { margin: 0 0 4px; font-weight: 800; color: #172033; }
.cipavi-partition-cc-header p { margin: 0; color: #64748b; }
.cipavi-partition-cc-close {
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}
.cipavi-partition-cc-body { padding: 20px; }
#modal-fixed-asset-history .cipavi-history-cc-cell,
#modal-fixed-asset-history .cipavi-movement-from-cc,
#modal-fixed-asset-history .cipavi-movement-to-cc,
#modal-fixed-asset-history .cipavi-inspection-cc-cell {
    min-width: 145px;
    white-space: normal !important;
}
#modal-fixed-asset-history .cipavi-history-cc-action { min-width: 150px; }
#modal-fixed-asset-history .history-table th { vertical-align: middle; }
