@import url('./modules/auth.css');
@font-face{font-family:IRANSansX;src:url('../installer-assets/fonts/IRANSansX-Regular.woff2') format('woff2');font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:IRANSansX;src:url('../installer-assets/fonts/IRANSansX-Medium.woff2') format('woff2');font-weight:500;font-style:normal;font-display:swap}
@font-face{font-family:IRANSansX;src:url('../installer-assets/fonts/IRANSansX-Bold.woff2') format('woff2');font-weight:700 950;font-style:normal;font-display:swap}
:root{
  --font-fa:IRANSansX,Vazirmatn,Tahoma,Arial,sans-serif;--font-mono-fa:IRANSansX,ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  --side:282px;--gap:18px;--radius:24px;--radius-sm:16px;
  --bg:#f3f6fb;--surface:#ffffff;--surface-2:#f8fafc;--surface-3:#eef4ff;
  --text:#142033;--text-2:#334155;--muted:#64748b;--muted-2:#94a3b8;
  --border:#dbe4f0;--border-soft:#ecf1f8;
  --brand:#1f5eff;--brand-2:#0f3cbd;--brand-soft:#edf4ff;
  --ok:#0f9f6e;--ok-soft:#e7f8f1;--warn:#d97706;--warn-soft:#fff4df;--danger:#dc2626;--danger-soft:#fff0f0;--info:#2563eb;--info-soft:#edf4ff;
  --shadow:0 22px 55px rgba(20,32,51,.10);--shadow-sm:0 10px 28px rgba(20,32,51,.07);--shadow-xs:0 4px 14px rgba(20,32,51,.05);
}
*{box-sizing:border-box;font-family:inherit}*::before,*::after{box-sizing:border-box;font-family:inherit}html,body,#app{min-height:100%;margin:0;font-family:var(--font-fa)}html{direction:rtl}body{font-family:var(--font-fa);background:radial-gradient(circle at 8% 0%,#e9f1ff 0,#f5f8fc 34%,#f3f6fb 100%);color:var(--text);direction:rtl;text-align:right;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;overflow-x:hidden}button,input,select,textarea{font:inherit;font-family:var(--font-fa)!important}body,.app-shell,.sidebar,.main,.topbar,.card,.modal,.modal *,.table,.table *,.toast,.notice-pop,.login-card,.calendar-pop,.print-only{font-family:var(--font-fa)!important}.fa-text,h1,h2,h3,h4,p,label,.card-sub,.quick-sub,.page-title,.page-subtitle,.nav-label,.brand-title,.brand-sub{direction:rtl;text-align:right;unicode-bidi:plaintext}.ltr,.ltr *{direction:ltr!important;text-align:left!important;unicode-bidi:isolate!important;font-family:var(--font-mono-fa)!important}.app-shell{min-height:100vh;direction:rtl}.sidebar{position:fixed;top:18px;right:18px;bottom:18px;width:var(--side);z-index:70;display:flex;flex-direction:column;border:1px solid rgba(219,228,240,.95);border-radius:30px;background:linear-gradient(180deg,rgba(255,255,255,.96),rgba(248,251,255,.94));box-shadow:var(--shadow);overflow:hidden}.brand{display:flex;align-items:center;gap:12px;padding:20px 18px 16px;border-bottom:1px solid var(--border-soft);min-height:88px}.brand-mark{width:52px;height:52px;min-width:52px;border-radius:19px;display:grid;place-items:center;color:white;font-weight:950;font-size:24px;background:linear-gradient(145deg,#1f5eff,#72a2ff);box-shadow:0 14px 28px rgba(31,94,255,.25)}.brand-title{font-weight:950;font-size:17px;line-height:1.6}.brand-sub{font-size:12px;color:var(--muted);line-height:1.8}.nav{padding:12px 10px;overflow:auto;scrollbar-width:thin}.nav-group-title{padding:16px 13px 8px;color:#8a9ab1;font-size:11px;font-weight:950;letter-spacing:0}.nav-item{width:100%;height:48px;border:0;border-radius:17px;margin:3px 0;display:flex;align-items:center;gap:10px;background:transparent;color:#41516a;cursor:pointer;padding:0 11px;text-align:right;transition:.18s ease}.nav-item:hover{background:#f1f6ff;color:#1d4ed8}.nav-item.active{background:linear-gradient(135deg,#1f5eff,#3d7dff);color:#fff;box-shadow:0 12px 28px rgba(31,94,255,.22)}.nav-ico{width:22px;height:22px;min-width:22px;display:grid;place-items:center}.nav-ico svg,.page-icon svg,.icon-btn svg,.stat-icon svg,.quick-icon svg{width:1em;height:1em}.nav-label{font-weight:850;font-size:13px;line-height:1.7;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sidebar-footer{padding:14px;border-top:1px solid var(--border-soft);margin-top:auto}.logout{width:100%;height:44px;border-radius:16px;border:1px solid #fecaca;background:#fff6f6;color:#b91c1c;font-weight:900;cursor:pointer}.main{margin-right:calc(var(--side) + 36px);padding:18px 26px 38px;min-height:100vh}.topbar{position:sticky;top:16px;height:72px;z-index:50;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:11px 14px;border:1px solid rgba(219,228,240,.92);border-radius:26px;background:rgba(255,255,255,.88);backdrop-filter:blur(18px);box-shadow:var(--shadow-sm)}.page-id{display:flex;align-items:center;gap:12px;min-width:0}.page-icon{width:48px;height:48px;min-width:48px;border-radius:18px;display:grid;place-items:center;color:#1f5eff;background:linear-gradient(145deg,#edf4ff,#fff);border:1px solid #dce8ff;font-size:22px}.page-title{font-weight:950;font-size:18px;line-height:1.55;color:#0f172a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.page-subtitle{font-size:12px;color:var(--muted);line-height:1.7;max-width:520px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.top-actions{display:flex;align-items:center;gap:10px}.icon-btn{position:relative;width:44px;height:44px;min-width:44px;border-radius:16px;border:1px solid var(--border);background:#fff;color:#334155;display:grid;place-items:center;cursor:pointer;transition:.16s ease;font-size:17px}.icon-btn:hover{border-color:#bcd0ff;color:#1f5eff;transform:translateY(-1px);box-shadow:var(--shadow-xs)}.badge{position:absolute;top:-5px;left:-5px;min-width:20px;height:20px;padding:0 6px;border-radius:99px;background:var(--danger);color:#fff;font-size:11px;display:grid;place-items:center;border:2px solid #fff}.user-pill{height:48px;padding:5px 8px 5px 12px;display:flex;align-items:center;gap:10px;border:1px solid var(--border);border-radius:18px;background:#fff}.avatar{width:36px;height:36px;border-radius:14px;background:linear-gradient(145deg,#1f5eff,#6ea1ff);color:white;display:grid;place-items:center;font-weight:950}.content{padding-top:18px;display:block}.grid{display:grid;gap:var(--gap);direction:rtl;align-items:stretch}.grid-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}.card{position:relative;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:20px;box-shadow:var(--shadow-sm);min-width:0;min-height:100%;direction:rtl;text-align:right;color:var(--text);overflow:hidden}.card:before{content:"";position:absolute;inset:0 0 auto 0;height:3px;background:linear-gradient(90deg,rgba(31,94,255,0),rgba(31,94,255,.32),rgba(31,94,255,0));opacity:.55}.card-title{font-weight:950;color:#0f172a;line-height:1.75}.card-sub{color:var(--muted);font-size:12px;line-height:1.85;margin-top:2px}.stat{min-height:156px;padding:18px}.stat-row{height:100%;display:flex;align-items:stretch;gap:14px;direction:rtl}.stat-icon{width:52px;height:52px;min-width:52px;border-radius:18px;display:grid;place-items:center;font-size:24px;color:#1f5eff;background:var(--brand-soft);border:1px solid #dce8ff}.stat.ok .stat-icon{color:var(--ok);background:var(--ok-soft);border-color:#c9efe0}.stat.warn .stat-icon{color:var(--warn);background:var(--warn-soft);border-color:#ffe2a8}.stat.danger .stat-icon{color:var(--danger);background:var(--danger-soft);border-color:#ffd0d0}.stat-content{min-width:0;display:flex;flex-direction:column;justify-content:space-between;gap:6px;flex:1}.stat-value{font-size:28px;font-weight:950;color:#101827;line-height:1.25;letter-spacing:-.02em;white-space:nowrap}.stat-label{font-size:12px;color:var(--muted);line-height:1.75}.hero{background:linear-gradient(135deg,#153c9a 0%,#1f5eff 52%,#76a7ff 100%);color:#fff;border-color:rgba(255,255,255,.22);box-shadow:0 26px 65px rgba(31,94,255,.22);min-height:218px}.hero:before{height:100%;background:radial-gradient(circle at 20% 20%,rgba(255,255,255,.22),transparent 28%);opacity:1}.hero h2{position:relative;margin:0 0 10px;color:#fff;font-weight:950;line-height:1.8;font-size:21px}.hero p{position:relative;margin:0;color:rgba(255,255,255,.88);line-height:2;font-size:14px}.hero-actions{position:relative;display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:18px}.btn{min-height:42px;border:0;border-radius:15px;background:linear-gradient(135deg,#1f5eff,#4584ff);color:#fff;padding:10px 16px;display:inline-flex;align-items:center;justify-content:center;gap:8px;font-weight:900;cursor:pointer;box-shadow:0 12px 25px rgba(31,94,255,.20);transition:.16s ease;white-space:nowrap;line-height:1.6}.btn:hover{transform:translateY(-1px);filter:saturate(1.06)}.btn.small{min-height:34px;border-radius:12px;padding:7px 11px;font-size:12px}.btn.secondary{background:#fff;color:#1f5eff;border:1px solid #d4e2ff;box-shadow:var(--shadow-xs)}.btn.ghost{background:rgba(255,255,255,.15);color:#fff;border:1px solid rgba(255,255,255,.35);box-shadow:none}.btn.danger{background:linear-gradient(135deg,#dc2626,#ef4444);color:#fff;box-shadow:0 12px 25px rgba(220,38,38,.18)}.quick-card{position:relative;min-height:98px;padding:15px;border:1px solid var(--border);border-radius:20px;background:linear-gradient(180deg,#fff,#fbfdff);display:grid;grid-template-columns:52px minmax(0,1fr) 34px;align-items:center;gap:12px;direction:rtl;cursor:default;box-shadow:var(--shadow-xs);transition:.16s ease;color:var(--text);overflow:hidden}.quick-card[onclick]{cursor:pointer}.quick-card:hover{transform:translateY(-2px);box-shadow:var(--shadow-sm);border-color:#cfe0ff}.quick-icon{width:52px;height:52px;min-width:52px;border-radius:18px;display:grid;place-items:center;font-size:23px;color:#1f5eff;background:var(--brand-soft);border:1px solid #dce8ff}.quick-text{min-width:0}.quick-title{font-weight:950;color:#0f172a;line-height:1.75;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.quick-sub{font-size:12px;color:var(--muted);line-height:1.9;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.quick-arrow{width:34px;height:34px;border-radius:13px;display:grid;place-items:center;color:#6480a6;background:#f3f7ff;justify-self:end;transform:none}.section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:16px;direction:rtl}.section-head h2,.section-head h3{margin:0;color:#0f172a;line-height:1.7}.section-head p{margin:.2rem 0 0}.form-grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:14px;align-items:start}.field{grid-column:span 4;display:flex;flex-direction:column;gap:8px;min-width:0}.field.wide{grid-column:span 12}.field.half{grid-column:span 6}.field.third{grid-column:span 4}.field.quarter{grid-column:span 3}.field label{font-weight:900;font-size:12px;color:#334155;line-height:1.75}input,select,textarea{width:100%;min-height:44px;padding:10px 13px;border:1px solid var(--border);border-radius:15px;background:#fff;color:var(--text);outline:none;direction:rtl;text-align:right;line-height:1.75;box-shadow:inset 0 1px 0 rgba(255,255,255,.9);transition:.16s ease}textarea{min-height:96px;resize:vertical}input::placeholder,textarea::placeholder{color:#9aa8bc}input:focus,select:focus,textarea:focus{border-color:#9bb8ff;box-shadow:0 0 0 4px rgba(31,94,255,.09);background:#fff}.table-wrap{overflow:auto;border:1px solid var(--border);border-radius:20px;background:white;box-shadow:var(--shadow-sm);direction:rtl}.table{width:100%;min-width:760px;border-collapse:separate;border-spacing:0;direction:rtl}.table th,.table td{text-align:right;padding:14px 15px;border-bottom:1px solid #edf2fa;font-size:13px;vertical-align:middle;line-height:1.85;color:#1f2937}.table th{background:#f8fbff;color:#475569;font-weight:950;white-space:nowrap}.table tr:last-child td{border-bottom:0}.chip{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:28px;border-radius:999px;padding:6px 10px;font-size:12px;font-weight:900;background:#f1f5f9;color:#475569;line-height:1.5;unicode-bidi:isolate}.chip.ok{background:var(--ok-soft);color:#047857}.chip.warn{background:var(--warn-soft);color:#b45309}.chip.danger{background:var(--danger-soft);color:#b42318}.chip.info{background:var(--info-soft);color:#1d4ed8}.empty{border:1px dashed #c7d2e4;border-radius:18px;background:#f8fbff;padding:22px;text-align:right;color:var(--muted);line-height:2;direction:rtl;unicode-bidi:plaintext}.notice-pop{position:fixed;top:92px;left:28px;width:min(390px,calc(100vw - 32px));background:white;border:1px solid var(--border);border-radius:22px;box-shadow:var(--shadow);z-index:90;display:none;overflow:hidden}.notice-pop.open{display:block}.notice-head{padding:14px 16px;display:flex;align-items:center;gap:10px;background:#fff8f7;color:#7f1d1d}.notice-list{display:grid}.notice-item{padding:13px 16px;border-top:1px solid #edf2fa;display:flex;gap:10px;text-align:right;direction:rtl}.notice-dot{width:10px;height:10px;border-radius:50%;background:var(--danger);margin-top:8px;min-width:10px}.toast{position:fixed;bottom:22px;right:calc(var(--side) + 55px);z-index:120;background:#111827;color:#fff;border-radius:18px;padding:13px 16px;box-shadow:var(--shadow);display:none;max-width:min(440px,calc(100vw - 32px));line-height:1.8}.toast.show{display:block}.modal-backdrop{position:fixed;inset:0;background:rgba(15,23,42,.42);z-index:100;display:none;align-items:center;justify-content:center;padding:18px}.modal-backdrop.open{display:flex}.modal{width:min(980px,100%);max-height:90vh;overflow:auto;background:white;border-radius:28px;box-shadow:0 40px 100px rgba(0,0,0,.32);direction:rtl}.modal-head{display:flex;align-items:center;justify-content:space-between;padding:18px 20px;border-bottom:1px solid var(--border)}.modal-head h2{margin:0;font-size:18px;line-height:1.7}.modal-body{padding:20px}.modal-foot{display:flex;justify-content:flex-start;gap:10px;padding:16px 20px;border-top:1px solid var(--border)}.login-screen{min-height:100vh;display:grid;place-items:center;padding:22px;background:linear-gradient(135deg,#0f2b75,#1f5eff)}.login-card{width:min(430px,100%);background:white;border-radius:30px;padding:28px;box-shadow:0 35px 100px rgba(0,0,0,.32)}.login-card h1{margin:0 0 6px;line-height:1.7}.login-logo{width:58px;height:58px;border-radius:20px;background:linear-gradient(145deg,#1f5eff,#71a7ff);display:grid;place-items:center;color:white;font-weight:950;font-size:26px;margin-bottom:16px}.mobile-menu-btn{display:none}.mobile-nav{display:none}.mobile-drawer{display:none}.date-picker{position:relative;overflow:visible!important}.calendar-pop{position:fixed!important;inset:auto auto auto auto;width:320px;max-width:calc(100vw - 24px);background:#fff;border:1px solid var(--border);box-shadow:0 28px 80px rgba(15,23,42,.22),0 8px 26px rgba(15,23,42,.12);border-radius:20px;padding:12px;z-index:2147483000!important;display:none;overflow:visible!important;isolation:isolate}.calendar-pop.open{display:block!important}.calendar-pop-floating{pointer-events:auto}.cal-close{width:30px;height:30px;border:0;border-radius:10px;background:#f1f5f9;color:#475569;cursor:pointer;font-size:18px;line-height:1}.cal-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.cal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:5px}.cal-day{height:34px;border-radius:11px;border:0;background:#f8fafc;cursor:pointer}.cal-day:hover,.cal-day.active{background:var(--brand);color:white}.cal-week{font-size:11px;color:var(--muted);text-align:center}.complete-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.complete-item{border:1px solid var(--border);border-radius:17px;padding:14px;background:#fff;min-height:104px}.complete-item b{display:block;margin-bottom:5px;line-height:1.75}.complete-item span{color:var(--muted);font-size:12px;line-height:1.9}.print-only{display:none}.product-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;direction:rtl}.toolbar-actions{display:flex;gap:10px;align-items:center;min-width:min(520px,100%)}.toolbar-actions input{min-width:320px}.product-cell{display:flex;align-items:center;gap:12px;direction:rtl;min-width:220px}.product-thumb{width:54px;height:54px;min-width:54px;border-radius:18px;background:linear-gradient(135deg,#eef5ff,#f8fbff);border:1px solid var(--border);display:grid;place-items:center;color:var(--brand);overflow:hidden}.product-thumb img{width:100%;height:100%;object-fit:cover;display:block}.variant-chip-wrap{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-start;direction:rtl}.products-table .table td{vertical-align:top}.product-wizard{display:grid;gap:18px}.wizard-note{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:16px 18px;border-radius:20px;background:linear-gradient(135deg,#eef5ff,#f9fbff);border:1px solid #dbe8ff;color:#173b83}.wizard-note b{font-size:15px;line-height:1.85}.wizard-note span{color:#426287;line-height:2;max-width:620px}.toggle-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;min-height:44px}.toggle-row label{display:inline-flex;align-items:center;gap:8px;background:#f8fafc;border:1px solid var(--border);border-radius:14px;padding:9px 12px;cursor:pointer}.toggle-row input{width:auto;min-height:0;accent-color:var(--brand)}.variant-head{display:flex;align-items:center;justify-content:space-between;gap:16px;padding-top:6px;border-top:1px solid var(--border-soft)}.variant-head h3{margin:0;line-height:1.7}.variant-rows{display:grid;gap:14px}.variant-row{background:#fff;border:1px solid var(--border);border-radius:22px;padding:16px;box-shadow:var(--shadow-sm)}.variant-row-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}.variant-row-title b{font-size:14px;color:#0f172a}.product-kpis .stat{min-height:144px}
@media(max-width:1240px){.grid-4{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-3{grid-template-columns:repeat(2,minmax(0,1fr))}.field,.field.third,.field.quarter{grid-column:span 6}.complete-list{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:900px){:root{
  --font-fa:IRANSansX,Vazirmatn,Tahoma,Arial,sans-serif;--font-mono-fa:IRANSansX,ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;--side:0;--gap:12px}.sidebar{display:none}.main{margin-right:0;padding:12px 12px 96px}.topbar{top:10px;border-radius:20px;height:64px}.mobile-menu-btn{display:grid}.user-pill{display:none}.page-subtitle{display:none}.notice-pop{left:12px;right:12px;top:78px;width:auto}.toast{right:12px;left:12px}.mobile-nav{display:flex;position:fixed;left:12px;right:12px;bottom:10px;height:70px;background:rgba(255,255,255,.97);backdrop-filter:blur(14px);border:1px solid var(--border);border-radius:24px;z-index:80;box-shadow:var(--shadow);direction:rtl;flex-direction:row;align-items:center;justify-content:space-around}.mobile-nav button{border:0;background:transparent;color:#64748b;display:grid;gap:3px;place-items:center;font-size:11px;font-weight:850;min-width:54px}.mobile-nav button.active{color:var(--brand)}.mobile-drawer{display:block;position:fixed;inset:0;z-index:110;background:rgba(15,23,42,.42);opacity:0;pointer-events:none;transition:.18s}.mobile-drawer.open{opacity:1;pointer-events:auto}.mobile-drawer .sidebar{display:block;top:0;bottom:0;right:0;width:min(320px,86vw);border-radius:0;transform:translateX(105%);transition:.22s}.mobile-drawer.open .sidebar{transform:translateX(0)}.product-toolbar{align-items:stretch;flex-direction:column}.toolbar-actions{width:100%;min-width:0;flex-direction:column}.toolbar-actions input,.toolbar-actions .btn{width:100%;min-width:0}.wizard-note{display:grid}.variant-head{align-items:stretch;flex-direction:column}.variant-head .btn{width:100%}}
@media(max-width:640px){.grid-4,.grid-3,.grid-2{grid-template-columns:1fr}.form-grid{grid-template-columns:1fr}.field,.field.wide,.field.half,.field.third,.field.quarter{grid-column:1}.hero{min-height:0}.hero h2{font-size:17px}.hero p{font-size:13px}.stat{min-height:132px}.stat-value{font-size:24px}.card{padding:16px;border-radius:20px}.section-head{flex-direction:column;align-items:stretch;gap:10px}.section-head .btn{width:100%}.complete-list{grid-template-columns:1fr}.calendar-pop{width:calc(100vw - 40px)}.top-actions{gap:6px}.icon-btn{width:39px;height:39px}.page-icon{width:40px;height:40px}.page-title{font-size:16px}.table{min-width:680px}.quick-card{grid-template-columns:44px minmax(0,1fr) 32px;min-height:84px;padding:12px}.quick-icon{width:44px;height:44px}.modal-body{padding:15px}.modal-foot{flex-wrap:wrap}.modal-foot .btn{flex:1}}
@media print{body{background:white}.sidebar,.topbar,.mobile-nav,.btn,.icon-btn{display:none!important}.main{margin:0;padding:0}.card{box-shadow:none;border-color:#ddd}.print-only{display:block}}
.sep{border:0;border-top:1px solid var(--line);margin:18px 0}.total-row{display:flex;justify-content:flex-end;gap:8px;padding:12px 4px;font-weight:800}.installment-field{transition:.18s ease}.chip.ok{background:#ecfdf3;color:#027a48}.chip.warn{background:#fffaeb;color:#b54708}.chip.info{background:#eff8ff;color:#175cd3}.search-box{display:flex;gap:10px;align-items:center}.search-box input{flex:1}
/* v1.4.6 manager polish */
.channel-dot{display:inline-block;width:12px;height:12px;border-radius:999px;margin-left:7px;vertical-align:middle;box-shadow:0 0 0 3px rgba(100,116,139,.12)}
.invoice-preview{margin-top:14px;border:1px dashed var(--border);border-radius:18px;padding:14px;background:linear-gradient(135deg,#f8fbff,#fff);display:grid;gap:4px;line-height:1.9}.invoice-preview b{font-weight:950;color:#0f172a}.invoice-preview span{color:var(--muted);font-size:12px}.invoice-preview.formal{border-color:#94a3b8}.invoice-preview.store{border-color:#93c5fd;background:linear-gradient(135deg,#eef5ff,#fff)}.invoice-preview.compact{max-width:420px}.settings-hint{border:1px solid var(--border);background:#f8fbff;border-radius:18px;padding:12px 14px;line-height:2;color:var(--muted)}


/* v1.4.6 final UI/accounting/batch fixes */
.card:before,.hero:before{pointer-events:none!important;}
.card>*{position:relative;z-index:1;}
.user-pill-btn{cursor:pointer;text-align:right;color:inherit;appearance:none;-webkit-appearance:none;}
.user-pill-btn:hover{border-color:#bcd0ff;color:#1f5eff;box-shadow:var(--shadow-xs);}
.complete-item b{display:flex;align-items:center;gap:8px;}
.complete-item b svg,.complete-list svg,.card h2>svg,.card h3>svg,.settings-hint svg{width:18px!important;height:18px!important;min-width:18px!important;max-width:18px!important;max-height:18px!important;vertical-align:middle;}
.complete-list .complete-item{overflow:hidden;}
#posScan{pointer-events:auto!important;position:relative;z-index:3;}


/* v1.4.6 final form polish */
input[type="checkbox"]{width:18px!important;height:18px!important;min-width:18px!important;max-width:18px!important;min-height:18px!important;padding:0!important;border-radius:5px!important;box-shadow:none!important;accent-color:var(--brand);cursor:pointer;vertical-align:middle;}
.compact-check{min-height:44px;display:inline-flex!important;align-items:center!important;justify-content:flex-start;gap:9px;width:max-content;max-width:100%;padding:9px 12px;border:1px solid var(--border);border-radius:14px;background:#f8fafc;font-size:12px;font-weight:900;color:#334155;line-height:1.6;cursor:pointer;}
.compact-check span{line-height:1.6;white-space:nowrap;}
.internal-note-field textarea{min-height:70px;}
.batch-entry-grid{grid-template-columns:repeat(12,minmax(0,1fr));align-items:end;}
.batch-entry-grid .field{grid-column:auto;}
.batch-search{grid-column:span 3!important;}
.batch-small{grid-column:span 1!important;}
.batch-date{grid-column:span 2!important;}
.batch-loc{grid-column:span 2!important;}
.batch-table{min-width:980px;}
.batch-table th,.batch-table td{white-space:nowrap;vertical-align:middle;}
.batch-product{min-width:210px;white-space:normal!important;}
.nowrap{white-space:nowrap!important;}
@media(max-width:1240px){.batch-search,.batch-small,.batch-date,.batch-loc{grid-column:span 6!important;}}
@media(max-width:640px){.batch-search,.batch-small,.batch-date,.batch-loc{grid-column:1!important}.compact-check{width:100%;}}

/* v1.4.8 floating jalali datepicker fix */
body.has-calendar-open{overflow-x:hidden}
.modal .calendar-pop,.calendar-pop{z-index:2147483000!important}
.date-picker input{position:relative;z-index:1}


/* v1.4.13 final UX polish */
.sidebar .nav{overscroll-behavior:contain;scroll-behavior:auto}.nav-item[aria-current="page"]{background:linear-gradient(135deg,#1f5eff,#3d7dff);color:#fff;box-shadow:0 12px 28px rgba(31,94,255,.22)}
.print-settings-head{align-items:flex-start;flex-wrap:wrap}.print-rtl-chip{white-space:nowrap;line-height:1.9;max-width:100%;flex-shrink:0}.print-template-grid .field label{white-space:normal}.invoice-settings-card{overflow:visible}.invoice-live-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:14px}.invoice-live-preview{border:1px solid #dbe4f0;border-radius:18px;background:#fff;padding:14px;display:grid;gap:9px;min-height:178px;line-height:1.8;direction:rtl;text-align:right;box-shadow:var(--shadow-xs)}.invoice-live-preview.formal{border-color:#94a3b8}.invoice-live-preview.store{border-color:#93c5fd;background:linear-gradient(135deg,#eef5ff,#fff)}.invoice-live-preview.compact,.invoice-live-preview.thermal{max-width:100%;border-style:dashed}.invoice-live-preview.postal{border-color:#fbbf24;background:#fffdf5}.preview-top{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;border-bottom:1px solid #edf2fa;padding-bottom:8px}.preview-top b{color:#0f172a;font-weight:950}.preview-top span,.preview-row span{color:#64748b;font-size:12px}.preview-row{display:flex;align-items:center;justify-content:space-between;gap:10px}.preview-row b{font-size:12px;color:#0f172a}.preview-footer{margin-top:4px;border-radius:12px;background:#f8fafc;color:#334155;padding:8px;font-size:12px;line-height:1.9;min-height:42px}.role-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.role-card{grid-template-columns:46px minmax(0,1fr);min-height:112px}.role-card .quick-icon,.role-icon{width:46px;height:46px;min-width:46px;font-size:20px}.role-icon.danger-tone{color:#b42318;background:#fff1f0;border-color:#ffd0d0}.role-icon.ok-tone{color:#047857;background:#ecfdf5;border-color:#c9efe0}.role-icon.warn-tone{color:#b45309;background:#fffbeb;border-color:#ffe2a8}.role-icon.info-tone{color:#1d4ed8;background:#eff6ff;border-color:#bfdbfe}.brand-search-field{gap:7px}.brand-search-field select{margin-top:2px}.hero .card-sub,#posCustomerHint{color:rgba(255,255,255,.9)!important}.hero input::placeholder{color:#9aa8bc!important}@media(max-width:980px){.invoice-live-grid,.role-grid{grid-template-columns:1fr}.print-template-grid .field{grid-column:span 12!important}.print-rtl-chip{font-size:11px;padding:5px 9px}.role-card{min-height:auto}}


/* v1.4.13: keep add/action buttons inside cards */
.quick-card{grid-template-columns:52px minmax(0,1fr) auto!important; overflow:visible!important;}
.quick-card>.btn,.quick-card button.btn{justify-self:end;align-self:center;min-width:max-content;max-width:100%;flex-shrink:0;white-space:nowrap;}
.quick-card .quick-arrow{width:34px;min-width:34px;}
@media(max-width:640px){.quick-card{grid-template-columns:44px minmax(0,1fr) auto!important}.quick-card>.btn,.quick-card button.btn{padding-inline:10px;font-size:11.5px}}


/* v1.4.13 invoice tabs, import and backup */
.invoice-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0 16px;border-bottom:1px solid var(--border-soft);padding-bottom:10px}.invoice-tab-btn{border:1px solid var(--border);background:#fff;color:#334155;border-radius:14px;padding:9px 14px;font-weight:950;cursor:pointer}.invoice-tab-btn.active{background:linear-gradient(135deg,#1f5eff,#3d7dff);color:#fff;border-color:#1f5eff;box-shadow:0 10px 24px rgba(31,94,255,.18)}.invoice-tab-panel{display:none}.invoice-tab-panel.active{display:block}.preview-logo{max-width:74px;max-height:38px;object-fit:contain;display:block;margin-bottom:6px}.import-box textarea{min-height:155px;direction:ltr;text-align:left;font-family:var(--font-mono-fa)!important}.backup-counts{margin:12px 0}.tiny-pre{max-height:180px;overflow:auto;background:#0f172a;color:#e2e8f0;border-radius:14px;padding:12px;font-size:11px;direction:ltr;text-align:left}.invoice-settings-card{overflow:visible!important}@media(max-width:640px){.invoice-tabs{display:grid;grid-template-columns:1fr}.invoice-tab-btn{width:100%}.invoice-live-grid{grid-template-columns:1fr}}

/* v1.4.13: inventory page full-width stack layout */
.inventory-stack{display:grid;grid-template-columns:1fr;gap:16px;margin-top:16px;width:100%;}
.inventory-full-card{width:100%;min-height:unset!important;overflow:visible!important;}
.inventory-batches-card{order:1;}
.inventory-receipts-card{order:2;}
.inventory-batches-card .table-wrap,.inventory-receipts-card .table-wrap{width:100%;max-width:100%;}
.inventory-batches-card .batch-table{min-width:1040px;}
.inventory-batches-card .section-head,.inventory-receipts-card .section-head{align-items:flex-start;}
@media(max-width:640px){.inventory-stack{gap:12px}.inventory-full-card{padding:16px}.inventory-batches-card .batch-table{min-width:920px}}

/* v1.4.14 POS contrast + order row alignment */
.hero .field label,.hero .field .card-title,.hero .field .card-sub{color:#fff!important;text-shadow:0 1px 1px rgba(15,23,42,.18)}
.hero select,.hero input,.hero textarea{color:#0f172a!important;background:#fff!important}
.orders-table-wrap{overflow:auto}
.orders-table{table-layout:fixed;min-width:1180px}
.orders-table th,.orders-table td{vertical-align:middle!important;white-space:nowrap!important;overflow:hidden;text-overflow:ellipsis}
.orders-table th:nth-child(1),.orders-table td:nth-child(1){width:180px}
.orders-table th:nth-child(2),.orders-table td:nth-child(2){width:230px}
.orders-table th:nth-child(3),.orders-table td:nth-child(3){width:150px}
.orders-table th:nth-child(4),.orders-table td:nth-child(4){width:245px}
.orders-table th:nth-child(5),.orders-table td:nth-child(5){width:185px}
.orders-table th:nth-child(6),.orders-table td:nth-child(6){width:280px}
.order-customer,.order-channel,.order-amount,.order-status{display:flex;align-items:center;gap:8px;min-width:0}
.order-customer span,.order-channel span,.order-amount span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.order-mobile,.order-external{color:#64748b;font-size:12px;flex:0 0 auto}
.order-amount em,.order-status em{font-style:normal;color:#64748b;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.order-actions{white-space:normal!important;overflow:visible!important;text-overflow:clip!important}
.order-actions .btn{margin:2px 0 2px 4px}
.in-person-order .order-amount em{color:#2563eb;font-weight:850}
@media(max-width:760px){.orders-table{min-width:1060px}.orders-table th:nth-child(6),.orders-table td:nth-child(6){width:240px}}

/* v1.4.15 customer geo + custom reports */
.report-filter-card{border-color:#dbe8ff;background:linear-gradient(180deg,#fff,#f8fbff)}
.report-actions{margin-top:14px;flex-wrap:wrap}.report-actions .btn{min-width:112px}
select[data-geo-province],select[data-geo-city]{background:#fff;color:#0f172a}
@media(max-width:900px){.report-actions .btn{width:100%}}

/* v1.4.22 profile, permissions, notification and dashboard polish */
.profile-avatar svg{width:22px;height:22px}.profile-summary{grid-template-columns:52px minmax(0,1fr)!important}.permission-matrix{display:grid;gap:14px}.permission-role-card{border:1px solid var(--border);border-radius:22px;background:#fff;padding:16px;box-shadow:var(--shadow-xs);overflow:visible}.role-title-line{display:flex;align-items:center;gap:12px}.permission-checks{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin-top:14px}.perm-check{display:grid;grid-template-columns:22px minmax(0,1fr);gap:7px;align-items:start;border:1px solid #e2e8f0;border-radius:14px;padding:9px 10px;background:#f8fafc;color:#0f172a;line-height:1.8}.perm-check input{width:16px;height:16px;min-height:0;margin-top:5px;accent-color:var(--brand)}.perm-check span{font-weight:850;font-size:12px}.perm-check small{grid-column:2;color:#64748b;font-size:10.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.perm-check.disabled{opacity:.78;background:#f1f5f9}.dashboard-insights .stat-value{font-size:20px;white-space:normal;line-height:1.55}.dashboard-insights .stat{min-height:148px}.notice-pop.open{display:block!important}@media(max-width:980px){.permission-checks{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:640px){.permission-checks{grid-template-columns:1fr}.dashboard-insights .stat-value{font-size:18px}}


/* v1.4.22 mobile UX + channel edit fix polish */
@media(max-width:760px){
  body.mobile-menu-open{overflow:hidden!important;}
  .mobile-drawer{touch-action:none;}
  .mobile-drawer.open{display:block!important;}
  .mobile-drawer .sidebar{max-width:86vw;overflow:hidden;}
  .mobile-drawer-close{position:absolute;top:12px;left:12px;width:40px;height:40px;border:1px solid var(--border);border-radius:14px;background:#fff;color:#0f172a;display:grid;place-items:center;z-index:3;box-shadow:var(--shadow-xs);}
  .mobile-drawer-close svg{width:20px;height:20px;}
  .mobile-drawer .brand{padding-left:62px;}
  .mobile-drawer .nav{padding-bottom:110px;}

  /* داشبورد و کارت‌های آماری در موبایل فشرده‌تر و ۲ در ۲ */
  .content > .grid.grid-4,
  .dashboard-insights,
  #liveDashboardBody.grid-4,
  .product-kpis.grid-4{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important;}
  .stat{min-height:112px!important;padding:13px!important;border-radius:18px!important;}
  .stat-icon{width:38px!important;height:38px!important;min-width:38px!important;}
  .stat-icon svg{width:19px!important;height:19px!important;}
  .stat-value{font-size:19px!important;line-height:1.45!important;}
  .stat-label,.stat-sub{font-size:11px!important;line-height:1.7!important;}

  /* هدر بخش‌ها و دکمه درج محصول در موبایل */
  .section-head{gap:9px!important;}
  .section-head .btn{width:auto!important;min-height:40px!important;padding:8px 12px!important;border-radius:14px!important;font-size:12px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:6px!important;}
  .section-head .btn svg,
  .btn svg{width:16px!important;height:16px!important;min-width:16px!important;}
  .page-icon svg,.nav-ico svg{width:20px!important;height:20px!important;}

  /* فرم‌ها در موبایل جمع‌وجور */
  .card{padding:14px!important;border-radius:18px!important;}
  .form-grid{gap:10px!important;}
  .field label{font-size:11.5px!important;margin-bottom:5px!important;}
  input,select,textarea{min-height:42px!important;border-radius:14px!important;font-size:13px!important;}
  textarea{min-height:76px!important;}
  .btn{min-height:40px!important;border-radius:14px!important;font-size:12px!important;}

  /* لیست‌ها در موبایل: اسکرول افقی کنترل‌شده نه بهم‌ریختگی */
  .table-wrap{border-radius:16px!important;overflow:auto!important;-webkit-overflow-scrolling:touch;}
  .table th,.table td{font-size:12px!important;padding:10px 9px!important;}

  /* کارت‌های سریع و عملیات‌ها فشرده‌تر */
  .quick-card{grid-template-columns:38px minmax(0,1fr) auto!important;min-height:68px!important;padding:10px!important;border-radius:16px!important;gap:9px!important;}
  .quick-icon{width:38px!important;height:38px!important;min-width:38px!important;border-radius:14px!important;}
  .quick-icon svg{width:18px!important;height:18px!important;}
  .quick-title,.quick-text b{font-size:12.5px!important;line-height:1.6!important;}
  .quick-sub{font-size:11px!important;line-height:1.6!important;}

  /* مودال‌ها در موبایل: تمام‌صفحه‌تر، قابل کنترل */
  .modal{width:calc(100vw - 18px)!important;max-height:calc(100vh - 24px)!important;border-radius:20px!important;}
  .modal-head{padding:12px 14px!important;}
  .modal-body{padding:12px!important;}
  .modal-foot{padding:10px 12px!important;gap:8px!important;}
  .modal-foot .btn{flex:1 1 auto!important;}
}
@media(max-width:420px){
  .content > .grid.grid-4,
  .dashboard-insights,
  #liveDashboardBody.grid-4,
  .product-kpis.grid-4{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;}
  .stat{padding:11px!important;min-height:106px!important;}
  .stat-value{font-size:17px!important;}
  .mobile-nav{left:8px!important;right:8px!important;height:64px!important;border-radius:20px!important;}
  .mobile-nav button{font-size:10px!important;min-width:48px!important;}
}

/* v1.4.22 - Balanced dropdown padding / RTL select arrow polish */
select,
.form-grid select,
.field select,
.hero select,
.modal select,
.card select,
.invoice-settings-card select,
.brand-search-field select,
select[data-geo-province],
select[data-geo-city] {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  padding-inline-start: 38px !important;
  padding-inline-end: 38px !important;
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%2364758B' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: left 15px center !important;
  background-size: 14px 14px !important;
}
select:focus,
.form-grid select:focus,
.field select:focus,
.hero select:focus,
.modal select:focus,
.card select:focus {
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%231F5EFF' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
}
@media (max-width: 760px) {
  select,
  .form-grid select,
  .field select,
  .hero select,
  .modal select,
  .card select,
  .invoice-settings-card select,
  .brand-search-field select,
  select[data-geo-province],
  select[data-geo-city] {
    padding-inline-start: 34px !important;
    padding-inline-end: 34px !important;
    background-position: left 13px center !important;
  }
}

/* v1.4.22 - Geo selector, inventory form and profile modal polish */
.receipt-submit-row{display:flex;justify-content:flex-end;align-items:center;margin-top:16px;width:100%;direction:rtl;}
.receipt-submit-row .btn{min-width:168px;}
.modal-form-card{border:1px solid var(--border);border-radius:22px;background:linear-gradient(180deg,#fff,#f8fbff);padding:16px;box-shadow:var(--shadow-xs);}
.modal-form-card textarea{resize:vertical;}
.profile-actions-row{display:flex;align-items:center;gap:8px;flex-wrap:nowrap;margin-top:14px;width:100%;}
.profile-actions-row .btn{flex:1 1 0;min-width:0;white-space:nowrap;padding-inline:12px;}
@media(max-width:760px){
  .receipt-submit-row{justify-content:flex-end;margin-top:12px;}
  .receipt-submit-row .btn{width:auto!important;min-width:150px;}
  .modal-form-card{padding:12px;border-radius:18px;}
  .profile-actions-row{gap:6px;}
  .profile-actions-row .btn{font-size:11px!important;padding-inline:8px!important;min-height:38px!important;}
}
@media(max-width:420px){
  .profile-actions-row .btn{font-size:10.5px!important;padding-inline:6px!important;}
}

/* v1.4.22 - Dashboard simplification, real invoice preview, POS title and restore modal polish */
.dashboard-main-stats .stat{min-height:138px;height:100%;}
.dashboard-main-stats .stat-row{align-items:center;}
.dashboard-main-stats .stat-content{justify-content:center;}
.dashboard-main-stats .card-title{min-height:30px;display:flex;align-items:center;}
.dashboard-main-stats .stat-value{font-size:25px;}
.dashboard-chart-card{margin-top:16px;overflow:visible;}
.dash-chart-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-top:14px;}
.dash-chart-block{border:1px solid var(--border-soft);border-radius:20px;background:linear-gradient(180deg,#fff,#f8fbff);padding:14px;display:grid;gap:12px;}
.dash-chart-block h4{margin:0;color:#0f172a;font-size:13px;font-weight:950;line-height:1.8;}
.dash-bar{display:grid;gap:8px;}
.dash-bar-head{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:12px;line-height:1.8;}
.dash-bar-head b{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#0f172a;}
.dash-bar-head span{flex:0 0 auto;color:#64748b;font-weight:850;}
.dash-bar-track{height:11px;border-radius:999px;background:#edf2fa;overflow:hidden;border:1px solid #e2e8f0;}
.dash-bar-track i{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,#1f5eff,#72a2ff);}
.dash-bar.ok .dash-bar-track i{background:linear-gradient(90deg,#0f9f6e,#7ddfbd);}
.dash-bar.warn .dash-bar-track i{background:linear-gradient(90deg,#d97706,#fbbf24);}
.dash-mini-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:14px;}
.dash-mini{border:1px solid var(--border-soft);border-radius:18px;background:#fff;padding:11px;display:flex;align-items:center;gap:10px;min-width:0;box-shadow:var(--shadow-xs);}
.dash-mini-icon{width:38px;height:38px;min-width:38px;border-radius:14px;display:grid;place-items:center;background:var(--info-soft);color:var(--info);}
.dash-mini.ok .dash-mini-icon{background:var(--ok-soft);color:var(--ok);}
.dash-mini.warn .dash-mini-icon{background:var(--warn-soft);color:var(--warn);}
.dash-mini span:not(.dash-mini-icon){min-width:0;display:grid;gap:1px;}
.dash-mini b{font-size:11px;color:#64748b;line-height:1.6;}
.dash-mini strong{font-size:17px;color:#0f172a;font-weight:950;line-height:1.5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.dash-mini em{font-style:normal;color:#94a3b8;font-size:10.5px;line-height:1.6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.live-dashboard-card{min-height:auto;}
.live-dashboard-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:10px;}
.live-pill{border:1px solid var(--border-soft);border-radius:18px;background:#fff;padding:10px;display:flex;align-items:center;gap:10px;min-width:0;}
.live-pill-icon{width:36px;height:36px;min-width:36px;border-radius:13px;display:grid;place-items:center;background:var(--info-soft);color:var(--info);}
.live-pill.ok .live-pill-icon{background:var(--ok-soft);color:var(--ok);}
.live-pill.warn .live-pill-icon{background:var(--warn-soft);color:var(--warn);}
.live-pill span:not(.live-pill-icon){min-width:0;display:grid;gap:2px;}
.live-pill b{font-size:11px;color:#64748b;line-height:1.6;}
.live-pill strong{font-size:16px;color:#0f172a;font-weight:950;line-height:1.5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.soft-badge{position:static!important;background:#edf4ff!important;color:#1f5eff!important;border:1px solid #d4e2ff!important;height:auto!important;min-height:28px!important;border-radius:999px!important;font-size:11px!important;}
.pos-hero h2,.pos-hero .pos-title{color:#fff!important;text-shadow:0 1px 1px rgba(0,0,0,.16);}
.invoice-real-preview{border:1px solid #dbe4f0;border-radius:18px;background:#fff;padding:12px;display:grid;gap:10px;direction:rtl;text-align:right;box-shadow:var(--shadow-xs);font-size:12px;line-height:1.8;min-height:260px;}
.invoice-real-preview.formal{border-color:#94a3b8;}
.invoice-real-preview.store{border-color:#93c5fd;background:linear-gradient(135deg,#f6faff,#fff);}
.invoice-real-preview.thermal{max-width:230px;margin-inline:auto;border-style:dashed;}
.invoice-real-preview.postal{border-color:#fbbf24;background:#fffdf5;}
.real-preview-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;border-bottom:1px solid #edf2fa;padding-bottom:9px;}
.real-preview-head b{display:block;color:#0f172a;font-weight:950;font-size:14px;}
.real-preview-head span,.real-preview-head small{display:block;color:#64748b;font-size:10.5px;}
.real-preview-store{text-align:left;direction:rtl;}
.real-preview-store i{display:inline-grid;place-items:center;width:34px;height:34px;border-radius:9px;border:1px dashed #94a3b8;color:#64748b;font-style:normal;font-size:10px;margin-top:4px;}
.real-preview-info{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
.real-preview-info>div{border:1px solid #e2e8f0;border-radius:13px;background:#f8fafc;padding:8px;display:grid;gap:2px;}
.real-preview-info b{color:#0f172a;font-size:11px;}
.real-preview-info span{color:#334155;font-weight:850;}
.real-preview-info small{color:#64748b;}
.invoice-real-preview table{width:100%;border-collapse:separate;border-spacing:0;border:1px solid #e2e8f0;border-radius:13px;overflow:hidden;}
.invoice-real-preview th,.invoice-real-preview td{padding:7px 8px;border-bottom:1px solid #edf2fa;color:#0f172a;}
.invoice-real-preview th{background:#f1f5f9;font-size:11px;color:#475569;}
.invoice-real-preview tr:last-child td{border-bottom:0;}
.real-preview-total{display:flex;justify-content:space-between;align-items:center;border-radius:13px;background:#0f172a;color:#fff;padding:9px 10px;font-weight:950;}
.real-preview-note{border-radius:12px;background:#eff6ff;color:#1d4ed8;padding:8px 10px;font-weight:850;}
.real-preview-sign{border:1px dashed #cbd5e1;border-radius:12px;padding:10px;text-align:center;color:#64748b;min-height:42px;}
.restore-confirm-card{display:grid;grid-template-columns:54px minmax(0,1fr);gap:12px;border:1px solid #fecaca;border-radius:22px;background:linear-gradient(180deg,#fff,#fff7f7);padding:16px;align-items:start;}
.restore-confirm-card h3{margin:0;color:#991b1b;font-size:16px;line-height:1.9;}
.restore-confirm-card p{margin:4px 0 10px;color:#334155;line-height:2;}
.restore-file-name{border:1px solid #e2e8f0;border-radius:12px;background:#fff;padding:8px;color:#0f172a;font-size:12px;}
@media(max-width:980px){.dash-mini-grid,.live-dashboard-grid{grid-template-columns:repeat(2,minmax(0,1fr));}.dash-chart-grid{grid-template-columns:1fr;}.dashboard-main-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important;}}
@media(max-width:640px){.dashboard-main-stats .stat{min-height:112px!important;}.dashboard-main-stats .stat-value{font-size:18px!important;}.dash-mini-grid,.live-dashboard-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}.dash-mini,.live-pill{padding:9px;border-radius:15px;}.dash-mini-icon,.live-pill-icon{width:32px;height:32px;min-width:32px;border-radius:12px;}.dash-mini strong,.live-pill strong{font-size:14px;}.real-preview-info{grid-template-columns:1fr;}.invoice-real-preview.thermal{max-width:100%;}.restore-confirm-card{grid-template-columns:1fr;}.restore-confirm-card .quick-icon{width:46px;height:46px;}}
.quick-icon.danger-tone{color:#b42318;background:#fff1f0;border-color:#ffd0d0;}

/* v1.4.22 - order row alignment, POS customer suggestions, card receipt archive */
.orders-table{min-width:1240px!important;table-layout:fixed!important;}
.orders-table th,.orders-table td{vertical-align:middle!important;white-space:normal!important;overflow:visible!important;text-overflow:clip!important;}
.orders-table th:nth-child(1),.orders-table td:nth-child(1){width:190px!important;}
.orders-table th:nth-child(2),.orders-table td:nth-child(2){width:210px!important;}
.orders-table th:nth-child(3),.orders-table td:nth-child(3){width:170px!important;}
.orders-table th:nth-child(4),.orders-table td:nth-child(4){width:230px!important;}
.orders-table th:nth-child(5),.orders-table td:nth-child(5){width:210px!important;}
.orders-table th:nth-child(6),.orders-table td:nth-child(6){width:330px!important;}
.orders-table .order-no bdi,
.order-cell-main,.order-cell-sub{display:block;min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.85;}
.order-cell-main{font-weight:950;color:#0f172a;font-size:13px;}
.order-cell-sub{font-size:11.5px;color:#64748b;font-weight:750;}
.order-status .chip{display:inline-flex;margin-bottom:4px;max-width:100%;}
.order-status .receipt-chip{margin-inline-start:4px;background:#eff6ff;color:#1d4ed8;border-color:#bfdbfe;}
.in-person-order .order-cell-sub{color:#2563eb;}
.in-person-order .order-status .order-cell-sub{color:#047857;font-weight:850;}
.order-actions{white-space:normal!important;line-height:2.4!important;}
.order-actions .btn{margin:2px 0 2px 4px!important;}
.customer-suggest-box{position:relative;z-index:6;margin-top:6px;display:grid;gap:6px;}
.customer-suggest-item{width:100%;border:1px solid #dbe4f0;background:#fff;border-radius:14px;padding:9px 11px;display:flex;align-items:center;justify-content:space-between;gap:12px;cursor:pointer;text-align:right;color:#0f172a;box-shadow:var(--shadow-xs);}
.customer-suggest-item:hover{border-color:#9bbcff;background:#f8fbff;}
.customer-suggest-item b{font-size:12px;line-height:1.7;}
.customer-suggest-item span{font-size:11px;color:#64748b;flex:0 0 auto;}
.customer-suggest-empty{border:1px dashed rgba(255,255,255,.52);border-radius:14px;padding:9px 11px;color:rgba(255,255,255,.92);font-size:12px;line-height:1.8;}
.pos-customer-field{overflow:visible!important;}
.card-receipt-field input[type=file]{padding:10px 12px;background:#fff;border:1px dashed #9bbcff;}
#cardReceiptHint{color:#64748b!important;text-shadow:none!important;}
.receipt-archive-card{display:grid;gap:12px;direction:rtl;text-align:right;}
.receipt-archive-card img{width:100%;max-height:72vh;object-fit:contain;border:1px solid var(--border);border-radius:18px;background:#f8fafc;box-shadow:var(--shadow-xs);}
.receipt-meta{display:flex;gap:8px;flex-wrap:wrap;}
.receipt-meta span{border:1px solid #dbe4f0;background:#f8fafc;color:#475569;border-radius:999px;padding:6px 10px;font-size:11px;font-weight:850;}
@media(max-width:760px){.orders-table{min-width:1120px!important}.orders-table th:nth-child(6),.orders-table td:nth-child(6){width:280px!important}.customer-suggest-item{padding:8px 10px}.receipt-archive-card img{max-height:66vh}}

/* v1.4.22 - Collapsible desktop sidebar + profile button fit */
.profile-actions-row{display:flex;align-items:center;gap:8px;flex-wrap:nowrap!important;min-width:0;}
.profile-actions-row .btn{min-width:0;white-space:nowrap!important;padding-inline:14px!important;flex:1 1 0;text-align:center;justify-content:center;}
.profile-actions-row .btn.danger{flex:.72 1 0;}
.brand-copy{min-width:0;display:grid;gap:1px;}
.sidebar-collapse-btn{margin-inline-start:auto;width:34px;height:34px;min-width:34px;border-radius:13px;border:1px solid #dbe4f0;background:#fff;color:#64748b;display:grid;place-items:center;cursor:pointer;transition:.18s ease;box-shadow:var(--shadow-xs);}
.sidebar-collapse-btn:hover{color:#1f5eff;border-color:#bcd0ff;background:#f8fbff;}
.sidebar-collapse-btn svg{width:18px;height:18px;transition:.18s ease;}
.mobile-drawer .sidebar-collapse-btn{display:none!important;}
@media(min-width:981px){
  .app-shell>.sidebar,.app-shell>.main{transition:width .22s ease,margin-right .22s ease,padding .22s ease;}
  .app-shell.sidebar-collapsed>.sidebar{width:92px!important;}
  .app-shell.sidebar-collapsed>.main{margin-right:128px!important;}
  .app-shell.sidebar-collapsed>.sidebar .brand{justify-content:center;padding-inline:12px;gap:0;}
  .app-shell.sidebar-collapsed>.sidebar .brand-mark{width:50px;height:50px;min-width:50px;border-radius:18px;font-size:21px;}
  .app-shell.sidebar-collapsed>.sidebar .brand-copy,
  .app-shell.sidebar-collapsed>.sidebar .nav-label,
  .app-shell.sidebar-collapsed>.sidebar .nav-group-title,
  .app-shell.sidebar-collapsed>.sidebar .sidebar-footer{display:none!important;}
  .app-shell.sidebar-collapsed>.sidebar .sidebar-collapse-btn{position:absolute;left:10px;top:21px;width:28px;height:28px;min-width:28px;border-radius:11px;background:#eef5ff;color:#1f5eff;}
  .app-shell.sidebar-collapsed>.sidebar .sidebar-collapse-btn svg{transform:rotate(180deg);width:15px;height:15px;}
  .app-shell.sidebar-collapsed>.sidebar .nav{padding:12px 10px;}
  .app-shell.sidebar-collapsed>.sidebar .nav-item{justify-content:center;padding:0;width:54px;height:48px;margin:5px auto;border-radius:18px;gap:0;}
  .app-shell.sidebar-collapsed>.sidebar .nav-ico{width:26px;height:26px;min-width:26px;font-size:18px;}
  .app-shell.sidebar-collapsed>.sidebar .nav-item:hover::after{content:attr(title);position:fixed;right:118px;z-index:5000;background:#0f172a;color:#fff;border-radius:12px;padding:7px 10px;font-size:12px;font-weight:850;white-space:nowrap;box-shadow:var(--shadow-sm);}
}
@media(max-width:640px){.profile-actions-row{gap:6px;}.profile-actions-row .btn{padding-inline:10px!important;font-size:11.5px!important;}}

/* v1.4.25 invoice logo upload + product edit + sales customer suggestions */
.invoice-logo-uploader{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(160px,.9fr);gap:12px;align-items:stretch;direction:rtl}
.invoice-logo-drop{position:relative;border:1px dashed #b8c7dc;border-radius:18px;background:linear-gradient(180deg,#f8fbff,#fff);min-height:92px;display:grid;place-items:center;text-align:center;padding:14px;color:#334155;overflow:hidden}
.invoice-logo-drop input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
.invoice-logo-drop span{font-weight:950;color:#1f5eff;line-height:1.8}
.invoice-logo-drop small{display:block;color:#64748b;line-height:1.8;font-size:11px}
.invoice-logo-preview{border:1px solid var(--border);border-radius:18px;background:#fff;min-height:92px;display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;padding:10px;color:#64748b;font-size:12px}
.invoice-logo-preview img{max-width:170px;max-height:72px;object-fit:contain;display:block}
.sales-customer-field{position:relative;overflow:visible!important}
.sales-customer-field .customer-suggest-box{position:relative;z-index:20}
.customer-suggest-item small{display:block;color:#7c8ca3;font-size:11px;line-height:1.6;margin-inline-start:auto;white-space:nowrap}
.customer-suggest-empty.light{background:#f8fbff;color:#64748b;border-color:#cbd5e1}
.products-table .btn.small{margin:2px}
@media(max-width:760px){.invoice-logo-uploader{grid-template-columns:1fr}.invoice-logo-preview{justify-content:center}.customer-suggest-item{display:grid;grid-template-columns:1fr auto;align-items:center}.customer-suggest-item small{grid-column:1/-1;margin:0}}

/* v1.4.25 - Engineered dark mode: not pure black, high contrast, RTL-safe */
html[data-theme="dark"]{
  color-scheme:dark;
  --bg:#0f172a;
  --surface:#132033;
  --surface-2:#182740;
  --surface-3:#203453;
  --text:#eef6ff;
  --text-2:#d6e3f5;
  --muted:#a8b8cf;
  --muted-2:#7890ad;
  --border:#31435f;
  --border-soft:#263952;
  --brand:#74a7ff;
  --brand-2:#4f7eff;
  --brand-soft:rgba(90,135,255,.18);
  --ok:#3dd69d;
  --ok-soft:rgba(61,214,157,.16);
  --warn:#f7b955;
  --warn-soft:rgba(247,185,85,.16);
  --danger:#ff6b7a;
  --danger-soft:rgba(255,107,122,.16);
  --info:#7bb3ff;
  --info-soft:rgba(123,179,255,.17);
  --shadow:0 24px 70px rgba(0,0,0,.34);
  --shadow-sm:0 16px 42px rgba(0,0,0,.28);
  --shadow-xs:0 8px 22px rgba(0,0,0,.22);
}
html[data-theme="dark"] body{
  background:
    radial-gradient(circle at 12% -8%,rgba(60,99,255,.30) 0,rgba(60,99,255,.08) 28%,transparent 48%),
    radial-gradient(circle at 92% 8%,rgba(20,184,166,.18) 0,transparent 34%),
    linear-gradient(135deg,#0f172a 0%,#101b2e 42%,#0b1220 100%);
  color:var(--text);
}
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .card,
html[data-theme="dark"] .modal,
html[data-theme="dark"] .login-card,
html[data-theme="dark"] .notice-pop,
html[data-theme="dark"] .mobile-nav{
  background:linear-gradient(180deg,rgba(19,32,51,.94),rgba(15,25,43,.92));
  border-color:var(--border-soft);
  box-shadow:var(--shadow-sm);
  color:var(--text);
  backdrop-filter:blur(18px);
}
html[data-theme="dark"] .brand,
html[data-theme="dark"] .modal-head,
html[data-theme="dark"] .modal-foot,
html[data-theme="dark"] .table th,
html[data-theme="dark"] .section-head,
html[data-theme="dark"] .sidebar-footer{
  border-color:var(--border-soft)!important;
}
html[data-theme="dark"] .brand-mark,
html[data-theme="dark"] .login-logo{
  background:linear-gradient(145deg,#4f7eff,#13b8a6);
  box-shadow:0 16px 34px rgba(79,126,255,.26);
}
html[data-theme="dark"] .nav-group-title{color:#8399b8;}
html[data-theme="dark"] .nav-item{
  color:var(--text-2);
  background:transparent;
}
html[data-theme="dark"] .nav-item:hover{
  background:rgba(116,167,255,.12);
  color:#fff;
}
html[data-theme="dark"] .nav-item.active{
  background:linear-gradient(135deg,rgba(79,126,255,.28),rgba(19,184,166,.16));
  color:#fff;
  border-color:rgba(116,167,255,.32);
  box-shadow:inset 0 0 0 1px rgba(116,167,255,.12);
}
html[data-theme="dark"] .page-icon,
html[data-theme="dark"] .icon-btn,
html[data-theme="dark"] .quick-icon,
html[data-theme="dark"] .stat-icon{
  background:rgba(116,167,255,.14);
  border-color:rgba(116,167,255,.22);
  color:var(--brand);
}
html[data-theme="dark"] .icon-btn:hover,
html[data-theme="dark"] .theme-toggle-btn{
  background:rgba(116,167,255,.20);
  color:#fff;
}
html[data-theme="dark"] .card-sub,
html[data-theme="dark"] .quick-sub,
html[data-theme="dark"] .brand-sub,
html[data-theme="dark"] .page-subtitle,
html[data-theme="dark"] .stat-sub,
html[data-theme="dark"] .order-cell-sub,
html[data-theme="dark"] small{
  color:var(--muted)!important;
}
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea{
  background:#0f1a2b!important;
  color:var(--text)!important;
  border-color:#31435f!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.03);
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder{color:#7c90ad!important;}
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus{
  border-color:var(--brand)!important;
  box-shadow:0 0 0 4px rgba(116,167,255,.16)!important;
}
html[data-theme="dark"] .hero input,
html[data-theme="dark"] .hero select,
html[data-theme="dark"] .hero textarea{background:#f8fafc!important;color:#0f172a!important;}
html[data-theme="dark"] .btn.secondary,
html[data-theme="dark"] .btn.ghost,
html[data-theme="dark"] .logout,
html[data-theme="dark"] .sidebar-collapse-btn,
html[data-theme="dark"] .invoice-tab-btn{
  background:rgba(255,255,255,.06)!important;
  color:var(--text)!important;
  border-color:var(--border)!important;
}
html[data-theme="dark"] .btn.secondary:hover,
html[data-theme="dark"] .btn.ghost:hover,
html[data-theme="dark"] .invoice-tab-btn:hover{background:rgba(116,167,255,.14)!important;}
html[data-theme="dark"] .invoice-tab-btn.active,
html[data-theme="dark"] .btn:not(.secondary):not(.ghost):not(.danger):not(.ok){
  background:linear-gradient(135deg,#4f7eff,#2278ff)!important;
  color:#fff!important;
}
html[data-theme="dark"] .btn.ok{background:linear-gradient(135deg,#16a979,#0f8d68)!important;color:#fff!important;}
html[data-theme="dark"] .btn.danger{background:linear-gradient(135deg,#ef4457,#c6283b)!important;color:#fff!important;}
html[data-theme="dark"] .table{color:var(--text);}
html[data-theme="dark"] .table th{background:#17263d!important;color:#dce8f8!important;}
html[data-theme="dark"] .table td{border-color:var(--border-soft)!important;}
html[data-theme="dark"] .table tr:hover td{background:rgba(116,167,255,.06)!important;}
html[data-theme="dark"] .quick-card,
html[data-theme="dark"] .stat,
html[data-theme="dark"] .dash-mini,
html[data-theme="dark"] .permission-role-card,
html[data-theme="dark"] .modal-form-card,
html[data-theme="dark"] .invoice-preview,
html[data-theme="dark"] .invoice-logo-uploader,
html[data-theme="dark"] .report-filter-card,
html[data-theme="dark"] .receipt-archive-card{
  background:linear-gradient(180deg,rgba(24,39,64,.92),rgba(18,31,50,.92))!important;
  border-color:var(--border-soft)!important;
  color:var(--text)!important;
}
html[data-theme="dark"] .invoice-logo-drop,
html[data-theme="dark"] .invoice-logo-preview,
html[data-theme="dark"] .perm-check,
html[data-theme="dark"] .dash-chart-block,
html[data-theme="dark"] .bar-row,
html[data-theme="dark"] .backup-restore-card{
  background:#101c2f!important;
  border-color:var(--border)!important;
  color:var(--text)!important;
}
html[data-theme="dark"] .chip,
html[data-theme="dark"] .badge,
html[data-theme="dark"] .soft-badge{
  border-color:rgba(255,255,255,.12);
  color:var(--text);
}
html[data-theme="dark"] .chip.ok{background:var(--ok-soft)!important;color:#9ff4cf!important;}
html[data-theme="dark"] .chip.warn{background:var(--warn-soft)!important;color:#ffd28a!important;}
html[data-theme="dark"] .chip.danger{background:var(--danger-soft)!important;color:#ffacb5!important;}
html[data-theme="dark"] .chip.info{background:var(--info-soft)!important;color:#b9d6ff!important;}
html[data-theme="dark"] .empty{background:rgba(255,255,255,.04)!important;border-color:var(--border-soft)!important;color:var(--muted)!important;}
html[data-theme="dark"] .hero{
  background:linear-gradient(135deg,#17305c,#10233f 58%,#123d43)!important;
  color:#fff!important;
}
html[data-theme="dark"] .hero h2,
html[data-theme="dark"] .hero p,
html[data-theme="dark"] .hero label,
html[data-theme="dark"] .pos-title{color:#fff!important;}
html[data-theme="dark"] .calendar-pop{
  background:#132033!important;
  border-color:var(--border)!important;
  color:var(--text)!important;
  box-shadow:0 26px 80px rgba(0,0,0,.46)!important;
}
html[data-theme="dark"] .calendar-pop button{color:var(--text);}
html[data-theme="dark"] .toast{background:#101c2f;color:#fff;border:1px solid var(--border);box-shadow:var(--shadow-sm);}
html[data-theme="dark"] .modal-backdrop.show{background:rgba(3,7,18,.70)!important;}
html[data-theme="dark"] .live-dashboard-card,
html[data-theme="dark"] .dashboard-chart-card{background:linear-gradient(180deg,rgba(19,32,51,.98),rgba(13,23,39,.96))!important;}
html[data-theme="dark"] .dash-bar-track{background:#0b1424!important;}
html[data-theme="dark"] .mobile-drawer .sidebar{background:#132033!important;}
html[data-theme="dark"] select,
html[data-theme="dark"] .form-grid select,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .modal select,
html[data-theme="dark"] .card select{
  background-image:url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%23A8B8CF' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")!important;
}
html[data-theme="dark"] ::selection{background:rgba(116,167,255,.35);color:#fff;}
@media print{
  html[data-theme="dark"] body,
  html[data-theme="dark"] .print-only,
  html[data-theme="dark"] .invoice-preview{background:#fff!important;color:#111827!important;box-shadow:none!important;}
}

/* v1.4.25 - Dark mode hardening pass: contrast-safe details */
html[data-theme="dark"] .page-title,
html[data-theme="dark"] .card-title,
html[data-theme="dark"] .quick-title,
html[data-theme="dark"] .section-head h2,
html[data-theme="dark"] .section-head h3,
html[data-theme="dark"] .variant-row-title b,
html[data-theme="dark"] .stat-value,
html[data-theme="dark"] .dash-chart-block h4,
html[data-theme="dark"] .dash-bar-head b,
html[data-theme="dark"] .dash-mini strong,
html[data-theme="dark"] .live-pill strong,
html[data-theme="dark"] .real-preview-head b,
html[data-theme="dark"] .real-preview-info b,
html[data-theme="dark"] .order-cell-main,
html[data-theme="dark"] .quick-text b,
html[data-theme="dark"] .modal h1,
html[data-theme="dark"] .modal h2,
html[data-theme="dark"] .modal h3,
html[data-theme="dark"] .modal h4{
  color:var(--text)!important;
}
html[data-theme="dark"] .field label,
html[data-theme="dark"] .compact-check,
html[data-theme="dark"] .preview-footer,
html[data-theme="dark"] .real-preview-info span,
html[data-theme="dark"] .restore-confirm-card p,
html[data-theme="dark"] .receipt-meta span,
html[data-theme="dark"] .table th,
html[data-theme="dark"] .chip{
  color:var(--text-2)!important;
}
html[data-theme="dark"] .table th,
html[data-theme="dark"] .invoice-real-preview th{
  background:#17263d!important;
  color:#dce8f8!important;
  border-color:var(--border-soft)!important;
}
html[data-theme="dark"] .table td,
html[data-theme="dark"] .invoice-real-preview td{
  color:var(--text)!important;
  border-color:var(--border-soft)!important;
}
html[data-theme="dark"] .quick-arrow,
html[data-theme="dark"] .cal-close,
html[data-theme="dark"] .receipt-meta span,
html[data-theme="dark"] .restore-file-name,
html[data-theme="dark"] .customer-suggest-item,
html[data-theme="dark"] .compact-check,
html[data-theme="dark"] .preview-footer{
  background:#101c2f!important;
  color:var(--text)!important;
  border-color:var(--border)!important;
}
html[data-theme="dark"] .customer-suggest-item:hover{
  background:rgba(116,167,255,.16)!important;
  border-color:rgba(116,167,255,.38)!important;
}
html[data-theme="dark"] .customer-suggest-box,
html[data-theme="dark"] .pos-customer-suggest-box,
html[data-theme="dark"] .suggest-box{
  background:#132033!important;
  border-color:var(--border)!important;
  box-shadow:0 20px 50px rgba(0,0,0,.38)!important;
}
html[data-theme="dark"] .perm-check,
html[data-theme="dark"] .invoice-logo-drop,
html[data-theme="dark"] .invoice-logo-preview,
html[data-theme="dark"] .restore-file-name{
  background:#101c2f!important;
  border-color:var(--border)!important;
  color:var(--text)!important;
}
html[data-theme="dark"] .real-preview-total{
  background:linear-gradient(135deg,#4f7eff,#2278ff)!important;
  color:#fff!important;
}
html[data-theme="dark"] .invoice-real-preview,
html[data-theme="dark"] .real-invoice-preview,
html[data-theme="dark"] .invoice-preview.real-preview{
  background:#f8fafc!important;
  color:#111827!important;
  border-color:#dbe4f0!important;
}
html[data-theme="dark"] .invoice-real-preview *,
html[data-theme="dark"] .real-invoice-preview *,
html[data-theme="dark"] .invoice-preview.real-preview *{
  color:inherit;
}
html[data-theme="dark"] .invoice-real-preview th,
html[data-theme="dark"] .real-invoice-preview th{background:#f1f5f9!important;color:#475569!important;border-color:#e2e8f0!important;}
html[data-theme="dark"] .invoice-real-preview td,
html[data-theme="dark"] .real-invoice-preview td{color:#0f172a!important;border-color:#e2e8f0!important;}
html[data-theme="dark"] .invoice-preview:not(.real-preview) b,
html[data-theme="dark"] .preview-top b,
html[data-theme="dark"] .preview-row b{color:var(--text)!important;}
html[data-theme="dark"] select[data-geo-province],
html[data-theme="dark"] select[data-geo-city]{background-color:#0f1a2b!important;color:var(--text)!important;}
html[data-theme="dark"] .badge{border-color:#132033!important;color:#fff!important;}
html[data-theme="dark"] .mobile-drawer-close{background:#101c2f!important;color:#fff!important;border-color:var(--border)!important;}
html[data-theme="dark"] .app-shell.sidebar-collapsed>.sidebar .nav-item:hover::after{background:#eaf2ff!important;color:#0f172a!important;}
@media print{
  html[data-theme="dark"] *,
  html[data-theme="dark"] .invoice-real-preview *,
  html[data-theme="dark"] .real-invoice-preview *{text-shadow:none!important;box-shadow:none!important;}
}

/* v1.4.26 security payment polish */
.security-note-card{display:flex;align-items:flex-start;gap:10px;padding:12px 14px;margin-bottom:14px;border:1px solid rgba(37,99,235,.22);border-radius:16px;background:linear-gradient(135deg,rgba(37,99,235,.08),rgba(14,165,233,.06));color:var(--text,#0f172a);line-height:1.9}
.security-note-card b{white-space:nowrap;color:var(--primary,#1d4ed8)}
.security-note-card span{font-size:12px;color:var(--muted,#64748b)}
[data-theme="dark"] .security-note-card{border-color:rgba(96,165,250,.28);background:linear-gradient(135deg,rgba(37,99,235,.16),rgba(14,165,233,.10));color:#e5edf8}
[data-theme="dark"] .security-note-card b{color:#93c5fd}
[data-theme="dark"] .security-note-card span{color:#b6c4d6}

/* v1.4.54 - Deep dark-mode polish: readable dropdowns, products, profile and tables */
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .user-pill,
html[data-theme="dark"] .notice-pop,
html[data-theme="dark"] .profile-summary,
html[data-theme="dark"] .product-toolbar,
html[data-theme="dark"] .variant-row,
html[data-theme="dark"] .variant-rows,
html[data-theme="dark"] .import-box,
html[data-theme="dark"] .backup-restore-panel,
html[data-theme="dark"] .complete-item,
html[data-theme="dark"] .customer-suggest-empty,
html[data-theme="dark"] .customer-suggest-empty.light,
html[data-theme="dark"] .date-picker,
html[data-theme="dark"] .table-wrap{
  background:linear-gradient(180deg,rgba(24,39,64,.96),rgba(17,29,48,.96))!important;
  border-color:var(--border-soft)!important;
  color:var(--text)!important;
  box-shadow:var(--shadow-xs);
}
html[data-theme="dark"] .user-pill *,
html[data-theme="dark"] .profile-summary *,
html[data-theme="dark"] .product-toolbar *,
html[data-theme="dark"] .variant-row *,
html[data-theme="dark"] .complete-item *,
html[data-theme="dark"] .import-box *,
html[data-theme="dark"] .backup-restore-panel *,
html[data-theme="dark"] .table-wrap *,
html[data-theme="dark"] .card:not(.hero) h2,
html[data-theme="dark"] .card:not(.hero) h3,
html[data-theme="dark"] .card:not(.hero) h4,
html[data-theme="dark"] .card:not(.hero) b,
html[data-theme="dark"] .modal:not(.invoice-real-preview) b{
  color:inherit!important;
}
html[data-theme="dark"] .card:not(.hero) .card-sub,
html[data-theme="dark"] .card:not(.hero) .quick-sub,
html[data-theme="dark"] .table .card-sub,
html[data-theme="dark"] td .card-sub,
html[data-theme="dark"] .profile-summary .quick-sub,
html[data-theme="dark"] .product-toolbar .card-sub,
html[data-theme="dark"] .variant-row .card-sub,
html[data-theme="dark"] .complete-item small,
html[data-theme="dark"] .import-box .card-sub,
html[data-theme="dark"] .backup-restore-panel .card-sub{
  color:var(--muted)!important;
}
html[data-theme="dark"] select,
html[data-theme="dark"] .form-grid select,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .modal select,
html[data-theme="dark"] .card select,
html[data-theme="dark"] .invoice-settings-card select,
html[data-theme="dark"] .brand-search-field select,
html[data-theme="dark"] select[data-geo-province],
html[data-theme="dark"] select[data-geo-city]{
  color:var(--text)!important;
  background-color:#0f1a2b!important;
  background-image:url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%23D6E3F5' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")!important;
  background-repeat:no-repeat!important;
  background-position:left 15px center!important;
  background-size:14px 14px!important;
  background-clip:padding-box!important;
  padding-inline-start:42px!important;
  padding-inline-end:42px!important;
  border-color:#38506f!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04),0 0 0 1px rgba(0,0,0,.06)!important;
}
html[data-theme="dark"] select:hover,
html[data-theme="dark"] .field select:hover,
html[data-theme="dark"] .modal select:hover,
html[data-theme="dark"] .card select:hover{
  border-color:#5f86c5!important;
  background-color:#122139!important;
}
html[data-theme="dark"] select:focus,
html[data-theme="dark"] .field select:focus,
html[data-theme="dark"] .modal select:focus,
html[data-theme="dark"] .card select:focus{
  background-image:url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%2374A7FF' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")!important;
  border-color:var(--brand)!important;
}
html[data-theme="dark"] select option,
html[data-theme="dark"] select optgroup{
  background:#101c2f!important;
  color:#eef6ff!important;
}
html[data-theme="dark"] input,
html[data-theme="dark"] textarea{
  background:#0f1a2b!important;
  color:var(--text)!important;
  border-color:#38506f!important;
}
html[data-theme="dark"] input[type="file"]::file-selector-button{
  background:#1b3150!important;
  color:#eef6ff!important;
  border:1px solid #38506f!important;
  border-radius:12px;
  padding:8px 12px;
}
html[data-theme="dark"] .table,
html[data-theme="dark"] table.table,
html[data-theme="dark"] .table-wrap table{
  background:#101c2f!important;
  color:var(--text)!important;
  border-color:var(--border-soft)!important;
}
html[data-theme="dark"] .table thead,
html[data-theme="dark"] .table thead tr,
html[data-theme="dark"] .table th{
  background:#1b2d49!important;
  color:#f2f7ff!important;
  border-color:#324966!important;
}
html[data-theme="dark"] .table tbody tr,
html[data-theme="dark"] .table td{
  background:#101c2f!important;
  color:#eaf2ff!important;
  border-color:#263952!important;
}
html[data-theme="dark"] .table tbody tr:nth-child(even) td{
  background:#132238!important;
}
html[data-theme="dark"] .table tbody tr:hover td{
  background:#1a3152!important;
  color:#fff!important;
}
html[data-theme="dark"] .table td a,
html[data-theme="dark"] .table td button:not(.btn),
html[data-theme="dark"] .table td b,
html[data-theme="dark"] .table td span,
html[data-theme="dark"] .table td div:not(.chip):not(.card-sub){
  color:inherit!important;
}
html[data-theme="dark"] .product-kpis .stat,
html[data-theme="dark"] .dashboard-main-stats .stat,
html[data-theme="dark"] .stat:not(.hero){
  background:linear-gradient(180deg,rgba(24,39,64,.96),rgba(18,31,50,.94))!important;
  border-color:#263952!important;
}
html[data-theme="dark"] .quick-card:not(.hero),
html[data-theme="dark"] .customer-suggest-item,
html[data-theme="dark"] .receipt-archive-card,
html[data-theme="dark"] .permission-role-card,
html[data-theme="dark"] .modal-form-card,
html[data-theme="dark"] .invoice-logo-drop,
html[data-theme="dark"] .invoice-logo-preview,
html[data-theme="dark"] .restore-confirm-card,
html[data-theme="dark"] .restore-file-name{
  background:linear-gradient(180deg,#182740,#111d30)!important;
  border-color:#31435f!important;
  color:var(--text)!important;
}
html[data-theme="dark"] .profile-actions-row .btn.secondary{
  background:#16263f!important;
  color:#edf6ff!important;
  border-color:#38506f!important;
}
html[data-theme="dark"] .profile-actions-row .btn.danger{
  background:linear-gradient(135deg,#e04658,#b9293b)!important;
  color:#fff!important;
  border-color:rgba(255,107,122,.45)!important;
}
html[data-theme="dark"] .pos-hero select,
html[data-theme="dark"] .hero select{
  color:#0f172a!important;
  background-color:#fff!important;
  border-color:#dbe4f0!important;
}
@media(max-width:760px){
  html[data-theme="dark"] select,
  html[data-theme="dark"] .form-grid select,
  html[data-theme="dark"] .field select,
  html[data-theme="dark"] .modal select,
  html[data-theme="dark"] .card select{
    padding-inline-start:38px!important;
    padding-inline-end:38px!important;
    background-position:left 13px center!important;
  }
}
@media print{
  html[data-theme="dark"] .table,
  html[data-theme="dark"] .table th,
  html[data-theme="dark"] .table td,
  html[data-theme="dark"] .table-wrap{
    background:#fff!important;
    color:#111827!important;
    border-color:#e5e7eb!important;
  }
}

/* v1.4.36 secure CSV export + engineered 404 page */
.not-found-page{min-height:420px;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:14px;overflow:hidden;position:relative}
.not-found-page::after{content:"";position:absolute;inset:auto -80px -130px auto;width:280px;height:280px;border-radius:999px;background:radial-gradient(circle,rgba(59,130,246,.16),transparent 68%);pointer-events:none}
.not-found-code{font-size:clamp(58px,10vw,118px);line-height:.9;font-weight:950;letter-spacing:-4px;color:var(--primary);opacity:.95}
.not-found-page h2{margin:0;font-size:clamp(22px,4vw,34px)}
.not-found-page p{max-width:720px;color:var(--muted);font-weight:700;line-height:2}
html[data-theme="dark"] .not-found-page{background:linear-gradient(145deg,#17243a,#0f172a)!important;border-color:#2a3d58!important;color:#edf6ff!important}
html[data-theme="dark"] .not-found-code{color:#7dd3fc!important;text-shadow:0 12px 48px rgba(14,165,233,.24)}
html[data-theme="dark"] .not-found-page p{color:#cbd5e1!important}

/* v1.4.54 - Final UI polish: modal close left, product icon, invoice light preview, live dashboard and sidebar arrow */
.modal-head{position:relative!important;padding-left:74px!important;padding-right:20px!important;justify-content:flex-start!important;min-height:72px;}
.modal-head h2{max-width:calc(100% - 18px);padding-left:10px;}
.modal-head .modal-close-btn{position:absolute!important;left:18px!important;right:auto!important;top:50%!important;transform:translateY(-50%)!important;margin:0!important;z-index:3;}
@media(max-width:640px){.modal-head{padding-left:58px!important;padding-right:14px!important;min-height:60px}.modal-head .modal-close-btn{left:12px!important;width:38px!important;height:38px!important;min-width:38px!important}}

html[data-theme="dark"] .product-thumb,
html[data-theme="dark"] .products-table .product-thumb{
  background:linear-gradient(145deg,#1d3354,#13243d)!important;
  color:#93c5fd!important;
  border-color:#3a5577!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06),0 10px 24px rgba(0,0,0,.20)!important;
}
html[data-theme="dark"] .product-thumb svg,
html[data-theme="dark"] .products-table .product-thumb svg{color:#93c5fd!important;stroke:#93c5fd!important;opacity:1!important;filter:none!important;}
html[data-theme="dark"] .product-thumb img{background:#fff!important;}

/* Invoice previews are print documents, not app cards: keep them light even inside dark mode. */
html[data-theme="dark"] .invoice-real-preview,
html[data-theme="dark"] .real-invoice-preview,
html[data-theme="dark"] .invoice-preview.real-preview{
  background:#fff!important;
  color:#111827!important;
  border-color:#cbd5e1!important;
  box-shadow:0 10px 30px rgba(15,23,42,.10)!important;
  filter:grayscale(.06) contrast(1.04)!important;
}
html[data-theme="dark"] .invoice-real-preview.store{background:#fff!important;}
html[data-theme="dark"] .invoice-real-preview.postal{background:#fff!important;border-color:#94a3b8!important;}
html[data-theme="dark"] .invoice-real-preview *,
html[data-theme="dark"] .real-invoice-preview *,
html[data-theme="dark"] .invoice-preview.real-preview *{
  color:#111827!important;
  text-shadow:none!important;
  box-shadow:none!important;
}
html[data-theme="dark"] .invoice-real-preview th,
html[data-theme="dark"] .real-invoice-preview th,
html[data-theme="dark"] .invoice-preview.real-preview th{background:#f3f4f6!important;color:#374151!important;border-color:#d1d5db!important;}
html[data-theme="dark"] .invoice-real-preview td,
html[data-theme="dark"] .real-invoice-preview td,
html[data-theme="dark"] .invoice-preview.real-preview td{background:#fff!important;color:#111827!important;border-color:#d1d5db!important;}
html[data-theme="dark"] .real-preview-total{background:#111827!important;color:#fff!important;border-color:#111827!important;}
html[data-theme="dark"] .real-preview-total *,
html[data-theme="dark"] .real-preview-total b,
html[data-theme="dark"] .real-preview-total span{color:#fff!important;}
html[data-theme="dark"] .real-preview-note,
html[data-theme="dark"] .real-preview-sign,
html[data-theme="dark"] .preview-footer{background:#fff!important;color:#374151!important;border-color:#d1d5db!important;}
@media print{
  .invoice-real-preview,
  .real-invoice-preview,
  .invoice-preview.real-preview,
  html[data-theme="dark"] .invoice-real-preview,
  html[data-theme="dark"] .real-invoice-preview,
  html[data-theme="dark"] .invoice-preview.real-preview{background:#fff!important;color:#000!important;border-color:#999!important;filter:grayscale(1) contrast(1.18)!important;box-shadow:none!important;}
  .invoice-real-preview *,
  .real-invoice-preview *,
  .invoice-preview.real-preview *,
  html[data-theme="dark"] .invoice-real-preview *,
  html[data-theme="dark"] .real-invoice-preview *,
  html[data-theme="dark"] .invoice-preview.real-preview *{color:#000!important;text-shadow:none!important;box-shadow:none!important;}
  .invoice-real-preview th,
  .real-invoice-preview th,
  .invoice-preview.real-preview th{background:#eee!important;color:#000!important;border-color:#888!important;}
  .invoice-real-preview td,
  .real-invoice-preview td,
  .invoice-preview.real-preview td{background:#fff!important;color:#000!important;border-color:#999!important;}
  .real-preview-total{background:#111!important;color:#fff!important;border-color:#111!important;}
  .real-preview-total *{color:#fff!important;}
}

html[data-theme="dark"] .live-dashboard-card .section-head,
html[data-theme="dark"] .live-dashboard-card .section-head *{color:var(--text)!important;}
html[data-theme="dark"] .live-dashboard-card .card-sub{color:#bfd0e7!important;}
html[data-theme="dark"] #liveDashboardTime,
html[data-theme="dark"] .soft-badge#liveDashboardTime{background:#1e3354!important;color:#eaf2ff!important;border-color:#3a5577!important;}
html[data-theme="dark"] .live-pill{background:linear-gradient(180deg,#182740,#111d30)!important;border-color:#31435f!important;color:var(--text)!important;}
html[data-theme="dark"] .live-pill b{color:#bfd0e7!important;}
html[data-theme="dark"] .live-pill strong{color:#ffffff!important;}
html[data-theme="dark"] .live-pill-icon{background:rgba(123,179,255,.16)!important;color:#93c5fd!important;border:1px solid rgba(147,197,253,.20)!important;}
html[data-theme="dark"] .live-pill.ok .live-pill-icon{background:rgba(61,214,157,.16)!important;color:#7df2bf!important;border-color:rgba(125,242,191,.22)!important;}

/* v1.5.0 - executive dashboard redesign */
.dashboard-command{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:18px;margin-bottom:16px;border:1px solid var(--border);border-radius:24px;padding:18px 20px;background:linear-gradient(135deg,#ffffff,#f6f9ff);box-shadow:var(--shadow-sm)}
.dashboard-command.danger{border-color:#fecaca;background:linear-gradient(135deg,#fff8f7,#fff)}
.dashboard-command.warn{border-color:#fed7aa;background:linear-gradient(135deg,#fffbeb,#fff)}
.dashboard-command.ok{border-color:#bbf7d0;background:linear-gradient(135deg,#f0fdf4,#fff)}
.dashboard-command-heading{display:flex;align-items:center;justify-content:flex-start;gap:10px;flex-wrap:wrap;min-width:0}
.dashboard-state-chip{display:inline-flex;align-items:center;justify-content:center;width:max-content;max-width:100%;min-height:28px;border-radius:999px;padding:6px 12px;font-size:12px;font-weight:950;line-height:1.5;white-space:nowrap}.dashboard-state-chip.danger{background:var(--danger-soft);color:#b42318}.dashboard-state-chip.warn{background:var(--warn-soft);color:#b45309}.dashboard-state-chip.ok{background:var(--ok-soft);color:#047857}
.dashboard-command-copy{display:grid;gap:5px;min-width:0}.dashboard-command-copy>.chip{justify-self:end;width:max-content;max-width:100%}.dashboard-command-copy h2{margin:0;color:#0f172a;font-size:24px;line-height:1.6;font-weight:950}.dashboard-command-copy p{margin:0;color:#475569;line-height:1.9}.dashboard-command-actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.dashboard-kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:16px}.dash-kpi{appearance:none;border:1px solid var(--border);border-radius:22px;background:#fff;padding:15px;display:grid;grid-template-columns:50px minmax(0,1fr);gap:12px;align-items:center;text-align:right;cursor:pointer;box-shadow:var(--shadow-xs);transition:.16s ease;color:var(--text)}.dash-kpi:hover{transform:translateY(-2px);box-shadow:var(--shadow-sm);border-color:#bfd3ff}.dash-kpi-icon{width:50px;height:50px;border-radius:17px;display:grid;place-items:center;background:var(--info-soft);color:var(--info);font-size:23px}.dash-kpi.ok .dash-kpi-icon{background:var(--ok-soft);color:var(--ok)}.dash-kpi.warn .dash-kpi-icon{background:var(--warn-soft);color:var(--warn)}.dash-kpi.danger .dash-kpi-icon{background:var(--danger-soft);color:var(--danger)}.dash-kpi b{display:block;color:#64748b;font-size:12px;line-height:1.6}.dash-kpi strong{display:block;color:#0f172a;font-size:22px;font-weight:950;line-height:1.45;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dash-kpi em{display:block;color:#64748b;font-style:normal;font-size:11.5px;line-height:1.7}
.dashboard-layout{display:grid;grid-template-columns:1.25fr .95fr;gap:16px;align-items:stretch}.dash-panel{min-height:auto;overflow:visible}.section-head.compact{margin-bottom:12px}.dash-trend-panel{grid-row:span 2}.dash-trend-bars{height:220px;display:grid;grid-template-columns:repeat(14,minmax(0,1fr));gap:7px;align-items:end;padding:14px 6px 2px;border:1px solid var(--border-soft);border-radius:18px;background:linear-gradient(180deg,#f8fbff,#fff)}.dash-trend-day{height:100%;display:grid;grid-template-rows:minmax(0,1fr) 22px;gap:6px;align-items:end;text-align:center;min-width:0}.dash-trend-day i{display:block;width:100%;max-width:24px;margin:0 auto;border-radius:999px 999px 7px 7px;background:linear-gradient(180deg,#1f5eff,#7aa8ff);box-shadow:0 10px 20px rgba(31,94,255,.18)}.dash-trend-day span{font-size:10px;color:#64748b;direction:ltr;text-align:center;white-space:nowrap}.dash-trend-foot{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:12px}
.dash-channel-list{display:grid;gap:10px}.dash-channel-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(110px,.75fr) 28px;gap:10px;align-items:center;border:1px solid var(--border-soft);border-radius:16px;padding:10px 12px;background:#fff}.dash-channel-row b{display:block;color:#0f172a;line-height:1.7;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dash-channel-row span{display:block;color:#64748b;font-size:11.5px;line-height:1.7;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dash-channel-meter{height:9px;background:#eef4ff;border-radius:99px;overflow:hidden}.dash-channel-meter i{display:block;height:100%;border-radius:99px;background:linear-gradient(90deg,#1f5eff,#7aa8ff)}.dash-channel-row em{font-style:normal;color:#94a3b8;font-weight:950;text-align:center}
.dash-ops-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.dash-status-box{margin-top:12px;display:grid;gap:8px}.dash-status-line{display:flex;align-items:center;justify-content:space-between;gap:10px;border:1px solid var(--border-soft);border-radius:14px;padding:9px 11px;background:#f8fbff}.dash-status-line span{color:#475569;font-size:12px}.dash-status-line b{color:#0f172a}
.dashboard-bottom-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:16px}.dashboard-actions-panel{margin-top:16px}.dashboard-actions-panel .quick-card{min-height:86px}
html[data-theme="dark"] .dashboard-command,html[data-theme="dark"] .dash-kpi,html[data-theme="dark"] .dash-panel,html[data-theme="dark"] .dash-channel-row,html[data-theme="dark"] .dash-status-line{background:linear-gradient(180deg,#142238,#101b2d)!important;border-color:#31435f!important;color:var(--text)!important;box-shadow:none!important}html[data-theme="dark"] .dashboard-command-copy h2,html[data-theme="dark"] .dash-kpi strong,html[data-theme="dark"] .dash-channel-row b,html[data-theme="dark"] .dash-status-line b{color:#fff!important}html[data-theme="dark"] .dashboard-command-copy p,html[data-theme="dark"] .dash-kpi b,html[data-theme="dark"] .dash-kpi em,html[data-theme="dark"] .dash-channel-row span,html[data-theme="dark"] .dash-status-line span{color:#bfd0e7!important}html[data-theme="dark"] .dash-trend-bars{background:linear-gradient(180deg,#111d30,#0f1a2b)!important;border-color:#31435f!important}html[data-theme="dark"] .dash-channel-meter{background:#20324f!important}
@media(max-width:1180px){.dashboard-layout{grid-template-columns:1fr}.dash-trend-panel{grid-row:auto}.dashboard-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.dashboard-command{grid-template-columns:1fr;padding:16px}.dashboard-command-heading{align-items:flex-start}.dashboard-command-copy h2{font-size:20px}.dashboard-command-actions{justify-content:stretch}.dashboard-command-actions .btn{flex:1}.dashboard-kpi-grid{grid-template-columns:1fr 1fr;gap:9px}.dash-kpi{grid-template-columns:40px minmax(0,1fr);padding:11px;border-radius:18px}.dash-kpi-icon{width:40px;height:40px;border-radius:14px;font-size:19px}.dash-kpi strong{font-size:16px}.dash-kpi b,.dash-kpi em{font-size:10.5px}.dash-trend-bars{height:160px;gap:4px;padding:10px 4px 0}.dash-trend-day span{font-size:9px}.dash-trend-foot,.dash-ops-grid,.dashboard-bottom-grid{grid-template-columns:1fr}.dash-channel-row{grid-template-columns:1fr;gap:7px}.dash-channel-row em{display:none}.dashboard-actions-panel .grid-3{grid-template-columns:1fr!important}}

.brand{position:relative!important;padding-left:62px!important;}
.sidebar-collapse-btn{position:absolute!important;left:14px!important;right:auto!important;top:50%!important;transform:translateY(-50%)!important;margin:0!important;z-index:4;}
.sidebar-collapse-btn svg{transform:rotate(180deg)!important;}
.app-shell.sidebar-collapsed>.sidebar .sidebar-collapse-btn{left:50%!important;top:74px!important;transform:translateX(-50%)!important;width:30px!important;height:30px!important;min-width:30px!important;}
.app-shell.sidebar-collapsed>.sidebar .sidebar-collapse-btn svg{transform:rotate(0deg)!important;}
.app-shell.sidebar-collapsed>.sidebar .brand{padding-left:12px!important;padding-bottom:42px!important;min-height:116px!important;}
.app-shell.sidebar-collapsed>.sidebar .nav{padding-top:8px!important;}
html[data-theme="dark"] .sidebar-collapse-btn{background:#182740!important;color:#eaf2ff!important;border-color:#38506f!important;}
html[data-theme="dark"] .app-shell.sidebar-collapsed>.sidebar .sidebar-collapse-btn{background:#1e3354!important;color:#93c5fd!important;border-color:#3a5577!important;}

/* v1.4.36 quick product entry UX */
.quick-stock-card{border:1px solid #dbeafe;background:linear-gradient(180deg,#ffffff,#f8fbff)}
.quick-stock-card .section-head{gap:14px;align-items:flex-start}.quick-stock-card .card-title{margin:0}.quick-stock-grid .field input[readonly]{background:#f8fafc;color:#475569;border-style:dashed}
html[data-theme="dark"] .quick-stock-card{background:linear-gradient(180deg,#142238,#101b2d)!important;border-color:#31435f!important;color:var(--text)!important;box-shadow:none!important}
html[data-theme="dark"] .quick-stock-card .card-title{color:#f8fbff!important}
html[data-theme="dark"] .quick-stock-card .card-sub{color:#bfd0e7!important}
html[data-theme="dark"] .quick-stock-grid .field input[readonly]{background:#17243a!important;color:#dbeafe!important;border-color:#31435f!important}
@media(max-width:760px){.quick-stock-grid{grid-template-columns:1fr!important}.quick-stock-card .section-head{display:grid!important}.quick-stock-card .chip{width:max-content}}

/* v1.4.54 - Dark calendar, settings polish and numeric safety */
html[data-theme="dark"] .calendar-pop,
html[data-theme="dark"] .calendar-pop.calendar-pop-floating{
  background:linear-gradient(180deg,#142238,#0f1a2b)!important;
  color:#eef6ff!important;
  border:1px solid #3a5577!important;
  box-shadow:0 28px 90px rgba(0,0,0,.55)!important;
}
html[data-theme="dark"] .cal-head{
  color:#f8fbff!important;
  border-bottom:1px solid #2f4664!important;
}
html[data-theme="dark"] .cal-head b{color:#fff!important;}
html[data-theme="dark"] .cal-close{
  background:#1c3150!important;
  color:#fff!important;
  border:1px solid #4b6f9f!important;
}
html[data-theme="dark"] .cal-grid{background:transparent!important;}
html[data-theme="dark"] .cal-week{
  color:#9fc5ff!important;
  background:#172a46!important;
  border:1px solid #2c4361!important;
  border-radius:10px!important;
}
html[data-theme="dark"] .cal-day{
  background:#0f1a2b!important;
  color:#eef6ff!important;
  border:1px solid #2d4565!important;
  box-shadow:none!important;
}
html[data-theme="dark"] .cal-day:hover,
html[data-theme="dark"] .cal-day:focus{
  background:#2563eb!important;
  color:#fff!important;
  border-color:#74a7ff!important;
}
.money-input{font-variant-numeric:tabular-nums;letter-spacing:.01em;}
.money-input:focus{direction:ltr!important;text-align:left!important;}
.settings-grid .complete-list{grid-template-columns:repeat(4,minmax(0,1fr));}
.settings-summary-card{overflow:visible;}
html[data-theme="dark"] .settings-grid .card,
html[data-theme="dark"] .settings-summary-card{
  background:linear-gradient(180deg,rgba(24,39,64,.96),rgba(17,29,48,.96))!important;
  color:var(--text)!important;
  border-color:#31435f!important;
}
html[data-theme="dark"] .settings-grid .card h2,
html[data-theme="dark"] .settings-summary-card h2{color:#eef6ff!important;}
@media(max-width:900px){.settings-grid .complete-list{grid-template-columns:repeat(2,minmax(0,1fr));}}

/* Final clean release v1.4.36 - universal live table filters */
.table-live-filter{display:flex;align-items:center;gap:10px;margin:12px 0 10px;padding:9px 12px;border:1px solid var(--border);border-radius:16px;background:rgba(255,255,255,.78);box-shadow:0 10px 24px rgba(15,23,42,.05)}
.table-live-filter .filter-icon{width:30px;height:30px;border-radius:10px;display:grid;place-items:center;color:var(--primary);background:rgba(37,99,235,.09);flex:0 0 auto}
.table-live-filter .filter-icon svg{width:17px;height:17px}.table-live-filter input{border:0!important;background:transparent!important;box-shadow:none!important;padding:7px 4px!important;min-height:34px;flex:1;color:var(--text)!important}.table-live-filter input:focus{outline:0}.table-live-filter .filter-count{font-size:12px;font-weight:900;color:var(--muted);white-space:nowrap}
html[data-theme="dark"] .table-live-filter{background:rgba(19,32,51,.92);border-color:rgba(116,167,255,.24);box-shadow:0 14px 30px rgba(0,0,0,.24)}
html[data-theme="dark"] .table-live-filter .filter-icon{background:rgba(116,167,255,.16);color:#b9d4ff}html[data-theme="dark"] .table-live-filter input{color:#f8fbff!important}html[data-theme="dark"] .table-live-filter input::placeholder{color:#8ea5c6!important}
.tiny-pre{white-space:pre-wrap;line-height:1.9;border:1px solid var(--border);border-radius:14px;padding:10px 12px;background:rgba(248,250,252,.78);font-size:12px}html[data-theme="dark"] .tiny-pre{background:#0f172a;border-color:rgba(116,167,255,.2);color:#e6eefb}
@media(max-width:720px){.table-live-filter{border-radius:14px;padding:8px 10px}.table-live-filter .filter-count{display:none}}

/* v1.4.54 shipment/order final UX */
.orders-table{table-layout:auto!important;min-width:1320px!important;}
.orders-table th,.orders-table td{overflow:visible!important;text-overflow:clip!important;}
.orders-table th:nth-child(6),.orders-table td:nth-child(6){width:420px!important;min-width:420px!important;}
.order-actions{display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:6px!important;flex-wrap:wrap!important;white-space:normal!important;line-height:1.4!important;overflow:visible!important;}
.order-actions .btn{margin:0!important;min-width:max-content!important;box-shadow:0 8px 18px rgba(31,94,255,.12)!important;}
.shipping-stack{display:grid;grid-template-columns:1fr;gap:16px;width:100%;}
.shipping-full-card{width:100%;overflow:visible!important;}
.shipments-table-wrap{width:100%;overflow:auto;}
.shipments-table{min-width:1280px;table-layout:auto;}
.shipments-table td,.shipments-table th{vertical-align:middle!important;}
.shipments-table select,.shipments-table input{min-height:38px;border-radius:12px;}
.shipments-table td:nth-child(3){min-width:260px;}
.shipments-table td:nth-child(5){min-width:180px;}
.shipment-actions{display:flex;gap:6px;flex-wrap:wrap;align-items:center;min-width:300px;}
.ready-shipping-list{display:grid;gap:12px;}
.ready-shipping-card{display:grid;grid-template-columns:54px minmax(220px,1fr) minmax(420px,auto);gap:14px;align-items:center;border:1px solid var(--border);border-radius:20px;background:linear-gradient(180deg,#fff,#f8fbff);padding:14px;box-shadow:var(--shadow-xs);}
.ready-order-main{min-width:0;line-height:1.9;}
.ready-ship-controls{display:grid;grid-template-columns:minmax(140px,1fr) minmax(120px,160px) minmax(140px,1fr) auto;gap:8px;align-items:center;}
.shipping-methods-rows{display:grid;gap:10px;margin-top:12px;}
.shipping-method-row{display:grid;grid-template-columns:120px 1fr 1fr 150px 86px auto;gap:9px;align-items:end;border:1px solid var(--border);border-radius:18px;background:#fff;padding:12px;}
.ship-active{display:flex;align-items:center;gap:7px;font-weight:850;white-space:nowrap;height:44px;}
.ship-active input{width:16px;height:16px;min-height:0;accent-color:var(--brand);}
.app-shell.sidebar-collapsed>.sidebar .nav-item{position:relative;}
.app-shell.sidebar-collapsed>.sidebar .nav-item:hover::after,
.app-shell.sidebar-collapsed>.sidebar .nav-item:focus-visible::after{content:attr(data-label)!important;position:fixed;right:116px;z-index:99999;background:#0f172a;color:#fff;border-radius:12px;padding:8px 11px;font-size:12px;font-weight:900;white-space:nowrap;box-shadow:0 12px 28px rgba(15,23,42,.22);pointer-events:none;}
html[data-theme="dark"] .ready-shipping-card,html[data-theme="dark"] .shipping-method-row{background:#14233a!important;border-color:#2b4161!important;}
html[data-theme="dark"] .app-shell.sidebar-collapsed>.sidebar .nav-item:hover::after,html[data-theme="dark"] .app-shell.sidebar-collapsed>.sidebar .nav-item:focus-visible::after{background:#eaf2ff!important;color:#0f172a!important;}
@media(max-width:980px){.ready-shipping-card{grid-template-columns:44px minmax(0,1fr);}.ready-ship-controls{grid-column:1/-1;grid-template-columns:1fr 1fr;}.shipping-method-row{grid-template-columns:1fr 1fr;}.ship-active{height:auto}.shipment-actions{min-width:240px}.orders-table{min-width:1180px!important}.orders-table th:nth-child(6),.orders-table td:nth-child(6){width:330px!important;min-width:330px!important;}}
@media(max-width:640px){.ready-ship-controls{grid-template-columns:1fr}.shipping-method-row{grid-template-columns:1fr}.shipment-actions{display:grid;grid-template-columns:1fr 1fr}.shipment-actions .btn{width:100%;}.order-actions{display:grid!important;grid-template-columns:1fr 1fr!important}.order-actions .btn{width:100%;}}

/* v1.4.54 - Orders table action alignment fix: keep TDs as table-cells and wrap buttons inside a safe flex wrapper */
.orders-table{
  table-layout:fixed!important;
  min-width:1440px!important;
}
.orders-table th:nth-child(1),.orders-table td:nth-child(1){width:190px!important;min-width:190px!important;}
.orders-table th:nth-child(2),.orders-table td:nth-child(2){width:230px!important;min-width:230px!important;}
.orders-table th:nth-child(3),.orders-table td:nth-child(3){width:180px!important;min-width:180px!important;}
.orders-table th:nth-child(4),.orders-table td:nth-child(4){width:240px!important;min-width:240px!important;}
.orders-table th:nth-child(5),.orders-table td:nth-child(5){width:230px!important;min-width:230px!important;}
.orders-table th:nth-child(6),.orders-table td:nth-child(6){width:370px!important;min-width:370px!important;}
.orders-table td.order-customer,
.orders-table td.order-channel,
.orders-table td.order-amount,
.orders-table td.order-status,
.orders-table td.order-actions{
  display:table-cell!important;
  vertical-align:middle!important;
}
.orders-table td.order-actions{
  text-align:right!important;
  white-space:normal!important;
  overflow:visible!important;
  line-height:1.45!important;
  padding-block:12px!important;
}
.orders-table .order-actions-list{
  display:flex!important;
  flex-wrap:wrap!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:7px!important;
  direction:rtl!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  overflow:visible!important;
}
.orders-table .order-actions-list .btn{
  margin:0!important;
  flex:0 0 auto!important;
  min-width:max-content!important;
  max-width:100%!important;
  line-height:1.55!important;
  white-space:nowrap!important;
}
.orders-table .order-actions-list .btn.danger{min-width:52px!important;}
.orders-table .order-status .chip{vertical-align:middle!important;}
@media(max-width:760px){
  .orders-table{min-width:1260px!important;}
  .orders-table th:nth-child(6),.orders-table td:nth-child(6){width:330px!important;min-width:330px!important;}
  .orders-table .order-actions-list{gap:6px!important;}
  .orders-table .order-actions-list .btn{padding-inline:9px!important;font-size:11.5px!important;}
}



/* v1.4.54 - UX polish: exact collapsed sidebar tooltip, closable Persian alerts, internal dialogs and autoscan */
.sidebar-tooltip{position:fixed;z-index:9000;display:none;align-items:center;min-height:34px;max-width:240px;padding:7px 11px;border-radius:13px;background:#0f172a;color:#fff;font-size:12px;font-weight:900;line-height:1.8;white-space:nowrap;box-shadow:0 16px 36px rgba(15,23,42,.22);pointer-events:none;transform:translateY(-50%);direction:rtl;text-align:right;}
.sidebar-tooltip.show{display:flex;}
.sidebar-tooltip:after{content:"";position:absolute;top:50%;right:-6px;transform:translateY(-50%);border-width:6px 0 6px 6px;border-style:solid;border-color:transparent transparent transparent #0f172a;}
@media(min-width:981px){.app-shell.sidebar-collapsed>.sidebar .nav-item:hover::after{display:none!important;content:none!important;}}
.toast{align-items:center;justify-content:space-between;gap:12px;min-width:min(420px,calc(100vw - 32px));}
.toast:not(.show){display:none!important;}
.toast.show{display:flex!important;}
.toast-message{min-width:0;line-height:1.9;}
.toast-close,.notice-close,.alert-dismiss{width:28px;height:28px;min-width:28px;border:1px solid rgba(148,163,184,.35);border-radius:10px;background:rgba(255,255,255,.86);color:#334155;display:grid;place-items:center;font-size:18px;font-weight:950;line-height:1;cursor:pointer;box-shadow:var(--shadow-xs);}
.toast-close:hover,.notice-close:hover,.alert-dismiss:hover{background:#fff1f0;border-color:#fecaca;color:#dc2626;}
.notice-head{display:flex;align-items:center;gap:10px;}
.notice-head .notice-close{margin-inline-start:auto;}
.notice-alert-card{grid-template-columns:auto minmax(0,1fr) auto!important;align-items:start;}
.alert-card{grid-template-columns:52px minmax(0,1fr) auto!important;margin-bottom:8px;cursor:default;}
.alert-card .alert-dismiss{align-self:start;justify-self:end;}
.system-dialog{display:grid;grid-template-columns:54px minmax(0,1fr);gap:14px;align-items:start;border:1px solid var(--border);border-radius:22px;background:linear-gradient(180deg,#fff,#f8fbff);padding:16px;}
.system-dialog p{margin:0;line-height:2;color:var(--text);font-weight:850;}
html[data-theme="dark"] .sidebar-tooltip{background:#eaf2ff;color:#0f172a;border:1px solid rgba(116,167,255,.28);box-shadow:0 18px 42px rgba(0,0,0,.36);}
html[data-theme="dark"] .sidebar-tooltip:after{border-color:transparent transparent transparent #eaf2ff;}
html[data-theme="dark"] .toast-close,html[data-theme="dark"] .notice-close,html[data-theme="dark"] .alert-dismiss{background:#101c2f;color:#eaf2ff;border-color:var(--border);}
html[data-theme="dark"] .toast-close:hover,html[data-theme="dark"] .notice-close:hover,html[data-theme="dark"] .alert-dismiss:hover{background:rgba(255,107,122,.16);color:#ffacb5;border-color:rgba(255,107,122,.38);}
html[data-theme="dark"] .system-dialog{background:linear-gradient(180deg,rgba(24,39,64,.96),rgba(17,29,48,.96));border-color:var(--border-soft);}
html[data-theme="dark"] .alert-card .quick-icon[style],html[data-theme="dark"] .notice-head .stat-icon[style]{background:rgba(255,107,122,.16)!important;color:#ff8d99!important;border-color:rgba(255,107,122,.24)!important;}
@media(max-width:760px){.sidebar-tooltip{display:none!important}.alert-card{grid-template-columns:38px minmax(0,1fr) auto!important}.toast{left:12px!important;right:12px!important;bottom:82px!important;min-width:0!important}}

/* v1.4.54 - Orders search, maintenance action alignment and safe batch label UX */
.orders-live-filter{margin:0 0 14px!important;background:linear-gradient(180deg,#fff,#f8fbff)!important;border-color:#dbe7ff!important;}
.orders-live-filter .filter-icon{color:#1f5eff!important;background:#eef5ff!important;}
.maintenance-action-row{position:relative;display:flex;align-items:center;gap:10px;flex-wrap:wrap;width:100%;margin-top:16px;}
.backup-actions-row{justify-content:flex-start;}
.customer-import-actions{justify-content:flex-end;}
.backup-actions-row .btn,.customer-import-actions .btn{min-width:150px;}
.backup-restore-panel{display:block;}
html[data-theme="dark"] .orders-live-filter{background:linear-gradient(180deg,#182740,#111d30)!important;border-color:#31435f!important;}
html[data-theme="dark"] .orders-live-filter .filter-icon{background:rgba(116,167,255,.16)!important;color:#b9d4ff!important;}
html[data-theme="dark"] .maintenance-action-row .btn.secondary{background:#14233a!important;color:#b9d4ff!important;border-color:#3a5577!important;}
@media(max-width:720px){.maintenance-action-row{justify-content:stretch!important}.maintenance-action-row .btn{flex:1 1 100%;min-width:0;width:100%;}}
.orders-search-panel{display:flex;align-items:center;gap:10px;margin:0 0 14px;padding:10px 12px;border:1px solid #dbe7ff;border-radius:18px;background:linear-gradient(180deg,#fff,#f8fbff);box-shadow:0 10px 24px rgba(15,23,42,.05)}
.orders-search-panel .filter-icon{width:32px;height:32px;border-radius:11px;display:grid;place-items:center;color:#1f5eff;background:#eef5ff;flex:0 0 auto}.orders-search-panel .filter-icon svg{width:17px;height:17px}.orders-search-panel input{border:0!important;background:transparent!important;box-shadow:none!important;padding:7px 4px!important;min-height:34px;flex:1}.orders-search-panel .filter-count{font-size:12px;font-weight:900;color:var(--muted);white-space:nowrap}
html[data-theme="dark"] .orders-search-panel{background:linear-gradient(180deg,#182740,#111d30)!important;border-color:#31435f!important;box-shadow:0 14px 30px rgba(0,0,0,.24)}html[data-theme="dark"] .orders-search-panel .filter-icon{background:rgba(116,167,255,.16)!important;color:#b9d4ff!important}html[data-theme="dark"] .orders-search-panel input{color:#f8fbff!important}html[data-theme="dark"] .orders-search-panel input::placeholder{color:#8ea5c6!important}
@media(max-width:720px){.orders-search-panel{display:grid;grid-template-columns:auto 1fr;gap:8px}.orders-search-panel .btn{width:100%}.orders-search-panel .filter-count{display:none}}

/* v1.4.54 - Engineered returns, Jalali reports, shipping tabs and Persian logs */
.report-actions-row{display:flex;align-items:center;justify-content:flex-start;gap:10px;flex-wrap:wrap;margin-top:18px;direction:ltr}
.report-actions-row .btn{direction:rtl}
.report-preset-btn.active{background:linear-gradient(135deg,#16a34a,#22c55e)!important;color:#fff!important;border-color:transparent!important;box-shadow:0 12px 25px rgba(22,163,74,.20)!important}
.report-apply-btn{order:0}
.shipping-tabs{margin-bottom:14px}
.shipping-method-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;border:1px solid var(--border);border-radius:18px;padding:12px;background:linear-gradient(180deg,#fff,#f8fbff);margin-bottom:12px}
.tabbed-shipping-methods{grid-template-columns:1fr}
.shipping-method-card{display:grid!important;grid-template-columns:minmax(180px,240px) minmax(0,1fr) auto!important;align-items:center!important;gap:14px!important;padding:14px!important}
.shipping-method-title{display:flex;align-items:center;gap:10px;min-width:0}
.shipping-method-fields{display:grid;grid-template-columns:1fr 1fr 1fr 150px;gap:10px}
.shipping-method-fields .field{display:flex}
.shipping-method-actions{display:flex;align-items:center;gap:8px}
.return-flow-card{display:grid;gap:14px}
.return-hint-card{border:1px dashed #bfdbfe;background:#eff6ff;color:#1e3a8a;border-radius:16px;padding:12px;line-height:2;font-weight:850}
.returns-table{min-width:1180px}
.returns-table td,.returns-table th{vertical-align:top}
.audit-message-fa{line-height:1.9;font-weight:850;color:var(--text)}
html[data-theme="dark"] .shipping-method-toolbar,html[data-theme="dark"] .return-hint-card{background:#14233a!important;border-color:#31435f!important;color:#dbeafe!important}
html[data-theme="dark"] .report-preset-btn.active{background:linear-gradient(135deg,#15803d,#22c55e)!important;color:#fff!important}
@media(max-width:980px){.shipping-method-card{grid-template-columns:1fr!important}.shipping-method-fields{grid-template-columns:1fr 1fr}.shipping-method-actions{justify-content:flex-start}}
@media(max-width:640px){.shipping-method-fields{grid-template-columns:1fr}.report-actions-row{justify-content:stretch}.report-actions-row .btn{flex:1 1 100%}}

/* v1.4.54 - exact close-button centering, readable SMS previews and postal label polish */
.toast-close,.notice-close,.alert-dismiss{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:30px!important;
  height:30px!important;
  min-width:30px!important;
  padding:0!important;
  line-height:1!important;
  text-align:center!important;
  font-size:18px!important;
  font-weight:950!important;
  flex:0 0 30px!important;
}
.toast{padding-inline:14px 10px!important;}
.toast-message{display:block;flex:1;color:inherit;font-weight:850;}
.notice-alert-card .notice-close,.notice-alert-card .alert-dismiss,.alert-card .alert-dismiss{align-self:center!important;justify-self:end!important;}
#smsTestResult .tiny-pre,.sms-readable-preview{
  background:#ffffff!important;
  color:#0f172a!important;
  border:1px solid #cbd5e1!important;
  box-shadow:var(--shadow-xs);
  direction:rtl!important;
  text-align:right!important;
  unicode-bidi:plaintext;
}
html[data-theme="dark"] #smsTestResult .tiny-pre,html[data-theme="dark"] .sms-readable-preview{
  background:#08111f!important;
  color:#f8fafc!important;
  border-color:rgba(116,167,255,.32)!important;
}
.label-print-hint{margin-top:10px;color:var(--muted);font-size:12px;line-height:1.9}

/* v1.4.54 - Safe backup/update/restore maintenance UX */
.safe-maintenance-panel{border-color:#bfdbfe;background:linear-gradient(180deg,#eff6ff,#ffffff)}
.maintenance-command-list{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px;direction:ltr;justify-content:flex-start}
.maintenance-command-list code,.mono-inline{font-family:var(--font-mono-fa)!important;background:#0f172a;color:#e2e8f0;border-radius:10px;padding:4px 8px;font-size:12px;direction:ltr;display:inline-block}
html[data-theme="dark"] .safe-maintenance-panel{background:linear-gradient(180deg,rgba(37,99,235,.16),rgba(15,23,42,.92));border-color:rgba(96,165,250,.55)}
html[data-theme="dark"] .maintenance-command-list code,html[data-theme="dark"] .mono-inline{background:#020617;color:#dbeafe;border:1px solid rgba(148,163,184,.25)}

/* v1.4.54 - shipping settings real tabs and order edit polish */
.shipping-settings-panel{display:none;}
.shipping-settings-panel.active{display:block;}
.shipping-tabs .invoice-tab-btn[data-ship-settings-tab="shipping"]{border-style:dashed;}
.order-edit-modal .edit-order-items input{min-width:90px;}
.order-edit-modal .return-hint-card{margin-bottom:8px;}
.edit-order-items table{min-width:760px;}
html[data-theme="dark"] .shipping-settings-panel .return-hint-card{background:#14233a!important;border-color:#31435f!important;color:#dbeafe!important;}

/* v1.5.0 - compact shipping methods settings */
.shipping-settings-redesign{padding:20px!important;overflow:hidden}
.shipping-settings-redesign .shipping-settings-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:14px}
.shipping-settings-title{display:flex;align-items:center;gap:12px;min-width:0}
.shipping-settings-title h2{margin:0;font-size:24px;line-height:1.4}
.shipping-settings-title .quick-icon{width:46px;height:46px;min-width:46px;border-radius:16px;background:#eef5ff;color:#1f5eff}
.shipping-settings-summary{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.shipping-settings-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:6px;border:1px solid var(--border);border-radius:18px;background:#f8fbff;margin:8px 0 14px}
.shipping-tab{min-height:42px;border:0;border-radius:13px;background:transparent;color:#40516a;font-weight:950;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:8px;white-space:nowrap}
.shipping-tab svg{width:18px;height:18px}
.shipping-tab.active{background:#1f5eff;color:#fff;box-shadow:0 10px 24px rgba(31,94,255,.20)}
.shipping-tab.ghost{border:1px dashed #bdd3f6;background:#fff}
.shipping-method-toolbar.compact{border:1px solid #d8e5f7;border-radius:16px;background:#fff;padding:10px 12px;margin-bottom:10px}
.shipping-method-toolbar.compact b{display:block;font-size:14px}
.tabbed-shipping-methods.compact{display:grid;gap:9px;margin-top:0}
.shipping-method-card.compact{grid-template-columns:minmax(170px,220px) minmax(0,1fr) auto!important;gap:12px!important;padding:11px 12px!important;border-radius:16px!important;background:#fff!important;box-shadow:0 8px 20px rgba(15,23,42,.04)}
.shipping-method-card.compact .shipping-method-title .quick-icon{width:40px;height:40px;min-width:40px;border-radius:14px}
.shipping-method-card.compact .shipping-method-title b{display:block;font-size:14px;line-height:1.6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:150px}
.shipping-method-card.compact .shipping-method-title .card-sub{font-size:11px;line-height:1.5}
.shipping-method-card.compact .shipping-method-fields{display:grid;grid-template-columns:minmax(110px,.8fr) minmax(140px,1.1fr) minmax(140px,1.1fr) minmax(118px,.8fr);gap:8px;align-items:end}
.shipping-method-card.compact .field{margin:0}
.shipping-method-card.compact .field label{font-size:11px;margin-bottom:4px;color:#64748b}
.shipping-method-card.compact input{min-height:38px;border-radius:12px;padding:8px 10px;font-size:13px}
.shipping-method-card.compact .shipping-method-actions{gap:8px;align-self:end}
.shipping-method-card.compact .ship-active{height:38px;padding:0 10px;border:1px solid var(--border);border-radius:12px;background:#f8fbff;font-size:13px}
.shipping-guide-grid{display:grid;grid-template-columns:minmax(220px,.8fr) minmax(0,1.2fr);gap:12px;align-items:start}
html[data-theme="dark"] .shipping-settings-tabs,
html[data-theme="dark"] .shipping-method-toolbar.compact,
html[data-theme="dark"] .shipping-method-card.compact,
html[data-theme="dark"] .shipping-method-card.compact .ship-active,
html[data-theme="dark"] .shipping-tab.ghost{background:#14233a!important;border-color:#31435f!important;color:#dbeafe!important}
@media(max-width:1100px){.shipping-method-card.compact{grid-template-columns:1fr!important}.shipping-method-card.compact .shipping-method-title b{max-width:none}.shipping-method-card.compact .shipping-method-actions{justify-content:flex-start}.shipping-method-card.compact .shipping-method-fields{grid-template-columns:1fr 1fr}}
@media(max-width:720px){.shipping-settings-redesign .shipping-settings-head{display:block}.shipping-settings-summary{justify-content:flex-start;margin-top:10px}.shipping-settings-tabs{grid-template-columns:1fr}.shipping-method-card.compact .shipping-method-fields,.shipping-guide-grid{grid-template-columns:1fr}.shipping-method-card.compact .shipping-method-actions{display:grid;grid-template-columns:1fr 1fr}.shipping-method-card.compact .shipping-method-actions .btn,.shipping-method-card.compact .ship-active{width:100%;justify-content:center}}

/* v1.4.54 - Accounting full-screen financial sections */
.accounting-full-stack{display:flex;flex-direction:column;gap:16px;width:100%}
.accounting-full-card{width:100%;min-width:0}
.accounting-full-card .table-wrap{max-height:none;overflow:auto}
.accounting-full-card table{min-width:980px}
@media (max-width:900px){.accounting-full-card table{min-width:760px}}

.server-health-card .mini-health{
  border:1px solid var(--border);
  border-radius:16px;
  padding:12px 14px;
  background:var(--surface-soft);
  display:flex;
  flex-direction:column;
  gap:6px;
  min-height:76px;
}
.server-health-card .mini-health span{color:var(--muted);font-size:13px;line-height:1.9}
.health-check-list .complete-item{align-items:flex-start}

/* v1.4.54 - User-separated audit logs, capacity readiness and dark POS payment select readability */
.audit-user-summary{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 12px;align-items:center;justify-content:flex-start;direction:rtl}
.audit-log-wrap .audit-log-table th:first-child,.audit-log-wrap .audit-log-table td:first-child{min-width:180px;white-space:normal}
.audit-user-cell{display:grid;gap:3px;line-height:1.8;min-width:160px}
.audit-user-cell b{font-weight:950;color:var(--text)}
.capacity-readiness{margin-top:16px;border-top:1px solid var(--border-soft);padding-top:14px}
.capacity-card small{display:block;margin-top:6px;color:var(--muted);line-height:1.8;font-size:12px}
.capacity-card.ready{border-color:rgba(22,163,116,.28)}
.capacity-card.watch{border-color:rgba(245,158,11,.36);background:linear-gradient(135deg,#fffdf5,#fff)}
.capacity-card.attention{border-color:rgba(239,68,68,.32);background:linear-gradient(135deg,#fff5f5,#fff)}
html[data-theme="dark"] .audit-user-cell b{color:#f5f9ff!important}
html[data-theme="dark"] .audit-user-summary .chip{background:#17263d!important;color:#dce8f8!important;border-color:#3a5578!important}
html[data-theme="dark"] .capacity-readiness{border-color:#263b58!important}
html[data-theme="dark"] .capacity-card.ready{background:rgba(22,163,116,.08)!important;border-color:rgba(34,197,94,.28)!important}
html[data-theme="dark"] .capacity-card.watch{background:rgba(245,158,11,.10)!important;border-color:rgba(245,158,11,.32)!important}
html[data-theme="dark"] .capacity-card.attention{background:rgba(239,68,68,.10)!important;border-color:rgba(239,68,68,.32)!important}
html[data-theme="dark"] .pos-hero #posPayment,
html[data-theme="dark"] .pos-hero #posPayment:hover,
html[data-theme="dark"] .pos-hero #posPayment:focus{
  background:#0f1a2b!important;
  color:#edf6ff!important;
  border-color:#5f86c5!important;
  box-shadow:0 0 0 4px rgba(116,167,255,.12)!important;
}
html[data-theme="dark"] .pos-hero #posPayment option{
  background:#101c2f!important;
  color:#f5f9ff!important;
}

/* v1.5.0 - Mobile shell polish: scrollable drawer, compact topbar, no fullscreen button on mobile */
@media(max-width:900px){
  .mobile-drawer{touch-action:pan-y!important;overscroll-behavior:contain!important;}
  .mobile-drawer.open{display:block!important;}
  .mobile-drawer .sidebar{
    display:flex!important;
    flex-direction:column!important;
    height:100dvh!important;
    max-height:100dvh!important;
    width:min(320px,88vw)!important;
    max-width:88vw!important;
    overflow:hidden!important;
  }
  .mobile-drawer .brand{flex:0 0 auto!important;min-height:78px!important;padding-top:14px!important;padding-bottom:12px!important;}
  .mobile-drawer .nav{
    flex:1 1 auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior:contain!important;
    touch-action:pan-y!important;
    padding-bottom:calc(118px + env(safe-area-inset-bottom))!important;
  }
  .mobile-drawer .sidebar-footer{flex:0 0 auto!important;margin-top:0!important;padding-bottom:calc(12px + env(safe-area-inset-bottom))!important;}
  .mobile-drawer .nav-item{height:45px!important;border-radius:15px!important;margin:3px 0!important;}
  .mobile-drawer .nav-group-title{padding-top:11px!important;padding-bottom:5px!important;}
  .fullscreen-btn{display:none!important;}
  .topbar{height:60px!important;top:8px!important;border-radius:20px!important;padding:8px 10px!important;gap:8px!important;}
  .top-actions{gap:6px!important;flex-shrink:0!important;}
  .top-actions .icon-btn{width:40px!important;height:40px!important;min-width:40px!important;border-radius:14px!important;}
  .page-id{flex:1 1 auto!important;min-width:0!important;gap:8px!important;}
  .page-icon{width:40px!important;height:40px!important;min-width:40px!important;border-radius:15px!important;font-size:18px!important;}
  .page-title{max-width:calc(100vw - 176px)!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;font-size:15px!important;}
  .notice-pop{top:72px!important;}
}
@media(max-width:420px){
  .topbar{height:58px!important;padding-inline:8px!important;}
  .top-actions .icon-btn{width:38px!important;height:38px!important;min-width:38px!important;}
  .page-icon{width:38px!important;height:38px!important;min-width:38px!important;}
  .page-title{max-width:calc(100vw - 160px)!important;font-size:14px!important;}
  .mobile-drawer .sidebar{width:90vw!important;max-width:90vw!important;}
  .mobile-drawer .nav-item{height:43px!important;}
}

/* v1.5.0 - Unlimited capacity wording and accordion role permissions */
.capacity-note{margin:10px 0 14px;padding:10px 12px;border:1px dashed rgba(59,130,246,.35);border-radius:16px;background:rgba(59,130,246,.06);color:var(--text);font-weight:800;line-height:1.9}
.permission-accordion-list{gap:10px}.permission-accordion{padding:0!important;overflow:hidden!important}.permission-role-summary{display:flex;align-items:center;justify-content:space-between;gap:12px;list-style:none;cursor:pointer;padding:15px 16px;user-select:none}.permission-role-summary::-webkit-details-marker{display:none}.permission-role-summary::marker{content:""}.role-summary-actions{display:flex;align-items:center;gap:10px;flex-shrink:0}.role-accordion-caret{width:30px;height:30px;border-radius:999px;display:grid;place-items:center;background:#eef4ff;color:#1d4ed8;font-weight:950;transition:transform .18s ease}.permission-accordion[open] .role-accordion-caret{transform:rotate(180deg)}.permission-role-body{border-top:1px solid var(--border-soft);padding:12px 16px 16px;background:linear-gradient(180deg,rgba(248,250,252,.7),rgba(255,255,255,.95))}.role-save-line{display:flex;justify-content:flex-end;margin-bottom:10px}.permission-role-body .permission-checks{margin-top:0}@media(max-width:640px){.permission-role-summary{align-items:flex-start}.role-summary-actions{flex-direction:column;align-items:flex-end}.permission-role-body{padding:10px 12px 14px}.capacity-note{font-size:12px}}
html[data-theme="dark"] .capacity-note{background:rgba(96,165,250,.10)!important;border-color:rgba(96,165,250,.35)!important;color:#eaf3ff!important}html[data-theme="dark"] .permission-role-body{background:linear-gradient(180deg,rgba(15,26,43,.75),rgba(12,20,33,.96))!important;border-color:#263b58!important}html[data-theme="dark"] .role-accordion-caret{background:#162a47!important;color:#bfdbfe!important}

/* v1.5.0 - مولتی‌سبد صندوق حضوری */
.pos-cart-tabs{display:flex;align-items:stretch;gap:10px;margin-bottom:14px;overflow:hidden}
.pos-cart-tabs-scroll{display:flex;gap:10px;overflow-x:auto;scrollbar-width:thin;flex:1;padding-bottom:4px;-webkit-overflow-scrolling:touch}
.pos-cart-tab{min-width:190px;border:1px solid var(--border);background:var(--card);color:var(--text);border-radius:18px;padding:10px 12px;text-align:right;cursor:pointer;box-shadow:var(--shadow-soft)}
.pos-cart-tab b{display:block;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pos-cart-tab small{display:block;color:var(--muted);margin-top:4px;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pos-cart-tab.active{border-color:var(--primary);background:linear-gradient(135deg,rgba(31,94,255,.12),rgba(20,184,166,.10));box-shadow:0 12px 28px rgba(31,94,255,.14)}
[data-theme="dark"] .pos-cart-tab.active{background:linear-gradient(135deg,rgba(96,165,250,.18),rgba(45,212,191,.12));border-color:#60a5fa}
@media (max-width: 720px){.pos-cart-tabs{align-items:center}.pos-cart-tab{min-width:150px;padding:9px 10px}.pos-cart-tabs>.btn{white-space:nowrap;padding-inline:12px}}

/* v1.5.0 - calmer maintenance, static topbar and single-line operational tables */
.topbar{position:relative!important;top:auto!important;z-index:45!important}
.content{padding-top:18px}
.one-line{display:block;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;max-width:100%}
.maintenance-page{display:grid;gap:16px}
.maintenance-summary-card{min-height:auto!important;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px!important}
.maintenance-summary-card h2{margin:0;font-size:20px;line-height:1.7;color:#0f172a}
.maintenance-summary-pills{display:flex;align-items:center;justify-content:flex-start;gap:8px;flex-wrap:wrap}
.maintenance-page .server-health-card{margin-top:0!important;padding:18px!important}
.maintenance-page .server-health-card .section-head{margin-bottom:12px}
.maintenance-page .server-health-card .grid-3{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.maintenance-page .mini-health{min-height:auto;padding:12px;border-radius:16px}
.maintenance-page .capacity-readiness{margin-top:12px;padding-top:12px;border-top:1px solid var(--border-soft)}
.maintenance-page .capacity-readiness .section-head{align-items:center}
.maintenance-page .capacity-note{padding:10px 12px;border-radius:14px;font-size:12px;line-height:1.9}
.maintenance-page .health-check-list{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.maintenance-page .health-check-list .complete-item{min-height:auto;padding:11px 12px;border-radius:14px}
.maintenance-page .health-check-list .complete-item b{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.maintenance-page .health-check-list .complete-item span{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.maintenance-tools-grid{margin-top:0!important}
.maintenance-tool-card{min-height:auto}
.maintenance-details-card{min-height:auto!important;padding:0!important;overflow:hidden}
.maintenance-details-card summary{cursor:pointer;padding:16px 18px;font-weight:950;color:#0f172a;list-style:none}
.maintenance-details-card summary::-webkit-details-marker{display:none}
.maintenance-details-card summary:after{content:"+";float:left;width:28px;height:28px;border-radius:10px;display:grid;place-items:center;background:#eef5ff;color:#1f5eff}
.maintenance-details-card[open] summary{border-bottom:1px solid var(--border-soft)}
.maintenance-details-card[open] summary:after{content:"-"}
.maintenance-module-list{padding:16px 18px;grid-template-columns:repeat(4,minmax(0,1fr))}
.maintenance-module-list .complete-item{min-height:auto;padding:12px;border-radius:14px}
.orders-table{table-layout:fixed!important;min-width:1260px!important}
.orders-table th,.orders-table td{white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;vertical-align:middle!important}
.orders-table th:nth-child(1),.orders-table td:nth-child(1){width:205px!important;min-width:205px!important}
.orders-table th:nth-child(2),.orders-table td:nth-child(2){width:250px!important;min-width:250px!important}
.orders-table th:nth-child(3),.orders-table td:nth-child(3){width:200px!important;min-width:200px!important}
.orders-table th:nth-child(4),.orders-table td:nth-child(4){width:255px!important;min-width:255px!important}
.orders-table th:nth-child(5),.orders-table td:nth-child(5){width:260px!important;min-width:260px!important}
.orders-table th:nth-child(6),.orders-table td:nth-child(6){width:320px!important;min-width:320px!important}
.order-inline-cell{display:flex;align-items:center;gap:8px;min-width:0;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.order-inline-cell>*{flex:0 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.order-inline-cell .chip{flex:0 0 auto}
.orders-table .order-actions{overflow:visible!important;text-overflow:clip!important}
.orders-table .order-actions-list{flex-wrap:nowrap!important;overflow:auto!important;max-width:100%;padding-bottom:2px}
.shipments-table{min-width:1120px!important;table-layout:fixed!important}
.shipments-table th,.shipments-table td{white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.shipments-table th:nth-child(1),.shipments-table td:nth-child(1){width:170px}
.shipments-table th:nth-child(2),.shipments-table td:nth-child(2){width:210px}
.shipments-table th:nth-child(3),.shipments-table td:nth-child(3){width:180px!important;min-width:180px!important}
.shipments-table th:nth-child(4),.shipments-table td:nth-child(4){width:145px}
.shipments-table th:nth-child(5),.shipments-table td:nth-child(5){width:190px}
.shipments-table th:nth-child(6),.shipments-table td:nth-child(6){width:150px}
.shipments-table th:nth-child(7),.shipments-table td:nth-child(7){width:180px}
.ship-method-cell select{width:100%;min-height:42px}
.batch-table{min-width:1160px!important;table-layout:fixed!important}
.batch-table th,.batch-table td{white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;vertical-align:middle!important}
.batch-table th:nth-child(1),.batch-table td:nth-child(1){width:280px}
.batch-table th:nth-child(2),.batch-table td:nth-child(2){width:145px}
.batch-table th:nth-child(3),.batch-table td:nth-child(3),.batch-table th:nth-child(4),.batch-table td:nth-child(4){width:125px}
.batch-table th:nth-child(5),.batch-table td:nth-child(5),.batch-table th:nth-child(6),.batch-table td:nth-child(6){width:150px}
.batch-table th:nth-child(7),.batch-table td:nth-child(7){width:180px}
.batch-table th:nth-child(8),.batch-table td:nth-child(8){width:130px}
.batch-product-line,.batch-location-line{display:flex;align-items:center;gap:8px;min-width:0;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.batch-product-line>*{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html[data-theme="dark"] .maintenance-summary-card h2,
html[data-theme="dark"] .maintenance-details-card summary{color:#e6eefb!important}
html[data-theme="dark"] .maintenance-details-card summary:after{background:#14233a;color:#b9d4ff}
@media(max-width:980px){
  .maintenance-summary-card{align-items:stretch;flex-direction:column}
  .maintenance-page .health-check-list,.maintenance-module-list{grid-template-columns:repeat(2,minmax(0,1fr))}
  .orders-table{min-width:1180px!important}
  .shipments-table{min-width:1040px!important}
}
@media(max-width:640px){
  .topbar{height:60px!important}
  .maintenance-page{gap:12px}
  .maintenance-summary-card{padding:15px!important}
  .maintenance-page .server-health-card .grid-3,.maintenance-page .health-check-list,.maintenance-module-list{grid-template-columns:1fr}
}

/* v1.5.0 - dedicated engineered backup and restore center */
.backup-center-page{display:grid;gap:16px}
.backup-hero-card{min-height:auto!important;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:20px!important;background:linear-gradient(135deg,#f8fbff,#ffffff)}
.backup-hero-card h2{margin:0;color:#0f172a;font-size:22px;line-height:1.7}
.backup-hero-card p{max-width:720px}
.backup-hero-pills{display:flex;align-items:center;justify-content:flex-start;gap:8px;flex-wrap:wrap}
.backup-command-grid{align-items:stretch}
.backup-operation-card{position:relative;display:grid;grid-template-columns:54px minmax(0,1fr);gap:13px;min-height:178px;padding:17px;border:1px solid var(--border);border-radius:20px;background:#fff;box-shadow:var(--shadow-xs);overflow:hidden}
.backup-operation-card:before{content:"";position:absolute;inset:0 0 auto 0;height:3px;background:#dbeafe}
.backup-operation-card.ok:before{background:#bbf7d0}
.backup-operation-card.danger:before{background:#fecaca}
.backup-operation-card h3{margin:0 0 4px;color:#0f172a;line-height:1.7;font-size:16px}
.backup-command-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:12px;direction:ltr;justify-content:flex-start}
.command-chip{max-width:100%;border:1px solid #bfd3f6;background:#0f172a;color:#eaf2ff;border-radius:12px;padding:8px 10px;font-size:12px;font-weight:850;line-height:1.7;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-shadow:none}
.command-chip:hover{background:#17294a;border-color:#8fb3ee}
.backup-note{margin-top:10px;border:1px solid #dbeafe;border-radius:13px;background:#eff6ff;color:#1e3a8a;padding:8px 10px;font-size:12px;line-height:1.9}
.backup-note.danger{border-color:#fecaca;background:#fff1f2;color:#b91c1c}
.backup-safe-grid{align-items:start}
.backup-wizard-card,.backup-json-card,.backup-table-card{min-height:auto!important}
.backup-safety-list{grid-template-columns:repeat(2,minmax(0,1fr));margin-top:14px}
.backup-safety-list .complete-item{min-height:auto;padding:12px;border-radius:14px}
.backup-counts.expanded{grid-template-columns:repeat(4,minmax(0,1fr))}
.backup-counts.expanded .complete-item{min-height:auto;padding:11px 12px;border-radius:14px}
.backup-counts.expanded .complete-item b,.backup-counts.expanded .complete-item span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html[data-theme="dark"] .backup-hero-card,
html[data-theme="dark"] .backup-operation-card{background:#132033!important;border-color:#294265!important}
html[data-theme="dark"] .backup-hero-card h2,
html[data-theme="dark"] .backup-operation-card h3{color:#e6eefb!important}
html[data-theme="dark"] .backup-note{background:#14233a!important;border-color:#294265!important;color:#bfdbfe!important}
html[data-theme="dark"] .backup-note.danger{background:rgba(127,29,29,.22)!important;border-color:rgba(248,113,113,.38)!important;color:#fecaca!important}
@media(max-width:980px){
  .backup-hero-card{align-items:stretch;flex-direction:column}
  .backup-command-grid,.backup-safe-grid{grid-template-columns:1fr!important}
  .backup-counts.expanded{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:640px){
  .backup-operation-card{grid-template-columns:1fr;min-height:auto}
  .backup-safety-list,.backup-counts.expanded{grid-template-columns:1fr}
  .command-chip{white-space:normal;text-align:left}
}

/* v1.5.0 - collapsed sidebar toggle alignment */
@media(min-width:901px){
  .app-shell.sidebar-collapsed>.sidebar .brand{
    display:grid!important;
    grid-template-columns:1fr!important;
    place-items:center!important;
    min-height:106px!important;
    padding:12px 10px 14px!important;
    gap:7px!important;
  }
  .app-shell.sidebar-collapsed>.sidebar .brand-mark{
    margin:0!important;
    position:relative!important;
    z-index:2!important;
  }
  .app-shell.sidebar-collapsed>.sidebar .sidebar-collapse-btn{
    position:static!important;
    transform:none!important;
    left:auto!important;
    top:auto!important;
    width:32px!important;
    height:32px!important;
    min-width:32px!important;
    border-radius:12px!important;
    background:#f8fbff!important;
    color:#1f5eff!important;
    border-color:#cfe0ff!important;
    box-shadow:0 6px 16px rgba(31,94,255,.10)!important;
  }
  .app-shell.sidebar-collapsed>.sidebar .sidebar-collapse-btn svg{
    width:16px!important;
    height:16px!important;
    transform:rotate(0deg)!important;
  }
  .app-shell.sidebar-collapsed>.sidebar .nav{padding-top:10px!important}
}
html[data-theme="dark"] .app-shell.sidebar-collapsed>.sidebar .sidebar-collapse-btn{
  background:#162a47!important;
  color:#bfdbfe!important;
  border-color:#345377!important;
}

/* v1.5.0 - management reports, per-user permissions and engineered backup UX */
.report-head-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.table-actions-nowrap{display:flex;align-items:center;gap:6px;flex-wrap:nowrap}
.users-table td:last-child{white-space:nowrap}
.user-permission-editor{display:grid;gap:12px}
.user-permission-checks{grid-template-columns:1fr!important}
.user-perm-row{display:grid;grid-template-columns:minmax(220px,1fr) 150px 150px;gap:10px;align-items:center;border:1px solid var(--border);border-radius:14px;background:#fff;padding:11px 12px}
.user-perm-row b{display:block;color:#0f172a;line-height:1.7}
.user-perm-row small{display:block;color:#64748b;margin-top:2px}
.user-perm-row label{display:flex;align-items:center;gap:7px;font-weight:850;color:#334155;white-space:nowrap}
.user-perm-row input{width:16px;height:16px;min-height:0;accent-color:var(--brand)}
.invoice-extra-controls{margin:8px 0 12px;padding:12px;border:1px solid var(--border-soft);border-radius:16px;background:#f8fbff}
html[data-theme="dark"] .user-perm-row,
html[data-theme="dark"] .invoice-extra-controls{background:#132033!important;border-color:#294265!important}
html[data-theme="dark"] .user-perm-row b{color:#e6eefb!important}
html[data-theme="dark"] .user-perm-row label,
html[data-theme="dark"] .user-perm-row small{color:#bfdbfe!important}
html[data-theme="dark"] .not-found-page{background:#111827!important;color:#f8fafc!important;border-color:#35506f!important}
html[data-theme="dark"] .not-found-page .ltr{color:#e0f2fe!important;background:#0b1220;border:1px solid #334155;border-radius:8px;padding:2px 7px}
@media(max-width:760px){.user-perm-row{grid-template-columns:1fr}.table-actions-nowrap{flex-wrap:wrap}.report-head-actions{width:100%}.report-head-actions .btn{flex:1 1 auto}}

/* v1.5.0 - one-click full backup/restore panel */
.backup-panel-action-card,.backup-auto-card{min-height:auto!important;overflow:visible!important}
.backup-big-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:14px 0 12px}
.backup-big-actions .btn{min-height:44px;min-width:190px}
.backup-live-result{border:1px dashed var(--border);border-radius:14px;background:#f8fbff;color:#334155;padding:11px 12px;line-height:1.9;margin-top:10px;min-height:46px;overflow:auto}
.backup-live-result .tiny-pre{margin-top:8px;max-height:160px}
.backup-auto-card .complete-list{margin-top:12px}
html[data-theme="dark"] .backup-panel-action-card,
html[data-theme="dark"] .backup-auto-card{background:#132033!important;border-color:#294265!important}
html[data-theme="dark"] .backup-panel-action-card h2,
html[data-theme="dark"] .backup-auto-card h2{color:#e6eefb!important}
html[data-theme="dark"] .backup-live-result{background:#0b1220!important;border-color:#294265!important;color:#dbeafe!important}
@media(max-width:700px){.backup-big-actions{display:grid;grid-template-columns:1fr}.backup-big-actions .btn{width:100%;min-width:0}.backup-live-result{font-size:12px}}

/* v1.5.0 panel-driven automatic backup controls */
.backup-auto-form{margin-top:12px}
.backup-auto-status{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}
.backup-auto-card .backup-big-actions{margin-top:10px}
.backup-auto-card select,.backup-auto-card input{min-height:42px}
@media (max-width: 720px){
  .backup-auto-status{gap:6px}
  .backup-auto-card .backup-big-actions{flex-direction:column;align-items:stretch}
  .backup-auto-card .backup-big-actions .btn{width:100%}
}


/* v1.5.0 - polished Persian login and validation UX */
.login-screen-pro{position:relative;overflow:hidden;min-height:100vh;padding:28px;background:linear-gradient(135deg,#071a46 0%,#123b8e 45%,#1f5eff 100%)!important;display:grid!important;place-items:center!important;isolation:isolate;}
.login-screen-pro:before{content:"";position:absolute;inset:0;background:radial-gradient(circle at 18% 18%,rgba(255,255,255,.20),transparent 24%),radial-gradient(circle at 82% 78%,rgba(125,177,255,.20),transparent 26%);z-index:-2;}
.login-orb{position:absolute;border-radius:999px;filter:blur(1px);opacity:.55;z-index:-1;pointer-events:none;}
.login-orb-a{width:260px;height:260px;top:-70px;left:-80px;background:rgba(96,165,250,.34);}
.login-orb-b{width:340px;height:340px;right:-120px;bottom:-120px;background:rgba(14,165,233,.22);}
.login-layout{width:min(1080px,100%);display:grid;grid-template-columns:minmax(0,1.08fr) minmax(360px,.78fr);gap:22px;align-items:stretch;direction:rtl;}
.login-intro-panel,.login-card-pro{position:relative;border:1px solid rgba(255,255,255,.20);box-shadow:0 34px 90px rgba(0,0,0,.24);backdrop-filter:blur(20px);}
.login-intro-panel{min-height:530px;border-radius:34px;padding:34px;color:#fff;background:linear-gradient(145deg,rgba(255,255,255,.14),rgba(255,255,255,.06));display:flex;flex-direction:column;justify-content:space-between;overflow:hidden;}
.login-intro-panel:after{content:"";position:absolute;left:-120px;bottom:-135px;width:360px;height:360px;border-radius:999px;background:radial-gradient(circle,rgba(255,255,255,.17),transparent 66%);}
.login-brandline{position:relative;display:flex;align-items:center;gap:13px;z-index:1;}
.login-brandline b{display:block;font-size:18px;font-weight:950;line-height:1.75;color:#fff;}
.login-brandline span:not(.login-logo){display:block;color:rgba(255,255,255,.78);font-size:12px;line-height:1.85;}
.login-logo.mini{width:50px;height:50px;min-width:50px;margin:0;border-radius:18px;background:rgba(255,255,255,.18);border:1px solid rgba(255,255,255,.26);box-shadow:none;}
.login-intro-panel h2{position:relative;z-index:1;margin:70px 0 12px;font-size:30px;line-height:1.7;color:#fff;font-weight:950;max-width:560px;}
.login-intro-panel p{position:relative;z-index:1;margin:0;color:rgba(255,255,255,.84);line-height:2.1;max-width:590px;}
.login-feature-grid{position:relative;z-index:1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:24px;}
.login-feature-grid span{min-height:54px;display:flex;align-items:center;gap:9px;border:1px solid rgba(255,255,255,.18);border-radius:18px;background:rgba(255,255,255,.10);padding:12px 14px;color:#fff;font-weight:900;line-height:1.6;}
.login-feature-grid svg{width:20px;height:20px;min-width:20px;color:#bfdbfe;}
.login-card-pro{width:100%!important;border-radius:34px!important;padding:30px!important;background:rgba(255,255,255,.97)!important;align-self:stretch;display:flex;flex-direction:column;justify-content:center;}
.login-card-head{display:flex;align-items:center;gap:14px;margin-bottom:18px;}
.login-card-head h1{margin:0!important;font-size:25px;line-height:1.65;color:#0f172a;}
.login-card-head .card-sub{text-align:right;margin:0;color:#64748b;}
.login-card-pro .login-logo:not(.mini){width:62px;height:62px;min-width:62px;margin:0;border-radius:22px;box-shadow:0 16px 32px rgba(31,94,255,.22);}
.login-field{margin-top:13px!important;}
.login-field label{color:#26364f;font-weight:950;}
.login-card-pro input{min-height:50px;border-radius:17px;background:#f8fbff;border-color:#d9e5f6;}
.login-card-pro input:focus{background:#fff;border-color:#8db1ff;box-shadow:0 0 0 5px rgba(31,94,255,.10);}
.login-submit{width:100%;min-height:50px;margin-top:18px;border-radius:18px;font-size:14px;box-shadow:0 16px 34px rgba(31,94,255,.24);}
.login-version{margin-top:16px;text-align:center;direction:rtl;color:#64748b;font-size:12px;line-height:1.8;}
.password-change-card{width:min(480px,100%)!important;}
html[data-theme="dark"] .login-card-pro{background:rgba(15,23,42,.97)!important;border-color:rgba(148,163,184,.24)!important;color:#e5edf8;}
html[data-theme="dark"] .login-card-head h1{color:#f8fafc;}
html[data-theme="dark"] .login-card-pro input{background:#111c2d;border-color:#334155;color:#e5edf8;}
html[data-theme="dark"] .login-version{color:#a7b5c8;}
@media(max-width:900px){.login-screen-pro{padding:16px}.login-layout{grid-template-columns:1fr}.login-intro-panel{display:none}.login-card-pro{min-height:auto;padding:24px!important;border-radius:28px!important}.login-card-head{align-items:flex-start}.login-card-head h1{font-size:22px}.login-submit{min-height:48px}}

/* v1.5.0: backup result readability and distinct online delivery icon polish */
.backup-live-result{
  overflow:visible!important;
  word-break:normal;
  overflow-wrap:anywhere;
}
.backup-result-success{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  min-width:0;
}
.backup-result-success .chip{
  white-space:normal;
  line-height:1.8;
}
.backup-result-hint{
  color:var(--muted);
  font-size:12px;
  line-height:1.8;
}
.backup-file-name{
  display:block;
  width:100%;
  margin-top:9px;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
  color:#0f172a;
  font-family:var(--font-mono-fa)!important;
  direction:ltr;
  text-align:left;
  unicode-bidi:plaintext;
  white-space:normal;
  overflow-wrap:anywhere;
  word-break:break-all;
  line-height:1.9;
  font-size:12px;
}
html[data-theme="dark"] .backup-file-name{
  background:#0f172a;
  color:#e6eefb;
  border-color:rgba(116,167,255,.24);
}
.nav-ico svg,.page-icon svg,.stat-icon svg,.quick-icon svg{
  flex:0 0 auto;
}

/* v1.5.0 - simplified backup/restore UX */
.backup-clean-page{gap:14px!important;}
.backup-clean-hero{padding:18px!important;background:linear-gradient(135deg,#f9fbff,#ffffff)!important;border:1px solid var(--border-soft)!important;}
.backup-clean-hero h2{font-size:21px!important;}
.backup-clean-hero .card-sub{max-width:760px!important;line-height:2!important;}
.backup-main-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;align-items:stretch;}
.backup-primary-card{min-height:auto!important;padding:18px!important;overflow:visible!important;}
.backup-primary-card.danger-side{border-color:rgba(239,68,68,.20)!important;}
.backup-card-title{display:flex;align-items:flex-start;gap:12px;}
.backup-card-title h2{margin:0;color:#0f172a;font-size:18px;line-height:1.8;}
.backup-card-title .card-sub{margin:0;line-height:1.95;}
.backup-primary-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin-top:14px;}
.backup-primary-actions .btn{min-height:42px;}
.backup-live-result.compact{min-height:42px;margin-top:12px;line-height:1.9;font-size:13px;}
.backup-auto-clean{padding:18px!important;}
.backup-auto-clean .section-head{margin-bottom:6px;}
.clean-status{margin:10px 0 12px!important;}
.clean-auto-form{margin-top:6px!important;}
.backup-auto-more{margin:10px 0;border:1px solid var(--border-soft);border-radius:15px;padding:10px 12px;background:#f8fbff;}
.backup-auto-more summary,.backup-advanced-card summary{cursor:pointer;font-weight:950;color:#1f3b66;line-height:1.9;}
.backup-advanced-card{padding:16px!important;}
.backup-advanced-grid{display:grid;grid-template-columns:minmax(0,.75fr) minmax(0,1.25fr);gap:14px;margin-top:14px;align-items:start;}
.backup-advanced-grid h3{margin:0 0 6px;color:#0f172a;line-height:1.8;font-size:15px;}
.compact-counts{grid-template-columns:repeat(3,minmax(0,1fr));}
.compact-counts .complete-item{min-height:auto!important;padding:10px 11px!important;border-radius:13px!important;}
.compact-counts .complete-item b,.compact-counts .complete-item span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
html[data-theme="dark"] .backup-clean-hero,
html[data-theme="dark"] .backup-primary-card,
html[data-theme="dark"] .backup-auto-clean,
html[data-theme="dark"] .backup-advanced-card{background:#132033!important;border-color:#294265!important;}
html[data-theme="dark"] .backup-card-title h2,
html[data-theme="dark"] .backup-advanced-grid h3{color:#e6eefb!important;}
html[data-theme="dark"] .backup-auto-more{background:#0f1a2b!important;border-color:#294265!important;}
html[data-theme="dark"] .backup-auto-more summary,
html[data-theme="dark"] .backup-advanced-card summary{color:#bfdbfe!important;}
@media(max-width:980px){.backup-main-grid,.backup-advanced-grid{grid-template-columns:1fr}.compact-counts{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:640px){.backup-primary-actions{display:grid;grid-template-columns:1fr}.backup-primary-actions .btn{width:100%}.compact-counts{grid-template-columns:1fr}.backup-clean-hero{padding:15px!important}}
.shop-scope-pill{display:inline-flex;align-items:center;gap:7px;border:1px solid var(--border);background:var(--card);border-radius:999px;padding:9px 12px;font-weight:900;font-size:12px;color:var(--text);white-space:nowrap}.shop-scope-pill svg{width:17px;height:17px;color:var(--primary)}
.table-actions-nowrap{display:flex;gap:6px;align-items:center;flex-wrap:nowrap}.modal-form-card hr{border:0;border-top:1px solid var(--border);margin:18px 0}.modal-form-card h3{margin:0 0 12px;font-size:15px}
.cal-head{gap:7px}.cal-selects{display:grid;grid-template-columns:1fr 86px;gap:6px;flex:1}.cal-selects select{min-height:34px;border-radius:11px;padding:4px 8px;font-size:12px}.cal-nav{width:32px;height:32px;border:1px solid var(--border);border-radius:11px;background:#fff;color:#1f5eff;font-size:20px;font-weight:950;cursor:pointer}.cal-empty{height:34px}.cal-foot{display:flex;justify-content:flex-start;margin-top:9px}.cal-day.active{box-shadow:0 0 0 3px rgba(31,94,255,.15)}.variant-consumption-note{grid-column:span 12;border:1px dashed #bfdbfe;background:#f8fbff;border-radius:14px;padding:10px 12px;color:#45617f;font-size:12px;line-height:1.9}.product-status-actions{display:flex;gap:6px;align-items:center;flex-wrap:nowrap}
html[data-theme="dark"] .cal-selects select,html[data-theme="dark"] .cal-nav{background:#0f172a;color:#e6eefb;border-color:#294265}
html[data-theme="dark"] .variant-consumption-note{background:#0f1a2b;border-color:#294265;color:#bfdbfe}

/* v1.8.30 order/invoice/return polish */
.tracking-copy{display:inline-flex;align-items:center;gap:6px;flex-wrap:wrap}.btn.mini{min-height:28px;padding:4px 8px!important;font-size:11px!important;border-radius:10px!important}.order-sku-track .order-inline-cell{align-items:flex-start}.order-sku-track .ltr{font-size:12px}.totals .grand.warn b{color:#b45309}.totals .grand.ok b{color:#047857}.sales-entry-grid{align-items:start}.return-hint-card.smart{border-color:rgba(31,94,255,.18);background:#f8fbff}.customer-balance-cell b{display:block;margin-bottom:4px}.customer-balance-cell .ok{color:#047857}.customer-balance-cell .warn{color:#b45309}
html[data-theme="dark"] .return-hint-card.smart{background:#0f1a2b;border-color:#294265}

/* v1.8.30 FINAL - restore full order operations and keep online delivery merged into shipping */
.orders-table{table-layout:fixed!important;min-width:1660px!important;}
.orders-table th:nth-child(1),.orders-table td:nth-child(1){width:190px!important;min-width:190px!important;}
.orders-table th:nth-child(2),.orders-table td:nth-child(2){width:230px!important;min-width:230px!important;}
.orders-table th:nth-child(3),.orders-table td:nth-child(3){width:180px!important;min-width:180px!important;}
.orders-table th:nth-child(4),.orders-table td:nth-child(4){width:240px!important;min-width:240px!important;}
.orders-table th:nth-child(5),.orders-table td:nth-child(5){width:220px!important;min-width:220px!important;}
.orders-table th:nth-child(6),.orders-table td:nth-child(6){width:280px!important;min-width:280px!important;}
.orders-table th:nth-child(7),.orders-table td:nth-child(7){width:520px!important;min-width:520px!important;}
.orders-table td.order-actions{display:table-cell!important;white-space:normal!important;overflow:visible!important;text-overflow:clip!important;}
.orders-table .order-actions-list{display:flex!important;flex-wrap:wrap!important;gap:7px!important;align-items:center!important;justify-content:flex-start!important;overflow:visible!important;min-height:36px!important;}
.orders-table .order-actions-list .btn{display:inline-flex!important;align-items:center!important;justify-content:center!important;white-space:nowrap!important;min-width:max-content!important;margin:0!important;}
@media(max-width:760px){.orders-table{min-width:1560px!important}.orders-table th:nth-child(7),.orders-table td:nth-child(7){width:500px!important;min-width:500px!important}.orders-table .order-actions-list{flex-wrap:wrap!important}}


/* v1.8.30 mobile UX + PWA + accounting final polish */
html,body{overscroll-behavior-y:none;}
.content{padding-bottom:calc(108px + env(safe-area-inset-bottom,0px))!important;}
.mobile-nav{bottom:calc(10px + env(safe-area-inset-bottom,0px))!important;z-index:80!important;}
.order-actions-sheet{display:none;}
.order-actions-desktop{display:flex!important;flex-wrap:wrap!important;gap:7px!important;}
.pwa-status-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}.pwa-actions{margin-top:12px}.pwa-install-guide{display:grid;gap:14px;line-height:2}.accounting-kpis .stat{min-height:128px}.accounting-debt-table table,.installment-control-table table{min-width:860px}.customers-table-wrap .btn,.accounting-full-card .btn{white-space:nowrap}.maintenance-tools-grid.grid-3{grid-template-columns:repeat(3,minmax(0,1fr));}
@media(max-width:980px){.maintenance-tools-grid.grid-3{grid-template-columns:1fr}.pwa-status-grid{grid-template-columns:1fr}.accounting-kpis{grid-template-columns:1fr 1fr!important}}
@media(max-width:760px){
  .main{padding:8px 12px 0!important;}
  .topbar{height:auto!important;min-height:62px!important;display:grid!important;grid-template-columns:1fr auto!important;align-items:center!important;padding:8px 10px!important;border-radius:22px!important;gap:8px!important;}
  .topbar .page-id{min-width:0!important;overflow:hidden!important;}
  .topbar .page-title{font-size:14px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;max-width:45vw!important;}
  .topbar .page-subtitle{display:none!important;}
  .top-actions{gap:6px!important;min-width:0!important;justify-content:flex-end!important;}
  .top-actions .fullscreen-btn{display:none!important;}
  .top-actions .user-pill{max-width:96px!important;min-width:0!important;padding:7px 9px!important;overflow:hidden!important;}
  .top-actions .user-pill .card-sub{display:none!important;}
  .top-actions .user-pill div:last-child{min-width:0!important;overflow:hidden!important;}
  .top-actions .user-pill div:last-child div:first-child{white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;font-size:12px!important;}
  .icon-btn{width:42px!important;height:42px!important;min-width:42px!important;}
  .orders-table{min-width:980px!important;}
  .orders-table th:nth-child(7),.orders-table td:nth-child(7){width:155px!important;min-width:155px!important;}
  .orders-table td.order-actions{position:sticky!important;left:0!important;background:var(--card)!important;z-index:6!important;box-shadow:-8px 0 18px rgba(15,23,42,.08)!important;padding:8px!important;}
  .orders-table .order-actions-desktop{display:none!important;}
  .orders-table .order-actions-sheet{display:block!important;position:relative!important;}
  .orders-table .order-actions-sheet summary{list-style:none;cursor:pointer;min-height:40px;display:flex;align-items:center;justify-content:center;border-radius:14px;background:linear-gradient(135deg,#1f5eff,#3d7dff);color:#fff;font-weight:950;padding:8px 12px;box-shadow:0 8px 22px rgba(31,94,255,.18);}
  .orders-table .order-actions-sheet summary::-webkit-details-marker{display:none;}
  .orders-table .order-actions-sheet[open] summary{border-radius:14px 14px 0 0;}
  .orders-table .order-actions-mobile-list{position:absolute!important;left:0!important;top:42px!important;width:min(78vw,330px)!important;background:var(--card)!important;border:1px solid var(--border)!important;border-radius:18px!important;padding:10px!important;box-shadow:0 20px 48px rgba(15,23,42,.22)!important;display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important;z-index:30!important;max-height:62vh!important;overflow:auto!important;}
  .orders-table .order-actions-mobile-list .btn{width:100%!important;min-width:0!important;min-height:40px!important;padding:8px 10px!important;margin:0!important;font-size:11.5px!important;white-space:nowrap!important;}
  .orders-table .order-actions-mobile-list .btn.danger{grid-column:1/-1!important;}
  .section-head{gap:10px!important;align-items:flex-start!important;}
  .section-head .btn{min-height:40px!important;}
  .orders-search-panel{grid-template-columns:1fr!important;}
  .orders-search-panel .filter-icon{display:none!important;}
  .orders-search-panel input{width:100%!important;}
  .card{border-radius:22px!important;}
  .modal{max-height:calc(100dvh - 26px)!important;border-radius:24px!important;}
  .accounting-kpis{grid-template-columns:1fr!important}.accounting-full-card .section-head{display:grid!important}.customers-table{min-width:760px!important;}
}
@media(max-width:420px){
  .top-actions .shop-scope-pill{display:none!important;}
  .top-actions .user-pill{max-width:82px!important;}
  .mobile-nav{left:7px!important;right:7px!important;height:64px!important;}
  .mobile-nav button{font-size:10px!important;gap:2px!important;}
  .orders-table{min-width:900px!important;}
  .orders-table th:nth-child(2),.orders-table td:nth-child(2){width:180px!important;min-width:180px!important;}
  .orders-table th:nth-child(4),.orders-table td:nth-child(4){width:180px!important;min-width:180px!important;}
}


/* v1.8.30 - exact mobile alignment + landscape sidebar stability */
.table th,
.table td,
.orders-table th,
.orders-table td,
.customers-table th,
.customers-table td,
.accounting-debt-table th,
.accounting-debt-table td,
.installment-control-table th,
.installment-control-table td{
  vertical-align:middle!important;
}

.table td,
.orders-table td{
  align-content:center!important;
}

.table td > *,
.orders-table td > *{
  vertical-align:middle!important;
}

.table td .btn,
.orders-table td .btn,
.table td .chip,
.orders-table td .chip,
.table td input,
.orders-table td input,
.table td select,
.orders-table td select{
  vertical-align:middle!important;
}

.order-inline-cell,
.order-customer,
.order-channel,
.order-sku-track,
.order-amount,
.order-status{
  min-height:42px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:7px!important;
}

.order-inline-cell{
  flex-wrap:wrap!important;
  max-width:100%!important;
}

.order-actions,
.orders-table td.order-actions{
  vertical-align:middle!important;
  align-content:center!important;
}

.order-actions-list,
.orders-table .order-actions-list{
  align-items:center!important;
  align-content:center!important;
}

.orders-table .order-actions-sheet summary{
  align-items:center!important;
  justify-content:center!important;
  line-height:1.6!important;
}

/* Phone landscape must still behave like mobile. Prevent desktop sidebar from breaking the layout. */
@media (orientation:landscape) and (max-height:540px){
  :root{--side:0!important;--gap:10px!important;}
  body{overflow-x:hidden!important;}
  .app-shell>.sidebar{
    display:none!important;
    width:0!important;
    min-width:0!important;
    max-width:0!important;
    pointer-events:none!important;
  }
  .app-shell.sidebar-collapsed>.main,
  .main{
    margin-right:0!important;
    margin-inline-start:0!important;
    padding:8px 10px calc(78px + env(safe-area-inset-bottom,0px))!important;
    max-width:100vw!important;
    overflow-x:hidden!important;
  }
  .content{
    padding-bottom:calc(78px + env(safe-area-inset-bottom,0px))!important;
    max-width:100%!important;
    overflow-x:hidden!important;
  }
  .topbar{
    top:6px!important;
    height:54px!important;
    min-height:54px!important;
    border-radius:18px!important;
    padding:6px 9px!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    align-items:center!important;
    gap:7px!important;
  }
  .page-id{min-width:0!important;overflow:hidden!important;}
  .page-title{
    max-width:calc(100vw - 220px)!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    font-size:13.5px!important;
  }
  .page-subtitle{display:none!important;}
  .page-icon{width:38px!important;height:38px!important;min-width:38px!important;border-radius:14px!important;}
  .mobile-menu-btn{display:grid!important;}
  .top-actions{gap:5px!important;min-width:0!important;}
  .top-actions .fullscreen-btn{display:none!important;}
  .top-actions .shop-scope-pill{max-width:120px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
  .top-actions .user-pill{display:none!important;}
  .icon-btn{width:38px!important;height:38px!important;min-width:38px!important;border-radius:14px!important;}

  .mobile-drawer{
    display:block!important;
    position:fixed!important;
    inset:0!important;
    z-index:220!important;
    background:rgba(15,23,42,.42)!important;
    opacity:0;
    pointer-events:none;
    transition:.18s ease!important;
  }
  .mobile-drawer.open{opacity:1!important;pointer-events:auto!important;}
  .mobile-drawer .sidebar{
    display:flex!important;
    position:fixed!important;
    top:0!important;
    right:0!important;
    bottom:0!important;
    left:auto!important;
    height:100dvh!important;
    max-height:100dvh!important;
    width:min(320px,88vw)!important;
    max-width:88vw!important;
    min-width:0!important;
    border-radius:0!important;
    transform:translateX(105%)!important;
    transition:.22s ease!important;
    overflow:hidden!important;
    z-index:230!important;
    pointer-events:auto!important;
  }
  .mobile-drawer.open .sidebar{transform:translateX(0)!important;}
  .mobile-drawer .brand{
    flex:0 0 auto!important;
    min-height:58px!important;
    padding:8px 12px!important;
  }
  .mobile-drawer .brand-mark{width:40px!important;height:40px!important;min-width:40px!important;border-radius:14px!important;font-size:18px!important;}
  .mobile-drawer .brand-title{font-size:13px!important;}
  .mobile-drawer .brand-sub{display:none!important;}
  .mobile-drawer .nav{
    flex:1 1 auto!important;
    min-height:0!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    padding-bottom:calc(74px + env(safe-area-inset-bottom,0px))!important;
  }
  .mobile-drawer .nav-item{
    height:40px!important;
    min-height:40px!important;
    border-radius:13px!important;
    margin:2px 0!important;
  }
  .mobile-drawer .nav-group-title{padding-top:8px!important;padding-bottom:4px!important;font-size:10px!important;}
  .mobile-drawer .sidebar-footer{
    flex:0 0 auto!important;
    padding:8px 12px calc(8px + env(safe-area-inset-bottom,0px))!important;
  }
  .mobile-nav{
    display:flex!important;
    left:10px!important;
    right:10px!important;
    bottom:calc(7px + env(safe-area-inset-bottom,0px))!important;
    height:56px!important;
    border-radius:18px!important;
    z-index:190!important;
  }
  .mobile-nav button{font-size:10px!important;min-width:48px!important;gap:1px!important;}
  .mobile-nav .nav-ico{width:19px!important;height:19px!important;min-width:19px!important;}

  .table-wrap{max-width:100%!important;overflow:auto!important;-webkit-overflow-scrolling:touch!important;}
  .orders-table{min-width:960px!important;}
  .orders-table th,
  .orders-table td{vertical-align:middle!important;}
  .orders-table th:nth-child(7),
  .orders-table td:nth-child(7){width:150px!important;min-width:150px!important;}
  .orders-table td.order-actions{
    position:sticky!important;
    left:0!important;
    background:var(--card)!important;
    z-index:7!important;
    padding:7px!important;
  }
  .orders-table .order-actions-desktop{display:none!important;}
  .orders-table .order-actions-sheet{display:block!important;position:relative!important;}
  .orders-table .order-actions-mobile-list{
    position:absolute!important;
    left:0!important;
    top:40px!important;
    width:min(72vw,330px)!important;
    max-height:calc(100dvh - 92px)!important;
    overflow:auto!important;
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:7px!important;
    background:var(--card)!important;
    border:1px solid var(--border)!important;
    border-radius:17px!important;
    padding:9px!important;
    box-shadow:0 20px 48px rgba(15,23,42,.22)!important;
    z-index:60!important;
  }
  .orders-table .order-actions-mobile-list .btn{
    width:100%!important;
    min-width:0!important;
    min-height:38px!important;
    margin:0!important;
    font-size:11px!important;
    padding:7px 8px!important;
  }
}


/* v1.8.30 - Mobile stability hotfix: order actions portal, centered rows, drawer/safe-area polish. Desktop layout is intentionally unchanged. */
.table th,.table td,
.orders-table th,.orders-table td,
.customers-table th,.customers-table td{vertical-align:middle!important;}
.table td,.orders-table td{align-content:center!important;}
.table td > *,.orders-table td > *{vertical-align:middle!important;}
.order-inline-cell,.order-customer,.order-channel,.order-sku-track,.order-amount,.order-status{display:flex!important;align-items:center!important;gap:8px!important;min-height:44px!important;max-width:100%!important;}
.order-inline-cell{flex-wrap:wrap!important;}
.order-actions-desktop{display:flex!important;align-items:center!important;gap:7px!important;flex-wrap:wrap!important;}
.order-actions-trigger,.order-actions-template{display:none!important;}
.order-actions-sheet{display:none!important;}

/* Global fixed portal: avoids table clipping and buttons going under rows/bottom nav */
.order-action-portal{position:fixed;inset:0;z-index:2147482500;display:none;direction:rtl;font-family:var(--font-fa)!important;}
.order-action-portal.open{display:block;}
.order-action-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.42);backdrop-filter:blur(3px);}
.order-action-sheet{position:absolute;left:14px;right:14px;bottom:calc(12px + env(safe-area-inset-bottom,0px));max-height:min(72dvh,560px);overflow:hidden;background:var(--surface,#fff);border:1px solid var(--border,#dbe4f0);border-radius:26px;box-shadow:0 26px 80px rgba(15,23,42,.28);padding:10px 12px 14px;color:var(--text,#0f172a);}
.order-action-sheet-grip{width:56px;height:5px;border-radius:999px;background:#dbe4f0;margin:2px auto 12px;}
.order-action-sheet-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 4px 10px;border-bottom:1px solid var(--border-soft,#edf2fa);}
.order-action-sheet-head b{display:block;font-weight:950;line-height:1.8;}
.order-action-sheet-head span{display:block;color:var(--muted,#64748b);font-size:12px;margin-top:2px;}
.order-action-sheet-close{width:38px!important;height:38px!important;min-width:38px!important;border-radius:14px!important;}
.order-action-sheet-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;overflow:auto;max-height:calc(min(72dvh,560px) - 92px);padding:12px 2px 2px;-webkit-overflow-scrolling:touch;}
.order-action-sheet-grid .btn{width:100%!important;min-width:0!important;min-height:42px!important;margin:0!important;padding:8px 10px!important;border-radius:14px!important;font-size:12px!important;white-space:nowrap!important;box-shadow:0 8px 20px rgba(31,94,255,.13)!important;}
.order-action-sheet-grid .btn.danger{grid-column:1/-1!important;background:linear-gradient(135deg,#dc2626,#ef4444)!important;}
body.order-actions-open{overflow:hidden!important;}
html[data-theme="dark"] .order-action-sheet{background:#101c2f!important;color:#e6eefb!important;border-color:#294265!important;}
html[data-theme="dark"] .order-action-sheet-grip{background:#334866!important;}

/* Drawer close must be small in all mobile widths, including iPhone landscape. */
.mobile-drawer-close{position:absolute!important;top:12px!important;left:12px!important;width:40px!important;height:40px!important;min-width:40px!important;max-width:40px!important;border:1px solid var(--border,#dbe4f0)!important;border-radius:14px!important;background:var(--surface,#fff)!important;color:var(--text,#0f172a)!important;display:grid!important;place-items:center!important;padding:0!important;z-index:5!important;box-shadow:var(--shadow-xs,0 8px 20px rgba(15,23,42,.08))!important;font-size:18px!important;line-height:1!important;overflow:hidden!important;}
.mobile-drawer-close svg{width:18px!important;height:18px!important;min-width:18px!important;max-width:18px!important;display:block!important;}
.mobile-drawer .brand{padding-left:62px!important;}

@media(max-width:760px){
  body{overflow-x:hidden!important;}
  .main{max-width:100vw!important;overflow-x:hidden!important;padding-bottom:calc(98px + env(safe-area-inset-bottom,0px))!important;}
  .content{max-width:100%!important;overflow-x:hidden!important;padding-bottom:calc(104px + env(safe-area-inset-bottom,0px))!important;}
  .topbar{position:sticky!important;top:8px!important;z-index:60!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:8px!important;width:100%!important;max-width:100%!important;overflow:hidden!important;}
  .topbar .page-id{flex:1 1 auto!important;min-width:0!important;gap:7px!important;}
  .topbar .page-title{max-width:40vw!important;font-size:14px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
  .top-actions{flex:0 0 auto!important;gap:5px!important;}
  .top-actions .shop-scope-pill{max-width:96px!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;}
  .top-actions .user-pill{display:none!important;}
  .icon-btn{width:40px!important;height:40px!important;min-width:40px!important;border-radius:14px!important;}
  .table-wrap,.orders-table-wrap{max-width:100%!important;overflow:auto!important;-webkit-overflow-scrolling:touch!important;}
  .orders-table{min-width:920px!important;table-layout:fixed!important;}
  .orders-table th,.orders-table td{vertical-align:middle!important;white-space:normal!important;overflow:visible!important;text-overflow:clip!important;}
  .orders-table th:nth-child(7),.orders-table td:nth-child(7){width:128px!important;min-width:128px!important;max-width:128px!important;}
  .orders-table td.order-actions{position:sticky!important;left:0!important;background:var(--surface,#fff)!important;z-index:12!important;box-shadow:-7px 0 18px rgba(15,23,42,.08)!important;padding:8px!important;overflow:visible!important;}
  .orders-table .order-actions-desktop{display:none!important;}
  .orders-table .order-actions-trigger{display:flex!important;width:100%!important;min-width:0!important;min-height:40px!important;margin:0!important;align-items:center!important;justify-content:center!important;border-radius:14px!important;font-size:12.5px!important;font-weight:950!important;}
  .orders-table .order-actions-template{display:none!important;}
  .orders-table .order-actions-sheet,.orders-table .order-actions-mobile-list{display:none!important;}
  .mobile-nav{z-index:180!important;bottom:calc(8px + env(safe-area-inset-bottom,0px))!important;left:10px!important;right:10px!important;}
}

@media(orientation:landscape) and (max-height:560px){
  :root{--side:0!important;--gap:10px!important;}
  body{overflow-x:hidden!important;}
  .app-shell>.sidebar{display:none!important;}
  .main,.app-shell.sidebar-collapsed>.main{margin-right:0!important;max-width:100vw!important;overflow-x:hidden!important;padding:8px 10px calc(76px + env(safe-area-inset-bottom,0px))!important;}
  .content{padding-bottom:calc(82px + env(safe-area-inset-bottom,0px))!important;}
  .topbar{top:6px!important;height:54px!important;min-height:54px!important;border-radius:18px!important;padding:6px 9px!important;display:flex!important;align-items:center!important;gap:7px!important;overflow:hidden!important;}
  .page-id{flex:1 1 auto!important;min-width:0!important;overflow:hidden!important;}
  .page-title{max-width:calc(100vw - 250px)!important;font-size:13px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
  .page-subtitle{display:none!important;}
  .page-icon{width:38px!important;height:38px!important;min-width:38px!important;border-radius:14px!important;}
  .mobile-menu-btn{display:grid!important;}
  .top-actions{flex:0 0 auto!important;gap:5px!important;}
  .top-actions .fullscreen-btn,.top-actions .user-pill{display:none!important;}
  .top-actions .shop-scope-pill{max-width:112px!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;}
  .mobile-drawer{display:block!important;position:fixed!important;inset:0!important;z-index:230!important;background:rgba(15,23,42,.42)!important;opacity:0!important;pointer-events:none!important;transition:.18s ease!important;}
  .mobile-drawer.open{opacity:1!important;pointer-events:auto!important;}
  .mobile-drawer .sidebar{display:flex!important;position:fixed!important;top:0!important;right:0!important;bottom:0!important;left:auto!important;width:min(330px,86vw)!important;max-width:86vw!important;height:100dvh!important;max-height:100dvh!important;border-radius:0!important;transform:translateX(105%)!important;transition:.22s ease!important;overflow:hidden!important;z-index:235!important;pointer-events:auto!important;}
  .mobile-drawer.open .sidebar{transform:translateX(0)!important;}
  .mobile-drawer .brand{min-height:62px!important;padding:9px 12px 9px 62px!important;flex:0 0 auto!important;}
  .mobile-drawer .brand-mark{width:40px!important;height:40px!important;min-width:40px!important;border-radius:14px!important;font-size:18px!important;}
  .mobile-drawer .brand-title{font-size:13px!important;}
  .mobile-drawer .brand-sub{display:none!important;}
  .mobile-drawer .nav{flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important;overflow-x:hidden!important;padding-bottom:calc(74px + env(safe-area-inset-bottom,0px))!important;}
  .mobile-drawer .nav-item{height:40px!important;min-height:40px!important;border-radius:13px!important;margin:2px 0!important;}
  .mobile-drawer .sidebar-footer{flex:0 0 auto!important;padding:8px 12px calc(8px + env(safe-area-inset-bottom,0px))!important;}
  .mobile-nav{display:flex!important;height:56px!important;left:10px!important;right:10px!important;bottom:calc(7px + env(safe-area-inset-bottom,0px))!important;border-radius:18px!important;z-index:190!important;}
  .mobile-nav button{font-size:10px!important;min-width:48px!important;}
  .orders-table{min-width:920px!important;}
  .orders-table th:nth-child(7),.orders-table td:nth-child(7){width:124px!important;min-width:124px!important;}
  .order-action-sheet{left:auto!important;right:12px!important;bottom:12px!important;top:12px!important;width:min(340px,45vw)!important;max-height:none!important;border-radius:24px!important;}
  .order-action-sheet-grid{max-height:calc(100dvh - 94px)!important;}
}


/* v1.8.30 - hard mobile/debug patch: no clipped scroll, landscape actions, safe toast, desktop preserved */
html,body,#app{min-height:100%;width:100%;overflow-x:hidden!important;}
.table th,.table td,.orders-table th,.orders-table td,.customers-table th,.customers-table td{vertical-align:middle!important;}
.table td > *,.orders-table td > *{vertical-align:middle!important;}
.toast{max-height:min(46dvh,360px)!important;overflow:auto!important;white-space:pre-wrap!important;word-break:break-word!important;line-height:1.9!important;z-index:2147482600!important;}
.toast-message{max-height:inherit!important;overflow:auto!important;direction:rtl!important;text-align:right!important;}
.modal-backdrop.open{align-items:center!important;justify-content:center!important;overflow:auto!important;-webkit-overflow-scrolling:touch!important;padding:12px!important;}
.modal{max-height:calc(100dvh - 24px)!important;overflow:auto!important;-webkit-overflow-scrolling:touch!important;}
.modal-body{overflow:visible!important;}

.order-action-portal{position:fixed!important;inset:0!important;z-index:2147482500!important;display:none!important;direction:rtl!important;}
.order-action-portal.open{display:block!important;}
.order-action-backdrop{position:absolute!important;inset:0!important;background:rgba(15,23,42,.46)!important;backdrop-filter:blur(3px)!important;}
.order-action-sheet{position:absolute!important;left:14px!important;right:14px!important;bottom:calc(12px + env(safe-area-inset-bottom,0px))!important;top:auto!important;width:auto!important;max-width:none!important;max-height:min(72dvh,560px)!important;overflow:hidden!important;background:var(--surface,#fff)!important;border:1px solid var(--border,#dbe4f0)!important;border-radius:26px!important;box-shadow:0 26px 80px rgba(15,23,42,.30)!important;padding:10px 12px 14px!important;color:var(--text,#0f172a)!important;}
.order-action-sheet-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px!important;overflow:auto!important;max-height:calc(min(72dvh,560px) - 92px)!important;padding:12px 2px 2px!important;-webkit-overflow-scrolling:touch!important;}
.order-action-sheet-grid .btn{width:100%!important;min-width:0!important;min-height:42px!important;margin:0!important;padding:8px 10px!important;border-radius:14px!important;font-size:12px!important;white-space:nowrap!important;}
.order-action-sheet-grid .btn.danger{grid-column:1/-1!important;}
body.order-actions-open{overflow:hidden!important;touch-action:none!important;}

@media(max-width:900px){
  .app-shell>.sidebar{display:none!important;}
  .main,.app-shell.sidebar-collapsed>.main{margin-right:0!important;max-width:100vw!important;overflow-x:hidden!important;padding-bottom:calc(104px + env(safe-area-inset-bottom,0px))!important;}
  .content{max-width:100%!important;overflow-x:hidden!important;padding-bottom:calc(110px + env(safe-area-inset-bottom,0px))!important;}
  .table-wrap,.orders-table-wrap{max-width:100%!important;overflow:auto!important;-webkit-overflow-scrolling:touch!important;overscroll-behavior-x:contain!important;}
  .orders-table{min-width:920px!important;table-layout:fixed!important;}
  .orders-table th,.orders-table td{white-space:normal!important;overflow:visible!important;text-overflow:clip!important;vertical-align:middle!important;}
  .orders-table th:nth-child(7),.orders-table td:nth-child(7){width:128px!important;min-width:128px!important;max-width:128px!important;}
  .orders-table td.order-actions{position:sticky!important;left:0!important;background:var(--surface,#fff)!important;z-index:18!important;box-shadow:-7px 0 18px rgba(15,23,42,.09)!important;padding:8px!important;overflow:visible!important;}
  .orders-table .order-actions-desktop{display:none!important;}
  .orders-table .order-actions-trigger{display:flex!important;width:100%!important;min-width:0!important;min-height:40px!important;margin:0!important;align-items:center!important;justify-content:center!important;border-radius:14px!important;font-size:12.5px!important;font-weight:950!important;}
  .orders-table .order-actions-template{display:none!important;}
  .orders-table .order-actions-sheet,.orders-table .order-actions-mobile-list{display:none!important;}
  .mobile-nav{z-index:180!important;}
  .mobile-drawer{display:block!important;position:fixed!important;inset:0!important;z-index:230!important;background:rgba(15,23,42,.42)!important;opacity:0!important;pointer-events:none!important;transition:.18s ease!important;}
  .mobile-drawer.open{opacity:1!important;pointer-events:auto!important;}
  .mobile-drawer .sidebar{display:flex!important;position:fixed!important;top:0!important;right:0!important;bottom:0!important;left:auto!important;width:min(330px,86vw)!important;max-width:86vw!important;height:100dvh!important;max-height:100dvh!important;border-radius:0!important;transform:translateX(105%)!important;transition:.22s ease!important;overflow:hidden!important;z-index:235!important;pointer-events:auto!important;}
  .mobile-drawer.open .sidebar{transform:translateX(0)!important;}
  .mobile-drawer .nav{flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important;overflow-x:hidden!important;padding-bottom:calc(74px + env(safe-area-inset-bottom,0px))!important;}
}

@media(orientation:landscape) and (max-height:620px){
  :root{--side:0!important;--gap:10px!important;}
  body{overflow-x:hidden!important;}
  .app-shell>.sidebar{display:none!important;}
  .main,.app-shell.sidebar-collapsed>.main{margin-right:0!important;max-width:100vw!important;overflow-x:hidden!important;padding:8px 10px calc(76px + env(safe-area-inset-bottom,0px))!important;}
  .content{max-width:100%!important;overflow-x:hidden!important;padding-bottom:calc(84px + env(safe-area-inset-bottom,0px))!important;}
  .topbar{top:6px!important;height:54px!important;min-height:54px!important;border-radius:18px!important;padding:6px 9px!important;display:flex!important;align-items:center!important;gap:7px!important;overflow:hidden!important;}
  .page-id{flex:1 1 auto!important;min-width:0!important;overflow:hidden!important;}
  .page-title{max-width:calc(100vw - 250px)!important;font-size:13px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
  .page-subtitle{display:none!important;}
  .mobile-menu-btn{display:grid!important;}
  .top-actions .fullscreen-btn,.top-actions .user-pill{display:none!important;}
  .table-wrap,.orders-table-wrap{max-width:100%!important;overflow:auto!important;-webkit-overflow-scrolling:touch!important;}
  .orders-table{min-width:920px!important;}
  .orders-table th:nth-child(7),.orders-table td:nth-child(7){width:126px!important;min-width:126px!important;max-width:126px!important;}
  .orders-table .order-actions-desktop{display:none!important;}
  .orders-table .order-actions-trigger{display:flex!important;width:100%!important;min-width:0!important;min-height:38px!important;margin:0!important;align-items:center!important;justify-content:center!important;}
  .orders-table .order-actions-template{display:none!important;}
  .orders-table td.order-actions{position:sticky!important;left:0!important;background:var(--surface,#fff)!important;z-index:20!important;}
  .order-action-sheet{left:auto!important;right:12px!important;top:12px!important;bottom:12px!important;width:min(360px,48vw)!important;max-height:none!important;border-radius:24px!important;}
  .order-action-sheet-grid{max-height:calc(100dvh - 94px)!important;}
  .mobile-drawer{display:block!important;position:fixed!important;inset:0!important;z-index:230!important;background:rgba(15,23,42,.42)!important;opacity:0!important;pointer-events:none!important;}
  .mobile-drawer.open{opacity:1!important;pointer-events:auto!important;}
  .mobile-drawer .sidebar{display:flex!important;position:fixed!important;top:0!important;right:0!important;bottom:0!important;left:auto!important;width:min(330px,86vw)!important;max-width:86vw!important;height:100dvh!important;border-radius:0!important;transform:translateX(105%)!important;overflow:hidden!important;z-index:235!important;pointer-events:auto!important;}
  .mobile-drawer.open .sidebar{transform:translateX(0)!important;}
  .mobile-drawer .nav{flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important;overflow-x:hidden!important;padding-bottom:calc(74px + env(safe-area-inset-bottom,0px))!important;}
}

/* v1.8.30 deep mobile stability: orders use mobile cards, not clipped table menus. Desktop table remains unchanged. */
.orders-mobile-list{display:none;gap:12px;direction:rtl;}
.order-mobile-card{display:grid;gap:11px;background:var(--surface,#fff);border:1px solid var(--border,#dbe4f0);border-radius:22px;padding:14px;box-shadow:var(--shadow-xs,0 8px 22px rgba(15,23,42,.08));overflow:hidden;}
.order-mobile-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;min-width:0;}
.order-mobile-card-head>div{display:grid;gap:3px;min-width:0;}
.order-mobile-card-head bdi{font-weight:950;color:var(--text,#0f172a);font-size:13px;}
.order-mobile-card-head span:not(.chip){font-weight:950;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.order-mobile-card-head small{color:var(--muted,#64748b);font-size:12px;}
.order-mobile-meta{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;}
.order-mobile-meta span{min-width:0;border:1px solid var(--border-soft,#edf2fa);border-radius:16px;padding:8px;background:#fbfdff;line-height:1.75;font-size:12px;color:var(--text,#0f172a);overflow:hidden;text-overflow:ellipsis;}
.order-mobile-meta b{display:block;color:var(--muted,#64748b);font-size:10px;margin-bottom:2px;}
.order-mobile-sku{display:flex;align-items:center;gap:6px;flex-wrap:wrap;min-height:34px;color:var(--muted,#64748b);font-size:12px;}
.order-mobile-actions{display:block!important;position:relative!important;overflow:visible!important;}
.order-mobile-actions .order-actions-trigger{display:flex!important;width:100%!important;min-height:42px!important;align-items:center!important;justify-content:center!important;margin:0!important;border-radius:16px!important;font-size:13px!important;}
.order-mobile-actions .order-actions-template{display:none!important;}

@media(max-width:900px){
  .orders-mobile-list{display:grid!important;}
  .orders-table-wrap{display:none!important;}
  .orders-search-panel{position:relative!important;z-index:1!important;}
  .order-action-sheet{left:12px!important;right:12px!important;bottom:calc(84px + env(safe-area-inset-bottom,0px))!important;top:auto!important;width:auto!important;max-height:min(68dvh,520px)!important;}
  .order-action-sheet-grid{max-height:calc(min(68dvh,520px) - 92px)!important;}
  body.order-actions-open .mobile-nav{z-index:70!important;}
}

@media(max-width:430px){
  .order-mobile-meta{grid-template-columns:1fr!important;}
  .order-action-sheet-grid{grid-template-columns:1fr!important;}
  .order-action-sheet-grid .btn.danger{grid-column:auto!important;}
}

@media(orientation:landscape) and (max-height:620px){
  .orders-mobile-list{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px!important;}
  .orders-table-wrap{display:none!important;}
  .order-mobile-card{padding:11px!important;border-radius:18px!important;gap:8px!important;}
  .order-mobile-meta{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px!important;}
  .order-mobile-meta span{padding:6px!important;font-size:11px!important;}
  .order-action-sheet{top:10px!important;bottom:10px!important;right:10px!important;left:auto!important;width:min(370px,48vw)!important;max-height:none!important;}
  .order-action-sheet-grid{max-height:calc(100dvh - 92px)!important;}
}

html[data-theme="dark"] .order-mobile-card{background:#101c2f!important;border-color:#294265!important;}
html[data-theme="dark"] .order-mobile-meta span{background:#0f1a2b!important;border-color:#294265!important;color:#e6eefb!important;}


/* v1.8.30 final mobile rotation and invoice print hardening */
@media (max-width:1024px){
  .orders-mobile-list{display:grid!important;grid-template-columns:1fr!important;}
  .orders-table-wrap{display:none!important;}
  .order-mobile-actions,.order-mobile-actions .order-actions-trigger{display:flex!important;visibility:visible!important;opacity:1!important;pointer-events:auto!important;}
  .order-mobile-actions{width:100%!important;}
}
body.sc-mobile-like .orders-mobile-list{display:grid!important;grid-template-columns:1fr!important;}
body.sc-mobile-like .orders-table-wrap{display:none!important;}
body.sc-mobile-like .order-mobile-actions,
body.sc-mobile-like .order-mobile-actions .order-actions-trigger{display:flex!important;visibility:visible!important;opacity:1!important;pointer-events:auto!important;}
@media (orientation:landscape) and (pointer:coarse), (orientation:landscape) and (max-height:760px){
  .orders-mobile-list{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important;}
  .orders-table-wrap{display:none!important;}
  .order-mobile-actions,.order-mobile-actions .order-actions-trigger{display:flex!important;}
  .order-action-sheet{top:10px!important;bottom:10px!important;right:10px!important;left:auto!important;width:min(390px,48vw)!important;max-height:none!important;border-radius:22px!important;}
  .order-action-sheet-grid{max-height:calc(100dvh - 92px)!important;}
}
@media (max-width:560px){
  .orders-mobile-list{grid-template-columns:1fr!important;}
  .order-mobile-meta{grid-template-columns:1fr!important;}
  .order-action-sheet-grid{grid-template-columns:1fr!important;}
}
body.order-actions-open .order-action-portal{display:block!important;}
.order-action-portal.open .order-action-sheet{visibility:visible!important;opacity:1!important;}
.shop-scope-summary{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:8px 0;}

/* v1.8.30 - global scroll hotfix: prevent clipped vertical scroll after mobile/order action changes */
html,
body,
#app{
  height:auto!important;
  min-height:100%!important;
  overflow-y:auto!important;
  overscroll-behavior-y:auto!important;
}
body{
  position:static!important;
  touch-action:auto!important;
}
body.mobile-menu-open,
body.order-actions-open{
  overflow:hidden!important;
  touch-action:none!important;
}
.app-shell,
.main,
.content{
  height:auto!important;
  max-height:none!important;
  overflow-y:visible!important;
}
.app-shell{min-height:100dvh!important;}
.main{min-height:100dvh!important;}
.content{min-height:auto!important;}
.content > .card,
.content .card:has(.table-wrap),
.inventory-full-card,
.shipping-full-card,
.accounting-full-card,
.backup-primary-card,
.backup-panel-action-card,
.backup-auto-card,
.maintenance-details-card,
.shipping-settings-redesign{
  max-height:none!important;
  overflow:visible!important;
}
.table-wrap,
.orders-table-wrap,
.shipments-table-wrap,
.customers-table-wrap,
.audit-log-wrap{
  max-height:none!important;
  overflow:auto!important;
  -webkit-overflow-scrolling:touch!important;
}
.login-screen,
.login-screen-pro{
  min-height:100dvh!important;
  height:auto!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  overscroll-behavior-y:auto!important;
  -webkit-overflow-scrolling:touch!important;
}
.login-card,
.login-card-pro,
.password-change-card{
  max-height:none!important;
  overflow:visible!important;
}
.modal-backdrop.open{
  overflow-y:auto!important;
  -webkit-overflow-scrolling:touch!important;
}
.modal{
  max-height:calc(100dvh - 24px)!important;
  overflow-y:auto!important;
  overscroll-behavior:contain!important;
  -webkit-overflow-scrolling:touch!important;
}
.order-action-sheet-grid,
.toast-message{
  -webkit-overflow-scrolling:touch!important;
}
@media(max-width:900px){
  .main,
  .content{
    overflow-y:visible!important;
    max-height:none!important;
  }
  .login-screen-pro{
    display:block!important;
    padding:16px!important;
  }
  .login-layout{
    min-height:calc(100dvh - 32px)!important;
    align-items:center!important;
  }
  .content > .grid,
  .content > .card{
    max-height:none!important;
  }
}
@media(orientation:landscape) and (max-height:620px){
  html,body,#app{overflow-y:auto!important;}
  body.mobile-menu-open,
  body.order-actions-open{overflow:hidden!important;}
  .main,.content{overflow-y:visible!important;max-height:none!important;}
  .order-action-sheet{overflow:hidden!important;}
  .order-action-sheet-grid{overflow-y:auto!important;}
}

/* v1.8.30 - accounting category, flexible city input, and full Jalali calendar polish */
.inline-input-action{display:flex;align-items:center;gap:8px;width:100%}
.inline-input-action input{flex:1;min-width:0}
.inline-input-action .btn{min-width:84px}
.expense-custom-category{grid-column:span 4}
.cal-caption{font-size:11px;color:var(--muted);text-align:center;line-height:1.8;margin:-4px 0 8px;direction:rtl}
.calendar-pop .cal-head{align-items:center;gap:8px}
.calendar-pop .cal-nav{display:grid;place-items:center;user-select:none;touch-action:manipulation}
.calendar-pop .cal-nav:active{transform:translateY(1px)}
.calendar-pop .cal-selects{grid-template-columns:minmax(0,1fr) 100px}
.calendar-pop .cal-year{direction:ltr;text-align:center}
input[data-geo-city]{background:#fff}
@media(max-width:640px){.inline-input-action{flex-direction:column;align-items:stretch}.inline-input-action .btn{width:100%}.calendar-pop .cal-selects{grid-template-columns:1fr 96px}.cal-caption{font-size:10px}}
html[data-theme="dark"] .cal-caption{color:#9fb0c9}
.return-items-box{border:1px solid rgba(148,163,184,.35);background:rgba(248,250,252,.88);border-radius:18px;padding:14px;margin-top:12px;display:grid;gap:10px}
.return-item-row{display:grid;grid-template-columns:minmax(0,1fr) 110px;gap:10px;align-items:center;padding:10px 12px;border:1px solid rgba(203,213,225,.7);border-radius:14px;background:#fff}
.return-item-row input{max-width:110px;text-align:center}
@media(max-width:640px){.return-item-row{grid-template-columns:1fr}.return-item-row input{max-width:100%}}
