/*!
 * Xceler8 UI layer (DEC-066, .ai/rules/ui.md): shared look for the enhanced widgets + responsive
 * safety net. Tabler variables only (light / dark safe). Loaded on every admin page.
 */

/* DEC-083 configurable site logo (setting branding.logo) */
.xl-site-logo { height: 30px; width: auto; max-width: 180px; object-fit: contain; }
.xl-site-brand-text { font-weight: 700; font-size: 1.05rem; color: var(--tblr-body-color); white-space: nowrap; letter-spacing: .01em; }
.xl-site-logo-lg { height: 56px; max-width: 260px; }

:root {
    --xl-radius: var(--tblr-border-radius, 6px);
    --xl-radius-lg: var(--tblr-border-radius-lg, 8px);
    --xl-border: var(--tblr-border-color, rgba(98, 105, 118, .16));
    --xl-surface: var(--tblr-bg-surface, #fff);
    --xl-surface-2: var(--tblr-bg-surface-secondary, var(--tblr-body-bg));
    --xl-muted: var(--tblr-secondary, #667382);
    --xl-primary: var(--tblr-primary, #066fd1);
    --xl-danger: var(--tblr-danger, #d63939);
    --xl-success: var(--tblr-success, #2fb344);
    --xl-shadow: 0 8px 24px rgba(0, 0, 0, .08), 0 2px 6px rgba(0, 0, 0, .04);
    --xl-touch: 2.5rem;
}

/* ── Drop-zone ─────────────────────────────────────────────────────────────── */
.xl-dropzone { position: relative; }
.xl-dropzone-input { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0; pointer-events: none; }
.xl-dropzone-target {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem;
    min-height: 7rem; padding: 1rem; text-align: center; cursor: pointer;
    border: 1.5px dashed var(--xl-border); border-radius: var(--xl-radius-lg);
    background: var(--xl-surface-2); color: var(--tblr-body-color);
    transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.xl-dropzone-target:hover, .xl-dropzone-target:focus-visible { border-color: var(--xl-primary); outline: none; box-shadow: 0 0 0 .2rem rgba(var(--tblr-primary-rgb, 6, 111, 209), .12); }
.xl-dropzone.is-dragover .xl-dropzone-target { border-color: var(--xl-primary); background: rgba(var(--tblr-primary-rgb, 6, 111, 209), .06); }
.xl-dropzone-icon { font-size: 1.9rem; line-height: 1; color: var(--xl-primary); }
.xl-dropzone-text { font-size: .9rem; }
.xl-dropzone-hint { font-size: .75rem; color: var(--xl-muted); }
.xl-link { color: var(--xl-primary); text-decoration: underline; text-underline-offset: 2px; }
.xl-dropzone.has-files .xl-dropzone-target { min-height: 3.25rem; padding: .55rem; }
.xl-dropzone.has-files .xl-dropzone-icon { font-size: 1.25rem; }
.xl-dropzone.has-files .xl-dropzone-hint { display: none; }
.xl-dropzone-list { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .4rem; }
.xl-dropzone-item {
    display: flex; align-items: center; gap: .6rem; padding: .4rem .5rem;
    border: 1px solid var(--xl-border); border-radius: var(--xl-radius); background: var(--xl-surface);
}
.xl-dropzone-item.is-rejected { color: var(--xl-danger); border-color: rgba(var(--tblr-danger-rgb, 214, 57, 57), .35); font-size: .85rem; }
.xl-dropzone-item.is-done { border-color: rgba(var(--tblr-success-rgb, 47, 179, 68), .45); }
.xl-dropzone-item.is-failed { border-color: rgba(var(--tblr-danger-rgb, 214, 57, 57), .45); }
.xl-dropzone-thumb {
    flex: 0 0 2.5rem; width: 2.5rem; height: 2.5rem; border-radius: var(--xl-radius); overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center; background: var(--xl-surface-2); font-size: 1.35rem; color: var(--xl-muted);
}
.xl-dropzone-thumb img { width: 100%; height: 100%; object-fit: cover; }
.xl-dropzone-meta { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.xl-dropzone-name { font-size: .85rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xl-dropzone-size, .xl-dropzone-error { font-size: .72rem; color: var(--xl-muted); }
.xl-dropzone-error { color: var(--xl-danger); }
.xl-dropzone-progress { display: block; height: 4px; margin-top: .3rem; border-radius: 2px; background: var(--xl-surface-2); overflow: hidden; }
.xl-dropzone-progress > span { display: block; width: 0; height: 100%; background: var(--xl-primary); transition: width .2s; }
.xl-dropzone-remove { flex: 0 0 auto; min-width: 2.25rem; min-height: 2.25rem; }
.xl-dropzone-actions { margin-top: .5rem; display: flex; justify-content: flex-end; }
.xl-dropzone.is-uploading .xl-dropzone-target { opacity: .6; pointer-events: none; }
.xl-dropzone.is-uploading .xl-dropzone-target::after { content: 'Uploading…'; font-size: .8rem; color: var(--xl-muted); }

/* ── Select2 on Tabler ─────────────────────────────────────────────────────── */
html body .select2-container { max-width: 100%; }
html body .select2-container--default .select2-selection--single,
html body .select2-container--default .select2-selection--multiple {
    min-height: calc(1.4285714em + .875rem + 2px); border: 1px solid var(--xl-border); border-radius: var(--xl-radius);
    background: var(--xl-surface); color: var(--tblr-body-color);
}
html body .select2-container--default .select2-selection--single { height: auto; padding: .28rem 0; }
html body .select2-container--default .select2-selection--single .select2-selection__rendered { color: var(--tblr-body-color); line-height: 1.6; padding-left: .75rem; padding-right: 2rem; }
html body .select2-container--default .select2-selection--single .select2-selection__arrow { height: 100%; }
html body .select2-container--default .select2-selection--multiple { padding: .2rem .5rem; display: flex; align-items: center; }
/* owner 10-10: many chips never grow the field past ~3 lines; the rest scroll inside the box */
html body .select2-container--default .select2-selection--multiple { max-height: 5.75rem; overflow-y: auto; align-items: flex-start; }
html body .select2-container--default .select2-selection--multiple .select2-selection__rendered { display: inline; }
html body .select2-container--default .select2-search--inline .select2-search__field, html body .select2-container--default .select2-selection__placeholder { font-size: .875rem; color: var(--xl-muted); }
html body .select2-container--default .select2-selection--multiple .select2-selection__choice {
    display: inline-flex; align-items: center; gap: .25rem; margin: .15rem .25rem .15rem 0; padding: .1rem .45rem .1rem .2rem;
    border: 0; border-radius: 999px; background: rgba(var(--tblr-primary-rgb, 6, 111, 209), .1); color: var(--tblr-body-color); font-size: .8rem;
}
html body .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    position: static; border: 0; padding: 0 .2rem; color: var(--xl-muted); background: transparent;
}
html body .select2-container--default .select2-search--inline .select2-search__field { margin-top: .3rem; font-family: inherit; color: var(--tblr-body-color); }
html body .select2-container--default.select2-container--focus .select2-selection--multiple,
html body .select2-container--default.select2-container--open .select2-selection { border-color: var(--xl-primary); box-shadow: 0 0 0 .2rem rgba(var(--tblr-primary-rgb, 6, 111, 209), .12); }
html body .xl-select2-sm { min-height: calc(1.4285714em + .5rem + 2px) !important; font-size: .8rem; }
html body .select2-dropdown { border-color: var(--xl-border); border-radius: var(--xl-radius); background: var(--xl-surface); color: var(--tblr-body-color); box-shadow: var(--xl-shadow); overflow: hidden; }
html body .select2-container--default .select2-search--dropdown .select2-search__field { border: 1px solid var(--xl-border); border-radius: var(--xl-radius); background: var(--xl-surface); color: var(--tblr-body-color); }
/* owner 10-10: a highlighted option is always the primary colour with its own foreground (selected or not); a selected
   option that is not highlighted keeps the pale tint with body text — never white text on the pale tint */
html body .select2-container--default .select2-results__option--highlighted,
html body .select2-container--default .select2-results__option--highlighted[aria-selected],
html body .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable,
html body .select2-container--default .select2-results__option--highlighted.select2-results__option--selected { background: var(--tblr-primary); color: var(--tblr-primary-fg, var(--tblr-white)); }
html body .select2-container--default .select2-results__option--selected:not(.select2-results__option--highlighted),
html body .select2-container--default .select2-results__option[aria-selected=true]:not(.select2-results__option--highlighted) { background: rgba(var(--tblr-primary-rgb, 6, 111, 209), .08); color: var(--tblr-body-color); }
html body .select2-results__option { padding: .45rem .75rem; }

/* ── flatpickr on Tabler ───────────────────────────────────────────────────── */
.flatpickr-calendar { border-radius: var(--xl-radius-lg); box-shadow: var(--xl-shadow); border: 1px solid var(--xl-border); background: var(--xl-surface); max-width: calc(100vw - 16px); }
.flatpickr-day.selected, .flatpickr-day.selected:hover { background: var(--xl-primary); border-color: var(--xl-primary); }
input.xl-date { background-image: none; cursor: pointer; }

/* ── Notification centre (user menu, DEC-102) ───────────────────────────────────── */
.xl-bell > .nav-link { position: relative; display: inline-flex; align-items: center; justify-content: center; width: var(--xl-touch); height: var(--xl-touch); border-radius: 999px; }
.xl-bell > .nav-link:hover { background: var(--xl-surface-2); }
.xl-bell-badge { position: absolute; top: .15rem; right: .1rem; min-width: 1.1rem; height: 1.1rem; padding: 0 .3rem; border-radius: 999px; font-size: .65rem; line-height: 1.1rem; font-weight: 600; text-align: center; color: #fff; background: var(--xl-primary); box-shadow: 0 0 0 2px var(--xl-surface); }
.xl-bell-badge.is-alert { background: var(--xl-danger); }
.xl-panel { width: 24rem; max-width: calc(100vw - 16px); padding: 0; border: 1px solid var(--xl-border); border-radius: var(--xl-radius-lg); box-shadow: var(--xl-shadow); overflow: hidden; background: var(--xl-surface); }
.xl-panel-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .75rem 1rem .5rem; }
.xl-panel-title { font-weight: 600; font-size: .95rem; }
.xl-panel-tabs { display: flex; gap: .25rem; padding: 0 .75rem .5rem; border-bottom: 1px solid var(--xl-border); }
.xl-panel-tab { flex: 1 1 0; border: 0; background: transparent; padding: .4rem .5rem; border-radius: var(--xl-radius); font-size: .8rem; color: var(--xl-muted); display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 2.25rem; }
.xl-panel-tab.active { background: var(--xl-surface-2); color: var(--tblr-body-color); font-weight: 600; }
.xl-panel-tab .xl-count { font-size: .68rem; padding: 0 .35rem; border-radius: 999px; background: var(--xl-surface-2); }
.xl-panel-tab.active .xl-count { background: var(--xl-primary); color: #fff; }
.xl-panel-list { max-height: min(60vh, 26rem); overflow-y: auto; }
.xl-panel-item { position: relative; display: flex; gap: .75rem; padding: .7rem 1rem; text-decoration: none; color: inherit; border-bottom: 1px solid var(--xl-border); }
.xl-panel-item:hover { background: var(--xl-surface-2); }
.xl-panel-item .xl-dot { position: absolute; left: .4rem; top: 1.05rem; width: .4rem; height: .4rem; border-radius: 50%; background: var(--xl-primary); }
.xl-panel-icon { flex: 0 0 2.25rem; width: 2.25rem; height: 2.25rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; }
.xl-panel-icon.is-N { background: rgba(var(--tblr-primary-rgb, 6, 111, 209), .1); color: var(--xl-primary); }
.xl-panel-icon.is-A { background: rgba(var(--tblr-danger-rgb, 214, 57, 57), .1); color: var(--xl-danger); }
.xl-panel-icon.is-M { background: rgba(var(--tblr-success-rgb, 47, 179, 68), .12); color: var(--xl-success); }
.xl-panel-body { min-width: 0; flex: 1 1 auto; }
.xl-panel-body strong { display: block; font-size: .85rem; font-weight: 600; }
.xl-panel-body p { margin: .1rem 0 0; font-size: .8rem; color: var(--xl-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.xl-panel-body time { font-size: .72rem; color: var(--xl-muted); }
.xl-panel-read { align-self: center; flex: 0 0 auto; width: 2rem; height: 2rem; border: 0; border-radius: 50%; background: transparent; color: var(--xl-muted); }
.xl-panel-read:hover { background: var(--xl-surface); color: var(--xl-primary); }
.xl-panel-empty { padding: 2.5rem 1rem; text-align: center; color: var(--xl-muted); font-size: .85rem; }
.xl-panel-empty i { display: block; font-size: 2rem; margin-bottom: .35rem; opacity: .6; }
.xl-panel-foot { display: block; padding: .6rem; text-align: center; font-size: .82rem; font-weight: 500; text-decoration: none; }
.xl-panel-foot:hover { background: var(--xl-surface-2); }

/* ── Chat / timeline bubbles ───────────────────────────────────────────────── */
.xl-timeline { display: grid; gap: .9rem; }
.xl-timeline-item { display: flex; gap: .65rem; }
.xl-timeline-item.is-reply { margin-left: 2.5rem; }
.xl-timeline-avatar { flex: 0 0 2rem; width: 2rem; height: 2rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--xl-surface-2); color: var(--xl-muted); font-size: .95rem; }
.xl-timeline-item.is-remark .xl-timeline-avatar { background: rgba(var(--tblr-primary-rgb, 6, 111, 209), .1); color: var(--xl-primary); }
.xl-timeline-content { min-width: 0; flex: 1 1 auto; }
.xl-timeline-meta { font-size: .75rem; color: var(--xl-muted); }
.xl-timeline-meta strong { color: var(--tblr-body-color); font-weight: 600; }
.xl-bubble { margin-top: .2rem; padding: .5rem .7rem; border-radius: var(--xl-radius-lg); background: var(--xl-surface-2); white-space: pre-line; word-break: break-word; font-size: .875rem; }
.xl-timeline-item.is-event .xl-bubble { background: transparent; padding: .1rem 0 0; color: var(--xl-muted); }
.xl-wa-bubble { max-width: min(78%, 34rem); padding: .5rem .7rem; border-radius: var(--xl-radius-lg); background: var(--xl-surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.xl-wa-bubble.is-out { background: rgba(var(--tblr-success-rgb, 47, 179, 68), .12); }
.xl-wa-scroll { background: var(--xl-surface-2); }

/* ── Page shell helpers ────────────────────────────────────────────────────── */
.xl-page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.xl-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.xl-toolbar > .form-control, .xl-toolbar > .form-select, .xl-toolbar > .select2-container { flex: 1 1 10rem; width: auto; min-width: 8rem; max-width: 100%; }
.xl-empty { padding: 3rem 1rem; text-align: center; color: var(--xl-muted); }
.xl-empty i { display: block; font-size: 2.25rem; margin-bottom: .5rem; opacity: .55; }
.xl-scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.nav-tabs.xl-tabs-scroll { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.nav-tabs.xl-tabs-scroll .nav-link { white-space: nowrap; }

/* ── Responsive safety net (phones 360px, tablets 768px) ──────────────────── */
/* Backpack's common.css forces `overflow: visible !important` on every .table-responsive (so its row-action dropdowns
   are not clipped), which lets wide tables push the whole page sideways on phones (Q6 audit: dashboard, tickets, My
   support tickets). Below 992px a wrapper without a dropdown scrolls its table again. */
@media (max-width: 991.98px) {
    .page-body .table-responsive:not(:has(.dropdown-menu)) { overflow-x: auto !important; }
}
.dropdown-menu { max-width: calc(100vw - 16px); }
@media (max-width: 767.98px) {
    .page-body [style*="width:"]:not(img):not(.progress-bar):not(.xl-dropzone-progress span),
    .page-body [style*="width :"]:not(img) { max-width: 100% !important; }
    .page-body .card-header { flex-wrap: wrap; gap: .5rem; }
    .page-body .card-header .card-title { font-size: 1rem; }
    .page-body .btn-group { flex-wrap: wrap; }
    .page-body .table-responsive > .table { font-size: .85rem; }
    .page-body .nav-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; }
    .page-body .nav-tabs .nav-link { white-space: nowrap; }
    .xl-stack-sm > * { flex: 1 1 100% !important; max-width: 100% !important; }
}
@media (pointer: coarse) {
    .page-body .btn:not(.btn-link), .page-body .form-control, .page-body .form-select { min-height: var(--xl-touch); }
    .page-body .btn-sm:not(.btn-link) { min-height: 2.25rem; }
}

/* ── Small utilities used by the shared components ────────────────────────── */
.xl-pre { white-space: pre-wrap; word-break: break-word; }
/* the booking / user detail cards' rounder corners (was an inline style, D-12 / BT-127) */
.card.xl-card-round { border-radius: 12px; }
.xl-scroll-y { max-height: min(70vh, 40rem); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.xl-thumb { width: 3.5rem; height: 3.5rem; object-fit: cover; }
/* clickable media tile in history / remarks (image thumb or file icon) — tokens only, dark-mode safe (Q7) */
.xl-media-tile { width: 3.75rem; height: 3.75rem; object-fit: cover; cursor: pointer; border: 1px solid var(--tblr-border-color);
    border-radius: var(--xl-radius); }
.xl-media-tile-file { display: flex; align-items: center; justify-content: center; background: var(--tblr-bg-surface-secondary); }
.xl-cell-wide { min-width: 14rem; max-width: 32rem; }

/* ── List toolbars (DEC-069): ~85 grid views give the quick-filter box a fixed inline width (260–360px);
      on phones and small tablets its group takes the whole row and the box shrinks to fit ─────────── */
#quickFilter { max-width: 100%; }
@media (max-width: 767.98px) {
    *:has(> #quickFilter) { flex: 1 1 100%; min-width: 0; }
    #quickFilter { width: auto !important; min-width: 0 !important; flex: 1 1 auto; }
}

/* ── Density (to-do U3): <html data-xl-text data-xl-space>, set before paint by inc/theme_styles.blade.php from the
      user's Appearance choice or the site default (Settings ui.density.*). Tabler sizes everything in rem, so the text
      size scales the root; the spacing scale tightens card / form / page-header padding. md + comfortable = Tabler. ── */
html[data-xl-text="xs"] { font-size: 14px; }
html[data-xl-text="sm"] { font-size: 15px; }
html[data-xl-text="lg"] { font-size: 17px; }
:root { --xl-space: 1; }
html[data-xl-space="cozy"] { --xl-space: .75; }
html[data-xl-space="compact"] { --xl-space: .5; }
html:is([data-xl-space="cozy"], [data-xl-space="compact"]) .card:not(.card-sm):not(.card-md):not(.card-lg) {
    --tblr-card-spacer-y: calc(1rem * var(--xl-space));
    --tblr-card-spacer-x: calc(1.25rem * var(--xl-space) + .25rem);
    --tblr-card-cap-padding-y: calc(1rem * var(--xl-space));
    --tblr-card-cap-padding-x: calc(1.25rem * var(--xl-space) + .25rem);
}
html:is([data-xl-space="cozy"], [data-xl-space="compact"]) form :is(.mb-3, .form-group) { margin-bottom: calc(1rem * var(--xl-space) + .125rem) !important; }
html:is([data-xl-space="cozy"], [data-xl-space="compact"]) .page-header { margin-top: calc(1.25rem * var(--xl-space)); margin-bottom: calc(1rem * var(--xl-space)); }
html:is([data-xl-space="cozy"], [data-xl-space="compact"]) .page-body { margin-top: calc(1.25rem * var(--xl-space)); margin-bottom: calc(1.25rem * var(--xl-space)); }
html:is([data-xl-space="cozy"], [data-xl-space="compact"]) form .card + .card { margin-top: calc(1rem * var(--xl-space)); }

/* ── Form cards (to-do U1, xl-ui.js enhanceCards): collapse toggle, drag handle, required filled / total ──────── */
.xl-card-tools { display: inline-flex; align-items: center; gap: .25rem; margin-left: auto; }
.xl-card-tools .btn { padding: .125rem .375rem; min-height: 0; line-height: 1; }
.xl-card-handle { cursor: grab; color: var(--xl-muted); margin-right: .375rem; touch-action: none; }
.xl-card-handle:active { cursor: grabbing; }
.xl-card-toggle .la { transition: transform .15s ease; }
.card.xl-collapsed > .card-header { border-bottom: 0; }
.card.xl-collapsed > .card-header .xl-card-toggle .la { transform: rotate(-90deg); }
.card.xl-collapsed > :not(.card-header) { display: none !important; }
.card.xl-dragging { opacity: .55; outline: 2px dashed var(--xl-primary); outline-offset: 2px; }
.xl-req { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .xl-card-toggle .la { transition: none; } }

/* ── Sales screens (UI pass 30-09, .ai/rules/ui.md): shared grid look + form bits that ~60 Sales views each carried in
      their own <style> block. Grids opt in with class "xl-grid" on the grid container (other grids are unchanged). ── */
.xl-grid .ag-header-cell-label,
.xl-grid .ag-header-group-cell-label { justify-content: center !important; text-align: center !important; }
.xl-grid .ag-header-group-cell { text-align: center !important; }
.xl-grid .ag-header-group-cell-label { width: 100% !important; display: flex !important; align-items: center !important; padding: 0 6px !important; }
.xl-grid .ag-cell.action-cell { display: flex !important; align-items: center !important; justify-content: center !important; white-space: nowrap !important; padding: 0 10px !important; }
.xl-grid .ag-cell.action-cell .btn { white-space: nowrap !important; width: max-content !important; }
.xl-grid-wrap { position: relative; }
.xl-grid-loader { position: absolute; inset: 0; z-index: 1000; justify-content: center; align-items: center;
    background: color-mix(in srgb, var(--tblr-bg-surface) 70%, transparent); }
/* header "Customise Headers" popover (its display is toggled by the page script) */
.xl-col-bubble { position: absolute; top: 110%; left: 0; width: 300px; max-width: calc(100vw - 32px); z-index: 1050;
    background: var(--tblr-bg-surface); border: 1px solid var(--tblr-border-color); border-radius: var(--xl-radius);
    box-shadow: var(--xl-shadow); }
.xl-col-bubble .xl-col-bubble-body { max-height: 260px; overflow: auto; }
/* hidden until the page script sets display: block (to-do 1.5: was an inline style on every list page) */
.xl-col-bubble { display: none; }
/* list pages (to-do 1.5): the card body around a grid, and the full-page grid height */
.xl-grid-host { background: var(--tblr-bg-surface-secondary); }
.xl-grid-page { height: calc(93vh - 260px); width: 100%; }
.xl-grid-page-lg { height: calc(93vh - 240px); width: 100%; }   /* DEC-169 Phase D: the taller list grids */
/* form helpers moved out of per-view <style> blocks (to-do 1.5) */
.xl-section-title { border-bottom: 1px solid var(--tblr-border-color); padding-bottom: .625rem; margin-bottom: 1.25rem; }
.xl-org-change { display: none; border: 1px dashed var(--tblr-warning); border-radius: var(--xl-radius); padding: 1rem;
    background: rgba(var(--tblr-warning-rgb), .08); }
.xl-row-card { border: 1px solid var(--tblr-border-color); border-radius: var(--xl-radius); padding: .75rem 1rem; margin-bottom: .6rem;
    display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.xl-row-card.is-primary { border-color: var(--tblr-primary); background: rgba(var(--tblr-primary-rgb), .06); }
.xl-row-card-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.xl-row-card-edit { width: 100%; margin-top: .75rem; padding-top: .75rem; border-top: 1px dashed var(--tblr-border-color); }
/* AG-Grid: headers marked `headerClass: 'center-header'`, and group headers on grids that opt in with
   `.xl-grid-center-groups` (Q7: was a <style> block copied into each org list view) */
.ag-theme-quartz .center-header .ag-header-cell-label,
.xl-grid-center-groups .ag-header-group-cell-label { justify-content: center !important; }
/* list toolbar search box: a desktop width, full width on phones (see #quickFilter rules above) */
.xl-toolbar-search { width: 360px; min-width: 260px; }
.xl-input-narrow { width: 5.5rem; }   /* DEC-212: small number inputs in table rows (order) */
/* form bits */
.required-mark { color: var(--tblr-danger); margin-left: 4px; }
.readonly-label { font-weight: 500; color: var(--tblr-body-color); margin-bottom: .35rem; display: block; }
.readonly-value { padding: .375rem .75rem; background-color: var(--tblr-bg-surface-secondary); border: 1px solid var(--tblr-border-color);
    border-radius: var(--xl-radius); min-height: 2.375rem; display: flex; align-items: center; }
.readonly-value.text-danger { font-weight: 600; }
.form-group.readonly-field { margin-bottom: 1.25rem; }
.field-frozen { background-color: var(--tblr-bg-surface-secondary) !important; pointer-events: none !important; color: var(--tblr-muted) !important; }
.xl-export-icon { height: 30px; width: auto; }
label .required-mark { display: inline !important; }

/* ── Bulk user grid + filter-like picker (DEC-089 Phase C, public/js/xl-user-bulk.js) ─────────────────────────── */
.xl-bulk-grid { height: calc(100vh - 15rem); min-height: 24rem; width: 100%; }
.xl-bulk-grid .xl-row-failed { background: rgba(var(--tblr-danger-rgb), .08); }
.xl-picker { width: 20rem; max-width: calc(100vw - 16px); padding: .5rem; display: flex; flex-direction: column; gap: .5rem;
    background: var(--tblr-bg-surface); border: 1px solid var(--tblr-border-color); border-radius: var(--xl-radius); box-shadow: var(--xl-shadow); }
.xl-picker-list { max-height: 16rem; overflow-y: auto; }
.xl-picker-item { display: flex; align-items: center; gap: .5rem; padding: .3rem .4rem; border-radius: var(--xl-radius); cursor: pointer; margin: 0; }
.xl-picker-item:hover { background: var(--tblr-bg-surface-secondary); }
.xl-picker-item.is-special { font-style: italic; }
.xl-picker-foot { display: flex; flex-wrap: wrap; gap: .375rem; justify-content: flex-end; }

/* ── Permission tree + person picker (Org → User create / edit, Designation), W5: was copied into 4 views with
      light-only colours; tokens make it dark-mode safe. Per-user overrides: inherited / added / removed. ─────── */
:root { --rbac-inherited: var(--tblr-primary); --rbac-added: var(--tblr-success); --rbac-removed: var(--tblr-danger); }
.hidden-card { display: none !important; }   /* DEC-119: must also beat .row { display: flex } */
#personResults { position: relative; }
#personResultsList { position: absolute; z-index: 20; top: 100%; left: 0; right: 0; background: var(--tblr-bg-surface);
    border: 1px solid var(--tblr-border-color); border-radius: var(--xl-radius); box-shadow: var(--xl-shadow); max-height: 320px; overflow-y: auto; display: none; }
.person-result { display: flex; align-items: center; gap: .6rem; padding: .5rem .75rem; cursor: pointer; }
.person-result:hover { background: var(--tblr-bg-surface-secondary); }
.person-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--tblr-secondary); color: var(--tblr-white, #fff);
    display: flex; align-items: center; justify-content: center; font-size: .7rem; flex-shrink: 0; overflow: hidden; }
.person-avatar img { width: 100%; height: 100%; object-fit: cover; }
#selectedPersonCard { display: none; }
/* ── RBAC permission tree (designation / user forms): compact folder tree, +/- boxes, inline permission chips (05-10) ── */
.rbac-tree { background: var(--tblr-bg-surface); border: 1px solid var(--tblr-border-color); border-radius: var(--xl-radius); padding: .25rem .5rem .4rem; font-size: .8125rem; }
/* modules in as many columns as fit (one on phones); a module keeps its place when another expands (owner 05-10) */
.rbac-tree { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); gap: .1rem 1rem; align-items: start; }
.rbac-toolbar { grid-column: 1 / -1; padding: .25rem 0 .35rem; }
.rbac-module { min-width: 0; }
.rbac-module:not(.collapsed) { border: 1px solid var(--tblr-border-color-translucent, var(--tblr-border-color)); border-radius: var(--tblr-border-radius-sm, .25rem); padding-bottom: .15rem; }
.rbac-filter { max-width: 26rem; }
.rbac-row { display: flex; align-items: center; gap: .35rem; padding: .1rem .25rem; border-radius: var(--tblr-border-radius-sm, .25rem); }
.rbac-row-module:hover, .rbac-row-process:hover { background: var(--tblr-bg-surface-secondary); }
.rbac-module-body { margin-left: .6rem; padding-left: .7rem; border-left: 1px dotted var(--tblr-border-color); }
.rbac-process-body { display: flex; flex-wrap: wrap; gap: .15rem .3rem; margin: 0 0 .15rem .6rem; padding: .1rem 0 .1rem 1.55rem; border-left: 1px dotted var(--tblr-border-color); }
.rbac-module.collapsed > .rbac-module-body, .rbac-process.collapsed > .rbac-process-body { display: none; }
.rbac-caret { flex: 0 0 auto; width: .95rem; height: .95rem; padding: 0; border: 1px solid var(--tblr-border-color); border-radius: 2px; background: var(--tblr-bg-surface);
    color: var(--tblr-secondary); font: 600 .7rem/1 var(--tblr-font-monospace, monospace); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.rbac-caret::before { content: "\2212"; }
.collapsed > .rbac-row > .rbac-caret::before { content: "+"; }
.rbac-caret:hover { border-color: var(--tblr-primary); color: var(--tblr-primary); }
.rbac-label { margin: 0; cursor: pointer; white-space: nowrap; }
.rbac-label-module, .rbac-label-process { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.rbac-label-module { font-weight: 600; }
.rbac-label-process { color: var(--tblr-body-color); }
.rbac-count { font-size: .7rem; color: var(--tblr-secondary); margin-left: .15rem; }
.rbac-row-perm { padding: .05rem .4rem .05rem .3rem; border: 1px solid var(--tblr-border-color-translucent, var(--tblr-border-color)); border-radius: 1rem; gap: .25rem; }
.rbac-row-perm:hover { background: var(--tblr-bg-surface-secondary); }
.rbac-row-perm .rbac-label { font-size: .75rem; }
.rbac-check { width: .85rem; height: .85rem; margin: 0; cursor: pointer; flex-shrink: 0; }
.rbac-check:disabled { cursor: not-allowed; opacity: .35; }
.rbac-hidden { display: none !important; }
/* Permission grid (owner 17-10): Module | Process | P1 (view) … Pn — one row per process; header and first two columns stay in view */
/* the grid never widens the page: its box takes the page's width (contain) and the table pans inside it both ways */
.rbac-tree.rbac-grid { display: block; padding: .25rem .4rem .4rem; max-width: 100%; min-width: 0; contain: inline-size; }
.rbac-grid-wrap { max-width: 100%; max-height: 65vh; overflow: auto; overscroll-behavior: contain; }
.tab-content, .tab-pane { min-width: 0; }
.rbac-grid-table { font-size: .78rem; }
.rbac-grid-table thead th { position: sticky; top: 0; z-index: 3; background: var(--tblr-bg-surface); box-shadow: inset 0 -1px 0 var(--tblr-border-color); white-space: nowrap; }   /* opaque: rows scroll under it */
.rbac-grid-table .rbac-grid-module { position: sticky; left: 0; z-index: 2; background: var(--tblr-bg-surface); min-width: 9rem; vertical-align: top; }
.rbac-grid-table thead .rbac-grid-module { z-index: 4; }
.rbac-grid-table .rbac-grid-process { white-space: nowrap; min-width: 11rem; }
.rbac-grid-table td.rbac-grid-perm { white-space: nowrap; padding: .15rem .35rem; }
.rbac-grid-table td.rbac-perm-view { background: var(--tblr-primary-lt); }
.rbac-grid-table tbody + tbody { border-top-width: 2px; }
.rbac-grid-table .rbac-label-perm { font-size: .75rem; }
.rbac-grid-table td.rbac-row-perm { border-radius: 0; border-color: var(--tblr-border-color); }   /* not the tree's pill chips */
@media (max-width: 767.98px) { .rbac-grid-table .rbac-grid-module { position: static; min-width: 7rem; } }   /* phones: room for the permission columns */
.rbac-grid-table td.ov-added { box-shadow: inset 3px 0 0 var(--rbac-added); } .rbac-grid-table td.ov-removed { box-shadow: inset 3px 0 0 var(--rbac-removed); } .rbac-grid-table td.ov-inherited { box-shadow: inset 3px 0 0 var(--rbac-inherited); }
.rbac-dim { opacity: .35; }
/* DEC-176: permissions by menu — Menu (indented by depth, pinned) | P1 … Pn; heads collapse */
.xl-pm .xl-pm-name { position: sticky; left: 0; z-index: 2; background: var(--tblr-bg-surface); white-space: nowrap; min-width: 16rem; font-weight: normal; }
.rbac-grid .rbac-grid-table thead th { background-color: var(--tblr-bg-surface) !important; }   /* pinned header: Backpack's style.css sets table headers transparent !important, rows would show through */
.xl-pm .rbac-grid-table thead th.xl-pm-name { top: 0; z-index: 4; }
.xl-pm .xl-pm-d1 { padding-left: 1.4rem; } .xl-pm .xl-pm-d2 { padding-left: 2.6rem; } .xl-pm .xl-pm-d3 { padding-left: 3.8rem; }
.xl-pm .xl-pm-d4 { padding-left: 5rem; } .xl-pm .xl-pm-d5 { padding-left: 6.2rem; } .xl-pm .xl-pm-d6 { padding-left: 7.4rem; }
.xl-pm .xl-pm-head > th { font-weight: 600; }
.xl-pm .xl-pm-row.collapsed .rbac-caret::before { content: "+"; }
.xl-pm .xl-pm-leaf { display: inline-block; width: .95rem; flex: 0 0 auto; }
.xl-pm .xl-pm-proc { color: var(--tblr-secondary); font-size: .68rem; }
.xl-pm .xl-pm-hidden { display: none; }
.xl-pm .xl-pm-unplaced { border-top: 2px solid var(--tblr-border-color); }
@media (max-width: 767.98px) { .xl-pm .xl-pm-name { position: static; min-width: 12rem; } }
/* DEC-174: working copy of the top-bar menu in the designation / user forms (public/js/xl-menu-tree.js): Backpack's
   dropdown markup, a checkbox in front of every head and item; menus open over the page like the top bar's */
.xl-menu-tree { background: var(--tblr-bg-surface); border: 1px solid var(--tblr-border-color); border-radius: var(--xl-radius); padding: .4rem .5rem; }
.xl-menu-replica { padding: 0; min-height: 2.75rem; align-items: flex-start; }
.xl-menu-replica .navbar-nav { gap: .15rem .5rem; }
/* the pane grows to fit the open menus (xl-menu-tree.js fitHeight); the bar and its items keep their own height, so the
   menus (top: 100% of their item) stay where they opened */
.xl-menu-tree .navbar.xl-menu-replica { align-items: flex-start; align-content: flex-start; }
.xl-menu-tree .xl-menu-replica .navbar-nav { align-self: flex-start; align-items: flex-start; }
.xl-menu-tree .xl-menu-replica .navbar-nav > .nav-item.xl-menu-head, .xl-menu-tree .xl-menu-replica .dropend.xl-menu-head { display: flex; flex-direction: row; align-items: center; gap: .3rem; }
.xl-menu-replica .dropend.xl-menu-head { padding-left: .6rem; }
.xl-menu-replica .dropdown-item.xl-menu-item { cursor: pointer; }
.xl-menu-check { width: .9rem; height: .9rem; margin: 0; flex-shrink: 0; cursor: pointer; }
.xl-menu-check:disabled { cursor: not-allowed; opacity: .55; }
/* read-only tree (My account): <details> / <summary> give the +/- without a script */
.rbac-readonly summary { list-style: none; cursor: pointer; }
.rbac-readonly summary::-webkit-details-marker { display: none; }
.rbac-readonly details:not([open]) > summary > .rbac-caret::before { content: "+"; }
.rbac-readonly .rbac-label { cursor: inherit; }
.rbac-readonly .rbac-row-perm { cursor: help; }
.rbac-state-badge { font-size: .65rem; font-weight: 700; line-height: 1; display: none; }
.ov-added { border-color: var(--rbac-added); }
.ov-added .rbac-label-perm, .ov-added .rbac-state-badge { color: var(--rbac-added); display: inline; }
.ov-removed { border-color: var(--rbac-removed); }
.ov-removed .rbac-label-perm { color: var(--rbac-removed); text-decoration: line-through; }
.ov-removed .rbac-state-badge { color: var(--rbac-removed); display: inline; }
.ov-inherited { border-color: var(--rbac-inherited); }
.ov-inherited .rbac-label-perm { color: var(--rbac-inherited); }
@media (max-width: 575.98px) { .rbac-module-body { margin-left: .3rem; padding-left: .4rem; } .rbac-process-body { padding-left: .8rem; } }

/* ── Vehicle compare (DEC-092): sticky first column, highlighted differing rows, print-friendly ─────────────── */
.xl-compare .xl-compare-sticky { position: sticky; left: 0; z-index: 1; background: var(--tblr-bg-surface); min-width: 12rem; }
.xl-compare tr.table-active .xl-compare-sticky { background: var(--tblr-bg-surface-secondary); }
.xl-compare tr.xl-compare-differs > td { background: rgba(var(--tblr-warning-rgb), .08); }
.xl-compare tr.xl-compare-differs > td.xl-compare-sticky { background: color-mix(in srgb, var(--tblr-bg-surface) 92%, var(--tblr-warning)); }
@media print { .xl-compare { overflow: visible !important; } .xl-compare .xl-compare-sticky { position: static; } }

/* F1 help pane (DEC-094, W16b) — right side, 420 px; full width on a phone */
.xl-help-pane { position: fixed; top: 0; right: 0; bottom: 0; width: 420px; max-width: 100vw; z-index: 1060; display: flex; flex-direction: column;
    background: var(--tblr-bg-surface); border-left: 1px solid var(--tblr-border-color); box-shadow: -.5rem 0 1.5rem rgba(0, 0, 0, .12);
    transform: translateX(100%); visibility: hidden; transition: transform .2s ease, visibility .2s; }
.xl-help-pane.show { transform: none; visibility: visible; }
.xl-help-pane:focus { outline: none; }
.xl-help-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .75rem 1rem; border-bottom: 1px solid var(--tblr-border-color); }
.xl-help-search { padding: .75rem 1rem 0; }
.xl-help-search [data-xl-help-results] { max-height: 40vh; overflow-y: auto; }
.xl-help-body { flex: 1; overflow-y: auto; padding: 1rem; }
.xl-help-foot { padding: .5rem 1rem; border-top: 1px solid var(--tblr-border-color); font-size: .875rem; }
.xl-help-article h1, .xl-help-article h2 { font-size: 1.1rem; margin-top: 1rem; }
.xl-help-article h3 { font-size: 1rem; margin-top: .75rem; }
.xl-help-article img { max-width: 100%; height: auto; }
@media (max-width: 575.98px) { .xl-help-pane { width: 100vw; } }
@media print { .xl-help-pane { display: none !important; } }
[data-xl-help-open] { position: relative; }
[data-xl-help-open].xl-help-new::after { content: ''; position: absolute; top: .35rem; right: .3rem; width: .5rem; height: .5rem; border-radius: 50%; background: var(--tblr-primary); }

/* ── Reporting trees (My account → My upline / My downline, owner 05-10): multi-branch, any depth ──────────────
   One markup (people-tree.blade.php), two looks switched by the Chart / List radios (people-tree-view, no script):
   List  = compact outline with +/- boxes; Chart = top-down org chart, a manager's team side by side under them. */
.xl-people-tree { list-style: none; margin: 0; padding-left: 0; font-size: .8125rem; }
.xl-people-tree .xl-people-tree { margin-left: .55rem; padding-left: .9rem; border-left: 1px dotted var(--tblr-border-color); }
.xl-people-tree li { margin: .1rem 0; }
.xl-people-tree summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .35rem; padding: .1rem .25rem; border-radius: var(--tblr-border-radius-sm, .25rem); }
.xl-people-tree summary::-webkit-details-marker { display: none; }
.xl-people-tree summary::before { content: "\2212"; flex: 0 0 auto; width: .95rem; height: .95rem; border: 1px solid var(--tblr-border-color); border-radius: 2px;
    display: inline-flex; align-items: center; justify-content: center; font: 600 .7rem/1 var(--tblr-font-monospace, monospace); color: var(--tblr-secondary); }
.xl-people-tree details:not([open]) > summary::before { content: "+"; }
.xl-people-tree summary:hover { background: var(--tblr-bg-surface-secondary); }
.xl-people-leaf { padding: .1rem .25rem .1rem 1.55rem; }
.xl-people-name { font-weight: 600; }
.xl-people-role { color: var(--tblr-secondary); font-size: .75rem; margin-left: .35rem; }
.xl-people-count { margin-left: .35rem; }
.xl-people-me { background: rgba(var(--tblr-primary-rgb), .08); border-radius: var(--tblr-border-radius-sm, .25rem); padding: 0 .3rem; }

/* Chart look */
.xl-people-view:has(.xl-view-chart:checked) .xl-people-scroll { overflow-x: auto; padding: .25rem 0 .75rem; }
.xl-people-view:has(.xl-view-chart:checked) .xl-people-tree { display: flex; justify-content: center; position: relative;
    margin: 0; padding: 1.1rem 0 0; border: 0; min-width: max-content; }
.xl-people-view:has(.xl-view-chart:checked) .xl-people-scroll > .xl-people-tree { padding-top: 0; width: max-content; margin: 0 auto; }   /* centred while it fits; wider = starts at the left and scrolls */
.xl-people-view:has(.xl-view-chart:checked) .xl-people-tree li { position: relative; display: flex; flex-direction: column; align-items: center;
    margin: 0; padding: 1.1rem .3rem 0; }
/* connectors: a horizontal line across the siblings, a vertical one down into each box and from each open box */
.xl-people-view:has(.xl-view-chart:checked) .xl-people-tree li::before,
.xl-people-view:has(.xl-view-chart:checked) .xl-people-tree li::after { content: ""; position: absolute; top: 0; right: 50%; width: 50%; height: 1.1rem;
    border-top: 1px solid var(--tblr-border-color); }
.xl-people-view:has(.xl-view-chart:checked) .xl-people-tree li::after { right: auto; left: 50%; border-left: 1px solid var(--tblr-border-color); }
.xl-people-view:has(.xl-view-chart:checked) .xl-people-tree li:first-child::before,
.xl-people-view:has(.xl-view-chart:checked) .xl-people-tree li:last-child::after { border-top: 0; }
.xl-people-view:has(.xl-view-chart:checked) .xl-people-tree li:last-child::before { border-right: 1px solid var(--tblr-border-color); }
.xl-people-view:has(.xl-view-chart:checked) .xl-people-tree li:only-child::before { border-top: 0; }
.xl-people-view:has(.xl-view-chart:checked) .xl-people-tree li:only-child::after { display: none; }
.xl-people-view:has(.xl-view-chart:checked) .xl-people-scroll > .xl-people-tree > li { padding-top: 0; }
.xl-people-view:has(.xl-view-chart:checked) .xl-people-scroll > .xl-people-tree > li::before,
.xl-people-view:has(.xl-view-chart:checked) .xl-people-scroll > .xl-people-tree > li::after { display: none; }
.xl-people-view:has(.xl-view-chart:checked) details > .xl-people-tree::before { content: ""; position: absolute; top: 0; left: 50%; height: 1.1rem;
    border-left: 1px solid var(--tblr-border-color); }
/* the person boxes */
.xl-people-view:has(.xl-view-chart:checked) summary,
.xl-people-view:has(.xl-view-chart:checked) .xl-people-leaf { display: flex; flex-direction: column; align-items: center; gap: .1rem; margin: 0 auto;
    width: max-content; max-width: 11rem; padding: .3rem .55rem; text-align: center; background: var(--tblr-bg-surface);
    border: 1px solid var(--tblr-border-color); border-radius: var(--tblr-border-radius); box-shadow: var(--tblr-box-shadow-sm, none); }
.xl-people-view:has(.xl-view-chart:checked) summary:hover { border-color: var(--tblr-primary); background: var(--tblr-bg-surface); }
.xl-people-view:has(.xl-view-chart:checked) summary::before { order: 3; margin-top: .1rem; }
.xl-people-view:has(.xl-view-chart:checked) .xl-people-node { display: flex; flex-direction: column; align-items: center; gap: .1rem; }
.xl-people-view:has(.xl-view-chart:checked) .xl-people-role,
.xl-people-view:has(.xl-view-chart:checked) .xl-people-count { margin-left: 0; white-space: normal; }
.xl-people-view:has(.xl-view-chart:checked) .xl-people-me { padding: 0; background: none; }
.xl-people-view:has(.xl-view-chart:checked) summary:has(.xl-people-me),
.xl-people-view:has(.xl-view-chart:checked) .xl-people-leaf:has(.xl-people-me) { border-color: var(--tblr-primary); background: rgba(var(--tblr-primary-rgb), .06); }


/* To-do 1.5: repeated inline styles on the enquiry and quotation forms, moved here with the same values. No !important,
   so the pages' scripts (which set inline background / border on some of these fields) still win. */
/* doubled with the form classes: Tabler's .form-control / .form-select load later with the same specificity */
.xl-ro-surface, .form-control.xl-ro-surface, .form-select.xl-ro-surface { background-color: var(--tblr-bg-surface-secondary); }
.xl-no-pointer { pointer-events: none; }
.xl-pointer { pointer-events: auto; }
.xl-text-body { color: var(--tblr-body-color); }
/* Quotation create: the compact printed-sheet grid (sizes kept from the original design). Each rule is repeated under
   .quotation-grid so it beats the page's own `.quotation-grid input / th / td` rules, as the inline styles did. */
.xl-qt-head, .quotation-grid .xl-qt-head { background: var(--tblr-bg-surface-tertiary); border: 1px solid var(--tblr-body-color); padding: 3px 2px; font-size: 9px; font-weight: bold; text-align: center; }
.xl-qt-cell, .quotation-grid .xl-qt-cell { border: 1px solid var(--tblr-body-color); padding: 3px 2px; text-align: right; }
.xl-qt-input, .quotation-grid .xl-qt-input { font-weight: bold; font-size: 10px; text-align: center; width: 100%; border: none; background: transparent; }
.xl-qt-select, .quotation-grid .xl-qt-select { font-size: 9px; padding: 1px 3px; height: 22px; border: 1px solid var(--tblr-border-color); border-radius: 3px; width: 100%; background: var(--tblr-card-bg); }
.xl-qt-check, .quotation-grid .xl-qt-check { font-size: 8px; font-weight: bold; margin: 0 2px; cursor: pointer; display: flex; align-items: center; gap: 1px; }
.xl-qt-req, .quotation-grid .xl-qt-req { color: var(--tblr-danger); font-weight: normal; font-size: 9px; }
.xl-qt-band, .quotation-grid .xl-qt-band { background: var(--tblr-bg-surface-secondary); font-weight: bold; }
.xl-qt-frame, .quotation-grid .xl-qt-frame { width: 100%; margin-top: 3px; border: 1px solid var(--tblr-body-color); }

/* DEC-118: row actions — icon buttons in one compact strip; the tooltip (data-xl-tip) explains each */
.xl-row-actions { display: inline-flex; align-items: center; justify-content: center; gap: .15rem; flex-wrap: nowrap; }
.xl-row-action { --tblr-btn-padding-x: .3rem; --tblr-btn-padding-y: .15rem; min-width: 1.9rem; min-height: 1.9rem; }
.xl-row-action .la { font-size: 1.05rem; line-height: 1; }
.xl-tip { pointer-events: none; z-index: 2000; }
.xl-tip .tooltip-inner { max-width: 18rem; text-align: left; }
@media (pointer: coarse) { .xl-row-action { min-width: 2.5rem; min-height: 2.5rem; } }   /* touch targets ≥ 40px (ui.md) */

/* DEC-119: Select all · Clear under every multi-select */
.xl-select-bulk { display: flex; gap: .35rem; align-items: center; margin-top: .15rem; font-size: .8rem; }
.xl-select-bulk .btn-link { --tblr-btn-font-size: .8rem; text-decoration: none; }
/* a disabled multi-select (e.g. a cascade left it nothing to offer) has nothing to select or clear */
.select2-container--disabled + .xl-select-bulk { visibility: hidden; }

/* Campaign form (moved from its inline <style>, UI audit 12-10): read-only flatpickr inputs look clickable */
.xl-campaign-form .flatpickr-input[readonly] { background-color: var(--tblr-card-bg); cursor: pointer; }

/* to-do 1.17: "show more / show all" toggles in a full-width table row — a quiet text control, not a row action */
.xl-table-toggle {
    background: none;
    border: 0;
    padding: 0.125rem 0.5rem;
    color: var(--tblr-secondary);
    font-weight: 600;
    font-size: 0.8125rem;
    cursor: pointer;
}
.xl-table-toggle:hover,
.xl-table-toggle:focus-visible {
    color: var(--tblr-primary);
    text-decoration: underline;
}

/* Owner 13-10: row-action colours by kind (RowAction registry). Ghost tones for the extra Tabler colours, from the
   theme tokens so dark mode still applies. */
.xl-row-action.btn-ghost-azure { color: var(--tblr-azure); background: transparent; border-color: transparent; }
.xl-row-action.btn-ghost-azure:hover, .xl-row-action.btn-ghost-azure:focus-visible { color: var(--tblr-white); background: var(--tblr-azure); }
.xl-row-action.btn-ghost-indigo { color: var(--tblr-indigo); background: transparent; border-color: transparent; }
.xl-row-action.btn-ghost-indigo:hover, .xl-row-action.btn-ghost-indigo:focus-visible { color: var(--tblr-white); background: var(--tblr-indigo); }
.xl-row-action.btn-ghost-teal { color: var(--tblr-teal); background: transparent; border-color: transparent; }
.xl-row-action.btn-ghost-teal:hover, .xl-row-action.btn-ghost-teal:focus-visible { color: var(--tblr-white); background: var(--tblr-teal); }
.xl-row-action.btn-ghost-purple { color: var(--tblr-purple); background: transparent; border-color: transparent; }
.xl-row-action.btn-ghost-purple:hover, .xl-row-action.btn-ghost-purple:focus-visible { color: var(--tblr-white); background: var(--tblr-purple); }
.xl-row-action.btn-ghost-orange { color: var(--tblr-orange); background: transparent; border-color: transparent; }
.xl-row-action.btn-ghost-orange:hover, .xl-row-action.btn-ghost-orange:focus-visible { color: var(--tblr-white); background: var(--tblr-orange); }
.xl-row-action.btn-ghost-pink { color: var(--tblr-pink); background: transparent; border-color: transparent; }
.xl-row-action.btn-ghost-pink:hover, .xl-row-action.btn-ghost-pink:focus-visible { color: var(--tblr-white); background: var(--tblr-pink); }

/* DEC-162: classes that replaced repeated inline styles (same strength as the inline style they replaced). */
.cursor-pointer { cursor: pointer; }
.xl-field-muted { background-color: var(--tblr-bg-surface-secondary) !important; }
.xl-field-locked { background-color: var(--tblr-bg-surface-secondary) !important; pointer-events: none; }

/* DEC-192: command output on System → House-keeping — light text on a dark panel in both themes (a class beats the
   theme's plain `pre` rule whatever the load order) */
.xl-terminal { background: var(--tblr-gray-900, var(--tblr-dark)); color: var(--tblr-gray-100, var(--tblr-white)); border-radius: 0 0 var(--tblr-border-radius) var(--tblr-border-radius); white-space: pre-wrap; word-break: break-word; line-height: 1.5; }

/* DEC-205: colour swatches — rounded squares with a soft glow of their own colour below (owner 20-10 reference). The
   colour is data: xl-ui.js sets --xl-swatch / --xl-swatch-roof from data attributes; a dual-tone colour shows its roof
   colour in the lower-right half; the faint inner ring keeps white squares visible on a light page. Named
   `xl-colour-swatch*` — `.xl-swatch` is the Appearance panel's theme tile (xl-theme.css). The bold [n] is the count. */
.xl-colour-swatches { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .4rem; vertical-align: middle; line-height: 1; padding: .15rem 0 .3rem; }
.xl-colour-swatch { --xl-swatch-glow: rgba(var(--tblr-body-color-rgb), .18); display: inline-block; width: 1.25rem; height: 1.25rem; flex: none; border-radius: .35rem; cursor: default;
    background: var(--xl-swatch, var(--tblr-gray-400));
    box-shadow: inset 0 0 0 1px rgba(var(--tblr-body-color-rgb), .08), 0 .25rem .4rem -.15rem var(--xl-swatch-glow); }
@supports (color: color-mix(in srgb, red 50%, transparent)) {
    .xl-colour-swatch { --xl-swatch-glow: color-mix(in srgb, var(--xl-swatch, var(--tblr-gray-400)) 65%, transparent); }
}
.xl-colour-swatch.xl-colour-swatch-roof { background: linear-gradient(135deg, var(--xl-swatch) 0 50%, var(--xl-swatch-roof) 50% 100%); }
.xl-colour-swatch:focus-visible { outline: 2px solid var(--tblr-primary); outline-offset: 2px; }
.xl-colour-count { font-weight: var(--tblr-font-weight-bold, 700); margin-inline-start: .1rem; }

/* DEC-227 #7: import findings in a box of their own — scrolls instead of stretching the card; long codes wrap */
.xl-findings { max-height: 14rem; overflow-y: auto; overflow-wrap: anywhere; padding: .25rem .5rem; border: var(--tblr-border-width) solid var(--tblr-border-color); border-radius: var(--tblr-border-radius); background: var(--tblr-bg-surface-secondary); }

/* DEC-234: the uniform imports list — a wrapping note column and a compact input */
.xl-import-note { min-width: 12rem; max-width: 22rem; white-space: normal; }
.xl-import-input { max-width: 15rem; }

/* Owner 07-11: every grid / list header is centre-aligned — AG Grid column and column-group headers (with or without
   .xl-grid), and plain table headers (Backpack lists, report tables). Cells keep their own alignment. */
.ag-header-cell-label,
.ag-header-group-cell-label { justify-content: center !important; text-align: center !important; }
.ag-header-cell-label .ag-header-cell-text { text-align: center; }
table thead th, table thead td { text-align: center !important; vertical-align: middle; }

/* Owner 07-11: the filter / menu icons always sit to the right of the header title — AG Grid reverses a right-aligned
   (number) column's header, which put them on the left. Plain tables get vertical cell separators like the grids
   (the grids' come from the theme: columnBorder / headerColumnBorder in header_metas). */
.ag-right-aligned-header .ag-cell-label-container { flex-direction: row-reverse !important; }
.ag-right-aligned-header .ag-header-cell-label { flex-direction: row !important; }
.table > :not(caption) > * > * + * { border-left: var(--tblr-border-width) solid var(--tblr-border-color); }

/* Owner 07-11: numeric data right-aligned (columns marked by the grid hook in header_metas, `xl-num`); headers stay centred */
.ag-cell.xl-num { text-align: right; justify-content: flex-end; }
.ag-cell.xl-num .ag-cell-wrapper, .ag-cell.xl-num .ag-cell-value { justify-content: flex-end; text-align: right; }
table td.xl-num { text-align: right; }
