/*
 * GridView styles - extracted verbatim from the <style> block that lived inside
 * Shared/Partials/GridView/GridView.razor.
 *
 * WHY GLOBAL AND NOT GridView.razor.css
 * This looks like component CSS but it is not. Several of its selectors target markup that
 * GridView does NOT render:
 *
 *   .gb-grid-fit / .gb-grid-fit-fixed  - the CONSUMER wraps the grid in these
 *                                        (Inventories/*.razor and others)
 *   td, th, td.sticky-tableData        - supplied by the consumer through
 *                                        RowTemplate / TableHeder1 (sticky-tableData alone
 *                                        appears in 580 files)
 *
 * CSS isolation stamps its b-XXXXXXXXXX scope attribute only onto elements the component
 * itself renders, and ::deep only reaches DESCENDANTS of those. A .gb-grid-fit wrapper lives
 * in a different component entirely, so no amount of ::deep can reach it - moving these rules
 * into GridView.razor.css would silently strip styling from every one of those pages.
 *
 * Keeping them global also fixes a second problem: as an inline <style> this block was emitted
 * once PER GridView INSTANCE, duplicating ~150 lines of CSS in the DOM on any page with more
 * than one grid.
 *
 * Linked from Pages/_Master.cshtml AFTER override.css, to preserve the late-in-cascade position
 * the inline <style> had (an inline style block in <body> wins ties against <head> links).
 *
 * Selectors are unchanged from the original, so rendering is identical.
 */

    .gb-gridview {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .gb-grid-scroll-tools {
        display: none;
        align-items: center;
        gap: .75rem;
        width: 100%;
        margin: 1rem 0 .5rem;
    }

    .gb-gridview.gb-grid-has-horizontal-overflow .gb-grid-scroll-tools {
        display: flex;
    }

    .gb-grid-scroll-button {
        width: 38px;
        height: 38px;
        flex: 0 0 38px;
        border: 1px solid #e4e6ef;
        border-radius: .475rem;
        background: #f5f8fa;
        color: var(--kt-primary);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: background-color .15s ease, color .15s ease, border-color .15s ease;
    }

        .gb-grid-scroll-button:hover,
        .gb-grid-scroll-button:focus {
            background: var(--kt-primary);
            border-color: var(--kt-primary);
            color: #fff;
        }

    .gb-grid-top-scroll {
        flex: 1 1 auto;
        min-width: 0;
        height: 18px;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: auto;
        scrollbar-color: var(--kt-primary) #eef3f7;
    }

    .gb-grid-top-scroll-spacer {
        height: 1px;
    }

    .gb-grid-table-scroll {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: auto !important;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        padding-bottom: .85rem;
        scrollbar-width: auto;
        scrollbar-color: var(--kt-primary) #eef3f7;
    }

    .gb-grid-table {
        width: max-content;
        min-width: 100%;
    }

        .gb-grid-table th,
        .gb-grid-table td,
        .gb-grid-table td p {
            white-space: nowrap;
        }

    .gb-grid-fit .gb-grid-table {
        width: 100%;
        min-width: 0;
    }

    .gb-grid-fit .gb-grid-table th,
    .gb-grid-fit .gb-grid-table td,
    .gb-grid-fit .gb-grid-table td p {
        white-space: normal;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .gb-grid-fit .gb-grid-table td p {
        margin-bottom: 0;
    }

    .gb-grid-fit .gb-grid-table th.sticky-tableData,
    .gb-grid-fit .gb-grid-table td.sticky-tableData {
        white-space: nowrap;
    }

    .gb-grid-fit .gb-grid-table th.gb-col-check,
    .gb-grid-fit .gb-grid-table td.gb-col-check {
        width: 40px;
        min-width: 0 !important;
    }

    .gb-grid-fit .gb-grid-table th.gb-col-idx,
    .gb-grid-fit .gb-grid-table td.gb-col-idx {
        width: 50px;
        min-width: 0 !important;
    }

    .gb-grid-fit-fixed .gb-grid-table {
        table-layout: fixed;
    }

    .gb-grid-top-scroll::-webkit-scrollbar,
    .gb-grid-table-scroll::-webkit-scrollbar {
        height: 16px;
    }

    .gb-grid-top-scroll::-webkit-scrollbar-track,
    .gb-grid-table-scroll::-webkit-scrollbar-track {
        background: #eef3f7;
        border-radius: 999px;
    }

    .gb-grid-top-scroll::-webkit-scrollbar-thumb,
    .gb-grid-table-scroll::-webkit-scrollbar-thumb {
        background: var(--kt-primary);
        border: 3px solid #eef3f7;
        border-radius: 999px;
    }

        .gb-grid-top-scroll::-webkit-scrollbar-thumb:hover,
        .gb-grid-table-scroll::-webkit-scrollbar-thumb:hover {
            background: var(--kt-primary-active);
        }

    @@media (max-width: 767.98px) {
        .gb-grid-scroll-tools {
            gap: .5rem;
        }

        .gb-grid-scroll-button {
            width: 34px;
            height: 34px;
            flex-basis: 34px;
        }
    }
