@media(max-width:768px){
  html,body{width:100%;max-width:100%;overflow-x:hidden}
  body{font-size:13px}
  .shell{width:100%;min-height:100svh;display:block;overflow:clip}
  .sidebar{position:relative;width:100%;height:auto;min-height:0;padding:16px 14px 12px;gap:12px;border:0;border-radius:0;box-shadow:0 10px 30px #06191420}
  .sidebar .brand{min-width:0;padding:3px 5px 13px;justify-content:flex-start}
  .sidebar .brand span{font-size:15px}.sidebar .brand small{font-size:8px}
  .sidebar .brand dotlottie-player,.sidebar .brand img{width:42px!important;height:42px!important}
  .sidebar .nav{width:100%;max-width:100%;margin:0;padding:3px 2px 7px;display:flex;gap:7px;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x proximity;overscroll-behavior-inline:contain;scrollbar-width:none}
  .sidebar .nav::-webkit-scrollbar{display:none}
  .nav a{min-width:max-content;min-height:42px;padding:0 12px;flex:0 0 auto;gap:8px;border-radius:12px;font-size:11px;scroll-snap-align:start}
  .nav a.active{box-shadow:inset -3px 0 var(--primary)}
  .nav-icon,.nav-icon svg{width:17px;height:17px}
  .sidebar-foot{display:none}
  .main{width:100%;min-width:0;min-height:0}
  .topbar{position:sticky;top:0;width:100%;height:68px;padding:0 14px;gap:8px}
  .topbar h1{min-width:0;margin-left:auto;padding-right:12px;font-size:17px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .topbar h1:before{top:3px;height:20px}
  .topbar-actions{min-width:max-content;gap:5px;direction:rtl}
  .topbar-actions .btn,.notification-button,.theme-toggle{width:38px!important;height:38px!important;min-height:38px;padding:0!important;justify-content:center;border-radius:10px;font-size:0}
  .topbar-actions form:last-child .btn:before{content:"↪";font-size:17px}
  .content{width:100%;max-width:100%;padding:14px 12px 70px}
  .content>.grid:not(.stats){grid-template-columns:1fr!important}
  .stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:16px}
  .stat{min-width:0;min-height:108px;padding:17px 16px;border-radius:15px}
  .stat .label{font-size:10px}.stat .value{margin-top:8px;font-size:25px;overflow-wrap:anywhere}
  .card{max-width:100%;padding:16px;border-radius:15px}
  .section-head{margin-bottom:14px;gap:11px}.section-head h2{font-size:16px}.section-head .label{line-height:1.7}
  .section-head>.btn{width:100%;justify-content:center}
  .form-grid{grid-template-columns:1fr!important;gap:13px}
  .field.full{grid-column:auto}.field input,.field select,.field textarea{width:100%;min-width:0;font-size:16px}
  .field textarea{min-height:95px}.form-actions{width:100%;gap:8px}.form-actions .btn{flex:1 1 120px;justify-content:center}
  .table-wrap{width:100%;max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain;border-radius:12px;box-shadow:inset -12px 0 18px -18px #0005}
  table{min-width:720px}th,td{padding:12px 10px;font-size:11px}
  .rental-date{min-width:135px}.rental-date strong{font-size:10px}
  .invoice{width:100%;padding:15px}.invoice-head{flex-direction:column}.invoice .mini-grid{grid-template-columns:1fr 1fr}
  .customer-search{width:100%;padding:7px;gap:5px}.customer-search svg{flex:0 0 auto}.customer-search input{width:100%;font-size:14px}.customer-search .btn{width:auto;min-width:58px}
  .customer-grid{grid-template-columns:1fr;gap:10px}.customer-card{min-height:105px;padding:13px;grid-template-columns:auto 1fr auto;gap:10px}.customer-avatar{width:44px;height:44px}.customer-card-stats{grid-column:2/4;flex-wrap:wrap}
  .customer-profile{padding:16px;gap:14px}.profile-main{width:100%}.customer-avatar.large{width:54px;height:54px}.profile-main h2{font-size:18px}.profile-actions{display:grid;grid-template-columns:1fr 1fr;width:100%}.profile-actions .btn:first-child{grid-column:1/-1}
  .customer-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.customer-stats .stat:first-child{grid-column:1/-1}
  .history-item{grid-template-columns:1fr 1fr!important;gap:11px}.history-date,.history-item>div:nth-child(2){grid-column:1/-1}.history-item>.badge,.history-item>.btn{width:100%;justify-content:center;text-align:center}
  .notification-panel{position:fixed;top:72px;right:10px;left:10px;width:auto;max-height:calc(100svh - 88px);border-radius:16px}
  .arabic-calendar{right:12px;bottom:14px;left:12px;width:auto;max-height:calc(100svh - 28px);overflow:auto}
  .date-selection-card{min-height:58px}.designer-credit{position:fixed;bottom:5px;max-width:calc(100vw - 20px)}
}
@media(max-width:430px){
  .stats{grid-template-columns:1fr}.customer-stats{grid-template-columns:1fr}.customer-stats .stat:first-child{grid-column:auto}
  .topbar{padding-inline:10px}.topbar h1{font-size:15px}.topbar-actions{gap:4px}.topbar-actions .btn,.notification-button,.theme-toggle{width:35px!important;height:35px!important;min-height:35px}
  .content{padding-inline:10px}.card{padding:14px}.invoice .mini-grid{grid-template-columns:1fr}
  .profile-actions{grid-template-columns:1fr}.profile-actions .btn:first-child{grid-column:auto}
  .customer-card{grid-template-columns:auto 1fr}.customer-card-stats{grid-column:1/-1}.customer-arrow{display:none}
}
@media(max-width:350px){.topbar-actions form:last-child{display:none}.nav a{padding-inline:10px}.content{padding-inline:8px}}
