html
{
	box-sizing: border-box;
}

*,
*::before,
*::after
{
	box-sizing: inherit;
}

body
{
	margin: 0;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 1rem;
	line-height: 1.5;
	color: #1a1a1a;
	background-color: #f4f6f8;
}

.SaltaNavigazione
{
	position: absolute;
	left: 0.5rem;
	top: 0.5rem;
	min-width: 44px;
	min-height: 44px;
	padding: 0.75rem 1rem;
	background: #111111;
	color: #ffffff;
	text-decoration: none;
	font-weight: bold;
	z-index: 10000;
	transform: translateY(-250%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 0.3rem;
}

.SaltaNavigazione:focus,
.SaltaNavigazione:focus-visible
{
	transform: translateY(0);
	outline: 0.15rem solid #ffffff;
	outline-offset: 0.15rem;
}

header
{
	padding: 0.75rem 1rem;
	background: #1f4e79;
	color: #ffffff;
}

.HeaderCompattato
{
	padding: 0.35rem 0.75rem;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem 1rem;
}

.HeaderCompattato h1
{
	margin: 0;
	font-size: clamp(1rem, 2.8vw, 1.25rem);
	line-height: 1.3;
	color: #ffffff;
	min-width: 0;
}

.HeaderNav
{
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}

.PulsanteHome,
.PulsanteNav
{
	white-space: nowrap;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	min-width: 44px;
	padding: 0.35rem 1.1rem;
	background: #ffffff;
	color: #1f4e79;
	text-decoration: none;
	border: 0.1rem solid #ffffff;
	border-radius: 0.3rem;
	font-weight: bold;
	font-size: 0.95rem;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.PulsanteHome:hover,
.PulsanteNav:hover
{
	background: #e8eef4;
	color: #163a5a;
}

.PulsanteHome:focus-visible,
.PulsanteNav:focus-visible
{
	outline: 0.15rem solid #ffffff;
	outline-offset: 0.15rem;
}

main
{
	display: block;
	padding: 1rem;
	max-width: 78rem;
	margin: 0 auto;
}

.Pannello
{
	position: relative;
	background: #ffffff;
	padding: 1.25rem;
	border-radius: 0.5rem;
	margin-bottom: 1.25rem;
	box-shadow: 0 0.1rem 0.4rem rgba(0, 0, 0, 0.12);
}

.Pannello h2
{
	margin: 0 0 1rem 0;
	font-size: 1.2rem;
	color: #1f4e79;
	border-bottom: 2px solid #e8eef4;
	padding-bottom: 0.4rem;
}

.BarraAzioniGrafico
{
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: center;
	margin-bottom: 1rem;
}

button,
.PulsanteAzione
{
	min-height: 44px;
	min-width: 44px;
	padding: 0.5rem 1.2rem;
	font-size: 1rem;
	font-weight: bold;
	font-family: inherit;
	cursor: pointer;
	background: #1f4e79;
	color: #ffffff;
	border: 0;
	border-radius: 0.3rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.15s ease, transform 0.1s ease;
}

button:hover,
.PulsanteAzione:hover
{
	background: #163a5a;
}

button:active,
.PulsanteAzione:active
{
	transform: translateY(1px);
}

button:focus-visible,
.PulsanteAzione:focus-visible,
input:focus-visible,
select:focus-visible
{
	outline: 0.15rem solid #1f4e79;
	outline-offset: 0.15rem;
}

.ContenitoreCanvas
{
	width: 100%;
	margin: 0 auto 1rem auto;
	text-align: center;
	background: #ffffff;
	border-radius: 0.4rem;
	overflow: hidden;
}

#AreaGrafo
{
	display: block;
	max-width: 100%;
	height: auto;
	margin: 0 auto;
}

.GrigliaFiltri
{
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 1.25rem;
	margin-top: 0.5rem;
}

.GruppoFiltro
{
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 0.4rem;
	padding: 1rem;
}

.GruppoFiltro h3
{
	margin: 0 0 0.75rem 0;
	font-size: 1.05rem;
	color: #1f4e79;
}

.ListaOpzioni
{
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.GrigliaRegioni
{
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
	gap: 0.35rem 0.5rem;
	max-height: 320px;
	overflow-y: auto;
	padding: 0.25rem;
	border: 1px solid #e2e8f0;
	border-radius: 0.3rem;
	background: #ffffff;
}

.VoceControllo
{
	display: flex;
	align-items: center;
	gap: 0.5rem;
	min-height: 44px;
	padding: 0.25rem 0.5rem;
	border-radius: 0.25rem;
	cursor: pointer;
	user-select: none;
	transition: background-color 0.15s ease;
}

.VoceControllo:hover
{
	background: #edf2f7;
}

.VoceControllo input[type="checkbox"]
{
	width: 20px;
	height: 20px;
	margin: 0;
	cursor: pointer;
}

.ControlloData,
.ControlloSelect
{
	width: 100%;
	min-height: 44px;
	padding: 0.5rem 0.75rem;
	font-size: 1rem;
	font-family: inherit;
	border: 1px solid #c5d0db;
	border-radius: 0.3rem;
	background: #ffffff;
	color: #1a1a1a;
	margin-bottom: 0.75rem;
}

.TabellaScorrevole
{
	width: 100%;
	overflow-x: auto;
	margin: 1rem 0;
	border: 1px solid #c5d0db;
	border-radius: 0.4rem;
}

.TabellaScorrevole:focus-visible,
.GrigliaRegioni:focus-visible
{
	outline: 0.15rem solid #1f4e79;
	outline-offset: 0.15rem;
}

.TabellaDati
{
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95rem;
	text-align: right;
	background: #ffffff;
}

.TabellaDati caption
{
	font-weight: bold;
	font-size: 1.1rem;
	color: #1f4e79;
	padding: 0.5rem;
	text-align: left;
}

.TabellaDati th
{
	background-color: #1f4e79;
	color: #ffffff;
	padding: 0.65rem 0.75rem;
	border: 1px solid #c5d0db;
	font-weight: bold;
	white-space: nowrap;
	text-align: center;
}

.TabellaDati td
{
	padding: 0.55rem 0.75rem;
	border: 1px solid #e2e8f0;
	white-space: nowrap;
}

.TabellaDati tr:nth-child(even) td
{
	background-color: #f8fafc;
}

.TabellaDati tr:hover td
{
	background-color: #e8eef4;
}

.TabellaDati .TCol1
{
	text-align: left;
	font-weight: 600;
}

.TabellaDati .TlastRow td
{
	font-weight: bold;
	background-color: #e2e8f0;
	border-top: 2px solid #1f4e79;
}

.GrigliaStatistiche
{
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	gap: 1.25rem;
}

.CardStatistica
{
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 0.4rem;
	padding: 1rem;
	box-shadow: 0 0.1rem 0.3rem rgba(0, 0, 0, 0.08);
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.CardStatistica h3
{
	margin: 0 0 0.75rem 0;
	font-size: 1.05rem;
	color: #1f4e79;
	width: 100%;
}

.PulsanteAnteprimaGrafico
{
	background: transparent;
	border: 0;
	padding: 0;
	margin: 0;
	cursor: pointer;
	position: relative;
	width: 100%;
	display: block;
	border-radius: 0.25rem;
	overflow: hidden;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.PulsanteAnteprimaGrafico:hover,
.PulsanteAnteprimaGrafico:focus-visible
{
	transform: scale(1.02);
	box-shadow: 0 0.25rem 0.75rem rgba(31, 78, 121, 0.25);
	outline: 0.15rem solid #1f4e79;
	outline-offset: 0.15rem;
}

.ImgStatistica
{
	max-width: 100%;
	height: auto;
	display: block;
	border-radius: 0.25rem;
	border: 1px solid #edf2f7;
	margin: 0 auto;
}

/* Modal Lightbox Zoom */
.ModalZoom
{
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.75);
	z-index: 20000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	overflow-y: auto;
}

.ModalZoom[hidden]
{
	display: none;
}

.ContenutoModalZoom
{
	position: relative;
	background: #ffffff;
	border-radius: 0.5rem;
	max-width: 95vw;
	max-height: 95vh;
	padding: 1rem;
	box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.5);
	display: flex;
	flex-direction: column;
	align-items: center;
}

.PulsanteChiudiZoom
{
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	min-width: 44px;
	min-height: 44px;
	background: #1f4e79;
	color: #ffffff;
	border: 0;
	border-radius: 50%;
	font-size: 1.5rem;
	font-weight: bold;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10;
	transition: background-color 0.15s ease;
}

.PulsanteChiudiZoom:hover
{
	background: #c62828;
}

.DidascaliaZoom
{
	margin: 0 2.5rem 0.75rem 0.5rem;
	font-size: 1.15rem;
	font-weight: bold;
	color: #1f4e79;
	text-align: center;
}

.ContenitoreImgZoom
{
	max-width: 100%;
	max-height: calc(90vh - 4rem);
	overflow: auto;
	display: flex;
	justify-content: center;
}

.ImgZoom
{
	max-width: 100%;
	max-height: calc(85vh - 4rem);
	object-fit: contain;
	border-radius: 0.25rem;
}

@media (max-width: 600px)
{
	.HeaderCompattato
	{
		flex-direction: column;
		align-items: flex-start;
	}

	.HeaderNav
	{
		width: 100%;
	}

	.PulsanteHome,
	.PulsanteNav
	{
		flex: 1 1 auto;
	}

	.GrigliaFiltri
	{
		grid-template-columns: 1fr;
	}

	.BarraAzioniGrafico button
	{
		width: 100%;
	}
}
