.statistics-page{min-width:0;color:var(--ink,#171717)}
.statistics-page .stats-intro{align-items:flex-start;margin-bottom:17px}
.statistics-page .stats-intro h2{margin:6px 0 7px;font:700 clamp(27px,3.5vw,38px) "Playfair Display",serif;letter-spacing:-.035em}
.statistics-page .stats-intro p{max-width:660px;line-height:1.55}
.stats-period-label{display:grid;gap:4px;min-width:200px;padding:11px 14px;border-left:2px solid #171717;background:#f5f5f5}
.stats-period-label>span,.stats-period-label small{color:#555;font-size:11px}
.stats-period-label strong{font-size:13px}
.statistics-page .stats-filters{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:15px;padding:15px 18px}
.stats-filter-title{display:grid;gap:4px}
.stats-filter-title>strong{font-size:13px}
.stats-filter-title>span{color:#555;font-size:11px}
.stats-filter-controls{display:flex;gap:10px;align-items:flex-end}
.stats-field{display:grid;gap:5px;min-width:130px;color:#333;font-size:11px;font-weight:700}
.stats-field select{width:100%;min-width:0;min-height:38px;padding:8px 10px;border:2px solid #c9c9c9;border-radius:9px;background:#fff;color:#171717}
.statistics-page .stats-summary-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:11px;margin:0 0 15px}
.statistics-page .stats-summary{min-width:0;padding:15px 16px}
.statistics-page .stats-summary strong{font-size:clamp(18px,2vw,23px);overflow-wrap:anywhere}
.statistics-page .stats-summary small{display:block}
.statistics-page .stats-summary.negative strong{color:#c62828}
.stats-panel-head{align-items:flex-start}
.stats-panel-head>div{min-width:0}
.stats-panel-head p{margin:5px 0 0;font-size:11px;line-height:1.45}
.stats-year-pair{flex:0 0 auto;padding:6px 9px;border:2px solid #d8d8d8;border-radius:99px;background:#f5f5f5;font:11px "DM Mono",monospace}
.stats-table-wrap{width:100%;max-width:100%}
.stats-table{min-width:0;width:100%}
.stats-table th{white-space:nowrap}
.stats-table tbody th{font-size:12px;text-transform:none;letter-spacing:0;color:#222}
.stats-table td{font-variant-numeric:tabular-nums}
.stats-chart-panel{min-width:0;overflow:visible}
.stats-chart canvas{display:block;width:100%!important;height:355px!important}
.stats-chart-head{align-items:flex-end}
.stats-chart-head .stats-field{min-width:215px}
.stats-chart-shell{position:relative;width:100%;min-width:0;min-height:355px}
.stats-chart{width:100%;height:355px;min-width:0}
.stats-chart-message{position:absolute;inset:0;display:grid;place-content:center;gap:9px;padding:20px;text-align:center;background:rgba(255,255,255,.95);color:#555;font-size:12px;line-height:1.5}
.stats-chart-error{color:#a51e1e;background:#fff8f8}
.stats-chart-loading{grid-auto-flow:column;align-content:center}
.stats-chart-loading i{width:38px;height:7px;border-radius:8px;background:#e2e2e2;animation:statsPulse 1.1s ease-in-out infinite alternate}
.stats-chart-loading i:nth-child(2){animation-delay:.12s}
.stats-chart-loading i:nth-child(3){animation-delay:.24s}
@keyframes statsPulse{from{opacity:.42}to{opacity:1}}
.stats-chart-note{margin:10px 0 0}
.flow-chart{width:100%;height:auto;display:block}
.flow-legend{display:flex;gap:16px;margin:8px 0 14px;color:#E6F1EF;font-size:13px}
.flow-swatch{width:18px;height:4px;display:inline-block;margin-right:6px;vertical-align:middle}
.flow-swatch.venduto{background:#3ecf8e}
.flow-swatch.uscite{background:#ff6b6b}
.flow-totals{margin-top:4px}
.stats-tooltip{display:grid;gap:7px;font-size:12px}
.stats-tooltip>div{padding-top:5px;border-top:2px solid #ddd}
.stats-tooltip small{color:#555}
.stats-beverage-table{min-width:0;width:100%}
.stats-empty{display:grid;gap:5px;line-height:1.5}
.stats-empty strong{color:#171717}
.stats-empty span{font-size:12px}
.stats-no-data{margin-bottom:15px}
.stats-error{padding:14px;border:2px solid #d9a1a1;border-radius:10px;background:#fff7f7;color:#a51e1e;font-size:12px}
.stats-footnote{margin:0 0 15px}
.statistics-page .negative{color:#c62828!important}
@media(max-width:980px){
  .statistics-page .stats-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:680px){
  .statistics-page .stats-intro{display:block}
  .stats-period-label{margin-top:13px;min-width:0}
  .statistics-page .stats-filters{align-items:stretch;flex-direction:column;gap:12px;padding:14px}
  .stats-filter-controls{align-items:stretch}
  .stats-field{flex:1;min-width:0}
  .statistics-page .stats-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .statistics-page .stats-summary{padding:13px}
  .statistics-page .stats-summary strong{font-size:19px}
  .stats-panel-head{flex-wrap:wrap}
  .stats-chart-head{align-items:stretch;flex-direction:column}
  .stats-chart-head .stats-field{min-width:0;width:100%}
  .stats-chart-shell,.stats-chart{min-height:310px;height:310px}
  .stats-chart-message{font-size:11px}
  .stats-year-pair{margin-top:2px}
  .stats-table-wrap{margin:0 -6px;width:calc(100% + 12px)}
}

/* Statistics surfaces inherit the SENSI dark palette while preserving red negatives. */
.statistics-page{color:#f5f5f5}
.stats-period-label{background:#14383C;border-left-color:#F3C98A}
.stats-period-label>span,.stats-period-label small,.stats-filter-title>span,.stats-field{color:#E6F1EF}
.stats-field select{background:#102E32;color:#f5f5f5;border-color:#C4925A;color-scheme:dark}
.statistics-page .stats-summary.negative strong,.statistics-page .negative{color:#ff6b6b!important}
.stats-year-pair{background:#14383C;border-color:#C4925A;color:#e3d5b3}
.stats-table tbody th{color:#f5f5f5}
.stats-chart-message{background:rgba(17,17,17,.96);color:#E6F1EF}
.stats-chart-error,.stats-error{background:#281515;border-color:#8f4545;color:#ff8b8b}
.stats-chart-loading i{background:#C8883C}
.stats-tooltip>div{border-color:#C4925A}
.stats-tooltip small{color:#E6F1EF}
.stats-empty strong{color:#f5f5f5}