﻿/* 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); }

.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; }
    .gdf-header-inner .gdf-subtitle { white-space: normal; }
}
.login-head .gdf-logo-img { height: 56px; }
