/* MY AI NOW · Tabelle ed elenchi compatti "stile foglio di calcolo" (18/11/2026)
   Regola comune per tutte le tabelle .my-tabella (Costi e commesse, Catalogo, CRM, Posta, Newsletter,
   Documentazione/Short link, Risorse, Segreteria, Spot, Utenti) + Social e Contatti.
   Caricato per ultimo in index.html: vince sui padding dei singoli moduli. I dettagli restano ad accordion. */

/* colonne larghe quanto il contenuto (non stirate su tutta la pagina), interlinea minima */
.my-tabella, .so-tab { width: auto; max-width: 100%; font-size: var(--t-xs); line-height: 1.25; border-collapse: collapse; }
.my-tabella th, .my-tabella td,
.so-tab th, .so-tab td { padding: 0.2rem 0.55rem; vertical-align: middle; border-bottom: 1px solid var(--ink-line); }
.my-tabella td + td, .my-tabella th + th,
.so-tab td + td, .so-tab th + th { border-left: 1px solid color-mix(in srgb, var(--ink-line) 55%, transparent); }

/* intestazione: grigia, sottile, resta visibile scorrendo */
.my-tabella thead th, .so-tab thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--paper-2); font-size: 0.68rem; letter-spacing: 0.04em; padding-top: 0.3rem; padding-bottom: 0.3rem;
  white-space: nowrap; border-bottom: 1px solid var(--ink-line);
}
.my-tabella-scorri, .so-tab-wrap { overflow: auto; max-width: 100%; }

/* righe alterne leggere + evidenza al passaggio, come un foglio */
.my-tabella tbody tr:nth-child(even) > td { background: color-mix(in srgb, var(--paper-2) 45%, transparent); }
.my-tabella tbody tr:hover > td { background: var(--paper-2); }

/* numeri e celle brevi: niente a capo */
.my-tabella .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.my-tabella td small, .my-tabella td .nota { font-size: 0.68rem; }
.my-tabella p { margin: 0; }

/* controlli dentro le righe: piccoli, non devono allargare la riga */
.my-tabella .btn, .my-tabella .btn-piccolo, .so-tab .btn { padding: 0.12rem 0.5rem; font-size: 0.7rem; min-height: 0; line-height: 1.2; }
.my-tabella input[type="checkbox"] { width: 0.95rem; height: 0.95rem; margin: 0; vertical-align: middle; }
.my-tabella input:not([type="checkbox"]):not([type="radio"]), .my-tabella select { padding: 0.12rem 0.35rem; font-size: 0.75rem; border-width: 1px; border-radius: 6px; min-height: 0; }
.my-tabella .my-stato, .my-tabella .my-chip { padding: 0.05rem 0.45rem; font-size: 0.66rem; }

/* Costi e commesse: pulsante Dettagli, foto, gruppi */
.bi-tab .bi-det { padding: 0.08rem 0.5rem; border-width: 1px; font-size: 0.68rem; }
.bi-tab .bi-foto { padding: 0.02rem 0.2rem; font-size: 0.7rem; }
.bi-tab .bi-sel { width: 1.6rem; }
.bi-tab .bi-sel input { width: 0.95rem; height: 0.95rem; }
.bi-tab .bi-gruppo td, .cat-tabella .cat-gruppo-riga th { padding: 0.35rem 0.55rem 0.2rem; font-size: 0.68rem; }
.bi-listino td:first-child { min-width: 0; max-width: none; }
.bi-sub-riga td:first-child { padding-left: 1.2rem; }

/* accordion: la riga del dettaglio occupa la larghezza disponibile e ha un respiro proprio */
.my-tabella tr.bi-acc > td { padding: 0.6rem 0.75rem; background: var(--paper); line-height: 1.4; font-size: var(--t-s); }
.my-tabella tbody tr.bi-acc:hover > td, .my-tabella tbody tr.bi-acc:nth-child(even) > td { background: var(--paper); }
.my-tabella td details > summary { cursor: pointer; list-style: none; font-size: 0.7rem; color: var(--magenta-deep); white-space: nowrap; }
.my-tabella td details > summary::-webkit-details-marker { display: none; }
.my-tabella td details > summary::before { content: "▸ "; }
.my-tabella td details[open] > summary::before { content: "▾ "; }
.my-tabella td details[open] { white-space: normal; }

/* Contatti (righe a griglia) e altre liste: righe più basse */
.rc-riga { padding: 0.2rem 0.4rem; gap: 0.5rem; border-radius: 4px; font-size: var(--t-xs); }
.rc-gm-riga { padding: 0.2rem 0; }

/* mobile: le tabelle a schede di Risorse restano a schede */
@media (max-width: 760px) {
  .my-tabella thead th { position: static; }
  .ar-tabella td { padding: 0.15rem 0; border-left: 0; }
}

/* righe speciali: tengono il loro colore anche sopra le righe alterne */
.my-tabella tbody tr.bi-gruppo > td { background: var(--paper-2); }
.my-tabella tbody tr.bi-aperta > td { background: var(--paper-2); }
.my-tabella tbody tr.bi-evid > td { background: color-mix(in srgb, var(--magenta-deep) 14%, transparent); }
.my-tabella tbody tr.my-riga-off > td { color: var(--ink-soft); }

/* colonne "azioni" con width:1% (pensate per tabelle al 100%): con larghezza automatica stirerebbero la tabella */
.my-tabella .bi-azione, .my-tabella .ar-c-azioni { width: auto; }

/* 18/11 sera: Costi e commesse a tutta larghezza, senza barra orizzontale.
   La tabella occupa la pagina; nel Listino le colonne si stringono al contenuto e la colonna Soluzione prende lo spazio
   che resta. Il dettaglio/modifica si apre nell'accordion sotto la riga, largo quanto la tabella e mai oltre. */
.my-tabella.bi-tab { width: 100%; table-layout: auto; }
.bi-listino th, .bi-listino td { width: 1%; white-space: nowrap; }
.bi-listino th:nth-child(2), .bi-listino td:nth-child(2) { width: auto; white-space: normal; }
.my-tabella tr.bi-acc > td { width: auto; white-space: normal; max-width: 0; overflow: hidden; }
.my-tabella tr.bi-acc > td > * { max-width: 100%; min-width: 0; box-sizing: border-box; }
.my-tabella tr.bi-acc input, .my-tabella tr.bi-acc select, .my-tabella tr.bi-acc textarea { max-width: 100%; box-sizing: border-box; }
.bi-tab .my-tabella-scorri, .my-tabella-scorri:has(> .bi-tab) { overflow-x: hidden; }

/* Newsletter: pulsanti azione in riga, non impilati a tutta larghezza */
.my-tabella.nl-tabella .nl-c-azioni { width: auto; white-space: nowrap; }
.my-tabella.nl-tabella .nl-c-azioni .btn { display: inline-block; width: auto; margin: 0 0.25rem 0 0; }
.my-tabella tr.bi-acc .bi-dett > *, .my-tabella tr.bi-acc .modulo > * { min-width: 0; }
.my-tabella tr.bi-acc .modulo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
