/* ============================================================
   Shared grid design for every AG Grid page (loaded from head.php).
   The .ux-grid class is added by assets/js/ux-grid.js when a grid is created.
   Presentation only: row heights, columns and behaviour stay as each page defines them.
   ============================================================ */

:root {
    --uxg-text: #2f2b3d;
    --uxg-text-2: #5d596c;
    --uxg-text-3: #6f6b7d;
    --uxg-border: #e4e3e9;
    --uxg-border-soft: #ebe9f1;
    --uxg-bg-soft: #f8f7fa;
    --uxg-fill: #f3f3f6;          /* filled toolbar controls (no border) */
    --uxg-fill-hover: #ebebf0;
    --uxg-frame: #e9e8ee;         /* table frame + header line */
    --uxg-head-bg: #f7f7f9;
    --uxg-primary: #7367f0;
    --uxg-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

/* loading: spinner in a grid container until the page creates its grid (ux-grid.js), and the same spinner as
   AG Grid's loading overlay. It fades in after 200ms, so fast loads never flash it. */
.aggrid.ux-grid-waiting { position: relative; }
.ux-grid-wait { position: absolute; inset: 0; pointer-events: none; }
.ux-grid-wait .ux-grid-loading { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.ux-grid-loading { display: inline-flex; align-items: center; gap: .5rem; color: var(--uxg-text-3); font-size: .95rem; white-space: nowrap;
    animation: uxGridWaitIn 200ms var(--uxg-ease-out) 200ms both; }
.ux-grid-loading .fa-spinner { color: var(--uxg-primary); font-size: 1.15rem; }
/* server-paged grids (counters): shown over the table while a page / search loads, so it has to stand out */
.ux-grid-loading.ux-grid-loading--page { font-size: 1.25rem; font-weight: 500; gap: .65rem; margin: 2.5rem 0; color: var(--uxg-text-2); }
.ux-grid-loading.ux-grid-loading--page .fa-spinner { font-size: 1.5rem; }
/* while that message shows, the grid keeps room for it (it is otherwise sized to a single placeholder row) */
.ux-grid.aggrid.ux-grid-is-loading { min-height: 320px; }
@keyframes uxGridWaitIn { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ux-grid-loading { animation-duration: 0s; } }

/* style.css caps every .aggrid at max-height: 793px and forces 12px text;
   ux-grid.js sizes the grid to its content (capped by the screen) */
.ux-grid.aggrid { max-height: none; font-size: 13px !important; color: var(--uxg-text-2); }

/* the table sits in its own rounded, bordered frame inside the page card
   (border-box: the 2px border is inside the height ux-grid.js sets, which already reserves +2) */
.ux-grid.aggrid {
    box-sizing: border-box; border: 1px solid var(--uxg-frame); border-radius: 10px;
    overflow: hidden; background: #fff;
    padding-top: 0 !important; padding-bottom: 0 !important; /* style.css pads #readingsGrid / #counterReadingsGrid by id: inside the frame that shows as a white strip above the header */
}
.ux-grid.aggrid .ag-root-wrapper { border: 0; border-radius: 10px; background: transparent; }
.ux-grid.aggrid .ag-header { background: var(--uxg-head-bg); }
.ux-grid.aggrid .ag-paging-panel { border-top: 1px solid var(--uxg-frame) !important; }

/* ---------- header ---------- */
.ux-grid .ag-header { border-bottom: 1px solid var(--uxg-frame) !important; }
/* quiet header: small caps-style labels, medium weight, on the grey band */
.ux-grid .ag-header-cell-text { color: var(--uxg-text-3); letter-spacing: .04em; font-size: 11.5px; font-weight: 500; text-transform: uppercase; }
.ux-grid .ag-floating-filter-input,
.ux-grid .ag-floating-filter-full-body input {
    height: 28px; border: 1px solid var(--uxg-border) !important; border-radius: 5px; padding: 0 .5rem !important;
    font-size: 12px; color: var(--uxg-text); background: #fff;
}
.ux-grid .ag-floating-filter-input:focus,
.ux-grid .ag-floating-filter-full-body input:focus { border-color: var(--uxg-primary) !important; outline: 0; box-shadow: 0 0 0 3px rgba(115, 103, 240, .15); }

/* ---------- rows & cells ---------- */
.ux-grid.ag-theme-material .ag-row { border-color: #f0eff3; }
.ux-grid.ag-theme-material .ag-cell { color: var(--uxg-text); }
/* roomier rows (ux-grid.js sets rowHeight 44 on grids that do not set their own; style.css forces 35px with !important) */
.ux-grid-roomy.ag-theme-material .ag-row { height: 44px !important; }
.ux-grid-roomy.ag-theme-material .ag-cell { line-height: 43px !important; padding-left: 8px !important; padding-right: 8px !important; }
.ux-grid.ag-theme-material .ag-row-selected { background: #f3f1fe; }
@media (hover: hover) and (pointer: fine) {
    .ux-grid.ag-theme-material .ag-row-hover { background: #f8f7fe; }
}
@media (hover: none) {
    .ux-grid.ag-theme-material .ag-row-hover { background: transparent; }
}

/* theme badges put same-hue text on a tint (cyan on cyan...); keep the hue, darken the text */
.ux-grid .badge.badge-light-primary   { background: #ece9fd; color: #4f3fc4 !important; }
.ux-grid .badge.badge-light-success   { background: #ddf6e6; color: #166534 !important; }
.ux-grid .badge.badge-light-danger    { background: #fde7e7; color: #b42318 !important; }
.ux-grid .badge.badge-light-warning   { background: #fdf0d5; color: #92400e !important; }
.ux-grid .badge.badge-light-info      { background: #e0f0fe; color: #075985 !important; }
.ux-grid .badge.badge-light-secondary { background: #eef0f3; color: #475569 !important; }
.ux-grid .badge.badge-light-dark      { background: #e9e8ec; color: #2f2b3d !important; }
.ux-grid .badge { font-weight: 600; letter-spacing: .01em; }
/* solid grey badge is white on #b8c2cc (unreadable): same meaning, readable tint */
.ux-grid .badge.badge-secondary,
.ux-grid .badge.badge-light   { background: #eef0f3; color: #475569 !important; }
/* white on orange / cyan is unreadable; same hue as a tint. Solid red stays: it is the most severe level */
.ux-grid .badge.badge-warning { background: #fdf0d5; color: #92400e !important; }
.ux-grid .badge.badge-info    { background: #e0f0fe; color: #075985 !important; }
/* long values: truncate inside the pill instead of clipping mid-word at the cell edge */
.ux-grid .ag-cell .badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }

/* row action icons (edit / status / delete) used by most pages */
.ux-grid .grid-delete-icon, .ux-grid .grid-status-icon, .ux-grid [class*="-edit-icon"] {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 6px; color: var(--uxg-text-2);
    transition: background-color .15s ease, color .15s ease, transform 160ms var(--uxg-ease-out);
}
.ux-grid .grid-delete-icon:active, .ux-grid .grid-status-icon:active { transform: scale(0.95); }
@media (hover: hover) and (pointer: fine) {
    .ux-grid [class*="-edit-icon"]:hover { background: #ece9fd; color: #4f3fc4; }
    .ux-grid .grid-status-icon:hover { background: #fdf0d5; color: #92400e; }
    .ux-grid .grid-delete-icon:hover { background: #fde7e7; color: #b42318; }
}
@media (pointer: coarse) {
    .ux-grid .grid-delete-icon, .ux-grid .grid-status-icon, .ux-grid [class*="-edit-icon"] { width: 36px; height: 36px; }
}

/* "open details" row icon (security events): a real <button>, same look as the edit icon */
.ux-grid .grid-view-icon {
    display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
    padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--uxg-text-2);
    font-size: 15px; line-height: 1; cursor: pointer; vertical-align: middle;
    transition: background-color .15s ease, color .15s ease, transform 160ms var(--uxg-ease-out);
}
.ux-grid .grid-view-icon:active { transform: scale(0.95); }
.ux-grid .grid-view-icon:focus { outline: 0; }
.ux-grid .grid-view-icon:focus-visible { box-shadow: 0 0 0 2px var(--uxg-primary); }
@media (hover: hover) and (pointer: fine) { .ux-grid .grid-view-icon:hover { background: #ece9fd; color: #4f3fc4; } }
@media (pointer: coarse) { .ux-grid .grid-view-icon { width: 36px; height: 36px; } }
@media (prefers-reduced-motion: reduce) { .ux-grid .grid-view-icon:active { transform: none; } }
/* a centred action cell (icon / button) without the roomy-row side padding */
.ux-grid-roomy.ag-theme-material .ag-cell.ux-cell-action { display: flex; align-items: center; justify-content: center; padding-left: 4px !important; padding-right: 4px !important; }

/* ---------- pager: one quiet row instead of grey boxes and round buttons ---------- */
.ux-grid.aggrid .ag-paging-panel {
    display: flex !important; align-items: center; justify-content: space-between;
    height: 52px; padding: 0 .75rem; border-top: 0;
    color: var(--uxg-text-3); font-size: .85rem;
}
/* grids without pagination: AG Grid hides the pager with .ag-hidden, which the display:flex !important above overrode
   (an empty "– din / Pagina [] din []" bar under small client-side grids) */
.ux-grid.aggrid.ag-theme-material .ag-paging-panel.ag-hidden { display: none !important; }
.ux-grid.aggrid .ag-paging-panel .ag-paging-row-summary-panel { display: inline-flex !important; align-items: center; gap: .3rem; margin: 0 !important; padding: 0; }
.ux-grid.aggrid .ag-paging-panel .ag-paging-row-summary-panel > span {
    background: none; padding: 0; margin: 0 !important; border-radius: 0; color: var(--uxg-text-2) !important; font-weight: 600;
}
.ux-grid.aggrid .ag-paging-panel .ag-paging-row-summary-panel > span:not([ref]) { font-weight: 400; color: var(--uxg-text-3) !important; }
.ux-grid.aggrid .ag-paging-panel .ag-paging-page-summary-panel { display: inline-flex !important; align-items: center; gap: .35rem; margin: 0 !important; }
.ux-grid.aggrid .ag-paging-panel .ag-paging-page-summary-panel [ref='lbCurrent'],
.ux-grid.aggrid .ag-paging-panel .ag-paging-page-summary-panel [ref='lbTotal'] {
    background: none !important; padding: 0 !important; color: var(--uxg-text) !important; font-weight: 600; margin: 0 .1rem;
}
.ux-grid.aggrid .ag-paging-panel .ag-paging-button {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; padding: 0; margin: 0; border-radius: 6px;
    background: var(--uxg-fill); border: 0; cursor: pointer;
    transition: background-color .15s ease, transform 160ms var(--uxg-ease-out);
}
.ux-grid.aggrid .ag-paging-panel .ag-paging-button:active { transform: scale(0.95); }
.ux-grid.aggrid .ag-paging-panel .ag-paging-button .ag-icon { color: var(--uxg-text-2) !important; }
.ux-grid.aggrid .ag-paging-panel .ag-paging-button.ag-disabled { opacity: .4 !important; cursor: default; }
@media (hover: hover) and (pointer: fine) {
    .ux-grid.aggrid .ag-paging-panel .ag-paging-button:not(.ag-disabled):hover { background: var(--uxg-fill-hover); }
}
/* rows-per-page picker moved here by ux-grid.js (left of "1 – 50 din 300"); opens upwards over the rows */
.ux-grid.aggrid .ag-paging-panel { overflow: visible; }
.ux-grid.aggrid .ag-paging-panel .ux-pagesize { margin: 0 .85rem 0 0 !important; flex: 0 0 auto; }
.ux-grid.aggrid .ag-paging-panel .ux-pagesize .filter-btn { height: 32px; padding: 0 .75rem !important; font-size: .8rem; }
.ux-grid.aggrid .ag-paging-panel .ux-pagesize ~ .ag-paging-row-summary-panel { margin-right: auto !important; }
.ux-grid.aggrid .ag-paging-panel .ux-pagesize .dropdown-menu { min-width: 9rem; margin-bottom: .35rem; }
/* phones: two rows (rows per page + "1 - 20 din 300", then the page buttons centred). The rows area must be
   allowed to shrink for the taller pager (flex min-height: auto kept it full size and the pager was cut off). */
.ux-grid.aggrid .ag-root-wrapper-body.ag-layout-normal { min-height: 0 !important; } /* style.css: calc(100% - 73px) !important */
.ux-grid .ag-root-wrapper > .ag-paging-panel { flex: 0 0 auto; }
/* (.ag-theme-material in the selectors: users.css repeats the base pager rules and loads after this file) */
@media (max-width: 575.98px) {
    .ux-grid.aggrid.ag-theme-material .ag-paging-panel { height: auto; flex-wrap: wrap; row-gap: 8px; column-gap: .5rem; padding: 8px 10px; }
    .ux-grid.aggrid.ag-theme-material .ag-paging-panel .ag-paging-row-summary-panel { margin-left: auto !important; }
    .ux-grid.aggrid.ag-theme-material .ag-paging-panel .ux-pagesize ~ .ag-paging-row-summary-panel { margin-right: 0 !important; }
    .ux-grid.aggrid.ag-theme-material .ag-paging-panel .ag-paging-page-summary-panel { flex: 1 1 100%; justify-content: center; gap: .5rem; }
    .ux-grid.aggrid.ag-theme-material .ag-paging-panel .ag-paging-button { width: 36px; height: 36px; }
    .ux-grid.aggrid.ag-theme-material .ag-paging-panel .ux-pagesize .filter-btn { height: 34px; margin: 0; width: auto; display: inline-flex; align-items: center; }
}

/* ---------- toolbar above the grid (same markup on every list page) ---------- */
.ag-grid-btns { gap: .5rem; margin-bottom: .75rem !important; align-items: center; }
/* sub-pages split the toolbar into two col-md-6 halves: with the gap above, 50% + 50% + gap overflows and the
   right half wraps under the title. Let the halves size to their content instead (they still wrap when narrow). */
.ag-grid-btns > [class*="col-"] { flex: 1 1 auto; width: auto; max-width: none; padding-left: 0; padding-right: 0; align-items: center; gap: .5rem; }
.ag-grid-btns > [class*="col-"] > * { margin-bottom: 0 !important; }
/* style.css gives the right-hand group width: 100%; in toolbars that may wrap (flex-wrap without flex-md-nowrap)
   it then always drops under the page-size button. Size it to its content and let it take the remaining space. */
.ag-grid-btns > .ag-btns { width: auto; flex: 1 1 auto; align-items: center; gap: .5rem; }
.ag-grid-btns > .ag-btns > *, .ag-grid-btns > .sort-dropdown { margin-bottom: 0 !important; }
.ag-grid-btns > .ag-btns > .ag-grid-filter { margin-right: 0 !important; }
/* a full-width search (w-100, e.g. proximity-points) pushed the buttons next to it onto a second row */
/* search: a fixed, comfortable width (pages give it col-4 / w-100, which grew with the screen) */
.ag-grid-btns .ag-grid-filter, .ag-grid-btns > .ag-btns > .ag-grid-filter.w-100 { width: 280px !important; max-width: 100% !important; flex: 0 1 280px !important; }
/* solid grey secondary buttons in toolbars (e.g. "Reincarca puncte") read as disabled: use the soft fill */
.ag-grid-btns .btn-secondary { height: 38px; display: inline-flex; align-items: center; border: 0 !important; border-radius: 8px !important; background: var(--uxg-fill) !important; color: var(--uxg-text) !important; font-weight: 500; box-shadow: none !important; }
@media (hover: hover) and (pointer: fine) { .ag-grid-btns .btn-secondary:hover { background: var(--uxg-fill-hover) !important; } }

/* grids that carry a bootstrap column class (helium pages: "aggrid col-12"): the column padding ended up
   inside the frame; keep the frame edge on the content */
.ux-grid.aggrid[class*="col-"] { padding-left: 0; padding-right: 0; }
.row:has(> .ux-grid.aggrid[class*="col-"]) { margin-left: 0; margin-right: 0; } /* its .row wrapper pulled the frame 14px past the toolbar */
/* card bodies with pb-0 (integration-devices) left the framed grid touching the card's bottom edge */
.card-body.pb-0:has(> .ux-grid), .card-body.pb-0:has(> * > .ux-grid) { padding-bottom: 1.5rem !important; }
/* the toolbar wrapper column on sub-pages adds 14px that the grid below does not have: keep both aligned */
.card-body > .col-12:has(> .ag-grid-btns) { padding-left: 0; padding-right: 0; }
.ag-grid-btns h4 { margin: 0 !important; font-size: 1.15rem; font-weight: 600; color: var(--uxg-text); letter-spacing: -.01em; }
.ag-grid-btns .btn, .ag-grid-btns .form-control { font-size: .85rem; }
/* page size: aggrid.css makes .filter-btn a large pill with !important padding */
.ag-grid-btns .filter-btn,
.sort-dropdown .filter-btn {
    height: 38px; padding: 0 .9rem !important; border-radius: 8px !important;
    border: 0 !important; background: var(--uxg-fill) !important; color: var(--uxg-text) !important; font-weight: 500;
}
.ag-grid-btns .ag-grid-filter {
    height: 38px; margin-top: 0; margin-bottom: 0; border: 1px solid transparent; border-radius: 8px; color: var(--uxg-text);
    background: var(--uxg-fill) url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2716%27 height=%2716%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27%23a5a3ae%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Ccircle cx=%2711%27 cy=%2711%27 r=%278%27/%3E%3Cline x1=%2721%27 y1=%2721%27 x2=%2716.65%27 y2=%2716.65%27/%3E%3C/svg%3E") no-repeat .75rem center; padding-left: 2.25rem;
}
.ag-grid-btns .ag-grid-filter::placeholder { color: #a5a3ae; }
.ag-grid-btns .ag-grid-filter:focus,
.ag-grid-btns .input-group-append .form-control:focus { background-color: #fff; border-color: var(--uxg-primary); box-shadow: 0 0 0 3px rgba(115, 103, 240, .15); }
/* "Optiuni" menu button: was white-on-white with no border; now a filled control like the others */
.ag-grid-btns .actions-dropodown > .btn {
    height: 38px; padding: 0 1rem !important; border: 0 !important; border-radius: 8px !important;
    background: var(--uxg-fill) !important; color: var(--uxg-text) !important; font-weight: 500;
}
/* extra filters some pages put in the toolbar (labels, date ranges, buttons): one aligned row */
.ag-grid-btns label { margin-bottom: 0; white-space: nowrap; text-transform: none; font-size: .82rem; font-weight: 600; color: var(--uxg-text-2); }
.ag-grid-btns .form-group { margin-bottom: 0; }
.ag-grid-btns .input-group-append { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; }
.ag-grid-btns .input-group-append > label { margin: 0 !important; }
.ag-grid-btns .input-group-text {
    height: 38px; margin: 0; background: transparent; border: 0; padding: 0 .1rem; color: var(--uxg-text-3);
}
.ag-grid-btns .input-group-append .form-control { height: 38px; margin: 0; border: 1px solid transparent; border-radius: 8px; background-color: var(--uxg-fill); }
/* date ranges: compact fields so label, range and action button stay on one line */
.ag-grid-btns .input-group-append .form-control[class*="datetimepicker"],
.ag-grid-btns .input-group-append .form-control[class*="datepicker"] { width: 150px !important; flex: 0 0 auto; }
.ag-grid-btns .additional-ag-btns .input-group { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.ag-grid-btns .additional-ag-btns .input-group > [class*="col-"] { padding: 0; width: auto; flex: 0 0 auto; max-width: none; }
.ag-grid-btns .additional-ag-btns .btn { margin-top: 0 !important; height: 38px; }
.ag-grid-btns .dropdown-menu .dropdown-item { font-size: .88rem; color: var(--uxg-text-2); }
.ag-grid-btns .dropdown-menu .dropdown-item i { margin-right: .4rem; }
/* "Optiuni" menu: centered under its button (Popper places it flush left; inline styles need !important) */
.ag-grid-btns .actions-dropodown .dropdown-menu {
    top: 100% !important; left: 50% !important; right: auto !important;
    transform: translateX(-50%) !important; margin-top: .45rem;
}
.ag-grid-btns .actions-dropodown .dropdown-menu::before { left: calc(50% - 1px); right: auto; }

/* light grey borders on white buttons and selects everywhere (theme uses #d8d6de / Bootstrap #dee2e6) */
.btn.btn-white.border { border-color: var(--uxg-border) !important; }
.ag-grid-btns .btn-white { border-color: transparent !important; background-color: var(--uxg-fill) !important; }
.ag-grid-btns .select2-container--default .select2-selection--single,
.ag-grid-btns .select2-container--default .select2-selection--multiple { background: var(--uxg-fill); border-color: transparent; border-radius: 8px; }
.ag-grid-btns .select2-container--default.select2-container--open .select2-selection--single,
.ag-grid-btns .select2-container--default.select2-container--focus .select2-selection--multiple { background: #fff; border-color: var(--uxg-primary); }
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple { border-color: var(--uxg-border); }
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single { border-color: var(--uxg-primary); }
.ag-grid-btns .btn, .ag-grid-btns .dropdown-toggle {
    transition: border-color .15s ease, color .15s ease, background-color .15s ease, transform 160ms var(--uxg-ease-out);
}
.ag-grid-btns .btn:active { transform: scale(0.97); }
.ag-grid-btns .btn:focus-visible { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--uxg-primary); outline: 0; }
@media (hover: hover) and (pointer: fine) {
    .ag-grid-btns .filter-btn:hover, .ag-grid-btns .actions-dropodown > .btn:hover {
        background: var(--uxg-fill-hover) !important; color: var(--uxg-text) !important;
    }
}
@media (prefers-reduced-motion: reduce) {
    .ag-grid-btns .btn:active, .ux-grid .grid-delete-icon:active, .ux-grid .grid-status-icon:active,
    .ux-grid.aggrid .ag-paging-panel .ag-paging-button:active { transform: none; }
}

/* ---------- column filter menu (header ≡ button): a small popover instead of a native select on a grey box ---------- */
.ag-theme-material .ag-menu {
    min-width: 240px; padding: 0; margin-top: 4px;
    background: #fff; border: 1px solid var(--uxg-frame); border-radius: 10px;
    box-shadow: 0 12px 32px rgba(47, 43, 61, .14), 0 2px 6px rgba(47, 43, 61, .06);
    overflow: hidden; font-size: 13px; color: var(--uxg-text);
    transform-origin: top left; animation: uxMenuIn 140ms var(--uxg-ease-out);
}
@keyframes uxMenuIn { from { opacity: 0; transform: scale(.97) translateY(-4px); } }
.ag-theme-material .ag-menu .ag-filter { padding: .75rem; }
.ag-theme-material .ag-menu .ag-filter-body-wrapper { padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.ag-theme-material .ag-menu .ag-filter-body { margin: 0; padding: 0; }
/* condition picker ("Contains", "Equals"...): still a native <select> inside AG Grid, styled like the toolbar selects */
.ag-theme-material .ag-menu select.ag-filter-select,
.ag-theme-material .ag-menu .ag-filter-select {
    -webkit-appearance: none; appearance: none; width: 100%; height: 34px; margin: 0 !important;
    padding: 0 2rem 0 .7rem; border: 1px solid transparent; border-radius: 8px;
    background: var(--uxg-fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236f6b7d' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right .6rem center;
    font-size: 13px; font-weight: 500; color: var(--uxg-text); cursor: pointer;
}
.ag-theme-material .ag-menu .ag-filter-select:focus { outline: 0; border-color: var(--uxg-primary); background-color: #fff; box-shadow: 0 0 0 3px rgba(115, 103, 240, .15); }
/* value input: material theme draws a bottom line only; make it a real field */
.ag-theme-material .ag-menu .ag-input-wrapper { width: 100%; }
.ag-theme-material .ag-menu input.ag-filter-filter,
.ag-theme-material .ag-menu input[type="text"],
.ag-theme-material .ag-menu input[type="number"],
.ag-theme-material .ag-menu input[type="date"] {
    width: 100%; height: 34px; margin: 0 !important; padding: 0 .7rem !important;
    border: 1px solid var(--uxg-border) !important; border-radius: 8px; background: #fff;
    font-size: 13px; color: var(--uxg-text); box-shadow: none;
}
.ag-theme-material .ag-menu input.ag-filter-filter::placeholder,
.ag-theme-material .ag-menu input[type="text"]::placeholder { color: #a5a3ae; }
.ag-theme-material .ag-menu input:focus { outline: 0; border-color: var(--uxg-primary) !important; box-shadow: 0 0 0 3px rgba(115, 103, 240, .15) !important; }
/* AND / OR between the two conditions */
.ag-theme-material .ag-menu .ag-filter-condition {
    display: flex; justify-content: center; gap: 1rem; margin: .6rem 0 .5rem; padding: 0;
    font-size: 12px; font-weight: 600; color: var(--uxg-text-2);
}
.ag-theme-material .ag-menu .ag-filter-condition label { display: inline-flex; align-items: center; gap: .3rem; margin: 0; cursor: pointer; }
.ag-theme-material .ag-menu .ag-filter-condition input[type="radio"] { accent-color: var(--uxg-primary); }
/* apply / reset buttons, when a page enables them */
.ag-theme-material .ag-menu .ag-filter-apply-panel { display: flex; justify-content: flex-end; gap: .4rem; padding: .6rem .75rem; border-top: 1px solid var(--uxg-border-soft); }
.ag-theme-material .ag-menu .ag-filter-apply-panel button {
    height: 30px; padding: 0 .8rem; border: 0; border-radius: 6px; background: var(--uxg-fill);
    font-size: 12px; font-weight: 600; color: var(--uxg-text); cursor: pointer;
}
.ag-theme-material .ag-menu .ag-filter-apply-panel button:last-child { background: var(--uxg-primary); color: #fff; }
/* set filter / checkbox lists */
.ag-theme-material .ag-menu .ag-filter .ag-mini-filter { margin: 0 0 .5rem; }
/* header ≡ button: style.css forces it fully visible; quieter until the header is hovered, primary when a filter is active */
.ux-grid .ag-header-icon.ag-header-cell-menu-button { opacity: .55 !important; transition: opacity .15s ease; }
.ux-grid .ag-header-cell:hover .ag-header-cell-menu-button, .ux-grid .ag-header-cell-menu-button:focus { opacity: 1 !important; }
.ux-grid .ag-header-cell-filtered .ag-header-cell-menu-button .ag-icon,
.ux-grid .ag-header-cell-filtered .ag-header-cell-text { color: var(--uxg-primary) !important; }
@media (hover: none) { .ux-grid .ag-header-icon.ag-header-cell-menu-button { opacity: 1 !important; } }
@media (prefers-reduced-motion: reduce) { .ag-theme-material .ag-menu { animation: none; } }
/* the theme's menu notch points up; this menu opens above its button */
.ux-grid.aggrid .ag-paging-panel .ux-pagesize .dropdown-menu::before { display: none; }
/* groups inside the right-hand toolbar carry grid classes (e.g. points: additional-ag-btns col-md-8):
   a fixed 66% basis pushed "Optiuni" onto a second row. Size them to their content. */
.ag-grid-btns .ag-btns > [class*="col-"] { flex: 0 1 auto; width: auto; max-width: none; }
.ag-grid-btns .ag-btns .brigada-select-wrapper[class*="col-"] { flex: 0 1 auto; width: auto; max-width: none; padding: 0; margin: 0; }
/* filters (date ranges + their action button, e.g. points "Perioada calcul consum") on the left,
   search + Optiuni stay on the right. Visual order only: the markup keeps search first. */
.ag-grid-btns .ag-btns > .additional-ag-btns { order: -1; margin-right: auto !important; }

/* ---------- search box clear (x) button (added by ux-grid.js) ---------- */
/* the input is wrapped in .ux-search: the wrapper now takes the toolbar width the input had */
.ag-grid-btns .ux-search { position: relative; display: inline-flex; align-items: center; flex: 0 1 280px; width: 280px; max-width: 100%; }
.ag-grid-btns .ux-search > .ag-grid-filter { width: 100% !important; max-width: none !important; flex: 1 1 auto !important; margin: 0 !important; }
.ag-grid-btns .ux-search:has(> .ag-grid-filter.d-none) { display: none; }   /* pages that hide the search box */
.ux-search-host > input { padding-right: 2.2rem !important; }
.ux-search-host > input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }  /* users: native x */
.ux-search-clear {
    position: absolute; top: 50%; right: .45rem; z-index: 3;
    display: none; align-items: center; justify-content: center;
    width: 24px; height: 24px; margin-top: -12px; padding: 0;
    border: 0; border-radius: 50%; background: #e4e3e9; color: var(--uxg-text-2); cursor: pointer;
    transition: background-color .15s ease, color .15s ease, transform 120ms var(--uxg-ease-out);
}
.ux-search-host.has-value > .ux-search-clear { display: inline-flex; }
.ux-search-clear:active { transform: scale(0.9); }
.ux-search-clear:focus { outline: 0; }
.ux-search-clear:focus-visible { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--uxg-primary); }
@media (hover: hover) and (pointer: fine) { .ux-search-clear:hover { background: #d6d4dc; color: var(--uxg-text); } }
@media (pointer: coarse) { .ux-search-clear { width: 30px; height: 30px; margin-top: -15px; } }
@media (prefers-reduced-motion: reduce) { .ux-search-clear:active { transform: none; } }

/* "Apasa Enter pentru a cauta" (ux-grid.js): small bubble under the search box, on pages that search on Enter */
.ux-search-hint {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 20;
    padding: .3rem .6rem; border-radius: 6px; background: #2f2b3d; color: #fff;
    font-size: .8rem; line-height: 1.3; white-space: nowrap; pointer-events: none;
    opacity: 0; transform: translateY(-2px); visibility: hidden;
    transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s;
}
.ux-search-hint::before {  /* arrow pointing at the box */
    content: ""; position: absolute; bottom: 100%; left: 14px;
    border: 5px solid transparent; border-bottom-color: #2f2b3d;
}
.ux-search-hint.is-visible { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
@media (prefers-reduced-motion: reduce) { .ux-search-hint { transition: none; transform: none; } }

/* Export CSV progress toast (page-counters.js, toastClass "toast ux-export-toast"): a white card in the grid's own
   colours, not the theme's cyan info toast. Scoped to .ux-export-toast, so every other toast stays as it is.
   Specificity: 0,3,0 beats the theme's .toast-info and the vendor .toast-container > div (and its :hover);
   the icon rule needs !important because the vendor icon is !important; dark mode needs body.dark-layout (0,5,1). */
.toast-container > .toast.ux-export-toast {
    padding: 14px 16px 14px 48px;
    border: 1px solid var(--uxg-border);
    border-radius: 8px;
    background-color: #fff;
    color: var(--uxg-text-2);
    box-shadow: 0 1px 3px rgba(47, 43, 61, .06), 0 6px 20px rgba(47, 43, 61, .10);
    opacity: 1;
    cursor: default;
}
.toast-container > .toast-info.ux-export-toast {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22'%3E%3Ccircle cx='11' cy='11' r='11' fill='%237367f0' fill-opacity='.12'/%3E%3Cpath d='M11 6v7.5M7.75 10.5 11 13.75l3.25-3.25M7 16h8' fill='none' stroke='%237367f0' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-position: 15px 13px;
    background-size: 22px 22px;
}
.ux-export-toast .toast-title { color: var(--uxg-text); font-size: .95rem; font-weight: 600; line-height: 1.35; }
.ux-export-toast .toast-message { margin-top: 2px; font-size: .875rem; line-height: 1.4; }
.ux-export-toast .toast-message b { color: var(--uxg-text); font-weight: 600; }
.ux-export-meta { display: flex; justify-content: space-between; gap: .75rem; margin-top: 6px;
    color: var(--uxg-text-3); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.ux-export-meta .ux-export-pct { color: var(--uxg-primary); font-weight: 600; }
.ux-export-track { position: relative; height: 6px; margin-top: 8px; overflow: hidden;
    border-radius: 999px; background: rgba(115, 103, 240, .16); }
.ux-export-bar { height: 100%; border-radius: inherit; background: var(--uxg-primary);
    transition: width 300ms var(--uxg-ease-out); }
/* start: total not known yet, a short segment slides across the track */
.ux-export-bar.is-indeterminate { width: 40%; transition: none;
    animation: uxExportSlide 1.4s cubic-bezier(.65, 0, .35, 1) infinite; }
@keyframes uxExportSlide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@keyframes uxExportPulse { from { opacity: .35; } to { opacity: .8; } }

body.dark-layout .toast-container > .toast.toast-info.ux-export-toast {
    border-color: #414561;
    background-color: #10163a;
    color: #c2c6dc;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
}
body.dark-layout .toast-container > .toast-info.ux-export-toast {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22'%3E%3Ccircle cx='11' cy='11' r='11' fill='%239e95f5' fill-opacity='.18'/%3E%3Cpath d='M11 6v7.5M7.75 10.5 11 13.75l3.25-3.25M7 16h8' fill='none' stroke='%239e95f5' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
}
body.dark-layout .ux-export-toast .toast-title,
body.dark-layout .ux-export-toast .toast-message b { color: #ebeefd; }
body.dark-layout .ux-export-meta { color: #b4b7bd; }
body.dark-layout .ux-export-meta .ux-export-pct { color: #9e95f5; }
body.dark-layout .ux-export-track { background: rgba(158, 149, 245, .2); }
body.dark-layout .ux-export-bar { background: #8b81f5; }

/* reduced motion: no sliding, no growing; the waiting bar fills the track and breathes instead */
@media (prefers-reduced-motion: reduce) {
    .ux-export-bar { transition: none; }
    .ux-export-bar.is-indeterminate { width: 100%; transform: none; animation: uxExportPulse 1.2s ease-in-out infinite alternate; }
}
