.cursor-pointer {
      cursor: pointer;
}

/* =====================================================================
 * Fix palette badge/pill/avatar — colori del design system non cablati
 * ---------------------------------------------------------------------
 * Questa build definisce le tinte standard (primary/secondary/success/…)
 * ma ha perso: (1) gli sfondi `.bg-{color}-subtle` dei colori estesi
 * (azure/teal/lime/orange/cyan), (2) le classi testo `.text-{color}` di
 * quei colori e di `purple`, (3) le varianti "light" `.bg-{color}-lt`
 * usate ancora in calendario, anagrafiche, area-cliente, ecc.
 * Senza queste regole i badge ereditavano testo bianco su sfondo bianco
 * (es. stati pratica "Appuntamento svolto", pill "0 appuntamenti").
 * Tutte le classi sotto erano INESISTENTI: l'aggiunta è puramente
 * correttiva e usa i token del tema dove disponibili.
 * ===================================================================== */
:root {
  --ins-azure-text:  #1366c4; --ins-azure-bg:  rgba(19, 102, 196, .12);
  --ins-teal-text:   #0b7a62; --ins-teal-bg:   rgba(11, 122, 98, .12);
  --ins-lime-text:   #4d7c0f; --ins-lime-bg:   rgba(77, 124, 15, .14);
  --ins-orange-text: #b35309; --ins-orange-bg: rgba(179, 83, 9, .12);
  --ins-cyan-text:   #0b7285; --ins-cyan-bg:   rgba(13, 114, 133, .12);
}

/* Sfondi "subtle" mancanti per la palette estesa */
.bg-azure-subtle  { background-color: var(--ins-azure-bg)  !important; }
.bg-teal-subtle   { background-color: var(--ins-teal-bg)   !important; }
.bg-lime-subtle   { background-color: var(--ins-lime-bg)   !important; }
.bg-orange-subtle { background-color: var(--ins-orange-bg) !important; }
.bg-cyan-subtle   { background-color: var(--ins-cyan-bg)   !important; }

/* Classi testo mancanti (leggibili su sfondo chiaro) */
.text-purple { color: var(--ins-purple-text-emphasis, #6b3382) !important; }
.text-azure  { color: var(--ins-azure-text)  !important; }
.text-teal   { color: var(--ins-teal-text)   !important; }
.text-lime   { color: var(--ins-lime-text)   !important; }
.text-orange { color: var(--ins-orange-text) !important; }

/* Variante "light" `.bg-{color}-lt`: sfondo tenue + testo leggibile */
.bg-primary-lt   { background-color: var(--ins-primary-bg-subtle)   !important; color: var(--ins-primary-text-emphasis)   !important; }
.bg-secondary-lt { background-color: var(--ins-secondary-bg-subtle) !important; color: var(--ins-secondary-text-emphasis) !important; }
.bg-success-lt   { background-color: var(--ins-success-bg-subtle)   !important; color: var(--ins-success-text-emphasis)   !important; }
.bg-danger-lt    { background-color: var(--ins-danger-bg-subtle)    !important; color: var(--ins-danger-text-emphasis)    !important; }
.bg-warning-lt   { background-color: var(--ins-warning-bg-subtle)   !important; color: var(--ins-warning-text-emphasis)   !important; }
.bg-info-lt      { background-color: var(--ins-info-bg-subtle)      !important; color: var(--ins-info-text-emphasis)      !important; }
.bg-dark-lt      { background-color: var(--ins-dark-bg-subtle)      !important; color: var(--ins-dark-text-emphasis)      !important; }
.bg-purple-lt    { background-color: var(--ins-purple-bg-subtle)    !important; color: var(--ins-purple-text-emphasis)    !important; }
.bg-azure-lt     { background-color: var(--ins-azure-bg)  !important; color: var(--ins-azure-text)  !important; }
.bg-teal-lt      { background-color: var(--ins-teal-bg)   !important; color: var(--ins-teal-text)   !important; }
.bg-lime-lt      { background-color: var(--ins-lime-bg)   !important; color: var(--ins-lime-text)   !important; }
.bg-orange-lt    { background-color: var(--ins-orange-bg) !important; color: var(--ins-orange-text) !important; }
.bg-cyan-lt      { background-color: var(--ins-cyan-bg)   !important; color: var(--ins-cyan-text)   !important; }

/* =====================================================================
 * DataTables dentro card con body p-0 — spaziatura controlli
 * ---------------------------------------------------------------------
 * Le righe controlli di DataTables (length/search sopra, info/paging
 * sotto) finivano attaccate ai bordi della card. Padding uniforme per
 * TUTTE le tabelle del progetto, senza CSS per-pagina.
 * ===================================================================== */
/* Le righe controlli hanno .mt-2; la riga con la tabella no. */
.card-body.p-0 [id$="_wrapper"] > .row.mt-2,
.card-body.p-0 .dt-container > .row.mt-2 {
    margin: 0;
    padding: .875rem 1.25rem;
}
.card-body.p-0 [id$="_wrapper"] > .row.mt-2:last-child,
.card-body.p-0 .dt-container > .row.mt-2:last-child {
    border-top: 1px solid #eef1f4;
}
[id$="_wrapper"] .dt-search input {
    margin-left: .5rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: .35rem .75rem;
    min-width: 220px;
}
[id$="_wrapper"] .dt-length select {
    margin: 0 .5rem;
    padding: .2rem 1.5rem .2rem .5rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}
[id$="_wrapper"] .dt-info {
    color: #64748b;
    font-size: .875rem;
}
[id$="_wrapper"] .dt-paging .page-link {
    border-radius: 6px !important;
    margin: 0 2px;
}

/* Indicatore di ordinamento: lo fornisce già il tema Tabler via th::after (font
 * tabler-icons). Lo <span.dt-column-order> di DataTables 2.x duplicherebbe la
 * freccia, quindi lo nascondiamo per avere una sola icona pulita. */
table.dataTable thead th .dt-column-order { display: none; }

/* =====================================================================
 * Modulo Amministrazione (.am-module) — tipografia e componenti
 * ===================================================================== */
.am-module .table > tbody > tr > td {
    font-size: .9rem;
    padding-top: .65rem;
    padding-bottom: .65rem;
    vertical-align: middle;
}
.am-module .table thead th {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #5c6b7a;
    font-weight: 600;
    background: #f8fafc;
    padding: .8rem .75rem;
    border-bottom: 2px solid #e9ecef;
}
.am-module .badge { font-size: .72rem; font-weight: 600; }
.am-small { font-size: .8125rem; }
.am-desc {
    color: #64748b;
    font-size: .8125rem;
    max-width: 420px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.am-medlink { font-size: .8125rem; }
.am-prewrap { white-space: pre-wrap; word-break: break-word; }
.am-help {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: .6rem .9rem;
    color: #475569;
    font-size: .875rem;
}

/* Filtri stato estratto conto */
.am-flt {
    border: 1px solid #dee2e6;
    color: #475569;
    background: #fff;
}
.am-flt:hover { background: #f1f5f9; }
.am-flt.active {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #fff;
}
.am-flt-count {
    display: inline-block;
    min-width: 1.5em;
    padding: 0 .4em;
    margin-left: .35em;
    border-radius: 99px;
    background: rgba(100, 116, 139, .12);
    font-size: .75em;
    font-weight: 700;
}
.am-flt.active .am-flt-count { background: rgba(255, 255, 255, .25); }

/* KPI compatti dashboard */
.am-kpi { transition: box-shadow .15s ease, transform .15s ease; }
.am-kpi:hover { box-shadow: 0 6px 18px rgba(15, 23, 42, .08); transform: translateY(-1px); }
.am-kpi-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    border-radius: 10px;
    background: #f1f5f9;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.am-fade-out { opacity: 0; transition: opacity .3s ease; }

/* Pill stato recupero (dropdown) */
.am-stato-pill {
    border: 0;
    cursor: pointer;
    font-size: .78rem !important;
}
.am-dot {
    display: inline-block;
    width: 9px; height: 9px;
    border-radius: 99px;
    margin-right: .5em;
}

/* Drawer abbina + quick view
   (.offcanvas davanti per battere .offcanvas.offcanvas-end del tema) */
.offcanvas.am-drawer { width: 600px; max-width: 92vw; }
.offcanvas.am-qv { width: 540px; max-width: 92vw; }
/* Link mediazione cliccabili: sottolineati per distinguerli dai numeri
   senza pratica collegata (i chip della tabella restano com'erano) */
a[data-qv="pratica"]:not(.am-link-chip) {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: .18em;
}
/* QV affiancato a sinistra di un drawer aperto (right inline impostato da am-ui.js):
   z-index sotto il drawer host così in apertura scivola fuori da sotto di esso */
.am-qv.am-qv-beside {
    z-index: 1044;
    border-right: 1px solid rgba(0, 0, 0, .08);
    box-shadow: -10px 0 24px rgba(0, 0, 0, .10);
}
.am-qv-eyebrow {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #94a3b8;
    font-weight: 600;
}
.am-qv-footer { padding: .9rem 1rem; background: #fff; }
.am-qv-section { margin-top: 1.25rem; }
.am-qv-section-title {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #64748b;
    font-weight: 700;
    margin-bottom: .5rem;
}
.am-qv-table { font-size: .85rem; }
.am-qv-table thead th {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #94a3b8;
    font-weight: 600;
    border-bottom-width: 1px;
}
.am-qv-empty { font-size: .875rem; padding: .25rem 0 .5rem; }
.am-kv { display: flex; gap: 1rem; padding: .45rem 0; border-bottom: 1px dashed #eef1f4; }
.am-kv:last-of-type { border-bottom: 0; }
.am-kv-label { flex: 0 0 130px; color: #94a3b8; font-size: .8125rem; padding-top: .15rem; }
.am-kv-value { flex: 1; min-width: 0; font-size: .9rem; }

/* Card movimento + candidati nel drawer */
.am-mov-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem;
}
.am-cand-card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: .8rem .9rem;
    background: #fff;
}
.am-cand-card:hover { border-color: #c7d2fe; }
/* Etichetta piccola sopra i valori chiave della card (Fattura / Mediazione) */
.am-cand-lbl {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #94a3b8;
    font-weight: 600;
}

/* Chip per i collegamenti cliccabili (mediazione -> pratica): rende evidente
   a colpo d'occhio cosa e' navigabile rispetto al testo semplice. */
.am-link-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .1rem .55rem;
    border-radius: 999px;
    background: rgba(79, 70, 229, .08);
    border: 1px solid rgba(79, 70, 229, .18);
    color: #4f46e5;
    font-weight: 600;
    font-size: .8125rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background .12s ease, border-color .12s ease;
}
.am-link-chip:hover {
    background: rgba(79, 70, 229, .16);
    border-color: rgba(79, 70, 229, .35);
    color: #4338ca;
}
.am-link-chip .ti { font-size: .9em; }
.min-w-0 { min-width: 0; }

/* ============================================================
   Ricerca globale topbar (gc-search)
   ============================================================ */
#gc-search-wrap {
    width: 640px;
    max-width: 100%;
}
#gc-search-wrap .topbar-search {
    width: 640px;
    max-width: 100%;
    padding-right: 2.25rem;
}
.gc-search-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 1080;
    width: 640px;
    max-width: calc(100vw - 32px);
    background: var(--bs-body-bg, #fff);
    border: 1px solid var(--bs-border-color, #e5e7eb);
    border-radius: .6rem;
    box-shadow: 0 14px 36px rgba(15, 23, 42, .14);
    max-height: 75vh;
    overflow-y: auto;
    padding: .35rem 0;
}
.gc-search-panel .gc-search-group-label {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--bs-secondary-color, #6b7280);
    padding: .55rem .95rem .3rem;
    display: flex;
    align-items: center;
    gap: .4rem;
    border-top: 1px solid var(--bs-border-color, #f1f3f5);
}
.gc-search-panel .gc-search-group-label:first-child {
    border-top: 0;
}
.gc-search-panel .gc-search-item {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: .25rem 1rem;
    padding: .55rem .95rem;
    color: var(--bs-body-color, #111);
    text-decoration: none;
    border-left: 2px solid transparent;
    cursor: pointer;
    line-height: 1.25;
}
.gc-search-panel .gc-search-item:hover,
.gc-search-panel .gc-search-item.is-active {
    background: var(--bs-tertiary-bg, #f3f4f6);
    border-left-color: var(--bs-primary, #3e60d5);
}
.gc-search-panel .gc-search-main {
    min-width: 0;
}
.gc-search-panel .gc-search-title {
    font-weight: 500;
    font-size: .9375rem;
    color: var(--bs-body-color, #111827);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gc-search-panel .gc-search-sub {
    font-size: .8125rem;
    color: var(--bs-secondary-color, #6b7280);
    margin-top: .1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gc-search-panel .gc-search-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .15rem;
    white-space: nowrap;
    padding-top: 1px;
}
.gc-search-panel .gc-search-chip {
    font-size: .72rem;
    font-weight: 600;
    line-height: 1;
    padding: .25rem .5rem;
    border-radius: 999px;
    letter-spacing: .01em;
    background: var(--bs-secondary-bg, #eef0f3);
    color: var(--bs-secondary-color, #4b5563);
    border: 1px solid transparent;
}
.gc-search-panel .gc-chip-primary {
    background: rgba(62, 96, 213, .12);
    color: var(--bs-primary, #3e60d5);
}
.gc-search-panel .gc-chip-mono {
    background: transparent;
    color: var(--bs-body-color, #111827);
    border-color: var(--bs-border-color, #e5e7eb);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    font-weight: 600;
}
.gc-search-panel .gc-chip-neutral {
    background: var(--bs-tertiary-bg, #f3f4f6);
    color: var(--bs-secondary-color, #6b7280);
}
.gc-search-panel .gc-search-meta-sub {
    font-size: .75rem;
    color: var(--bs-secondary-color, #6b7280);
    font-variant-numeric: tabular-nums;
}
.gc-search-panel .gc-search-empty,
.gc-search-panel .gc-search-loading {
    padding: .95rem;
    text-align: center;
    color: var(--bs-secondary-color, #6b7280);
    font-size: .9rem;
}
.gc-search-panel mark {
    background: rgba(62, 96, 213, .18);
    color: inherit;
    padding: 0 .1rem;
    border-radius: .15rem;
    font-weight: 600;
}
/* Modal scrollabili con <form> diretto dentro .modal-content:
   il form deve replicare il flex del .modal-content, altrimenti
   il .modal-body non riceve l'altezza vincolata e non scorre. */
.modal-dialog-scrollable .modal-content > form {
    display: flex;
    flex-direction: column;
    max-height: 100%;
    overflow: hidden;
}
