/* [ADDED BY CLAUDE] 2026-11-18 (المالك: صفحة المبيعات وعرض السعر وفاتورة الإيرادات على الويب «نفس الشكل والتصميم» في نموذجه المرفق مع التحسينات):
   ألوان النموذج وخطوطه ومقاساته نفسها؛ الكمبيوتر عمودان (المستند والملخص)، والجوال عمود واحد بشريط إجمالي وحفظ سفلي ونوافذ تنزل من الأسفل.
   بلا style مضمّن ولا onclick (سياسة أمان البوابة تمنعهما)، فكل الأحداث في sales.js */
:root{--navy:#132b49;--blue:#2563eb;--bg:#f4f6fa;--ink:#172c45;--muted:#7c899b;--line:#e6ebf2;--green:#168668;--red:#c64747;--amber:#b7791f}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;background:var(--bg);color:var(--ink);font:14px Tahoma,Arial,sans-serif}
button,input,select,textarea{font:inherit}
button{cursor:pointer;touch-action:manipulation;border:0}
button,input,select,textarea{outline-offset:3px}
button:disabled{opacity:.5;cursor:default}
svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;vertical-align:middle}
/* [MODIFIED BY CLAUDE] 2026-11-29 (المالك بصورة آيفون: «في الشريط العلوي في الجوال يظهر توهج… يحتاج إصلاح»): كان الشريط غير مثبّت فيلوّن سفاري (iOS 26) منطقة شريط الحالة من خلفية الصفحة الفاتحة ويمزجها بالكحلي فيظهر توهج / الآن مثبّت أعلى الصفحة ويمتد تحت شريط الحالة (المنطقة الآمنة) فيأخذ سفاري لونه */
.top{background:var(--navy);color:#fff;position:sticky;top:0;z-index:30;padding-top:env(safe-area-inset-top)}
.topinner{max-width:1220px;margin:auto;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:17px 24px}
.brand{display:flex;align-items:center;gap:12px;background:none;color:#fff;padding:0;text-align:right}
.brandmark{width:39px;height:39px;border-radius:12px;background:#ffffff12;display:grid;place-items:center;color:#74bdff}
.brand b{display:block;font-size:16px}
.brand small{display:block;font-size:10px;letter-spacing:2px;color:#b7c9dd;margin-top:6px}
.toplabel{font-size:12px;color:#bccbde}
.topuser{display:flex;align-items:center;gap:10px;font-size:12px;color:#d6e2ef}
.avatar{background:#2b4461;border:1px solid #ffffff22;border-radius:50%;width:34px;height:34px;display:grid;place-items:center;color:#fff}
.toplink{background:none;color:#bccbde;font-size:12px;padding:6px}
.wrap{max-width:1220px;margin:0 auto;padding:30px 24px 120px}
.pagehead{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:24px}
.pagehead h1{font-size:25px;margin:0 0 9px;letter-spacing:-1px}
.sub{color:var(--muted);font-size:12px;line-height:1.8}
.status{font-size:11px;background:#edf2f8;padding:6px 10px;border-radius:6px;color:#687d95;margin-right:8px;vertical-align:middle;display:inline-block}
.status.ok{background:#e7f6ef;color:var(--green)}
.status.warn{background:#fff4e0;color:var(--amber)}
.actions{display:flex;gap:8px;flex-wrap:wrap}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:43px;border-radius:10px;padding:10px 15px;background:#fff;color:var(--ink);border:1px solid var(--line);font-weight:600;font-size:12px;text-decoration:none}
.btn.primary{background:var(--blue);color:#fff;border-color:var(--blue)}
.btn.green{background:#1f9d55;color:#fff;border-color:#1f9d55}
.btn.danger{color:var(--red)}
.btn.wide{width:100%}
.iconbtn{padding:0;width:40px;min-width:40px;height:40px;display:grid;place-items:center;border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--muted)}
.layout{display:grid;grid-template-columns:minmax(0,1fr) 325px;gap:20px;align-items:start}
.main{min-width:0}
.card{background:#fff;border:1px solid var(--line);border-radius:16px;margin-bottom:18px;overflow:hidden;box-shadow:0 3px 4px #152d4902}
.pad{padding:21px}
.sectionhead{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:18px}
.sectionhead.pad{margin:0}
.sectionhead h2{margin:0;font-size:14px;display:flex;align-items:center;gap:9px}
.sectionhead h2 svg{color:#8190a6}
.link{background:none;color:var(--blue);font-weight:600;font-size:12px;padding:7px}
.customer{display:flex;gap:13px;align-items:center}
.customer .circle{height:45px;width:45px;flex-shrink:0;display:grid;place-items:center;color:var(--blue);border-radius:14px;background:#eff5ff}
.customer strong{font-size:14px}
.customer p{margin:7px 0 0;font-size:11px;color:var(--muted)}
.meta{display:flex;gap:18px;flex-wrap:wrap;border-top:1px solid var(--line);margin-top:18px;padding-top:15px;color:#62738a;font-size:11px}
.meta span{display:flex;gap:6px;align-items:center}
.meta svg{width:15px;height:15px}
.count{background:#eef3fc;color:var(--blue);font-size:11px;border-radius:7px;padding:4px 8px}
.addbar{display:flex;gap:8px;padding:0 20px 18px}
.searchbtn{flex:1;text-align:right;display:flex;align-items:center;gap:10px;background:#f7f9fc;color:#8793a4;border:1px solid var(--line);border-radius:10px;padding:12px;font-size:12px}
.item{margin:0 20px;padding:20px 0;border-top:1px solid var(--line)}
.itemtop{display:flex;align-items:flex-start;gap:12px}
.producticon{display:grid;place-items:center;flex-shrink:0;width:46px;height:46px;background:#edf4fa;border-radius:12px;color:#4c6d90}
.itemname{flex:1;min-width:0}
.item h3{font-size:13px;line-height:1.8;margin:0 0 5px}
.item small{color:var(--muted);font-size:10px}
.more{background:none;color:#8b99a8;padding:4px;min-width:40px;min-height:40px}
.itembottom{display:flex;justify-content:space-between;align-items:end;gap:10px;margin-top:18px;padding-right:58px}
.stepper{display:flex;direction:rtl;align-items:center;border:1px solid var(--line);border-radius:9px;height:43px}
.stepper button{background:#f8fafc;width:41px;height:41px;color:#526780;font-size:19px}
.stepper button:first-child{border-radius:0 8px 8px 0}
.stepper button:last-child{border-radius:8px 0 0 8px}
.stepper input{width:52px;text-align:center;border:0;background:#fff;color:var(--ink);font-size:12px;padding:0;-moz-appearance:textfield}
.stepper input::-webkit-inner-spin-button{display:none}
.itemtotal{text-align:left}
.itemtotal b{font-size:16px;display:block;direction:ltr}
.itemtotal small{display:block;margin-top:6px}
.note{background:#f9fbfd;border-top:1px solid var(--line);padding:13px 20px;font-size:10px;color:var(--muted);display:flex;align-items:center;gap:7px}
.note svg{width:14px;height:14px}
.details summary{padding:18px 20px;cursor:pointer;font-size:12px;font-weight:bold;list-style:none;display:flex;justify-content:space-between}
.details summary::-webkit-details-marker{display:none}
.details summary:after{content:'+';color:#8da0b5}
.details[open] summary:after{content:'−'}
.gridfields{display:grid;grid-template-columns:1fr 1fr;gap:14px;padding:0 20px 20px}
.field{display:block;font-size:11px;color:#65778d}
.field input,.field select,.field textarea{display:block;width:100%;padding:12px;margin-top:8px;background:#f9fbfd;border:1px solid var(--line);border-radius:9px;color:var(--ink);min-width:0}
.field.bad input,.field.bad select{border-color:var(--red);background:#fff6f6}
.full{grid-column:1/-1}
.sidebar{position:sticky;top:20px}
.row{display:flex;justify-content:space-between;gap:10px;margin:17px 0;font-size:12px;color:#6b7c91}
.row strong{color:var(--ink);font-weight:600;direction:ltr}
.discountedit{background:transparent;color:var(--blue);padding:0;font-size:11px}
.grand{border-top:1px dashed #d6dfeb;padding-top:18px;margin-top:20px;display:flex;justify-content:space-between;align-items:center}
.grand span{font-weight:bold;font-size:13px}
.grand b{font-size:25px;direction:ltr;letter-spacing:-.5px}
.grand small{font-size:10px;font-weight:normal;color:var(--muted)}
.taxhint{font-size:10px;color:var(--muted);margin-top:10px}
.positive{color:var(--green)}
.paymethod{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}
.paymethod button{background:#fff;border:1px solid var(--line);color:#6b7c91;border-radius:10px;padding:12px 3px;font-size:11px}
.paymethod svg{display:block;margin:0 auto 8px;width:21px}
.paymethod button.active{color:var(--blue);background:#eff5ff;border-color:#a6c4ff}
.paydetail{font-size:11px;margin-top:15px;border-top:1px solid var(--line);padding-top:14px;display:flex;justify-content:space-between;gap:8px;color:#6b7c91}
.savebtn{width:100%;margin-top:20px;min-height:47px}
.security{text-align:center;font-size:10px;color:#8f9bac;line-height:1.9;margin:14px 0 3px}
.bottombar{display:none}
.empty{text-align:center;padding:32px;color:var(--muted);font-size:12px;line-height:2}
/* الدخول */
.login{max-width:400px;margin:60px auto}
.login h1{font-size:21px;margin:0 0 6px}
.login form .btn{width:100%;margin-top:18px}
/* [ADDED BY CLAUDE] 2026-11-28 (المالك: «الإطار مغطي على كلمة المرور»): كانت خانات الدخول متلاصقة بلا مسافة، وإطار التركيز يخرج 3px عن الخانة فيغطي عنوان الخانة التالية / الآن مسافة بين الخانات (صفحتا المبيعات والفرع) */
.login form .field{margin-top:16px}
/* البداية: ثلاث بطاقات كبيرة */
.starts{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-bottom:26px}
.start{display:flex;flex-direction:column;align-items:flex-start;gap:12px;text-align:right;background:#fff;border:1px solid var(--line);border-radius:18px;padding:22px;color:var(--ink);box-shadow:0 3px 4px #152d4903;transition:border-color .15s,transform .15s}
.start:hover{border-color:#a6c4ff;transform:translateY(-2px)}
.start .ic{width:52px;height:52px;border-radius:15px;display:grid;place-items:center;background:#eff5ff;color:var(--blue)}
.start .ic svg{width:26px;height:26px}
.start.quote .ic{background:#fff4e0;color:var(--amber)}
.start.revenue .ic{background:#e7f6ef;color:var(--green)}
.start b{display:block;font-size:17px;margin-bottom:7px}
.start span{display:block;font-size:12px;color:var(--muted);line-height:1.8}
.start i{font-style:normal;font-size:12px;font-weight:bold;color:var(--blue);margin-top:4px}
.listtools{display:flex;gap:8px;padding:0 20px 16px;flex-wrap:wrap}
.listtools input{flex:1;min-width:160px;padding:11px 12px;border:1px solid var(--line);border-radius:10px;background:#f7f9fc}
.chips{display:flex;gap:6px}
.chip{background:#fff;border:1px solid var(--line);border-radius:999px;padding:8px 13px;font-size:11px;color:#62738a}
.chip.active{background:var(--navy);border-color:var(--navy);color:#fff}
.docrow{display:flex;align-items:center;gap:12px;width:100%;background:#fff;border:0;border-top:1px solid var(--line);padding:14px 20px;text-align:right;color:var(--ink)}
.docrow:hover{background:#f9fbfd}
.docrow .grow{flex:1;min-width:0}
.docrow strong{display:block;font-size:13px;margin-bottom:5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.docrow small{font-size:10px;color:var(--muted)}
.docrow b{direction:ltr;font-size:13px;white-space:nowrap}
.kind{font-size:10px;border-radius:6px;padding:4px 7px;background:#eff5ff;color:var(--blue);white-space:nowrap}
.kind.quote{background:#fff4e0;color:var(--amber)}
.kind.revenue{background:#e7f6ef;color:var(--green)}
/* النوافذ */
.overlay{position:fixed;inset:0;background:#0c213d77;z-index:40;display:none;align-items:center;justify-content:center;padding:20px;backdrop-filter:blur(4px)}
.overlay.open{display:flex}
.dialog{width:520px;max-width:100%;max-height:88vh;overflow:auto;background:#fff;border-radius:20px;padding:0 24px 24px;box-shadow:0 30px 100px #00193630}
/* [MODIFIED BY CLAUDE] 2026-11-18 (المالك: «عند اضافة صنف وأنزل تحت يختفي الهيدر احتاج تثبته… اضغط اكس وارجع للفاتورة»): رأس النافذة (العنوان وزر الإغلاق) ثابت أعلاها مع التمرير */
.dialogheader{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;position:sticky;top:0;z-index:5;background:#fff;padding:20px 0 12px;border-bottom:1px solid var(--line)}
.dialog h2{font-size:18px;margin:0}
.dialog .field{margin:13px 0}
.dialog .btn.primary.wide{margin-top:16px}
.tabs{display:grid;grid-template-columns:1fr 1fr;gap:6px;background:#f1f4f9;border-radius:12px;padding:5px;margin:4px 0 14px}
.tabs button{background:none;border-radius:9px;padding:11px 6px;font-size:12px;font-weight:600;color:#62738a}
.tabs button.active{background:#fff;color:var(--navy);box-shadow:0 2px 6px #13294b14}
.tabhint{font-size:11px;color:var(--muted);line-height:1.8;margin:0 0 6px}
.two{display:grid;grid-template-columns:1fr 1fr;gap:0 12px}
.three{display:grid;grid-template-columns:1fr 1fr 1fr;gap:0 10px}
.formerr{color:var(--red);font-size:12px;min-height:18px;margin-top:8px}
.catalog{width:100%;display:flex;align-items:center;gap:12px;background:#fff;border:1px solid var(--line);border-radius:12px;padding:12px;text-align:right;margin-top:9px;color:var(--ink)}
.catalog strong{font-size:12px;display:block;margin-bottom:6px}
.catalog small{font-size:10px;color:var(--muted)}
.catalog b{margin-right:auto;color:var(--blue);font-size:12px;white-space:nowrap;direction:ltr}
.catalog .producticon{width:40px;height:40px}
.catalog.new{border-style:dashed;color:var(--blue);justify-content:center;font-weight:600;font-size:12px}
.morefields summary{cursor:pointer;color:var(--blue);font-size:12px;font-weight:600;margin:6px 0}
/* المستند */
.doc{background:#fff;border:1px solid var(--line);border-radius:16px;padding:28px;max-width:860px;margin:0 auto 18px}
.dochead{display:flex;justify-content:space-between;gap:20px;align-items:flex-start;border-bottom:2px solid var(--navy);padding-bottom:16px;margin-bottom:16px}
.dochead h2{margin:0 0 6px;font-size:19px}
.dochead .title{font-size:16px;font-weight:bold;color:var(--navy);text-align:left}
.dochead .title small{display:block;font-size:11px;color:var(--muted);font-weight:normal;margin-top:6px;direction:ltr}
.docparty{display:grid;grid-template-columns:1fr 1fr;gap:16px;font-size:12px;line-height:1.9;margin-bottom:16px}
.docparty > div{background:#f9fbfd;border:1px solid var(--line);border-radius:10px;padding:10px 12px}
.docparty b{display:block;color:var(--muted);font-size:10px;font-weight:normal}
.doctable{width:100%;border-collapse:collapse;font-size:12px}
.doctable th{background:var(--navy);color:#fff;font-weight:600;padding:9px 6px;text-align:right}
.doctable td{padding:9px 6px;border-bottom:1px solid var(--line);vertical-align:top}
.doctable td.n{direction:ltr;text-align:left;white-space:nowrap}
.docfoot{display:flex;justify-content:space-between;gap:20px;align-items:flex-end;margin-top:16px}
.doctotals{min-width:250px;font-size:12px}
.doctotals .row{margin:8px 0}
.doctotals .grand{margin-top:10px;padding-top:10px}
.doctotals .grand b{font-size:20px}
.qr canvas{width:130px;height:130px;image-rendering:pixelated;border:1px solid var(--line);border-radius:6px}
.qr small{display:block;font-size:10px;color:var(--muted);margin-top:4px;text-align:center}
.docnotes{font-size:11px;color:#4a5a70;line-height:1.9;margin-top:14px;white-space:pre-line;border-top:1px dashed var(--line);padding-top:10px}
.banner{display:flex;align-items:center;gap:12px;background:#e7f6ef;border:1px solid #bfe6d2;color:#0f6b4c;border-radius:14px;padding:14px 18px;margin:0 auto 16px;max-width:860px;font-size:13px}
.banner.warn{background:#fff4e0;border-color:#f1d3a2;color:#7a4d0d}
.banner svg{width:24px;height:24px;flex-shrink:0}
.docactions{display:flex;gap:8px;flex-wrap:wrap;justify-content:center;max-width:860px;margin:0 auto 18px}
.toast{position:fixed;bottom:25px;left:50%;transform:translateX(-50%);background:var(--navy);color:#fff;padding:14px 22px;border-radius:12px;box-shadow:0 9px 30px #0b284e20;z-index:60;font-size:12px;width:max-content;max-width:90%;text-align:center}
.toast.err{background:#a52a2a}
.busy{position:fixed;inset:0;z-index:70;background:#ffffff66;display:grid;place-items:center}
.busy span{background:var(--navy);color:#fff;border-radius:12px;padding:14px 22px;font-size:12px}
@media(min-width:1200px){.item h3{font-size:14px}.pad{padding:23px}.item{padding:23px 0}}
@media(max-width:860px){.starts{grid-template-columns:1fr}.start{flex-direction:row;align-items:center;padding:16px}.start .ic{flex-shrink:0}.start div{flex:1}}
@media(max-width:760px){
  .topinner{padding:14px 16px}.toplabel{display:none}.brand b{font-size:14px}.brand small{font-size:9px}.brandmark{width:35px;height:35px}.topuser span{display:none}
  .wrap{padding:22px 14px 132px}.pagehead{margin-bottom:18px;align-items:flex-start}.pagehead h1{font-size:21px}
  .pagehead .actions .btn span{display:none}.pagehead .actions .btn{width:39px;min-height:39px;padding:0}.pagehead .actions{gap:6px}
  .sub{font-size:10px}.layout{display:block}.card{border-radius:14px;margin-bottom:14px}.pad{padding:18px}
  .item{margin:0 17px;padding:19px 0}.item h3{font-size:12px}.itembottom{padding-right:0}.producticon{height:42px;width:42px}.itemtotal b{font-size:15px}
  .sidebar{position:static}.sidebar .savebtn,.sidebar .security{display:none}.grand b{font-size:23px}.addbar{padding:0 17px 17px}
  .bottombar{display:flex;position:fixed;z-index:20;bottom:0;right:0;left:0;padding:13px 17px calc(13px + env(safe-area-inset-bottom));background:#fffffff5;border-top:1px solid #dde5f0;box-shadow:0 -6px 24px #19354f06;justify-content:space-between;align-items:center;gap:20px;backdrop-filter:blur(12px)}
  .bottombar small{color:var(--muted);font-size:10px;display:block;margin-bottom:7px}
  .bottombar b{font-size:22px;direction:ltr;display:inline-block}
  .bottombar .btn{min-height:47px;min-width:150px}
  .overlay{padding:0;align-items:flex-end}
  .dialog{width:100%;max-height:92vh;border-radius:23px 23px 0 0;padding:0 18px calc(24px + env(safe-area-inset-bottom))}
  .dialog:before{content:'';display:block;width:38px;height:4px;border-radius:3px;background:#e1e7ee;margin:10px auto 0}
  .dialogheader{padding-top:12px}
  .toast{bottom:105px}.gridfields{grid-template-columns:1fr;gap:12px}.field input,.field select,.field textarea{font-size:16px}
  .two,.three{grid-template-columns:1fr}
  .doc{padding:16px;border-radius:14px}.dochead{flex-direction:column}.dochead .title{text-align:right}.docparty{grid-template-columns:1fr}.docfoot{flex-direction:column-reverse;align-items:stretch}
  .doctable .hm{display:none}
  .listtools .chips{width:100%;overflow-x:auto}
}
@media print{
  body{background:#fff}
  .top,.pagehead,.bottombar,.banner,.docactions,.toast,.overlay,.noprint{display:none!important}
  .wrap{padding:0;max-width:none}
  .doc{border:0;border-radius:0;padding:0;max-width:none}
  .doctable th{background:#fff!important;color:#000;border-bottom:2px solid #000}
}
/* [ADDED BY CLAUDE] 2026-11-18 (المالك: «النموذج المرفق هذا يكون لعرض السعر والمبيعات»): نموذج «فاتورة ضريبية» المرفق: إطارات رمادية، رأس بالعنوان ثنائي اللغة على خلفية
   سماوية فاتحة، ومربعا المورد والعميل، وجدول الأصناف، والمبلغ كتابةً، والإجماليات، والشروط، والختم والتوقيع. مقاس A4 في الطباعة */
.inv{background:#fff;color:#111;max-width:860px;margin:0 auto 18px;padding:26px 28px;border:1px solid var(--line);border-radius:6px;font:12px Tahoma,Arial,sans-serif;line-height:1.5}
.inv .bi{display:inline-flex;flex-direction:column;align-items:center;line-height:1.25}
.inv .bi b{font-weight:bold}
.inv .bi i{font-style:normal;font-weight:bold;font-size:11px;direction:ltr}
.inv .ltr{direction:ltr;unicode-bidi:isolate}
.invtop{display:grid;grid-template-columns:1fr 1.7fr 1fr 120px;gap:14px;align-items:start;margin-bottom:12px}
.invwho{display:flex;flex-direction:column;gap:4px;font-size:12px}
.invwho b{font-size:13px}
.invmeta{border-collapse:collapse;font-size:11px;width:100%}
.invmeta th{text-align:right;padding:3px 4px;white-space:nowrap;vertical-align:middle}
.invmeta th .bi{flex-direction:row-reverse;gap:6px;align-items:baseline}
.invmeta td{padding:3px 4px;font-weight:bold;white-space:nowrap}
.invmeta td.num{color:#8b1d1d;font-size:14px;direction:ltr;text-align:right}
.invmeta td.pay{background:#dff3fb}
.invmid{display:flex;flex-direction:column;align-items:center;gap:6px}
.invlogo{max-width:120px;max-height:70px;object-fit:contain}
.invtitle{background:#dff3fb;width:100%;text-align:center;padding:6px 4px;display:flex;flex-direction:column}
.invtitle b{font-size:15px}
.invtitle span{font-size:15px;font-weight:bold;direction:ltr}
.invqr canvas{width:116px;height:116px;image-rendering:pixelated}
.parties{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-bottom:10px}
.party{border:3px solid #6b6b6b;padding:6px 8px}
.phead{display:flex;justify-content:space-between;font-weight:bold;border-bottom:1px solid #ddd;padding-bottom:4px;margin-bottom:4px}
.phead .pe,.prow .pe{direction:ltr;text-align:left}
.prow{display:grid;grid-template-columns:96px 1fr 96px;gap:6px;padding:2px 0;font-size:11px}
.prow .pa,.prow .pe{font-weight:bold;background:#f2f2f2;padding:1px 4px}
.prow .pv{text-align:center;font-weight:bold}
.invdesc{display:flex;align-items:center;gap:14px;margin:8px 0}
.invdesc .bi{flex-direction:row-reverse;gap:6px}
.invdesc .dv{flex:1;background:#e9e9e9;padding:5px 10px;font-weight:bold}
.invlines{width:100%;border-collapse:collapse;font-size:11.5px}
.invlines th{border:1px solid #444;padding:4px;font-weight:bold;vertical-align:middle}
.invlines td{border:1px solid #444;border-top:0;border-bottom:0;padding:5px;vertical-align:top}
.invlines tbody tr:last-child td{border-bottom:1px solid #444}
.invlines td.code{text-align:center;font-weight:bold;white-space:nowrap}
.invlines td.nm b{display:block}
.invlines td.nm .note{display:block;color:#444}
.invlines td.c{text-align:center}
.invlines td.c .unit{display:block;font-size:10px}
.invlines td.n{text-align:center;direction:ltr;font-weight:bold;white-space:nowrap}
.invwords{display:flex;gap:8px;align-items:center;border:1px solid #444;border-top:0;padding:6px;background:#f5f5f5}
.invwords span{border:1px solid #444;background:#fff;padding:3px 6px;text-align:center;font-weight:bold}
.invwords .wtext{border:0;background:none;text-align:right;flex:1}
.invwords .wvat{min-width:160px}.invwords .wcur{min-width:50px}.invwords .wtotal{min-width:130px}
.invmeta td.sales{color:#1d3a8b}
.invwords .wtotal{color:#8b1d1d;direction:ltr}
.invtotals{display:grid;grid-template-columns:200px 1fr;gap:14px;border:1px solid #444;border-top:0;padding:8px}
.tside{display:flex;flex-direction:column;gap:12px;justify-content:center}
.tqty,.tsales{display:flex;flex-direction:column;align-items:center;gap:4px}
.tqty>b{color:#1d3a8b;font-size:14px}
.trows .trow{display:flex;justify-content:space-between;gap:10px;padding:2px 0;font-weight:bold}
.trows .tv{color:#8b1d1d;direction:ltr;min-width:110px;text-align:left}
.trows .tax .tl{color:#8b1d1d}
.trows .grand{background:#e9e9e9;padding:4px}
.invpolicy{border:1px solid #c9c9c9;border-radius:4px;margin-top:12px;padding:8px 12px;font-size:11px}
.invpolicy h3{margin:0 0 6px;font-size:12.5px}
.invpolicy p{margin:0 0 4px;white-space:pre-line}
.invpolicy .phead2{font-weight:bold}
.invpolicy .c-red{color:#b3261e}.invpolicy .c-navy{color:#13294b}.invpolicy .c-green{color:#167a3d}.invpolicy .c-blue{color:#1d4ed8}.invpolicy .c-black{color:#111}.invpolicy .c-brown{color:#6e3c14}.invpolicy .c-gold{color:#966e00}
.invpolicy .pfoot{display:flex;flex-wrap:wrap;gap:6px 18px;border-top:1px dashed #ccc;padding-top:6px;margin-top:6px}
.invpolicy .bank{display:flex;gap:6px}
.invpolicy .thanks{text-align:center;font-weight:bold;margin-top:6px}
.invsign{display:flex;justify-content:space-around;margin-top:56px;font-weight:bold;text-decoration:underline}
.invsign .bi{flex-direction:row-reverse;gap:6px}
.docimg{max-width:860px;margin:0 auto 18px;background:#fff;border:1px solid var(--line);border-radius:6px;padding:8px}
.docimg img{display:block;width:100%;height:auto}
.washeet .note2{font-size:11px;color:var(--muted);line-height:1.8}
.lumpbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:0 20px 16px;padding:12px;background:#fff8e6;border:1px solid #f1d9a6;border-radius:10px;font-size:12px}
.lumpbar label{display:flex;align-items:center;gap:6px;font-weight:bold}
.lumpbar input[type=number]{width:150px;padding:9px;border:1px solid var(--line);border-radius:8px}
.salesrow{margin-top:14px}
.salesrow select{display:block;width:100%;padding:11px;margin-top:6px;background:#f9fbfd;border:1px solid var(--line);border-radius:9px}
/* [MODIFIED BY CLAUDE] 2026-11-18: كان @media(max-width:760px) فيطبَّق في الطباعة أيضاً (عرض ورقة A4 718 أقل من 760 فتختفي أعمدة النموذج) / الآن للشاشة فقط */
@media screen and (max-width:760px){
  .inv{padding:12px;font-size:11px}
  .invtop{grid-template-columns:1fr 96px}
  .invtop .invmid{grid-column:1/-1;order:-1}
  .invtop .invmeta{grid-column:1/-1}
  .invqr canvas{width:92px;height:92px}
  .parties{grid-template-columns:1fr}
  .invlines th:nth-child(1),.invlines td:nth-child(1),.invlines th:nth-child(5),.invlines td:nth-child(5),.invlines th:nth-child(6),.invlines td:nth-child(6){display:none}
  .invwords .wvat{display:none}.invwords .wcur{display:none}
  .invtotals{grid-template-columns:1fr}
  .prow{grid-template-columns:78px 1fr 78px}
}
@media print{
  @page{size:A4;margin:10mm}
  .inv{border:0;border-radius:0;padding:0;max-width:none;margin:0}
  .docimg{border:0;padding:0;max-width:none}
  .invlines th,.invmeta td.pay,.invtitle{-webkit-print-color-adjust:exact;print-color-adjust:exact}
}
/* [ADDED BY CLAUDE] 2026-11-18 (المالك: «نقدي أجل متعدد… والمتعدد يكون نقدي وشبكة وتحويل وتابي وتمارا»): ملخص «متعدد» تحت الأزرار ونافذة توزيع الدفع،
   بألوان أنواع الدفع في فاتورة البرنامج (نقدي أخضر، شبكة أزرق، تحويل بنفسجي، تقسيط أرجواني) */
.paydetail.multi{flex-direction:column;align-items:stretch;gap:10px}
.paylist{display:flex;flex-wrap:wrap;gap:6px}
.paychip{display:inline-flex;align-items:center;gap:6px;border-radius:9px;padding:6px 9px;font-size:11px;background:#eceef2;color:#505864}
.paychip svg{width:15px;height:15px}
.paychip b{font-weight:600}
.paychip span{direction:ltr;font-weight:bold}
.paychip.t0{background:#e1f5e8;color:#157a3c}.paychip.t1{background:#deebfc;color:#1555aa}.paychip.t2{background:#eee6fa;color:#6937a5}.paychip.t7{background:#f3e5f5;color:#7b1fa2}
.payerr{color:var(--red);font-size:11px;width:100%}
.paydetail.multi .link{align-self:flex-start;padding:4px 0}
.partsheet .parthead{display:flex;justify-content:space-between;align-items:center;background:#f4f7fb;border-radius:10px;padding:12px 14px;margin-bottom:10px;font-size:12px;color:#62738a}
.partsheet .parthead b{font-size:18px;color:var(--ink);direction:ltr}
.partrow{display:grid;grid-template-columns:1fr 190px;gap:8px 10px;align-items:center;border:1px solid var(--line);border-radius:12px;padding:10px 12px;margin-top:8px}
.partrow .pname{display:grid;grid-template-columns:24px 1fr;grid-template-rows:auto auto;column-gap:8px;align-items:center}
.partrow .pname svg{grid-row:1/3;width:22px;height:22px}
.partrow .pname b{font-size:13px}
.partrow .pname small{font-size:10px;color:var(--muted)}
.partrow.t1 .pname svg{color:#1555aa}.partrow.t2 .pname svg{color:#6937a5}.partrow.t7 .pname svg{color:#7b1fa2}.partrow.cash .pname svg{color:#157a3c}
.partrow .pamt{display:flex;gap:6px}
.partrow .pamt input{flex:1;min-width:0;padding:10px;border:1px solid var(--line);border-radius:9px;background:#f9fbfd;text-align:left;direction:ltr}
.partrow .pref{grid-column:1/-1;padding:9px 10px;border:1px solid var(--line);border-radius:9px;background:#f9fbfd;font-size:12px}
.partrow.cash{background:#f3fbf6;border-color:#cfe9d9}
.partrow .pcash{direction:ltr;text-align:left;font-size:15px;color:#157a3c}
.partrow .pcash.bad{color:var(--red)}
.btn.mini{min-height:38px;padding:6px 10px;font-size:11px}
.bnplok{display:flex;align-items:flex-start;gap:8px;margin-top:12px;padding:10px 12px;background:#fff8e6;border:1px solid #f1d9a6;border-radius:10px;font-size:12px;line-height:1.7}
@media(max-width:760px){.partrow{grid-template-columns:1fr}.partrow .pamt input{font-size:16px}}
.invmeta td.pay{white-space:normal;max-width:260px;line-height:1.6}
/* [ADDED BY CLAUDE] 2026-11-18: طلب تابي/تمارا المباشر داخل صف التقسيط (رمز QR، الحالة، المهلة، أزرار المحاكاة والإلغاء) */
.bnplreq{grid-column:1/-1;display:flex;flex-direction:column;gap:8px}
.bnplreq input{padding:10px;border:1px solid var(--line);border-radius:9px;background:#f9fbfd;text-align:left;direction:ltr}
.bnplfld{font-size:11px;color:var(--muted)}
.bnplreq .seg{display:flex;gap:6px}.bnplreq .seg .btn{flex:1;min-height:38px;font-size:11px;background:#f1f3f6;color:#505864}.bnplreq .seg .btn.on{background:#f3e5f5;color:#7b1fa2;font-weight:600}
.bnplqr{display:flex;justify-content:center}.bnplqr canvas,.bnplqr img{width:200px;height:200px;image-rendering:pixelated;border:1px solid var(--line);border-radius:10px;background:#fff}
.bnplmsg{font-size:12px;line-height:1.7;color:#1d3a6b;white-space:pre-line}.bnplmsg.ok{color:#157a3c;font-weight:600;background:#e1f5e8;border-radius:9px;padding:8px 10px}.bnplmsg.bad{color:var(--red)}
.bnplclock{font-size:11px;color:#6e7887;direction:rtl}
.bnplacts{display:flex;flex-wrap:wrap;gap:6px}.bnplacts .btn{flex:1}
.bnplsim{font-size:11px;background:#fff8e6;border:1px dashed #e0b85a;border-radius:8px;padding:5px 8px;color:#8a5a00;text-align:center}
.btn.wide.mini{width:100%}
.bnplacts .btn.ok{background:#157a3c;color:#fff;border-color:#157a3c}.bnplreq .btn.primary.wide{margin-top:0}
.bnplid{white-space:nowrap;unicode-bidi:isolate}
/* [ADDED BY CLAUDE] 2026-11-18: «وصف الخدمة» في فاتورة الإيرادات (كمحرر البرنامج): كتلة الوصف في السطر، والمحرر بشريط الخط واللون */
.headlinks{display:flex;gap:14px;align-items:center}
.svcdesc{display:block;width:100%;margin-top:6px;padding:8px 10px;border:1px dashed var(--line);border-radius:9px;background:#fbfcfe;text-align:right;font:13px/1.8 Tahoma,Arial,sans-serif;white-space:pre-line;color:#111;cursor:pointer}
.svcdesc.empty{color:var(--muted);font-size:12px}
.desced{display:flex;flex-direction:column;gap:8px;margin-bottom:12px}
.descbar{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.descbar .desclabel{font-size:12px;color:var(--muted)}
.descbar .descsize{min-width:28px;text-align:center;font-weight:bold;color:#12286e}
.descbar .descsaved{font-size:11px;color:#157a3c}
.descbar .swatch{display:inline-block;width:14px;height:14px;border:1px solid #999;border-radius:3px;margin-left:6px;vertical-align:middle}
.desccolors{display:flex;flex-wrap:wrap;gap:8px;padding:8px;border:1px solid var(--line);border-radius:10px;background:#fff}
.desccolors .dot{width:32px;height:32px;min-height:32px;padding:0;border-radius:50%;border:2px solid #fff;box-shadow:0 0 0 1px #bbb}
.desced textarea{width:100%;min-height:180px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:#f9fbfd;font-family:Tahoma,Arial,sans-serif;line-height:1.8;resize:vertical;box-sizing:border-box}
