/* Responsive navigation and content. Tables scroll inside their own card. */
.workspace,main#main,.dashboard-grid>*,.stats>*,.sales-layout>*,.operations-two>*{min-width:0}
.stats{grid-template-columns:repeat(4,minmax(0,1fr))}
.sidebar{overscroll-behavior:contain;scrollbar-width:thin}
.sidebar-heading{position:relative;flex-shrink:0}
.sidebar-close{display:none}
.sidebar .nav-label{margin-top:0}
.nav-toggle{display:inline-grid;flex-shrink:0;width:44px;height:44px}
.menu-backdrop[hidden]{display:none}
.menu-backdrop{position:fixed;inset:0;z-index:39;background:#142d2666;border:0;border-radius:0;cursor:pointer}
.nav-text,.user-info,.page-heading>div,.alert-text{min-width:0;overflow-wrap:anywhere}
.breadcrumb{min-width:0}
.breadcrumb strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.table-wrap{max-width:100%;overscroll-behavior-x:contain}
.tabs{max-width:100%;overflow-x:auto}
.tab{flex-shrink:0}
.stat-value{font-size:clamp(20px,2.1vw,30px);overflow-wrap:anywhere}
.card-head,.pager{flex-wrap:wrap}
@media(min-width:851px){
 body.nav-collapsed .sidebar{width:76px;padding:20px 10px}
 body.nav-collapsed .workspace{margin-left:76px}
 body.nav-collapsed .brand{padding:0 0 18px;justify-content:center}
 body.nav-collapsed .brand img{width:42px;height:42px}
 body.nav-collapsed .brand>div,body.nav-collapsed .nav-label,body.nav-collapsed .nav-text,body.nav-collapsed .side-note,body.nav-collapsed .user-info,body.nav-collapsed .user-block>.avatar{display:none}
 body.nav-collapsed .nav-item{justify-content:center;padding:12px}
 body.nav-collapsed .user-block{padding:10px 0;justify-content:center}
 body.nav-collapsed .user-block .icon-button{margin:0;width:44px;height:44px}
}
@media(min-width:601px) and (max-width:1150px){
 .dashboard-grid{grid-template-columns:minmax(0,1.3fr) minmax(0,1fr)}
 .stats{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:850px){
 body.nav-open{overflow:hidden}
 .sidebar{z-index:40;width:min(300px,calc(100vw - 56px));padding:14px 14px max(18px,env(safe-area-inset-bottom));height:100vh;height:100dvh;box-shadow:none}
 .sidebar.open{box-shadow:12px 0 40px #142d2633}
 .sidebar-heading{position:sticky;top:-14px;background:#fff;z-index:1;padding-top:8px}
 .sidebar .brand{padding:0 40px 18px 0;gap:8px}
 .sidebar .brand img{width:46px;height:46px}
 .sidebar .brand strong{font-size:22px}
 .sidebar .brand span{font-size:9px;letter-spacing:1.5px}
 .sidebar-close{display:inline-grid;position:absolute;right:0;top:8px;width:44px;height:44px;color:var(--green)}
 .sidebar .nav-item{min-height:46px}
 .sidebar .side-note{display:none}
 .sidebar .sidebar-bottom{margin-top:auto;padding-top:12px}
 .sidebar .user-block{padding-top:8px}
 .topbar{position:sticky;top:0;z-index:30;padding:0 12px;height:60px}
 .breadcrumb>span,.breadcrumb>.icon{display:none}
 .breadcrumb strong{max-width:none}
 .top-right{gap:4px}
 .top-right .icon-button{width:44px;height:44px}
 main#main{padding:20px 16px max(24px,env(safe-area-inset-bottom))}
 .btn{min-height:44px;white-space:normal}
 .table-actions button{min-width:44px;min-height:44px}
 .basket-controls .icon-button{width:44px;height:44px}
 .page-heading h1{font-size:26px;overflow-wrap:anywhere}
 .page-heading p{line-height:1.5}
 dialog{max-height:calc(100dvh - 24px)}
}
@media(max-width:600px){
 .stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 .stat{padding:14px 12px}
 .stat-head{gap:6px;align-items:flex-start;line-height:1.4}
 .stat-head .stat-icon{padding:5px}
 .stat-head .stat-icon .icon{width:17px;height:17px}
 .stat-value{font-size:clamp(19px,5.5vw,28px);letter-spacing:-.7px}
 .stat small{display:block;line-height:1.6}
 .stat-open{margin-top:10px}
 .dashboard-grid{grid-template-columns:minmax(0,1fr)}
 .welcome{padding:20px;min-height:140px}
 .welcome .copy{max-width:100%}
 .welcome h2{font-size:22px}
 .welcome-photo{opacity:.18}
 .card-head,.card-body,.activity-list{padding-left:16px;padding-right:16px}
 .alert-row{gap:8px;flex-wrap:wrap}
 .alert-text{flex-basis:110px}
 .activity>div{min-width:0;overflow-wrap:anywhere}
 .page-heading .actions{gap:8px}
 .page-heading .actions:empty{display:none}
 .page-heading .actions .btn{flex:1 1 auto}
 .page-footer{flex-direction:column;gap:6px}
 .toolbar .search{min-width:0}
 .toolbar select{min-width:0}
 .round-counts{gap:14px;flex-wrap:wrap}
 .cart-row{grid-template-columns:minmax(0,1fr) 64px 86px 44px;gap:6px}
 .cart-row>select{grid-column:1/-1}
 .metric-line{flex-wrap:wrap;gap:6px}
 .modal-body,.modal-header,.modal-footer{padding:16px}
 .modal-footer{flex-wrap:wrap}
 .modal-footer .btn{flex:1 1 auto}
 .detail-grid{grid-template-columns:minmax(0,1fr)}
 .driver-grid{grid-template-columns:minmax(0,1fr)}
 .driver-stats>.stat:last-child{grid-column:span 2}
 .driver-item{padding:18px}
 .route-calendar{grid-template-columns:repeat(2,minmax(0,1fr))}
 .sales-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .sale-plant-body{padding:12px}
 .sale-plant h2{overflow-wrap:anywhere}
 .sale-photo{height:135px}
 .basket-line>div:first-child{min-width:0;overflow-wrap:anywhere}
 .basket-controls{flex-shrink:0}
 #toast{bottom:16px;right:16px;max-width:calc(100vw - 32px)}
}
@media(max-width:360px){
 .top-right .online{max-width:62px;line-height:1.3}
 .topbar{padding:0 8px}
 main#main{padding-inline:12px}
 .sales-grid{gap:8px}
 .sale-plant-body{padding:10px}
}
