/* ═══════════════════════════════════════════════════════════════════════════════════════════════
   lucpac-grid.css — one look for every TelerikGrid in Lucpac.App, Lucpac.AdminApp and
   Lucpac.TenantAdminApp. Restyles Kendo's own classes only: no grid's markup, columns, editing,
   grouping, filtering, paging or exports change.

   Linked by every host AFTER lucpac-tokens.css (same three places as the token sheet):
     Lucpac.App/wwwroot/index.html, Lucpac.AdminApp/UIInfrastructure/App.razor,
     Lucpac.TenantAdminApp/Components/App.razor

   Decisions, 2026-10-23: header 1c (mist, navy rule); action buttons icon-only with the label as
   tooltip; the command column locked at the right; loader 1c (sweeping bar + the mark drawing itself).
   ═══════════════════════════════════════════════════════════════════════════════════════════════ */

/* ── Frame ─────────────────────────────────────────────────────────────────────────────────── */
.k-grid {
    font-family: var(--lucpac-font-body);
    color: var(--lucpac-ink);
    background: var(--lucpac-paper);
    border-color: var(--lucpac-line);
    border-radius: var(--lucpac-radius);
}
.k-grid .k-table { font-size: 14px; }
/* Every column is at least its Width. Kendo makes the tables width: 100% with table-layout: fixed, so
   when the columns add up to less than the grid the browser stretches every one of them in proportion -
   a 160 px action column on Tenants drew at ~330 px. min-content keeps the fixed layout (auto or
   max-content fall back to auto layout, where columns grow with their text and shrink below their
   Width in a narrow grid) and makes the table the sum of its columns; a narrow grid scrolls with the
   action column still pinned. A wide grid is filled by js/grid-fill.js, which widens only the main text
   column (the widest data column), so the action column stays exactly its Width (2026-10-27). */
.k-grid .k-grid-header .k-table,
.k-grid .k-grid-content .k-table,
.k-grid .k-grid-footer .k-table { width: min-content; }
.k-grid .k-table-td,
.k-grid td { border-color: var(--lucpac-line-soft); }

/* ── Header: 1c — mist ground, 2 px navy rule, tracked capitals ─────────────────────────────── */
.k-grid .k-grid-header,
.k-grid .k-table-thead,
.k-grid .k-grid-header .k-table-th,
.k-grid th {
    background: var(--lucpac-mist);
    color: var(--lucpac-navy);
    border-color: var(--lucpac-line);
}
.k-grid .k-grid-header { border-top: 2px solid var(--lucpac-navy); border-bottom: 2px solid var(--lucpac-navy); }
.k-grid .k-grid-header .k-table-th,
.k-grid .k-grid-header th { padding: 10px 12px; vertical-align: middle; }
.k-grid .k-grid-header .k-column-title {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
}
.k-grid .k-grid-header .k-sort-icon,
.k-grid .k-grid-header .k-sort-order,
.k-grid .k-grid-header .k-svg-icon { color: var(--lucpac-navy); }
/* The other two headers from the review, should the pick change:
   1a — white:      .k-grid .k-grid-header, .k-grid .k-table-th { background: #FFF; }
                    .k-grid .k-grid-header { border-bottom: 1px solid #C9D1DE; }
                    .k-grid .k-grid-header .k-column-title { font-size: 13.5px; letter-spacing: 0; text-transform: none; }
   1b — navy band:  .k-grid .k-grid-header, .k-grid .k-table-th { background: var(--lucpac-navy); color: #FFF; }
                    .k-grid .k-grid-header { border-bottom: 2px solid var(--lucpac-sky); }
                    .k-grid .k-grid-header .k-sort-icon { color: var(--lucpac-sky); }
                    .k-grid .k-grid-header .k-column-title { font-size: 13.5px; letter-spacing: 0; text-transform: none; } */

/* Header filter / column-menu buttons */
.k-grid .k-grid-header .k-grid-header-menu,
.k-grid .k-grid-header .k-grid-filter {
    color: var(--lucpac-navy);
    border-radius: var(--lucpac-radius);
}
.k-grid .k-grid-header .k-grid-header-menu:hover,
.k-grid .k-grid-header .k-grid-filter:hover { background: var(--lucpac-sky-tint); }
.k-grid .k-grid-header .k-grid-header-menu.k-active,
.k-grid .k-grid-header .k-grid-filter.k-active {
    background: var(--lucpac-navy);
    color: var(--lucpac-on-navy);
}

/* ── Rows: hairlines, a hover tint, the selected row in Sky tint ───────────────────────────── */
.k-grid .k-table-td { padding: 10px 12px; vertical-align: middle; }
/* A grid inside a detail row lost the padding to a more specific Kendo rule - 36 px rows against 40 on
   every page grid (audit, 2026-10-27). */
.k-grid .k-detail-cell .k-grid .k-table-td:not(.k-command-cell) { padding: 10px 12px; }
/* ... and its titles lost to a Kendo rule that leaves 12 px beside a nested header's title, which cuts a
   title sized to title + 45 (re-audit, 2026-10-27). */
.k-grid .k-detail-cell .k-grid .k-grid-header .k-cell-inner .k-link { padding-inline-end: 0; }
/* One line per row, every row the same height: text that does not fit its column ends in an ellipsis,
   and js/grid-cell-title.js puts the full text in the cell's tooltip. Data rows only - a group header,
   a detail row, a row being edited and the action column keep their own layout. */
.k-grid .k-master-row:not(.k-grid-edit-row) > .k-table-td:not(.k-command-cell):not(.k-hierarchy-cell):not(.k-group-cell) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Row colours are painted on the CELLS, pinned or not, one rule per state (2026-10-27). Kendo paints a
   pinned (sticky) cell itself - white, grey on a striped row, grey on hover, and a 25% navy overlay
   (::before) when selected - while an ordinary cell shows the row behind it, so a pinned column never
   matched the rest of its row. Each rule below is at least as specific as Kendo's for that state and
   this sheet loads after Kendo's, so ties fall to it. Striped rows are `k-table-alt-row` in Telerik 15
   (there is no `k-alt`), and the stripe is a navy tint rather than Kendo's 5% grey. */
.k-grid .k-grid-content .k-master-row.k-table-row > .k-table-td:not(.k-group-cell) {
    background-color: var(--lucpac-paper);
}
.k-grid .k-grid-content .k-master-row.k-table-alt-row > .k-table-td:not(.k-group-cell) {
    background-color: var(--lucpac-row-stripe);
}
.k-grid .k-grid-content .k-master-row.k-table-row:is(:hover, .k-hover) > .k-table-td:not(.k-group-cell) {
    background-color: var(--lucpac-hover);
}
.k-grid .k-grid-content .k-master-row.k-table-row.k-selected > .k-table-td:not(.k-group-cell) {
    background-color: var(--lucpac-sky-tint);
    color: var(--lucpac-navy-deep);
}
.k-grid .k-master-row.k-table-row.k-selected .k-grid-content-sticky::before,
.k-grid .k-master-row.k-table-row .k-selected.k-table-td.k-grid-content-sticky::before { background-color: transparent; }
.k-grid .k-hierarchy-cell .k-svg-icon { color: var(--lucpac-navy); }

/* ── Grouping: the drop strip, chips and group rows ────────────────────────────────────────── */
.k-grid .k-grouping-header {
    background: var(--lucpac-mist-soft);
    border-color: var(--lucpac-line);
    color: var(--lucpac-text-muted);
    font-size: 13px;
    padding: 7px 12px;
}
.k-grid .k-grouping-header .k-chip,
.k-grid .k-grouping-header .k-group-indicator {
    background: var(--lucpac-paper);
    border: 1px solid var(--lucpac-control-border);
    border-radius: var(--lucpac-radius);
    color: var(--lucpac-navy);
    font-weight: 500;
}
.k-grid .k-grouping-row .k-table-td,
.k-grid .k-grouping-row td,
.k-grid .k-group-cell {
    background: var(--lucpac-mist);
    color: var(--lucpac-navy);
    font-weight: 600;
}
.k-grid .k-grouping-row .k-svg-icon { color: var(--lucpac-navy); }
.k-grid .k-group-footer .k-table-td,
.k-grid .k-group-footer td { background: var(--lucpac-mist-soft); }

/* ── Status badges in cells ──────────────────────────────────────────────────────────────────────
   A TelerikBadge's ThemeColor drew Kendo's stock fills - saturated blue, green, orange, red - in the
   middle of an otherwise navy-and-mist grid (audit, 2026-10-27). Same meaning, brand tints: a pale
   fill with the strong colour as text, as the danger chip already does. Telerik 15 names the colour
   alone (k-badge-info), with no fill-mode class to match. */
.k-grid .k-badge {
    border-radius: var(--lucpac-radius);
    border-color: transparent;
    font-family: var(--lucpac-font-body);
    font-weight: 600;
}
.k-grid .k-badge-primary   { background: var(--lucpac-navy); color: var(--lucpac-on-navy); }
.k-grid .k-badge-info      { background: var(--lucpac-sky-tint); color: var(--lucpac-navy); }
.k-grid .k-badge-success   { background: color-mix(in srgb, var(--lucpac-success) 14%, transparent); color: var(--lucpac-success); }
.k-grid .k-badge-warning   { background: color-mix(in srgb, var(--lucpac-warning) 16%, transparent); color: var(--lucpac-warning); }
.k-grid .k-badge-error     { background: var(--lucpac-danger-bg); color: var(--lucpac-danger); }
.k-grid .k-badge-tertiary,
.k-grid .k-badge-secondary,
.k-grid .k-badge-base      { background: var(--lucpac-mist); color: var(--lucpac-text-muted); }

/* ── Toolbar ───────────────────────────────────────────────────────────────────────────────── */
.k-grid .k-grid-toolbar,
.k-grid .k-toolbar,
.work-queue-toolbar.k-toolbar {
    background: var(--lucpac-paper);
    border-color: var(--lucpac-line);
    padding: 8px 10px;
    gap: 6px;
}
/* Telerik 15 puts the toolbar's buttons inside .k-toolbar-items, whose own gap (8 px) is what spaces
   them - the 6 px on the toolbar above reaches only that one wrapper (audit, 2026-10-27). */
.k-grid .k-grid-toolbar .k-toolbar-items,
.work-queue-toolbar .k-toolbar-items { gap: 6px; }

/* The standard toolbar's layout: the toolbar-spacer grows to push the search box and Set / Reset to the
   right end. These lived in AdminApp's app.css only, so on every TenantAdminApp grid search and Set /
   Reset sat straight after the export toggle; here both apps get them. */
.k-grid .k-grid-toolbar { display: flex; align-items: center; flex-wrap: wrap; }
/* In a narrow grid (a list beside a detail panel) the toolbar wraps onto a second line rather than
   becoming a scrolling strip with the search cut and Set / Reset out of sight (re-audit, 2026-10-27). */
.k-grid .k-grid-toolbar.k-toolbar-scrollable { overflow: visible; }
.k-grid .k-grid-toolbar .k-toolbar-items { flex-wrap: wrap; row-gap: 6px; }
.k-grid .k-grid-toolbar .toolbar-spacer { flex: 1 1 auto; }
.k-grid .k-grid-toolbar .grid-search-right,
.k-grid .k-grid-toolbar .k-grid-search { width: 320px; max-width: 100%; }
.k-grid .k-grid-toolbar .k-button,
.work-queue-toolbar .k-button {
    border-radius: var(--lucpac-radius);
    border-color: var(--lucpac-control-border);
    background: var(--lucpac-paper);
    color: var(--lucpac-navy);
    box-shadow: none;
}
.k-grid .k-grid-toolbar .k-button:hover,
.k-grid .k-grid-toolbar .k-button.k-hover,
.work-queue-toolbar .k-button:hover {
    background: var(--lucpac-sky-tint);
    border-color: var(--lucpac-control-border-hover);
    color: var(--lucpac-navy-deep);
}
.k-grid .k-grid-toolbar .k-button .k-svg-icon,
.work-queue-toolbar .k-button .k-svg-icon { color: inherit; }

/* Icon only. The label stays in the markup - it is the title and the accessible name - but is
   not drawn, on every button that carries a glyph. A button with no glyph keeps its text, so
   nothing can turn into an empty square. */
.k-grid .k-grid-toolbar .k-button:has(.k-svg-icon, .k-icon) .k-button-text,
.k-grid .k-command-cell .k-button:has(.k-svg-icon, .k-icon) .k-button-text,
.work-queue-toolbar .k-button:has(.k-svg-icon, .k-icon) .k-button-text { display: none; }
.k-grid .k-grid-toolbar .k-button:has(.k-svg-icon, .k-icon),
.work-queue-toolbar .k-button:has(.k-svg-icon, .k-icon) {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    justify-content: center;
    gap: 0;
}

/* The one solid button: Add / New / Request / Claim next - every one is ThemeColor Primary. Telerik 15
   renders that as `k-button k-button-primary` and leaves the default fill out of the class list, so
   neither `k-button-solid-primary` nor a `k-grid-add-command` class exists to match. */
.k-grid .k-grid-toolbar .k-button.k-button-primary:not(.k-button-outline):not(.k-button-flat),
.work-queue-toolbar .k-button.k-button-primary:not(.k-button-outline):not(.k-button-flat),
.work-queue-toolbar .k-toggle-button.k-selected,
.k-grid .k-grid-toolbar .k-toggle-button.k-selected {
    background: var(--lucpac-navy);
    border-color: var(--lucpac-navy);
    color: var(--lucpac-on-navy);
}
.k-grid .k-grid-toolbar .k-button.k-button-primary:not(.k-button-outline):not(.k-button-flat):hover,
.work-queue-toolbar .k-button.k-button-primary:not(.k-button-outline):not(.k-button-flat):hover {
    background: var(--lucpac-navy-deep);
    border-color: var(--lucpac-navy-deep);
    color: var(--lucpac-on-navy);
}

/* Export scope (GridDataExportToggler): the selected half is solid navy. The Info theme colour the
   component asks for (`k-button-outline k-button-info`) is neutralised by the toolbar button rules
   above, which outrank Kendo's; only the selected half needs a rule of its own. */
.k-grid .k-grid-toolbar .k-button-group { gap: 0; }
.k-grid .k-grid-toolbar .k-button-group .k-button.k-selected {
    background: var(--lucpac-navy);
    border-color: var(--lucpac-navy);
    color: var(--lucpac-on-navy);
}

/* Search */
.k-grid .k-grid-toolbar .k-grid-search,
.k-grid .k-grid-toolbar .k-textbox {
    height: 32px;
    border-color: var(--lucpac-control-border);
    border-radius: var(--lucpac-radius);
    box-shadow: none;
}
.k-grid .k-grid-toolbar .k-grid-search:focus-within { border-color: var(--lucpac-navy); box-shadow: var(--lucpac-focus-ring); }

/* Layout Set / Reset (GridLayoutButtons): outlined like the rest, which the toolbar button rules above
   already draw. They are FillMode Outline rather than Flat because Kendo's theme forces every flat
   button transparent with !important (`.k-button.k-button-flat`), which no selector outranks. Reset
   keeps ThemeColor Error (`k-button-error`) and is navy at rest; it turns red only on hover. */
.k-grid .k-grid-toolbar .k-button.grid-layout-btn.k-button-error {
    background: var(--lucpac-paper);
    border-color: var(--lucpac-control-border);
    color: var(--lucpac-navy);
}
.k-grid .k-grid-toolbar .k-button.grid-layout-btn.k-button-error:hover,
.k-grid .k-grid-toolbar .k-button.grid-layout-btn.k-button-error.k-hover {
    color: var(--lucpac-danger);
    background: var(--lucpac-danger-bg);
    border-color: var(--lucpac-danger-border);
}

/* ── Command column: ghost icon buttons, right-aligned, pinned ─────────────────────────────── */
.k-grid .k-command-cell {
    white-space: nowrap;
    padding: 0 8px;
    text-align: right;
}
.k-grid .k-command-cell .k-button {
    width: 30px;
    height: 30px;
    min-width: 30px;
    padding: 0;
    margin: 0 1px;
    border: 0;
    border-radius: var(--lucpac-radius);
    background: transparent;
    color: var(--lucpac-navy);
    box-shadow: none;
    vertical-align: middle;
}
.k-grid .k-command-cell .k-button:has(.k-svg-icon, .k-icon) { gap: 0; justify-content: center; }
.k-grid .k-command-cell .k-button:not(:has(.k-svg-icon, .k-icon)) { width: auto; padding: 0 8px; } /* text-only buttons, until they get a glyph */
.k-grid .k-command-cell .k-button:hover,
.k-grid .k-command-cell .k-button.k-hover { background: var(--lucpac-sky-tint); color: var(--lucpac-navy-deep); }
/* Delete. Telerik 15 gives a command button no class naming its command, so the trash glyph is the
   only mark it carries. */
.k-grid .k-command-cell .k-button:has(.k-svg-i-trash):hover,
.k-grid .k-command-cell .k-button.k-hover:has(.k-svg-i-trash) {
    background: var(--lucpac-danger-bg);
    color: var(--lucpac-danger);
}
.k-grid .k-command-cell .k-button .k-svg-icon { color: inherit; }

/* Locked (pinned) columns: a hairline and a soft shadow on the inner edge. The side cannot be read off
   the inline position - Telerik 15 writes BOTH left: and right: on every pinned cell, so a rule per
   side matched every cell and the later one won: the action column's shadow fell on its outer edge
   (2026-10-27). The action column is the one pinned right: the command cell, and the last header. */
.k-grid .k-grid-content-sticky,
.k-grid .k-grid-header-sticky,
.k-grid .k-grid-content-locked,
.k-grid .k-grid-header-locked { border-color: var(--lucpac-line); }
/* The row line under a pinned cell is the row's own hairline, not the column edge's grey - it showed as a
   darker break in every row on any grid with a locked column (re-audit, 2026-10-27). */
.k-grid .k-table-td.k-grid-content-sticky { border-block-color: var(--lucpac-line-soft); }
.k-grid .k-table-td.k-grid-content-sticky:not(.k-command-cell),
.k-grid .k-table-th.k-grid-header-sticky:not(:last-child) { box-shadow: 8px 0 10px -8px color-mix(in srgb, var(--lucpac-navy-deep) 25%, transparent); }
.k-grid .k-table-td.k-grid-content-sticky.k-command-cell,
.k-grid .k-table-th.k-grid-header-sticky:last-child { box-shadow: -8px 0 10px -8px color-mix(in srgb, var(--lucpac-navy-deep) 25%, transparent); }

/* ── Filter row, filter and column menus ───────────────────────────────────────────────────── */
.k-grid .k-filter-row .k-table-td,
.k-grid .k-filter-row td { background: var(--lucpac-mist-soft); border-color: var(--lucpac-line); }
.k-grid .k-filter-row .k-textbox,
.k-grid .k-filter-row .k-picker,
.k-grid .k-filter-row .k-input { border-color: var(--lucpac-control-border); border-radius: var(--lucpac-radius); }
.k-column-menu,
.k-filter-menu,
.k-grid-columnmenu-popup {
    font-family: var(--lucpac-font-body);
    border-color: var(--lucpac-line);
    border-radius: var(--lucpac-radius);
}
.k-column-menu .k-columnmenu-item.k-selected,
.k-column-menu .k-columnmenu-item:hover { background: var(--lucpac-sky-tint); color: var(--lucpac-navy); }

/* ── Pager ─────────────────────────────────────────────────────────────────────────────────── */
.k-grid .k-pager,
.k-grid .k-grid-pager {
    background: var(--lucpac-paper);
    border-color: var(--lucpac-line);
    color: var(--lucpac-text-muted);
    padding: 8px 12px;
    font-size: 13px;
}
.k-pager .k-button {
    border-radius: var(--lucpac-radius);
    color: var(--lucpac-ink);
    box-shadow: none;
}
.k-pager .k-pager-nav.k-button { color: var(--lucpac-navy); }
.k-pager .k-button:hover,
.k-pager .k-button.k-hover { background: var(--lucpac-sky-tint); color: var(--lucpac-navy-deep); }
.k-pager .k-pager-numbers .k-button.k-selected,
.k-pager .k-pager-numbers .k-button.k-selected:hover {
    background: var(--lucpac-navy);
    color: var(--lucpac-on-navy);
}
.k-pager .k-picker,
.k-pager .k-dropdownlist,
.k-pager .k-textbox,
.k-pager .k-numerictextbox {
    height: 30px;
    border-color: var(--lucpac-control-border);
    border-radius: var(--lucpac-radius);
    box-shadow: none;
}

/* ── Loading: 1c — a Sky Steel bar sweeping along the top edge and the LP mark drawing itself at
   the centre (one pen from the top of the L, then the same stroke backwards), on a light veil. The
   draw lives inside lucpac-mark-draw.svg, keyframes and reduced motion included, so it animates as
   a background image. Covers the grid's own loader and the page-level TelerikLoaderContainer
   (same classes); the small inline TelerikLoader in dialogs keeps Kendo's dots, in navy.
   .grid-loading is the same loader drawn by GridNoData while a grid's first load runs: it sits in
   the no-records row, so the bar sweeps directly under the column headers and the mark draws
   where the rows will be. Telerik's own container never shows for a grid bound with Data=. ──── */
.k-loader-container {
    overflow: hidden;
    background: transparent;
}
.k-loader-container .k-loader-container-overlay {
    background: var(--lucpac-paper);
    opacity: .72;
}
.k-loader-container .k-loader-container-panel {
    background: transparent;
    border: 0;
    box-shadow: none;
}
.k-loader-container .k-loader-container-inner .k-loader { display: none; }
.k-loader-container::before,
.k-loader-container::after,
.grid-loading::before,
.grid-loading::after {
    content: "";
    position: absolute;
    top: 0;
    height: 3px;
    z-index: 1;
}
.k-loader-container::before,
.grid-loading::before { left: 0; right: 0; background: var(--lucpac-sky-tint); }
.k-loader-container::after,
.grid-loading::after {
    left: -34%;
    width: 30%;
    border-radius: 2px;
    background: var(--lucpac-sky);
    animation: lucpac-loader-bar 1.4s cubic-bezier(.4, 0, .2, 1) infinite;
}
.k-loader-container .k-loader-container-inner::before,
.grid-loading .grid-loading-mark {
    content: "";
    display: block;
    width: 64px;
    height: 70px;
    background: url("../Images/lucpac-mark-draw.svg") center / contain no-repeat;
}
.k-loader-container .k-loader-container-label { color: var(--lucpac-text-muted); font-family: var(--lucpac-font-body); }
.k-grid .k-grid-norecords:has(.grid-loading),
.k-grid .k-grid-norecords:has(.grid-loading) > td,
.k-grid .k-grid-norecords :has(> .grid-loading) { padding: 0; }
.grid-loading {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    overflow: hidden;
}
.grid-loading .grid-loading-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
@keyframes lucpac-loader-bar {
    0% { left: -34%; }
    100% { left: 104%; }
}
@media (prefers-reduced-motion: reduce) {
    .k-loader-container::after,
    .grid-loading::after { animation: none; left: 0; width: 100%; }
}
