/*topheader*/
#header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 115;
    height: 50px;
}

/*subheader*/
#kt_app_header {
    width: 100% !important;          
    position: relative;              
    z-index: 105;  
    margin-top: 50px;    
    height: 50px;            
}

/*sidebar*/
#kt_app_sidebar {
    padding-top: 10px; 
}

#kt_app_content{
    padding-top:0;
}

:root {
    --bs-app-sidebar-primary-width: 60px; 
    --bs-app-sidebar-secondary-width: 0px; 
    --bs-app-sidebar-width: var(--bs-app-sidebar-primary-width);
    --bs-app-sidebar-width-actual: var(--bs-app-sidebar-primary-width);
}
/* end sidebar*/

.form-control.form-control-solid {
    background-color: #f1f1f4 !important;
}

.form-select:disabled {
    color: #4b5675 !important; 
}

.select2-container--bootstrap5.select2-container--disabled .form-select .select2-selection__rendered {
    color: #4b5675 !important;
}

.select2-container--bootstrap5.select2-container--disabled .form-select .select2-selection__placeholder {
    color: #4b5675 !important;
}



/*toolbar*/
@media (min-width: 992px) {
    [data-kt-app-header-fixed="true"] .app-wrapper {
        margin-top: 0 !important;
    }
}


/*datatable*/
table.dataTable th {
    white-space: nowrap;
    text-align: center;
    background-color: rgb(242, 242, 242) !important;
}

.dt-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

/*button: csv...*/
.dt-container > div:first-child {
    display: flex;
    gap: 5px;                     
    align-items: center;
}

.dt-buttons .buttons-copy,
.dt-buttons .buttons-excel,
.dt-buttons .buttons-print {
    display: none !important;
}

.dt-buttons .btn {
    display: flex;              /* turn button into flex container */
    justify-content: center;    /* horizontal center */
    align-items: center;
    border: 1px solid rgb(150, 150, 150) !important;
    background-color: white !important;
    height: 38px !important;
    border-radius: 8px !important; 
}

/*length : 10/25..*/
.dt-container > div:nth-child(2) {
    display: flex;
    align-items: center;
    margin-left: auto; 
    gap: 10px;
}

#dt-length-0{
    border: 1px solid rgb(150, 150, 150) !important;
    background-color: white !important;
}

/*search*/
.dt-container > div:nth-child(3) {
    display: flex;
    align-items: center;
    gap: 10px;
}

#dt-search-0{
    border: 1px solid rgb(150, 150, 150) !important;
    background-color: white !important;
}

.dt-scroll{
    margin-top:5px;
}

.form-check-input{
	border: 2px solid #9c9c9c !important;
}

/*end datatable*/



/* .tabulator {
    border: 1px solid #b8b8b8; 
}


.tabulator .tabulator-header .tabulator-col {
    border-right: 1px solid #b8b8b8;  
    border-bottom: 1px solid #b8b8b8; 
}


.tabulator .tabulator-header .tabulator-col:last-child {
    border-right: none;
}


.tabulator .tabulator-cell {
    border-right: 1px solid #b8b8b8; 
    border-bottom: 1px solid #b8b8b8; 
    background-color: #ffffff;
}


.tabulator .tabulator-row .tabulator-cell:last-child {
    border-right: none;
} */



/* Display size (global UI zoom). Default 80%, overridable per user from the
   account menu. Kept in CSS variables so JS can change it without reloading. */
:root {
    --cfs-ui-zoom: 0.8;
    --cfs-ui-unzoom: 1.25;
    --cfs-ui-vh: 125vh;
}

html {
    zoom: var(--cfs-ui-zoom);
    scrollbar-gutter: stable;
}

/* Bootstrap adds scrollbar padding when a modal opens. Under zoom that value is
   wrong and shifts the page; the gutter above keeps the layout stable instead. */
body.modal-open {
    padding-right: 0 !important;
}

/* Bootstrap also pads sticky/fixed headers when a modal opens. Under zoom the
   value is huge (visually empty gap on the right), so neutralize it. */
body.modal-open #header,
body.modal-open .app-header,
body.modal-open .fixed-top,
body.modal-open .fixed-bottom,
body.modal-open .is-fixed,
body.modal-open .sticky-top {
    padding-right: 0 !important;
}

/* Modal header is the drag handle. */
.modal .modal-header {
    cursor: move;
    touch-action: none;
}

.modal .modal-header button,
.modal .modal-header a,
.modal .modal-header input,
.modal .modal-header select,
.modal .modal-header textarea {
    cursor: pointer;
}

/* Resizable modal sides (visible handle with icon). */
.modal .modal-dialog {
    position: relative;
    overflow: visible;
}

.modal .modal-dialog .cfs-resize-handle {
    position: absolute;
    top: 50%;
    width: 18px;
    height: 44px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: ew-resize;
    touch-action: none;
    pointer-events: auto;
    color: #1b2861;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(15, 37, 71, 0.18);
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(11, 27, 51, 0.18);
    font-size: 12px;
    line-height: 1;
    opacity: 0.85;
    transform: translateY(-50%);
    transition: opacity 0.15s ease, background-color 0.15s ease;
}

.modal .modal-dialog .cfs-resize-handle:hover {
    opacity: 1;
    background: #ffffff;
}

.modal .modal-dialog .cfs-resize-handle.corner {
    top: auto;
    left: auto;
    right: 3px;
    bottom: 3px;
    width: 22px;
    height: 22px;
    transform: none;
    cursor: nwse-resize;
    color: #000000;
    background: #c7ccd1;
    border-color: rgba(17, 24, 39, 0.55);
    font-size: 14px;
    opacity: 1;
}

.modal .modal-dialog .cfs-resize-handle.corner i {
    color: #000000;
    font-size: 14px;
    font-weight: 700;
    -webkit-text-stroke: 0.45px #000000;
}

.modal .modal-dialog .cfs-resize-handle.corner:hover {
    color: #000000;
    background: #adb5bd;
}

/* When the height is resized, let the body scroll inside the modal. */
.modal .modal-dialog.cfs-resized-height .modal-body {
    overflow-y: auto;
    min-height: 0;
}

/* Keep the content inside the resized modal. */
.modal .modal-content {
    max-width: 100%;
}

/* A resized modal has a fixed height, so everything inside must shrink and
   scroll instead of spilling out of the white modal box. */
.modal .modal-dialog.cfs-resized-height .modal-content {
    overflow: hidden;
}

.modal .modal-dialog.cfs-resized-height .modal-content > .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

/* Modals whose body sits inside Bootstrap tabs (e.g. Chart Of Accounts):
   make the whole tab/form chain flex so the inner body scrolls and stays
   inside the modal when it is resized narrower or shorter. */
.modal .modal-dialog.cfs-resized-height .modal-content > .nav-tabs {
    flex-shrink: 0;
}

.modal .modal-dialog.cfs-resized-height .modal-content > .tab {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    /* Print preview sets an inline 90vh on this tab; let flex drive the
       height so the iframe follows the resize smoothly. */
    height: auto !important;
}

.modal .modal-dialog.cfs-resized-height .modal-content > .tab > form,
.modal .modal-dialog.cfs-resized-height .modal-content > .tab > .tab-content,
.modal .modal-dialog.cfs-resized-height .modal-content > .tab > form > .tab-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
}

.modal .modal-dialog.cfs-resized-height .modal-content .tab-content > .tab-pane.active {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    overflow-y: auto;
}

.modal .modal-dialog.cfs-resized-height .modal-content .tab-content > .tab-pane.active > .modal-body {
    flex: 1 1 auto;
    min-height: 400px;
    min-width: 0;
    overflow: auto;
}

/* Flex children need an explicit min-width of 0 or wide tables/rows push
   the modal wider than its box. */
.modal .modal-dialog.cfs-resized-height .modal-content .row,
.modal .modal-dialog.cfs-resized-height .modal-content .tab-pane,
.modal .modal-dialog.cfs-resized-height .modal-content .modal-body > .row {
    min-width: 0;
}

.modal .modal-dialog.cfs-resized-height .modal-content .modal-body table {
    max-width: 100%;
}

/* While a modal is being resized, keep the drag smooth. The pointer move loop
   is frame-throttled in JS; these rules stop the embedded print preview iframe
   from stealing pointer events or forcing extra paints during the drag. */
.modal .modal-dialog.cfs-resizing {
    will-change: transform;
}

.modal .modal-dialog.cfs-resizing .modal-content {
    will-change: width, height;
}

.modal .modal-dialog.cfs-resizing iframe {
    pointer-events: none;
}

.modal .modal-body {
    overflow-x: auto;
}

.modal .modal-body img {
    max-width: 100%;
    height: auto;
}

/* While a popup is being placed, keep it invisible so it never paints in the
   wrong position and then jumps. */
.cfs-positioning {
    visibility: hidden !important;
}

/* Fixed full-screen overlays must fill the viewport at any zoom level.
   Using inset instead of 100vh/100vw avoids the uncovered gap that a
   scaled viewport unit would leave. */
#loading-overlay,
.loading-overlay,
.modal,
.modal-backdrop {
    height: auto !important;
    width: auto !important;
    right: 0 !important;
    bottom: 0 !important;
}

/* Popper positions tooltips with visual pixels while the page is zoomed, so
   their final position is corrected in JavaScript (see master layout). */

/* Select2 dropdown: counter the zoom so it aligns with its field, then restore
   the UI scale on the dropdown itself so it keeps the 80% size. */
.cfs-zoom-popper {
    zoom: var(--cfs-ui-unzoom, 1);
}

.cfs-zoom-popper .select2-dropdown {
    zoom: var(--cfs-ui-zoom, 1);
}

/* Tabulator cell list editor: cap its height so it never grows over the header
   or above the table. */
.tabulator-edit-list {
    max-height: 244px;
    overflow-y: auto;
}

/* Tabulator list editor highlight. Two states use colours from the CFS logo so
   they are easy to tell apart:
   - first option highlighted because nothing is selected (bright logo blue)
   - the already-selected option highlighted (logo navy) */
.tabulator-edit-list .tabulator-edit-list-item.focused {
    background-color: #0060c0;
    color: #ffffff;
    outline: 1px solid #0060c0;
}

.tabulator-edit-list .tabulator-edit-list-item.active,
.tabulator-edit-list .tabulator-edit-list-item.focused.active {
    background-color: #002060;
    color: #ffffff;
    outline: 1px solid #0080e0;
}

@media (hover: hover) and (pointer: fine) {
    .tabulator-edit-list .tabulator-edit-list-item:not(.focused):not(.active):hover {
        background-color: #e6f2ff;
        color: #002060;
    }
}

/* Auth page is sized with 100vh and a fixed background; scale the height back up
   so the background still covers the screen when the UI is zoomed down. */
.auth-page {
    min-height: var(--cfs-ui-vh, 100vh) !important;
    background-attachment: scroll !important;
}

/* Current page highlight in the top menu and its dropdown */
.app-header-menu .menu-item.active > .menu-link,
.app-header-menu .menu-state-bg .menu-item .menu-link.active {
    background-color: #0e4a7e !important;
}

/* Darker Tabulator scrollbars (dark grey, not black) */
.tabulator .tabulator-tableholder {
    scrollbar-width: thin;
    scrollbar-color: #6c757d #ced4da;
}

.tabulator .tabulator-tableholder::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.tabulator .tabulator-tableholder::-webkit-scrollbar-track {
    background: #ced4da;
}

.tabulator .tabulator-tableholder::-webkit-scrollbar-thumb {
    background: #6c757d;
    border: 3px solid #ced4da;
    border-radius: 6px;
}

.tabulator .tabulator-tableholder::-webkit-scrollbar-thumb:hover {
    background: #5a6268;
}

.tabulator .tabulator-tableholder::-webkit-scrollbar-corner {
    background: #ced4da;
}

.app-header-menu .menu-item.active > .menu-link,
.app-header-menu .menu-item.active > .menu-link .menu-title,
.app-header-menu .menu-item.active > .menu-link .menu-arrow,
.app-header-menu .menu-state-bg .menu-item .menu-link.active,
.app-header-menu .menu-state-bg .menu-item .menu-link.active span,
.app-header-menu .menu-state-bg .menu-item .menu-link.active .menu-title {
    color: #ffffff !important;
}
