/* Tenuta Virgilio - layout stability safeguards */
html,body{max-width:100%;overflow-x:hidden}
*,*::before,*::after{box-sizing:border-box}
.app-shell,.section,.panel,.split,.kpi-grid,.hero-kpi-grid,.insight-grid,.strategy-analytics,.sa-grid,.sa-card,.table-wrap,.costs-manager-view,.guest-stay-analytics{min-width:0;max-width:100%}
img,svg,canvas{max-width:100%;height:auto}
.chart,.revenue-yoy-chart,.sa-bars,.sa-months,.sa-paired-months{min-width:0;max-width:100%;overflow:hidden}
.table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
.table-wrap table{max-width:none}
.section-head,.panel-head,.topbar,.toolbar,.quick-filters,.filter-bar{min-width:0}
.section-head>*,.panel-head>*,.topbar>*,.toolbar>*,.quick-filters>*,.filter-bar>*{min-width:0}
button,input,select,textarea{max-width:100%}
.summary-pill,.detail-pill,.badge,.status-pill{max-width:100%;white-space:normal}
@media(max-width:900px){
  .app-shell{width:100%;max-width:100%;padding-left:12px;padding-right:12px}
  .section{width:100%;max-width:100%;overflow:hidden}
  .split,.sa-grid,.lucia-table-grid{grid-template-columns:minmax(0,1fr)!important}
  .hero-kpi-grid,.kpi-grid,.insight-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .panel,.sa-card{overflow:hidden}
  .chart{overflow:hidden}
}
@media(max-width:520px){
  .app-shell{padding-left:8px;padding-right:8px}
  .hero-kpi-grid,.kpi-grid,.insight-grid{grid-template-columns:minmax(0,1fr)}
  .quick-filters{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  .section-head,.panel-head{align-items:flex-start;flex-wrap:wrap}
  .table-wrap{margin-left:0;margin-right:0;width:100%}
}
