/* Stili del gestionale progetti: celle di allarme dei riepiloghi, tabelle, schede stampabili */

/* celle dei riepiloghi progetti: verde = nei limiti, rosso = fuori budget, arancio = attenzione */
.cell-ok { background-color: #d4edda !important; color: #155724; }
.cell-ko { background-color: #f8d7da !important; color: #721c24; font-weight: 600; }
.cell-warn { background-color: #ffe5d0 !important; color: #7a3e00; }

/* righe dei to-do e delle ferie */
tr.riga-completata > td { background-color: #fff9c4 !important; }
tr.riga-approvata > td { background-color: #d4edda !important; }
tr.riga-rifiutata > td { background-color: #f8d7da !important; }

table.dataTable td.num,
table.dataTable th.num,
.table td.num,
.table th.num { text-align: right; white-space: nowrap; }

/* totali in testa ai riepiloghi */
.totali-riepilogo .totale { text-align: center; padding: 0.5rem 1rem; }
.totali-riepilogo .totale .valore { display: block; font-size: 1.5rem; font-weight: 600; }
.totali-riepilogo .totale .etichetta { display: block; font-size: 0.85rem; color: #80808f; text-transform: uppercase; }

/* sezioni di dettaglio del progetto */
.dettagli-progetto .totale-sezione { font-weight: 600; }
.dettagli-progetto .totale-ko, .totali-progetto .totale-ko { color: #dc3545; font-weight: 600; }
.dettagli-progetto .totale-ok, .totali-progetto .totale-ok { color: #008327; font-weight: 600; }
.dettagli-progetto .riepilogo-ore { max-width: 360px; }


/* calendario ferie */
#calendario-ferie { background-color: #fff; padding: 1rem; }

/* scheda progetto stampabile */
.scheda-progetto h1 { font-size: 1.6rem; }
.scheda-progetto .table td, .scheda-progetto .table th { padding: 0.35rem 0.6rem; }

@media print {
    header, footer, .header, .header-mobile, .subheader, .footer, .no-print, #kt_header, #kt_footer { display: none !important; }
    .content { padding: 0 !important; }
    .card { border: 0 !important; box-shadow: none !important; }
    body { background: #fff !important; }
}

/* colore di base di label, intestazioni e testo delle tabelle (le classi specifiche, es. text-*, restano valide) */
label,
.form-group label,
.table,
table.dataTable { color: #121212; }

/* il tema colora th/td dei DataTables (#464E5F, #212121), le righe in hover e .thead-light: stesso colore di base */
.dataTables_wrapper .dataTable th,
.dataTables_wrapper .dataTable td,
.dataTables_wrapper .dataTable thead th,
.dataTables_wrapper .dataTable tfoot th,
.table-hover tbody tr:hover,
.table .thead-light th { color: #121212; }

/* padding verticale compatto di intestazioni e celle dei DataTables */
.dataTables_wrapper .dataTable th,
.dataTables_wrapper .dataTable td { padding-top: 0.5rem; padding-bottom: 0.5rem; }

/* colonne con solo pulsanti icona (th.no-sort): larghe al massimo 50px */
table.dataTable th.no-sort,
.table th.no-sort { width: 50px; max-width: 50px; }
table.dataTable td:has(> a.btn-icon),
.table td:has(> a.btn-icon) { max-width: 50px; white-space: nowrap; }
table.dataTable th.no-sort,
table.dataTable td:has(> a.btn-icon) { padding-left: 0.5rem; padding-right: 0.5rem; }

/* colonne icona: contenuto centrato (Users usa la classe col-icona, definita nei columnDefs) */
table.dataTable th.col-icona,
table.dataTable td.col-icona { width: 1% !important; min-width: 0; white-space: nowrap; padding-left: 0.5rem; padding-right: 0.5rem; }
table.dataTable th.no-sort,
table.dataTable td:has(> a.btn-icon),
table.dataTable th.col-icona,
table.dataTable td.col-icona { text-align: center; }
table.dataTable td > a.btn-icon:only-child { margin-right: 0; }

/* leggibilità tabelle: bordi più marcati e intestazione più evidente */
.table-bordered,
.table-bordered th,
.table-bordered td,
table.table-bordered.dataTable th,
table.table-bordered.dataTable td { border-color: #D3D9E0; }

.table.table-head-solid thead th,
.table.table-head-solid thead td,
.table thead th,
table.dataTable thead th,
.dataTables_wrapper .dataTable thead th {
    background-color: #E4E9EF;
    font-weight: 600;
    border-bottom: 2px solid #C5CDD6;
}

/* leggibilità form: bordo dei campi più marcato, focus evidente, campi non modificabili, errori di validazione */
.form-control,
.custom-select { border-color: #B5BFCB; }

.form-control:focus,
.custom-select:focus {
    border-color: #3B7DDD;
    box-shadow: 0 0 0 3px rgba(59, 125, 221, 0.2) !important;
}

.form-control:disabled,
.form-control[readonly],
.custom-select:disabled,
fieldset:disabled .form-control,
fieldset:disabled .custom-select {
    background-color: #F1F3F6;
    color: #5A6270;
    cursor: not-allowed;
}

.form-control.is-invalid,
.form-control.input-validation-error,
.custom-select.is-invalid,
.custom-select.input-validation-error { border-color: #C62828; }
.form-control.input-validation-error:focus,
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.2) !important; }

.field-validation-error,
.invalid-feedback,
.validation-summary-errors { color: #B71C1C; font-size: 0.95rem; font-weight: 500; }
span.field-validation-error { display: block; margin-top: 0.25rem; }
