/* KAVI BRAND v8: responsive monitor fit. Business logic is untouched. */
html,body,#root{width:100%;max-width:100%;min-width:0;margin:0;overflow-x:hidden}
*,*::before,*::after{box-sizing:border-box}
img,svg,video,canvas{max-width:100%}
.app-bg,.glass-shell,.sidebar-glass,.main-glass,.content-panel,.sell-content,.sell-content-add-sale,.prod-content,.prod-list-shell,.prod-card,.prod-filter-card,.prod-table-card,.sale-page,.sale-card{min-width:0;max-width:100%}
.content-panel,.prod-table-wrap,.prod-history-table-wrap,.sale-table-wrap,.sales-table-shell,.pur-table-wrap,.cust-table-wrap,.sup-table-wrap,.um-table-wrap{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}
.prod-list-table,.prod-history-table,.sale-table{width:max-content;min-width:100%}
.prod-toolbar,.prod-list-head,.prod-search-row,.sale-header-row,.sale-top-mini-bar,.sale-search-add-row{max-width:100%}

/* Keep sidebar and content side-by-side on normal desktop/office monitors. */
@media (min-width:901px) and (max-width:1400px){
  .glass-shell:not(.glass-shell-add-sale-full){display:grid!important;grid-template-columns:clamp(205px,19vw,250px) minmax(0,1fr)!important;gap:6px!important;overflow:hidden!important}
  .glass-shell:not(.glass-shell-add-sale-full) .sidebar-glass{display:block!important;width:auto!important;min-width:0!important;margin:0!important;padding:8px!important;overflow:auto!important}
  .glass-shell:not(.glass-shell-add-sale-full) .side-menu{display:flex!important;flex-direction:column!important;flex-wrap:nowrap!important;gap:8px!important;width:100%!important}
  .glass-shell:not(.glass-shell-add-sale-full) .side-btn{width:100%!important;white-space:normal!important;padding:10px 12px!important}
  .glass-shell:not(.glass-shell-add-sale-full) .main-glass{min-width:0!important;overflow:hidden!important}
  .glass-shell:not(.glass-shell-add-sale-full) .content-panel{min-width:0!important;overflow:auto!important}
  .prod-card,.prod-filter-card,.prod-table-card{padding:18px 16px!important}
  .prod-grid-3{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .sale-card-grid.sale-grid-3,.sale-grid-3{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}

/* Tablet and narrow windows: compact navigation above content, tables scroll inside their cards. */
@media (max-width:900px){
  .glass-shell:not(.glass-shell-add-sale-full){display:grid!important;grid-template-columns:1fr!important;width:100%!important;max-width:100%!important;overflow:visible!important}
  .sidebar-glass{width:100%!important;min-height:auto!important;margin:0!important;padding:8px!important;display:block!important}
  .side-brand{margin:2px 4px 8px!important}
  .side-logo{width:48px!important;height:48px!important;flex-basis:48px!important}
  .side-menu{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important;width:100%!important}
  .side-btn,.side-sub-btn{width:100%!important;margin-left:0!important;white-space:normal!important;padding:10px!important}
  .main-glass,.content-panel{width:100%!important;max-width:100%!important;overflow:visible!important}
  .prod-card,.prod-filter-card,.prod-table-card,.sale-card{padding:14px 10px!important}
  .prod-grid-2,.prod-grid-3,.sale-card-grid,.sale-grid-2,.sale-grid-3{grid-template-columns:1fr!important}
  .prod-toolbar,.prod-list-head,.sale-header-row,.sale-header-actions,.sale-top-mini-bar{flex-wrap:wrap!important}
  .sale-header-actions{width:100%!important;justify-content:flex-start!important}
}

@media (max-width:560px){
  .side-menu{grid-template-columns:1fr!important}
  .page-title,.prod-page-title,.sale-page-title,.sale-page-title-inline{font-size:20px!important}
  .logout-pill,.sale-save-btn,.sale-print-btn{min-height:38px!important;padding:8px 12px!important}
  .prod-card,.prod-filter-card,.prod-table-card,.sale-card{padding:10px 8px!important;border-radius:12px!important}
  .prod-toolbar-center,.prod-toolbar-left,.prod-toolbar-bottom{width:100%!important;flex-wrap:wrap!important}
  .sale-search-add-row{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important}
}

/* Fresh MRP v9 */
@media (max-width:1400px){.prod-price-cell>div[style*="repeat(3"]{grid-template-columns:1fr!important}}
