/*
 * Contrato transversal de encuadre para las vistas contables.
 * Mantiene el contenido centrado y contiene el desbordamiento dentro de tablas,
 * aun cuando una vista histórica incluya reglas locales de ancho más antiguas.
 */

body .acw-main,
body .acw-main > *,
body .acw-main > form,
body .acw-main > form > .container,
body .acw-main > form > .container-fluid,
body .acw-main .accounting-wrapper,
body .acw-main .smart-accounting-shell,
body .acw-main .bank-reconciliation-shell,
body .acw-main .expenses-wrapper,
body .acw-main .reception-wrapper,
body .acw-main .import-wrapper,
body .acw-main .confirmations-wrapper,
body .acw-main .mailops-page {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0 !important;
}

body .acw-main > .accounting-hero,
body .acw-main > .accounting-page-hero,
body .acw-main > .expenses-hero,
body .acw-main > form > .accounting-hero,
body .acw-main :is(.reception-hero,.import-hero,.confirmations-hero,.mailops-topbar,.performance-hero) {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
}

body .acw-main .accounting-hero > .container-fluid,
body .acw-main .accounting-page-hero > .container-fluid,
body .acw-main .expenses-hero > .container-fluid,
body .acw-main .accounting-wrapper > .container-fluid,
body .acw-main .expenses-wrapper > .container-fluid,
body .acw-main .smart-accounting-shell > .container-fluid,
body .acw-main .bank-reconciliation-shell > .container-fluid {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-right: auto !important;
    margin-left: auto !important;
    padding-right: clamp(.75rem, 1.5vw, 1.5rem) !important;
    padding-left: clamp(.75rem, 1.5vw, 1.5rem) !important;
}

body .acw-main .accounting-wrapper :is([class*="-grid"], [class*="-layout"]),
body .acw-main .smart-accounting-shell :is([class*="-grid"], [class*="-layout"]) {
    max-width: 100%;
    min-width: 0;
}

body .acw-main .accounting-wrapper :is([class*="-grid"], [class*="-layout"]) > *,
body .acw-main .smart-accounting-shell :is([class*="-grid"], [class*="-layout"]) > * {
    min-width: 0;
}

body .acw-main .accounting-wrapper :is(.table-responsive, .smart-table-scroll, .operational-table-wrap, .report-table-card),
body .acw-main .smart-accounting-shell :is(.table-responsive, .smart-table-scroll, .operational-table-wrap, .report-table-card),
body .acw-main .expenses-wrapper .table-responsive,
body .acw-main :is(.reception-wrapper,.import-wrapper,.confirmations-wrapper,.mailops-page) :is(.table-responsive,.dataTables_wrapper,.dt-container) {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

body .acw-main :is(.accounting-panel,.card,[class*="-shell"],[class*="-layout"],[class*="-grid"]) {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

body .acw-main :is(.accounting-panel,.card,[class*="-shell"],[class*="-layout"],[class*="-grid"]) > * {
    min-width: 0;
}

body .acw-main :is(.modal-dialog,.swal2-popup) {
    max-width: calc(100vw - 2rem);
}

/* Los encabezados operativos que conservan fondo oscuro dentro de EasyConta
   no deben heredar el tono usado por las variantes blancas especializadas. */
body.acw-body .acw-main .accounting-page-hero:not(.bank-hero):not(.vat-compact-hero):not(.income-tax-hero):not(.reporting-page-hero) .accounting-hero-content,
body.acw-body .acw-main .accounting-page-hero:not(.bank-hero):not(.vat-compact-hero):not(.income-tax-hero):not(.reporting-page-hero) .accounting-hero-content h1 {
    color: #fff !important;
}

body.acw-body .acw-main .accounting-page-hero:not(.bank-hero):not(.vat-compact-hero):not(.income-tax-hero):not(.reporting-page-hero) .accounting-hero-content p {
    color: #d7e7ef !important;
}

body.acw-body .acw-main .reporting-page-hero .accounting-hero-content,
body.acw-body .acw-main .reporting-page-hero .accounting-hero-content h1,
body.acw-body:has(.report-main-panel) .acw-main .accounting-page-hero .accounting-hero-content,
body.acw-body:has(.report-main-panel) .acw-main .accounting-page-hero .accounting-hero-content h1 {
    color: #173f54 !important;
}

body.acw-body .acw-main .reporting-page-hero .accounting-hero-content p,
body.acw-body:has(.report-main-panel) .acw-main .accounting-page-hero .accounting-hero-content p {
    color: #738994 !important;
}

body.acw-body .acw-main .reporting-page-hero .accounting-actions .btn-outline-light,
body.acw-body:has(.report-main-panel) .acw-main .accounting-page-hero .accounting-actions .btn-outline-light {
    background: #fff !important;
    border-color: #b8cdd7 !important;
    color: #173f54 !important;
}

body.acw-body .acw-main .reporting-page-hero .accounting-actions .btn-outline-light:hover,
body.acw-body:has(.report-main-panel) .acw-main .accounting-page-hero .accounting-actions .btn-outline-light:hover {
    background: #eaf7f9 !important;
    border-color: #55b9c4 !important;
    color: #075f6a !important;
}

@media (max-width: 767.98px) {
    body .acw-main .accounting-hero > .container-fluid,
    body .acw-main .accounting-page-hero > .container-fluid,
    body .acw-main .expenses-hero > .container-fluid,
    body .acw-main .accounting-wrapper > .container-fluid,
    body .acw-main .expenses-wrapper > .container-fluid,
    body .acw-main .smart-accounting-shell > .container-fluid,
    body .acw-main .bank-reconciliation-shell > .container-fluid {
        width: 100% !important;
        margin-right: auto !important;
        margin-left: auto !important;
    }
}
