/* =========================================================
   MARUTHI LIGHTS ADMIN - MOBILE ONLY RESPONSIVE FIX
   Desktop theme/layout untouched. Active only <= 900px.
   ========================================================= */
@media (max-width:900px){
  *,*::before,*::after{box-sizing:border-box!important;}
  html,body{width:100%!important;max-width:100%!important;min-width:0!important;margin:0!important;overflow-x:hidden!important;-webkit-text-size-adjust:100%;}
  body{min-height:100dvh!important;}
  img,svg,video,canvas,iframe{max-width:100%!important;height:auto;}

  /* Main admin shell */
  .adm,.admin,.wrapper,.app,.page{display:block!important;width:100%!important;max-width:100%!important;min-width:0!important;grid-template-columns:none!important;overflow-x:hidden!important;}
  .main,main,.content,main.content,.page-content,.container{width:100%!important;max-width:100%!important;min-width:0!important;margin:0!important;overflow-x:hidden!important;}
  .main,main{padding:0!important;}
  .content,main.content,.page-content{padding:10px 10px 88px!important;}

  /* Top bar fit mobile width */
  .top{position:sticky!important;top:0!important;z-index:9000!important;width:100%!important;max-width:100vw!important;min-height:56px!important;padding:7px 8px!important;display:flex!important;align-items:center!important;gap:6px!important;background:#fff!important;border-bottom:1px solid #eef1f5!important;overflow:hidden!important;}
  .top b,.top .title{flex:1 1 auto!important;min-width:0!important;max-width:none!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;font-size:15px!important;line-height:1.1!important;}
  .top span{display:none!important;}
  .hamb,#hambBtn{display:inline-flex!important;align-items:center!important;justify-content:center!important;flex:0 0 42px!important;width:42px!important;height:42px!important;min-width:42px!important;min-height:42px!important;border:0!important;border-radius:12px!important;background:#fff!important;box-shadow:0 2px 8px rgba(15,23,42,.08)!important;font-size:22px!important;line-height:1!important;touch-action:manipulation!important;}
  #adminInstallBtn{flex:0 0 auto!important;max-width:112px!important;min-height:38px!important;padding:7px 8px!important;font-size:12px!important;line-height:1.05!important;white-space:normal!important;text-align:center!important;}
  .top .btn,.top a.btn{flex:0 0 auto!important;min-height:38px!important;padding:7px 9px!important;font-size:12px!important;white-space:nowrap!important;}

  /* Off-canvas menu */
  .side{position:fixed!important;top:0!important;left:0!important;bottom:0!important;width:min(84vw,315px)!important;max-width:315px!important;height:100dvh!important;max-height:100dvh!important;overflow-y:auto!important;overflow-x:hidden!important;background:#fff!important;transform:translateX(-110%)!important;transition:transform .24s ease!important;z-index:10000!important;box-shadow:0 14px 40px rgba(15,23,42,.28)!important;padding-bottom:24px!important;-webkit-overflow-scrolling:touch!important;}
  body.open .side,body.menu-open .side,.adm.open .side,.side.open{transform:translateX(0)!important;left:0!important;}
  body.open::after,body.menu-open::after{content:""!important;position:fixed!important;inset:0!important;background:rgba(15,23,42,.30)!important;z-index:9990!important;}
  body.open .side,body.menu-open .side{z-index:10000!important;}
  .side .brand{display:flex!important;align-items:center!important;gap:10px!important;padding:14px!important;}
  .side a,.side .menu a,.side nav a{display:flex!important;align-items:center!important;width:100%!important;min-height:42px!important;padding:10px 14px!important;font-size:15px!important;line-height:1.2!important;white-space:normal!important;}

  /* Cards, forms, panels */
  .card,.box,.panel,.form-card,.table-card,.ds-card,.pwa-card,.section,.pm-section{width:100%!important;max-width:100%!important;min-width:0!important;margin-left:0!important;margin-right:0!important;overflow:hidden!important;}
  form,.form,.filter-form{width:100%!important;max-width:100%!important;min-width:0!important;}
  .row,.form-row,.input-row,.filter-row,.filters,.search-row,.grid,.cards,.summary-grid,.dashboard-stats,.pwa-grid,.ds-grid{width:100%!important;max-width:100%!important;min-width:0!important;display:grid!important;grid-template-columns:1fr!important;gap:10px!important;}

  label{max-width:100%!important;}
  input:not([type=checkbox]):not([type=radio]),select,textarea{width:100%!important;max-width:100%!important;min-width:0!important;height:auto!important;min-height:40px!important;padding:9px 10px!important;font-size:14px!important;border-radius:11px!important;}
  textarea{min-height:78px!important;}
  input[type=file]{height:auto!important;line-height:1.3!important;}
  input[type=checkbox],input[type=radio]{width:auto!important;min-height:0!important;}
  button,.btn,input[type=submit],a.btn,.btn-orange,.btn-light{max-width:100%!important;min-height:40px!important;border-radius:11px!important;padding:9px 12px!important;font-size:14px!important;line-height:1.15!important;white-space:normal!important;text-align:center!important;}

  /* Tables: no content cut; scroll inside table wrapper only */
  .table-wrap,.table-responsive,.list-wrap,.orders-table,.products-table,.recent-card{width:100%!important;max-width:100%!important;overflow-x:auto!important;overflow-y:visible!important;-webkit-overflow-scrolling:touch!important;border-radius:14px!important;}
  table,.table{min-width:720px!important;width:max-content!important;max-width:none!important;border-collapse:collapse;}
  table th,table td,.table th,.table td{white-space:nowrap!important;font-size:13px!important;padding:8px 10px!important;vertical-align:middle!important;}

  /* Dashboard auto adjust */
  .dash-status{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;width:100%!important;}
  .dash-status .stat,.stat{min-width:0!important;width:100%!important;padding:9px!important;overflow:hidden!important;}
  .dash-status .stat small{font-size:10.5px!important;line-height:1.1!important;}
  .dash-status .stat b{font-size:16px!important;line-height:1.15!important;word-break:break-word!important;}
  .dash-actions,.quick-actions,.actions,.ds-btns{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;width:100%!important;}
  .dash-actions .btn,.quick-actions .btn,.actions .btn,.ds-btns .btn{width:100%!important;min-width:0!important;height:auto!important;min-height:40px!important;font-size:12px!important;padding:8px 6px!important;}
  .dash-action-flex{display:flex!important;gap:6px!important;align-items:center!important;flex-wrap:nowrap!important;}
  .dash-status-select{min-width:132px!important;width:132px!important;height:36px!important;font-size:12px!important;padding:6px!important;}
  .btn-view{min-height:36px!important;padding:8px 10px!important;font-size:12px!important;}

  /* Product/admin card rows */
  .product-card,.prod-card,.item-card{width:100%!important;max-width:100%!important;display:grid!important;grid-template-columns:76px minmax(0,1fr) auto!important;gap:9px!important;align-items:center!important;}
  .product-card img,.prod-card img,.item-card img{width:70px!important;height:70px!important;object-fit:cover!important;border-radius:11px!important;}

  /* Product form common */
  .pm-form-wrap{width:100%!important;max-width:100%!important;padding:8px 8px 90px!important;margin:0!important;overflow:hidden!important;}
  .pm-title,h1,h2,.page-title,.title{font-size:21px!important;line-height:1.18!important;margin:8px 0 12px!important;}
  .pm-grid{display:grid!important;grid-template-columns:1fr!important;gap:9px!important;}
  .pm-field.full{grid-column:1/-1!important;}
  .range-row{display:grid!important;grid-template-columns:1fr!important;gap:8px!important;}
  .variant-head,.pm-actions{display:flex!important;flex-wrap:wrap!important;gap:8px!important;}
  .pm-actions{position:sticky!important;bottom:0!important;background:#fff!important;padding:9px!important;margin:8px -8px 0!important;z-index:30!important;border-top:1px solid #eef1f5!important;}
  .pm-actions .btn-orange,.pm-actions .btn-light,.pm-actions button{flex:1 1 140px!important;}

  .floating-add,.fab,.add-float{position:fixed!important;right:16px!important;bottom:70px!important;z-index:8000!important;}
}

@media (min-width:601px) and (max-width:900px){
  .pm-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  .dash-status{grid-template-columns:repeat(4,minmax(0,1fr))!important;}
  .dash-actions,.quick-actions,.actions,.ds-btns{grid-template-columns:repeat(4,minmax(0,1fr))!important;}
}

@media (max-width:420px){
  .content,main.content,.page-content{padding:8px 8px 82px!important;}
  .top{gap:5px!important;padding:6px!important;}
  .top b,.top .title{font-size:14px!important;}
  #adminInstallBtn{max-width:98px!important;font-size:11px!important;padding:6px!important;}
  .top .btn,.top a.btn{font-size:11px!important;padding:7px 8px!important;}
  .dash-status{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  .dash-actions,.quick-actions,.actions,.ds-btns{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  table,.table{min-width:680px!important;}
}
