/*
 * documenti-table.css
 * ===================
 * Stili condivisi per il ViewComponent DocumentiTable.
 * Usato da ElencoDocumenti, GestisciIstruttoria, SuperFascicoloInfo e tutte
 * le pagine che montano <vc:documenti-table>.
 *
 * Colori celle fedeli a ElencoDocumentiDgv.vb (CellFormatting) di REP.
 */

/* ── Tabella documenti (te-table) ───────────────────────────────────────────── */
.te-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
.te-table th,
.te-table td {
    padding: 4px 7px;
    border: 1px solid #dee2e6;
    vertical-align: top;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.te-table thead th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: .80rem;
    white-space: nowrap;
}
.te-table tbody tr:hover td { filter: brightness(.97); }
.te-table td { font-size: .80rem; }

/* ── Larghezze iniziali colonne ─────────────────────────────────────────────── */
.col-view  { width: 30px;  min-width: 30px;  text-align: center; padding: 2px !important; }
.col-ops   { width: 36px;  min-width: 36px;  text-align: center; padding: 2px !important; }
.col-data  { width: 72px;  min-width: 60px;  }
.col-prot  { width: 105px; min-width: 80px;  white-space: pre-line; }
.col-nid   { width: 90px;  min-width: 70px;  }
.col-nome  { width: 220px; min-width: 100px; }
.col-tipo  { width: 130px; min-width: 70px;  }
.col-descr { width: 180px; min-width: 80px;  }
.col-firma { width: 160px; min-width: 80px;  }
.col-stato { width: 210px; min-width: 100px; }
.col-note  { min-width: 80px; }

/* ── Righe colorate (sfondo tenue — non sovrascrive celle colorate inline) ──── */
.te-table tr.doc-int td { background: rgba(0,255,255,.07); }
.te-table tr.doc-ann td { background: rgba(255,0,0,.06); text-decoration: line-through; }
.te-table tr.doc-igr td { background: rgba(173,255,47,.10); }

/* ── Contenitore con intestazione sticky e scroll verticale ─────────────────── */
.te-scroll-wrap {
    overflow-y: auto;
    max-height: calc(100vh - 310px);
    border: 1px solid #dee2e6;
    border-radius: .375rem;
}
/* border-collapse:collapse impedisce position:sticky — si usa separate+spacing:0 */
.te-scroll-wrap .te-table {
    border-collapse: separate !important;
    border-spacing: 0;
}
.te-scroll-wrap .te-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: #f8f9fa;
    box-shadow: inset 0 -1px 0 #dee2e6;
}

/* ── Pulsante visualizza (apre il file in nuova scheda) ─────────────────────── */
.btn-view {
    padding: 2px 4px;
    font-size: .73rem;
    line-height: 1;
    border: 1px solid #ced4da;
    border-radius: 4px;
    color: #0d6efd;
    background: transparent;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}
.btn-view:hover { border-color: #0d6efd; background: #e9f2ff; color: #0a58ca; }
.btn-view .material-icons { font-size: 14px; }

/* ── Pulsante operazioni (dropdown more_vert) ───────────────────────────────── */
.btn-ops {
    padding: 1px 4px;
    font-size: .75rem;
    line-height: 1;
    border-color: #ced4da;
    color: #6c757d;
}
.btn-ops:hover { border-color: #495057; color: #212529; }
.ops-dropdown .dropdown-menu { min-width: 210px; }

/* ── Badge INT (documento interno) ─────────────────────────────────────────── */
.badge-interno { background-color: #00FFFF; color: #000; font-size: .65rem; }

/* ── Righe firmatari nella colonna Stato Approvazione ───────────────────────── */
.firma-riga {
    display: flex;
    align-items: flex-start;
    gap: 3px;
    padding: 2px 0;
    line-height: 1.25;
}
.firma-riga + .firma-riga { border-top: 1px dashed rgba(0,0,0,.15); }
.firma-prossima { font-weight: 600; }
.firma-icona { font-size: 14px; line-height: 1.2; }
.firma-riga .firma-ruolo { color: #555; font-style: italic; }
.firma-riga .firma-stato { color: #444; font-size: .70rem; }

/* ── Icona tipo file nella colonna Nome File (tabella) ─────────────────────── */
.dtc-file-icon {
    font-size: 16px;
    vertical-align: middle;
    margin-right: 3px;
    color: #6c757d;
    flex-shrink: 0;
    opacity: .75;
}

/* Wrapper testo+dimensione in col-nome */
.dtc-nome-wrap { min-width: 0; }

/* ── Vista SCHEDE: card custom a sezioni orizzontali ────────────────────────── */
/* Ispirate a SuperFascicoloInfo con etichetta 90px | valore */
.dtc-card {
    border: 1px solid #dee2e6;
    border-radius: .375rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    margin-bottom: .75rem;
    overflow: hidden;
    font-size: .80rem;
    background: #fff;
}

/* Sfondo tenue per tipo documento */
.dtc-card.doc-int { border-left: 4px solid #00FFFF; background: rgba(0,255,255,.04); }
.dtc-card.doc-ann { border-left: 4px solid #dc3545; background: rgba(255,0,0,.04); }
.dtc-card.doc-igr { border-left: 4px solid #ADFF2F; background: rgba(173,255,47,.05); }

/* ── Barra azioni in cima alla scheda (come SuperFascicoloInfo) ──────────────── */
.dtc-card-azioni {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .35rem;
    padding: .45rem .65rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

/* ── Riga orizzontale: etichetta | valore ───────────────────────────────────── */
.dtc-card-row {
    display: flex;
    align-items: flex-start;
    padding: .30rem .65rem;
    border-bottom: 1px solid #f0f0f0;
    line-height: 1.4;
}
.dtc-card-row:last-child { border-bottom: none; }

/* Etichetta a sinistra — larghezza fissa, uppercase, grigio */
.dtc-label {
    flex: 0 0 90px;
    min-width: 90px;
    font-size: .68rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding-right: .5rem;
    padding-top: .05rem;
}

/* Valore a destra — si espande per riempire lo spazio */
.dtc-val {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

/* Badge N. ISTANZA grande e monospace (ispirato a SuperFascicoloInfo) */
.dtc-nid-badge {
    font-family: var(--bs-font-monospace, monospace);
    font-size: .82rem;
    font-weight: 700;
}

/* ── Separatore tra documenti principali e fascicoli collegati ───────────────── */
.dtc-sep-label {
    text-align: center;
    background: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: .25rem;
    font-size: .78rem;
    font-weight: 600;
    color: #495057;
    padding: .35rem .8rem;
    margin: .75rem 0 .5rem;
}

/* ── Pallino colorato nella legenda ─────────────────────────────────────────── */
.badge-leg {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 1px solid #aaa;
    border-radius: 2px;
    vertical-align: middle;
    margin-right: 3px;
}

/* Pulsante scarica — variante teal (non presente in Bootstrap 5 di default) */
.btn-outline-teal {
    color: #20c997;
    border-color: #20c997;
}
.btn-outline-teal:hover {
    color: #fff;
    background-color: #20c997;
    border-color: #20c997;
}
