/* Screen-only rules leave invoice and report printing unchanged. */
.mobile-menu-toggle{display:none}
@media screen and (min-width:761px) and (max-width:1100px){
 #shell>aside{width:196px;padding:22px 12px}
 #shell>.body{margin-right:196px;min-width:0}
 #shell>aside .brand{gap:8px}
 #shell>aside .brand strong{font-size:17px}
 #shell .brand-banner{padding:14px 20px;gap:16px}
 #shell .brand-banner .wordmark{font-size:28px}
 #shell .header-actions{gap:8px;flex-wrap:wrap;justify-content:flex-end}
 #shell .body>header>div:first-child{min-width:140px}
 #content,.panel,.summary-grid>*{min-width:0}
}
@media screen and (max-width:760px){
 html,body{max-width:100%;overflow-x:clip}
 #shell{width:100%;min-width:0}
 #shell>aside{position:sticky;inset:auto;top:0;z-index:45;width:100%;padding:10px 14px;display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;overflow:visible;box-shadow:0 3px 15px #07192924}
 #shell>aside>.brand{margin:0;min-width:0;gap:9px;flex:1}
 #shell>aside>.brand img.logo{width:38px;height:38px;flex:none}
 #shell>aside>.brand strong{font-size:17px;overflow-wrap:anywhere}
 #shell>aside>.brand small{font-size:9px;margin-top:2px}
 #mobile-menu-toggle{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:44px;min-width:75px;padding:7px 12px;background:#ffffff16;color:#fff;border-color:#ffffff4d;flex:none}
 #mobile-menu-toggle>span:first-child{font-size:23px;line-height:1}
 #shell>aside>.nav-label{display:none}
 #shell>aside nav,#shell>aside .sidebar-bottom{display:none}
 #shell>aside.mobile-nav-open{align-content:start;max-height:calc(100vh - 12px);max-height:calc(100dvh - 12px);overflow:auto;overscroll-behavior:contain}
 #shell>aside.mobile-nav-open nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;flex-basis:100%;width:100%;margin-top:7px;overflow:visible}
 #shell>aside.mobile-nav-open nav button{display:block;width:100%;min-height:46px;margin:0;padding:9px 10px;white-space:normal;line-height:1.7;font-size:14px}
 #shell>aside.mobile-nav-open nav .nav-label{display:block;grid-column:1/-1;margin:10px 7px 0}
 #shell>aside.mobile-nav-open .sidebar-bottom{display:flex;align-items:center;flex-wrap:wrap;gap:8px;flex-basis:100%;width:100%;padding:12px 0 3px;margin:8px 0 0;border-top:1px solid #ffffff2b}
 #shell>aside .sidebar-bottom p{display:none}
 #shell>aside .sidebar-bottom #user-name{flex:1;font-size:13px;overflow-wrap:anywhere}
 #shell>aside .sidebar-bottom #logout{width:auto;min-height:44px;margin:0;padding:8px 12px}
 #shell>aside .sidebar-bottom .trial-pill{font-size:10px}
 #shell>.body{width:100%;margin:0;min-width:0}
 #shell .brand-banner{padding:10px 14px;gap:10px;justify-content:flex-start;min-width:0}
 #shell .brand-banner>.banner-logo{display:block}
 #shell .brand-banner .wordmark{font-size:25px;line-height:1.25;letter-spacing:-1px;flex:1;min-width:0;text-align:right}
 #shell .brand-banner .wordmark small{font-size:13px;text-align:right}
 #shell .brand-banner>div:last-child:not(.wordmark){display:none}
 #shell .body>header{display:flex;flex-direction:column;align-items:stretch;gap:10px;padding:14px;border-bottom:1px solid var(--border)}
 #shell .body>header h1{font-size:23px;line-height:1.5;overflow-wrap:anywhere}
 #breadcrumb{display:block;overflow-wrap:anywhere}
 #shell .header-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-start;gap:7px;min-width:0}
 #shell .header-actions button{min-height:44px;padding:7px 10px;font-size:13px;max-width:100%}
 #shell .header-actions #new-invoice{order:-1}
 #shell .header-actions #today{display:none}
 #shell .quick-widgets{min-width:0;max-width:100%;flex-wrap:wrap}
 #shell .quick-widget summary{min-height:44px;max-width:150px;font-size:11px;padding:8px}
 #shell .quick-widget-panel{position:fixed;inset:150px 12px auto;top:150px;width:auto;max-width:none;max-height:calc(100vh - 180px);max-height:calc(100dvh - 180px);overflow:auto;z-index:60}
 #shell .trial-banner{padding:9px 14px;font-size:11px;line-height:1.9;overflow-wrap:anywhere}
 #content{padding:14px;min-width:0;width:100%}
 #content>*{min-width:0;max-width:100%}
 #navigation-bar{padding:10px 14px 0}
 #navigation-back{min-height:44px;white-space:normal;text-align:right;line-height:1.5}
 .panel{padding:14px;margin-bottom:14px;min-width:0}
 .panel-head{flex-wrap:wrap;align-items:flex-start;gap:10px}
 .panel-head>*,.toolbar>*{min-width:0;max-width:100%}
 .panel-head h2{font-size:18px;overflow-wrap:anywhere}
 .toolbar{gap:10px;align-items:stretch}
 .toolbar label,.toolbar .grow{flex:1 1 100%;min-width:0}
 .toolbar>button,.toolbar>.actions{max-width:100%}
 .form-grid,.summary-grid,.journal-row,.finance-workspace,.opening-line,.opening-grid-head,.due-grid,.live-board{grid-template-columns:minmax(0,1fr)}
 .form-grid{gap:14px}
 .span2{grid-column:1/-1}
 .form-grid>*,.summary-grid>*,.journal-row>*,.due-grid>*,.finance-workspace>*{min-width:0;max-width:100%}
 .access-grid,.settings-links{grid-template-columns:minmax(0,1fr)}
 .metrics,.dashboard-metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:16px}
 .metric{padding:13px;min-width:0}
 .metric span{font-size:12px}
 .metric strong{font-size:clamp(14px,3.8vw,20px);overflow-wrap:anywhere}
 .metric small{font-size:11px}
 .actions{gap:8px;margin-top:14px}
 .actions>button{min-height:44px;max-width:100%;white-space:normal;line-height:1.6}
 .invoice-meta{gap:9px;margin:12px 0 17px}
 .invoice-title{display:block}
 .invoice-title h2{font-size:19px;overflow-wrap:anywhere}
 .invoice-title .badge{margin-top:6px}
 .totals{width:100%;margin-top:16px}
 .totals .grand{font-size:18px}
 .totals div{gap:10px;flex-wrap:wrap}
 .table-wrap{width:100%;max-width:100%;min-width:0;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
 .table-wrap table{min-width:100%;width:max-content;max-width:none}
 .table-wrap td,.table-wrap th{padding:10px;font-size:13px}
 .table-wrap .wrap{min-width:145px;max-width:245px}
 .table-wrap button{min-height:40px}
 .table-wrap input.line-input{min-width:90px;max-width:125px}
 #invoice-next-product{min-width:200px}
 .invoice-entry-label{max-width:100%;min-width:0}
 #invoice-entry-options button{gap:8px;white-space:normal;overflow-wrap:anywhere}
 #invoice-entry-options button>span{min-width:0}
 .finance-operation-menu{flex-direction:row;flex-wrap:wrap;gap:7px;border:0;padding:0}
 .finance-operation-menu button{flex:1 1 140px;min-width:0;min-height:44px}
 .opening-steps,.opening-summary{grid-template-columns:minmax(0,1fr)}
 .opening-workspace .panel-head{flex-direction:column}
 input,select,textarea{font-size:16px;min-height:46px;max-width:100%}
 input[type=checkbox],input[type=radio]{min-height:20px;width:20px;flex:none}
 label{font-size:13px;overflow-wrap:anywhere}
 .hint,.status-note{overflow-wrap:anywhere}
 dialog[open],dialog.movable-window[open]{position:fixed!important;inset:8px!important;margin:auto!important;width:calc(100% - 16px)!important;min-width:0!important;min-height:0!important;max-width:calc(100% - 16px)!important;max-height:calc(100vh - 16px)!important;max-height:calc(100dvh - 16px)!important;height:fit-content;padding:14px;resize:none!important;overflow:auto;overscroll-behavior:contain;border-radius:13px}
 dialog.persian-calendar[open]{width:min(360px,calc(100% - 16px))!important}
 dialog .modal-head,dialog .calendar-heading{cursor:default;touch-action:pan-y;gap:10px}
 dialog .modal-head::after,dialog .calendar-heading::after{display:none}
 dialog .modal-head h2{font-size:19px;overflow-wrap:anywhere}
 dialog .icon-button{min-width:44px;min-height:44px;flex:none}
 dialog form,.modal-content,#modal-content{min-width:0;max-width:100%}
 .chat-panel{inset:auto 6px 6px;width:auto;max-width:calc(100% - 12px);height:min(650px,calc(100vh - 12px));height:min(650px,calc(100dvh - 12px))}
 .chat-heading-actions button{width:40px;height:40px}
 .chat-compose textarea{font-size:16px;min-width:0}
 .chat-compose button{min-height:46px;flex:none}
 .toast{inset:auto 14px 14px;max-width:calc(100% - 28px);padding:11px 14px;font-size:13px;overflow-wrap:anywhere;z-index:100}
 #shell footer{padding:13px 14px;font-size:11px;overflow-wrap:anywhere}
}
@media screen and (max-width:380px){
 #shell>aside>.brand strong{font-size:15px}
 #shell>aside>.brand small{letter-spacing:.6px}
 #mobile-menu-toggle{min-width:62px;padding:7px 9px;gap:5px}
 #shell .quick-widget summary{max-width:133px}
 .metric strong{font-size:14px}
}
@media print{#mobile-menu-toggle{display:none!important}}

.number-value,.num{font-variant-numeric:tabular-nums;white-space:nowrap;direction:ltr;unicode-bidi:isolate;overflow-wrap:normal!important;word-break:normal!important}
@media(max-width:700px){.table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}.table-wrap td.number-value,.table-wrap td.num{min-width:110px;font-size:12px}.metric strong.number-value{font-size:clamp(12px,3.2vw,18px);max-width:100%;display:block;overflow-x:auto}.invoice-meta{flex-wrap:wrap;gap:8px}.finance-operation-total strong{white-space:nowrap}.table-wrap td{padding:8px 10px}}
