/* Palette istituzionale portale gdf.gov.it: grigio ardesia, giallo oro, grigi neutri */
:root {
	--gdf-grigio-scuro: #474859;
	--gdf-grigio-barra: #505265;
	--gdf-grigio-chiaro: #EDF1F2;
	--gdf-giallo: #F2C200;
	--gdf-sfondo: #F5F7F8;
	--gdf-testo: #1A1A1A;
}

html { font-size: 15px; }
body {
	font-family: "Titillium Web", "Segoe UI", Arial, sans-serif;
	color: var(--gdf-testo);
	background: var(--gdf-sfondo);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}
main { flex: 1; }

.gdf-topbar { background: var(--gdf-grigio-barra); color: #fff; font-size: .85rem; padding: .3rem 0; }
.gdf-header { background: var(--gdf-grigio-scuro); color: #fff; padding: 1rem 0; border-bottom: 4px solid var(--gdf-giallo); }
.gdf-logo {
	width: 56px; height: 56px; border-radius: 50%;
	background: var(--gdf-giallo); color: var(--gdf-grigio-scuro);
	font-weight: 700; display: flex; align-items: center; justify-content: center;
	margin-right: 1rem; font-size: 1.1rem;
}
.gdf-title { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.gdf-subtitle { font-size: .9rem; opacity: .85; }

.gdf-nav { background: #fff; border-bottom: 1px solid #C7D5D8; }
.gdf-nav .nav-link { color: var(--gdf-grigio-scuro); font-weight: 600; padding: .8rem 1rem; border-bottom: 3px solid transparent; }
.gdf-nav .nav-link:hover, .gdf-nav .nav-link.active { border-bottom-color: var(--gdf-giallo); background: var(--gdf-grigio-chiaro); }

.gdf-footer { background: var(--gdf-grigio-barra); color: #D4D4D5; font-size: .85rem; padding: 1rem 0; margin-top: 2rem; }

h1, h2, h3 { color: var(--gdf-grigio-scuro); font-weight: 700; }
h1 { font-size: 1.6rem; border-left: 6px solid var(--gdf-giallo); padding-left: .6rem; margin-bottom: 1.2rem; }

.btn-gdf { background: var(--gdf-grigio-scuro); color: #fff; border: none; }
.btn-gdf:hover { background: var(--gdf-grigio-barra); color: var(--gdf-giallo); }
.btn-gdf-outline { border: 1px solid var(--gdf-grigio-scuro); color: var(--gdf-grigio-scuro); background: #fff; }
.btn-gdf-outline:hover { background: var(--gdf-grigio-chiaro); }
.btn-check:checked + .btn-gdf-outline, .btn-check:checked + .btn-gdf-outline:hover { background: var(--gdf-grigio-scuro) !important; border-color: var(--gdf-grigio-scuro) !important; color: #fff !important; font-weight: 600; }

.card-gdf { border: none; border-top: 4px solid var(--gdf-grigio-scuro); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.kpi { border-top-color: var(--gdf-giallo); }
.kpi .kpi-label { font-size: .8rem; text-transform: uppercase; color: #5D7083; }
.kpi .kpi-value { font-size: 1.6rem; font-weight: 700; color: var(--gdf-grigio-scuro); }

.filtri { background: #fff; padding: 1rem; border-radius: .25rem; margin-bottom: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,.06); }

.table-gdf { background: #fff; font-size: .9rem; }
.table-gdf thead th { background: var(--gdf-grigio-scuro); color: #fff; border-bottom: 3px solid var(--gdf-giallo); white-space: nowrap; }
.table-gdf tbody tr:hover { background: var(--gdf-grigio-chiaro); }
.table-gdf tfoot td { background: #fff7d1; font-weight: 700; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.delta-pos { color: #a12622; }
.delta-neg { color: #1b6e3a; }


#mappa { height: 560px; background: #F5F7F8; border-radius: .25rem; }
.mappa-legenda { background: #fff; padding: .5rem .7rem; font-size: .8rem; border-top: 3px solid var(--gdf-giallo); box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.mappa-legenda i { display: inline-block; width: 14px; height: 14px; margin-right: 6px; vertical-align: middle; border: 1px solid #C5C7C9; }
.liv-badge.liv-3, .liv-card.liv-3 { border-top-color: #A61B29; } .liv-badge.liv-3 { background: #A61B29; }
.liv-badge.liv-2, .liv-card.liv-2 { border-top-color: #E07B00; } .liv-badge.liv-2 { background: #E07B00; }
.liv-badge.liv-1, .liv-card.liv-1 { border-top-color: var(--gdf-giallo); } .liv-badge.liv-1 { background: var(--gdf-giallo); color: #1A1A1A; }
.liv-badge.liv-0 { background: #C5C7C9; color: #1A1A1A; }
.liv-card:hover { box-shadow: 0 3px 10px rgba(0,0,0,.15); }

/* Mappa ore tagliate (pagina Forza) */
:root { --mt-verde: #2e9e5b; --mt-giallo: #f2c200; --mt-rosso: #d64545; --mt-vuoto: #d5dade; }
.mappa-pannello { position: relative; padding: 1rem; background: linear-gradient(160deg, #fbfcfd, #eef2f4); }
#mappa { width: 100%; max-height: 560px; display: block; margin-top: .5rem; filter: drop-shadow(0 6px 10px rgba(30,40,60,.12)); }
#mappa .regione { stroke: #fff; stroke-width: 1.2; cursor: pointer; transition: fill .25s, opacity .2s, stroke-width .15s; }
#mappa .regione:hover { opacity: .82; stroke-width: 2; }
#mappa .regione.sel { stroke: #1f2433; stroke-width: 2.6; }
.mt-verde { fill: var(--mt-verde); } .mt-giallo { fill: var(--mt-giallo); } .mt-rosso { fill: var(--mt-rosso); } .mt-vuoto { fill: var(--mt-vuoto); }
.mt-badge-verde { background: var(--mt-verde); } .mt-badge-giallo { background: var(--mt-giallo); color: #333; }
.mt-badge-rosso { background: var(--mt-rosso); } .mt-badge-vuoto { background: var(--mt-vuoto); color: #555; }
.mappa-legenda { display: flex; flex-direction: column; gap: .15rem; }
.mappa-legenda i { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.mappa-tip { position: absolute; pointer-events: none; background: rgba(31,36,51,.92); color: #fff; padding: .4rem .6rem; border-radius: 6px; font-size: .8rem; line-height: 1.35; box-shadow: 0 4px 12px rgba(0,0,0,.25); z-index: 5; }
.mappa-kpi { background: var(--gdf-grigio-chiaro); border-radius: 6px; padding: .35rem .5rem; font-size: .8rem; }
.mappa-albero { max-height: 460px; overflow-y: auto; }
.mappa-albero thead th { position: sticky; top: 0; background: #fff; z-index: 1; }
.btn-espandi { border: 0; background: none; width: 1.2rem; padding: 0; color: var(--gdf-grigio-scuro); display: inline-block; }
.btn-espandi.vuoto { cursor: default; }
.mappa-albero tr.aperta > td { font-weight: 600; }
.mappa-tagli [hidden] { display: none !important; }
.mappa-tagli .row > [class*="col-"] { min-width: 0; }
.mappa-albero table { min-width: 640px; }
.mappa-albero { overflow-x: auto; }
.mappa-albero tr.espandibile { cursor: pointer; } .mappa-albero tr.espandibile:hover > td { background: #f3f6f8; }

/* Area ispettiva: spiegazione anomalie in italiano corrente */
.spiega summary { cursor: pointer; list-style: none; }
.spiega summary::-webkit-details-marker { display: none; }
.spiega-link { color: #0d6efd; text-decoration: underline dotted; white-space: nowrap; margin-left: .25rem; }
.spiega[open] .spiega-link { color: #6c757d; }
.spiega-testo { margin-top: .35rem; padding: .5rem .65rem; background: #F7F8FA; border-left: 3px solid #F2C200; border-radius: 4px; max-width: 46rem; }

/* Pagina di accesso */
.login-page {
background: linear-gradient(160deg, var(--gdf-grigio-scuro) 0%, var(--gdf-grigio-barra) 55%, #2f303d 100%);
align-items: center; justify-content: center; padding: 1rem;
}
.login-box { width: 100%; max-width: 400px; background: #fff; border-radius: .4rem; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.login-head { background: var(--gdf-grigio-scuro); color: #fff; padding: 1.4rem; display: flex; align-items: center; border-bottom: 4px solid var(--gdf-giallo); }
.login-head .gdf-title { font-size: 1.3rem; }
.login-body { padding: 1.6rem; }
.login-body h2 { border: none; padding: 0; }
.login-body .form-control:focus { border-color: var(--gdf-giallo); box-shadow: 0 0 0 .2rem rgba(242,194,0,.3); }
.login-body .btn-gdf { font-weight: 600; letter-spacing: .03em; }
.login-foot { background: var(--gdf-grigio-chiaro); color: #5D7083; font-size: .8rem; text-align: center; padding: .7rem; }

.gdf-logo-img { height: 64px; width: auto; margin-right: 2rem; }

/* ---- Confronto anni ---- */
.filtri-confronto .anno-chip { border: 1px solid #ccd; border-radius: 1rem; padding: .1rem .6rem; background: #fff; font-size: .85rem; }
.kpi .kpi-valore { font-size: 1.6rem; font-weight: 700; color: var(--gdf-grigio-scuro); }
.kpi-attivo { border-top: 4px solid var(--gdf-giallo); }
.delta-su { color: #C62828; font-weight: 600; }
.delta-giu { color: #2E7D32; font-weight: 600; }
.delta-neutro { color: #555; }
.tabella-confronto-wrap { max-height: 70vh; overflow: auto; }
.tabella-confronto { font-size: .82rem; white-space: nowrap; }
.tabella-confronto thead th { position: sticky; top: 0; z-index: 2; background: var(--gdf-grigio-scuro); color: #fff; vertical-align: middle; }
.tabella-confronto thead tr:nth-child(2) th { top: 2.1rem; }
.tabella-confronto thead tr.filtri-colonna th { top: 3.9rem; background: var(--gdf-grigio-chiaro); }
.tabella-confronto th.gruppo { border-left: 2px solid #fff; }
.tabella-confronto th.gruppo-attivo { background: var(--gdf-giallo); color: #1A1A1A; }
.tabella-confronto .sticky-col { position: sticky; left: 0; background: #fff; z-index: 1; min-width: 9rem; }
.tabella-confronto .sticky-col2 { position: sticky; left: 9rem; background: #fff; z-index: 1; min-width: 10rem; }
.tabella-confronto thead .sticky-col, .tabella-confronto thead .sticky-col2 { z-index: 3; }
.tabella-confronto td.anno-cur { font-weight: 600; }
.tabella-confronto tr.riga-sub td { background: var(--gdf-grigio-chiaro); font-weight: 700; }
.tabella-confronto tfoot td { background: var(--gdf-grigio-scuro); color: #fff; font-weight: 700; position: sticky; bottom: 0; }
.tabella-confronto tfoot td.delta-su, .tabella-confronto tfoot td.delta-giu { color: var(--gdf-giallo); }
.badge.macro-ufficiali { background: var(--gdf-grigio-scuro); }
.badge.macro-peisaf { background: #7A7F8C; }
.badge.macro-allievi { background: #B0B4BC; color: #1A1A1A; }
.gdf-header-inner { position: relative; display: flex; align-items: center; min-height: 64px; }
.gdf-header-inner .gdf-header-center { position: absolute; left: 50%; transform: translateX(-50%); text-align: center; white-space: nowrap; }
.gdf-header-inner .gdf-title { font-size: 1.9rem; letter-spacing: .02em; }
@media (max-width: 768px) {
    .gdf-header-inner .gdf-header-center { position: static; transform: none; flex: 1; min-width: 0; white-space: normal; }
    .gdf-header-inner .gdf-title { font-size: 1.3rem; }
    .gdf-header-inner .gdf-subtitle { white-space: normal; }
}
.login-head .gdf-logo-img { height: 56px; }
#mappaMilitari .tabulator-row.mil-oltre { background: #FDECEC; }
#mappaMilitari .tabulator-row.mil-oltre .tabulator-cell:first-child { box-shadow: inset 3px 0 0 #C62828; }

.gdf-dropdown { border: none; border-top: 3px solid var(--gdf-giallo); border-radius: 0; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.gdf-dropdown .dropdown-item { color: var(--gdf-grigio-scuro); font-weight: 600; padding: .5rem 1.2rem; }
.gdf-dropdown .dropdown-item:hover { background: var(--gdf-grigio-chiaro); }

/* Indici di rischio */
.rischio-tabs { border-bottom: 3px solid var(--gdf-giallo); }
.rischio-tabs .nav-link { color: var(--gdf-grigio-scuro); background: #fff; border: 1px solid #dee2e6; border-bottom: none; margin-right: .25rem; padding: .5rem .9rem; }
.rischio-tabs .nav-link:hover { background: var(--gdf-grigio-chiaro); }
.rischio-tabs .nav-link.active { background: var(--gdf-grigio-scuro); color: #fff; border-color: var(--gdf-grigio-scuro); }
.rischio-tabs .nav-link.active .text-muted { color: #D4D4D5 !important; }
.rischio-num { display: inline-flex; align-items: center; justify-content: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--gdf-giallo); color: #1A1A1A; font-weight: 700; margin-right: .5rem; vertical-align: middle; }
.rischio-filtri { border-top-left-radius: 0; border-top-right-radius: 0; }
.indice-voce { background: #fff; border: 1px solid #e3e6e8; border-left-width: 4px; border-radius: 4px; padding: .35rem .5rem; height: 100%; }
.stato-attivo { background: #3B8C5A; color: #fff; } .stato-attivo-bordo { border-left-color: #3B8C5A; }
.stato-parziale { background: var(--gdf-giallo); color: #1A1A1A; } .stato-parziale-bordo { border-left-color: var(--gdf-giallo); }
.stato-mancante { background: #C5C7C9; color: #1A1A1A; } .stato-mancante-bordo { border-left-color: #C5C7C9; opacity: .8; }
.tabella-scroll { max-height: 480px; overflow-y: auto; }
.tabella-scroll thead th { position: sticky; top: 0; z-index: 1; }
.table-gdf thead th[role=button]:hover { color: var(--gdf-giallo); }
.table-gdf thead th[data-ord=asc]::after { content: " \25B2"; font-size: .7em; }
.table-gdf thead th[data-ord=desc]::after { content: " \25BC"; font-size: .7em; }
.nascosta-cerca, .nascosta-filtro { display: none; }
.barra-val { display: inline-block; min-width: 4.5rem; padding: 0 .3rem; background: linear-gradient(90deg, #dfe5ea var(--w), transparent var(--w)); border-radius: 3px; }
.barra-val.val-medio { background: linear-gradient(90deg, #ffe08a var(--w), transparent var(--w)); }
.barra-val.val-alto { background: linear-gradient(90deg, #f3b3a6 var(--w), transparent var(--w)); font-weight: 700; color: #A61B29; }
.mesi-pallini { display: inline-flex; gap: 2px; vertical-align: middle; margin-right: .3rem; }
.mesi-pallini i { width: 6px; height: 10px; border-radius: 1px; background: #e3e6e8; }
.mesi-pallini i.on { background: #E07B00; }
.rischio-attesa { background: linear-gradient(160deg, #fbfcfd, #eef2f4); }

/* Manuale integrato: pulsante "?" e box descrittivo */
.btn-guida {
display: inline-flex; align-items: center; justify-content: center;
width: 1.35rem; height: 1.35rem; margin-left: .4rem; padding: 0;
border: 1px solid var(--gdf-grigio-barra); border-radius: 50%;
background: #fff; color: var(--gdf-grigio-scuro);
font-size: .75rem; font-weight: 700; line-height: 1; vertical-align: middle; cursor: help;
}
.btn-guida:hover, .btn-guida[aria-expanded="true"] { background: var(--gdf-giallo); border-color: var(--gdf-giallo); color: #000; }
.guida-box { font-size: .85rem; }
.guida-corpo {
margin: .5rem 0; padding: .6rem .8rem;
background: #FFFBEA; border-left: 4px solid var(--gdf-giallo); border-radius: .25rem;
}
.guida-titolo { font-weight: 700; margin-bottom: .3rem; }
.guida-corpo dt { font-weight: 600; font-size: .8rem; color: var(--gdf-grigio-scuro); }
.guida-corpo dd { margin-bottom: .35rem; }
.btn-esporta { font-size: .75rem; }
.guida-box { font-weight: 400; font-family: inherit; letter-spacing: normal; text-transform: none; } h1 .guida-box, h2 .guida-box, h3 .guida-box { display: block; } .guida-box.collapse:not(.show) { display: none; }
.sigla { display: inline-block; font-size: .65rem; font-weight: 600; padding: 0 .3rem; margin-right: .25rem; border-radius: .2rem; background: var(--gdf-grigio-chiaro); color: var(--gdf-grigio-scuro); vertical-align: middle; }
.link-reparto { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--gdf-grigio-barra); } .link-reparto:hover { color: #000; background: #FFFBEA; }
.btn-xs { padding: 0 .35rem; font-size: .72rem; line-height: 1.4; } .azioni-dett { display: inline-flex; gap: .25rem; flex-wrap: wrap; margin-top: .1rem; } .tab-dett .riga-prov { cursor: pointer; } .tab-dett .riga-prov:hover { background: #FFFBEA; } .tab-dett td { vertical-align: top; } #mappaDettaglio { max-height: 560px; overflow-y: auto; }

/* Anello giallo che evidenzia sulla mappa il reparto scelto nel box di destra */
.sede-evidenziata { animation: sede-lampeggia 1s ease-in-out infinite; }
@keyframes sede-lampeggia { 50% { stroke-opacity: .2; } }
.sede-evidenziata-gl { animation: sede-lampeggia-gl 1s ease-in-out infinite; }
@keyframes sede-lampeggia-gl { 50% { border-color: rgba(242,194,0,.2); } }


.th-ordina { color: inherit; text-decoration: none; white-space: nowrap; }
.th-ordina:hover { text-decoration: underline; }

/* Barra filtri della mappa del cruscotto: ambito organizzativo e categoria di personale */
.filtri-mappa { background: #f4f6fa; border: 1px solid #dde3ec; }
.filtri-mappa .filtri-etichetta { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #5b6575; }
.filtri-mappa .btn-group .btn { white-space: nowrap; }
.filtri-mappa .btn-group .btn.active { font-weight: 600; }

/* Caricamento mappa: velo leggero e barra animata durante il refresh */
#mappa { position: relative; transition: opacity .2s; }
#mappa.mappa-caricamento { opacity: .65; }
#mappa.mappa-caricamento::after { content: ""; position: absolute; top: 0; left: 0; height: 3px; width: 40%; z-index: 1000; background: var(--gdf-giallo, #F2C200); animation: mappa-barra 1s ease-in-out infinite; }
@keyframes mappa-barra { 0% { left: -40%; } 100% { left: 100%; } }
.leaflet-interactive { transition: fill .25s, fill-opacity .25s; }
/* Tom Select compatto come form-select-sm */
.ts-wrapper.form-select-sm .ts-control { min-height: calc(1.5em + .5rem + 2px); padding: .2rem .5rem; font-size: .875rem; }
#mappaMilitari .tabulator { font-size: .85rem; }

/* Tabulator (elenco militari del dettaglio): intestazione nei colori del sito, compatta e leggibile */
.tabulator.tabulator.tabulator { font-size: .85rem; border: 1px solid #DDE2E4; }
.tabulator.tabulator .tabulator-header { background: var(--gdf-grigio-scuro); color: #fff; border-bottom: 3px solid var(--gdf-giallo); }
.tabulator.tabulator .tabulator-header .tabulator-col { background: transparent; color: #fff; border-right: 1px solid rgba(255,255,255,.15); }
.tabulator.tabulator .tabulator-header .tabulator-col .tabulator-col-content { padding: .35rem .4rem; }
.tabulator.tabulator .tabulator-header .tabulator-col .tabulator-col-title { font-weight: 600; white-space: nowrap; }
.tabulator.tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover { background: var(--gdf-grigio-barra); color: var(--gdf-giallo); }
.tabulator.tabulator .tabulator-header .tabulator-col .tabulator-col-sorter .tabulator-arrow { border-bottom-color: rgba(255,255,255,.45); }
.tabulator.tabulator .tabulator-header .tabulator-col[aria-sort=ascending] .tabulator-col-sorter .tabulator-arrow { border-bottom-color: var(--gdf-giallo); }
.tabulator.tabulator .tabulator-header .tabulator-col[aria-sort=descending] .tabulator-col-sorter .tabulator-arrow { border-top-color: var(--gdf-giallo); }
.tabulator.tabulator .tabulator-header .tabulator-header-filter input { font-size: .78rem; padding: .1rem .3rem; border: 0; border-radius: .2rem; background: #fff; color: var(--gdf-testo); }
.tabulator.tabulator .tabulator-row { cursor: pointer; }
.tabulator.tabulator .tabulator-row .tabulator-cell { padding: .3rem .4rem; }
.tabulator.tabulator .tabulator-row.tabulator-row-even { background: var(--gdf-sfondo); }
.tabulator.tabulator .tabulator-row:hover { background: #FFF6D1; }

.tabulator.tabulator .col-num { text-align: left !important; font-variant-numeric: tabular-nums; }
.tabulator.tabulator .tabulator-header .col-num .tabulator-col-title { text-align: left; }
