:root {
  --ga-primario: #0b4f7c;
  --ga-sfondo: #f4f6f9;
}
body { background: var(--ga-sfondo); font-size: .925rem; }
.navbar-brand { font-weight: 600; letter-spacing: .02em; }
.navbar.bg-ga { background: var(--ga-primario); }
.page-title { font-size: 1.35rem; font-weight: 600; margin: 0; }
.card { border: 0; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
label.required::after, .form-label.required::after { content: " *"; color: #dc3545; }

/* Colori per stato ed esito (RF-06) */
.badge-stato { font-weight: 600; font-size: .78rem; padding: .35em .6em; border-radius: .35rem; white-space: nowrap; }
.stato-da-lavorare { background: #e7f1fb; color: #0b4f7c; }
.stato-in-lavorazione { background: #fff1dd; color: #a35400; }
.stato-sospesa { background: #efe7fb; color: #5b2d9c; }
.stato-completata { background: #e3f5e9; color: #1b6e3a; }
.stato-annullata { background: #eceef1; color: #5c636a; }
.esito-ok { background: #d1f0dc; color: #14592e; }
.esito-ko { background: #fbe0e1; color: #a1161f; }
.priorita-alta { color: #a1161f; font-weight: 600; }

/* Elenco attività */
.tabella-attivita { font-size: .86rem; }
.tabella-attivita th { white-space: nowrap; background: #eef2f6; position: sticky; top: 0; z-index: 2; }
.tabella-attivita th a { color: inherit; text-decoration: none; }
.tabella-attivita tr.filtri th { background: #f8f9fb; padding: .25rem; }
.tabella-attivita tr.filtri .form-control, .tabella-attivita tr.filtri .form-select { font-size: .8rem; padding: .2rem .4rem; min-width: 80px; }
.tabella-attivita td { vertical-align: middle; }
.tabella-attivita tbody tr { cursor: pointer; }
.tabella-attivita tbody tr.riga-ko td { background: #fff5f5; }
.tabella-attivita tbody tr.riga-ritardo td:first-child + td { box-shadow: inset 3px 0 0 #dc3545; }
.tabella-attivita tbody tr.selezionata td { background: #fff8d6 !important; }
.tabella-attivita tbody tr:hover td { background: #f1f6fb; }
.task-cella { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra-strumenti { background: #fff; border-radius: .5rem; padding: .5rem .75rem; }
.in-ritardo { color: #a1161f; font-weight: 600; }

/* Form Nuovo Task / informazioni generali (6.2) */
.form-task { border-radius: .25rem; }
.form-task-header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .75rem 1rem; background: #f7f7f7; border-bottom: 1px solid #e5e5e5; }
.form-task-titolo { font-size: 1rem; font-weight: 400; margin: 0; color: #333; }
.form-task-titolo span { color: #999; }
.form-task-body { padding: 1rem 1rem .5rem; }
.form-task-body .col-form-label { font-weight: 700; font-size: .8rem; color: #333; padding-top: .3rem; }
.form-task-body .form-control-sm, .form-task-body .form-select-sm { font-size: .8rem; border-radius: 2px; }
@media (min-width: 576px) {
  /* Colonna etichette stretta come nel sistema attuale; le etichette a metà riga non vanno a capo */
  .form-task-body .row > .col-form-label.col-sm-2 { flex: 0 0 150px; width: 150px; }
  .form-task-body .row > .offset-sm-2 { margin-left: 150px; }
  .form-task-body .row > .col-form-label.text-sm-end { flex: 0 0 auto; width: auto; white-space: nowrap; }
}
.form-task-sezione { font-weight: 700; font-size: .8rem; color: #666; border-bottom: 1px solid #eee; margin-bottom: .5rem; padding-bottom: .25rem; }
.form-task-footer { display: flex; justify-content: flex-end; gap: .5rem; padding: 1.25rem 1rem 1rem; }
.form-task-footer .btn, .form-task-header .btn { font-size: .75rem; }
.form-task .editor-area { min-height: 210px; border-radius: 0; }
.form-task .editor-toolbar { border-radius: 0; }

/* Editor di testo formattato */
.editor-toolbar { border: 1px solid #ced4da; border-bottom: 0; border-radius: .375rem .375rem 0 0; background: #f8f9fa; padding: .25rem; }
.editor-toolbar button { border: 0; background: transparent; padding: .2rem .5rem; border-radius: .25rem; }
.editor-toolbar button:hover { background: #e2e6ea; }
.editor-area { min-height: 160px; border: 1px solid #ced4da; border-radius: 0 0 .375rem .375rem; padding: .5rem .75rem; background: #fff; }
.editor-area:focus { outline: 2px solid #86b7fe; }
.testo-formattato p, .testo-formattato div { margin-bottom: .25rem; }

/* Autocompletamento cliente */
.autocomplete { position: relative; }
.autocomplete-lista { position: absolute; z-index: 1050; left: 0; right: 0; top: 100%; max-height: 280px; overflow-y: auto; }

/* Dettaglio */
.dl-dettaglio dt { font-weight: 500; color: #6c757d; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.dl-dettaglio dd { margin-bottom: .75rem; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { border-left: 3px solid #dee2e6; padding: .25rem 0 .75rem .9rem; position: relative; }
.timeline li.nota { border-left-color: #0b4f7c; }
.timeline li.stato { border-left-color: #fd7e14; }
.timeline .meta { font-size: .78rem; color: #6c757d; }
.checklist-item { padding: .35rem 0; border-bottom: 1px dashed #e5e7eb; }

@media print {
  .no-print, nav, .btn { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}
@media (max-width: 991px) {
  .task-cella { max-width: 180px; }
}
