/*=========================================================
  PIL Enterprise UI Framework
  File    : pil-layout.css
  Version : 2.0.0
  Target  : Oracle APEX 24.2+
  Purpose : Screen Layout Only
=========================================================*/


/*=========================================================
  APPLICATION BACKGROUND
=========================================================*/

.t-PageBody{
    background:var(--pil-bg);
}

.t-Body{
    background:var(--pil-bg);
}

.t-Body-main{
    background:var(--pil-bg);
}

.t-Body-content{
    background:var(--pil-bg);
}


/*=========================================================
  CONTENT AREA
=========================================================*/

.t-Body-contentInner{
    padding:20px;
}

.t-Body-contentInner > .container{
    max-width:100%;
}


/*=========================================================
  FULL CONTENT
=========================================================*/

.t-Body-fullContent{
    padding:0;
    margin:0;
}


/*=========================================================
  BREADCRUMB
=========================================================*/

.t-BreadcrumbRegion{
    margin-bottom:16px;
}


/*=========================================================
  ROW SPACING
=========================================================*/

.row{
    margin-bottom:20px;
}


/*=========================================================
  RESPONSIVE
=========================================================*/

@media (max-width:992px){

    .t-Body-contentInner{
        padding:16px;
    }

}

@media (max-width:768px){

    .t-Body-contentInner{
        padding:12px;
    }

}


/*=========================================================
  PRINT
  (Do not override Oracle Print Layout)
=========================================================*/

@media print{

    .t-PageBody,
    .t-Body,
    .t-Body-main,
    .t-Body-content,
    .t-Body-contentInner,
    .t-Body-fullContent{

        background:#fff !important;
    }

}

/* =========================================================
   PIL ERP - PRINT LAYOUT
   Trial Balance / Print Pages
   IMPORTANT:
   Do not force screen/Desktop grid width into print
   ========================================================= */

@media print {

    /* -----------------------------------------
       Reset APEX screen layout width
       ----------------------------------------- */

    .t-Body,
    .t-Body-main,
    .t-Body-content,
    .t-Body-contentInner,
    .container,
    .row,
    .col,
    [class*="col-"] {

        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;

        margin-left: 0 !important;
        margin-right: 0 !important;
    }


    /* -----------------------------------------
       Remove screen padding for print
       ----------------------------------------- */

    .t-Body-contentInner {

        padding: 0 !important;
    }


    /* -----------------------------------------
       Trial Balance print region
       ----------------------------------------- */

    #TB_PRINT_REGION {

        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;

        margin: 0 !important;
        padding: 0 !important;

        box-sizing: border-box !important;

        overflow: visible !important;

        background: #fff !important;
    }


    /* -----------------------------------------
       Report tables
       ----------------------------------------- */

    #TB_PRINT_REGION table {

        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;

        box-sizing: border-box !important;

        table-layout: auto !important;
    }


    /* -----------------------------------------
       APEX region body
       ----------------------------------------- */

    #TB_PRINT_REGION .t-Region-bodyWrap,
    #TB_PRINT_REGION .t-Region-body {

        width: 100% !important;
        max-width: none !important;

        margin: 0 !important;
        padding: 0 !important;

        overflow: visible !important;
    }


    /* -----------------------------------------
       A4
       ----------------------------------------- */

    @page {

        size: A4 portrait;
        margin: 10mm;
    }

}

/* =========================================================
   PIL ERP - GLOBAL PRINT LAYOUT
   Version : 1.0
   Scope   : ALL APEX PRINT PAGES
   ========================================================= */

@media print {

    /* =====================================================
       1. RESET APEX SCREEN GRID
       ===================================================== */

    .t-Body,
    .t-Body-main,
    .t-Body-content,
    .t-Body-contentInner {

        width: auto !important;
        max-width: none !important;
        min-width: 0 !important;

        margin: 0 !important;
    }


    /* =====================================================
       2. REMOVE SCREEN PADDING
       ===================================================== */

    .t-Body-contentInner {

        padding: 0 !important;
    }


    /* =====================================================
       3. APEX CONTAINERS
       ===================================================== */

    .t-Body-contentInner > .container,
    .container {

        width: auto !important;
        max-width: none !important;
        min-width: 0 !important;

        margin-left: 0 !important;
        margin-right: 0 !important;
    }


    /* =====================================================
       4. APEX ROW
       ===================================================== */

    .row {

        margin-left: 0 !important;
        margin-right: 0 !important;

        margin-bottom: 0 !important;
    }


    /* =====================================================
       5. APEX COLUMNS
       ===================================================== */

    [class*="col-"] {

        min-width: 0 !important;
    }


    /* =====================================================
       6. PRINT BACKGROUND
       ===================================================== */

    html,
    body,
    .t-PageBody,
    .t-Body,
    .t-Body-main,
    .t-Body-content,
    .t-Body-contentInner {

        background: #fff !important;
    }


    /* =====================================================
       7. PREVENT SCREEN OVERFLOW
       ===================================================== */

    html,
    body {

        overflow: visible !important;
    }


    /* =====================================================
       8. IMAGES
       ===================================================== */

    img {

        max-width: 100% !important;
    }


    /* =====================================================
       9. TABLES
       ===================================================== */

    table {

        max-width: 100% !important;

        page-break-inside: auto;
    }


    tr {

        page-break-inside: avoid;
        break-inside: avoid;
    }


    thead {

        display: table-header-group;
    }


    tfoot {

        display: table-footer-group;
    }


    /* =====================================================
       10. APEX UI — HIDE
       ===================================================== */

    .t-Header,
    .t-Body-title,
    .t-Footer,
    .t-Body-nav,
    .t-BreadcrumbRegion,
    .t-Breadcrumb,
    .a-Toolbar,
    .t-Region-header,
    .t-ButtonRegion,
    .t-NavigationBar,
    .t-TreeNav,
    .t-Body-actions,
    button {

        display: none !important;
    }


    /* =====================================================
       11. APEX PRINTABLE CONTENT
       ===================================================== */

    .t-Body-fullContent {

        padding: 0 !important;
        margin: 0 !important;
    }


    /* =====================================================
       12. REMOVE UI DECORATION
       ===================================================== */

    .t-Region {

        box-shadow: none !important;
    }


    /* =====================================================
       13. PAGE
       ===================================================== */

    @page {

        size: A4 portrait;
        margin: 10mm;
    }

}

/* =========================================================
   PIL ERP - PRINT DOCUMENT FRAMEWORK
   Version : 1.0

   Purpose:
   Common document container for all APEX print pages.

   Used by:
   - Trial Balance Print
   - General Ledger Print
   - Account Ledger Print
   - Income Statement Print
   - Balance Sheet Print
   - Other report print pages
   ========================================================= */


/* =========================================================
   SCREEN
   ========================================================= */

.pil-print-document {

    width: 100%;
    max-width: 1000px;

    margin-left: auto;
    margin-right: auto;

    padding: 20px;

    background: #fff;

    box-sizing: border-box;
}


/* =========================================================
   TABLE
   ========================================================= */

.pil-print-document table {

    width: 100%;

    max-width: 100%;

    border-collapse: collapse;

    box-sizing: border-box;
}


/* =========================================================
   PRINT
   ========================================================= */

@media print {

    /* -----------------------------------------------------
       Print document
       ----------------------------------------------------- */

    .pil-print-document {

        width: 100% !important;
        max-width: none !important;

        min-width: 0 !important;

        margin-left: 0 !important;
        margin-right: 0 !important;

        padding: 0 !important;

        background: #fff !important;

        box-sizing: border-box !important;

        overflow: visible !important;
    }


    /* -----------------------------------------------------
       Print tables
       ----------------------------------------------------- */

    .pil-print-document table {

        width: 100% !important;
        max-width: 100% !important;

        min-width: 0 !important;

        margin-left: 0 !important;
        margin-right: 0 !important;

        box-sizing: border-box !important;

        border-collapse: collapse !important;
    }


    /* -----------------------------------------------------
       Print rows
       ----------------------------------------------------- */

    .pil-print-document tr {

        page-break-inside: avoid;
        break-inside: avoid;
    }


    /* -----------------------------------------------------
       Avoid breaking headings from content
       ----------------------------------------------------- */

    .pil-print-document h1,
    .pil-print-document h2,
    .pil-print-document h3 {

        page-break-after: avoid;
        break-after: avoid;
    }

}