/* Stili confinati alla dashboard: nessun impatto sugli altri servizi. */
.meteo-dashboard { --meteo-ink: #16354b; --meteo-muted: #526879; --meteo-border: #dce5ec; color: var(--meteo-ink); padding-bottom: 1rem; }
.meteo-dashboard h2 { font-size: 1.45rem; margin: 0 0 .6rem; color: #16354b; }
.meteo-dashboard h3 { font-size: 1.1rem; margin-top: 0; }
.meteo-dashboard p { color: var(--meteo-muted); }
.meteo-hero { display: flex; gap: 2rem; align-items: center; justify-content: space-between; padding: 2.4rem; border-radius: 1rem; background: linear-gradient(115deg, var(--portal-primary-hover, #003d6b), var(--portal-primary, #005b9f)); color: #fff; margin-bottom: 1.5rem; }
.meteo-hero h1 { color: #fff; font-size: clamp(1.9rem, 3.5vw, 2.7rem); margin: 0 0 .9rem; letter-spacing: -.035em; }
.meteo-hero p { color: #e0edf5; margin-bottom: 0; max-width: 46rem; }
.meteo-dashboard .meteo-eyebrow { font-size: .76rem; font-weight: 700; letter-spacing: .1em; margin: 0 0 .65rem; color: #42637a; }
.meteo-hero .meteo-eyebrow { color: #a9dbe8; margin-bottom: 1rem; }
.meteo-update { min-width: 190px; border-left: 1px solid #6491a7; padding-left: 1.5rem; font-size: .87rem; line-height: 1.8; }
.meteo-update strong, .meteo-update > span:last-child { display: block; }
.meteo-update a { color: #fff; }
.meteo-live-dot { display: inline-block; height: 8px; width: 8px; background: #87e7cf; border-radius: 50%; margin-right: 5px; }
.meteo-card { background: #fff; border: 1px solid var(--meteo-border); border-radius: .8rem; padding: 1.6rem; margin-bottom: 1.5rem; box-shadow: 0 3px 12px rgba(17, 52, 76, .035); min-width: 0; }
.meteo-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .7rem; flex-wrap: wrap; }
.meteo-section-heading > span { color: var(--meteo-muted); font-size: .9rem; }
.meteo-filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; align-items: end; }
.meteo-filter-grid > * { min-width: 0; }
.meteo-filters .form-group { margin-bottom: .6rem; }
.meteo-filters .form-control { box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%; }
.meteo-filter-submit { margin-bottom: .6rem; }
.meteo-filter-submit button { width: 100%; }
.meteo-dashboard details { border-top: 1px solid var(--meteo-border); padding-top: .8rem; margin-top: .8rem; }
.meteo-dashboard summary { cursor: pointer; font-weight: 600; color: #005b9f; padding: .3rem 0; }
.meteo-dashboard details[open] > summary { margin-bottom: .8rem; }
.meteo-advanced p { font-size: .9rem; margin: .6rem 0 0; }
.meteo-presets { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-top: 1rem; font-size: .9rem; }
.meteo-presets a { font-weight: 600; }
.meteo-section-nav { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; padding: .4rem 0 1.2rem; }
.meteo-section-nav a { text-decoration: none; font-weight: 600; font-size: .9rem; }
.meteo-section-nav a:hover { text-decoration: underline; }
.meteo-period-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .7rem; }
.meteo-period-heading h2 { font-size: 1.3rem; margin: 0; }
.meteo-period-heading h2 span { color: #72889a; margin: 0 .5rem; }
.meteo-dashboard .meteo-quality { font-size: .9rem; margin-bottom: 1.4rem; }
.meteo-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.meteo-kpi { border: 1px solid var(--meteo-border); border-top: 3px solid #086887; border-radius: .6rem; padding: 1.2rem; background: #f5fafc; }
.meteo-kpi > span { display: block; color: var(--meteo-muted); font-weight: 600; font-size: .9rem; }
.meteo-kpi > strong { display: block; font-size: 2.2rem; font-variant-numeric: tabular-nums; letter-spacing: -.04em; line-height: 1.3; margin: .65rem 0; }
.meteo-kpi small { font-size: .85rem; font-weight: 500; letter-spacing: 0; white-space: normal; }
.meteo-kpi p { font-size: .8rem; margin-bottom: 0; line-height: 1.45; }
.meteo-kpi-hot { border-top-color: #bf4d26; background: #fff8f3; }
.meteo-kpi-cold { border-top-color: #287db0; background: #f4f9ff; }
.meteo-stat-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; background: #edf3f7; padding: 1.2rem; border-radius: .6rem; margin-bottom: 1.7rem; font-size: .85rem; }
.meteo-stat-strip strong { display: block; font-size: 1.1rem; margin-top: .3rem; font-variant-numeric: tabular-nums; }
.meteo-chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; }
.meteo-chart-grid > .meteo-card { display: flex; flex-direction: column; }
.meteo-chart-grid > .meteo-card > p:not(.meteo-eyebrow) { min-height: 4.5rem; }
.meteo-chart { height: 310px; position: relative; min-width: 0; margin: 1rem 0; }
.meteo-chart-wide { height: 370px; }
.meteo-dashboard canvas { max-width: 100%; }
.meteo-year-highlights { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 1rem; background: #f0f6f8; border-left: 3px solid #086887; border-radius: .4rem; padding: 1.3rem; margin-bottom: 1.5rem; }
.meteo-year-highlights p { margin: 0; font-size: .88rem; }
.meteo-year-highlights strong { display: block; color: var(--meteo-ink); font-size: 1.25rem; margin-top: .4rem; }
.meteo-dashboard caption { color: var(--meteo-muted); font-size: .85rem; padding: .6rem 0; text-align: left; }
.meteo-dashboard .table { font-size: .9rem; margin-bottom: .6rem; }
.meteo-dashboard .table th { white-space: nowrap; }
.meteo-dashboard .table td { font-variant-numeric: tabular-nums; white-space: nowrap; }
.meteo-scroll-table { max-height: 440px; }
.meteo-scroll-table thead { position: sticky; top: 0; z-index: 1; }
.meteo-heatmap { border-collapse: separate; border-spacing: 3px; width: 100%; min-width: 740px; font-size: .85rem; }
.meteo-heatmap th { text-align: center; padding: .4rem .25rem; }
.meteo-heatmap tbody th { background: #f5f8fa; position: sticky; left: 0; z-index: 1; }
.meteo-heatmap td { text-align: center; padding: .5rem .25rem; border-radius: .2rem; color: #16354b; font-variant-numeric: tabular-nums; }
.meteo-heatmap-scroll { max-height: 600px; }
.meteo-heatmap thead th { background: #fff; position: sticky; top: 0; z-index: 2; }
.meteo-heatmap-switch .btn[aria-pressed="true"] { background: #005b9f; color: #fff; border-color: #005b9f; }
.meteo-thresholds { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .8rem; margin: 1.2rem 0; }
.meteo-thresholds > div { border-radius: .5rem; background: #f1f5f8; padding: 1rem; }
.meteo-thresholds strong, .meteo-thresholds span, .meteo-thresholds small { display: block; }
.meteo-thresholds strong { font-size: 1.7rem; }
.meteo-thresholds span { font-weight: 600; font-size: .88rem; }
.meteo-thresholds small { color: var(--meteo-muted); margin-top: .3rem; }
.meteo-streaks { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--meteo-border); }
.meteo-streaks strong { font-size: 1.4rem; }
.meteo-streaks p { margin: .5rem 0 0; font-size: .85rem; }
.meteo-method { background: #f5f8fa; }
.meteo-method-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; margin-top: 1.3rem; }
.meteo-method-grid p, .meteo-footer-note { font-size: .85rem; }
.meteo-dashboard [id] { scroll-margin-top: 90px; }
.meteo-dashboard [hidden] { display: none !important; }
.meteo-dashboard .summary { font-size: .9rem; margin: .7rem 0; }
.meteo-dashboard .grid-view .pagination { display: flex; justify-content: center; flex-wrap: wrap; }
@media (max-width: 991px) {
    .meteo-kpis, .meteo-stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .meteo-hero { padding: 1.7rem; }
    .meteo-chart-grid { grid-template-columns: 1fr; }
    .meteo-chart-grid > .meteo-card > p:not(.meteo-eyebrow) { min-height: 0; }
    .meteo-method-grid { grid-template-columns: 1fr; gap: .5rem; }
    .meteo-thresholds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .meteo-year-highlights { grid-template-columns: 1fr 1fr; }
    .meteo-year-highlights > p:last-child { grid-column: 1 / -1; }
}
@media (max-width: 767px) {
    .meteo-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .meteo-filters .form-control, .meteo-filter-submit .btn { min-height: 44px; }
    /* Safari iOS: elimina la larghezza intrinseca e la centratura del controllo data. */
    .meteo-filters input[type="date"] { -webkit-appearance: none; appearance: none; text-align: left; }
    .meteo-filters input[type="date"]::-webkit-date-and-time-value { min-width: 0; min-height: 1.5em; text-align: left; }
}
@media (max-width: 600px) {
    .meteo-hero { display: block; }
    .meteo-update { border-left: 0; border-top: 1px solid #6491a7; margin-top: 1.3rem; padding: 1rem 0 0; }
    .meteo-card { padding: 1.1rem; }
    .meteo-filter-grid { grid-template-columns: minmax(0, 1fr); }
    .meteo-kpi { padding: 1rem; }
    .meteo-kpi > strong { font-size: 1.8rem; }
    .meteo-kpis { gap: .7rem; }
    .meteo-thresholds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .meteo-streaks, .meteo-year-highlights { grid-template-columns: 1fr; }
    .meteo-chart, .meteo-chart-wide { height: 280px; }
    .meteo-section-nav { gap: .6rem 1rem; }
}
@media print {
    .meteo-filters, .meteo-section-nav, .meteo-dashboard .btn { display: none !important; }
    .meteo-hero { background: #fff; color: #16354b; border: 1px solid #ddd; }
    .meteo-hero h1, .meteo-hero p, .meteo-hero .meteo-eyebrow, .meteo-update a { color: #16354b; }
    .meteo-kpis { grid-template-columns: repeat(2, 1fr); }
    .meteo-chart-grid, .meteo-method-grid { display: block; }
    .meteo-chart { break-inside: avoid; }
    .meteo-card { box-shadow: none; }
    .meteo-scroll-table, .meteo-heatmap-scroll { max-height: none; overflow: visible; }
}
