/* Common classes */
/* Float */
.left {
    float: left;
}

.right {
    float: right;
}

/* Fonts */
.small-font {
    font-size: 11px;
}

.normal-font {
    font-size: 14px;
}

.big-font {
    font-size: 16px;
}

/* Colors */
.white {
    color: #FFFFFF;
}

.black {
    color: #000000;
}

.red {
    color: #FF0000;
}

.width-100 {
    width: 100%;
}

.width-50 {
    width: 50%;
}

.height-100 {
    height: 100%;
}

.height-50 {
    height: 50%;
}

.vertical-center {
    display: flex;
    align-items: center;
}

.flex-content-left {
    justify-content: flex-start;
}

.flex-content-right {
    justify-content: flex-end;
}

/* Mobile / responsive helpers */

/* Prevent accidental horizontal page scroll; keep scroll inside tables/containers */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Sidebar (mobile drawer) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1040;
}

@media (max-width: 767.98px) {
    /* Off-canvas sidebar on mobile */
    #accordionSidebar.sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transform: translateX(-110%);
        transition: transform 0.2s ease;
        z-index: 1050;
    }

    body.sidebar-open #accordionSidebar.sidebar {
        transform: translateX(0);
    }

    body.sidebar-open #sidebarOverlay {
        display: block;
    }

    /* Lock background scroll when sidebar is open */
    body.sidebar-open {
        overflow: hidden;
    }

    /* Allow content to use full width on mobile */
    #content-wrapper {
        min-width: 100vw;
    }

    /* Common width utilities should stack on mobile */
    .width-50 {
        width: 100%;
    }
}

/* Tables: horizontal scroll when needed */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Table actions (icon buttons) */
.table-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.table-actions__main,
.table-actions__secondary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin: 0;
}

.table-actions .btn {
    border-radius: 10px;
    line-height: 1;
    padding: 0.42rem 0.55rem;
}

.table-actions .btn i,
.table-actions .btn span {
    pointer-events: none;
}

@media (max-width: 767.98px) {
    /* DataTables: keep <table> semantics; scroll via wrapper */
    .dataTables_wrapper {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Generic wrapper for wide tables */
    .table-scroll {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Wide tables: avoid layout break by allowing horizontal scroll */
    table.table th,
    table.table td {
        white-space: nowrap;
    }

    /* Select2 / multiselect often overflow on mobile */
    .select2-container {
        width: 100% !important;
        max-width: 100% !important;
    }
}
