/* ============================================================================
   Kendo UI widgets skinned like the CnMaterial Telerik controls.
   Scope: only Kendo classes (.k-*) are matched; no Telerik class is referenced.
   Opt in per-widget with a wrapper class, so pages keep their current look
   unchanged unless they ask for it:

     - .cn-kendo-grid     on the host div of a kendoGrid.
     - .cn-kendo-window   on the wrapper element of a kendoWindow
                          (add via: _wnd.wrapper.addClass("cn-kendo-window");).

   Button variants (match RadButton_CnMaterial's primary/secondary shapes so a
   Kendo button and a plain <button> both render like Telerik's dialog buttons):

     - .cnPrimaryButton   solid blue, white text (confirm / submit).
     - .cnSecondaryButton white box, blue text (cancel / dismiss / toolbar).

   Any of these can also wear .btn-icon-sm to flatten the min-width/padding into
   a 32x32 icon slot (used by the +/- row controls).
   ============================================================================ */

/* ---------------------------------------------------------------------------
   Button variants — Kendo UI and plain HTML buttons dressed as RadButton_CnMaterial.
   Specs come from live computed styles of .cnPrimaryButton.rbButton /
   .cnSecondaryButton.rbButton: 32px tall, 66px wide, 4px radius, same shadow.
   --------------------------------------------------------------------------- */
.cnPrimaryButton,
button.cnPrimaryButton,
.k-button.cnPrimaryButton,
.cnSecondaryButton,
button.cnSecondaryButton,
.k-button.cnSecondaryButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 66px;
    height: 32px;
    padding: 8px 13px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    line-height: 18.5714px;
    text-transform: none;
    box-shadow: var(--box-shadow-button-main);
    outline: none;
    cursor: pointer;
    transition: all .2s ease-in-out;
}

/* Primary — solid blue, white text. */
.cnPrimaryButton,
button.cnPrimaryButton,
.k-button.cnPrimaryButton {
    border-color: var(--border-color-pri-default);
    background-color: var(--bg-color-pri-default);
    color: var(--color-pri-default);
}

    .cnPrimaryButton:hover,
    .cnPrimaryButton:focus,
    .cnPrimaryButton:active,
    .cnPrimaryButton.k-active,
    .cnPrimaryButton.k-focus,
    .cnPrimaryButton.k-hover,
    .cnPrimaryButton.k-selected,
    button.cnPrimaryButton:hover,
    button.cnPrimaryButton:focus,
    .k-button.cnPrimaryButton:hover,
    .k-button.cnPrimaryButton:focus,
    .k-button.cnPrimaryButton.k-active,
    .k-button.cnPrimaryButton.k-focus,
    .k-button.cnPrimaryButton.k-hover,
    .k-button.cnPrimaryButton.k-selected {
        border-color: var(--border-color-pri-hover);
        background-color: var(--bg-color-pri-hover);
        color: var(--color-pri-hover);
        box-shadow: var(--box-shadow-button-main);
    }

/* Secondary — white box, blue text. */
.cnSecondaryButton,
button.cnSecondaryButton,
.k-button.cnSecondaryButton {
    border-color: var(--border-color-sec-default);
    background-color: var(--bg-color-sec-default);
    color: var(--color-sec-default);
}

    .cnSecondaryButton:hover,
    .cnSecondaryButton:focus,
    .cnSecondaryButton:active,
    .cnSecondaryButton.k-active,
    .cnSecondaryButton.k-focus,
    .cnSecondaryButton.k-hover,
    .cnSecondaryButton.k-selected,
    button.cnSecondaryButton:hover,
    button.cnSecondaryButton:focus,
    .k-button.cnSecondaryButton:hover,
    .k-button.cnSecondaryButton:focus,
    .k-button.cnSecondaryButton.k-active,
    .k-button.cnSecondaryButton.k-focus,
    .k-button.cnSecondaryButton.k-hover,
    .k-button.cnSecondaryButton.k-selected {
        border-color: var(--border-color-sec-hover);
        background-color: var(--bg-color-sec-hover);
        /* Matches Telerik: secondary hovers to the same text colour as primary. */
        color: var(--color-pri-hover);
        box-shadow: var(--box-shadow-button-main);
    }

/* Disabled — RadButton_CnMaterial fades the whole box. */
.cnPrimaryButton:disabled,
.cnSecondaryButton:disabled,
.cnPrimaryButton.k-disabled,
.cnSecondaryButton.k-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

/* Icon-only variant — square 32x32 slot used by the row +/- controls. */
.cnPrimaryButton.btn-icon-sm,
.cnSecondaryButton.btn-icon-sm,
.k-button.cnPrimaryButton.btn-icon-sm,
.k-button.cnSecondaryButton.btn-icon-sm {
    min-width: 32px;
    width: 32px;
    padding: 0;
}

/* Flat modifier — no rounded corners, no shadow, slightly larger text.
   Apply alongside .cnPrimaryButton / .cnSecondaryButton: e.g. class="cnPrimaryButton btn-flat". */
.cnPrimaryButton.btn-flat,
.cnSecondaryButton.btn-flat,
.k-button.cnPrimaryButton.btn-flat,
.k-button.cnSecondaryButton.btn-flat {
    border-radius: 0 !important;
    box-shadow: none !important;
    font-size: 15px;
    padding-left: 16px;
    padding-right: 16px;
}

.cnPrimaryButton.btn-flat:hover,
.cnPrimaryButton.btn-flat:focus,
.cnPrimaryButton.btn-flat:active,
.cnSecondaryButton.btn-flat:hover,
.cnSecondaryButton.btn-flat:focus,
.cnSecondaryButton.btn-flat:active,
.k-button.cnPrimaryButton.btn-flat:hover,
.k-button.cnPrimaryButton.btn-flat.k-focus,
.k-button.cnPrimaryButton.btn-flat.k-hover,
.k-button.cnSecondaryButton.btn-flat:hover,
.k-button.cnSecondaryButton.btn-flat.k-focus,
.k-button.cnSecondaryButton.btn-flat.k-hover {
    box-shadow: none !important;
}

.cnPrimaryButton.btn-flat.btn-icon-sm,
.cnSecondaryButton.btn-flat.btn-icon-sm,
.k-button.cnPrimaryButton.btn-flat.btn-icon-sm,
.k-button.cnSecondaryButton.btn-flat.btn-icon-sm {
    padding-left: 0;
    padding-right: 0;
}



/* ---------------------------------------------------------------------------
   Kendo Grid — matches RadGrid_CnMaterial (see Grid.CnMaterial.css).
   --------------------------------------------------------------------------- */
.cn-kendo-grid {
    font-size: var(--font-size);
    color: var(--color-ctrl_grid-default);
    background-color: var(--bg-color-ctrl_grid);
    border: 1px solid var(--border-color-ctrl);
    border-radius: 0;
    box-shadow: none;
}

/* ColumnWidthSummary mode (Telerik RadGridColWidthSummary twin). The grid keeps Kendo's
   default scrollable layout so native column-resize math (which reads the current
   rendered width as the base for the drag delta) works correctly — but we disable the
   inner scrollers so the outer .cn-kendo-window .k-window-content (overflow: auto)
   handles any horizontal overflow instead. JS pins the wrapper width to the sum of
   column widths (+ scrollbar + border) in SetWidthForKendoGrid. */
.cn-kendo-grid-colwidth .k-grid-content,
.cn-kendo-grid-colwidth .k-grid-content-locked {
    /* overflow: visible disables the inner scrollbars so the outer .k-window-content
       is the only scroller. Keep Kendo's own height (set from the grid wrapper's
       height) so the content area flex-fills the grid — otherwise rows cluster at
       the top with empty space below. */
    overflow: visible !important;
}


.cn-kendo-grid-colwidth .k-grid-header,
.cn-kendo-grid-colwidth .k-grid-header-wrap {
    overflow: visible !important;
    /* Kendo inline-styles padding-right on .k-grid-header-wrap to reserve space for the
       body's vertical scrollbar. With overflow: visible on the body there is no such
       scrollbar, so clearing this padding re-aligns header columns with body columns. */
    padding-right: 0 !important;
}

/* "No records" placeholder: Kendo's default styling lets the flex container size to its
   content plus 20px padding, which can exceed the pinned wrapper width and bleed out of
   the popup body. Pin it to the content area so the message stays inside the grid. */
.cn-kendo-grid-colwidth .k-grid-norecords {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    padding: 20px;
    justify-content: center;
    text-align: center;
}

/* Header band — same tone as .rgHeader; column titles are italic in this skin. */
.cn-kendo-grid .k-grid-header,
.cn-kendo-grid .k-grid-header-wrap,
.cn-kendo-grid .k-grouping-header {
    background-color: var(--bg-color-ctrl_grid-head);
    border-color: var(--border-color-ctrl);
    color: var(--color-ctrl_grid-default);
}

.cn-kendo-grid .k-grid-header .k-table-th,
.cn-kendo-grid .k-grid-header th.k-header {
    background-color: var(--bg-color-ctrl_grid-head);
    color: var(--color-ctrl_grid-default);
    font-weight: 500;
    font-style: normal;
    padding: 8px 13px 7px !important;
    padding-block: 8px 7px !important;
    padding-inline: 13px !important;
    border-color: var(--border-color-ctrl);
    border-bottom: 1px solid var(--border-color-ctrl) !important;
    text-transform: none;
}

    .cn-kendo-grid .k-grid-header .k-table-th .k-link,
    .cn-kendo-grid .k-grid-header .k-table-th a.k-link,
    .cn-kendo-grid .k-grid-header .k-table-th .k-column-title {
        color: var(--color-ctrl_grid-default);
    }

    .cn-kendo-grid .k-grid-header .k-table-th.k-sorted,
    .cn-kendo-grid .k-grid-header .k-table-th.k-active {
        background-color: var(--bg-color-ctrl_grid-col-sorted);
    }

/* Body rows — match .rgRow / .rgAltRow / hover / selected (computed from the live DocumentGrid).
   !important + the logical padding longhands are needed because modern Kendo themes
   drive cell padding through `padding-block` / `padding-inline`, which override our
   shorthand `padding` even at higher specificity. We set both so either cascade wins. */
.cn-kendo-grid td,
.cn-kendo-grid .k-table-td {
    padding: 3px 13px 2px !important;
    padding-block: 3px 2px !important;
    padding-inline: 13px !important;
    border-color: var(--border-color-ctrl);
    border-bottom: 1px solid var(--border-color-ctrl) !important;
    line-height: 1.5384615385;
    background-color: transparent;
}

/* Row text colour only; let the row background stay transparent so the grid colour shows through,
   matching RadGrid where .rgRow td has background-color: rgba(0,0,0,0).
   NB: --bg-color-ctrl_grid-row-default on this skin is --color2 (the blue header colour), not white. */
.cn-kendo-grid tbody tr,
.cn-kendo-grid tbody .k-table-row,
.cn-kendo-grid tbody tr > td,
.cn-kendo-grid tbody .k-table-row > .k-table-td {
    background-color: transparent !important;
    color: var(--color-ctrl_grid-default);
}

    /* Alt (even) rows — cream */
    .cn-kendo-grid tbody tr.k-alt,
    .cn-kendo-grid tbody .k-table-alt-row,
    .cn-kendo-grid tbody tr.k-alt > td,
    .cn-kendo-grid tbody .k-table-alt-row > .k-table-td {
        background-color: var(--bg-color-ctrl_grid-row-alt) !important;
    }

    /* Hover — light amber */
    .cn-kendo-grid tbody tr:hover,
    .cn-kendo-grid tbody tr.k-hover,
    .cn-kendo-grid tbody .k-table-row:hover,
    .cn-kendo-grid tbody .k-table-row.k-hover,
    .cn-kendo-grid tbody tr:hover > td,
    .cn-kendo-grid tbody .k-table-row:hover > .k-table-td,
    .cn-kendo-grid tbody .k-table-row.k-hover > .k-table-td {
        background-color: var(--bg-color-ctrl_grid-row-hover) !important;
        color: var(--color-ctrl_grid-default);
    }

    /* Selected — amber (beats hover and alt) */
    .cn-kendo-grid tbody tr.k-selected,
    .cn-kendo-grid tbody tr.k-state-selected,
    .cn-kendo-grid tbody .k-table-row.k-selected,
    .cn-kendo-grid tbody tr.k-selected > td,
    .cn-kendo-grid tbody .k-table-row.k-selected > .k-table-td,
    .cn-kendo-grid tbody tr.k-alt.k-selected > td,
    .cn-kendo-grid tbody .k-table-alt-row.k-selected > .k-table-td,
    .cn-kendo-grid tbody tr.k-selected:hover > td,
    .cn-kendo-grid tbody .k-table-row.k-selected:hover > .k-table-td {
        background-color: var(--bg-color-ctrl_grid-row-selected) !important;
        color: var(--color-main_text);
    }

    /* Kendo tints the selected row cell via ::before — clear it so the solid colour shows. */
    .cn-kendo-grid tbody tr.k-selected > td::before,
    .cn-kendo-grid tbody .k-table-row.k-selected > .k-table-td::before {
        background: none !important;
        opacity: 0 !important;
    }

/* Filter row — same as .rgFilterRow. The padding on the live grid is 0 at the TR; the box carries it. */
.cn-kendo-grid .k-grid-header .k-filter-row,
.cn-kendo-grid .k-grid-header .k-filter-row > th,
.cn-kendo-grid .k-grid-header .k-filter-row > td {
    background-color: var(--bg-color-ctrl_grid-head);
    padding: 4px 13px;
    border-color: var(--border-color-ctrl);
    border-bottom: 1px solid var(--border-color-ctrl);
}

/* Filter box — same as .rgFilterBox. !important wins over the window content's own input rule. */
/* Filter box — same as .rgFilterBox. !important wins over the window content's own input rule.
   outline:none kills the browser/Material focus-visible ring, so our 1px/2px border is what shows.
   `flex: 1 1 auto` (instead of `width: 100%`) lets the clear/filter button sit next to the input
   inside the .k-filtercell-wrapper flex row; `min-width: 0` lets the input shrink below content. */
.cn-kendo-grid .k-filter-row .k-input,
.cn-kendo-grid .k-filter-row .k-textbox,
.cn-kendo-grid .k-filter-row input[type="text"] {
    box-sizing: border-box;
    flex: 1 1 auto;
    min-width: 0;
    padding: 8px 0 7px 8px !important;
    color: var(--color-main_text);
    background-color: var(--bg-color-ctrl-default);
    border: 1px solid var(--border-color-ctrl-default) !important;
    border-width: 1px 1px 2px 1px !important;
    border-radius: 3px !important;
    outline: none !important;
    box-shadow: none !important;
    line-height: var(--line-height);
    font-size: var(--font-size);
}

/* Clear-filter button inside .k-filtercell-operator — same tint as the border, square clickable area. */
.cn-kendo-grid .k-filter-row .k-filtercell-operator {
    flex: 0 0 auto;
    margin-left: 4px;
}

    .cn-kendo-grid .k-filter-row .k-filtercell-operator .k-button {
        color: var(--color-ctrl-default);
        background: transparent;
        border: 0 none;
        box-shadow: none;
    }

        .cn-kendo-grid .k-filter-row .k-filtercell-operator .k-button:hover {
            color: var(--color-ctrl-hover);
            background: var(--bg-color-ctrl-hover);
        }

    /* Hover — matches RadGrid's .rgFilterBox:hover (border tint). */
    .cn-kendo-grid .k-filter-row .k-input:hover,
    .cn-kendo-grid .k-filter-row input[type="text"]:hover {
        border-color: #90A4AE !important;
    }

    /* Focus — matches the live RadGrid: the Telerik filter box keeps its white background and
       default border on focus (the skin's own :focus rule is overridden somewhere upstream).
       We only recolor the bottom border to the focus accent so there is still a visible cue.
       Kendo's material-arctic uses `:focus-within` on .k-input which otherwise wins. */
    .cn-kendo-grid .k-filter-row .k-input:focus,
    .cn-kendo-grid .k-filter-row .k-input:focus-within,
    .cn-kendo-grid .k-filter-row input[type="text"]:focus {
        border-bottom-color: var(--border-color-ctrl-focus) !important;
        background-color: var(--bg-color-ctrl-default) !important;
    }

    /* Kendo adds an underline bar via ::after on focused inputs — hide it, we already use border-bottom. */
    .cn-kendo-grid .k-filter-row .k-input::after,
    .cn-kendo-grid .k-filter-row .k-textbox::after {
        display: none;
    }

/* Only hide the operator picker (the "eq / contains" dropdown that Telerik does not render).
   Kendo adds `k-operator-hidden` on the wrapper whenever the dropdown is hidden, which also
   hides the clear/funnel button next to it — override that so the funnel stays visible like
   the one in the Telerik grid's filter column header. */
.cn-kendo-grid .k-filter-row .k-dropdown-operator {
    display: none !important;
}

.cn-kendo-grid .k-filter-row .k-filtercell-wrapper.k-operator-hidden .k-filtercell-operator {
    display: inline-flex !important;
}

/* Pager — one row like .rgPager (no border-top on the live grid; the row above provides the line). */
.cn-kendo-grid .k-grid-pager,
.cn-kendo-grid .k-pager-wrap {
    background-color: var(--bg-color-ctrl_grid-head);
    color: var(--color-main_text);
    border-top: 0 none;
    padding: 5px;
}

/* Page-number buttons — RadGrid's .rgNumPart a: boxed, 1/1/2/1 border, current page gets a blue
   bottom accent via border-bottom-color = --border-color-ctrl-focus. */
.cn-kendo-grid .k-pager-numbers .k-link {
    padding: 6px;
    min-width: calc(1.4285714286em + 2px);
    color: var(--color-ctrl-default);
    background-color: var(--bg-color-ctrl-default);
    border: 1px solid var(--border-color-ctrl-default);
    border-bottom-width: 2px;
    border-radius: 0;
    box-shadow: none;
    margin: 0 1px;
}

    .cn-kendo-grid .k-pager-numbers .k-link.k-selected,
    .cn-kendo-grid .k-pager-numbers .k-link.k-state-selected {
        color: var(--color-ctrl-default);
        background-color: var(--bg-color-ctrl-default);
        border-bottom-color: var(--border-color-ctrl-focus);
    }

    .cn-kendo-grid .k-pager-numbers .k-link:hover {
        color: var(--color-ctrl-hover);
        background-color: var(--bg-color-ctrl-hover);
    }

    .cn-kendo-grid .k-pager-numbers .k-link.k-disabled {
        opacity: 0.5;
    }

/* Prev/next/first/last arrows — RadGrid shows these as plain icons without the number-button
   border/background box. Kendo renders them inside .k-pager-nav .k-button, so we flatten both. */
.cn-kendo-grid .k-pager-nav,
.cn-kendo-grid .k-pager-wrap .k-pager-nav,
.cn-kendo-grid .k-pager-nav.k-button,
.cn-kendo-grid .k-pager-nav .k-button {
    background: transparent !important;
    border: 0 none !important;
    box-shadow: none !important;
    color: var(--color-ctrl-default);
    padding: 6px;
    min-width: 0;
    margin: 0 2px;
}

    .cn-kendo-grid .k-pager-nav:hover,
    .cn-kendo-grid .k-pager-wrap .k-pager-nav:hover,
    .cn-kendo-grid .k-pager-nav.k-button:hover,
    .cn-kendo-grid .k-pager-nav .k-button:hover {
        background: var(--bg-color-ctrl-hover) !important;
        color: var(--color-ctrl-hover);
    }

    .cn-kendo-grid .k-pager-nav.k-disabled,
    .cn-kendo-grid .k-pager-nav.k-disabled .k-button {
        opacity: 0.4;
    }

/* Page-size label + dropdown — mirror the "Treffer pro Seite 8 ▼" box in RadGrid.
   Kendo renders this as .k-pager-sizes .k-dropdownlist; drop its Material underline shape
   and give it the thin 1/1/2/1 border the CnMaterial skin uses on filter inputs. */
.cn-kendo-grid .k-pager-sizes .k-dropdownlist,
.cn-kendo-grid .k-pager-sizes .k-dropdown-wrap,
.cn-kendo-grid .k-pager-sizes .k-picker {
    height: 28px;
    min-width: 56px;
    border: 1px solid var(--border-color-ctrl-default) !important;
    border-bottom-width: 2px !important;
    border-radius: 3px !important;
    background-color: var(--bg-color-ctrl-default) !important;
    box-shadow: none !important;
    color: var(--color-ctrl-default);
}

.cn-kendo-grid .k-pager-info,
.cn-kendo-grid .k-pager-sizes,
.cn-kendo-grid .k-pager-sizes .k-label {
    color: var(--color-main_text);
    font-weight: var(--font-bold);
}

/* No-records cell. */
.cn-kendo-grid .k-grid-norecords,
.cn-kendo-grid.k-grid-norecords-template {
    color: var(--color-main_text);
    padding: 20px;
    font-style: italic;
}

/* Scroll area background. */
.cn-kendo-grid .k-grid-content,
.cn-kendo-grid .k-grid-container {
    background-color: var(--bg-color-ctrl_grid);
}

/* ---------------------------------------------------------------------------
   Kendo Window — matches RadWindow_CnMaterial (see Window.CnMaterial.css).
   Three bands: titlebar (dark blue), body (white), footer strip (tinted).
   --------------------------------------------------------------------------- */
.cn-kendo-window.k-window {
    border: 1px solid var(--border-color-ctrl);
    /* RadWindow of this skin rounds the top corners only (see Window.CnMaterial.css: `border-radius: 6px 6px 0 0`). */
    border-radius: 6px 6px 0 0;
    box-shadow: 0 8px 24px 0 rgba(0, 0, 0, 0.18), 0 3px 2px 0 rgba(0, 0, 0, 0.2);
    background-color: var(--bg-color-ctrl-default);
    /* Keep the rounded corners visible when the dark titlebar fills to the edge. */
    overflow: hidden;
    /* Three stacked bands like RadWindow: titlebar + content (scrollable body) + footer. */
    display: flex;
    flex-direction: column;
    /* Safety net: when a caller forgets to pass `height` to kendoWindow(), the content area
       would otherwise flex to zero and the popup collapses to titlebar + footer. */
    min-height: 300px;
}

/* Titlebar — matches RadWindow .rwTitleBar: dark blue band, rounded top, ~34px tall.
   Zero vertical padding; the inner title / actions carry their own breathing room so the band
   matches the Telerik height (34.56px measured on the live RadWindow).
   !important + the logical padding longhands are needed because material-arctic.css drives
   titlebar padding through padding-block / padding-inline which override shorthand `padding`. */
.cn-kendo-window .k-window-titlebar,
.cn-kendo-window.k-window .k-window-titlebar {
    background-color: var(--bg-color-win-head);
    color: var(--color-win-head);
    border-bottom: 1px solid var(--border-color-ctrl);
    border-radius: 6px 6px 0 0;
    padding: 0 13px !important;
    padding-block: 0 !important;
    padding-inline: 13px !important;
    min-height: 0;
    font-weight: var(--font-bold);
}

    /* Title text — RadWindow uses `font-size: 15px; line-height: 1em; font-family: inherit`
       (see Window.CnMaterial.css, .rwTitleWrapper .rwTitle). Padding 10px/0 reaches the Telerik
       titlebar height of ~34.5px (15px font + 2×10 padding ≈ 35px). */
    .cn-kendo-window .k-window-titlebar .k-window-title,
    .cn-kendo-window .k-window-titlebar .k-window-title-text {
        color: var(--color-win-head);
        font-size: 15px;
        line-height: 1em;
        font-family: inherit;
        padding: 10px 0;
    }

    /* Actions container (close button) — Kendo lays this out as a 38px tall icon-button cluster,
       which overrides the title band's own height. Flatten it to match the title text's rhythm. */
    .cn-kendo-window .k-window-titlebar .k-window-titlebar-actions {
        height: 24px;
        min-height: 0;
    }

    /* Close "X" — same colour as the title; Kendo renders it as an SVG icon or ::before glyph. */
    .cn-kendo-window .k-window-titlebar .k-window-action,
    .cn-kendo-window .k-window-titlebar .k-window-action .k-icon,
    .cn-kendo-window .k-window-titlebar .k-window-action .k-svg-icon,
    .cn-kendo-window .k-window-titlebar .k-button-icon {
        color: var(--color-win-head);
    }

    .cn-kendo-window .k-window-titlebar .k-window-action.k-button,
    .cn-kendo-window .k-window-titlebar .k-window-action {
        width: 24px;
        height: 24px;
        min-width: 24px;
        padding: 0;
        box-shadow: none;
    }

        .cn-kendo-window .k-window-titlebar .k-window-action:hover {
            background-color: rgba(255, 255, 255, 0.15);
        }

/* Body — white, same as RadWindow .rwWindowContent. Scrolls when the inner widgets overflow.
   !important + flex-grow override Kendo's own inline `height` on the content, which would
   otherwise fill the whole window and squeeze the footer band to zero height.
   width: 100% + min-width: 0 are required because a flex item with `overflow-x: auto` grows
   to its content's natural width otherwise — which lets a wide grid push the content past
   the window's right edge and shows a white band next to the titlebar / footer bands. */
.cn-kendo-window .k-window-content {
    background-color: var(--bg-color-win-body);
    padding: 12px 14px;
    box-sizing: border-box;
    flex: 1 1 0 !important;
    min-height: 0 !important;
    height: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    overflow: auto;
    /* Firefox — thicker scrollbar so users can grab the horizontal thumb easily when
       a wide grid overflows the window. */
    scrollbar-width: auto;
    scrollbar-color: var(--border-color-ctrl, #bdbdbd) transparent;
}

/* WebKit / Chromium — style the horizontal + vertical scrollbars on .k-window-content so
   the drag thumb is thick and has visible contrast (default native bar is ~8px and
   tricky to hover when a wide grid pushes horizontal overflow). */
.cn-kendo-window .k-window-content::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.cn-kendo-window .k-window-content::-webkit-scrollbar-track {
    background: transparent;
}

.cn-kendo-window .k-window-content::-webkit-scrollbar-thumb {
    background-color: var(--border-color-ctrl, #bdbdbd);
    border-radius: 5px;
    border: 2px solid var(--bg-color-win-body, #fff);
    background-clip: padding-box;
    min-height: 32px;
    min-width: 32px;
}

    .cn-kendo-window .k-window-content::-webkit-scrollbar-thumb:hover {
        background-color: var(--color-main_text, #757575);
    }

.cn-kendo-window .k-window-content::-webkit-scrollbar-corner {
    background: transparent;
}

/* Breathing room between the grid pager and the window's horizontal scrollbar — without
   this the pager row sits flush against the scroll track and users can't tell them apart
   or grab the thumb cleanly. */
.cn-kendo-window .k-window-content > .cn-kendo-grid,
.cn-kendo-window .k-window-content > div > .cn-kendo-grid {
    /*margin-bottom: 4px;*/
}

/* Footer band — RadWindow shows a tinted strip under the body (same tone as .rwFooter).
   Rendered as a real sibling div `.cn-kendo-footer` injected in script after kendoWindow init,
   so it stays pinned at the bottom of the window and the body above can scroll independently. */
.cn-kendo-footer {
    flex: 0 0 auto;
    height: 48px;
    background-color: var(--bg-color-win-foot);
    border-top: 1px solid var(--border-color-ctrl);
}

/* Search box inside the window — same box as rfdTextInput of CnMaterial. */
.cn-kendo-window .k-window-content input.k-input,
.cn-kendo-window .k-window-content input.k-textbox,
.cn-kendo-window .k-window-content input[type="text"] {
    box-sizing: border-box;
    padding: 8px 10px 7px 10px;
    color: var(--color-main_text);
    background-color: var(--bg-color-ctrl-default);
    border: 1px solid var(--border-color-ctrl-default);
    border-width: 1px 1px 2px 1px;
    border-radius: 0;
    box-shadow: none;
    outline: none;
    line-height: var(--line-height);
    font-size: var(--font-size);
}

    .cn-kendo-window .k-window-content input.k-input:focus,
    .cn-kendo-window .k-window-content input.k-textbox:focus,
    .cn-kendo-window .k-window-content input[type="text"]:focus {
        border-bottom-color: var(--border-color-ctrl-focus);
        background-color: #f5f5f5;
    }
