/* ============================================================
   Detail / sub-page chrome (loaded from head.php, after ux-grid.css).
   Every entity page (point, counter, area, integration, ...) shares the same markup:
     .card-header  -> back button + page actions (Editeaza / Adauga / Arhiveaza / Download PDF)
     .card-header  -> <ul class="nav nav-tabs nav-fill" id="myTab"> sub-page tabs
   Presentation only: classes, ids and handlers stay as the pages define them.
   Uses the --uxg-* tokens from ux-grid.css.
   ============================================================ */

/* ---------- header actions: one quiet family instead of purple / black / cyan outlines ---------- */
.card-header .back-btn,
.card-header .btn-edit,
.card-header .btn-add,
.card-header .btn-archive,
.card-header #download-link {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    height: 38px; padding: 0 1rem !important; border-radius: 8px !important;
    border: 1px solid transparent !important; box-shadow: none !important;
    font-size: .9rem; font-weight: 500; line-height: 1;
    transition: background-color .15s ease, color .15s ease, transform 160ms var(--uxg-ease-out);
}
.card-header .btn-edit.d-none, .card-header .btn-add.d-none, .card-header .btn-archive.d-none { display: none !important; }
.card-header .back-btn i, .card-header .btn-edit i, .card-header .btn-add i, .card-header .btn-archive i { font-size: .95em; }

/* secondary: soft grey fill (same as the list toolbars) */
.card-header .back-btn,
.card-header .btn-edit,
.card-header #download-link { background: var(--uxg-fill) !important; color: var(--uxg-text) !important; }
/* create: primary tint, so it reads as the main action without shouting */
.card-header .btn-add { background: #efedfd !important; color: #4f3fc4 !important; }
/* destructive: red tint */
.card-header .btn-archive { background: #fde7e7 !important; color: #b42318 !important; }

.card-header .back-btn:active, .card-header .btn-edit:active, .card-header .btn-add:active,
.card-header .btn-archive:active, .card-header #download-link:active { transform: scale(0.97); }
.card-header .back-btn:focus-visible, .card-header .btn-edit:focus-visible, .card-header .btn-add:focus-visible,
.card-header .btn-archive:focus-visible, .card-header #download-link:focus-visible { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--uxg-primary) !important; outline: 0; }
@media (hover: hover) and (pointer: fine) {
    .card-header .back-btn:hover, .card-header .btn-edit:hover, .card-header #download-link:hover { background: var(--uxg-fill-hover) !important; }
    .card-header .btn-add:hover { background: #e2defc !important; }
    .card-header .btn-archive:hover { background: #fbd5d5 !important; }
}

/* ---------- sub-page tabs: left-aligned tab bar on a hairline, active tab underlined on the edge ---------- */
.card-header .nav.nav-tabs.nav-fill {
    display: flex; flex-wrap: nowrap; gap: 2rem; margin: 0; padding: 0;
    border-bottom: 1px solid var(--uxg-frame);
    overflow-x: auto; scrollbar-width: none;   /* many tabs on a phone: scroll sideways, never wrap */
}
.card-header .nav.nav-tabs.nav-fill::-webkit-scrollbar { display: none; }
.card-header .nav.nav-tabs.nav-fill .nav-item { flex: 0 0 auto; margin: 0; text-align: left; }
.card-header .nav.nav-tabs.nav-fill .nav-link {
    position: relative; display: inline-flex; align-items: center;
    padding: .9rem .1rem .85rem; border: 0; background: transparent;
    font-size: 1rem; font-weight: 600; color: var(--uxg-text-3); white-space: nowrap;
    transition: color 150ms ease;
}
.card-header .nav.nav-tabs.nav-fill .nav-link.active { color: var(--uxg-primary); background: transparent; }
/* theme draws the underline below the link (top: 100%) with a glow; put it on the hairline instead */
.card-header .nav.nav-tabs.nav-fill .nav-item .nav-link.active:after {
    top: auto; bottom: -1px; left: 0; right: 0; height: 3px;
    border-radius: 3px 3px 0 0; box-shadow: none !important; background: var(--uxg-primary) !important;
}
.card-header .nav.nav-tabs.nav-fill .nav-link:focus { outline: 0; }
.card-header .nav.nav-tabs.nav-fill .nav-link:focus-visible { box-shadow: inset 0 -3px 0 var(--uxg-primary); }
@media (hover: hover) and (pointer: fine) {
    .card-header .nav.nav-tabs.nav-fill .nav-link:not(.active):hover { color: var(--uxg-text); }
}
@media (max-width: 575.98px) {
    .card-header .nav.nav-tabs.nav-fill { gap: 1.25rem; }
    .card-header .nav.nav-tabs.nav-fill .nav-link { font-size: .95rem; }
}

/* the tab bar's own card-header: no extra top gap when it follows the actions header */
.card-header + .card-header { padding-top: .5rem; }

@media (prefers-reduced-motion: reduce) {
    .card-header .back-btn:active, .card-header .btn-edit:active, .card-header .btn-add:active,
    .card-header .btn-archive:active, .card-header #download-link:active { transform: none; }
}

/* ============================================================
   Date range (pickadate): ".input-group-append > input.datetimepicker-start - input.datetimepicker-end"
   Used on lists, charts and reports. The field and the calendar get the same soft, rounded look as
   the toolbars. pickadate.css is linked later in <body>, so calendar rules carry an extra class.
   ============================================================ */
.input-group-append > .form-control[class*="datetimepicker"],
.input-group-append > .picker__input.form-control {
    height: 38px; width: 150px !important; flex: 0 0 auto;
    padding: 0 .75rem 0 2.2rem !important; margin: 0;
    border: 1px solid transparent !important; border-radius: 8px !important;
    background: var(--uxg-fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236f6b7d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") no-repeat .7rem center !important;
    color: var(--uxg-text) !important; font-size: .85rem; font-weight: 500; cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.input-group-append > .form-control[class*="datetimepicker"]:focus,
.input-group-append > .picker__input.picker__input--active {
    background-color: #fff !important; border-color: var(--uxg-primary) !important; box-shadow: 0 0 0 3px rgba(115, 103, 240, .15);
}
@media (hover: hover) and (pointer: fine) {
    .input-group-append > .form-control[class*="datetimepicker"]:not(:focus):not(.picker__input--active):hover { background-color: var(--uxg-fill-hover) !important; }
}
/* the "-" between the two dates was a grey bordered box: make it a plain en dash */
.input-group-append:has(> [class*="datetimepicker"]) { display: flex; align-items: center; gap: .4rem; }
.input-group-append:has(> [class*="datetimepicker"]) > .input-group-text {
    height: auto; padding: 0 .1rem; margin: 0; border: 0; background: transparent;
    color: var(--uxg-text-3); font-size: 0;
}
.input-group-append:has(> [class*="datetimepicker"]) > .input-group-text::before { content: "\2013"; font-size: .9rem; }

/* ---------- the calendar ---------- */
.picker.picker--opened .picker__holder {
    width: 300px; max-width: 300px; max-height: none; margin-top: 6px;
    border: 1px solid var(--uxg-frame) !important; border-radius: 12px;
    box-shadow: 0 12px 32px rgba(47, 43, 61, .14), 0 2px 6px rgba(47, 43, 61, .06);
    overflow: hidden; transform-origin: top left;
    animation: uxPickerIn 160ms var(--uxg-ease-out);
}
@keyframes uxPickerIn { from { opacity: 0; transform: scale(.97) translateY(-4px); } }
.picker .picker__box { padding: .75rem .75rem .5rem; }
.picker .picker__header { padding: .25rem 0 .75rem; font-size: .95rem; }
.picker .picker__month { font-weight: 600; color: var(--uxg-text); margin: 0 .2rem; }
.picker .picker__year { font-size: .95rem; font-weight: 500; color: var(--uxg-text-3); margin: 0 .2rem; }
.picker .picker__nav--prev, .picker .picker__nav--next {
    width: 32px; height: 32px; padding: 0; margin-top: -20px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center; color: var(--uxg-text-2);
}
.picker .picker__nav--prev { left: 0; }
.picker .picker__nav--next { right: 0; }
.picker .picker__nav--prev:before { content: '\f104'; font-size: 18px; width: auto; }
.picker .picker__nav--next:before { content: '\f105'; font-size: 18px; width: auto; }
.picker .picker__nav--prev:hover, .picker .picker__nav--next:hover { background: var(--uxg-fill); }
.picker .picker__table { margin-bottom: .25rem; }
.picker .picker__weekday { padding-bottom: .4rem; font-size: 11px; font-weight: 600; color: #a5a3ae; text-transform: uppercase; letter-spacing: .04em; }
.picker .picker__day {
    width: 36px; height: 36px; line-height: 36px; padding: 0; margin: 1px auto;
    border-radius: 50%; font-size: .85rem; color: var(--uxg-text);
}
.picker .picker__day.picker__day--outfocus { color: #c4c3cb; }
.picker .picker__day--infocus:hover, .picker .picker__day--outfocus:hover { background: var(--uxg-fill); color: var(--uxg-text); }
/* today: primary text + a dot instead of the cyan corner triangle */
.picker .picker__day.picker__day--today { background: transparent; color: var(--uxg-primary); font-weight: 700; }
.picker .picker__day.picker__day--today:before {
    top: auto; bottom: 5px; left: 50%; right: auto; width: 4px; height: 4px; margin-left: -2px;
    border: 0; border-radius: 50%; background: currentColor;
}
.picker .picker__day.picker__day--highlighted { background: var(--uxg-fill); color: var(--uxg-text); border-radius: 50%; }
.picker .picker__day.picker__day--selected,
.picker.picker--focused .picker__day.picker__day--selected,
.picker .picker__day.picker__day--selected:hover { background: var(--uxg-primary); color: #fff; border-radius: 50%; font-weight: 600; }
.picker .picker__day.picker__day--selected:before { background: #fff; }
.picker .picker__day.picker__day--disabled, .picker .picker__day.picker__day--disabled:hover { background: transparent; color: #d0cfd6; text-decoration: line-through; }
/* footer: Azi / Sterge / Inchide as quiet text buttons */
.picker .picker__footer { display: flex; justify-content: space-between; gap: .25rem; padding-top: .5rem; border-top: 1px solid var(--uxg-border-soft); }
.picker .picker__footer button {
    padding: .4rem .7rem; border-radius: 8px; background: transparent;
    font-size: .82rem; font-weight: 600; color: var(--uxg-text-2);
}
.picker .picker__footer button:before { display: none; }
.picker .picker__footer .picker__button--today { color: var(--uxg-primary); }
.picker .picker__footer button:hover, .picker .picker__footer button:focus { background: var(--uxg-fill); }
.picker .picker__select--month, .picker .picker__select--year {
    height: 30px; border: 1px solid var(--uxg-border); border-radius: 6px; font-size: .85rem; color: var(--uxg-text);
}
@media (prefers-reduced-motion: reduce) {
    .picker.picker--opened .picker__holder { animation: none; }
}

/* ============================================================
   Navigation feel
   ============================================================ */

/* Loading masks (the map pages' .map-preloader): they block clicks from the first frame, but only become
   visible if loading takes longer than 300ms. The full-screen page mask was removed from header.php. */
.loading-mask { animation: uxMaskIn 150ms ease-out 300ms both; }
@keyframes uxMaskIn { from { opacity: 0; } }

/* Page-to-page cross-fade (Chrome / Edge 126+, ignored elsewhere): the old page stays on screen until the new
   one can paint, then they cross-fade quickly. Only the whole page (root) takes part. Do NOT give the sidebar
   (or any other element) its own view-transition-name: a named element is shown as a snapshot image scaled to
   its box, and when the old and new menu differ in size the image is stretched, so the menu text looked bolder
   and the icons bigger until the real menu appeared. The root snapshot is never scaled, and the menu is the
   same on both pages, so it simply stays still. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 140ms; animation-timing-function: ease-out; }

@media (prefers-reduced-motion: reduce) {
    .loading-mask { animation: none; }
    ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ---------- selects before select2 takes over ----------
   Pages turn <select class="select2"> into select2 boxes in their scripts at the end of the page; until then the
   browser's own select showed for a moment. Draw it like the select2 box from the first frame. select2 adds
   .select2-hidden-accessible to the original element when it is done, which switches this off. */
select.select2:not(.select2-hidden-accessible),
select.role-filter:not(.select2-hidden-accessible) {
    -webkit-appearance: none; appearance: none;
    height: 38px; padding: 0 2rem 0 .75rem; border: 1px solid var(--uxg-border); border-radius: 5px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0h10L5 6z' fill='%23888'/%3E%3C/svg%3E") no-repeat right .75rem center;
    color: var(--uxg-text-2); font-size: .9rem;
}

/* ============================================================
   Dialogs (Bootstrap modals)
   ============================================================ */
/* style.css washes the page with 50% white behind every dialog: the page stayed too readable and the dialog
   did not stand out. Dim it instead (dim to focus). Bootstrap's own backdrop is kept invisible so the two
   layers do not stack into a darker shade on some pages than on others. */
.modal { background: rgba(30, 27, 40, .55); }
.modal-backdrop.show { opacity: 0; }

/* wider default dialog: 500px -> 640px (modal-sm / -lg / -xl and side panels keep their own sizes) */
@media (min-width: 576px) {
    .modal-dialog:not(.modal-sm):not(.modal-lg):not(.modal-xl):not(.sidebar-lg) { max-width: 640px; }
}
.modal-content { border: 0; border-radius: 12px; box-shadow: 0 24px 60px rgba(30, 27, 40, .28); }

/* "Configurare Coloane": with the wider dialog the column list fits in two columns (half the scrolling) */
@media (min-width: 576px) {
    .modal-config-column .modal-body { column-count: 2; column-gap: 2rem; }
    .modal-config-column .modal-body > div { break-inside: avoid; margin: 0 0 .45rem !important; } /* inline margin: 5px misaligned the column tops */
}
/* search box above the column list (added by ux-grid.js); stays put while the list scrolls */
.modal-config-column .ux-col-search { padding: 1rem 1rem 0; }
.modal-config-column .ux-col-search .ux-search { position: relative; display: block; }
.modal-config-column .ux-col-search input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; } /* ours replaces the native x */
.modal-config-column .modal-body > div[hidden] { display: none !important; }
.modal-config-column .ux-col-search-empty { padding: 0 1rem 1rem; color: var(--uxg-text-2, #6e6b7b); }
.modal-config-column .ux-col-search-empty[hidden] { display: none; }

/* ============================================================
   Page loading (every page): skeletons instead of empty fields
   head.php adds html.ux-page-loading before the first paint; footer.php removes it when the page's
   requests are done. Fields keep their exact size, so nothing moves when the data arrives.
   Cards that hold a grid are left out: the grid has its own loading state and its filters stay usable.
   ============================================================ */
html.ux-page-loading .content-body .card:not(:has(.aggrid)) :is(.form-control, textarea, .select2-selection, .consumer-card, .consumer-list,
    .hero-name, .hero-contact, .hero-badges, .hero-initials):not(.ag-grid-btns *):not(.aggrid *):not(.modal *) {
    color: transparent !important; border-color: transparent !important; box-shadow: none !important;
    background: linear-gradient(90deg, #f1f0f4 0%, #e6e5eb 40%, #f1f0f4 80%) !important; background-size: 300% 100% !important;
    border-radius: 6px !important; pointer-events: none;
    /* nothing for the first 150ms (fast loads never flash grey), then the shimmer */
    animation: uxSkelIn 150ms ease-out 150ms both, uxShimmer 1.4s ease-in-out 300ms infinite;
}
html.ux-page-loading .content-body .card:not(:has(.aggrid)) :is(.form-control, .select2-selection, .consumer-card, .consumer-list,
    .hero-name, .hero-contact, .hero-badges, .hero-initials):not(.ag-grid-btns *):not(.aggrid *):not(.modal *) * { visibility: hidden; }
html.ux-page-loading .content-body .card:not(:has(.aggrid)) :is(.form-control, textarea)::placeholder { color: transparent !important; }
/* user header: text blocks get a readable skeleton shape */
html.ux-page-loading .user-hero .hero-name { max-width: 260px; }
html.ux-page-loading .user-hero .hero-contact { height: 14px; max-width: 220px; margin-top: .45rem; }
html.ux-page-loading .user-hero .hero-badges { height: 22px; max-width: 140px; margin-top: .5rem; }
@keyframes uxSkelIn { from { opacity: 0; } }
@keyframes uxShimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* data arrived: values settle in (opacity only, short) */
html.ux-page-ready .content-body .card:not(:has(.aggrid)) :is(.form-control, textarea, .select2-selection, .consumer-card, .consumer-list,
    .hero-name, .hero-contact, .hero-badges):not(.ag-grid-btns *):not(.aggrid *) { animation: uxValueIn 180ms ease-out; }
@keyframes uxValueIn { from { opacity: .35; } }

@media (prefers-reduced-motion: reduce) {
    html.ux-page-loading .content-body .card:not(:has(.aggrid)) :is(.form-control, textarea, .select2-selection, .consumer-card, .consumer-list,
        .hero-name, .hero-contact, .hero-badges, .hero-initials) { animation: uxSkelIn 150ms ease-out 150ms both; }
    html.ux-page-ready .content-body * { animation: none !important; }
}

/* ---------- side menu: identical from the first paint ----------
   header.php now renders body.menu-expanded up front (before, app-menu.js added it at load). The theme fades the
   menu labels and the brand in (0.3s) whenever that class appears, which would replay on every page change and
   read as the text changing weight. The menu is not toggled between collapsed / expanded in this app: no fade. */
body.vertical-layout.vertical-menu-modern.menu-expanded .main-menu .navigation > li > a > span,
body.vertical-layout.vertical-menu-modern.menu-expanded .navbar .navbar-brand .brand-text,
body.vertical-layout.vertical-menu-modern.menu-expanded .main-menu .navbar-header .brand-text { animation: none; }

/* ============================================================
   QA banner (menu.php, only on the test database)
   It was a fixed bar at its static position: on phones it sat over the top of the first card, on desktop
   over the top of the page. Desktop: a small tab hanging from the top edge. Phones / tablets (where the
   title bar shows): a slim strip in the page flow right under the title bar, so it pushes content down.
   ============================================================ */
.qa-banner {
    position: fixed; top: 0; left: 50%; z-index: 1040; transform: translateX(-50%);
    padding: 7px 24px; border-radius: 0 0 12px 12px;
    background: #ff9f43; color: #fff; font-size: 14px; font-weight: 600; line-height: 1.4; letter-spacing: .01em;
    white-space: nowrap; pointer-events: none; box-shadow: 0 2px 8px rgba(255, 159, 67, .35);
}
@media (max-width: 991.98px) {
    .qa-banner {
        position: relative; top: auto; left: auto; transform: none; z-index: auto;
        display: block; width: 100%; padding: 4px 12px; border-radius: 0; box-shadow: none;
        text-align: center; font-size: 11.5px;
    }
}

/* ============================================================
   Phones and tablets (< 992px: the theme swaps the side menu for the title bar)
   ============================================================ */
@media (max-width: 991.98px) {
    /* title bar: stays on screen while scrolling, title + menu button on one centred line */
    .header-navbar.mobile-menu {
        position: sticky !important; top: 0; z-index: 1000;
        min-height: 0; padding: 0; margin: 0; background: #fff; box-shadow: 0 1px 0 var(--uxg-frame) !important;
    }
    .header-navbar.mobile-menu > .col-12 {
        display: flex; align-items: center; justify-content: space-between; gap: .5rem;
        height: 52px; padding: 0 4px 0 16px;
    }
    .header-navbar.mobile-menu h4 {
        flex: 1 1 auto; min-width: 0; margin: 0 !important;
        font-size: 1.05rem; font-weight: 600; letter-spacing: -.01em; color: var(--uxg-text);
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .header-navbar.mobile-menu .menu-toggle {
        flex: 0 0 auto; display: inline-flex !important; align-items: center; justify-content: center;
        width: 44px; height: 44px; padding: 0 !important; margin: 0; border-radius: 10px; float: none !important;
        transition: background-color .15s ease, transform 160ms var(--uxg-ease-out);
    }
    .header-navbar.mobile-menu .menu-toggle:active { background: var(--uxg-fill); transform: scale(.95); }
    .header-navbar.mobile-menu .menu-toggle .ficon { font-size: 1.4rem; color: var(--uxg-text); }
    /* the slide-in menu had no top set, so it started below the title bar and banner (and moved with the page
       scroll): a full-height drawer from the top edge, over the title bar */
    .main-menu.menu-fixed { top: 0 !important; height: 100% !important; }

    /* header actions (Inapoi / Editeaza / Punct nou ...): style.css stretches every .btn to the full width below
       992px, which stacked them into a tall column. One wrapping row of compact buttons instead, back button first. */
    .card-header > .col-12:has(> .back-btn, > .btn-edit, > .btn-add, > .btn-archive, > #download-link) {
        display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    }
    .card-header .back-btn, .card-header .btn-edit, .card-header .btn-add,
    .card-header .btn-archive, .card-header #download-link, .card-header > .col-12 > .btn {
        width: auto !important; flex: 0 0 auto; float: none !important; margin: 0 !important;
        height: 36px; padding: 0 .85rem !important; font-size: .85rem;
    }
    .card-header > .col-12 > .back-btn { margin-right: auto !important; }
    /* point: "Seteaza GPS" (black outline) joins the same soft family */
    .card-header .btn-edit-gps { display: inline-flex; align-items: center; gap: .4rem; border: 0 !important; border-radius: 8px !important;
        background: var(--uxg-fill) !important; color: var(--uxg-text) !important; box-shadow: none !important; }
    .card-header .btn-edit-gps.d-none { display: none !important; }
    /* any other header button (point: "Citire Manuala", an outline link): centred text, same soft look */
    .card-header > .col-12 > .btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; line-height: 1; }
    .card-header .btn-add-manual-reading { border: 0 !important; border-radius: 8px !important; background: #efedfd !important; color: #4f3fc4 !important; box-shadow: none !important; }
    .card-header > .col-12 > .btn.d-none, .card-header .btn-add-manual-reading.d-none { display: none !important; }
    .card-header .btn-edit.d-none, .card-header .btn-add.d-none, .card-header .btn-archive.d-none,
    .card-header > .col-12 > .btn.d-none { display: none !important; }
}

/* ============================================================
   Phones (< 768px): tighter spacing, toolbars that wrap cleanly, compact actions
   ============================================================ */
@media (max-width: 767.98px) {
    /* page gutter and card padding: 17px + 21px a side left the content 300px wide on a 390px phone */
    html body .content .content-wrapper { padding: 12px 10px 0; }
    .content-body .card { margin-bottom: 12px; border-radius: 12px; }
    .content-body .card .card-body { padding: 14px; }
    .content-body .card .card-header { padding: 14px 14px 0; }
    .content-body .card .card-header.row { margin-left: 0; margin-right: 0; }
    .content-body .card .card-header.row > .col-12 { padding-left: 0; padding-right: 0; }
    /* my-point: back button (col-auto) and the toolbar (col) side by side squeezed the dates: stack them */
    .content-body .card .card-header.row:has(> .col-auto) { row-gap: 10px; }
    .content-body .card .card-header.row > .col-auto,
    .content-body .card .card-header.row > .col-auto ~ .col { flex: 1 1 100%; max-width: 100%; padding-left: 0; padding-right: 0; }
    .content-body .card .card-header.row > .col-auto > .back-btn { width: auto !important; margin: 0 !important; height: 36px; padding: 0 .85rem !important; }
    .content-body .card .card-body .card-body { padding: 0; }   /* nested bodies doubled the inset */
    .card-body.pb-0:has(> .ux-grid), .card-body.pb-0:has(> * > .ux-grid) { padding-bottom: 14px !important; }

    .card-header + .card-header { padding-top: .25rem; }

    /* sub-page tabs scroll sideways: fade the right edge so the hidden tabs read as "more" */
    .card-header .nav.nav-tabs.nav-fill {
        gap: 1.1rem; padding-right: 28px;
        -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
                mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
    }
    .card-header .nav.nav-tabs.nav-fill .nav-link { font-size: .92rem; padding: .7rem 0 .65rem; }

    /* ---------- list toolbars ---------- */
    .ag-grid-btns { flex-wrap: wrap !important; gap: 8px; margin-bottom: 10px !important; }
    .ag-grid-btns > .ag-btns { flex: 1 1 100%; flex-wrap: wrap !important; gap: 8px; }
    .ag-grid-btns > [class*="col-"] { flex: 1 1 100%; flex-wrap: wrap; gap: 8px; justify-content: flex-start !important; }
    .ag-grid-btns h4 { font-size: 1.05rem; }
    /* search takes the free width, the Optiuni button stays next to it */
    .ag-grid-btns .ux-search { flex: 1 1 0 !important; width: auto !important; min-width: 0; max-width: none; }
    .ag-grid-btns .ag-grid-filter, .ag-grid-btns > .ag-btns > .ag-grid-filter.w-100 { flex: 1 1 0 !important; width: auto !important; min-width: 0; }
    .ag-grid-btns .ux-search > .ag-grid-filter { flex: 1 1 auto !important; width: 100% !important; }
    /* style.css pins the Optiuni menu to the card's top edge below 768px, where it covered the search box */
    .ag-grid-btns .action-btns { position: static !important; flex: 0 0 auto; margin: 0 !important; }
    .ag-grid-btns .actions-dropodown .dropdown-menu { left: auto !important; right: 0 !important; transform: none !important; }
    .ag-grid-btns .actions-dropodown .dropdown-menu::before { left: auto; right: 1.2rem; }
    .ag-grid-btns .btn { width: auto; margin: 0 !important; padding-top: 0 !important; padding-bottom: 0 !important; }
    /* page filters (date range, "Incarca date consum", selects): their own full row above search */
    .ag-grid-btns .additional-ag-btns { flex: 1 1 100% !important; width: 100% !important; max-width: 100% !important; margin: 0 !important; }
    .ag-grid-btns .additional-ag-btns .input-group > [class*="col-"] { flex: 1 1 100%; }
    .ag-grid-btns .additional-ag-btns .btn { width: 100%; justify-content: center; display: inline-flex; align-items: center; }
    /* devices: the outlined "Add" became a full-width purple frame; same soft tint as the other create buttons */
    .ag-grid-btns .additional-ag-btns .btn-outline-primary { border: 0 !important; border-radius: 8px !important; background: #efedfd !important; color: #4f3fc4 !important; box-shadow: none !important; }
    .ag-grid-btns .additional-ag-btns .btn.d-none { display: none !important; }
    .ag-grid-btns .additional-ag-btns .form-group { width: 100%; }
    .ag-grid-btns .additional-ag-btns .select2-container { width: 100% !important; }

    /* date range: two equal fields with the dash between them, the label (if any) on its own line */
    .input-group-append:has(> [class*="datetimepicker"]) { flex-wrap: wrap; width: 100%; }
    .input-group-append:has(> [class*="datetimepicker"]) > label { flex: 1 1 100%; text-align: left; }
    .input-group-append > .form-control[class*="datetimepicker"],
    .input-group-append > .picker__input.form-control { flex: 1 1 0 !important; width: auto !important; min-width: 0; }
    /* sub-pages: date range and the Action button share a row when they fit */
    .ag-grid-btns > [class*="col-"] > .additional-ag-btns:has([class*="datetimepicker"]) { flex: 1 1 220px !important; width: auto !important; }

    /* the calendar: centred on the screen instead of hanging off the field's left edge */
    .picker.picker--opened .picker__holder {
        position: fixed; left: 50%; top: 50%; margin: 0; transform: translate(-50%, -50%);
        width: min(320px, calc(100vw - 24px)); max-width: none;
        transform-origin: center; animation-name: uxPickerInM;
    }
    @keyframes uxPickerInM { from { opacity: 0; transform: translate(-50%, -50%) scale(.97); } }

    /* forms: labels closer to their fields */
    .content-body .form-group { margin-bottom: .85rem; }

    /* dialogs: nearly full width, 12px from the edges */
    .modal-dialog { margin: 12px auto; max-width: calc(100vw - 24px); }
    .modal-content { border-radius: 14px; }
}

@media (max-width: 767.98px) and (prefers-reduced-motion: reduce) {
    .header-navbar.mobile-menu .menu-toggle:active { transform: none; }
}

/* ---------- groups of buttons (all pages, phones and tablets) ----------
   style.css makes every .btn a full-width block below 992px (width: 100%; display: block; margin: 5px 0), so any
   two or more buttons side by side became a stack of bars (e.g. organization: Save / Delete / Log in, dialog
   footers). A container holding only buttons now lays them out in one wrapping row that shares the width.
   A single button (Import, Genereaza ...) keeps the full width, which suits a form's main action. */
@media (max-width: 991.98px) {
    :is(.content-body, .modal) :is(div, span, li, p):has(> .btn:not(.d-none) ~ .btn:not(.d-none)):not(:has(> :not(.btn, .d-none, script, input[type="hidden"], br))):not(.btn-group):not(.input-group):not(.dropdown-menu):not(.ag-grid-btns *):not(.card-header *):not(.hero-actions) {
        display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    }
    :is(.content-body, .modal) :is(div, span, li, p):has(> .btn:not(.d-none) ~ .btn:not(.d-none)):not(:has(> :not(.btn, .d-none, script, input[type="hidden"], br))):not(.btn-group):not(.input-group):not(.dropdown-menu):not(.ag-grid-btns *):not(.card-header *):not(.hero-actions) > .btn {
        flex: 1 1 auto; width: auto; min-width: 0; margin: 0 !important; float: none;
        display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
        min-height: 40px; padding: .55rem .9rem !important; white-space: nowrap;
    }
    :is(.content-body, .modal) :is(div, span, li, p):has(> .btn:not(.d-none) ~ .btn:not(.d-none)):not(.card-header *):not(.hero-actions) > .btn.d-none { display: none !important; }
    /* buttons next to each other inside a container that also holds other things (organization: the form fields,
       then Save / Delete / Log in): keep them on one line at their natural width instead of full-width bars */
    :is(.content-body, .modal) .btn:not(.d-none):is(:has(~ .btn:not(.d-none)), .btn:not(.d-none) ~ .btn):not(.ag-grid-btns *):not(.card-header *):not(.hero-actions *):not(.btn-group *):not(.input-group *):not(.dropdown-menu *):not(.modal-footer > *) {
        display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
        width: auto; min-height: 40px; margin: 0 6px 8px 0 !important; padding: .55rem 1rem !important; float: none; vertical-align: top;
    }
    /* dialog footers: same row, main action last on the right as Bootstrap orders them */
    .modal .modal-footer { flex-wrap: wrap; gap: 8px; }
    .modal .modal-footer > .btn { flex: 1 1 auto; width: auto; margin: 0 !important; }
}

/* ============================================================
   Phones: header actions on one row (assets/js/ux-page.js moves the extra actions into a "more" menu)
     detail pages:  [<-]                       [...] [Editeaza]
     user pages:    [      Editeaza      ] [...]
   ============================================================ */
.ux-more { display: none; }
@media (max-width: 767.98px) {
    /* back button: only the arrow (the label stays for screen readers through aria-label) */
    .card-header > .col-12 > .back-btn { width: 36px !important; padding: 0 !important; gap: 0 !important; font-size: 0 !important; }
    .card-header > .col-12 > .back-btn i { font-size: 18px; margin: 0; }
    .card-header > .col-12 > .ux-more { order: 1; }
    .card-header > .col-12 > .btn-edit { order: 2; }
    .card-header > .col-12 { flex-wrap: nowrap !important; }

    .ux-more { display: block; position: relative; flex: 0 0 auto; }
    /* nothing visible inside (the page has not shown any of these actions yet): no (...) button */
    .ux-more:not(:has(.ux-more-menu > .btn:not(.d-none))) { display: none; }
    .ux-more-btn {
        display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0;
        border: 0; border-radius: 8px; background: var(--uxg-fill); color: var(--uxg-text); cursor: pointer;
        transition: background-color .15s ease, transform 160ms var(--uxg-ease-out);
    }
    .ux-more-btn:active { transform: scale(.95); }
    .ux-more-btn:focus { outline: 0; }
    .ux-more-btn:focus-visible { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--uxg-primary); }
    .ux-more.open .ux-more-btn { background: var(--uxg-fill-hover); }

    /* the menu: anchored under its button, grows from that corner */
    .ux-more-menu {
        position: absolute; top: calc(100% + 6px); right: 0; z-index: 1050;
        min-width: 210px; padding: 6px; border-radius: 12px; background: #fff;
        box-shadow: 0 12px 32px rgba(47, 43, 61, .16), 0 2px 6px rgba(47, 43, 61, .08);
        opacity: 0; visibility: hidden; pointer-events: none;
        transform: scale(.96) translateY(-4px); transform-origin: top right;
        transition: opacity 120ms ease-out, transform 120ms var(--uxg-ease-out), visibility 0s linear 120ms;
    }
    .ux-more.open .ux-more-menu {
        opacity: 1; visibility: visible; pointer-events: auto; transform: none;
        transition: opacity 160ms ease-out, transform 160ms var(--uxg-ease-out), visibility 0s;
    }
    .ux-more-menu > .btn {
        display: flex !important; align-items: center; justify-content: flex-start; gap: .6rem;
        width: 100% !important; height: 42px; margin: 0 !important; padding: 0 .75rem !important;
        border: 0 !important; border-radius: 8px !important; box-shadow: none !important;
        background: transparent !important; color: var(--uxg-text) !important;
        font-size: .92rem; font-weight: 500; text-align: left; white-space: nowrap; line-height: 1;
    }
    .ux-more-menu > .btn i { width: 16px; margin: 0 !important; text-align: center; color: var(--uxg-text-3); }
    .ux-more-menu > .btn:active { background: var(--uxg-fill) !important; }
    .ux-more-menu > .btn.d-none { display: none !important; }
    .ux-more-menu > .btn:disabled, .ux-more-menu > .btn.disabled { opacity: .45; }
    /* destructive actions stay red */
    .ux-more-menu > :is(.btn-archive, .btn-delete, .btn-outline-danger, .btn-danger) { color: #b42318 !important; }
    .ux-more-menu > :is(.btn-archive, .btn-delete, .btn-outline-danger, .btn-danger) i { color: #b42318; }

    /* user pages: Editeaza takes the row, (...) holds User nou / Sterge */
    .user-hero .hero-actions > .btn-edit { order: 0; flex: 1 1 auto !important; }
    .user-hero .hero-actions > .ux-more { order: 1; }
    .user-hero .hero-actions .ux-more-btn { width: 40px; height: 40px; }
}
@media (max-width: 767.98px) and (prefers-reduced-motion: reduce) {
    .ux-more-menu, .ux-more.open .ux-more-menu { transform: none; transition: opacity 120ms ease-out, visibility 0s; }
    .ux-more-btn:active { transform: none; }
}

/* ---------- side menu on phones: 75% of the screen instead of the theme's fixed 260px ----------
   The theme hides the slide-in menu at left: -260px and opens it with translateX(260px): both follow the width. */
@media (max-width: 767.98px) {
    body.vertical-overlay-menu .main-menu,
    body.vertical-overlay-menu.menu-hide .main-menu,
    body.vertical-overlay-menu.menu-expanded .main-menu { width: 75vw !important; left: -75vw !important; }
    body.vertical-overlay-menu.menu-open .main-menu { transform: translate3d(75vw, 0, 0) !important; }
    body.vertical-overlay-menu .main-menu .main-menu-footer,
    body.vertical-overlay-menu .main-menu .navbar-header { width: 75vw !important; }
}

/* ============================================================
   Map pages on phones (map, map-radio, map-radio-new, map-compare)
   The map fills the screen under the title bar; the filters float over its top edge as one compact card
   ([zone ........] [Filtre]), the statistics and the legend sit at its bottom-left.
   Before: style.css gave the zone picker a fixed 500px width (the whole page scrolled sideways), the filter bar
   covered the qa banner, the "Filtre" toggle hung off the card's right edge and the legend was 400px wide.
   ============================================================ */
@media (max-width: 767.98px) {
    :is(.map-page, .map-radio-page, .map-radio-new-page, .map-compare-page) .full-map.full-height-vh {
        height: calc(var(--vh, 1vh) * 100 - 52px) !important;
    }
    body:has(.qa-banner):is(.map-page, .map-radio-page, .map-radio-new-page, .map-compare-page) .full-map.full-height-vh {
        height: calc(var(--vh, 1vh) * 100 - 76px) !important;
    }

    /* the theme gives .content a min-height of ~100vh that does not count the title bar and banner: the page
       scrolled ~20px past the map */
    :is(.map-page, .map-radio-page, .map-radio-new-page, .map-compare-page) .app-content.content { min-height: 0 !important; }

    /* the floating filter card */
    .header-navbar.filter-navbar.floating-nav {
        position: absolute !important; top: 60px; left: 10px !important; right: 10px; z-index: 20;
        width: auto !important; max-width: none !important; min-height: 0; margin: 0 !important; padding: 0;
        border-radius: 12px; background: #fff; box-shadow: 0 6px 20px rgba(47, 43, 61, .16) !important;
    }
    body:has(.qa-banner) .header-navbar.filter-navbar.floating-nav { top: 84px; }
    .filter-navbar :is(.navbar-wrapper, .navbar-container, .navbar-collapse, .filter-wrapper, .filter-nav, .filter-nav > .card) {
        width: 100% !important; max-width: 100% !important; flex: 1 1 auto;
        margin: 0 !important; padding: 0 !important;
    }
    .filter-navbar .filter-nav > .card { border-radius: 12px; box-shadow: none; background: transparent; }
    .filter-navbar .card > .card-header { display: flex; align-items: center; gap: 8px; padding: 8px !important; border: 0; }
    .filter-navbar .top-filters { flex: 1 1 auto; min-width: 0; padding: 0 !important; }
    .filter-navbar .top-filters .row { margin: 0; }
    .filter-navbar #zone-filter-wrapper { width: 100% !important; max-width: 100% !important; padding: 0; }
    .filter-navbar #zone-filter-wrapper > label { display: none; }           /* the placeholder already says it */
    .filter-navbar .top-filters .form-group { margin: 0 !important; }
    .filter-navbar .select2-container { width: 100% !important; max-width: 100%; }
    .filter-navbar .select2-container--default .select2-selection--single,
    .filter-navbar .select2-container--default .select2-selection--multiple {
        min-height: 40px; border: 1px solid transparent !important; border-radius: 8px !important; background: var(--uxg-fill);
    }
    /* "Filtre": a real button in the row instead of an absolutely placed link off the edge */
    .filter-navbar .card-header .heading-elements { position: static !important; top: auto !important; right: auto !important; flex: 0 0 auto; margin: 0; padding: 0; }
    .filter-navbar .card-header .heading-elements .filtre-button a {
        display: inline-flex; align-items: center; gap: .3rem; height: 40px; padding: 0 .8rem; border-radius: 8px;
        background: var(--uxg-fill); color: var(--uxg-text) !important; font-size: .85rem; font-weight: 600; white-space: nowrap;
    }
    .filter-navbar .card-header .heading-elements .filtre-button a:active { background: var(--uxg-fill-hover); }
    /* the opened filter panel: scrolls inside the card, never taller than the screen */
    .filter-navbar .card-content {
        height: auto !important; max-height: calc(var(--vh, 1vh) * 100 - 190px); overflow-y: auto; margin: 0 !important;
        border-top: 1px solid var(--uxg-frame);
    }
    .filter-navbar .card-content .card-body { padding: 12px !important; }
    .filter-navbar .card-content .row { margin: 0; }
    .filter-navbar .card-content [class*="col"] { flex: 1 1 100%; max-width: 100%; padding: 0; }
    .filter-navbar .card-content :is(input, select)[style*="min-width"] { min-width: 0 !important; width: 100% !important; }
    .filter-navbar .card-content label { font-size: .78rem; }

    /* statistics: compact card at the bottom-left, above the legend button */
    .map-stats-top {
        top: auto !important; bottom: 58px; left: 10px !important; min-width: 0 !important;
        width: min(250px, calc(100vw - 20px)); font-size: 12px !important; border-radius: 12px; overflow: hidden;
    }
    .map-stats-top .card { margin: 0; box-shadow: none; }
    .map-stats-top .card-header { padding: 10px 12px 0 !important; }
    .map-stats-top .card-title { font-size: .95rem; }
    .map-stats-top .card-body { min-width: 0 !important; padding: 0 12px 10px !important; margin-top: .5rem !important; }
    .map-stats-top .card-body p { margin-bottom: .3rem !important; }

    /* legend */
    .map-button-legend { left: 10px; bottom: 10px; border-radius: 8px; font-size: 15px; }
    .map-legend { left: 10px; right: 10px; bottom: 58px; width: auto; max-height: 60vh; overflow-y: auto; border-radius: 12px; }
}

/* ============================================================
   Securitate page (security.php): tiles equal height, row gaps = the 28px column gutter
   ============================================================ */
.security-page .card { margin-bottom: 1.75rem; }

/* ---------- side menu: logout item in the danger colour (Vuexy --danger #ea5455) ---------- */
.main-menu.menu-light .navigation > li.nav-logout > a,
.main-menu.menu-light .navigation > li.nav-logout > a:hover,
.main-menu.menu-light .navigation > li.nav-logout.active > a,
.main-menu.menu-light .navigation > li.nav-logout > a:focus,
.main-menu .navigation > li.nav-logout > a i,
.main-menu .navigation > li.nav-logout > a .menu-title { color: #ea5455 !important; }

/* ============================================================
   Securitate console (security-console): tokens, pill tabs, controls, tiles, chart, lists, grids, blocks
   Light values on .security-page, dark values on body.dark-layout.security-page. No other page is touched.
   ============================================================ */
body.security-page {
    /* segmented control (Auto/Oră/Zi = filled primary) */
    --sec-seg-track: #eceaf3;
    --sec-seg-fg: #5d596c;
    --sec-seg-on-bg: #5a4bd1;
    --sec-seg-on-fg: #ffffff;
    /* severity badges */
    --sec-sev1-bg: #e0f0fe;  --sec-sev1-fg: #075985;
    --sec-sev2-bg: #fdf0d5;  --sec-sev2-fg: #92400e;
    --sec-sev3-bg: #fde7e7;  --sec-sev3-fg: #b42318;
    /* verdict */
    --sec-ok-bg: #ecfdf3;   --sec-ok-border: #abefc6;  --sec-ok-fg: #067647;
    --sec-bad-bg: #fef3f2;  --sec-bad-border: #fecdca; --sec-bad-fg: #912018;
    /* chart */
    --sec-series-attacks: #d63c3d;
    --sec-series-logins: #7367f0;
    --sec-chart-grid: #e4e3e9;
    --sec-chart-text: #6f6b7d;
    /* misc */
    --sec-raw-bg: #f8f7fa;
    --sec-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    --sec-radius-sm: 8px;
    --sec-gap: 1.5rem;
}
body.dark-layout.security-page {
    /* existing --ux-* tokens, dark values (this page only) */
    --ux-text: #ebeefd;
    --ux-text-2: #c2c6dc;
    --ux-text-3: #a3a9c9;
    --ux-border: #414561;
    --ux-border-soft: #343a5e;
    --ux-bg-soft: #1a2147;
    --ux-primary: #9e95f5;
    --ux-primary-dark: #b3acf8;
    --ux-primary-tint: #2a2a5c;
    --ux-focus: 0 0 0 2px #10163a, 0 0 0 4px #9e95f5;
    /* new */
    --sec-seg-track: #10163a;
    --sec-seg-fg: #c2c6dc;
    --sec-seg-on-bg: #5a4bd1;
    --sec-seg-on-fg: #ffffff;
    --sec-sev1-bg: #123049;  --sec-sev1-fg: #7dd3fc;
    --sec-sev2-bg: #3a2c10;  --sec-sev2-fg: #fcd34d;
    --sec-sev3-bg: #401a26;  --sec-sev3-fg: #fca5a5;
    --sec-ok-bg: #0f2e2c;   --sec-ok-border: #1f6f55;  --sec-ok-fg: #6ee7b7;
    --sec-bad-bg: #3a1626;  --sec-bad-border: #8a2c3b; --sec-bad-fg: #fda4af;
    --sec-series-attacks: #ff8a8b;
    --sec-series-logins: #9e95f5;
    --sec-chart-grid: #414561;
    --sec-chart-text: #c2c6dc;
    --sec-raw-bg: #0b1030;
}

/* vendor overrides (dark) */
body.dark-layout.security-page .ux-grid .ag-row.ux-row-current { background: #1e2550; }
body.dark-layout.security-page .ux-grid-msg--error { color: #fca5a5; }

/* the tiles row of older markup inside a tab pane */
.security-page .tab-pane > .row > [class*="col-"] { display: flex; flex-direction: column; }
.security-page .tab-pane > .row > [class*="col-"] > .card { flex: 1 1 auto; }

/* ---------- header ---------- */
.security-page .sec-header { margin: 0 0 1rem; }
.security-page .sec-title { margin: 0 0 .25rem; font-size: 1.5rem; font-weight: 600; letter-spacing: -.01em; color: var(--ux-text); }
.security-page .sec-subtitle { margin: 0; font-size: .9rem; font-weight: 400; color: var(--ux-text-3); }

/* ---------- tab strip: same line tabs as the point / detail sub-pages (.card-header .nav-tabs.nav-fill) ----------
   Selectors start with body.security-page ... .nav-item .nav-link so they outrank the theme nav-tabs rules. */
body.security-page .nav.nav-tabs.security-tabs {
    display: flex; flex-wrap: nowrap; gap: 2rem; margin: 0 0 1.5rem; padding: 0;
    border: 0; border-bottom: 1px solid var(--ux-border); border-radius: 0; background: transparent;
    overflow-x: auto; scrollbar-width: none;   /* phone: scroll sideways, never wrap */
}
body.security-page .nav.nav-tabs.security-tabs::-webkit-scrollbar { display: none; }
body.security-page .nav.nav-tabs.security-tabs .nav-item { margin: 0; flex: 0 0 auto; }
body.security-page .nav.nav-tabs.security-tabs .nav-item .nav-link,
body.security-page .nav.nav-tabs.security-tabs .nav-item .nav-link.active {
    position: relative; display: inline-flex; align-items: center;
    padding: .9rem .1rem .85rem; border: 0; border-radius: 0; background: transparent; box-shadow: none;
    font-size: 1rem; font-weight: 600; white-space: nowrap; color: var(--ux-text-3);
    transition: color 150ms ease;
}
body.security-page .nav.nav-tabs.security-tabs .nav-item .nav-link.active { color: var(--ux-primary); }
/* underline sits on the hairline (theme draws it below the link with a glow) */
body.security-page .nav.nav-tabs.security-tabs .nav-item .nav-link.active:after {
    display: block; top: auto; bottom: -1px; left: 0; right: 0; width: auto; height: 3px;
    border-radius: 3px 3px 0 0; box-shadow: none !important; background: var(--ux-primary) !important;
}
body.security-page .nav.nav-tabs.security-tabs .nav-item .nav-link:focus { outline: 0; }
body.security-page .nav.nav-tabs.security-tabs .nav-item .nav-link:focus-visible { box-shadow: inset 0 -3px 0 var(--ux-primary); }
@media (hover: hover) and (pointer: fine) {
    body.security-page .nav.nav-tabs.security-tabs .nav-item .nav-link:not(.active):hover { color: var(--ux-text); }
}
@media (max-width: 575.98px) {
    body.security-page .nav.nav-tabs.security-tabs { gap: 1.25rem; }
    body.security-page .nav.nav-tabs.security-tabs .nav-item .nav-link { font-size: .95rem; }
}
.security-page .tab-pane:focus { outline: 0; }
.security-page .tab-pane:focus-visible { box-shadow: var(--ux-focus); border-radius: 8px; }

/* ---------- controls row + range control ---------- */
.security-page .sec-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.security-page .sec-controls-end { margin-left: auto; }
.security-page .sec-range-wrap { position: relative; display: inline-block; }
.security-page .sec-range {
    height: 38px; padding: 0 .75rem; display: inline-flex; align-items: center; gap: .5rem;
    border: 1px solid var(--ux-border); border-radius: var(--sec-radius-sm); background: transparent;
    color: var(--ux-text); font-size: .875rem; font-weight: 500; font-variant-numeric: tabular-nums;
    transition: border-color 150ms ease;
}
.security-page .sec-range i { color: var(--ux-text-3); }
.security-page .sec-range[aria-expanded="true"] { border-color: var(--ux-primary); }
.security-page .sec-range:focus { outline: 0; }
.security-page .sec-range:focus-visible { box-shadow: var(--ux-focus); }

.security-page .sec-range-pop {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 1050;
    display: grid; grid-template-columns: 11rem auto; gap: 0; padding: 0;
    background: #fff; border: 1px solid var(--ux-border); border-radius: .5rem;
    box-shadow: 0 5px 16px rgba(34, 41, 47, .24);
    transform-origin: top left;
    opacity: 1; transform: none;
    transition: opacity 140ms var(--ux-ease-out), transform 140ms var(--ux-ease-out);
}
body.dark-layout.security-page .sec-range-pop { background: #10163a; box-shadow: 0 5px 16px rgba(0, 0, 0, .5); }
.security-page .sec-range-pop[hidden] { display: none; }
@starting-style {
    .security-page .sec-range-pop { opacity: 0; transform: translateY(-4px); }
}
.security-page .sec-range-presets { display: flex; flex-direction: column; padding: .5rem 0; border-right: 1px solid var(--ux-border); }
.security-page .sec-range-preset {
    width: 100%; height: 36px; padding: 0 1rem; border: 0; background: transparent; text-align: left;
    font-size: .875rem; color: var(--ux-text-2);
    transition: background-color 150ms ease, color 150ms ease;
}
.security-page .sec-range-preset[aria-pressed="true"] { background: var(--ux-primary-tint); color: var(--ux-primary-dark); }
.security-page .sec-range-preset:focus { outline: 0; }
.security-page .sec-range-preset:focus-visible { box-shadow: inset 0 0 0 2px var(--ux-primary); }
.security-page .sec-range-cal { padding: .5rem; }
.security-page .sec-range-foot {
    grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: .75rem;
    padding: .5rem .75rem; border-top: 1px solid var(--ux-border);
}
.security-page .sec-range-hint { font-size: .8rem; color: var(--ux-text-3); }
.security-page .sec-range-hint--bad { color: var(--sec-sev3-fg); }
.security-page .sec-range-actions { display: flex; gap: .5rem; }

/* granularity */
.security-page .sec-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--sec-seg-track); }
.security-page .sec-seg-btn {
    height: 30px; min-width: 2.75rem; padding: 0 .7rem; border: 0; border-radius: 7px;
    background: transparent; color: var(--sec-seg-fg); font-family: inherit; font-size: .8125rem; font-weight: 600; line-height: 1;
    transition: background-color 150ms ease, color 150ms ease;
}
.security-page .sec-seg-btn[aria-pressed="true"] { background: var(--sec-seg-on-bg); color: var(--sec-seg-on-fg); }
.security-page .sec-seg-btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.security-page .sec-seg-btn:focus { outline: 0; }
.security-page .sec-seg-btn:focus-visible { box-shadow: var(--ux-focus); }
.security-page .sec-copy { height: 38px; }

/* ---------- verdict ---------- */
.security-page .sec-verdict {
    display: flex; gap: .75rem; align-items: flex-start; padding: .75rem 1rem; margin-bottom: var(--sec-gap);
    border: 1px solid; border-radius: .5rem; font-size: .9rem;
}
.security-page .sec-verdict > i { font-size: 1.1rem; margin-top: 1px; }
.security-page .sec-verdict--ok { background: var(--sec-ok-bg); border-color: var(--sec-ok-border); color: var(--sec-ok-fg); }
.security-page .sec-verdict--bad { background: var(--sec-bad-bg); border-color: var(--sec-bad-border); color: var(--sec-bad-fg); }
.security-page .sec-verdict--wait { background: var(--ux-bg-soft); border-color: var(--ux-border); color: var(--ux-text-2); }
.security-page .sec-verdict--bad a { color: inherit; text-decoration: underline; }
.security-page .sec-verdict--bad .sec-ip-link { font-family: var(--sec-mono); }
.security-page .sec-verdict-list { overflow-wrap: anywhere; list-style: none; margin: .35rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }

/* ---------- tiles ---------- */
.security-page .sec-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1rem; margin-bottom: var(--sec-gap); }
.security-page .sec-tile { margin: 0; padding: 1rem 1.25rem; min-height: 6.25rem; display: flex; flex-direction: column; gap: .35rem; }
.security-page .sec-tile-label { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ux-text-3); }
.security-page .sec-tile-value {
    font-size: 1.75rem; font-weight: 700; line-height: 1.2; color: var(--ux-text); font-variant-numeric: tabular-nums;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.security-page .sec-tile[data-tile="mode"] .sec-tile-value { font-size: 1.375rem; }
.security-page .sec-tile-value--warn { color: var(--sec-sev2-fg); }
.security-page .sec-tile-sub { font-size: .8rem; font-weight: 500; color: var(--ux-text-3); }
.security-page .sec-tile-sub--warn { color: var(--sec-sev2-fg); }

/* ---------- chart card ---------- */
.security-page .sec-chart-card .card-title,
.security-page .sec-list-card .card-title,
.security-page .sec-config .card-title { font-size: 1rem; font-weight: 600; color: var(--ux-text); }
.security-page .sec-chart-meta { font-size: .8rem; color: var(--ux-text-3); }
.security-page .sec-chart-summary { font-size: .8rem; color: var(--ux-text-3); margin: 0 0 .25rem; }
.security-page .sec-chart { height: 300px; }
.security-page .sec-state { font-size: .875rem; color: var(--ux-text-3); text-align: center; padding: 1.5rem 1rem; }
.security-page .sec-state--error { color: var(--sec-sev3-fg); }

/* ---------- lists ---------- */
.security-page .sec-lists { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--sec-gap); }
.security-page .sec-lists > .card { margin: 0; }
.security-page .sec-span-ips, .security-page .sec-span-paths, .security-page .sec-span-types { grid-column: span 4; }
.security-page .sec-span-notable, .security-page .sec-span-csp { grid-column: span 6; }
.security-page .sec-list-card .card-header { padding: 1rem 1.25rem .5rem; }
.security-page .sec-list-card .card-body { padding: 0 .5rem .75rem; }
.security-page .sec-list-meta { font-size: .8rem; color: var(--ux-text-3); }
.security-page .sec-more { font-size: .8rem; color: var(--ux-primary-dark); margin-left: .5rem; }
.security-page .sec-list { list-style: none; margin: 0; padding: 0; }
.security-page .sec-list-row {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .75rem;
    min-height: 36px; padding: .35rem .75rem; border-radius: var(--sec-radius-sm); font-size: .875rem; color: var(--ux-text);
}
.security-page .sec-list-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.security-page .sec-list-count { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ux-text); }
.security-page .sec-list-sub { grid-column: 1; font-size: .75rem; color: var(--ux-text-3); }
.security-page .sec-ip-link { font-family: var(--sec-mono); font-size: .85rem; color: var(--ux-primary-dark); }
.security-page .sec-guess { color: var(--ux-text-3); font-style: italic; }
.security-page .sec-reason { color: var(--ux-text-3); font-weight: 400; }
.sec-detail .sec-guess { font-style: italic; }
.sec-detail .sec-guess-note { margin-top: .15rem; font-size: .8rem; opacity: .75; }
.security-page .sec-ip-link:focus { outline: 0; }
.security-page .sec-ip-link:focus-visible { box-shadow: var(--ux-focus); border-radius: 3px; }
@media (hover: hover) and (pointer: fine) { .security-page .sec-ip-link:hover { text-decoration: underline; } }
.security-page .sec-path { font-family: var(--sec-mono); font-size: .82rem; unicode-bidi: isolate-override; direction: ltr; }
.security-page .sec-code {
    font-family: var(--sec-mono); font-size: .75rem; color: var(--ux-text-3); background: var(--ux-bg-soft);
    padding: 1px 6px; border-radius: 4px;
}
.security-page .sec-list-btn {
    width: 100%; text-align: left; border: 0; background: transparent; font-family: inherit;
    grid-template-columns: 6.5rem auto minmax(0, 1fr) auto;
}
.security-page .sec-list-btn:focus { outline: 0; }
.security-page .sec-list-btn:focus-visible { box-shadow: var(--ux-focus); }
@media (hover: hover) and (pointer: fine) { .security-page .sec-list-btn:hover { background: var(--ux-bg-soft); } }
.security-page .sec-span-notable .card-body { max-height: 22rem; overflow-y: auto; }
.security-page .sec-time { font-variant-numeric: tabular-nums; color: var(--ux-text-2); }
.security-page .sec-mono { font-family: var(--sec-mono); font-size: .85rem; unicode-bidi: isolate; direction: ltr; }

/* ---------- badges ---------- */
.ux-badge.sec-sev { text-transform: none; }
.sec-sev-1 { background: var(--sec-sev1-bg); color: var(--sec-sev1-fg); }
.sec-sev-2 { background: var(--sec-sev2-bg); color: var(--sec-sev2-fg); }
.sec-sev-3 { background: var(--sec-sev3-bg); color: var(--sec-sev3-fg); }
.sec-kind-login { background: var(--ux-bg-soft); color: var(--ux-text-2); text-transform: none; }
.sec-kind-probe { background: var(--sec-sev3-bg); color: var(--sec-sev3-fg); text-transform: none; }
.sec-res-ok { background: var(--sec-ok-bg); color: var(--sec-ok-fg); text-transform: none; }
.sec-res-fail { background: var(--sec-sev3-bg); color: var(--sec-sev3-fg); text-transform: none; }

/* ---------- filter bar, inputs, dropdowns ---------- */
.security-page .sec-filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.security-page .sec-filterbar-end { margin-left: auto; display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--ux-text-3); font-variant-numeric: tabular-nums; }
.security-page .sec-input, .security-page .sec-dd {
    height: 38px; border: 1px solid var(--ux-border); border-radius: var(--sec-radius-sm); background: transparent;
    color: var(--ux-text); font-size: .875rem; padding: 0 .75rem;
}
.security-page .sec-input--q { width: 16rem; }
.security-page .sec-input--ip { width: 9.5rem; }
.security-page .sec-input::placeholder { color: var(--ux-text-3); }
.security-page .sec-input:focus, .security-page .sec-dd:focus {
    outline: 0; border-color: var(--ux-primary); box-shadow: 0 0 0 3px var(--ux-primary-tint);
}
.security-page .sec-dd { display: inline-flex; align-items: center; gap: .4rem; }
.security-page .sec-dd-k { color: var(--ux-text-3); font-weight: 500; }
.security-page .sec-dd-v { color: var(--ux-text); font-weight: 600; }
.security-page .sec-dd--set { border-color: var(--ux-primary); }
.security-page .sec-dd-menu { max-height: 60vh; overflow-y: auto; }

/* ---------- grids ---------- */
.security-page .sec-grid-click .ag-row { cursor: pointer; }
.security-page .sec-cell-mono { font-family: var(--sec-mono); font-size: .82rem; }
.security-page .sec-cell-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- detail dialog ---------- */
.sec-detail .sec-facts, .security-page .sec-facts {
    display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: .4rem 1rem; margin: 0 0 1rem; font-size: .9rem;
}
.sec-facts dt { margin: 0; font-weight: 500; color: var(--ux-text-3); }
.sec-facts dd { margin: 0; color: var(--ux-text); overflow-wrap: anywhere; }
.sec-wrap { overflow-wrap: anywhere; unicode-bidi: isolate; direction: ltr; }
.sec-raw-title { margin: 0 0 .35rem; font-size: .75rem; text-transform: uppercase; color: var(--ux-text-3); }
.sec-raw {
    margin: 0; max-height: 15rem; overflow: auto; padding: .75rem; border-radius: var(--sec-radius-sm);
    background: var(--sec-raw-bg); color: var(--ux-text); font: .8rem/1.5 var(--sec-mono);
    white-space: pre-wrap; overflow-wrap: anywhere; unicode-bidi: isolate-override; direction: ltr;
}

/* ---------- blocks + configuration ---------- */
.security-page .sec-blocks { display: grid; grid-template-columns: minmax(0, 2fr) minmax(18rem, 1fr); gap: var(--sec-gap); align-items: start; }
.security-page .sec-blocks > .card { margin: 0; }
.security-page .sec-chips { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; margin: 0; padding: 0; }
.security-page .sec-rules { margin: 0; padding-left: 1.1rem; font-size: .875rem; }
.security-page .sec-rules li { margin-bottom: .2rem; }
.security-page .sec-config-note { font-size: .8rem; color: var(--ux-text-3); margin: 1rem 0 0; }

/* ---------- T10 additions: blocks card, config sub-line, grid cells, copy label ---------- */
.security-page .sec-blocked-card .card-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.security-page .sec-blocked-card .card-body { padding-top: 0; }
.security-page .sec-facts dd small.d-block { margin-top: .15rem; font-size: .8rem; color: var(--ux-text-3) !important; }
.security-page .sec-cell-strong { font-weight: 600; color: var(--ux-text); }
.security-page .sec-num { font-variant-numeric: tabular-nums; color: var(--ux-text-2); }
.security-page .sec-ua { unicode-bidi: isolate; direction: ltr; font-size: .8rem; color: var(--ux-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.security-page .sec-fact-action { padding: 0; margin-left: .5rem; font-size: .8rem; vertical-align: baseline; color: var(--ux-primary-dark); }
.security-page .sec-fact-action:focus { outline: 0; }
.security-page .sec-fact-action:focus-visible { box-shadow: var(--ux-focus); border-radius: 3px; }
.sec-detail .sec-fact-action { padding: 0; margin-left: .5rem; font-size: .8rem; color: var(--ux-primary-dark); }
@media (max-width: 575.98px) {
    .security-page .sec-copy-label { font-size: 0; }
    .security-page .sec-copy-label::after { content: "Copiază"; font-size: .875rem; }
}

/* ---------- responsive ---------- */
@media (max-width: 1365.98px) {
    .security-page .sec-tile-label { overflow-wrap: anywhere; }
}
@media (max-width: 1199.98px) {
    .security-page .sec-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .security-page .sec-span-ips, .security-page .sec-span-paths { grid-column: span 6; }
    .security-page .sec-span-types, .security-page .sec-span-notable, .security-page .sec-span-csp { grid-column: span 12; }
    .security-page .sec-blocks { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767.98px) {
    .security-page .sec-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
    .security-page .sec-tile-value { font-size: 1.5rem; }
    .security-page .sec-lists > .card { grid-column: span 12; }
    .security-page .sec-chart { height: 240px; }
    .security-page .sec-range-wrap { width: 100%; }
    .security-page .sec-range { width: 100%; }
    .security-page .sec-input--q { width: 100%; }
    .security-page .sec-input--ip, .security-page .sec-filterbar .dropdown { flex: 1 1 8rem; width: auto; }
    .security-page .sec-range-pop {
        position: fixed; left: .75rem; right: .75rem; top: auto; grid-template-columns: minmax(0, 1fr);
    }
    .security-page .sec-range-presets { border-right: 0; border-bottom: 1px solid var(--ux-border); }
    .security-page .sec-range-cal .flatpickr-calendar { width: 100%; }
}
@media (max-width: 575.98px) {
    .security-page .sec-facts { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .security-page .sec-facts dt { font-size: .75rem; text-transform: uppercase; margin-top: .5rem; }
}
@media (max-width: 359.98px) {
    .security-page .sec-tiles { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .security-page .sec-range-pop, .security-page .security-tabs .nav-link, .security-page .sec-seg-btn,
    .security-page .sec-range, .security-page .sec-range-preset {
        transition: none !important; animation: none !important;
    }
}

/* ---------- shared tokens + badges (moved from users.css so pages without it, e.g. Securitate, have them;
   users.css stays off those pages: its 56px grid rows would break their 44px grids) ---------- */
:root {
    --ux-text: #2f2b3d;
    --ux-text-2: #5d596c;
    --ux-text-3: #6f6b7d;
    --ux-border: #e4e3e9;
    --ux-border-soft: #ebe9f1;
    --ux-bg-soft: #f8f7fa;
    --ux-primary: #7367f0;
    --ux-primary-dark: #5a4bd1;
    --ux-primary-tint: #efedfd;
    --ux-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --ux-focus: 0 0 0 2px #fff, 0 0 0 4px var(--ux-primary);
}

/* ---------- badges ---------- */
.ux-badge {
    display: inline-flex; align-items: center; gap: .35rem;
    font-size: .78rem; font-weight: 600; line-height: 1;
    padding: .35rem .6rem; border-radius: 6px; white-space: nowrap;
    text-transform: capitalize;
}
.ux-badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ux-role-superadmin     { background: #fde7e7; color: #b42318; }
.ux-role-admin          { background: #ece9fd; color: #4f3fc4; }
.ux-role-operator-birou { background: #e0f0fe; color: #075985; }
.ux-role-operator-teren { background: #ddf6e6; color: #166534; }
.ux-role-operator-radio { background: #fdf0d5; color: #92400e; }
.ux-role-vizitator      { background: #eef0f3; color: #475569; }
.ux-role-consumator     { background: #f3e8ff; color: #6b21a8; }
.ux-status-activ        { background: #ddf6e6; color: #166534; }
.ux-status-inactiv      { background: #fde7e7; color: #b42318; }

/* ---------- grid cells shared by the logins and sessions grids (security.php, user-sessions.php) ---------- */
/* user link: opens the user page in a new tab */
.ux-grid .ux-cell-user { display: flex; align-items: center; gap: .5rem; min-width: 0; height: 100%; }
.ux-grid .ux-cell-user a, .ux-grid .ux-cell-user .ux-cell-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ux-grid .ux-cell-user a { color: var(--ux-primary-dark); font-weight: 500; }
.ux-grid .ux-cell-user a:focus { outline: 0; }
.ux-grid .ux-cell-user a:focus-visible { box-shadow: var(--ux-focus); border-radius: 3px; }
@media (hover: hover) and (pointer: fine) { .ux-grid .ux-cell-user a:hover { text-decoration: underline; } }

/* device: feather icon + word */
.ux-grid .ux-device { display: inline-flex; align-items: center; gap: .45rem; color: var(--ux-text-2); white-space: nowrap; }
.ux-grid .ux-device i { font-size: 1rem; color: var(--ux-text-3); }

/* "Sesiunea curenta": never truncated, the email next to it truncates instead */
.ux-badge-current { flex: 0 0 auto; background: var(--ux-primary-tint); color: var(--ux-primary-dark); text-transform: none; }
.ux-grid .ag-row.ux-row-current { background: #f6f5fe; }

/* empty / error text inside a grid overlay */
.ux-grid-msg { color: var(--ux-text-3); font-size: .95rem; padding: 0 1rem; text-align: center; white-space: normal; }
.ux-grid-msg--error { color: #b42318; }
/* role 1 viewing a superadmin's session: no Revoca, a grey lock with a tooltip */
.ux-grid .ux-cell-locked { color: var(--ux-text-3); font-size: 1rem; }

/* styled tooltip: .sec-tip (SecPage.tip) and ag-grid's own .ag-tooltip look the same */
body.security-page {
    --sec-tip-bg: #2f2b3d;
    --sec-tip-fg: #ffffff;
    --sec-tip-shadow: 0 4px 14px rgba(25, 21, 40, .28);
}
body.dark-layout.security-page {
    --sec-tip-bg: #e8e9f5;
    --sec-tip-fg: #10163a;
    --sec-tip-shadow: 0 4px 14px rgba(0, 0, 0, .5);
}
.security-page .sec-tip,
.security-page .ag-tooltip {
    background: var(--sec-tip-bg);
    color: var(--sec-tip-fg);
    border: 0;
    border-radius: 6px;
    padding: .35rem .6rem;
    font-size: .8rem;
    line-height: 1.35;
    box-shadow: var(--sec-tip-shadow);
    max-width: 320px;
    white-space: pre-line;
    overflow-wrap: anywhere;
}
.security-page .sec-tip {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100000;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity .12s ease, visibility 0s linear .12s;
}
.security-page .sec-tip.sec-tip--on { opacity: 1; visibility: visible; transition-delay: 0s; }
@media (prefers-reduced-motion: reduce) {
    .security-page .sec-tip { transition: none; }
}
