
/* Use class "Grid-UI" to apply kendo grid design for ASP Grid and Repeater */

.Grid-UI {
    width: 99%;
    border-collapse: collapse;
    border: 1px solid #dbdbdb !important;
}
    .Grid-UI > tbody > tr > td {
        padding: 5px 10px !important;
    }

    /* #region Header Without Pager */

    /* First row in Grid without pager (header styling) */
    .Grid-UI:not(.Has-Pager) > tbody > tr:first-child > td,
    .Grid-UI:not(.Has-Pager) > tbody > tr:first-child > th {
        background-color: #3e86c9;
        color: #fff;
        border: 1px solid #fff;
        vertical-align: middle;
        font-weight: bold;
        white-space: nowrap;
    }
        /* Links inside first row cells (styled as text, disabled) */
        .Grid-UI:not(.Has-Pager) > tbody > tr:first-child > td > a {
            color: #fff;
            font-weight: bold;
        }
        /* Left border of first row's first cell */
        .Grid-UI:not(.Has-Pager) > tbody > tr:first-child > td:first-child,
        .Grid-UI:not(.Has-Pager) > tbody > tr:first-child > th:first-child {
            border-left: 1px solid #3e86c9 !important;
        }

        /* Right border of first row's last cell */
        .Grid-UI:not(.Has-Pager) > tbody > tr:first-child > td:last-child {
            border-right: 1px solid #3e86c9 !important;
        } 
    /* #endregion */

    /* #region Header With Pager */

    /* Second row cells in Grid with pager (header styling) */
    .Grid-UI.Has-Pager > tbody > tr:nth-child(2) > td {
        background-color: #3e86c9;
        color: #fff;
        border: 1px solid #fff;
        vertical-align: middle;
        font-weight: bold;
        white-space: nowrap;
    }
        /* Links inside second row cells (styled as text, disabled) */
        .Grid-UI.Has-Pager > tbody > tr:nth-child(2) > td > a {
            color: #fff;
            font-weight: bold;
        }

    /* Left border of second row's first cell */
    .Grid-UI.Has-Pager > tbody > tr:nth-child(2) > td:first-child {
        border-left: 1px solid #3e86c9 !important;
    }

    /* Right border of second row's last cell */
    .Grid-UI.Has-Pager > tbody > tr:nth-child(2) > td:last-child {
        border-right: 1px solid #3e86c9 !important;
    }
    /* #endregion */

    /* #region Body Without Pager */

    /* Hover effect for data rows (exclude first row and Category rows) */
    .Grid-UI:not(.Has-Pager) > tbody > tr:not(:first-child):not(.g-category-row):hover {
        background-color: #e3e3e3 !important;
    }

    /* Odd data rows starting from 2nd row (exclude Category rows) */
    .Grid-UI:not(.Has-Pager) > tbody > tr:nth-child(n+2):not(.g-category-row):nth-child(odd) {
        background-color: #f5f5f5;
    }

    /* Even data rows starting from 2nd row (exclude Category rows) */
    .Grid-UI:not(.Has-Pager) > tbody > tr:nth-child(even):not(.g-category-row):nth-child(n+2) {
        background-color: #fff;
    }

    /* Default cell styling for data rows (exclude first row) */
    .Grid-UI:not(.Has-Pager) > tbody > tr:not(:first-child) > td {
        color: #787878;
        border: 1px solid #dbdbdb;
    }

    /* Override: if Grid-UI also has class g-fcolor-black */
    .Grid-UI.g-fcolor-black:not(.Has-Pager) > tbody > tr:not(:first-child) > td {
        color: #2E3D47;
    }

    /* Category rows styling (special highlight rows) */
    .Grid-UI:not(.Has-Pager) > tbody > tr.g-category-row {
        background-color: #eaf1fa;
    }
    /* #endregion */

    /* #region Body With Pager */

    /* Hover effect (skip first 2, last row, and .Category-Row) */
    .Grid-UI.Has-Pager > tbody > tr:nth-child(n+3):not(:last-child):not(.g-category-row):hover {
        background-color: #e3e3e3 !important;
    }

    /* Odd rows (skip first 2, last row, and .Category-Row) */
    .Grid-UI.Has-Pager > tbody > tr:nth-child(n+3):not(:last-child):not(.g-category-row):nth-child(odd) {
        background-color: #ffffff;
    }

    /* Even rows (skip first 2, last row, and .Category-Row) */
    .Grid-UI.Has-Pager > tbody > tr:nth-child(n+3):not(:last-child):not(.g-category-row):nth-child(even) {
        background-color: #f5f5f5;
    }

    /* Default cell styling for data rows (Has-Pager, from 3rd row onward) */
    .Grid-UI.Has-Pager > tbody > tr:nth-child(n+3) > td {
        color: #787878;
        border: 1px solid #dbdbdb;
    }

    /* Override: if Grid-UI also has class g-fcolor-black */
    .Grid-UI.g-fcolor-black.Has-Pager > tbody > tr:nth-child(n+3) > td {
        color: #2E3D47;
    }

    /* Category rows styling (special highlight rows) */
    .Grid-UI.Has-Pager > tbody > tr.g-category-row {
        background-color: #eaf1fa;
    }
    /* #endregion */

    /* #region Pager */

    /* Pager row styling */
    .Grid-UI > tbody > tr.grd-pager {
        background-color: #f5f5f5 !important;
        border-color: #fff !important;
        text-decoration: none !important;
    }
        /* Active/current page number (span element) */
        .Grid-UI > tbody > tr.grd-pager > td > span {
            display: inline-block;
            width: 25px;
            height: 25px;
            line-height: 25px;
            border-radius: 50%;
            background-color: #3e86c9;
            color: #fff;
            text-align: center;
            font-weight: bold;
            margin-right: 4px;
            cursor: pointer;
            border: 1px solid #3e86c9;
        }

        /* Page links (inactive page numbers, anchor elements) */
        .Grid-UI > tbody > tr.grd-pager > td > a {
            display: inline-block;
            width: 25px;
            height: 25px;
            line-height: 25px;
            color: #000;
            text-align: center;
            font-weight: normal;
            margin-right: 4px;
            cursor: pointer;
            text-decoration: none !important;
            border: 1px solid transparent; 
        }

            /* Hover effect for page links */
            .Grid-UI > tbody > tr.grd-pager > td > a:hover {
                display: inline-block;
                width: 25px;
                height: 25px;
                line-height: 25px;
                border-radius: 50%;
                border: 1px solid #3e86c9 !important;
                background-color: #c6dbeb;
                color: #000;
                text-align: center;
                font-weight: bold;
                margin-right: 4px;
                cursor: pointer;
                text-decoration: none !important;
            }
    /* #endregion */

    /* #region Fields */

    /* Default input styling for data rows (exclude first/header row) */
    .Grid-UI > tbody > tr:not(:first-child) > td input[type="text"],
    .Grid-UI > tbody > tr:not(:first-child) > td select,
    .Grid-UI > tbody > tr:not(:first-child) > td textarea,
    .Grid-UI > tbody > tr:not(:first-child) > td .k-dropdown-wrap {
        color: #787878 !important;
        border: 1px solid #ccc !important;
    }

    /* Override: if Grid-UI has class g-fcolor-black */
    .Grid-UI.g-fcolor-black > tbody > tr:not(:first-child) > td input[type="text"],
    .Grid-UI.g-fcolor-black > tbody > tr:not(:first-child) > td select,
    .Grid-UI.g-fcolor-black > tbody > tr:not(:first-child) > td textarea,
    .Grid-UI.g-fcolor-black > tbody > tr:not(:first-child) > td .k-dropdown-wrap {
        color: #2E3D47 !important;
        border: 1px solid #ccc !important;
    }

    /* #endregion */

/* #region Freeze Header */

    /* Freeze (stick) the first row in Grid with class g-freeze-header */
    .Grid-UI.g-freeze-header > tbody > tr:first-child > th,
    .Grid-UI.g-freeze-header > tbody > tr:first-child > td {
        position: sticky;
        top: 0;
    }
/* #endregion */