/* Responsive shared PMS layout. Keep reservation navigation, content and actions in their own grid rows. */
.app-main__outer,.app-main__inner{min-width:0}
#booking-modal .modal-dialog{max-width:calc(100% - 24px)!important;margin:16px auto}
#booking-modal .modal-content{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto;height:min(850px,calc(100vh - 32px));height:min(850px,calc(100dvh - 32px));overflow:hidden}
#booking-modal .modal-content:has(>.sidebar-wrapper:not(.hidden)){grid-template-columns:200px minmax(0,1fr)}
#booking-modal .modal-content:has(>.col-lg-3:not(.sidebar-wrapper)){grid-template-columns:minmax(0,1fr) 240px}
#booking-modal .modal-content:has(>.sidebar-wrapper:not(.hidden)):has(>.col-lg-3:not(.sidebar-wrapper)){grid-template-columns:160px minmax(0,1fr) 240px}
#booking-modal .modal-header{grid-column:1/-1;grid-row:1;min-width:0}
#booking-modal .modal-footer{grid-column:1/-1;grid-row:3;clear:none!important;min-width:0;background:#fff}
#booking-modal .sidebar-wrapper{grid-column:1;grid-row:2;width:auto!important;min-height:0;min-width:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-gutter:stable}
#booking-modal .sidebar-wrapper .left-sidebar{height:auto!important;min-height:0!important;margin:0!important;display:block;float:none;flex-flow:initial}
#booking-modal .sidebar-wrapper .left-sidebar>li{float:none!important;display:block}
#booking-modal .sidebar-wrapper .left-sidebar>li>a{min-height:44px;white-space:normal}
#booking-modal .booking-modal-body{grid-column:1;grid-row:2;width:auto!important;min-height:0;min-width:0;overflow:auto!important;overscroll-behavior:contain}
#booking-modal .modal-content:has(>.sidebar-wrapper:not(.hidden))>.booking-modal-body{grid-column:2}
#booking-modal .modal-content>.col-lg-3:not(.sidebar-wrapper){grid-column:-2/-1;grid-row:2;width:auto!important;min-height:0;overflow:auto}
@media(max-width:767px){
 #booking-modal .modal-dialog{width:calc(100% - 16px)!important;max-width:none!important;margin:8px auto}
 #booking-modal .modal-content,#booking-modal .modal-content:has(>.sidebar-wrapper:not(.hidden)),#booking-modal .modal-content:has(>.col-lg-3:not(.sidebar-wrapper)),#booking-modal .modal-content:has(>.sidebar-wrapper:not(.hidden)):has(>.col-lg-3:not(.sidebar-wrapper)){grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr) auto;height:calc(100vh - 16px);height:calc(100dvh - 16px)}
 #booking-modal .modal-header{padding:10px 32px 10px 10px;position:relative}
 #booking-modal .modal-header h4{font-size:15px;overflow-wrap:anywhere}
 #booking-modal .modal-header .close{position:absolute;top:10px;right:10px}
 #booking-modal .sidebar-wrapper{grid-column:1!important;grid-row:2;max-height:52px;padding:0!important;overflow-x:auto;overflow-y:hidden;scrollbar-gutter:auto;border-bottom:1px solid #dce5ef}
 #booking-modal .sidebar-wrapper .left-sidebar{display:flex!important;flex-flow:row nowrap!important;width:max-content;border:0;padding:0}
 #booking-modal .sidebar-wrapper .left-sidebar>li{flex:0 0 auto;margin:0!important}
 #booking-modal .sidebar-wrapper .left-sidebar>li>a{white-space:nowrap;padding:10px}
 #booking-modal .booking-modal-body,#booking-modal .modal-content:has(>.sidebar-wrapper:not(.hidden))>.booking-modal-body{grid-column:1;grid-row:3;padding:10px}
 #booking-modal .modal-footer{grid-row:4;padding:10px}
 #booking-modal .modal-content>.col-lg-3:not(.sidebar-wrapper){grid-column:1;grid-row:3}
 #booking-modal .form-horizontal .form-group{margin-left:0;margin-right:0}
 #booking-modal input.form-control,#booking-modal select.form-control,#booking-modal textarea.form-control{max-width:100%}
}

@media(max-width:767px){
 #booking-modal .modal-content:has(>.col-lg-3:not(.sidebar-wrapper)){grid-template-rows:auto auto minmax(100px,1fr) minmax(80px,.45fr) auto}
 #booking-modal .modal-content>.col-lg-3:not(.sidebar-wrapper){display:block;grid-row:4;max-height:none;border-top:1px solid #dce5ef}
 #booking-modal .modal-content:has(>.col-lg-3:not(.sidebar-wrapper))>.modal-footer{grid-row:5}
}

/* Grid children must shrink to the available screen width, including long company names. */
.corp .split>*,.corp .grid>*,.corp .fields>*,.corp .kpis>*{min-width:0}
.corp .list-buttons button,.corp .hero,.corp .metric{overflow-wrap:anywhere}
@media(max-width:650px){
 .corp{width:100%;min-width:0}
 .corp .split{grid-template-columns:minmax(0,1fr)}
 .corp .actions{flex-wrap:wrap}
 .corp dialog{padding:14px;max-height:calc(100dvh - 24px)}
}
@media(max-width:650px){
 .corp .hero header>div:first-child{width:100%;flex-basis:100%}
}
/* CRS property selection must remain inside the filter panel on narrow screens. */
#oc-dashboard .oc-property-picker{min-width:0;max-width:100%}
#oc-dashboard .oc-property-popover{left:auto;right:0;max-width:calc(100vw - 56px);max-height:60vh;max-height:60dvh;overflow:auto;overscroll-behavior:contain}
#oc-dashboard .oc-property-options label{min-width:0;overflow-wrap:anywhere}
@media(max-width:650px){
 #oc-dashboard .oc-property-picker{flex:1 1 100%!important}
 #oc-dashboard .oc-property-popover{left:0;right:0;width:auto;max-width:100%;box-sizing:border-box}
}

/* Reservation header actions must open inward; the content shell clips overflow. */
#booking-modal .modal-header{position:relative;z-index:30;overflow:visible}
#booking-modal .modal-header .dropdown-menu.other-actions{left:auto!important;right:0!important;top:100%!important;transform:none!important;min-width:min(230px,calc(100vw - 48px))!important;max-width:calc(100vw - 48px);max-height:calc(100vh - 160px);max-height:calc(100dvh - 160px);overflow-x:hidden;overflow-y:auto;box-sizing:border-box}
#booking-modal .modal-header .dropdown-menu.other-actions>li>a{white-space:normal;overflow-wrap:anywhere}
/* The navigation scrolls independently and never extends behind the footer. */
#booking-modal .sidebar-wrapper{height:100%;max-height:100%;align-self:stretch;box-sizing:border-box;padding-bottom:12px!important;scrollbar-width:thin}
#booking-modal .sidebar-wrapper .left-sidebar{width:100%;max-height:none!important;overflow:visible!important;box-sizing:border-box}
#booking-modal .sidebar-wrapper .left-sidebar>li>a{padding:10px 12px;line-height:1.4;box-sizing:border-box}
@media(max-width:767px){
 #booking-modal .sidebar-wrapper{height:auto;max-height:72px;padding-bottom:0!important;scrollbar-width:auto}
 #booking-modal .sidebar-wrapper .left-sidebar{width:max-content}
 #booking-modal .modal-header .btn-group{position:static}
 #booking-modal .modal-header .dropdown-menu.other-actions{top:calc(100% - 4px)!important;right:8px!important;max-width:calc(100% - 16px)}
}
