/* Calm, professional hover for every module (loaded last in layouts/app).
   Nothing lifts, grows, rotates, slides or glows in colour on hover any more. The lift / grow was the cause
   of the "blinking": an element moved away from the cursor at its edge, lost the hover, came back, got it
   again... Hover now only shows a light grey background / shadow. */

/* 1. nothing that is hovered moves or grows
      (kept: elements placed with a transform - dropdowns, centred badges, icons, spinners, sliders) */
html body :is(.main-content, .modal) :hover:not(
    .dropdown-menu, .popover, .tooltip, .modal-dialog, .offcanvas, .carousel-item, .toast,
    [class*="translate"], [class*="rotate"], [class*="spin"], [class*="chevron"], [class*="caret"],
    [style*="transform"], [data-popper-placement], i, svg, svg *, .bi, img,
    [class*="icon"], [class*="menu"], [class*="toast"], [class*="bulk"], [class*="tip"], [class*="island"]
) {
    transform: none !important;
}

/* icons inside a hovered tile / card / row do not jump either */
html body :is(.main-content, .modal) :is(.card, .hg-card, [class*="kpi"], [class*="-card"], [class*="tile"], [class*="row"], .btn, a):hover
    :is(.kpi-icon-3d, .work-icon-3d, .act-icon-pod, .go, .ic, [class*="icon-3d"], [class*="-ic"]) {
    transform: none !important;
}

/* 2. one quiet transition (no springy bounce) */
html body :is(.main-content, .modal) :is(.card, .hg-card, .card-custom, .card-clay-3d, [class*="kpi-card"], .work-detail-card-3d, .followup-kpi-card-3d) {
    transition: box-shadow .15s ease, border-color .15s ease, background-color .15s ease !important;
    will-change: auto !important;
}

/* 3. small tiles: a light neutral shadow instead of a big coloured glow */
html body :is(.main-content, .modal) :is(.card, .hg-card, .card-custom, .card-clay-3d, .custom-hover-card,
    [class*="kpi-card"], [class*="-kpi"], .stat-card, .metric-card, .dash-card, .pj-card):not(.hg-big):not(.active):hover {
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 18px -10px rgba(15, 23, 42, .18) !important;
    border-color: rgba(100, 116, 139, .28) !important;
}

/* 4. big sections and tables (follow-up list, lead distribution, forms): almost no change */
html body :is(.main-content, .modal) .hg-card.hg-big:hover {
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 14px -10px rgba(15, 23, 42, .12) !important;
}

/* 5. table rows: no grow / lift / shadow / coloured side bar - just a light grey row */
html body :is(.main-content, .modal) table tbody tr:hover {
    transform: none !important;
    filter: none !important;
    box-shadow: none !important;
    z-index: auto !important;
}
html body :is(.main-content, .modal) table tbody tr:hover > :is(td, th),
html body[data-mod] :is(.main-content, .modal) :is(table, .table) tbody tr:hover > :is(td, th):nth-child(n) {
    background: #f8fafc !important;
    box-shadow: none !important;
}
html body :is(.main-content, .modal) table tbody tr { transition: background-color .12s ease !important; }

/* rows / list items that slid sideways on hover stay put */
html body[data-mod] .main-content .list-group-item-action:hover { padding-left: var(--bs-list-group-item-padding-x, 1rem) !important; }
html body[data-mod] .pj-row:hover { padding-left: 2px !important; padding-right: 2px !important; background: #f8fafc !important; }

/* 6. buttons: no light sweep across the main button, no coloured glow below it */
html body[data-mod] .btn-primary::after { display: none !important; }
html body :is(.main-content, .modal) .btn:hover { filter: none !important; }
html body :is(.main-content, .modal) :is(.btn, [class*="chip"], [class*="pill"]):not(.active):not(.btn-link):hover {
    box-shadow: 0 1px 2px rgba(15, 23, 42, .08), 0 3px 8px -4px rgba(15, 23, 42, .18) !important;
}

/* 7. sidebar: no sliding text, no spinning icons, no breathing glow / moving gradients */
html body[data-mod] #sidebar .nav-link-custom:not(.active):hover { padding-left: 10px !important; background: rgba(15, 23, 42, .045) !important; }
html body[data-mod] #sidebar .nav-link-custom::after { display: none !important; }
html body[data-mod] #sidebar .nav-link-custom:hover > i,
html body[data-mod] #sidebar .btn-back-modules:hover i { transform: none !important; }
html body[data-mod] #sidebar .nav-link-custom.active::before,
html body[data-mod] #sidebar .nav-link-custom.active > i,
html body[data-mod] #sidebar .sub-sidebar-header > div.p-2.rounded-3 { animation: none !important; }

/* touch screens: no jump while pressing, and a tapped row (e.g. ticking a lead) does not stay grey */
@media (hover: none) {
    html body .hg-card:active { transform: none !important; }
    html body :is(.main-content, .modal) table tbody tr:hover > :is(td, th),
    html body[data-mod] :is(.main-content, .modal) :is(table, .table) tbody tr:hover > :is(td, th):nth-child(n) {
        background-color: transparent !important;
    }
}
