﻿/* =========================================================
   DevExtreme Grid - Full Styling
   ========================================================= */

body {
    background: #efefef;
}

/* =========================================================
   OUTER GRID CONTAINER
   ========================================================= */

.report-grid-card,
.dx-datagrid {
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: var(--standard-border-radius);
    overflow: hidden;
}


    /* =========================================================
HEADER / TOOLBAR
========================================================= */

    .dx-datagrid .dx-header-panel {
        background: #f8f9fa;
        border-bottom: 1px solid #e2e2e2;
        border-top-left-radius: var(--standard-border-radius);
        border-top-right-radius: var(--standard-border-radius);
    }

    .dx-datagrid .dx-toolbar {
        border: var(--bs-border-width) solid var(--bs-border-color);
        background: #f8f9fa !important;
        padding: 10px 14px;
        border-bottom: 0px;
    }

.dx-datagrid-header-panel .dx-toolbar {
    margin: 0px !important;
}

.dx-toolbar-before,
.dx-toolbar-after {
    gap: 10px;
}

/* =========================================================
   TOOLBAR BUTTONS
   ========================================================= */

.dx-datagrid .dx-toolbar .dx-button {
    height: 38px;
    border-radius: 18px !important;
}

.dx-datagrid .dx-toolbar .dx-button-mode-contained,
.dx-datagrid .dx-toolbar .dx-button-mode-outlined,
.dx-datagrid .dx-toolbar .dx-button-normal {
    background: #ffffff !important;
    border: 1px solid #d9d9d9 !important;
    box-shadow: none !important;
}

.dx-datagrid .dx-toolbar .dx-button-content {
    padding: 8px 14px;
}

/* =========================================================
   TOP SEARCH BAR
   ========================================================= */

.dx-datagrid .dx-toolbar .dx-datagrid-search-panel {
    margin-right: 8px;
}

    .dx-datagrid .dx-toolbar .dx-datagrid-search-panel .dx-texteditor,
    .dx-datagrid .dx-toolbar .dx-datagrid-search-panel .dx-editor-outlined,
    .dx-datagrid .dx-toolbar .dx-datagrid-search-panel .dx-searchbox {
        height: 38px !important;
        min-height: 38px !important;
        width: 240px;
        background: #ffffff !important;
        border: 1px solid #d9d9d9 !important;
        border-radius: 18px !important;
        box-shadow: none !important;
        overflow: hidden;
    }

    .dx-datagrid .dx-toolbar .dx-datagrid-search-panel .dx-texteditor-container {
        display: flex !important;
        align-items: center !important;
        gap: 8px;
        height: 100%;
        padding: 0 12px;
        border-radius: 18px !important;
        overflow: hidden;
    }

    .dx-datagrid .dx-toolbar .dx-datagrid-search-panel .dx-icon-search {
        position: static !important;
        transform: none !important;
        margin: 0 !important;
        flex: 0 0 auto;
        color: #6b7280;
        pointer-events: none;
    }

    .dx-datagrid .dx-toolbar .dx-datagrid-search-panel .dx-texteditor-input-container {
        flex: 1 1 auto !important;
        min-width: 0;
        display: flex;
        align-items: center;
    }

    .dx-datagrid .dx-toolbar .dx-datagrid-search-panel .dx-texteditor-input {
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        border: 0 !important;
        background: transparent !important;
        font-size: 14px;
        line-height: 20px;
    }

    .dx-datagrid .dx-toolbar .dx-datagrid-search-panel .dx-texteditor.dx-state-focused,
    .dx-datagrid .dx-toolbar .dx-datagrid-search-panel .dx-editor-outlined.dx-state-focused {
        box-shadow: none !important;
        border-color: #cfcfcf !important;
    }

/* =========================================================
   COLUMN HEADER
   ========================================================= */

.dx-datagrid .dx-datagrid-headers {
    background: #f8f9fa;
}

.dx-datagrid .dx-header-row > td,
.dx-datagrid .dx-header-row > th {
    background: #f8f9fa !important;
    border-color: #dddddd !important;
    font-weight: 500;
    padding: 14px 10px !important;
    text-align: left !important;
}

.dx-datagrid .dx-header-row .dx-datagrid-text-content {
    display: block !important;
    width: 100%;
    text-align: left !important;
}

.dx-datagrid .dx-header-row .dx-column-indicators,
.dx-datagrid .dx-header-row .dx-template-wrapper,
.dx-datagrid .dx-header-row .dx-datagrid-action {
    justify-content: flex-start !important;
    text-align: left !important;
}

/* =========================================================
   FILTER ROW
   ========================================================= */

.dx-item-content.dx-menu-item-content {
    background: #f3f3f3;
}

    .dx-item-content.dx-menu-item-content:hover {
        background: #d5d5d5;
    }

.dx-datagrid .dx-datagrid-filter-row {
    background: #f8f9fa;
}

.rd-small-date-btn .dx-button-content {
    padding: 2px 6px !important;
    font-size: 12px;
}

.rd-small-date-btn {
    min-height: 20px !important;
}

.dx-datagrid .dx-datagrid-filter-row > td {
    background: #f8f9fa !important;
    border-color: #dddddd !important;
}

/* remove the bubbles around the search icons below each column */
.dx-datagrid .dx-datagrid-filter-row .dx-texteditor {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.dx-datagrid .dx-datagrid-filter-row .dx-editor-with-menu,
.dx-datagrid .dx-datagrid-filter-row .dx-menu {
    background: transparent !important;
    border: none !important;
}

.dx-datagrid .dx-datagrid-filter-row .dx-icon-search {
    background: transparent !important;
    border: none !important;
    margin-left: 4px;
}

.dx-datagrid .dx-datagrid-filter-row .dx-icon {
    color: #333;
}

/* =========================================================
   ROWS
   ========================================================= */
.dx-bordered-bottom-view {
    border-top: 0px !important;
}

.dx-datagrid-rowsview .dx-row > td {
    border-color: #ebebeb !important;
    padding: 10px 10px !important;
}

.dx-datagrid-rowsview .dx-row:hover > td {
    background: rgba(0,0,0,.075);
}

.rd-pages-visited-list {
    max-height: 120px;
    overflow-y: auto;
    overflow-x: hidden;
}

.rd-pages-visited-item {
    display: block;
    padding: 3px 0;
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
    text-decoration: underline;
    color: inherit;
}

.rd-pages-visited-item + .rd-pages-visited-item {
    border-top: 1px solid #ececec;
}

.rd-pages-visited-item:hover {
    color: #0d6efd;
}

/* =========================================================
   PAGER
   ========================================================= */

.dx-datagrid .dx-pager {
    background: #ffffff;
    padding: 12px 14px;
    border: 1px solid #ececec;
}

.dx-datagrid .dx-page.dx-selection {
    background: #d9d9d9;
    border-radius: 3px;
    padding: 7px 9px 8px 10px !important;
}

/* =========================================================
   CLEANUP
   ========================================================= */

.dx-texteditor.dx-state-focused,
.dx-button.dx-state-focused {
    box-shadow: none !important;
}

input:focus {
    outline: none;
}

.dx-texteditor {
    border-radius: 18px !important;
}

/* =========================================================
   REMOVE EMPTY SPACE BELOW ROWS
   ========================================================= */

.dx-row.dx-freespace-row.dx-column-lines {
    display: none !important;
    height: 0px !important;
}

/* let the bottom toolbar wrap onto multiple lines */
.dx-popup-bottom .dx-toolbar-items-container {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center;
    row-gap: 4px;
    column-gap: 6px;
}

/* keep the button groups from forcing one long row */
.dx-popup-bottom .dx-toolbar-before,
.dx-popup-bottom .dx-toolbar-after,
.dx-popup-bottom .dx-toolbar-center {
    display: contents !important;
}

/* compact button sizing */
.rd-small-date-btn .dx-button-content {
    padding: 2px 6px !important;
    font-size: 12px;
    white-space: nowrap;
}

.rd-small-date-btn {
    min-height: 20px !important;
    margin: 0 !important;
}

/* optional: tighten popup bottom padding a bit */
.dx-popup-bottom .dx-toolbar {
    padding: 4px 6px !important;
}


/* =========================================================
   CALENDAR DATE RANGE PICKER
   ========================================================= */

.rd-date-range-popup-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rd-date-range-popup-buttons {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.rd-date-range-popup-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.rd-date-range-popup-presets {
    min-width: 120px;
}

.dx-datagrid-filter-row .rd-date-range-editor-with-menu {
    display: flex !important;
    align-items: center;
    width: 100%;
    height: 100%;
    min-height: 33px;
    background: #fff;
    overflow: hidden;
}

.rd-date-range-filter-trigger {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    min-height: 33px;
    background: #f3f3f3;
    cursor: pointer;
    overflow: hidden;
}

.rd-date-range-filter-icon {
    flex: 0 0 30px;
    width: 30px;
    height: 33px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.rd-date-range-filter-text {
    flex: 1 1 auto;
    min-width: 0;
    height: 33px;
    line-height: 33px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: #fff;
    color: #333;
    padding-left: 6px;
    padding-right: 6px;
}

.rd-date-range-filter-trigger-active .rd-date-range-filter-icon,
.rd-date-range-filter-trigger-active .rd-date-range-filter-icon .dx-icon {
    color: var(--bs-primary, #0d6efd);
}

.dx-datagrid-filter-row td.rd-column-filter-applied .dx-editor-with-menu > .dx-menu.dx-filter-menu > .dx-menu-horizontal > ul.dx-menu-items-container > li.dx-menu-item-wrapper > .dx-menu-item-has-submenu > .dx-menu-item-content > .dx-icon[class*="dx-icon-filter-operation-"]::before {
    color: var(--bs-primary, #0d6efd);
}

/*
.dx-toolbar-items-container > .dx-datagrid-filter-panel.rd-filter-panel-toolbar-item {
    flex: 1 1 auto;
    min-width: 0;
    border-top: 0;
    border-bottom: 0;
    margin-right: 12px;
}

.dx-toolbar-items-container {
    position: relative;
}

.dx-toolbar-items-container > .dx-datagrid-filter-panel.rd-filter-panel-toolbar-item {
    display: flex;
    align-items: center;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    max-width: calc(100% - var(--rd-toolbar-after-width, 320px) - 16px);
    width: auto;
    min-width: 0;
    border-top: 0;
    border-bottom: 0;
    margin: 0;
    padding-right: 8px;
    overflow: hidden;
    white-space: nowrap;
}

.dx-toolbar-items-container > .dx-datagrid-filter-panel.rd-filter-panel-toolbar-item .dx-datagrid-filter-panel-left {
    display: flex;
    align-items: center;
    min-width: 0;
    overflow: hidden;
}

.dx-toolbar-items-container > .dx-datagrid-filter-panel.rd-filter-panel-toolbar-item .dx-datagrid-filter-panel-text {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dx-toolbar-items-container > .dx-datagrid-filter-panel.rd-filter-panel-toolbar-item .dx-datagrid-filter-panel-clear-filter {
    flex: 0 0 auto;
    margin-left: 25px;
}
*/
.dx-toolbar-items-container {
    position: relative;
}

    .dx-toolbar-items-container > .dx-datagrid-filter-panel.rd-filter-panel-toolbar-item {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        position: absolute;
        top: 50%;
        left: calc(var(--rd-toolbar-before-width, 0px) + 8px);
        right: calc(var(--rd-toolbar-after-width, 320px) + 8px);
        transform: translateY(-50%);
        width: auto;
        max-width: none;
        min-width: 0;
        border-top: 0;
        border-bottom: 0;
        margin: 0;
        padding: 0;
        overflow: hidden;
        white-space: nowrap;
        z-index: 2;
    }

        .dx-toolbar-items-container > .dx-datagrid-filter-panel.rd-filter-panel-toolbar-item .dx-datagrid-filter-panel-left {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            min-width: 0;
            overflow: hidden;
            flex: 0 1 auto;
        }

        .dx-toolbar-items-container > .dx-datagrid-filter-panel.rd-filter-panel-toolbar-item .dx-datagrid-filter-panel-text {
            display: block;
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .dx-toolbar-items-container > .dx-datagrid-filter-panel.rd-filter-panel-toolbar-item .dx-datagrid-filter-panel-checkbox,
        .dx-toolbar-items-container > .dx-datagrid-filter-panel.rd-filter-panel-toolbar-item .dx-icon-filter {
            flex: 0 0 auto;
        }

        .dx-toolbar-items-container > .dx-datagrid-filter-panel.rd-filter-panel-toolbar-item .dx-datagrid-filter-panel-clear-filter {
            flex: 0 0 auto;
            margin-left: 8px;
        }
.rd-filterbuilder-date-range-editor {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rd-filterbuilder-date-range-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.rd-filterbuilder-date-range-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 180px;
    max-width: 280px;
    height: 24px;
    cursor: pointer;
    vertical-align: middle;
}

.rd-filterbuilder-date-range-trigger-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.rd-filterbuilder-date-range-trigger-text {
    display: inline-block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rd-filterbuilder-date-range-popover-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0px;
}

.rd-filterbuilder-date-range-popover-buttons {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.rd-filterbuilder-date-range-popover-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.rd-filterbuilder-date-range-popover-presets {
    min-width: 120px;
}

.dx-filterbuilder-group-item.rd-filterbuilder-date-range-row > .dx-filterbuilder-item-operation {
    display: none !important;
}

.dx-filterbuilder-group-item.rd-filterbuilder-date-range-row > .dx-filterbuilder-item-value {
    margin-left: 4px;
}

.dx-filterbuilder-group-item.rd-filterbuilder-date-range-row .dx-filterbuilder-item-value-text {
    cursor: pointer;
    color: var(--bs-primary, #0d6efd);
}

.rd-filterbuilder-date-range-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 180px;
    max-width: 280px;
    height: 24px;
    cursor: pointer;
    vertical-align: middle;
    color: var(--bs-primary, #0d6efd);
}

.rd-filterbuilder-date-range-trigger-static {
    pointer-events: none;
}

.rd-filterbuilder-date-range-trigger-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.rd-filterbuilder-date-range-trigger-text {
    display: inline-block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.rd-filterbuilder-date-range-popover-buttons {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.rd-filterbuilder-date-range-popover-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.rd-filterbuilder-date-range-popover-presets {
    min-width: 120px;
}

.rd-filterbuilder-date-range-popover-content,
.rd-date-range-popup-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.rd-date-range-calendar-popup-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 26px;
    margin-bottom: -2px;
}

.rd-date-range-calendar-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 0;
    background: transparent;
    color: #555;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

    .rd-date-range-calendar-close:hover {
        color: #000;
    }


.dx-toolbar-items-container > .dx-datagrid-filter-panel.rd-primary-date-filter-panel-host {
    cursor: default;
}

    .dx-toolbar-items-container > .dx-datagrid-filter-panel.rd-primary-date-filter-panel-host .dx-datagrid-filter-panel-left {
        display: flex;
        align-items: center;
        min-width: 0;
        overflow: hidden;
    }

.rd-primary-date-filter-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
    cursor: pointer;
    color: var(--bs-primary, #0d6efd);
    white-space: nowrap;
    overflow: hidden;
}

.rd-primary-date-filter-icon {
    flex: 0 0 auto;
    font-size: 18px;
}

.rd-primary-date-filter-text {
    display: inline-block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rd-primary-date-filter-trigger {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    max-width: 100%;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    color: #344054;
    white-space: nowrap;
    overflow: hidden;
}

    .rd-primary-date-filter-trigger:hover {
        border-color: var(--bs-primary, #0d6efd);
        color: var(--bs-primary, #0d6efd);
        background: rgba(13, 110, 253, 0.04);
    }

.rd-primary-date-filter-trigger-active {
    border-color: var(--bs-primary, #0d6efd);
    background: rgba(13, 110, 253, 0.08);
    color: var(--bs-primary, #0d6efd);
}

.rd-primary-date-filter-icon {
    flex: 0 0 auto;
    font-size: 17px;
}

.rd-primary-date-filter-text {
    display: inline-block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 500;
}

.rd-primary-date-filter-caret {
    flex: 0 0 auto;
    font-size: 12px;
    opacity: 0.7;
}

/* Hide DevExtreme's default FilterPanel UI so "Create Filter",
   the default filter text, checkbox, and Clear link never flash. */
.dx-datagrid .dx-datagrid-filter-panel .dx-datagrid-filter-panel-checkbox,
.dx-datagrid .dx-datagrid-filter-panel .dx-datagrid-filter-panel-left > .dx-icon-filter,
.dx-datagrid .dx-datagrid-filter-panel .dx-datagrid-filter-panel-left > .dx-datagrid-filter-panel-text,
.dx-datagrid .dx-datagrid-filter-panel .dx-datagrid-filter-panel-clear-filter {
    display: none !important;
}

/* Keep your replacement trigger visible. */
.dx-datagrid .dx-datagrid-filter-panel .rd-primary-date-filter-trigger {
    display: inline-flex !important;
}