/* MEGA_THERM_HOME_CLEANUP_V37_ACTIVE */
/* Mega Therm ERP - Styles
   التصميم والشكل العام للبرنامج */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&display=swap');
    :root{
      --bg:#edf4fa; --card:#ffffff; --nav:#0f182b; --nav2:#1d2a42;
      --text:#061b38; --muted:#7b8aa0; --line:#e4ebf3;
      --blue:#2867e8; --cyan:#21c7dc; --green:#20c997; --red:#ff4d4f; --orange:#ff9f1c;
      --shadow:0 20px 45px rgba(15,24,43,.10); --radius:28px;
    }
    *{box-sizing:border-box}
    body{margin:0;font-family:"Cairo",Tahoma,Arial,sans-serif;background:var(--bg);color:var(--text);overflow-x:hidden}
    .app{min-height:100vh;display:flex;direction:rtl}
    aside{width:340px;min-height:100vh;background:var(--nav);color:#fff;padding:30px 26px 22px;position:fixed;right:0;top:0;bottom:0;display:flex;flex-direction:column;gap:18px;box-shadow:-14px 0 35px rgba(0,0,0,.08);z-index:10}
    .brand{display:flex;align-items:center;gap:14px;padding-bottom:18px;border-bottom:1px solid rgba(255,255,255,.10)}
    .logoBox{width:70px;height:70px;border-radius:24px;display:grid;place-items:center;background:linear-gradient(135deg,#1d7bff,#24d5e0);color:#fff;font-weight:900;letter-spacing:.4px;box-shadow:0 14px 25px rgba(33,199,220,.25)}
    .brand h1{font-size:20px;margin:0;line-height:1.2;font-weight:900}.brand p{margin:6px 0 0;color:#9dafc6;font-size:12px;font-weight:700;line-height:1.6}
    nav{display:flex;flex-direction:column;gap:8px;flex:1;overflow:auto;padding-left:4px}.navGroupTitle{font-size:12px;color:#7f90aa;font-weight:900;margin:10px 14px 2px}
    .navItem{border:0;background:transparent;color:#dfe8f7;font-family:inherit;font-size:14px;font-weight:900;padding:12px 14px;border-radius:18px;display:flex;align-items:center;justify-content:space-between;gap:12px;cursor:pointer;transition:.22s;text-align:right}
    .navItem span{display:flex;align-items:center;gap:11px}.navItem:hover{background:rgba(255,255,255,.06);transform:translateX(-3px)}.navItem.active{background:var(--nav2);box-shadow:inset -5px 0 0 var(--cyan);color:#fff}
    .userCard{background:rgba(255,255,255,.08);border-radius:22px;padding:16px;display:flex;align-items:center;gap:13px}.avatar{width:46px;height:46px;border-radius:16px;background:linear-gradient(135deg,#e82835,#111827,#22b36b);display:grid;place-items:center;font-weight:900}.userCard strong{display:block;font-size:15px}.userCard small{display:block;color:#9dafc6;margin-top:3px}
    .logout{border:0;background:#321e2c;color:#ffd1cf;font-family:inherit;font-weight:900;padding:13px 18px;border-radius:18px;cursor:pointer;font-size:14px}
    main{margin-right:340px;width:calc(100% - 340px);min-height:100vh;padding:42px 38px}.topBar{display:flex;align-items:flex-start;justify-content:space-between;gap:22px;margin-bottom:30px}.pageTitle h2{margin:0;font-size:40px;font-weight:900;letter-spacing:-.8px}.pageTitle p{margin:6px 0 0;color:var(--muted);font-size:17px;font-weight:700;line-height:1.8}.desktopBadge{background:#fff;color:#2867e8;border:1px solid #dde9f6;border-radius:999px;padding:13px 21px;font-weight:900;box-shadow:0 12px 28px rgba(15,24,43,.08);white-space:nowrap}
    .grid4{display:grid;grid-template-columns:repeat(4,1fr);gap:20px;margin-bottom:24px}.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:20px;margin-bottom:24px}.statCard{background:var(--card);border:1px solid #e3edf7;border-radius:var(--radius);padding:22px;box-shadow:0 18px 35px rgba(15,24,43,.06);display:flex;align-items:center;justify-content:space-between;min-height:132px}.statText h3{margin:0 0 8px;font-size:16px;color:#60718a;font-weight:900}.statText strong{display:block;font-size:29px;font-weight:900;color:#050f24;line-height:1.1}.statText small{display:block;color:#95a2b6;margin-top:13px;font-weight:800;font-size:13px}.statIcon{width:56px;height:56px;border-radius:20px;display:grid;place-items:center;background:#eef6ff;font-size:25px}
    .layout{display:grid;grid-template-columns:420px 1fr;gap:24px;align-items:start}.panel{background:#fff;border:1px solid #e3edf7;border-radius:var(--radius);box-shadow:var(--shadow);padding:24px 26px;margin-bottom:24px}.panelHead{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:20px}.panel h3{margin:0;font-size:25px;font-weight:900}.miniText{color:#7b8aa0;font-size:13px;font-weight:800;margin-top:4px;line-height:1.7}
    .btn{border:0;background:#edf5ff;color:#2867e8;font-family:inherit;font-weight:900;padding:11px 16px;border-radius:15px;cursor:pointer;transition:.2s;font-size:14px}.btn:hover{transform:translateY(-2px)}.btn.primary{background:linear-gradient(135deg,var(--blue),var(--cyan));color:#fff;box-shadow:0 12px 22px rgba(40,103,232,.22)}.btn.danger{background:#fff0f0;color:#df2f3a}.btn.green{background:#ecfff8;color:#0a9669}.btn.dark{background:#111a2d;color:#fff}.btn.orange{background:#fff5e6;color:#c66a00}
    .progressItem{margin:16px 0}.progressRow{display:flex;align-items:center;justify-content:space-between;font-weight:900;font-size:15px;margin-bottom:9px}.track{height:15px;background:#e4ebf3;border-radius:999px;overflow:hidden}.fill{height:100%;border-radius:999px;background:linear-gradient(90deg,var(--blue),var(--cyan))}.fill.orange{background:linear-gradient(90deg,#ff4d4f,#ffb11f)}.fill.green{background:linear-gradient(90deg,#1aaf77,#22d3ae)}
    table{width:100%;border-collapse:collapse;overflow:hidden}th,td{padding:14px 10px;border-bottom:1px solid #e9eef5;text-align:right;
  direction:ltr;vertical-align:middle;font-weight:700}th{color:#62738d;font-size:13px;font-weight:900}td{color:#21334d;font-size:14px}.tag{display:inline-flex;align-items:center;justify-content:center;padding:7px 11px;border-radius:999px;font-weight:900;font-size:12px;white-space:nowrap}.tag.blue{background:#e8f7ff;color:#047aa8}.tag.yellow{background:#fff4cc;color:#9a6100}.tag.green{background:#dffbec;color:#087443}.tag.red{background:#ffe2e2;color:#c92727}.tag.gray{background:#eef1f5;color:#59677a}.tag.dark{background:#ecf0f6;color:#13213a}
    .moduleGrid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}.moduleCard{background:#fff;border:1px solid #e3edf7;border-radius:22px;padding:20px;box-shadow:0 14px 30px rgba(15,24,43,.05)}.moduleCard h4{margin:0 0 8px;font-size:18px;font-weight:900}.moduleCard p{margin:0;color:#738399;line-height:1.8;font-weight:700;font-size:13px}
    .formGrid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-bottom:18px}label{display:block;color:#64748b;font-weight:900;margin-bottom:7px;font-size:13px}input,select,textarea{width:100%;border:1px solid #dfe8f2;background:#f8fbff;border-radius:15px;padding:12px 13px;font-family:inherit;font-size:14px;color:#0f213a;outline:none;transition:.2s}input:focus,select:focus,textarea:focus{border-color:#25bfd8;box-shadow:0 0 0 4px rgba(33,199,220,.12);background:#fff}textarea{min-height:86px;resize:vertical}.full{grid-column:1/-1}.toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:18px;flex-wrap:wrap}.search{max-width:360px}.hidden{display:none!important}.actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.tabs{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:18px}.tab{border:1px solid #dfe8f2;background:#fff;color:#52657f;border-radius:999px;padding:10px 15px;cursor:pointer;font-weight:900;font-family:inherit}.tab.active{background:linear-gradient(135deg,var(--blue),var(--cyan));color:#fff;border-color:transparent}
    .loginScreen{min-height:100vh;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at top left,rgba(33,199,220,.18),transparent 35%), var(--bg)}.loginCard{width:min(520px,100%);background:#fff;border:1px solid #e3edf7;border-radius:34px;padding:36px;box-shadow:var(--shadow)}.loginLogo{width:82px;height:82px;border-radius:26px;margin:0 auto 20px;display:grid;place-items:center;background:linear-gradient(135deg,#e82835,#111827,#22b36b);color:#fff;font-weight:900;font-size:17px}.loginCard h2{margin:0;font-size:31px;text-align:center;font-weight:900}.loginCard p{text-align:center;color:#738399;font-weight:700;line-height:1.8;margin:10px 0 24px}.loginNote{background:#f3f7fc;border:1px dashed #cdd9e6;border-radius:18px;padding:13px;color:#60718a;font-weight:800;text-align:center;margin-top:16px;font-size:14px}
    .certificate{border:2px solid #13213a;border-radius:22px;padding:30px;background:#fff;max-width:900px;margin:auto;color:#13213a}.certificate .certHead{display:flex;justify-content:space-between;align-items:center;border-bottom:2px solid #13213a;padding-bottom:18px;margin-bottom:20px}.certificate h1{margin:0;font-size:32px}.certLogo{width:90px;height:70px;border-radius:18px;background:linear-gradient(135deg,#e82835,#111827,#22b36b);color:#fff;display:grid;place-items:center;font-weight:900}.certGrid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}.certBox{background:#f6f8fb;border:1px solid #e0e7ef;border-radius:14px;padding:12px;font-weight:800}.certBox span{display:block;color:#64748b;font-size:12px;margin-bottom:4px}.certFoot{margin-top:28px;display:flex;justify-content:space-between;gap:20px}.signature{border-top:1px solid #13213a;padding-top:10px;min-width:180px;text-align:center;font-weight:900}
    @media(max-width:1200px){.grid4{grid-template-columns:repeat(2,1fr)}.grid3{grid-template-columns:1fr}.layout{grid-template-columns:1fr}.moduleGrid{grid-template-columns:repeat(2,1fr)}.formGrid{grid-template-columns:1fr 1fr}}
    @media(max-width:900px){aside{position:relative;width:100%;min-height:auto;border-radius:0 0 28px 28px}main{margin-right:0;width:100%;padding:28px 18px}.app{display:block}.topBar{flex-direction:column}.pageTitle h2{font-size:31px}.grid4,.grid3,.moduleGrid,.formGrid{grid-template-columns:1fr}.certGrid{grid-template-columns:1fr}}
    @media print{body{background:#fff}aside,.topBar,.toolbar,.panelHead .btn,.formGrid,.actions,.desktopBadge,.tabs,.noPrint{display:none!important}main{margin:0;width:100%;padding:0}.panel{box-shadow:none;border:0;border-radius:0}.certificate{border:2px solid #000}}

/* ===== Mega Therm Warranty Certificate - Classic Gold Design ===== */
.warrantyCertificatePanel{background:#f7f1df}
.classicWarranty{position:relative;overflow:hidden;max-width:980px;margin:0 auto;padding:42px 46px;background:linear-gradient(rgba(255,255,255,.93),rgba(255,255,255,.93)),radial-gradient(circle at top,#fff7df 0,#ffffff 45%,#fff8e5 100%);border:10px double #b98a2d;outline:3px solid #ead7a3;outline-offset:-20px;border-radius:12px;color:#1f2633;box-shadow:0 25px 60px rgba(75,52,16,.16)}
.classicWarranty::after{content:"";position:absolute;inset:22px;border:1px solid rgba(185,138,45,.55);pointer-events:none}
.qualityWatermark{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%) rotate(-28deg);font-size:72px;font-weight:900;color:rgba(185,138,45,.09);letter-spacing:3px;text-transform:uppercase;white-space:nowrap;z-index:0}
.classicWarranty>*:not(.qualityWatermark){position:relative;z-index:1}
.certTopOrnament{display:flex;align-items:center;justify-content:center;gap:18px;margin-bottom:20px;color:#9b6d17;font-weight:900;letter-spacing:2px}
.certTopOrnament span{height:2px;width:150px;background:linear-gradient(90deg,transparent,#b98a2d,transparent)}
.classicCertHead{display:flex;align-items:center;justify-content:space-between;gap:24px;border-bottom:2px solid #caa24c;padding-bottom:22px;margin-bottom:22px}
.certLogoWrap{display:flex;align-items:center;gap:16px}
.classicCertHead .certLogo{width:92px;height:72px;border-radius:18px;background:linear-gradient(135deg,#e82835,#111827 52%,#22b36b);color:#fff;display:grid;place-items:center;font-weight:900;box-shadow:0 14px 24px rgba(0,0,0,.16)}
.classicCertHead h2{margin:0;font-size:26px;font-weight:900;color:#13213a}
.classicCertHead p{margin:5px 0 0;color:#7a5a18;font-size:14px;font-weight:900}
.certMeta{min-width:190px;text-align:center;border:1px solid #caa24c;border-radius:14px;padding:13px 16px;background:rgba(255,250,235,.8)}
.certMeta strong,.certMeta span,.certMeta small{display:block}
.certMeta strong{color:#6f5011;font-size:13px;margin-bottom:4px}
.certMeta span{font-size:22px;font-weight:900;color:#13213a}
.certMeta small{color:#6b7280;font-weight:800;margin-top:3px}
.certTitleBlock{text-align:center;margin:24px 0 22px}
.certTitleBlock h1{display:inline-block;margin:0;padding:5px 36px 10px;font-size:44px;font-weight:900;color:#13213a;border-bottom:3px solid #b98a2d}
.certTitleBlock p{margin:12px 0 0;color:#5f6b7c;font-weight:900;line-height:1.8}
.certIntro{border:1px solid #ead7a3;background:rgba(255,252,242,.78);border-radius:18px;padding:16px 20px;line-height:2;font-size:15px;font-weight:800;color:#24344d;margin-bottom:20px}
.certSection{margin-top:20px}
.certSection h3,.certTerms h3{margin:0 0 12px;font-size:19px;font-weight:900;color:#8a6419;display:flex;align-items:center;gap:10px}
.certSection h3::before,.certTerms h3::before{content:"";width:28px;height:3px;background:#b98a2d;border-radius:999px}
.classicWarranty .certGrid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
.classicWarranty .certBox{background:rgba(255,255,255,.84);border:1px solid #ead7a3;border-radius:14px;padding:12px 14px;font-weight:900}
.classicWarranty .certBox span{display:block;color:#7b6a45;font-size:12px;margin-bottom:4px;font-weight:900}
.classicWarranty .certBox strong{display:block;color:#13213a;font-size:15px;line-height:1.7}
.fullCertBox{grid-column:1/-1}
.certTerms{margin-top:22px;padding:16px 18px;background:rgba(255,250,235,.75);border:1px dashed #caa24c;border-radius:18px}
.certTerms ol{margin:0;padding-right:22px;line-height:2;color:#26364f;font-weight:800}
.certFooter{display:grid;grid-template-columns:1fr 170px 1fr;gap:18px;align-items:end;margin-top:34px}
.certSignBox{min-height:92px;border-top:2px solid #13213a;padding-top:12px;text-align:center}
.certSignBox span{display:block;color:#6f5011;font-weight:900;margin-bottom:8px}
.certSignBox strong{display:block;color:#13213a;font-size:16px;font-weight:900}
.companyStamp{width:150px;height:150px;margin:auto;border:4px double #b92424;border-radius:50%;display:grid;place-items:center;text-align:center;color:#b92424;transform:rotate(-8deg);background:rgba(255,255,255,.45);font-weight:900}
.companyStamp div{font-size:18px}.companyStamp strong{font-size:13px;letter-spacing:1px}
@media print{
  @page{size:A4;margin:10mm}
  body.certificatePrintMode{background:#fff!important}
  body.certificatePrintMode aside,body.certificatePrintMode .topBar,body.certificatePrintMode #content>.panel,body.certificatePrintMode .noPrint{display:none!important}
  body.certificatePrintMode main{margin:0!important;width:100%!important;padding:0!important}
  body.certificatePrintMode #certPreview{display:block!important}
  body.certificatePrintMode #certPreview .panel{display:block!important;padding:0!important;margin:0!important;border:0!important;box-shadow:none!important;background:#fff!important}
  body.certificatePrintMode .classicWarranty{width:100%;max-width:none;min-height:270mm;margin:0;box-shadow:none!important;border:8px double #b98a2d!important;outline:2px solid #ead7a3!important;outline-offset:-16px;border-radius:0;padding:34px 38px}
  body.certificatePrintMode .qualityWatermark{color:rgba(185,138,45,.08)!important}
  body.certificatePrintMode .certTitleBlock h1{font-size:40px}
}
@media(max-width:900px){
  .classicCertHead{flex-direction:column;text-align:center}
  .certLogoWrap{flex-direction:column}
  .classicWarranty .certGrid{grid-template-columns:1fr}
  .certFooter{grid-template-columns:1fr}
}


/* ===== Mega Therm Sales Invoice + Imported Items ===== */
.invoiceFormGrid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:14px;
  margin-bottom:4px;
}
.invoiceLineGrid{
  display:grid;
  grid-template-columns:repeat(6,1fr);
  gap:12px;
  align-items:end;
}
.invoiceLineGrid input[readonly]{
  background:#edf2f7;
  color:#53657f;
  font-weight:900;
}
.invoiceNotesField{
  grid-column:span 2;
}
.invoiceAddButton{
  display:flex;
  align-items:end;
}
.invoiceAddButton .btn{
  width:100%;
}
.invoiceLinesTable th,
.invoiceLinesTable td{
  font-size:12px;
  padding:11px 8px;
}
.invoiceTotalsBar{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:14px;
  flex-wrap:wrap;
  margin-top:18px;
  padding:16px;
  border-radius:20px;
  background:#f7fbff;
  border:1px solid #e3edf7;
}
.invoiceTotalsBar div{
  min-width:180px;
  background:#fff;
  border:1px solid #e3edf7;
  border-radius:16px;
  padding:12px 14px;
}
.invoiceTotalsBar span{
  display:block;
  color:#64748b;
  font-size:12px;
  font-weight:900;
  margin-bottom:4px;
}
.invoiceTotalsBar strong{
  display:block;
  font-size:20px;
  font-weight:900;
  color:#111827;
}
.salesInvoicePaper{
  max-width:1120px;
  margin:auto;
  background:#fff;
  color:#111827;
  border:2px solid #152238;
  border-radius:18px;
  padding:28px;
  box-shadow:0 24px 52px rgba(15,24,43,.10);
}
.invoiceHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:22px;
  border-bottom:4px double #152238;
  padding-bottom:18px;
  margin-bottom:18px;
}
.invoiceHeader h1{
  margin:0;
  font-size:36px;
  font-weight:900;
  color:#111827;
}
.invoiceHeader p{
  margin:6px 0 3px;
  font-weight:900;
  color:#334155;
}
.invoiceHeader small{
  color:#138447;
  font-weight:900;
}
.invoiceLogo{
  width:96px;
  height:76px;
  border-radius:20px;
  background:linear-gradient(135deg,#e82835,#111827 52%,#22b36b);
  color:#fff;
  display:grid;
  place-items:center;
  font-weight:900;
  box-shadow:0 14px 24px rgba(0,0,0,.16);
}
.invoiceInfoGrid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:10px;
  margin-bottom:18px;
}
.invoiceInfoGrid div{
  background:#f8fafc;
  border:1px solid #e2e8f0;
  border-radius:12px;
  padding:10px 12px;
}
.invoiceInfoGrid span{
  display:block;
  color:#64748b;
  font-size:12px;
  font-weight:900;
  margin-bottom:4px;
}
.invoiceInfoGrid strong{
  display:block;
  color:#111827;
  font-weight:900;
  line-height:1.6;
}
.printedInvoiceTable{
  border:1px solid #cbd5e1;
}
.printedInvoiceTable th{
  background:#152238;
  color:#fff;
  border-bottom:0;
  text-align:center;
}
.printedInvoiceTable td{
  border:1px solid #e2e8f0;
  text-align:center;
}
.printedInvoiceTable td:nth-child(2){
  text-align:right;
}
.invoiceBottom{
  display:grid;
  grid-template-columns:1fr 360px;
  gap:18px;
  align-items:start;
  margin-top:20px;
}
.invoiceCategorySummary,
.invoiceFinalTotals{
  border:1px solid #dbe4ef;
  border-radius:16px;
  padding:16px;
  background:#f8fafc;
}
.invoiceCategorySummary h3{
  margin:0 0 12px;
  font-size:18px;
}
.invoiceCategorySummary div,
.invoiceFinalTotals div{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border-bottom:1px dashed #cbd5e1;
  padding:9px 0;
  font-weight:900;
}
.invoiceCategorySummary div:last-child,
.invoiceFinalTotals div:last-child{
  border-bottom:0;
}
.invoiceFinalTotals strong{
  color:#0f766e;
  font-size:18px;
}
.invoiceSignatureRow{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:24px;
  margin-top:34px;
}
.invoiceSignatureRow div{
  border-top:2px solid #111827;
  padding-top:10px;
  text-align:center;
  font-weight:900;
}
@media print{
  @page{
    size:A4 landscape;
    margin:8mm;
  }
  body.invoicePrintMode{
    background:#fff!important;
  }
  body.invoicePrintMode aside,
  body.invoicePrintMode .topBar,
  body.invoicePrintMode #content > .grid4,
  body.invoicePrintMode #content > .panel:not(.invoicePreviewPanel),
  body.invoicePrintMode .noPrint{
    display:none!important;
  }
  body.invoicePrintMode main{
    margin:0!important;
    width:100%!important;
    padding:0!important;
  }
  body.invoicePrintMode #invoicePreview{
    display:block!important;
  }
  body.invoicePrintMode .invoicePreviewPanel{
    display:block!important;
    padding:0!important;
    margin:0!important;
    border:0!important;
    box-shadow:none!important;
    background:#fff!important;
  }
  body.invoicePrintMode .salesInvoicePaper{
    width:100%;
    max-width:none;
    min-height:190mm;
    border-radius:0;
    box-shadow:none!important;
    padding:18px;
  }
  body.invoicePrintMode .printedInvoiceTable th,
  body.invoicePrintMode .printedInvoiceTable td{
    padding:7px 6px;
    font-size:10px;
  }
}
@media(max-width:1100px){
  .invoiceFormGrid{
    grid-template-columns:repeat(2,1fr);
  }
  .invoiceLineGrid{
    grid-template-columns:repeat(3,1fr);
  }
  .invoiceInfoGrid{
    grid-template-columns:repeat(2,1fr);
  }
  .invoiceBottom{
    grid-template-columns:1fr;
  }
}
@media(max-width:700px){
  .invoiceFormGrid,
  .invoiceLineGrid,
  .invoiceInfoGrid,
  .invoiceBottom,
  .invoiceSignatureRow{
    grid-template-columns:1fr;
  }
  .invoiceNotesField{
    grid-column:auto;
  }
  .invoiceHeader{
    flex-direction:column;
    text-align:center;
  }
}


/* ===== Invoice: visible item catalog + quantity by piece / carton ===== */
.invoiceCatalogTools{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:14px;
}
.invoiceCatalogTools .search{
  max-width:none;
  flex:1 1 360px;
}
.invoiceCatalogTools select{
  max-width:240px;
  background:#fff;
}
.invoiceCatalogBox{
  max-height:430px;
  overflow:auto;
  border:1px solid #e3edf7;
  border-radius:22px;
  background:#fff;
}
.invoiceCatalogTable{
  min-width:1040px;
}
.invoiceCatalogTable th{
  position:sticky;
  top:0;
  z-index:2;
  background:#f3f7fc;
  color:#24344d;
  text-align:center;
}
.invoiceCatalogTable td{
  text-align:center;
  font-size:12px;
}
.invoiceCatalogTable td:nth-child(3){
  text-align:right;
  min-width:260px;
}
.invoiceCatalogRow{
  cursor:pointer;
  transition:.18s;
}
.invoiceCatalogRow:hover{
  background:#eef7ff;
}
.invoiceCatalogRow.selected{
  background:#e7fbf7;
  box-shadow:inset -5px 0 0 var(--green);
}
.selectedInvoiceTitle{
  display:inline-flex;
  align-items:center;
  padding:10px 14px;
  border-radius:999px;
  background:#edf5ff;
  color:#2867e8;
  font-size:13px;
  line-height:1.6;
}
.selectedItemGrid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:12px;
  align-items:end;
}
.selectedItemGrid input[readonly]{
  background:#edf2f7;
  color:#53657f;
  font-weight:900;
}
.quantityHintBox{
  grid-column:span 2;
  background:#f7fbff;
  border:1px solid #dbeafe;
  border-radius:18px;
  padding:14px;
  color:#334155;
  font-weight:800;
  line-height:1.8;
}
.quantityHintBox span{
  display:block;
  color:#64748b;
  margin-bottom:8px;
}
.quantityHintBox div{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  border-top:1px dashed #cbd5e1;
  padding-top:7px;
  margin-top:7px;
}
.quantityHintBox strong{
  color:#0f766e;
  font-size:17px;
}
@media(max-width:1100px){
  .selectedItemGrid{
    grid-template-columns:repeat(2,1fr);
  }
}
@media(max-width:700px){
  .invoiceCatalogTools,
  .selectedItemGrid{
    grid-template-columns:1fr;
  }
  .selectedItemGrid{
    display:grid;
  }
  .quantityHintBox,
  .invoiceNotesField{
    grid-column:auto;
  }
}


/* ===== Invoice inline quantity rows - Excel-like selection ===== */
.excelInvoiceBox{
  max-height:560px;
}

.excelInvoiceTable{
  min-width:1180px;
}

.excelInvoiceTable th,
.excelInvoiceTable td{
  border:1px solid #e8edf5;
}

.excelInvoiceTable th{
  background:#f8fafc;
  color:#172033;
  font-size:13px;
}

.excelInvoiceTable td:nth-child(3){
  min-width:320px;
  text-align:right;
  font-weight:900;
}

.invoiceInlineQtyRow td{
  background:#fffaf0;
  padding:0!important;
}

.inlineQtyBox{
  border:2px solid #e6c86d;
  border-radius:0 0 18px 18px;
  margin:0 8px 10px;
  padding:16px;
  background:linear-gradient(135deg,#fffaf0,#ffffff);
  box-shadow:0 14px 28px rgba(185,138,45,.12);
}

.inlineItemTitle{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:14px;
  color:#13213a;
}

.inlineItemTitle strong{
  font-size:16px;
  font-weight:900;
}

.inlineItemTitle span{
  color:#7a5a18;
  font-weight:900;
  font-size:13px;
}

.inlineQtyControls{
  display:grid;
  grid-template-columns:160px 140px 140px 1fr 150px 150px auto;
  gap:12px;
  align-items:end;
}

.inlineQtyControls label{
  text-align:right;
}

.inlineEstimate{
  background:#fff;
  border:1px solid #ead7a3;
  border-radius:14px;
  padding:10px 12px;
  text-align:center;
}

.inlineEstimate span{
  display:block;
  color:#7b6a45;
  font-size:12px;
  font-weight:900;
  margin-bottom:5px;
}

.inlineEstimate strong{
  display:block;
  color:#13213a;
  font-size:15px;
  font-weight:900;
}

@media(max-width:1200px){
  .inlineQtyControls{
    grid-template-columns:repeat(3,1fr);
  }
}

@media(max-width:900px){
  .inlineQtyControls{
    grid-template-columns:1fr;
  }
}

/* ===== Purchase invoices: same item selection, quantities only / no prices ===== */
.purchaseCatalogRow{
  cursor:pointer;
  transition:.18s;
}
.purchaseCatalogRow:hover{
  background:#eef7ff;
}
.purchaseCatalogRow.selected{
  background:#fff6df;
  box-shadow:inset -5px 0 0 var(--orange);
}
.purchaseCatalogTable{
  min-width:1080px;
}
.purchaseCatalogTable td:nth-child(3){
  min-width:330px;
  text-align:right;
  font-weight:900;
}
.purchaseInlineBox{
  background:linear-gradient(135deg,#fff8e7,#ffffff);
  border-color:#f0c764;
}
.purchaseInlineQtyControls{
  grid-template-columns:180px 160px 1fr 180px auto;
}
.purchaseLinesTable th,
.purchaseLinesTable td{
  font-size:12px;
  padding:11px 8px;
}
.purchaseInvoicePaper .invoiceHeader{
  border-bottom-color:#9a6a12;
}
.purchaseInvoicePaper .invoiceHeader h1{
  color:#8a5d0f;
}
.purchasePrintedTable th{
  background:#8a5d0f;
}
@media(max-width:1200px){
  .purchaseInlineQtyControls{
    grid-template-columns:repeat(3,1fr);
  }
}
@media(max-width:900px){
  .purchaseInlineQtyControls{
    grid-template-columns:1fr;
  }
}


/* ===== Company & product logos ===== */
.logoBox,
.loginLogo{
  color:transparent!important;
  font-size:0!important;
  background:#ffffff url('../assets/logos/mega-therm-ppr.png') center/contain no-repeat!important;
  border:1px solid rgba(255,255,255,.20);
}
.logoBox{
  width:96px!important;
  height:58px!important;
  border-radius:16px!important;
  background-color:rgba(255,255,255,.08)!important;
  box-shadow:0 14px 25px rgba(0,0,0,.14)!important;
  flex:0 0 96px;
}
.loginLogo{
  width:210px!important;
  height:118px!important;
  border-radius:22px!important;
  margin:0 auto 20px!important;
  background-color:#fff!important;
  box-shadow:0 16px 32px rgba(15,24,43,.10)!important;
}
.invoiceLogo,
.certLogo{
  background:#fff!important;
  color:transparent!important;
  border:1px solid #e7edf5!important;
  padding:8px!important;
  overflow:hidden;
}
.invoiceLogo{
  width:180px!important;
  height:92px!important;
  border-radius:18px!important;
}
.classicCertHead .certLogo,
.certLogo{
  width:190px!important;
  height:100px!important;
  border-radius:18px!important;
}
.invoiceLogoImg,
.certLogoImg,
.companyLogoImg{
  display:block;
  width:100%;
  height:100%;
  object-fit:contain;
}
.categoryLogoImg{
  display:block;
  width:82px;
  height:42px;
  object-fit:contain;
  margin:auto;
  background:#fff;
  border:1px solid #e8eef6;
  border-radius:10px;
  padding:4px;
}
.brandChip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  background:#fff;
  border:1px solid #e5edf6;
  border-radius:999px;
  padding:5px 9px;
  font-weight:900;
  white-space:nowrap;
  box-shadow:0 6px 14px rgba(15,24,43,.05);
}
.brandChip b{
  color:#13213a;
  font-size:12px;
}
.brandChip small{
  color:#64748b;
  font-size:10px;
  direction:ltr;
}
.categoryLogoTiny{
  display:block;
  width:42px;
  height:22px;
  object-fit:contain;
}
.logosGrid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:16px;
}
.logosGrid > div{
  background:#fff;
  border:1px solid #e3edf7;
  border-radius:22px;
  padding:18px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:12px;
  min-height:150px;
  text-align:center;
  box-shadow:0 14px 30px rgba(15,24,43,.05);
}
.settingsLogoImg{
  display:block;
  max-width:170px;
  width:100%;
  height:82px;
  object-fit:contain;
}
.logosGrid strong{
  font-size:13px;
  color:#13213a;
  font-weight:900;
}
.invoiceHeader .invoiceLogo{
  flex:0 0 180px;
}
@media(max-width:1000px){
  .logosGrid{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:650px){
  .logosGrid{grid-template-columns:1fr}
  .invoiceLogo{width:150px!important;height:78px!important}
}
@media print{
  .invoiceLogo,
  .certLogo{
    -webkit-print-color-adjust:exact;
    print-color-adjust:exact;
  }
  .brandChip{
    box-shadow:none!important;
  }
}

/* ===== Invoice cartons, edit mode, clearer logo ===== */
.invoiceEditNotice{
  background:#fff7df;
  border:1px solid #f2d48a;
  color:#7a5200;
  border-radius:18px;
  padding:13px 16px;
  margin-bottom:16px;
  font-weight:900;
  line-height:1.8;
}
.linePackingMini{
  margin-top:5px;
  font-size:11px;
  color:#64748b;
  font-weight:900;
  line-height:1.5;
}
.invoiceLinesTable .linePackingMini,
.printedInvoiceTable .linePackingMini{
  display:block;
}
.invoiceTotalsBar div{
  min-width:205px;
}
.salesInvoicePaper .invoiceHeader{
  align-items:center;
  min-height:150px;
}
.salesInvoicePaper .invoiceLogo{
  width:280px!important;
  height:135px!important;
  flex:0 0 280px!important;
  padding:10px!important;
  border-radius:22px!important;
  background:#fff!important;
  box-shadow:0 18px 34px rgba(15,24,43,.12)!important;
}
.salesInvoicePaper .invoiceLogoImg{
  width:100%!important;
  height:100%!important;
  object-fit:contain!important;
}
.printedInvoiceTable th,
.printedInvoiceTable td{
  font-size:11px;
  padding:9px 7px;
}
.printedInvoiceTable .brandChip{
  transform:scale(.9);
}
@media print{
  body.invoicePrintMode .salesInvoicePaper .invoiceLogo{
    width:250px!important;
    height:115px!important;
    flex:0 0 250px!important;
    box-shadow:none!important;
  }
  body.invoicePrintMode .printedInvoiceTable th,
  body.invoicePrintMode .printedInvoiceTable td{
    font-size:9.8px!important;
    padding:6px 5px!important;
  }
  body.invoicePrintMode .linePackingMini{
    font-size:9px!important;
  }
}
@media(max-width:900px){
  .salesInvoicePaper .invoiceHeader{
    flex-direction:column;
    text-align:center;
  }
  .salesInvoicePaper .invoiceLogo{
    width:230px!important;
    height:112px!important;
    flex:0 0 auto!important;
  }
}


/* ===== Clean Sales Invoice Header + Branch Discounts ===== */
.cleanSalesInvoicePaper{
  border-radius:14px;
  padding:26px 30px;
  border:2px solid #101827;
}

.cleanInvoiceHeader{
  direction:rtl;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:28px!important;
  min-height:auto!important;
  padding-bottom:16px!important;
  margin-bottom:16px!important;
  border-bottom:4px double #111827!important;
}

.invoiceCompanyBlock{
  text-align:right;
  flex:1;
}

.invoiceCompanyBlock h1{
  margin:0 0 6px;
  font-size:34px;
  font-weight:900;
  color:#111827;
}

.invoiceCompanyBlock p{
  margin:0 0 5px;
  font-size:16px;
  font-weight:900;
  color:#243044;
}

.invoiceCompanyBlock small{
  display:block;
  color:#118142;
  font-size:14px;
  font-weight:900;
}

.invoiceBrandLogos{
  direction:ltr;
  display:grid;
  grid-template-columns:repeat(2,78px);
  gap:8px;
  align-items:center;
  justify-content:center;
  flex:0 0 166px;
  padding:8px;
  border:1px solid #e5edf6;
  border-radius:16px;
  background:#fff;
}

.invoiceHeaderLogoImg{
  display:block;
  width:78px;
  height:38px;
  object-fit:contain;
  background:#fff;
  border:1px solid #edf2f7;
  border-radius:10px;
  padding:3px;
}

.cleanPrintedInvoiceTable th,
.cleanPrintedInvoiceTable td{
  font-size:11.3px;
  padding:8px 6px;
}

.cleanPrintedInvoiceTable th{
  background:#111827!important;
  color:#fff!important;
}

.cleanPrintedInvoiceTable td:nth-child(2){
  min-width:210px;
}

.cleanInvoiceBottom{
  display:flex!important;
  justify-content:flex-end;
  align-items:flex-start;
  margin-top:18px;
}

.compactInvoiceTotals{
  width:360px;
  max-width:100%;
}

.compactInvoiceTotals div{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.invoiceFormGrid input#invoiceDefaultDiscount{
  font-weight:900;
  color:#0f766e;
}

@media print{
  body.invoicePrintMode .cleanSalesInvoicePaper{
    padding:18px 20px!important;
    border-radius:0!important;
  }

  body.invoicePrintMode .cleanInvoiceHeader{
    min-height:0!important;
    padding-bottom:12px!important;
    margin-bottom:12px!important;
  }

  body.invoicePrintMode .invoiceCompanyBlock h1{
    font-size:28px!important;
  }

  body.invoicePrintMode .invoiceCompanyBlock p{
    font-size:13px!important;
  }

  body.invoicePrintMode .invoiceCompanyBlock small{
    font-size:12px!important;
  }

  body.invoicePrintMode .invoiceBrandLogos{
    grid-template-columns:repeat(2,64px);
    flex:0 0 140px;
    gap:6px;
    padding:6px;
  }

  body.invoicePrintMode .invoiceHeaderLogoImg{
    width:64px;
    height:30px;
    padding:2px;
  }

  body.invoicePrintMode .cleanPrintedInvoiceTable th,
  body.invoicePrintMode .cleanPrintedInvoiceTable td{
    font-size:9.5px!important;
    padding:5px 4px!important;
  }

  body.invoicePrintMode .compactInvoiceTotals{
    width:320px;
  }
}

@media(max-width:900px){
  .cleanInvoiceHeader{
    flex-direction:column!important;
    text-align:center;
  }
  .invoiceCompanyBlock{
    text-align:center;
  }
  .invoiceBrandLogos{
    flex:0 0 auto;
  }
}


/* ===== Dashboard Control View ===== */
.dashboardNotice{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  background:#fff7e8;
  border:1px solid #ffe0a6;
  color:#805000;
  border-radius:22px;
  padding:15px 18px;
  margin-bottom:20px;
  box-shadow:0 12px 28px rgba(15,24,43,.05);
  font-weight:900;
}
.dashboardNotice span{
  color:#8b6a2a;
  font-size:13px;
  line-height:1.8;
}
.dashboardStats .statCard,
.clickableStat{
  cursor:pointer;
  transition:.22s;
}
.clickableStat:hover{
  transform:translateY(-4px);
  border-color:#bfeeff;
  box-shadow:0 24px 45px rgba(40,103,232,.10);
}
.dashboardControlGrid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:16px;
}
.dashboardControlCard{
  background:#f8fbff;
  border:1px solid #e3edf7;
  border-radius:22px;
  padding:20px;
  min-height:178px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap:14px;
}
.dashboardControlCard h4{
  margin:0;
  font-size:18px;
  font-weight:900;
  color:#13213a;
}
.dashboardControlCard p{
  margin:0;
  color:#738399;
  line-height:1.8;
  font-weight:800;
  font-size:13px;
}
@media(max-width:1200px){.dashboardControlGrid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:900px){.dashboardNotice{flex-direction:column;align-items:flex-start}.dashboardControlGrid{grid-template-columns:1fr}}


/* ===== Master Dashboard Section Icons ===== */
.sectionControlSearchBar{
  display:flex;
  justify-content:flex-end;
  margin:0 0 18px;
}
.sectionIconGrid{
  display:grid;
  grid-template-columns:repeat(6,1fr);
  gap:14px;
}
.sectionIconTile{
  border:1px solid #e3edf7;
  background:#ffffff;
  border-radius:22px;
  padding:18px 12px;
  min-height:150px;
  cursor:pointer;
  font-family:inherit;
  color:#13213a;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:7px;
  text-align:center;
  transition:.22s;
  box-shadow:0 12px 28px rgba(15,24,43,.05);
}
.sectionIconTile:hover{
  transform:translateY(-4px);
  border-color:#9be8f5;
  box-shadow:0 22px 42px rgba(40,103,232,.12);
}
.sectionIconTile.active{
  background:linear-gradient(180deg,#effbff,#ffffff);
  border-color:#21c7dc;
  box-shadow:0 22px 42px rgba(33,199,220,.18);
}
.sectionTileIcon{
  width:54px;
  height:54px;
  border-radius:20px;
  display:grid;
  place-items:center;
  background:#eef6ff;
  font-size:26px;
}
.sectionIconTile strong{
  display:block;
  font-size:15px;
  font-weight:900;
  line-height:1.4;
}
.sectionIconTile small{
  display:block;
  color:#7b8aa0;
  font-size:12px;
  font-weight:800;
}
.sectionIconTile em{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:58px;
  padding:5px 10px;
  border-radius:999px;
  font-style:normal;
  font-size:11px;
  font-weight:900;
}
.sectionIconTile em.on{
  background:#dffbec;
  color:#087443;
}
.sectionIconTile em.off{
  background:#ffe2e2;
  color:#c92727;
}
.dashboardEditorPanel{
  border-color:#c8f4fb;
}
.dashboardEditorPanel > .sectionControlCard{
  margin-top:18px;
}
.sectionControlCard{
  background:#f8fbff;
  border:1px solid #e3edf7;
  border-radius:24px;
  padding:20px;
  box-shadow:0 14px 30px rgba(15,24,43,.04);
}
.sectionControlCardHead{
  display:flex;
  align-items:center;
  gap:13px;
  margin-bottom:18px;
}
.sectionControlIcon{
  width:56px;
  height:56px;
  border-radius:20px;
  display:grid;
  place-items:center;
  background:linear-gradient(135deg,#eef6ff,#e8fbff);
  font-size:26px;
}
.sectionControlCardHead h4{
  margin:0;
  font-size:22px;
  font-weight:900;
  color:#13213a;
}
.sectionControlCardHead p{
  margin:4px 0 0;
  color:#7b8aa0;
  font-size:13px;
  font-weight:800;
}
.sectionControlForm{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:14px;
  margin-bottom:18px;
}
.sectionControlForm .full{
  grid-column:1/-1;
}
.sectionFeatureGrid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:10px;
  margin:8px 0 18px;
}
.switchLine{
  margin:0;
  display:flex;
  align-items:center;
  gap:8px;
  background:#fff;
  border:1px solid #e5edf6;
  border-radius:16px;
  padding:11px 12px;
  color:#25364f;
  cursor:pointer;
  font-size:13px;
}
.switchLine input{
  width:auto;
  accent-color:#21c7dc;
}
.switchLine span{
  font-weight:900;
}
.sectionControlActions{
  border-top:1px solid #e3edf7;
  padding-top:14px;
}
.dashboardHelpStrip{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:10px;
  margin-bottom:16px;
}
.dashboardHelpStrip div{
  background:#fff;
  border:1px solid #e3edf7;
  border-radius:18px;
  padding:13px;
}
.dashboardHelpStrip b,
.dashboardHelpStrip span{
  display:block;
}
.dashboardHelpStrip b{
  color:#13213a;
  font-size:13px;
  margin-bottom:4px;
}
.dashboardHelpStrip span{
  color:#7b8aa0;
  font-size:12px;
  line-height:1.7;
  font-weight:800;
}
@media(max-width:1300px){
  .sectionIconGrid{grid-template-columns:repeat(4,1fr)}
  .sectionFeatureGrid,.dashboardHelpStrip{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:900px){
  .sectionIconGrid{grid-template-columns:repeat(2,1fr)}
  .sectionControlForm{grid-template-columns:1fr}
  .sectionFeatureGrid,.dashboardHelpStrip{grid-template-columns:1fr}
}


/* ===== Dashboard Admin Users ===== */
.dashboardAdminPanel{
  border:1px solid #dbeafe;
  background:linear-gradient(180deg,#ffffff,#f8fbff);
}
.adminHint{
  margin-top:16px;
  border:1px dashed #cbd5e1;
  background:#f8fafc;
  border-radius:18px;
  padding:14px 16px;
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  align-items:center;
  color:#475569;
  font-weight:800;
}
.adminHint strong{
  color:#0f172a;
}
.accessDeniedPanel{
  text-align:center;
  padding:45px;
}
.accessDeniedPanel h3{
  color:#b91c1c;
  margin-bottom:10px;
}
.accessDeniedPanel p{
  margin:0;
  color:#64748b;
  font-weight:800;
  line-height:1.9;
}

.ownerOnlyHint{
  border:1px solid #fde68a;
  background:#fffbeb;
  color:#92400e;
  border-radius:16px;
  padding:12px 14px;
  font-weight:900;
  margin-bottom:14px;
}


/* ===== Owner Gate for Dashboard ===== */
.dashboardGateOverlay{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.58);
  backdrop-filter:blur(8px);
  z-index:99999;
  display:grid;
  place-items:center;
  padding:24px;
}

.dashboardGateCard{
  width:min(460px,100%);
  background:#fff;
  border:1px solid #e2e8f0;
  border-radius:30px;
  padding:32px;
  box-shadow:0 30px 80px rgba(2,6,23,.25);
  position:relative;
  text-align:center;
  animation:dashboardGateIn .2s ease-out;
}

@keyframes dashboardGateIn{
  from{opacity:0;transform:translateY(12px) scale(.98)}
  to{opacity:1;transform:translateY(0) scale(1)}
}

.dashboardGateClose{
  position:absolute;
  top:16px;
  left:16px;
  width:38px;
  height:38px;
  border:0;
  border-radius:14px;
  background:#f1f5f9;
  color:#0f172a;
  font-size:24px;
  font-weight:900;
  cursor:pointer;
}

.dashboardGateIcon{
  width:74px;
  height:74px;
  border-radius:24px;
  display:grid;
  place-items:center;
  margin:0 auto 16px;
  background:linear-gradient(135deg,#2867e8,#21c7dc);
  color:#fff;
  font-size:32px;
  box-shadow:0 18px 35px rgba(40,103,232,.22);
}

.dashboardGateCard h2{
  margin:0;
  font-size:28px;
  font-weight:900;
  color:#0f172a;
}

.dashboardGateCard p{
  margin:10px 0 20px;
  color:#64748b;
  font-weight:800;
  line-height:1.8;
}

.dashboardGateForm{
  display:grid;
  gap:14px;
  text-align:right;
}

.dashboardGateForm .btn{
  width:100%;
  margin-top:4px;
}

.dashboardGateNote{
  margin-top:16px;
  border:1px dashed #cbd5e1;
  background:#f8fafc;
  border-radius:16px;
  padding:12px;
  color:#475569;
  font-size:13px;
  font-weight:900;
  direction:ltr;
  text-align:center;
}


/* ===== HR / Salaries / Attendance ===== */
.employeeSalaryGrid,.attendanceQuickGrid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:14px;
}
.employeeSalaryCard,.attendanceQuickCard{
  border:1px solid #e3edf7;
  background:#fff;
  border-radius:22px;
  padding:16px;
  box-shadow:0 12px 25px rgba(15,24,43,.05);
}
.employeeSalaryCard b,.attendanceQuickCard b{display:block;font-size:15px;font-weight:900;color:#0f172a;margin-bottom:4px}
.employeeSalaryCard span,.attendanceQuickCard span{display:block;color:#64748b;font-weight:800;font-size:12px;line-height:1.7}
.employeeSalaryCard strong{display:block;margin-top:10px;font-size:20px;font-weight:900;color:#0f766e}
.attendanceTimes{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0}
.attendanceTimes small{background:#f1f5f9;border-radius:999px;padding:6px 9px;color:#475569;font-weight:900}
.payrollPanel,.attendancePanel{border-color:#dbeafe;background:linear-gradient(180deg,#fff,#f8fbff)}
@media(max-width:1200px){.employeeSalaryGrid,.attendanceQuickGrid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:700px){.employeeSalaryGrid,.attendanceQuickGrid{grid-template-columns:1fr}}


/* ===== Payroll Actions / Monthly Salary Sheet ===== */
.payrollActions{
  justify-content:flex-end;
}

.payrollFlow{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:12px;
  margin:0 0 20px;
}

.payrollFlow div{
  background:#f8fbff;
  border:1px solid #e2e8f0;
  border-radius:18px;
  padding:14px;
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:900;
  color:#334155;
}

.payrollFlow b{
  width:32px;
  height:32px;
  border-radius:12px;
  display:grid;
  place-items:center;
  background:linear-gradient(135deg,#2867e8,#21c7dc);
  color:#fff;
}

.payrollPrintArea table strong{
  color:#0f172a;
}

@media(max-width:900px){
  .payrollFlow{
    grid-template-columns:1fr;
  }
}

@media print{
  body.payrollPrintMode aside,
  body.payrollPrintMode .topBar,
  body.payrollPrintMode .grid4,
  body.payrollPrintMode .payrollPanel,
  body.payrollPrintMode .panel:not(.payrollPrintArea),
  body.payrollPrintMode .noPrint{
    display:none!important;
  }

  body.payrollPrintMode main{
    margin:0!important;
    width:100%!important;
    padding:0!important;
  }

  body.payrollPrintMode .payrollPrintArea{
    display:block!important;
    box-shadow:none!important;
    border:0!important;
    padding:0!important;
    margin:0!important;
  }
}


/* ===== Locked Partners Section ===== */
.partnersSummaryPanel{
  background:linear-gradient(180deg,#ffffff,#fbfdff);
}

.partnersRoleGrid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:14px;
}

.partnersRoleGrid div{
  background:#f8fbff;
  border:1px solid #dbeafe;
  border-radius:20px;
  padding:18px;
}

.partnersRoleGrid b{
  display:block;
  font-size:18px;
  color:#0f172a;
  margin-bottom:7px;
}

.partnersRoleGrid span{
  display:block;
  color:#64748b;
  font-weight:800;
  line-height:1.8;
}

@media(max-width:900px){
  .partnersRoleGrid{
    grid-template-columns:1fr;
  }
}


/* ===== Finance / Treasury / Profits ===== */
.financeAccountGrid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:16px;
  margin-bottom:24px;
}
.financeAccountCard{
  background:#fff;
  border:1px solid #e3edf7;
  border-radius:24px;
  padding:20px;
  box-shadow:0 14px 30px rgba(15,24,43,.06);
}
.financeAccountCard span{
  display:inline-flex;
  padding:6px 10px;
  border-radius:999px;
  background:#eef6ff;
  color:#2867e8;
  font-size:12px;
  font-weight:900;
}
.financeAccountCard h4{
  margin:12px 0 6px;
  color:#0f172a;
  font-size:18px;
  font-weight:900;
}
.financeAccountCard strong{
  display:block;
  font-size:28px;
  font-weight:900;
  color:#061b38;
}
.financeAccountCard small{
  display:block;
  margin-top:8px;
  color:#64748b;
  font-weight:800;
}
.profitLayout{
  grid-template-columns:1fr 1fr;
}
.profitBreakdown{
  display:grid;
  gap:10px;
}
.profitBreakdown div{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border:1px solid #e2e8f0;
  background:#f8fbff;
  border-radius:16px;
  padding:12px 14px;
  font-weight:900;
}
.profitBreakdown div.net{
  background:#ecfff8;
  border-color:#bbf7d0;
  color:#087443;
}
.profitBreakdown span{
  color:#64748b;
}
.profitBreakdown strong{
  color:#0f172a;
}
@media(max-width:1200px){.financeAccountGrid{grid-template-columns:repeat(2,1fr)}.profitLayout{grid-template-columns:1fr}}
@media(max-width:900px){.financeAccountGrid{grid-template-columns:1fr}}


/* ===== Receipt / Payment Vouchers ===== */
.voucherPanel{background:linear-gradient(180deg,#ffffff,#f8fbff)}
.voucherFormGrid textarea{min-height:82px}
.voucherPrintCard{max-width:850px;margin:18px auto 0;background:#fff;border:2px solid #0f172a;border-radius:18px;padding:30px;color:#0f172a;box-shadow:0 22px 55px rgba(15,23,42,.10)}
.voucherHeader{display:flex;align-items:center;justify-content:space-between;gap:22px;border-bottom:2px solid #e2e8f0;padding-bottom:18px;margin-bottom:18px}
.voucherCompany h2{margin:0;font-size:22px;font-weight:900}.voucherCompany p{margin:6px 0 0;color:#64748b;font-weight:900}.voucherLogoImg{max-width:135px;max-height:78px;object-fit:contain}
.voucherTitle{display:flex;align-items:center;justify-content:space-between;gap:12px;border-radius:18px;padding:16px 20px;margin-bottom:18px}.voucherTitle.receipt{background:#ecfdf5;color:#047857}.voucherTitle.payment{background:#fff7ed;color:#c2410c}.voucherTitle h1{margin:0;font-size:32px;font-weight:900}.voucherTitle span{font-size:22px;font-weight:900;direction:ltr}
.voucherMetaGrid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:16px}.voucherMetaGrid div,.voucherStatement{border:1px solid #e2e8f0;background:#f8fafc;border-radius:14px;padding:13px}.voucherMetaGrid span{display:block;color:#64748b;font-weight:900;font-size:12px}.voucherMetaGrid b{display:block;margin-top:5px;font-weight:900}.voucherAmountBox{border:2px dashed #2563eb;border-radius:18px;padding:18px;text-align:center;margin-bottom:16px;background:#eff6ff}.voucherAmountBox span{display:block;color:#1d4ed8;font-weight:900}.voucherAmountBox strong{display:block;font-size:32px;font-weight:900;margin-top:5px}.voucherStatement p{margin:8px 0;line-height:1.8;font-weight:800}.voucherSignatures{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;margin-top:34px}.voucherSignatures div{border-top:2px solid #0f172a;text-align:center;padding-top:12px;min-height:78px}.voucherSignatures span{display:block;color:#64748b;font-weight:900}.voucherSignatures b{display:block;margin-top:8px;font-weight:900}
@media(max-width:900px){.voucherMetaGrid,.voucherSignatures{grid-template-columns:1fr}.voucherHeader{flex-direction:column;text-align:center}}
@media print{body.voucherPrintMode aside,body.voucherPrintMode .topBar,body.voucherPrintMode #content>.grid4,body.voucherPrintMode #content>.panel,body.voucherPrintMode .noPrint{display:none!important}body.voucherPrintMode main{margin:0!important;width:100%!important;padding:0!important}body.voucherPrintMode #voucherPreview{display:block!important}body.voucherPrintMode .voucherPrintCard{display:block!important;box-shadow:none!important;border-radius:0!important;margin:0!important;max-width:none!important;min-height:270mm!important}}


/* ===== Voucher party select fix ===== */
.voucherManualParty{
  margin-top:8px;
}
.voucherFormGrid select{
  max-height:46px;
}


/* ===== Gamal Profit Holding / Distribution ===== */
.gamalProfitPanel .panelHead{
  align-items:flex-start;
}
.gamalProfitPanel .actions{
  justify-content:flex-end;
}
.gamalProfitPanel .miniText{
  max-width:560px;
}
@media(max-width:900px){
  .gamalProfitPanel .panelHead{
    flex-direction:column;
  }
}


/* ===== Purchase invoice cost price ===== */
.costEstimate strong{
  color:#0f766e;
}
.purchaseTotalsBar{
  grid-template-columns:repeat(3,1fr);
}
.purchaseCatalogTable th,
.purchaseCatalogTable td{
  white-space:nowrap;
}
.purchasePrintedTable th,
.purchasePrintedTable td{
  font-size:12px;
}
@media(max-width:900px){
  .purchaseTotalsBar{
    grid-template-columns:1fr;
  }
}


/* ===== Force visible purchase cost prices ===== */
.purchaseCostBadge,
.costEstimate strong,
.purchaseTotalCostValue{
  color:#0f766e!important;
  font-weight:900!important;
}

.purchaseCatalogTable th:nth-child(5),
.purchaseCatalogTable td:nth-child(5),
.purchaseLinesTable th:nth-child(9),
.purchaseLinesTable td:nth-child(9),
.purchaseLinesTable th:nth-child(10),
.purchaseLinesTable td:nth-child(10),
.purchasePrintedTable th:nth-child(8),
.purchasePrintedTable td:nth-child(8),
.purchasePrintedTable th:nth-child(9),
.purchasePrintedTable td:nth-child(9){
  background:#ecfdf5;
  color:#065f46;
  font-weight:900;
}

.purchaseInvoicePaper .invoiceHeader h1{
  color:#95640e;
}

.purchaseTotalsBar strong{
  color:#065f46;
}


/* ===== Hide internal purchase cost from items/stock screens ===== */
#table_items th,
#table_items td{
  white-space:nowrap;
}

.itemsCostHiddenNote{
  color:#64748b;
  font-weight:800;
  font-size:13px;
}


/* ===== Invoice item table column sizing fix ===== */
/* الكود كان واخد مساحة كبيرة؛ هنا بنصغّر عمود الكود ونوسّع عمود البيان / اسم الصنف */
.invoiceCatalogBox{
  overflow:auto;
}

.invoiceCatalogTable,
.purchaseCatalogTable,
.excelInvoiceTable{
  table-layout:fixed;
  min-width:1180px;
}

.invoiceCatalogTable th,
.invoiceCatalogTable td{
  vertical-align:middle;
}

/* ترتيب الأعمدة في جدول اختيار الأصناف:
1 اختيار — 2 اللوجو — 3 الكود — 4 البيان — باقي البيانات */
.invoiceCatalogTable th:nth-child(1),
.invoiceCatalogTable td:nth-child(1){
  width:105px!important;
  min-width:105px!important;
  max-width:105px!important;
}

.invoiceCatalogTable th:nth-child(2),
.invoiceCatalogTable td:nth-child(2){
  width:120px!important;
  min-width:120px!important;
  max-width:120px!important;
}

.invoiceCatalogTable th:nth-child(3),
.invoiceCatalogTable td:nth-child(3){
  width:125px!important;
  min-width:125px!important;
  max-width:125px!important;
  white-space:nowrap!important;
  overflow:hidden;
  text-overflow:ellipsis;
  font-size:13px;
}

.invoiceCatalogTable th:nth-child(4),
.invoiceCatalogTable td:nth-child(4){
  width:390px!important;
  min-width:390px!important;
  max-width:390px!important;
  white-space:normal!important;
  line-height:1.8;
  text-align:right;
}

.invoiceCatalogTable th:nth-child(5),
.invoiceCatalogTable td:nth-child(5){
  width:90px!important;
  min-width:90px!important;
  max-width:90px!important;
}

.invoiceCatalogTable th:nth-child(6),
.invoiceCatalogTable td:nth-child(6){
  width:120px!important;
  min-width:120px!important;
  max-width:120px!important;
}

/* لو فيه أعمدة إضافية زي التعبئة/الرصيد/الحالة خليها متوسطة ومش تاخد من اسم الصنف */
.invoiceCatalogTable th:nth-child(n+7),
.invoiceCatalogTable td:nth-child(n+7){
  width:120px;
  min-width:110px;
  max-width:150px;
  white-space:nowrap;
}

/* جدول أصناف الفاتورة الحالية */
.invoiceLinesTable{
  table-layout:fixed;
  min-width:1250px;
}

.invoiceLinesTable th:nth-child(2),
.invoiceLinesTable td:nth-child(2){
  width:120px!important;
  min-width:120px!important;
  max-width:120px!important;
  white-space:nowrap;
}

.invoiceLinesTable th:nth-child(3),
.invoiceLinesTable td:nth-child(3){
  width:340px!important;
  min-width:340px!important;
  max-width:340px!important;
  white-space:normal!important;
  line-height:1.8;
  text-align:right;
}

/* تحسين عرض اللوجو داخل جداول الفواتير */
.invoiceCatalogTable .brandPill,
.invoiceLinesTable .brandPill{
  transform:scale(.92);
  transform-origin:center;
  max-width:110px;
  margin:auto;
}

/* للمعاينة والطباعة: الكود صغير والبيان واسع */
.printedInvoiceTable{
  table-layout:fixed;
  width:100%;
}

.printedInvoiceTable th:first-child,
.printedInvoiceTable td:first-child{
  width:95px!important;
  max-width:95px!important;
  white-space:nowrap!important;
}

.printedInvoiceTable th:nth-child(2),
.printedInvoiceTable td:nth-child(2){
  width:auto!important;
  white-space:normal!important;
  line-height:1.7;
  text-align:right;
}


/* ===== Compact sales invoice print layout fix ===== */

/* شاشة المعاينة */
.compactSalesInvoicePaper,
.salesInvoicePaper{
  max-width:980px;
}

/* الهيدر: بيانات الشركة يمين واللوجوهات شمال جنب بعض */
.salesInvoicePaper .invoiceHeader{
  display:flex!important;
  flex-direction:row-reverse!important;
  align-items:flex-start!important;
  justify-content:space-between!important;
  gap:16px!important;
  padding-bottom:10px!important;
  margin-bottom:10px!important;
  border-bottom:2px solid #0f172a!important;
}

.salesInvoicePaper .invoiceHeader > div:first-child{
  flex:1!important;
  text-align:right!important;
}

.salesInvoicePaper .invoiceHeader h1{
  font-size:28px!important;
  margin:0 0 4px!important;
  line-height:1.2!important;
}

.salesInvoicePaper .invoiceHeader p{
  font-size:12px!important;
  margin:0 0 3px!important;
  line-height:1.5!important;
}

.salesInvoicePaper .invoiceHeader small{
  font-size:11px!important;
  line-height:1.4!important;
}

/* بوكس اللوجوهات */
.salesInvoicePaper .invoiceLogo,
.salesInvoicePaper .invoiceLogos,
.salesInvoicePaper .allInvoiceLogos{
  flex:0 0 230px!important;
  width:230px!important;
  min-width:230px!important;
  height:auto!important;
  display:flex!important;
  flex-direction:row!important;
  flex-wrap:nowrap!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:6px!important;
  padding:6px!important;
  border:1px solid #e2e8f0!important;
  border-radius:12px!important;
  background:#fff!important;
  box-shadow:none!important;
  overflow:hidden!important;
}

/* لو اللوجوهات داخلة كصور */
.salesInvoicePaper .invoiceLogo img,
.salesInvoicePaper .invoiceLogos img,
.salesInvoicePaper .allInvoiceLogos img,
.salesInvoicePaper .invoiceLogo .brandPill,
.salesInvoicePaper .invoiceLogos .brandPill,
.salesInvoicePaper .allInvoiceLogos .brandPill{
  width:48px!important;
  height:34px!important;
  max-width:48px!important;
  min-width:48px!important;
  object-fit:contain!important;
  margin:0!important;
  transform:none!important;
}

/* لو اللوجوهات داخل brand pill */
.salesInvoicePaper .invoiceLogo .brandPill{
  padding:2px 4px!important;
}

.salesInvoicePaper .invoiceLogo .brandPill span,
.salesInvoicePaper .invoiceLogo .brandPill b,
.salesInvoicePaper .invoiceLogos .brandPill span,
.salesInvoicePaper .invoiceLogos .brandPill b{
  display:none!important;
}

/* بيانات الفاتورة مضغوطة */
.salesInvoicePaper .invoiceInfoGrid{
  display:grid!important;
  grid-template-columns:repeat(4,1fr)!important;
  gap:6px!important;
  margin:8px 0 10px!important;
}

.salesInvoicePaper .invoiceInfoGrid div{
  min-height:auto!important;
  padding:7px 9px!important;
  border-radius:9px!important;
}

.salesInvoicePaper .invoiceInfoGrid span{
  font-size:10px!important;
  margin-bottom:2px!important;
}

.salesInvoicePaper .invoiceInfoGrid strong{
  font-size:12px!important;
  line-height:1.4!important;
}

/* جدول الأصناف: تصغير خانة اسم الصنف نسبيًا حتى لا يطول الجدول */
.salesInvoicePaper .printedInvoiceTable{
  table-layout:fixed!important;
  width:100%!important;
  margin-top:6px!important;
  border-collapse:collapse!important;
}

.salesInvoicePaper .printedInvoiceTable th,
.salesInvoicePaper .printedInvoiceTable td{
  padding:5px 4px!important;
  font-size:9.5px!important;
  line-height:1.35!important;
  white-space:normal!important;
  word-break:normal!important;
}

.salesInvoicePaper .printedInvoiceTable th:first-child,
.salesInvoicePaper .printedInvoiceTable td:first-child{
  width:72px!important;
  max-width:72px!important;
  white-space:nowrap!important;
}

.salesInvoicePaper .printedInvoiceTable th:nth-child(2),
.salesInvoicePaper .printedInvoiceTable td:nth-child(2){
  width:170px!important;
  max-width:170px!important;
  white-space:normal!important;
  line-height:1.35!important;
}

.salesInvoicePaper .printedInvoiceTable th:nth-child(3),
.salesInvoicePaper .printedInvoiceTable td:nth-child(3){
  width:100px!important;
  max-width:100px!important;
}

.salesInvoicePaper .printedInvoiceTable th:nth-child(n+4),
.salesInvoicePaper .printedInvoiceTable td:nth-child(n+4){
  width:auto!important;
  min-width:48px!important;
}

/* الجزء السفلي: الإجماليات بالعرض خانات */
.salesInvoicePaper .invoiceBottom{
  display:block!important;
  margin-top:8px!important;
}

.salesInvoicePaper .invoiceCategorySummary{
  display:none!important;
}

.salesInvoicePaper .invoiceFinalTotals{
  display:grid!important;
  grid-template-columns:repeat(5,1fr)!important;
  gap:6px!important;
  width:100%!important;
  margin:0!important;
}

.salesInvoicePaper .invoiceFinalTotals div{
  border:1px solid #dbe5f0!important;
  border-radius:9px!important;
  padding:6px 7px!important;
  min-height:auto!important;
  background:#f8fbff!important;
}

.salesInvoicePaper .invoiceFinalTotals span{
  display:block!important;
  font-size:10px!important;
  color:#64748b!important;
  font-weight:900!important;
  margin-bottom:2px!important;
}

.salesInvoicePaper .invoiceFinalTotals strong{
  display:block!important;
  font-size:12px!important;
  color:#0f172a!important;
  font-weight:900!important;
  line-height:1.3!important;
}

/* التوقيعات أصغر وقريبة */
.salesInvoicePaper .invoiceSignatureRow{
  display:grid!important;
  grid-template-columns:repeat(3,1fr)!important;
  gap:12px!important;
  margin-top:14px!important;
}

.salesInvoicePaper .invoiceSignatureRow div{
  padding-top:8px!important;
  min-height:30px!important;
  font-size:11px!important;
}

/* الطباعة: صفحة واحدة قدر الإمكان */
@media print{
  @page{
    size:A4 portrait;
    margin:6mm;
  }

  body.invoicePrintMode{
    background:#fff!important;
  }

  body.invoicePrintMode .salesInvoicePaper{
    width:100%!important;
    max-width:none!important;
    min-height:auto!important;
    padding:8mm!important;
    margin:0!important;
    border:1.5px solid #0f172a!important;
    box-shadow:none!important;
    page-break-inside:avoid!important;
    break-inside:avoid!important;
    font-size:10px!important;
  }

  body.invoicePrintMode .invoicePreviewPanel{
    padding:0!important;
    margin:0!important;
  }

  body.invoicePrintMode .salesInvoicePaper .invoiceHeader{
    padding-bottom:5px!important;
    margin-bottom:5px!important;
  }

  body.invoicePrintMode .salesInvoicePaper .invoiceHeader h1{
    font-size:20px!important;
  }

  body.invoicePrintMode .salesInvoicePaper .invoiceHeader p{
    font-size:9px!important;
  }

  body.invoicePrintMode .salesInvoicePaper .invoiceHeader small{
    font-size:8px!important;
  }

  body.invoicePrintMode .salesInvoicePaper .invoiceLogo,
  body.invoicePrintMode .salesInvoicePaper .invoiceLogos,
  body.invoicePrintMode .salesInvoicePaper .allInvoiceLogos{
    flex:0 0 190px!important;
    width:190px!important;
    min-width:190px!important;
    padding:4px!important;
    gap:4px!important;
  }

  body.invoicePrintMode .salesInvoicePaper .invoiceLogo img,
  body.invoicePrintMode .salesInvoicePaper .invoiceLogos img,
  body.invoicePrintMode .salesInvoicePaper .allInvoiceLogos img,
  body.invoicePrintMode .salesInvoicePaper .invoiceLogo .brandPill{
    width:42px!important;
    height:26px!important;
    max-width:42px!important;
    min-width:42px!important;
  }

  body.invoicePrintMode .salesInvoicePaper .invoiceInfoGrid{
    grid-template-columns:repeat(4,1fr)!important;
    gap:4px!important;
    margin:5px 0 6px!important;
  }

  body.invoicePrintMode .salesInvoicePaper .invoiceInfoGrid div{
    padding:4px 5px!important;
    border-radius:6px!important;
  }

  body.invoicePrintMode .salesInvoicePaper .invoiceInfoGrid span{
    font-size:7.5px!important;
    margin-bottom:1px!important;
  }

  body.invoicePrintMode .salesInvoicePaper .invoiceInfoGrid strong{
    font-size:8.5px!important;
  }

  body.invoicePrintMode .salesInvoicePaper .printedInvoiceTable{
    margin-top:4px!important;
  }

  body.invoicePrintMode .salesInvoicePaper .printedInvoiceTable th,
  body.invoicePrintMode .salesInvoicePaper .printedInvoiceTable td{
    padding:3px 2px!important;
    font-size:7.2px!important;
    line-height:1.25!important;
  }

  body.invoicePrintMode .salesInvoicePaper .printedInvoiceTable th:first-child,
  body.invoicePrintMode .salesInvoicePaper .printedInvoiceTable td:first-child{
    width:58px!important;
    max-width:58px!important;
  }

  body.invoicePrintMode .salesInvoicePaper .printedInvoiceTable th:nth-child(2),
  body.invoicePrintMode .salesInvoicePaper .printedInvoiceTable td:nth-child(2){
    width:135px!important;
    max-width:135px!important;
  }

  body.invoicePrintMode .salesInvoicePaper .invoiceFinalTotals{
    grid-template-columns:repeat(5,1fr)!important;
    gap:4px!important;
    margin-top:5px!important;
  }

  body.invoicePrintMode .salesInvoicePaper .invoiceFinalTotals div{
    padding:4px!important;
    border-radius:6px!important;
  }

  body.invoicePrintMode .salesInvoicePaper .invoiceFinalTotals span{
    font-size:7.5px!important;
  }

  body.invoicePrintMode .salesInvoicePaper .invoiceFinalTotals strong{
    font-size:8.5px!important;
  }

  body.invoicePrintMode .salesInvoicePaper .invoiceSignatureRow{
    margin-top:8px!important;
    gap:10px!important;
  }

  body.invoicePrintMode .salesInvoicePaper .invoiceSignatureRow div{
    padding-top:5px!important;
    min-height:20px!important;
    font-size:8px!important;
  }

  body.invoicePrintMode .salesInvoicePaper,
  body.invoicePrintMode .invoicePreviewPanel,
  body.invoicePrintMode #invoicePreview{
    page-break-after:auto!important;
    break-after:auto!important;
  }
}


/* ===== Excel-style sales invoice header ===== */

.invoiceExcelHeader{
  display:grid;
  grid-template-columns:300px 1fr;
  direction:ltr;
  border:1.5px solid #111827;
  margin-bottom:8px;
  background:#fff;
}

.excelHeaderLogos{
  border-right:1.5px solid #111827;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:5px 8px;
  min-height:74px;
}

.excelHeaderLogos img{
  width:64px;
  height:48px;
  object-fit:contain;
  display:block;
}

.excelHeaderData{
  direction:rtl;
  display:grid;
  grid-template-rows:auto 1fr;
}

.excelCompanyRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  border-bottom:1.5px solid #111827;
  padding:4px 8px;
  min-height:26px;
}

.excelCompanyRow strong{
  font-size:13px;
  font-weight:900;
  color:#0f172a;
  line-height:1.3;
}

.excelCompanyRow span{
  font-size:12px;
  font-weight:900;
  color:#0f172a;
  white-space:nowrap;
}

.excelDataGrid{
  display:grid;
  grid-template-columns:1fr 1fr;
}

.excelDataGrid div{
  min-height:24px;
  border-left:1px solid #111827;
  border-bottom:1px solid #111827;
  padding:3px 6px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px;
}

.excelDataGrid div:nth-child(2n){
  border-left:0;
}

.excelDataGrid div:nth-last-child(-n+2){
  border-bottom:0;
}

.excelDataGrid b{
  font-size:12px;
  font-weight:900;
  color:#0f172a;
  white-space:nowrap;
}

.excelDataGrid span{
  font-size:12px;
  font-weight:800;
  color:#0f172a;
  text-align:right;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* إلغاء الكروت الكبيرة القديمة لو ظهرت في فاتورة البيع */
.salesInvoicePaper .invoiceInfoGrid{
  display:none!important;
}

/* جسم فاتورة البيع مضغوط */
.salesInvoicePaper{
  padding:18px 20px!important;
}

.salesInvoicePaper .printedInvoiceTable th,
.salesInvoicePaper .printedInvoiceTable td{
  padding:4px 3px!important;
  font-size:10px!important;
  line-height:1.25!important;
}

.salesInvoicePaper .printedInvoiceTable th:nth-child(2),
.salesInvoicePaper .printedInvoiceTable td:nth-child(2){
  width:150px!important;
  max-width:150px!important;
}

.salesInvoicePaper .invoiceFinalTotals{
  display:grid!important;
  grid-template-columns:repeat(4,1fr)!important;
  gap:5px!important;
  margin-top:7px!important;
}

.salesInvoicePaper .invoiceFinalTotals div{
  padding:5px 6px!important;
  border-radius:6px!important;
  min-height:34px!important;
}

/* طباعة صفحة واحدة قدر الإمكان */
@media print{
  @page{
    size:A4 portrait;
    margin:5mm;
  }

  body.invoicePrintMode .salesInvoicePaper{
    padding:5mm!important;
    border:1px solid #111827!important;
    min-height:auto!important;
  }

  body.invoicePrintMode .invoiceExcelHeader{
    grid-template-columns:210px 1fr!important;
    margin-bottom:5px!important;
  }

  body.invoicePrintMode .excelHeaderLogos{
    min-height:48px!important;
    gap:5px!important;
    padding:3px 5px!important;
  }

  body.invoicePrintMode .excelHeaderLogos img{
    width:46px!important;
    height:32px!important;
  }

  body.invoicePrintMode .excelCompanyRow{
    min-height:18px!important;
    padding:2px 5px!important;
  }

  body.invoicePrintMode .excelCompanyRow strong{
    font-size:8.5px!important;
  }

  body.invoicePrintMode .excelCompanyRow span{
    font-size:8.5px!important;
  }

  body.invoicePrintMode .excelDataGrid div{
    min-height:16px!important;
    padding:1px 4px!important;
  }

  body.invoicePrintMode .excelDataGrid b,
  body.invoicePrintMode .excelDataGrid span{
    font-size:8px!important;
  }

  body.invoicePrintMode .salesInvoicePaper .printedInvoiceTable th,
  body.invoicePrintMode .salesInvoicePaper .printedInvoiceTable td{
    padding:2px 2px!important;
    font-size:6.8px!important;
    line-height:1.18!important;
  }

  body.invoicePrintMode .salesInvoicePaper .printedInvoiceTable th:first-child,
  body.invoicePrintMode .salesInvoicePaper .printedInvoiceTable td:first-child{
    width:48px!important;
    max-width:48px!important;
  }

  body.invoicePrintMode .salesInvoicePaper .printedInvoiceTable th:nth-child(2),
  body.invoicePrintMode .salesInvoicePaper .printedInvoiceTable td:nth-child(2){
    width:115px!important;
    max-width:115px!important;
  }

  body.invoicePrintMode .salesInvoicePaper .invoiceFinalTotals{
    grid-template-columns:repeat(4,1fr)!important;
    gap:3px!important;
    margin-top:4px!important;
  }

  body.invoicePrintMode .salesInvoicePaper .invoiceFinalTotals div{
    min-height:22px!important;
    padding:2px 4px!important;
  }

  body.invoicePrintMode .salesInvoicePaper .invoiceFinalTotals span{
    font-size:6.8px!important;
  }

  body.invoicePrintMode .salesInvoicePaper .invoiceFinalTotals strong{
    font-size:8px!important;
  }

  body.invoicePrintMode .salesInvoicePaper .invoiceSignatureRow{
    margin-top:6px!important;
  }

  body.invoicePrintMode .salesInvoicePaper .invoiceSignatureRow div{
    min-height:16px!important;
    padding-top:4px!important;
    font-size:7px!important;
  }
}


/* ===== Mega Therm flat Excel-like invoice layout ===== */
.flatInvoicePaper{
  max-width:1120px!important;
  padding:14px 16px!important;
  border:2px solid #111827!important;
  border-radius:0!important;
  box-shadow:none!important;
  background:#fff!important;
}

.flatInvoiceHeader{
  display:grid;
  grid-template-columns:300px 1fr 360px;
  direction:ltr;
  border:1.5px solid #111827;
  background:#fff;
  margin-bottom:0;
}

.flatHeaderLeft,
.flatHeaderCenter,
.flatHeaderRight{
  min-height:56px;
  border-right:1.5px solid #111827;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:5px 7px;
}

.flatHeaderRight{
  direction:rtl;
  border-right:0;
  flex-direction:column;
  align-items:flex-end;
  justify-content:center;
  text-align:right;
}

.flatHeaderRight strong{
  font-size:13px;
  font-weight:900;
  color:#0f172a;
  line-height:1.35;
}

.flatHeaderRight span{
  font-size:11px;
  font-weight:900;
  color:#15803d;
}

.flatHeaderCenter{
  direction:rtl;
  flex-direction:column;
  text-align:center;
}

.flatHeaderCenter h1{
  margin:0 0 3px!important;
  font-size:22px!important;
  line-height:1!important;
  color:#0f172a!important;
  font-weight:900!important;
}

.flatHeaderCenter div{
  font-size:12px;
  font-weight:900;
  color:#0f172a;
}

.flatInvoiceLogos{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}

.flatInvoiceLogos img{
  width:62px;
  height:42px;
  object-fit:contain;
  display:block;
}

.flatInvoiceInfo{
  display:grid;
  grid-template-columns:1fr 1fr;
  border-right:1.5px solid #111827;
  border-left:1.5px solid #111827;
  border-bottom:1.5px solid #111827;
  margin-bottom:6px;
}

.flatInvoiceInfo div{
  min-height:24px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:3px 7px;
  border-top:1px solid #111827;
  border-left:1px solid #111827;
  direction:rtl;
}

.flatInvoiceInfo div:nth-child(2n){
  border-left:0;
}

.flatInvoiceInfo b{
  font-size:12px;
  font-weight:900;
  color:#0f172a;
  white-space:nowrap;
}

.flatInvoiceInfo span{
  font-size:12px;
  font-weight:800;
  color:#0f172a;
  text-align:right;
  overflow:hidden;
  text-overflow:ellipsis;
}

.flatInvoiceItemsTable{
  width:100%;
  border-collapse:collapse!important;
  table-layout:fixed!important;
  margin-top:6px;
  border:1.5px solid #111827;
}

.flatInvoiceItemsTable th,
.flatInvoiceItemsTable td{
  border:1px solid #111827!important;
  padding:4px 3px!important;
  font-size:10px!important;
  line-height:1.35!important;
  color:#0f172a!important;
  text-align:center!important;
  vertical-align:middle!important;
  background:#fff!important;
}

.flatInvoiceItemsTable th{
  font-weight:900!important;
  background:#f8fafc!important;
}

.flatInvoiceItemsTable th:nth-child(1),
.flatInvoiceItemsTable td:nth-child(1){width:70px!important;white-space:nowrap!important}
.flatInvoiceItemsTable th:nth-child(2),
.flatInvoiceItemsTable td:nth-child(2){width:185px!important;text-align:right!important;white-space:normal!important}
.flatInvoiceItemsTable th:nth-child(3),
.flatInvoiceItemsTable td:nth-child(3){width:70px!important}
.flatInvoiceItemsTable th:nth-child(4),
.flatInvoiceItemsTable td:nth-child(4){width:70px!important}
.flatInvoiceItemsTable th:nth-child(5),
.flatInvoiceItemsTable td:nth-child(5){width:85px!important}
.flatInvoiceItemsTable th:nth-child(6),
.flatInvoiceItemsTable td:nth-child(6){width:55px!important}
.flatInvoiceItemsTable th:nth-child(7),
.flatInvoiceItemsTable td:nth-child(7){width:90px!important}
.flatInvoiceItemsTable th:nth-child(8),
.flatInvoiceItemsTable td:nth-child(8){width:70px!important}
.flatInvoiceItemsTable th:nth-child(9),
.flatInvoiceItemsTable td:nth-child(9){width:90px!important}
.flatInvoiceItemsTable th:nth-child(10),
.flatInvoiceItemsTable td:nth-child(10){width:70px!important}
.flatInvoiceItemsTable th:nth-child(11),
.flatInvoiceItemsTable td:nth-child(11){width:70px!important}

.flatTotalsStrip{
  display:grid;
  grid-template-columns:repeat(6,1fr);
  border:1.5px solid #111827;
  border-top:0;
}

.flatTotalsStrip div{
  min-height:34px;
  border-left:1px solid #111827;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  padding:3px;
  background:#fff;
}

.flatTotalsStrip div:last-child{
  border-left:0;
}

.flatTotalsStrip b{
  font-size:10px;
  font-weight:900;
  color:#0f172a;
}

.flatTotalsStrip span{
  font-size:11px;
  font-weight:900;
  color:#0f766e;
}

.flatCategorySummary,
.flatPackingSummary{
  width:100%;
  border-collapse:collapse!important;
  table-layout:fixed;
}

.flatCategorySummary{
  margin-top:6px;
}

.flatCategorySummary th,
.flatCategorySummary td,
.flatPackingSummary th,
.flatPackingSummary td{
  border:1px solid #111827!important;
  padding:3px!important;
  font-size:10px!important;
  text-align:center!important;
  font-weight:900;
  color:#0f172a;
  background:#fff!important;
}

.flatCategorySummary th:first-child,
.flatCategorySummary td:first-child,
.flatPackingSummary th:first-child,
.flatPackingSummary td:first-child{
  width:140px;
  text-align:right!important;
}

.flatBottomArea{
  display:grid;
  grid-template-columns:260px 1fr 260px;
  gap:0;
  margin-top:6px;
  border:1.5px solid #111827;
}

.flatReceiverBox{
  display:grid;
  place-items:center;
  min-height:96px;
  font-size:18px;
  font-weight:900;
  border-left:1px solid #111827;
}

.flatPackingBox{
  border-left:1px solid #111827;
}

.flatNetBox{
  display:grid;
  grid-template-rows:1fr 1fr;
}

.flatNetBox div{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:8px;
  border-bottom:1px solid #111827;
}

.flatNetBox div:last-child{
  border-bottom:0;
}

.flatNetBox b{
  font-size:14px;
  font-weight:900;
}

.flatNetBox span{
  font-size:16px;
  font-weight:900;
}

.flatSignatureRow{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:20px;
  margin-top:12px;
}

.flatSignatureRow div{
  border-top:2px solid #111827;
  text-align:center;
  padding-top:6px;
  font-size:12px;
  font-weight:900;
}

/* إخفاء عناصر الفاتورة القديمة داخل المعاينة الجديدة لو ظهرت */
.flatInvoicePaper .invoiceHeader,
.flatInvoicePaper .invoiceInfoGrid,
.flatInvoicePaper .invoiceBottom,
.flatInvoicePaper .invoiceFinalTotals,
.flatInvoicePaper .invoiceCategorySummary{
  display:none!important;
}

@media print{
  @page{
    size:A4 portrait;
    margin:4mm;
  }

  body.invoicePrintMode .flatInvoicePaper{
    width:100%!important;
    max-width:none!important;
    padding:4mm!important;
    border:1.5px solid #111827!important;
    min-height:auto!important;
    page-break-inside:avoid!important;
    break-inside:avoid!important;
  }

  body.invoicePrintMode .flatInvoiceHeader{
    grid-template-columns:210px 1fr 250px!important;
  }

  body.invoicePrintMode .flatHeaderLeft,
  body.invoicePrintMode .flatHeaderCenter,
  body.invoicePrintMode .flatHeaderRight{
    min-height:40px!important;
    padding:2px 4px!important;
  }

  body.invoicePrintMode .flatInvoiceLogos{
    gap:4px!important;
  }

  body.invoicePrintMode .flatInvoiceLogos img{
    width:46px!important;
    height:30px!important;
  }

  body.invoicePrintMode .flatHeaderCenter h1{
    font-size:15px!important;
    margin-bottom:1px!important;
  }

  body.invoicePrintMode .flatHeaderCenter div,
  body.invoicePrintMode .flatHeaderRight strong,
  body.invoicePrintMode .flatInvoiceInfo b,
  body.invoicePrintMode .flatInvoiceInfo span{
    font-size:7.5px!important;
  }

  body.invoicePrintMode .flatHeaderRight span{
    font-size:7px!important;
  }

  body.invoicePrintMode .flatInvoiceInfo div{
    min-height:15px!important;
    padding:1px 3px!important;
  }

  body.invoicePrintMode .flatInvoiceItemsTable{
    margin-top:3px!important;
  }

  body.invoicePrintMode .flatInvoiceItemsTable th,
  body.invoicePrintMode .flatInvoiceItemsTable td{
    padding:1.6px 1.5px!important;
    font-size:6.3px!important;
    line-height:1.14!important;
  }

  body.invoicePrintMode .flatInvoiceItemsTable th:nth-child(1),
  body.invoicePrintMode .flatInvoiceItemsTable td:nth-child(1){width:44px!important}
  body.invoicePrintMode .flatInvoiceItemsTable th:nth-child(2),
  body.invoicePrintMode .flatInvoiceItemsTable td:nth-child(2){width:120px!important}
  body.invoicePrintMode .flatInvoiceItemsTable th:nth-child(3),
  body.invoicePrintMode .flatInvoiceItemsTable td:nth-child(3){width:45px!important}
  body.invoicePrintMode .flatInvoiceItemsTable th:nth-child(4),
  body.invoicePrintMode .flatInvoiceItemsTable td:nth-child(4){width:45px!important}
  body.invoicePrintMode .flatInvoiceItemsTable th:nth-child(5),
  body.invoicePrintMode .flatInvoiceItemsTable td:nth-child(5){width:55px!important}
  body.invoicePrintMode .flatInvoiceItemsTable th:nth-child(6),
  body.invoicePrintMode .flatInvoiceItemsTable td:nth-child(6){width:36px!important}
  body.invoicePrintMode .flatInvoiceItemsTable th:nth-child(7),
  body.invoicePrintMode .flatInvoiceItemsTable td:nth-child(7){width:60px!important}
  body.invoicePrintMode .flatInvoiceItemsTable th:nth-child(8),
  body.invoicePrintMode .flatInvoiceItemsTable td:nth-child(8){width:46px!important}
  body.invoicePrintMode .flatInvoiceItemsTable th:nth-child(9),
  body.invoicePrintMode .flatInvoiceItemsTable td:nth-child(9){width:55px!important}
  body.invoicePrintMode .flatInvoiceItemsTable th:nth-child(10),
  body.invoicePrintMode .flatInvoiceItemsTable td:nth-child(10){width:45px!important}
  body.invoicePrintMode .flatInvoiceItemsTable th:nth-child(11),
  body.invoicePrintMode .flatInvoiceItemsTable td:nth-child(11){width:45px!important}

  body.invoicePrintMode .flatTotalsStrip div{
    min-height:21px!important;
    padding:1px!important;
  }

  body.invoicePrintMode .flatTotalsStrip b,
  body.invoicePrintMode .flatTotalsStrip span,
  body.invoicePrintMode .flatCategorySummary th,
  body.invoicePrintMode .flatCategorySummary td,
  body.invoicePrintMode .flatPackingSummary th,
  body.invoicePrintMode .flatPackingSummary td{
    font-size:6.4px!important;
    padding:1.5px!important;
  }

  body.invoicePrintMode .flatCategorySummary{
    margin-top:3px!important;
  }

  body.invoicePrintMode .flatBottomArea{
    grid-template-columns:160px 1fr 160px!important;
    margin-top:3px!important;
  }

  body.invoicePrintMode .flatReceiverBox{
    min-height:50px!important;
    font-size:9px!important;
  }

  body.invoicePrintMode .flatNetBox div{
    padding:3px!important;
  }

  body.invoicePrintMode .flatNetBox b,
  body.invoicePrintMode .flatNetBox span{
    font-size:7px!important;
  }

  body.invoicePrintMode .flatSignatureRow{
    margin-top:5px!important;
    gap:14px!important;
  }

  body.invoicePrintMode .flatSignatureRow div{
    padding-top:3px!important;
    font-size:6.5px!important;
  }
}


/* ===== Premium professional invoice styling without changing data ===== */
.premiumInvoicePaper{
  background:
    radial-gradient(circle at top left, rgba(59,130,246,.06), transparent 22%),
    radial-gradient(circle at bottom right, rgba(16,185,129,.05), transparent 18%),
    #ffffff !important;
  border:2px solid #0f172a !important;
  border-radius:18px !important;
  box-shadow:0 14px 35px rgba(15,23,42,.08) !important;
  overflow:hidden;
}

/* Header */
.premiumInvoicePaper .flatInvoiceHeader{
  background:linear-gradient(135deg,#f8fbff 0%,#eef6ff 100%) !important;
  border:0 !important;
  border-bottom:2px solid #0f172a !important;
  padding:8px 10px !important;
  align-items:center;
  gap:10px;
  grid-template-columns:300px 1fr 360px;
}

.premiumInvoicePaper .flatHeaderLeft,
.premiumInvoicePaper .flatHeaderCenter,
.premiumInvoicePaper .flatHeaderRight{
  border-right:0 !important;
  min-height:72px;
  background:transparent;
}

.premiumInvoicePaper .flatHeaderLeft{
  justify-content:flex-start;
}

.premiumInvoicePaper .flatHeaderCenter{
  position:relative;
}

.premiumInvoicePaper .flatHeaderCenter h1{
  font-size:28px !important;
  margin:0 0 4px !important;
  letter-spacing:.2px;
  color:#0f172a !important;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
}

.premiumInvoicePaper .flatHeaderCenter h1::before{
  content:"🧾";
  font-size:22px;
  line-height:1;
}

.premiumInvoicePaper .flatHeaderCenter div{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 14px;
  border-radius:999px;
  background:#ffffff;
  border:1px solid #dbeafe;
  box-shadow:0 4px 10px rgba(37,99,235,.08);
  font-size:12px;
  font-weight:900;
}

.premiumInvoicePaper .flatHeaderCenter div::before{
  content:"رقم";
  color:#64748b;
  font-weight:800;
}

.premiumInvoicePaper .flatHeaderRight{
  align-items:flex-end;
  justify-content:center;
}

.premiumInvoicePaper .flatHeaderRight strong{
  font-size:15px;
  color:#0f172a;
  margin-bottom:4px;
}

.premiumInvoicePaper .flatHeaderRight span{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:5px 10px;
  border-radius:999px;
  background:#ecfdf5;
  color:#15803d;
  border:1px solid #bbf7d0;
  font-size:11px;
  font-weight:900;
}

.premiumInvoicePaper .flatHeaderRight span::before{
  content:"✓";
  display:inline-grid;
  place-items:center;
  width:16px;
  height:16px;
  border-radius:50%;
  background:#16a34a;
  color:#fff;
  font-size:10px;
}

.premiumInvoicePaper .flatInvoiceLogos{
  justify-content:flex-start;
  gap:10px;
  flex-wrap:nowrap;
}

.premiumInvoicePaper .flatInvoiceLogos img{
  width:66px;
  height:46px;
  padding:4px;
  border-radius:12px;
  background:#ffffff;
  border:1px solid #dbe4f0;
  box-shadow:0 4px 10px rgba(15,23,42,.06);
}

/* Info area */
.premiumInvoicePaper .flatInvoiceInfo{
  border:0 !important;
  background:#ffffff;
  padding:8px 10px;
  gap:8px;
  display:grid !important;
  grid-template-columns:1fr 1fr;
  margin-bottom:8px;
}

.premiumInvoicePaper .flatInvoiceInfo div{
  min-height:44px;
  border:1px solid #dbe4f0 !important;
  border-radius:14px;
  padding:8px 12px;
  background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);
  box-shadow:0 4px 10px rgba(15,23,42,.04);
  border-left:1px solid #dbe4f0 !important;
  border-top:1px solid #dbe4f0 !important;
}

.premiumInvoicePaper .flatInvoiceInfo b{
  display:flex;
  align-items:center;
  gap:8px;
  color:#64748b;
  font-size:11px;
  font-weight:900;
}

.premiumInvoicePaper .flatInvoiceInfo span{
  color:#0f172a;
  font-size:13px;
  font-weight:900;
}

/* Icons per row without changing data */
.premiumInvoicePaper .flatInvoiceInfo div:nth-child(1) b::before{content:"👤";}
.premiumInvoicePaper .flatInvoiceInfo div:nth-child(2) b::before{content:"📞";}
.premiumInvoicePaper .flatInvoiceInfo div:nth-child(3) b::before{content:"🧑‍💼";}
.premiumInvoicePaper .flatInvoiceInfo div:nth-child(4) b::before{content:"📍";}
.premiumInvoicePaper .flatInvoiceInfo div:nth-child(5) b::before{content:"📅";}
.premiumInvoicePaper .flatInvoiceInfo div:nth-child(6) b::before{content:"🗓️";}

/* Main items table */
.premiumInvoicePaper .flatInvoiceItemsTable{
  border:1px solid #d7e3f3 !important;
  border-radius:16px !important;
  overflow:hidden;
  box-shadow:0 8px 18px rgba(15,23,42,.05);
  margin-top:8px;
}

.premiumInvoicePaper .flatInvoiceItemsTable th{
  background:linear-gradient(180deg,#0f172a 0%,#1e293b 100%) !important;
  color:#ffffff !important;
  font-size:10px !important;
  padding:8px 4px !important;
  border-color:#334155 !important;
}

.premiumInvoicePaper .flatInvoiceItemsTable td{
  border-color:#e2e8f0 !important;
  padding:7px 4px !important;
  font-size:10.5px !important;
}

.premiumInvoicePaper .flatInvoiceItemsTable tbody tr:nth-child(even) td{
  background:#f8fbff !important;
}

.premiumInvoicePaper .flatInvoiceItemsTable tbody tr:hover td{
  background:#eef6ff !important;
}

/* Slightly more premium widths */
.premiumInvoicePaper .flatInvoiceItemsTable th:nth-child(2),
.premiumInvoicePaper .flatInvoiceItemsTable td:nth-child(2){
  width:195px !important;
}

.premiumInvoicePaper .flatInvoiceItemsTable th:nth-child(11),
.premiumInvoicePaper .flatInvoiceItemsTable td:nth-child(11){
  width:85px !important;
}

/* Totals strip */
.premiumInvoicePaper .flatTotalsStrip{
  border:0 !important;
  gap:8px;
  display:grid !important;
  grid-template-columns:repeat(6,1fr);
  margin-top:10px;
}

.premiumInvoicePaper .flatTotalsStrip div{
  min-height:62px;
  border:1px solid #dbe4f0 !important;
  border-radius:16px;
  background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);
  box-shadow:0 6px 14px rgba(15,23,42,.04);
  padding:8px 6px;
}

.premiumInvoicePaper .flatTotalsStrip b{
  font-size:10px;
  color:#64748b;
  margin-bottom:6px;
}

.premiumInvoicePaper .flatTotalsStrip span{
  font-size:14px;
  color:#0f766e;
  font-weight:900;
}

/* Category summary + bottom summary */
.premiumInvoicePaper .flatCategorySummary,
.premiumInvoicePaper .flatPackingSummary{
  margin-top:10px;
  border-radius:14px;
  overflow:hidden;
  box-shadow:0 6px 14px rgba(15,23,42,.04);
}

.premiumInvoicePaper .flatCategorySummary th,
.premiumInvoicePaper .flatPackingSummary th{
  background:#eaf2ff !important;
  color:#0f172a !important;
  border-color:#d3e0f3 !important;
  padding:6px 4px !important;
}

.premiumInvoicePaper .flatCategorySummary td,
.premiumInvoicePaper .flatPackingSummary td{
  border-color:#dbe4f0 !important;
  padding:5px 4px !important;
  background:#ffffff !important;
}

.premiumInvoicePaper .flatBottomArea{
  border:0 !important;
  gap:10px;
  margin-top:10px;
  grid-template-columns:230px 1fr 230px;
}

.premiumInvoicePaper .flatReceiverBox,
.premiumInvoicePaper .flatPackingBox,
.premiumInvoicePaper .flatNetBox{
  border:1px solid #dbe4f0 !important;
  border-radius:16px;
  background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);
  box-shadow:0 6px 14px rgba(15,23,42,.04);
  overflow:hidden;
}

.premiumInvoicePaper .flatReceiverBox{
  font-size:22px;
  color:#0f172a;
  border-left:1px solid #dbe4f0 !important;
}

.premiumInvoicePaper .flatPackingBox{
  border-left:1px solid #dbe4f0 !important;
}

.premiumInvoicePaper .flatNetBox div{
  padding:12px 10px;
  border-bottom:1px solid #dbe4f0 !important;
}

.premiumInvoicePaper .flatNetBox div:last-child{
  border-bottom:0 !important;
}

.premiumInvoicePaper .flatNetBox b{
  color:#475569;
  font-size:13px;
}

.premiumInvoicePaper .flatNetBox span{
  color:#0f172a;
  font-size:18px;
  font-weight:900;
}

/* Signature row */
.premiumInvoicePaper .flatSignatureRow{
  margin-top:16px;
  gap:28px;
}

.premiumInvoicePaper .flatSignatureRow div{
  border-top:2px dashed #94a3b8;
  padding-top:8px;
  color:#0f172a;
  font-size:13px;
  font-weight:900;
}

/* Purchase invoice accent */
.purchaseFlatInvoicePaper .flatHeaderCenter h1::before{
  content:"📦";
}

.purchaseFlatInvoicePaper .flatHeaderRight span{
  background:#fff7ed;
  color:#c2410c;
  border-color:#fed7aa;
}

.purchaseFlatInvoicePaper .flatHeaderRight span::before{
  content:"●";
  background:#ea580c;
}

/* Print polish */
@media print{
  body.invoicePrintMode .premiumInvoicePaper{
    border-radius:8px !important;
    box-shadow:none !important;
    background:#fff !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatInvoiceHeader{
    padding:4px 5px !important;
    gap:6px;
    grid-template-columns:205px 1fr 240px !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatHeaderLeft,
  body.invoicePrintMode .premiumInvoicePaper .flatHeaderCenter,
  body.invoicePrintMode .premiumInvoicePaper .flatHeaderRight{
    min-height:46px !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatHeaderCenter h1{
    font-size:14px !important;
    gap:5px;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatHeaderCenter h1::before{
    font-size:12px;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatHeaderCenter div{
    padding:2px 7px !important;
    font-size:7px !important;
    box-shadow:none !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatHeaderRight strong{
    font-size:8px !important;
    margin-bottom:1px;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatHeaderRight span{
    padding:2px 5px !important;
    font-size:6.5px !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatHeaderRight span::before{
    width:10px;
    height:10px;
    font-size:6px;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatInvoiceLogos{
    gap:4px !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatInvoiceLogos img{
    width:42px !important;
    height:28px !important;
    padding:2px;
    border-radius:6px;
    box-shadow:none !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatInvoiceInfo{
    padding:5px !important;
    gap:4px !important;
    margin-bottom:4px !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatInvoiceInfo div{
    min-height:22px !important;
    padding:3px 5px !important;
    border-radius:8px !important;
    box-shadow:none !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatInvoiceInfo b{
    font-size:7px !important;
    gap:4px;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatInvoiceInfo span{
    font-size:7px !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatInvoiceItemsTable{
    margin-top:4px !important;
    box-shadow:none !important;
    border-radius:8px !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatInvoiceItemsTable th{
    font-size:6.1px !important;
    padding:2.5px 1.5px !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatInvoiceItemsTable td{
    font-size:6.1px !important;
    padding:2.2px 1.5px !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatTotalsStrip{
    gap:4px !important;
    margin-top:5px !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatTotalsStrip div{
    min-height:30px !important;
    padding:3px 2px !important;
    border-radius:8px !important;
    box-shadow:none !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatTotalsStrip b{
    font-size:6.4px !important;
    margin-bottom:2px !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatTotalsStrip span{
    font-size:7px !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatCategorySummary,
  body.invoicePrintMode .premiumInvoicePaper .flatPackingSummary,
  body.invoicePrintMode .premiumInvoicePaper .flatReceiverBox,
  body.invoicePrintMode .premiumInvoicePaper .flatPackingBox,
  body.invoicePrintMode .premiumInvoicePaper .flatNetBox{
    box-shadow:none !important;
    border-radius:8px !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatCategorySummary th,
  body.invoicePrintMode .premiumInvoicePaper .flatPackingSummary th,
  body.invoicePrintMode .premiumInvoicePaper .flatCategorySummary td,
  body.invoicePrintMode .premiumInvoicePaper .flatPackingSummary td{
    font-size:6.1px !important;
    padding:2px 1.5px !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatBottomArea{
    gap:5px !important;
    grid-template-columns:160px 1fr 160px !important;
    margin-top:5px !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatReceiverBox{
    min-height:55px !important;
    font-size:8px !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatNetBox div{
    padding:4px !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatNetBox b{
    font-size:6.8px !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatNetBox span{
    font-size:7.6px !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatSignatureRow{
    margin-top:8px !important;
    gap:15px !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatSignatureRow div{
    font-size:7px !important;
    padding-top:4px !important;
  }
}


/* ===== Final invoice cleanup: no duplicated summaries ===== */

/* حذف ملخص التصنيفات المالي المكرر نهائيًا من المعاينة والطباعة */
.flatCategorySummary{
  display:none!important;
}

/* جزء إجمالي الكراتين والمواسير الجديد */
.flatPackingSection{
  margin-top:12px;
  border:1px solid #dbe4f0;
  border-radius:18px;
  overflow:hidden;
  background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);
  box-shadow:0 8px 18px rgba(15,23,42,.05);
}

.flatPackingTitle{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:11px 14px;
  background:linear-gradient(135deg,#eef6ff 0%,#f8fbff 100%);
  border-bottom:1px solid #dbe4f0;
}

.flatPackingTitle strong{
  font-size:17px;
  font-weight:900;
  color:#0f172a;
}

.flatPackingTitle span{
  font-size:12px;
  font-weight:800;
  color:#64748b;
}

.flatPackingContent{
  display:grid;
  grid-template-columns:230px 1fr;
  gap:10px;
  padding:10px;
}

.flatPackingContent .flatReceiverBox{
  min-height:100%;
  border:1px solid #dbe4f0!important;
  border-radius:16px!important;
  background:#ffffff!important;
  box-shadow:none!important;
}

.flatPackingContent .flatPackingBox{
  border:1px solid #dbe4f0!important;
  border-radius:16px!important;
  overflow:hidden;
  background:#ffffff!important;
  box-shadow:none!important;
}

/* جدول الكراتين والمواسير */
.flatPackingContent .flatPackingSummary{
  margin:0!important;
  box-shadow:none!important;
  border-radius:0!important;
}

.flatPackingContent .flatPackingSummary th{
  background:#eaf2ff!important;
  color:#0f172a!important;
  font-size:12px!important;
  padding:8px 5px!important;
}

.flatPackingContent .flatPackingSummary td{
  font-size:12px!important;
  padding:7px 5px!important;
}

.flatPackingContent .flatPackingSummary td:first-child,
.flatPackingContent .flatPackingSummary th:first-child{
  width:160px!important;
  text-align:right!important;
  font-weight:900;
}

/* منع ظهور الصافي أسفل الجدول مرة تانية لأنه موجود في خانات الإجمالي فوق */
.flatNetBox{
  display:none!important;
}

/* تحسين خانات الإجمالي العلوية */
.premiumInvoicePaper .flatTotalsStrip{
  grid-template-columns:repeat(6,1fr)!important;
  margin-top:10px!important;
  margin-bottom:0!important;
}

.premiumInvoicePaper .flatTotalsStrip div{
  min-height:58px!important;
}

.premiumInvoicePaper .flatTotalsStrip b{
  font-size:11px!important;
}

.premiumInvoicePaper .flatTotalsStrip span{
  font-size:14px!important;
}

/* الطباعة */
@media print{
  body.invoicePrintMode .flatCategorySummary,
  body.invoicePrintMode .flatNetBox{
    display:none!important;
  }

  body.invoicePrintMode .flatPackingSection{
    margin-top:5px!important;
    border-radius:8px!important;
    box-shadow:none!important;
  }

  body.invoicePrintMode .flatPackingTitle{
    padding:4px 6px!important;
  }

  body.invoicePrintMode .flatPackingTitle strong{
    font-size:8px!important;
  }

  body.invoicePrintMode .flatPackingTitle span{
    font-size:6.5px!important;
  }

  body.invoicePrintMode .flatPackingContent{
    grid-template-columns:135px 1fr!important;
    gap:4px!important;
    padding:4px!important;
  }

  body.invoicePrintMode .flatPackingContent .flatReceiverBox{
    min-height:48px!important;
    font-size:8px!important;
    border-radius:8px!important;
  }

  body.invoicePrintMode .flatPackingContent .flatPackingBox{
    border-radius:8px!important;
  }

  body.invoicePrintMode .flatPackingContent .flatPackingSummary th,
  body.invoicePrintMode .flatPackingContent .flatPackingSummary td{
    font-size:6.2px!important;
    padding:1.8px 1.5px!important;
  }

  body.invoicePrintMode .flatPackingContent .flatPackingSummary td:first-child,
  body.invoicePrintMode .flatPackingContent .flatPackingSummary th:first-child{
    width:75px!important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatTotalsStrip{
    gap:3px!important;
    margin-top:4px!important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatTotalsStrip div{
    min-height:26px!important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatTotalsStrip b{
    font-size:6.2px!important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatTotalsStrip span{
    font-size:7px!important;
  }
}


/* ===== Header final tweak: bigger logos + Mega Therm above company name ===== */
.premiumInvoicePaper .flatInvoiceHeader{
  grid-template-columns:360px 1fr 340px !important;
}

.premiumInvoicePaper .flatHeaderLeft{
  padding-inline:10px !important;
}

.premiumInvoicePaper .flatInvoiceLogos{
  gap:12px !important;
}

.premiumInvoicePaper .flatInvoiceLogos img{
  width:78px !important;
  height:56px !important;
  padding:5px !important;
  border-radius:14px !important;
}

.premiumInvoicePaper .flatHeaderRight{
  flex-direction:column-reverse !important;
  align-items:flex-end !important;
  gap:6px !important;
}

.premiumInvoicePaper .flatHeaderRight span{
  order:1;
  font-size:14px !important;
  padding:6px 12px !important;
}

.premiumInvoicePaper .flatHeaderRight strong{
  order:2;
  font-size:14px !important;
  line-height:1.45 !important;
}

@media print{
  body.invoicePrintMode .premiumInvoicePaper .flatInvoiceHeader{
    grid-template-columns:240px 1fr 220px !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatInvoiceLogos{
    gap:5px !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatInvoiceLogos img{
    width:50px !important;
    height:36px !important;
    padding:2px !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatHeaderRight{
    gap:2px !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatHeaderRight span{
    font-size:7px !important;
    padding:2px 5px !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatHeaderRight strong{
    font-size:7.2px !important;
    line-height:1.3 !important;
  }
}


/* ===== FINAL FIX: header brand + bigger logos + one receiver only ===== */

/* اللوجوهات أكبر فعليًا */
.premiumInvoicePaper .flatInvoiceHeader,
.flatInvoicePaper .flatInvoiceHeader{
  grid-template-columns:390px 1fr 360px !important;
}

.premiumInvoicePaper .flatHeaderLeft,
.flatInvoicePaper .flatHeaderLeft{
  justify-content:flex-start !important;
  padding-inline:12px !important;
}

.premiumInvoicePaper .flatInvoiceLogos,
.flatInvoicePaper .flatInvoiceLogos{
  gap:14px !important;
  justify-content:flex-start !important;
}

.premiumInvoicePaper .flatInvoiceLogos img,
.flatInvoicePaper .flatInvoiceLogos img{
  width:88px !important;
  height:62px !important;
  max-width:88px !important;
  max-height:62px !important;
  padding:5px !important;
  border-radius:14px !important;
  object-fit:contain !important;
}

/* ميجا ثيرم فوق اسم الشركة */
.premiumInvoicePaper .flatHeaderRight,
.flatInvoicePaper .flatHeaderRight{
  flex-direction:column !important;
  align-items:flex-end !important;
  justify-content:center !important;
  gap:7px !important;
  text-align:right !important;
}

.premiumInvoicePaper .flatHeaderRight .megaThermHeaderBrand,
.flatInvoicePaper .flatHeaderRight .megaThermHeaderBrand{
  order:1 !important;
  display:inline-flex !important;
  align-items:center !important;
  gap:7px !important;
  padding:6px 14px !important;
  border-radius:999px !important;
  background:#ecfdf5 !important;
  border:1px solid #bbf7d0 !important;
  color:#15803d !important;
  font-size:16px !important;
  font-weight:900 !important;
  line-height:1 !important;
}

.premiumInvoicePaper .flatHeaderRight .megaThermHeaderBrand::before,
.flatInvoicePaper .flatHeaderRight .megaThermHeaderBrand::before{
  content:"✓";
  display:grid;
  place-items:center;
  width:18px;
  height:18px;
  border-radius:50%;
  background:#16a34a;
  color:#fff;
  font-size:11px;
}

.premiumInvoicePaper .flatHeaderRight strong,
.flatInvoicePaper .flatHeaderRight strong{
  order:2 !important;
  display:block !important;
  font-size:15px !important;
  line-height:1.45 !important;
  color:#0f172a !important;
  margin:0 !important;
}

/* إلغاء أي span قديم في الهيدر لو كان متخزن في الكاش */
.premiumInvoicePaper .flatHeaderRight > span,
.flatInvoicePaper .flatHeaderRight > span{
  display:none !important;
}

/* كلمة المستلم تظهر مرة واحدة فقط في التوقيع */
.flatPackingContent.onlyPackingTable{
  display:block !important;
  padding:10px !important;
}

.flatPackingContent.onlyPackingTable .flatPackingBox{
  width:100% !important;
}

.flatPackingContent .flatReceiverBox{
  display:none !important;
}

/* الطباعة */
@media print{
  body.invoicePrintMode .premiumInvoicePaper .flatInvoiceHeader,
  body.invoicePrintMode .flatInvoicePaper .flatInvoiceHeader{
    grid-template-columns:270px 1fr 235px !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatInvoiceLogos,
  body.invoicePrintMode .flatInvoicePaper .flatInvoiceLogos{
    gap:6px !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatInvoiceLogos img,
  body.invoicePrintMode .flatInvoicePaper .flatInvoiceLogos img{
    width:58px !important;
    height:40px !important;
    max-width:58px !important;
    max-height:40px !important;
    padding:2px !important;
    border-radius:7px !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatHeaderRight,
  body.invoicePrintMode .flatInvoicePaper .flatHeaderRight{
    gap:2px !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatHeaderRight .megaThermHeaderBrand,
  body.invoicePrintMode .flatInvoicePaper .flatHeaderRight .megaThermHeaderBrand{
    font-size:7.5px !important;
    padding:2px 6px !important;
    gap:3px !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatHeaderRight .megaThermHeaderBrand::before,
  body.invoicePrintMode .flatInvoicePaper .flatHeaderRight .megaThermHeaderBrand::before{
    width:10px !important;
    height:10px !important;
    font-size:6px !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatHeaderRight strong,
  body.invoicePrintMode .flatInvoicePaper .flatHeaderRight strong{
    font-size:7.2px !important;
    line-height:1.3 !important;
  }

  body.invoicePrintMode .flatPackingContent.onlyPackingTable{
    padding:4px !important;
  }

  body.invoicePrintMode .flatPackingContent .flatReceiverBox{
    display:none !important;
  }
}


/* ===== Invoice final requested cleanup: remove top packing total + restore category totals ===== */

/* اسم الشركة في اليمين وميجا ثيرم فوقها */
.premiumInvoicePaper .flatHeaderRight,
.flatInvoicePaper .flatHeaderRight{
  align-items:flex-end!important;
  justify-content:center!important;
  text-align:right!important;
}

.premiumInvoicePaper .flatHeaderRight .megaThermHeaderBrand,
.flatInvoicePaper .flatHeaderRight .megaThermHeaderBrand{
  margin-inline-start:auto!important;
}

.premiumInvoicePaper .flatHeaderRight strong,
.flatInvoicePaper .flatHeaderRight strong{
  text-align:right!important;
  max-width:100%!important;
}

/* الإجماليات المالية فقط: حذف كارت إجمالي الكراتين / المواسير من أعلى */
.financialTotalsStrip{
  grid-template-columns:repeat(5,1fr)!important;
}

/* تفعيل جدول الصنف / بولي / محابس / صرف pvc / لحام وشحم / صرف pph */
.activeCategorySummary,
.flatInvoicePaper .activeCategorySummary,
.premiumInvoicePaper .activeCategorySummary{
  display:table!important;
  width:100%!important;
  margin-top:10px!important;
  border-collapse:collapse!important;
  table-layout:fixed!important;
  overflow:hidden!important;
  border-radius:14px!important;
  box-shadow:0 6px 14px rgba(15,23,42,.04)!important;
}

.activeCategorySummary th,
.activeCategorySummary td{
  border:1px solid #d7e3f3!important;
  text-align:center!important;
  padding:7px 5px!important;
  font-size:12px!important;
  font-weight:900!important;
  background:#fff!important;
  color:#0f172a!important;
}

.activeCategorySummary th{
  background:#eaf2ff!important;
}

.activeCategorySummary th:first-child,
.activeCategorySummary td:first-child{
  width:150px!important;
  text-align:right!important;
  background:#f8fbff!important;
}

/* حتى لو فيه CSS قديم بيخفي flatCategorySummary */
.flatCategorySummary.activeCategorySummary{
  display:table!important;
}

/* جدول إجمالي الكراتين والمواسير يظل تحت فقط */
.flatPackingSection{
  margin-top:10px!important;
}

@media print{
  body.invoicePrintMode .financialTotalsStrip{
    grid-template-columns:repeat(5,1fr)!important;
  }

  body.invoicePrintMode .activeCategorySummary,
  body.invoicePrintMode .flatInvoicePaper .activeCategorySummary,
  body.invoicePrintMode .premiumInvoicePaper .activeCategorySummary{
    display:table!important;
    margin-top:4px!important;
    border-radius:6px!important;
    box-shadow:none!important;
  }

  body.invoicePrintMode .activeCategorySummary th,
  body.invoicePrintMode .activeCategorySummary td{
    font-size:6.2px!important;
    padding:1.8px 1.5px!important;
  }

  body.invoicePrintMode .activeCategorySummary th:first-child,
  body.invoicePrintMode .activeCategorySummary td:first-child{
    width:75px!important;
  }
}


/* ===== Final category totals working + remove paid from invoice ===== */

/* شريط الإجماليات العلوي بدون المدفوع والمتبقي */
.totalsWithoutPaid,
.financialTotalsStrip.totalsWithoutPaid{
  display:grid!important;
  grid-template-columns:repeat(3,1fr)!important;
  gap:8px!important;
}

.totalsWithoutPaid div{
  min-height:58px!important;
}

/* جدول إجماليات التصنيف مطلوب وفعال */
.realCategoryTotals,
.flatCategorySummary.realCategoryTotals,
.activeCategorySummary.realCategoryTotals,
.premiumInvoicePaper .realCategoryTotals,
.flatInvoicePaper .realCategoryTotals{
  display:table!important;
  width:100%!important;
  margin-top:10px!important;
  border-collapse:collapse!important;
  table-layout:fixed!important;
  border-radius:14px!important;
  overflow:hidden!important;
  box-shadow:0 6px 14px rgba(15,23,42,.04)!important;
}

.realCategoryTotals th,
.realCategoryTotals td{
  border:1px solid #d7e3f3!important;
  text-align:center!important;
  padding:7px 5px!important;
  font-size:12px!important;
  font-weight:900!important;
  background:#fff!important;
  color:#0f172a!important;
}

.realCategoryTotals th{
  background:#eaf2ff!important;
}

.realCategoryTotals th:first-child,
.realCategoryTotals td:first-child{
  width:150px!important;
  text-align:right!important;
  background:#f8fbff!important;
}

/* تأكيد إخفاء أي كارت قديم للمدفوع/المتبقي لو فضل من الكاش */
.flatTotalsStrip div:has(b){
  visibility:visible;
}

/* الطباعة */
@media print{
  body.invoicePrintMode .totalsWithoutPaid,
  body.invoicePrintMode .financialTotalsStrip.totalsWithoutPaid{
    grid-template-columns:repeat(3,1fr)!important;
    gap:3px!important;
    margin-top:4px!important;
  }

  body.invoicePrintMode .totalsWithoutPaid div{
    min-height:26px!important;
  }

  body.invoicePrintMode .realCategoryTotals,
  body.invoicePrintMode .flatCategorySummary.realCategoryTotals,
  body.invoicePrintMode .premiumInvoicePaper .realCategoryTotals,
  body.invoicePrintMode .flatInvoicePaper .realCategoryTotals{
    display:table!important;
    margin-top:4px!important;
    border-radius:6px!important;
    box-shadow:none!important;
  }

  body.invoicePrintMode .realCategoryTotals th,
  body.invoicePrintMode .realCategoryTotals td{
    font-size:6.2px!important;
    padding:1.8px 1.5px!important;
  }

  body.invoicePrintMode .realCategoryTotals th:first-child,
  body.invoicePrintMode .realCategoryTotals td:first-child{
    width:75px!important;
  }
}


/* ===== Sales invoice customer form cleanup ===== */
.invoiceCustomerFormGrid{
  grid-template-columns:repeat(3,1fr)!important;
}

.invoiceCustomerFormGrid label{
  display:flex;
  align-items:center;
  gap:6px;
}

.invoiceCustomerFormGrid div:nth-child(3) label::before{content:"👤";}
.invoiceCustomerFormGrid div:nth-child(4) label::before{content:"📞";}
.invoiceCustomerFormGrid div:nth-child(5) label::before{content:"📍";}
.invoiceCustomerFormGrid div:nth-child(6) label::before{content:"🧑‍💼";}

@media(max-width:900px){
  .invoiceCustomerFormGrid{
    grid-template-columns:1fr!important;
  }
}


/* ===== Current sales invoice draft table cleanup ===== */
/* منع دخول الكلام في بعضه داخل جدول أصناف الفاتورة الحالية */
.invoiceLinesTable{
  table-layout:fixed!important;
  min-width:1320px!important;
  width:100%!important;
  border-collapse:collapse!important;
}

.invoiceLinesTable th,
.invoiceLinesTable td{
  white-space:normal!important;
  word-break:normal!important;
  overflow-wrap:anywhere!important;
  vertical-align:middle!important;
  line-height:1.55!important;
  font-size:11px!important;
  padding:9px 6px!important;
  text-align:center!important;
}

.invoiceLinesTable th{
  color:#4b5d78!important;
  font-weight:900!important;
  background:#f8fbff!important;
}

.invoiceLinesTable td:nth-child(1),
.invoiceLinesTable th:nth-child(1){width:42px!important;}

.invoiceLinesTable td:nth-child(2),
.invoiceLinesTable th:nth-child(2){width:95px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}

.invoiceLinesTable td:nth-child(3),
.invoiceLinesTable th:nth-child(3){
  width:260px!important;
  text-align:right!important;
  overflow-wrap:break-word!important;
}

.invoiceLinesTable td:nth-child(4),
.invoiceLinesTable th:nth-child(4){width:150px!important;}

.invoiceLinesTable td:nth-child(5),
.invoiceLinesTable th:nth-child(5){width:95px!important;}

.invoiceLinesTable td:nth-child(6),
.invoiceLinesTable th:nth-child(6){width:90px!important;}

.invoiceLinesTable td:nth-child(7),
.invoiceLinesTable th:nth-child(7){width:95px!important;}

.invoiceLinesTable td:nth-child(8),
.invoiceLinesTable th:nth-child(8){width:90px!important;}

.invoiceLinesTable td:nth-child(9),
.invoiceLinesTable th:nth-child(9){width:85px!important;}

.invoiceLinesTable td:nth-child(10),
.invoiceLinesTable th:nth-child(10){width:70px!important;}

.invoiceLinesTable td:nth-child(11),
.invoiceLinesTable th:nth-child(11){width:100px!important;}

.invoiceLinesTable td:nth-child(12),
.invoiceLinesTable th:nth-child(12){width:120px!important;}

.invoiceLinesTable td:nth-child(13),
.invoiceLinesTable th:nth-child(13){width:80px!important;}

.invoiceLinesTable .linePackingMini{
  display:block!important;
  margin-top:4px!important;
  font-size:10px!important;
  color:#64748b!important;
  font-weight:800!important;
  line-height:1.45!important;
}

.invoiceLinesTable .brandPill,
.invoiceLinesTable .brandChip{
  max-width:130px!important;
  margin:auto!important;
  transform:scale(.9)!important;
  transform-origin:center!important;
}

/* شريط حفظ الفاتورة بعد حذف إجمالي الكراتين */
.currentInvoiceTotalsBar{
  justify-content:space-between!important;
  align-items:center!important;
  gap:16px!important;
}

.currentInvoiceTotalsBar div{
  min-width:240px!important;
}

.currentInvoiceTotalsBar .btn{
  min-width:150px!important;
  height:54px!important;
  font-size:15px!important;
  font-weight:900!important;
}

/* لا تعرض إجمالي الكراتين في شريط الفاتورة الحالية حتى لو كان موجودًا من كاش قديم */
.invoiceTotalsBar #invoiceTotalPackingValue{
  display:none!important;
}

.invoiceTotalsBar div:has(#invoiceTotalPackingValue){
  display:none!important;
}

@media(max-width:900px){
  .currentInvoiceTotalsBar{
    justify-content:flex-start!important;
  }
}


/* ===== Category discount controls + order summary under category table ===== */
.invoiceCategoryDiscountPanel{
  border:1px solid #dbeafe;
  background:linear-gradient(180deg,#ffffff,#f8fbff);
}

.categoryDiscountGrid{
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:12px;
}

.categoryDiscountCard{
  border:1px solid #dbe4f0;
  border-radius:18px;
  background:#fff;
  padding:14px;
  box-shadow:0 6px 14px rgba(15,23,42,.04);
}

.categoryDiscountCard label{
  display:block;
  font-weight:900;
  color:#0f172a;
  margin-bottom:8px;
  text-align:center;
}

.categoryDiscountCard input{
  text-align:center;
  font-size:18px;
  font-weight:900;
  color:#0f766e;
}

.categoryDiscountCard span{
  display:block;
  text-align:center;
  margin-top:7px;
  color:#64748b;
  font-size:12px;
  font-weight:900;
}

.draftCategoryDiscountSummary{
  margin-top:16px;
  border:1px solid #dbe4f0;
  border-radius:18px;
  overflow:hidden;
  background:#fff;
}

.draftCategoryDiscountSummary h4{
  margin:0;
  padding:12px 14px;
  background:#eaf2ff;
  color:#0f172a;
  font-size:16px;
  font-weight:900;
}

.draftCategoryDiscountSummary table{
  width:100%;
  border-collapse:collapse;
  table-layout:fixed;
}

.draftCategoryDiscountSummary th,
.draftCategoryDiscountSummary td{
  border:1px solid #dbe4f0;
  padding:10px 6px;
  text-align:center;
  font-weight:900;
  font-size:13px;
}

.draftCategoryDiscountSummary th{
  background:#f8fbff;
  color:#475569;
}

.draftCategoryDiscountSummary td:first-child{
  text-align:right;
  color:#0f172a;
}

/* جدول التصنيف يظهر فوق خانات الإجمالي في الطباعة والمعاينة */
.premiumInvoicePaper .realCategoryTotals{
  margin-top:10px!important;
  margin-bottom:10px!important;
}

.premiumInvoicePaper .totalsWithoutPaid{
  margin-top:0!important;
  margin-bottom:10px!important;
}

/* توضيح أن خصم الصنف مستقل */
.flatInvoiceItemsTable th:nth-child(6)::after{
  content:" الصنف";
}

@media(max-width:1100px){
  .categoryDiscountGrid{
    grid-template-columns:repeat(2,1fr);
  }
}

@media(max-width:700px){
  .categoryDiscountGrid{
    grid-template-columns:1fr;
  }
}

@media print{
  body.invoicePrintMode .realCategoryTotals{
    margin-top:4px!important;
    margin-bottom:4px!important;
  }

  body.invoicePrintMode .totalsWithoutPaid{
    margin-bottom:4px!important;
  }
}


/* ===== Compact packing / pipes summary table ===== */
/* تصغير جدول إجمالي الكراتين والمواسير فقط */
.flatPackingSection{
  margin-top:6px!important;
  border-radius:10px!important;
}

.flatPackingTitle{
  padding:6px 9px!important;
  min-height:auto!important;
}

.flatPackingTitle strong{
  font-size:13px!important;
}

.flatPackingTitle span{
  font-size:10px!important;
}

.flatPackingContent.onlyPackingTable,
.flatPackingContent{
  padding:5px!important;
}

.flatPackingContent .flatPackingBox{
  border-radius:8px!important;
}

.flatPackingContent .flatPackingSummary,
.flatPackingSummary{
  table-layout:fixed!important;
  margin:0!important;
  width:100%!important;
  border-collapse:collapse!important;
}

.flatPackingContent .flatPackingSummary th,
.flatPackingContent .flatPackingSummary td,
.flatPackingSummary th,
.flatPackingSummary td{
  padding:3px 4px!important;
  font-size:10px!important;
  line-height:1.15!important;
  height:22px!important;
  min-height:22px!important;
  font-weight:900!important;
}

.flatPackingContent .flatPackingSummary th:first-child,
.flatPackingContent .flatPackingSummary td:first-child,
.flatPackingSummary th:first-child,
.flatPackingSummary td:first-child{
  width:120px!important;
  max-width:120px!important;
  text-align:right!important;
}

.flatPackingContent .flatPackingSummary th:not(:first-child),
.flatPackingContent .flatPackingSummary td:not(:first-child),
.flatPackingSummary th:not(:first-child),
.flatPackingSummary td:not(:first-child){
  width:70px!important;
  max-width:70px!important;
  text-align:center!important;
}

/* تقليل المسافة قبل التوقيعات بعد جدول التعبئة */
.flatSignatureRow{
  margin-top:7px!important;
}

/* الطباعة: خلي جدول إجمالي الكراتين والمواسير صغير جدًا زي المثال */
@media print{
  body.invoicePrintMode .flatPackingSection{
    margin-top:3px!important;
    border-radius:4px!important;
  }

  body.invoicePrintMode .flatPackingTitle{
    padding:2px 4px!important;
  }

  body.invoicePrintMode .flatPackingTitle strong{
    font-size:6.5px!important;
  }

  body.invoicePrintMode .flatPackingTitle span{
    font-size:5.5px!important;
  }

  body.invoicePrintMode .flatPackingContent.onlyPackingTable,
  body.invoicePrintMode .flatPackingContent{
    padding:2px!important;
  }

  body.invoicePrintMode .flatPackingContent .flatPackingSummary th,
  body.invoicePrintMode .flatPackingContent .flatPackingSummary td,
  body.invoicePrintMode .flatPackingSummary th,
  body.invoicePrintMode .flatPackingSummary td{
    padding:1px 1.5px!important;
    font-size:5.6px!important;
    line-height:1.05!important;
    height:12px!important;
    min-height:12px!important;
  }

  body.invoicePrintMode .flatPackingContent .flatPackingSummary th:first-child,
  body.invoicePrintMode .flatPackingContent .flatPackingSummary td:first-child,
  body.invoicePrintMode .flatPackingSummary th:first-child,
  body.invoicePrintMode .flatPackingSummary td:first-child{
    width:58px!important;
    max-width:58px!important;
  }

  body.invoicePrintMode .flatPackingContent .flatPackingSummary th:not(:first-child),
  body.invoicePrintMode .flatPackingContent .flatPackingSummary td:not(:first-child),
  body.invoicePrintMode .flatPackingSummary th:not(:first-child),
  body.invoicePrintMode .flatPackingSummary td:not(:first-child){
    width:36px!important;
    max-width:36px!important;
  }

  body.invoicePrintMode .flatSignatureRow{
    margin-top:4px!important;
  }
}


/* ===== Merge PVC + PPH in packing summary only ===== */
.mergedDrainagePackingSummary th:nth-child(4),
.mergedDrainagePackingSummary td:nth-child(4){
  background:#fff7ed!important;
  color:#9a3412!important;
  font-weight:900!important;
}

/* أعمدة جدول التعبئة بعد دمج صرف pvc + صرف pph في عمود صرف واحد */
.flatPackingContent .mergedDrainagePackingSummary th:first-child,
.flatPackingContent .mergedDrainagePackingSummary td:first-child,
.mergedDrainagePackingSummary th:first-child,
.mergedDrainagePackingSummary td:first-child{
  width:135px!important;
  max-width:135px!important;
}

.flatPackingContent .mergedDrainagePackingSummary th:not(:first-child),
.flatPackingContent .mergedDrainagePackingSummary td:not(:first-child),
.mergedDrainagePackingSummary th:not(:first-child),
.mergedDrainagePackingSummary td:not(:first-child){
  width:95px!important;
  max-width:95px!important;
}

@media print{
  body.invoicePrintMode .flatPackingContent .mergedDrainagePackingSummary th:first-child,
  body.invoicePrintMode .flatPackingContent .mergedDrainagePackingSummary td:first-child,
  body.invoicePrintMode .mergedDrainagePackingSummary th:first-child,
  body.invoicePrintMode .mergedDrainagePackingSummary td:first-child{
    width:68px!important;
    max-width:68px!important;
  }

  body.invoicePrintMode .flatPackingContent .mergedDrainagePackingSummary th:not(:first-child),
  body.invoicePrintMode .flatPackingContent .mergedDrainagePackingSummary td:not(:first-child),
  body.invoicePrintMode .mergedDrainagePackingSummary th:not(:first-child),
  body.invoicePrintMode .mergedDrainagePackingSummary td:not(:first-child){
    width:42px!important;
    max-width:42px!important;
  }
}


/* ===== Remove discount percent card + smart packing rows ===== */

/* حذف كارت نسبة الخصم من خانات الإجمالي: يبقى قبل الخصم وبعد الخصم فقط */
.totalsWithoutDiscountCard,
.financialTotalsStrip.totalsWithoutDiscountCard{
  display:grid!important;
  grid-template-columns:repeat(2,1fr)!important;
  gap:10px!important;
}

.totalsWithoutDiscountCard div{
  min-height:58px!important;
}

/* جدول التعبئة: الصفوف حسب نوع التعبئة الحقيقي */
.smartPackingRowsSummary td:first-child,
.smartPackingRowsSummary th:first-child{
  font-weight:900!important;
  color:#0f172a!important;
}

/* تمييز عمود صرف المدمج PVC + PPH */
.smartPackingRowsSummary th:nth-child(4),
.smartPackingRowsSummary td:nth-child(4){
  background:#fff7ed!important;
  color:#9a3412!important;
  font-weight:900!important;
}

@media print{
  body.invoicePrintMode .totalsWithoutDiscountCard,
  body.invoicePrintMode .financialTotalsStrip.totalsWithoutDiscountCard{
    grid-template-columns:repeat(2,1fr)!important;
    gap:4px!important;
  }

  body.invoicePrintMode .totalsWithoutDiscountCard div{
    min-height:26px!important;
  }
}


/* ===== Packing icons instead of table ===== */
.flatPackingIconsWrap{
  display:grid!important;
  grid-template-columns:repeat(6, minmax(0, 1fr))!important;
  gap:10px!important;
  padding:8px 4px!important;
}

.packingIconCard{
  border:1px solid #dbe4f0!important;
  border-radius:16px!important;
  background:linear-gradient(180deg,#ffffff 0%, #f8fbff 100%)!important;
  padding:10px 8px!important;
  text-align:center!important;
  box-shadow:0 6px 12px rgba(15,23,42,.04)!important;
  min-height:104px!important;
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
  align-items:center!important;
  gap:6px!important;
}

.packingIconSymbol{
  width:42px!important;
  height:42px!important;
  border-radius:14px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  background:#ecf5ff!important;
  font-size:24px!important;
  line-height:1!important;
}

.packingIconTitle{
  font-size:13px!important;
  font-weight:900!important;
  color:#0f172a!important;
  line-height:1.35!important;
}

.packingIconCount{
  font-size:22px!important;
  font-weight:900!important;
  color:#0f766e!important;
  line-height:1!important;
}

.packingIconCard.pipeRoll .packingIconSymbol{ background:#eef2ff!important; }
.packingIconCard.polyCarton .packingIconSymbol{ background:#ecfeff!important; }
.packingIconCard.valvesBlakorCarton .packingIconSymbol{ background:#f0fdf4!important; }
.packingIconCard.pvcDrainCarton .packingIconSymbol{ background:#fff7ed!important; }
.packingIconCard.pphDrainCarton .packingIconSymbol{ background:#f5f3ff!important; }
.packingIconCard.weldGreaseCarton .packingIconSymbol{ background:#fef2f2!important; }

@media(max-width:1100px){
  .flatPackingIconsWrap{
    grid-template-columns:repeat(3, minmax(0, 1fr))!important;
  }
}

@media(max-width:700px){
  .flatPackingIconsWrap{
    grid-template-columns:repeat(2, minmax(0, 1fr))!important;
  }

  .packingIconCard{
    min-height:88px!important;
  }

  .packingIconTitle{
    font-size:12px!important;
  }

  .packingIconCount{
    font-size:18px!important;
  }
}

@media print{
  body.invoicePrintMode .flatPackingIconsWrap{
    grid-template-columns:repeat(6, minmax(0, 1fr))!important;
    gap:4px!important;
    padding:2px 0!important;
  }

  body.invoicePrintMode .packingIconCard{
    min-height:48px!important;
    border-radius:8px!important;
    padding:4px 3px!important;
    gap:2px!important;
    box-shadow:none!important;
  }

  body.invoicePrintMode .packingIconSymbol{
    width:16px!important;
    height:16px!important;
    border-radius:5px!important;
    font-size:9px!important;
  }

  body.invoicePrintMode .packingIconTitle{
    font-size:6.2px!important;
    line-height:1.2!important;
  }

  body.invoicePrintMode .packingIconCount{
    font-size:9px!important;
  }
}


/* ===== Header final visual fix: far-right Mega Therm, no duplicate "رقم", bigger logos ===== */

/* الهيدر */
.premiumInvoicePaper .flatInvoiceHeader,
.flatInvoicePaper .flatInvoiceHeader{
  grid-template-columns: 440px 1fr 320px !important;
  align-items:center !important;
}

/* اللوجوهات أكبر */
.premiumInvoicePaper .flatHeaderLeft,
.flatInvoicePaper .flatHeaderLeft{
  justify-content:flex-start !important;
  padding-inline:14px !important;
}

.premiumInvoicePaper .flatInvoiceLogos,
.flatInvoicePaper .flatInvoiceLogos{
  gap:16px !important;
  justify-content:flex-start !important;
  flex-wrap:nowrap !important;
}

.premiumInvoicePaper .flatInvoiceLogos img,
.flatInvoicePaper .flatInvoiceLogos img{
  width:96px !important;
  height:68px !important;
  max-width:96px !important;
  max-height:68px !important;
  padding:5px !important;
  border-radius:14px !important;
  object-fit:contain !important;
}

/* ميجا ثيرم في أقصى اليمين */
.premiumInvoicePaper .flatHeaderRight,
.flatInvoicePaper .flatHeaderRight{
  justify-self:end !important;
  width:100% !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:flex-end !important;
  justify-content:center !important;
  text-align:right !important;
  gap:8px !important;
}

.premiumInvoicePaper .flatHeaderRight .megaThermHeaderBrand,
.flatInvoicePaper .flatHeaderRight .megaThermHeaderBrand{
  align-self:flex-end !important;
  margin-right:0 !important;
  margin-left:auto !important;
  order:1 !important;
}

.premiumInvoicePaper .flatHeaderRight strong,
.flatInvoicePaper .flatHeaderRight strong{
  order:2 !important;
  width:100% !important;
  text-align:right !important;
  margin:0 !important;
}

/* إزالة كلمة "رقم" المضافة بالـ CSS حتى لا تتكرر */
.premiumInvoicePaper .flatHeaderCenter div::before,
.flatInvoicePaper .flatHeaderCenter div::before{
  content:none !important;
  display:none !important;
}

.premiumInvoicePaper .flatHeaderCenter div,
.flatInvoicePaper .flatHeaderCenter div{
  padding-inline:18px !important;
  min-width:210px !important;
}

/* الطباعة */
@media print{
  body.invoicePrintMode .premiumInvoicePaper .flatInvoiceHeader,
  body.invoicePrintMode .flatInvoicePaper .flatInvoiceHeader{
    grid-template-columns: 290px 1fr 220px !important;
    align-items:center !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatInvoiceLogos,
  body.invoicePrintMode .flatInvoicePaper .flatInvoiceLogos{
    gap:7px !important;
    flex-wrap:nowrap !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatInvoiceLogos img,
  body.invoicePrintMode .flatInvoicePaper .flatInvoiceLogos img{
    width:64px !important;
    height:46px !important;
    max-width:64px !important;
    max-height:46px !important;
    padding:2px !important;
    border-radius:8px !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatHeaderRight,
  body.invoicePrintMode .flatInvoicePaper .flatHeaderRight{
    justify-self:end !important;
    gap:3px !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatHeaderRight .megaThermHeaderBrand,
  body.invoicePrintMode .flatInvoicePaper .flatHeaderRight .megaThermHeaderBrand{
    align-self:flex-end !important;
    margin-left:auto !important;
    font-size:8px !important;
    padding:2px 7px !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatHeaderCenter div::before,
  body.invoicePrintMode .flatInvoicePaper .flatHeaderCenter div::before{
    content:none !important;
    display:none !important;
  }

  body.invoicePrintMode .premiumInvoicePaper .flatHeaderCenter div,
  body.invoicePrintMode .flatInvoicePaper .flatHeaderCenter div{
    min-width:108px !important;
    padding-inline:8px !important;
  }
}


/* ===== Remove extra labels from invoice summary areas ===== */

/* أول خانة في جدول إجماليات التصنيف بدون كلمة الصنف */

/* حذف أي وصف صغير تحت عنوان إجمالي الكراتين والمواسير */
.flatPackingTitle span{
  display:none!important;
}

.flatPackingTitle{
  justify-content:flex-end!important;
}

.flatPackingTitle strong{
  margin-right:auto!important;
}

/* في الطباعة كذلك */
@media print{
  body.invoicePrintMode .flatPackingTitle span{
    display:none!important;
  }
}


/* ===== Category totals first header label = قائمة الخصم ===== */
.activeCategorySummary th:first-child,
.realCategoryTotals th:first-child{
  color:#0f172a!important;
  font-weight:900!important;
  white-space:nowrap!important;
}


/* ===== Show only packing icons that have quantity > 0 ===== */
.onlyActivePackingIcons{
  grid-template-columns:repeat(auto-fit, minmax(150px, 1fr))!important;
}

@media print{
  body.invoicePrintMode .onlyActivePackingIcons{
    grid-template-columns:repeat(auto-fit, minmax(90px, 1fr))!important;
  }
}


/* ===== Side footer layout: small packing cards at right, signatures stacked at left ===== */
.flatInvoiceFooterSideLayout{
  display:grid!important;
  grid-template-columns:260px 1fr!important;
  gap:16px!important;
  align-items:start!important;
  margin-top:10px!important;
}

.compactPackingAtRight{
  width:100%!important;
  margin:0!important;
  align-self:start!important;
}

.compactPackingAtRight .flatPackingTitle{
  padding:8px 10px!important;
}

.compactPackingAtRight .flatPackingTitle strong{
  font-size:18px!important;
}

.compactPackingAtRight .flatPackingContent{
  padding:8px!important;
}

.compactPackingAtRight .flatPackingBox{
  width:100%!important;
}

.compactPackingAtRight .flatPackingIconsWrap,
.compactPackingAtRight .onlyActivePackingIcons{
  grid-template-columns:1fr!important;
  gap:8px!important;
  padding:0!important;
}

.compactPackingAtRight .packingIconCard{
  min-height:62px!important;
  padding:7px 8px!important;
  border-radius:12px!important;
  gap:4px!important;
}

.compactPackingAtRight .packingIconSymbol{
  width:26px!important;
  height:26px!important;
  border-radius:9px!important;
  font-size:15px!important;
}

.compactPackingAtRight .packingIconTitle{
  font-size:12px!important;
  line-height:1.15!important;
}

.compactPackingAtRight .packingIconCount{
  font-size:18px!important;
  line-height:1!important;
}

.verticalSignatureAtLeft{
  display:flex!important;
  flex-direction:column!important;
  gap:16px!important;
  width:100%!important;
  margin-top:0!important;
  align-self:end!important;
}

.verticalSignatureAtLeft div{
  border-top:2px dashed #94a3b8!important;
  padding-top:10px!important;
  text-align:center!important;
  font-size:14px!important;
  font-weight:900!important;
  color:#0f172a!important;
  min-height:30px!important;
}

.flatInvoiceFooterSideLayout .verticalSignatureAtLeft{
  justify-self:stretch!important;
}

@media (max-width:900px){
  .flatInvoiceFooterSideLayout{
    grid-template-columns:1fr!important;
  }

  .compactPackingAtRight .flatPackingIconsWrap,
  .compactPackingAtRight .onlyActivePackingIcons{
    grid-template-columns:repeat(2, minmax(0,1fr))!important;
  }

  .verticalSignatureAtLeft{
    margin-top:10px!important;
  }
}

@media print{
  body.invoicePrintMode .flatInvoiceFooterSideLayout{
    grid-template-columns:150px 1fr!important;
    gap:8px!important;
    margin-top:4px!important;
  }

  body.invoicePrintMode .compactPackingAtRight .flatPackingTitle{
    padding:3px 4px!important;
  }

  body.invoicePrintMode .compactPackingAtRight .flatPackingTitle strong{
    font-size:8px!important;
  }

  body.invoicePrintMode .compactPackingAtRight .flatPackingContent{
    padding:3px!important;
  }

  body.invoicePrintMode .compactPackingAtRight .flatPackingIconsWrap,
  body.invoicePrintMode .compactPackingAtRight .onlyActivePackingIcons{
    grid-template-columns:1fr!important;
    gap:3px!important;
  }

  body.invoicePrintMode .compactPackingAtRight .packingIconCard{
    min-height:28px!important;
    padding:3px 4px!important;
    border-radius:6px!important;
    gap:1px!important;
  }

  body.invoicePrintMode .compactPackingAtRight .packingIconSymbol{
    width:12px!important;
    height:12px!important;
    border-radius:4px!important;
    font-size:8px!important;
  }

  body.invoicePrintMode .compactPackingAtRight .packingIconTitle{
    font-size:5.8px!important;
    line-height:1.05!important;
  }

  body.invoicePrintMode .compactPackingAtRight .packingIconCount{
    font-size:7.8px!important;
    line-height:1!important;
  }

  body.invoicePrintMode .verticalSignatureAtLeft{
    gap:8px!important;
  }

  body.invoicePrintMode .verticalSignatureAtLeft div{
    min-height:16px!important;
    padding-top:4px!important;
    font-size:8px!important;
    border-top:1px dashed #94a3b8!important;
  }
}


/* ===== Footer packing cards 2 columns, smaller, no empty space ===== */
.flatInvoiceFooterSideLayout{
  grid-template-columns:220px 1fr!important;
  gap:12px!important;
  align-items:start!important;
}

.compactPackingAtRight{
  justify-self:end!important;
  align-self:start!important;
  width:220px!important;
  max-width:220px!important;
}

.compactPackingAtRight .flatPackingTitle{
  padding:6px 8px!important;
}

.compactPackingAtRight .flatPackingTitle strong{
  font-size:15px!important;
  line-height:1.2!important;
}

.compactPackingAtRight .flatPackingContent{
  padding:6px!important;
}

.compactPackingAtRight .flatPackingIconsWrap,
.compactPackingAtRight .onlyActivePackingIcons{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:6px!important;
  padding:0!important;
}

.compactPackingAtRight .packingIconCard{
  min-height:54px!important;
  padding:6px 5px!important;
  border-radius:10px!important;
  gap:3px!important;
}

.compactPackingAtRight .packingIconSymbol{
  width:22px!important;
  height:22px!important;
  border-radius:7px!important;
  font-size:13px!important;
}

.compactPackingAtRight .packingIconTitle{
  font-size:10.5px!important;
  line-height:1.08!important;
}

.compactPackingAtRight .packingIconCount{
  font-size:15px!important;
  line-height:1!important;
}

.verticalSignatureAtLeft{
  align-self:start!important;
  justify-self:stretch!important;
  justify-content:flex-start!important;
  gap:10px!important;
  padding-top:2px!important;
}

.verticalSignatureAtLeft div{
  min-height:24px!important;
  padding-top:7px!important;
  font-size:12.5px!important;
}

@media (max-width:900px){
  .flatInvoiceFooterSideLayout{
    grid-template-columns:1fr!important;
  }

  .compactPackingAtRight{
    justify-self:stretch!important;
    width:100%!important;
    max-width:none!important;
  }

  .compactPackingAtRight .flatPackingIconsWrap,
  .compactPackingAtRight .onlyActivePackingIcons{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
}

@media print{
  body.invoicePrintMode .flatInvoiceFooterSideLayout{
    grid-template-columns:130px 1fr!important;
    gap:6px!important;
  }

  body.invoicePrintMode .compactPackingAtRight{
    width:130px!important;
    max-width:130px!important;
  }

  body.invoicePrintMode .compactPackingAtRight .flatPackingTitle{
    padding:2px 3px!important;
  }

  body.invoicePrintMode .compactPackingAtRight .flatPackingTitle strong{
    font-size:7px!important;
    line-height:1.1!important;
  }

  body.invoicePrintMode .compactPackingAtRight .flatPackingContent{
    padding:2px!important;
  }

  body.invoicePrintMode .compactPackingAtRight .flatPackingIconsWrap,
  body.invoicePrintMode .compactPackingAtRight .onlyActivePackingIcons{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:2px!important;
  }

  body.invoicePrintMode .compactPackingAtRight .packingIconCard{
    min-height:22px!important;
    padding:2px!important;
    border-radius:5px!important;
    gap:1px!important;
  }

  body.invoicePrintMode .compactPackingAtRight .packingIconSymbol{
    width:10px!important;
    height:10px!important;
    border-radius:3px!important;
    font-size:6px!important;
  }

  body.invoicePrintMode .compactPackingAtRight .packingIconTitle{
    font-size:5.1px!important;
    line-height:1.0!important;
  }

  body.invoicePrintMode .compactPackingAtRight .packingIconCount{
    font-size:6.7px!important;
  }

  body.invoicePrintMode .verticalSignatureAtLeft{
    gap:5px!important;
    padding-top:0!important;
    align-self:start!important;
  }

  body.invoicePrintMode .verticalSignatureAtLeft div{
    min-height:12px!important;
    padding-top:3px!important;
    font-size:7px!important;
  }
}


/* ===== Header visual tweaks: bigger logos + more space under title ===== */
.flatInvoicePaper .flatInvoiceLogos,
.premiumInvoicePaper .flatInvoiceLogos{
  gap:14px!important;
}

.flatInvoicePaper .flatInvoiceLogos img,
.premiumInvoicePaper .flatInvoiceLogos img{
  width:82px!important;
  height:58px!important;
  object-fit:contain!important;
  padding:6px 8px!important;
}

.flatInvoicePaper .flatHeaderCenter,
.premiumInvoicePaper .flatHeaderCenter{
  gap:14px!important;
}

.flatInvoicePaper .flatHeaderCenter h1,
.premiumInvoicePaper .flatHeaderCenter h1{
  margin-bottom:10px!important;
}

.flatInvoiceNoRow{
  display:inline-flex!important;
  flex-direction:column!important;
  gap:8px!important;
  align-items:center!important;
  justify-content:center!important;
  min-width:210px!important;
  padding:10px 18px!important;
  border:1px solid #cdd9ea!important;
  border-radius:999px!important;
  background:#fff!important;
  box-shadow:0 8px 20px rgba(15,23,42,.06)!important;
}

.flatInvoiceNoRow span{
  font-size:15px!important;
  color:#5b6b84!important;
  font-weight:800!important;
  line-height:1!important;
}

.flatInvoiceNoRow strong{
  font-size:20px!important;
  color:#0f172a!important;
  line-height:1!important;
}

/* ===== Customer balance cards in middle ===== */
.customerBalanceStrip{
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  gap:14px!important;
  margin:12px 0 10px!important;
}

.balanceCard{
  background:linear-gradient(180deg,#f8fbff 0%, #eef5ff 100%)!important;
  border:1px solid #cfe0f5!important;
  border-radius:18px!important;
  padding:14px 18px!important;
  text-align:center!important;
  box-shadow:0 10px 22px rgba(15,23,42,.06)!important;
}

.balanceCard small{
  display:block!important;
  color:#64748b!important;
  font-size:15px!important;
  font-weight:800!important;
  margin-bottom:8px!important;
}

.balanceCard strong{
  display:block!important;
  color:#0f766e!important;
  font-size:28px!important;
  font-weight:900!important;
  line-height:1.15!important;
}

/* ===== Signature icon cards ===== */
.signatureCardsAtLeft{
  display:flex!important;
  flex-direction:column!important;
  gap:12px!important;
  align-self:start!important;
  justify-self:stretch!important;
  margin-top:0!important;
}

.signatureCardsAtLeft .signatureIconCard{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:10px!important;
  min-height:58px!important;
  padding:10px 14px!important;
  border:1px solid #cfe0f5!important;
  border-radius:16px!important;
  background:linear-gradient(180deg,#ffffff 0%, #f8fbff 100%)!important;
  box-shadow:0 8px 18px rgba(15,23,42,.06)!important;
}

.signatureCardsAtLeft .signatureIconSymbol{
  width:34px!important;
  height:34px!important;
  border-radius:12px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  background:#eef5ff!important;
  font-size:18px!important;
}

.signatureCardsAtLeft .signatureIconLabel{
  font-size:16px!important;
  font-weight:900!important;
  color:#0f172a!important;
}

/* old signature lines hidden inside card mode */
.signatureCardsAtLeft div{
  border-top:none!important;
  padding-top:0!important;
  min-height:auto!important;
}

@media (max-width:900px){
  .customerBalanceStrip{
    grid-template-columns:1fr!important;
  }
}

@media print{
  body.invoicePrintMode .flatInvoicePaper .flatInvoiceLogos img,
  body.invoicePrintMode .premiumInvoicePaper .flatInvoiceLogos img{
    width:44px!important;
    height:30px!important;
    padding:2px 3px!important;
  }

  body.invoicePrintMode .flatInvoiceNoRow{
    min-width:112px!important;
    padding:5px 10px!important;
    gap:4px!important;
    border-radius:999px!important;
    box-shadow:none!important;
  }

  body.invoicePrintMode .flatInvoiceNoRow span{
    font-size:7px!important;
  }

  body.invoicePrintMode .flatInvoiceNoRow strong{
    font-size:10px!important;
  }

  body.invoicePrintMode .customerBalanceStrip{
    gap:6px!important;
    margin:5px 0 4px!important;
  }

  body.invoicePrintMode .balanceCard{
    padding:5px 8px!important;
    border-radius:9px!important;
    box-shadow:none!important;
  }

  body.invoicePrintMode .balanceCard small{
    font-size:6.5px!important;
    margin-bottom:3px!important;
  }

  body.invoicePrintMode .balanceCard strong{
    font-size:11px!important;
  }

  body.invoicePrintMode .signatureCardsAtLeft{
    gap:5px!important;
  }

  body.invoicePrintMode .signatureCardsAtLeft .signatureIconCard{
    min-height:22px!important;
    padding:4px 6px!important;
    border-radius:8px!important;
    gap:4px!important;
    box-shadow:none!important;
  }

  body.invoicePrintMode .signatureCardsAtLeft .signatureIconSymbol{
    width:12px!important;
    height:12px!important;
    border-radius:4px!important;
    font-size:7px!important;
  }

  body.invoicePrintMode .signatureCardsAtLeft .signatureIconLabel{
    font-size:7px!important;
  }
}


/* ===== Invoice bottom cleanup: compact balances + real signature space ===== */

/* رصيد العميل: أصغر ومتناسق مع كروت الإجماليات */
.customerBalanceStrip{
  display:grid!important;
  grid-template-columns:repeat(2, minmax(0, 1fr))!important;
  gap:10px!important;
  margin:8px 0 8px!important;
}

.balanceCard{
  min-height:58px!important;
  padding:8px 12px!important;
  border-radius:14px!important;
  background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%)!important;
  border:1px solid #d7e3f3!important;
  box-shadow:none!important;
}

.balanceCard small{
  font-size:12px!important;
  margin-bottom:4px!important;
  color:#64748b!important;
  font-weight:900!important;
}

.balanceCard strong{
  font-size:19px!important;
  color:#0f766e!important;
  font-weight:900!important;
  line-height:1.15!important;
}

/* تقليل الفراغ تحت الفاتورة */
.flatInvoiceFooterSideLayout{
  grid-template-columns:220px 1fr!important;
  gap:12px!important;
  align-items:start!important;
  margin-top:8px!important;
  min-height:0!important;
}

/* كروت التعبئة تفضل يمين وصغيرة */
.compactPackingAtRight{
  width:220px!important;
  max-width:220px!important;
  justify-self:end!important;
  align-self:start!important;
  margin:0!important;
}

.compactPackingAtRight .flatPackingTitle{
  padding:6px 8px!important;
}

.compactPackingAtRight .flatPackingTitle strong{
  font-size:14px!important;
  line-height:1.25!important;
}

.compactPackingAtRight .flatPackingContent{
  padding:6px!important;
}

.compactPackingAtRight .flatPackingIconsWrap,
.compactPackingAtRight .onlyActivePackingIcons{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:6px!important;
  padding:0!important;
}

.compactPackingAtRight .packingIconCard{
  min-height:52px!important;
  padding:5px 5px!important;
  border-radius:10px!important;
  gap:2px!important;
}

.compactPackingAtRight .packingIconSymbol{
  width:20px!important;
  height:20px!important;
  border-radius:7px!important;
  font-size:12px!important;
}

.compactPackingAtRight .packingIconTitle{
  font-size:10px!important;
  line-height:1.08!important;
}

.compactPackingAtRight .packingIconCount{
  font-size:14px!important;
  line-height:1!important;
}

/* كروت التوقيع: مكان إمضاء واضح بدون فراغ كبير */
.signatureCardsAtLeft{
  display:grid!important;
  grid-template-columns:repeat(3, minmax(0, 1fr))!important;
  gap:10px!important;
  align-self:start!important;
  justify-self:stretch!important;
  margin-top:0!important;
  padding-top:0!important;
}

.signatureCardsAtLeft .signatureIconCard{
  min-height:72px!important;
  padding:8px 10px!important;
  border-radius:14px!important;
  border:1px solid #d7e3f3!important;
  background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%)!important;
  box-shadow:none!important;
  display:flex!important;
  flex-direction:column!important;
  justify-content:space-between!important;
  align-items:stretch!important;
  gap:8px!important;
}

.signatureLabelLine{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
}

.signatureIconSymbol{
  width:24px!important;
  height:24px!important;
  border-radius:8px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  background:#eef5ff!important;
  font-size:13px!important;
}

.signatureIconLabel{
  font-size:13px!important;
  font-weight:900!important;
  color:#0f172a!important;
}

.signatureWriteLine{
  height:22px!important;
  border-bottom:2px dashed #94a3b8!important;
  width:100%!important;
}

/* إلغاء أي خطوط قديمة على كروت التوقيع */
.signatureCardsAtLeft div{
  border-top:none!important;
}

/* الطباعة */
@media print{
  body.invoicePrintMode .customerBalanceStrip{
    gap:4px!important;
    margin:4px 0!important;
  }

  body.invoicePrintMode .balanceCard{
    min-height:24px!important;
    padding:3px 5px!important;
    border-radius:7px!important;
  }

  body.invoicePrintMode .balanceCard small{
    font-size:6px!important;
    margin-bottom:1px!important;
  }

  body.invoicePrintMode .balanceCard strong{
    font-size:8.5px!important;
  }

  body.invoicePrintMode .flatInvoiceFooterSideLayout{
    grid-template-columns:130px 1fr!important;
    gap:5px!important;
    margin-top:3px!important;
  }

  body.invoicePrintMode .compactPackingAtRight{
    width:130px!important;
    max-width:130px!important;
  }

  body.invoicePrintMode .compactPackingAtRight .flatPackingTitle{
    padding:2px 3px!important;
  }

  body.invoicePrintMode .compactPackingAtRight .flatPackingTitle strong{
    font-size:6.5px!important;
  }

  body.invoicePrintMode .compactPackingAtRight .flatPackingContent{
    padding:2px!important;
  }

  body.invoicePrintMode .compactPackingAtRight .flatPackingIconsWrap,
  body.invoicePrintMode .compactPackingAtRight .onlyActivePackingIcons{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:2px!important;
  }

  body.invoicePrintMode .compactPackingAtRight .packingIconCard{
    min-height:21px!important;
    padding:2px!important;
    border-radius:5px!important;
    gap:1px!important;
  }

  body.invoicePrintMode .compactPackingAtRight .packingIconSymbol{
    width:10px!important;
    height:10px!important;
    font-size:6px!important;
  }

  body.invoicePrintMode .compactPackingAtRight .packingIconTitle{
    font-size:5px!important;
    line-height:1!important;
  }

  body.invoicePrintMode .compactPackingAtRight .packingIconCount{
    font-size:6.5px!important;
  }

  body.invoicePrintMode .signatureCardsAtLeft{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:4px!important;
  }

  body.invoicePrintMode .signatureCardsAtLeft .signatureIconCard{
    min-height:28px!important;
    padding:3px 4px!important;
    border-radius:6px!important;
    gap:2px!important;
  }

  body.invoicePrintMode .signatureLabelLine{
    gap:3px!important;
  }

  body.invoicePrintMode .signatureIconSymbol{
    width:10px!important;
    height:10px!important;
    border-radius:3px!important;
    font-size:6px!important;
  }

  body.invoicePrintMode .signatureIconLabel{
    font-size:6px!important;
  }

  body.invoicePrintMode .signatureWriteLine{
    height:10px!important;
    border-bottom:1px dashed #94a3b8!important;
  }
}


/* ===== Move customer balance between packing and signatures ===== */
.flatInvoiceFooterSideLayout.threeColFooterLayout.withFooterBalance{
  grid-template-columns: 220px minmax(260px, 1fr) 320px !important;
  gap: 12px !important;
  align-items: start !important;
}

.footerBalanceColumn{
  align-self: start !important;
  justify-self: stretch !important;
  margin: 0 !important;
}

.footerBalanceColumn .customerBalanceStrip{
  grid-template-columns: 1fr !important;
  gap: 10px !important;
  margin: 0 !important;
}

.footerBalanceColumn .balanceCard{
  min-height: 78px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 10px 12px !important;
}

.footerBalanceColumn .balanceCard small{
  font-size: 13px !important;
  margin-bottom: 6px !important;
}

.footerBalanceColumn .balanceCard strong{
  font-size: 24px !important;
}

/* make signature column nicely stacked on left */
.flatInvoiceFooterSideLayout.withFooterBalance .signatureCardsAtLeft{
  grid-template-columns: 1fr !important;
  gap: 10px !important;
  align-self: start !important;
}

.flatInvoiceFooterSideLayout.withFooterBalance .signatureCardsAtLeft .signatureIconCard{
  min-height: 72px !important;
}

/* compact spacing overall to avoid empty area */
.flatInvoiceFooterSideLayout.withFooterBalance{
  margin-top: 8px !important;
  min-height: 0 !important;
}

@media (max-width: 980px){
  .flatInvoiceFooterSideLayout.threeColFooterLayout.withFooterBalance{
    grid-template-columns: 1fr !important;
  }

  .footerBalanceColumn .customerBalanceStrip{
    grid-template-columns: 1fr 1fr !important;
  }

  .flatInvoiceFooterSideLayout.withFooterBalance .signatureCardsAtLeft{
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media print{
  body.invoicePrintMode .flatInvoiceFooterSideLayout.threeColFooterLayout.withFooterBalance{
    grid-template-columns: 125px minmax(130px, 1fr) 160px !important;
    gap: 4px !important;
    margin-top: 3px !important;
  }

  body.invoicePrintMode .footerBalanceColumn .customerBalanceStrip{
    grid-template-columns: 1fr !important;
    gap: 4px !important;
    margin: 0 !important;
  }

  body.invoicePrintMode .footerBalanceColumn .balanceCard{
    min-height: 24px !important;
    padding: 3px 5px !important;
  }

  body.invoicePrintMode .footerBalanceColumn .balanceCard small{
    font-size: 6px !important;
    margin-bottom: 1px !important;
  }

  body.invoicePrintMode .footerBalanceColumn .balanceCard strong{
    font-size: 9px !important;
  }

  body.invoicePrintMode .flatInvoiceFooterSideLayout.withFooterBalance .signatureCardsAtLeft{
    grid-template-columns: 1fr !important;
    gap: 3px !important;
  }

  body.invoicePrintMode .flatInvoiceFooterSideLayout.withFooterBalance .signatureCardsAtLeft .signatureIconCard{
    min-height: 26px !important;
  }
}


/* ===== Final premium invoice polish - CSS only, no data changes ===== */

/* الورقة العامة */
.premiumInvoicePaper,
.flatInvoicePaper{
  background:
    linear-gradient(180deg, rgba(248,251,255,.95) 0%, rgba(255,255,255,1) 22%),
    #fff!important;
  border:2px solid #0f172a!important;
  border-radius:18px!important;
  padding:18px!important;
  box-shadow:0 20px 45px rgba(15,23,42,.10)!important;
}

/* تقليل المسافات بين كل أجزاء الفاتورة بشكل احترافي */
.premiumInvoicePaper > * + *,
.flatInvoicePaper > * + *{
  margin-top:9px!important;
}

/* الهيدر */
.premiumInvoicePaper .flatInvoiceHeader,
.flatInvoicePaper .flatInvoiceHeader{
  border:1px solid #d8e4f5!important;
  border-bottom:2px solid #0f172a!important;
  border-radius:16px 16px 8px 8px!important;
  background:linear-gradient(135deg,#f8fbff 0%,#eef6ff 100%)!important;
  box-shadow:0 10px 24px rgba(15,23,42,.06)!important;
  overflow:hidden!important;
}

/* اللوجوهات بشكل أقوى */
.premiumInvoicePaper .flatInvoiceLogos img,
.flatInvoicePaper .flatInvoiceLogos img{
  background:#fff!important;
  border:1px solid #d5e1f1!important;
  box-shadow:0 8px 16px rgba(15,23,42,.09)!important;
  transition:none!important;
}

/* بيانات العميل */
.premiumInvoicePaper .flatInvoiceInfo,
.flatInvoicePaper .flatInvoiceInfo{
  margin-top:10px!important;
  padding:8px!important;
  border:1px solid #d8e4f5!important;
  border-radius:16px!important;
  background:#fbfdff!important;
  box-shadow:0 8px 18px rgba(15,23,42,.04)!important;
}

.premiumInvoicePaper .flatInvoiceInfo div,
.flatInvoicePaper .flatInvoiceInfo div{
  border-radius:12px!important;
  min-height:38px!important;
  background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%)!important;
}

/* جدول الأصناف */
.premiumInvoicePaper .flatInvoiceItemsTable,
.flatInvoicePaper .flatInvoiceItemsTable{
  margin-top:10px!important;
  border-radius:16px!important;
  overflow:hidden!important;
  border:1px solid #d7e3f3!important;
  box-shadow:0 10px 22px rgba(15,23,42,.06)!important;
}

.premiumInvoicePaper .flatInvoiceItemsTable th,
.flatInvoicePaper .flatInvoiceItemsTable th{
  background:linear-gradient(180deg,#101827 0%,#162238 100%)!important;
  color:#ffffff!important;
  border-color:#26344d!important;
  padding:7px 5px!important;
  font-size:10.5px!important;
  letter-spacing:.1px!important;
}

.premiumInvoicePaper .flatInvoiceItemsTable td,
.flatInvoicePaper .flatInvoiceItemsTable td{
  padding:6px 5px!important;
  border-color:#e0e8f3!important;
  background:#ffffff!important;
  font-size:10.5px!important;
  line-height:1.45!important;
}

.premiumInvoicePaper .flatInvoiceItemsTable tbody tr:nth-child(even) td,
.flatInvoicePaper .flatInvoiceItemsTable tbody tr:nth-child(even) td{
  background:#f8fbff!important;
}

/* جدول قائمة الخصم */
.realCategoryTotals,
.activeCategorySummary{
  margin-top:10px!important;
  margin-bottom:8px!important;
  border-radius:16px!important;
  overflow:hidden!important;
  border:1px solid #d7e3f3!important;
  box-shadow:0 10px 22px rgba(15,23,42,.05)!important;
}

.realCategoryTotals th,
.activeCategorySummary th{
  background:linear-gradient(180deg,#eaf3ff 0%,#dcecff 100%)!important;
  color:#0f172a!important;
  padding:7px 5px!important;
  font-size:11px!important;
}

.realCategoryTotals td,
.activeCategorySummary td{
  padding:7px 5px!important;
  font-size:11px!important;
  border-color:#d7e3f3!important;
  background:#fff!important;
}

/* كروت إجمالي قبل وبعد الخصم */
.totalsWithoutDiscountCard,
.totalsWithoutPaid{
  margin-top:8px!important;
  margin-bottom:8px!important;
  gap:10px!important;
}

.totalsWithoutDiscountCard div,
.totalsWithoutPaid div{
  border-radius:16px!important;
  min-height:60px!important;
  background:linear-gradient(180deg,#ffffff 0%,#f7fbff 100%)!important;
  border:1px solid #d7e3f3!important;
  box-shadow:0 8px 18px rgba(15,23,42,.05)!important;
}

.totalsWithoutDiscountCard b,
.totalsWithoutPaid b{
  color:#64748b!important;
  font-size:12px!important;
}

.totalsWithoutDiscountCard span,
.totalsWithoutPaid span{
  color:#0f766e!important;
  font-size:20px!important;
  font-weight:900!important;
}

/* الفوتر: الكراتين + الرصيد + التوقيع */
.flatInvoiceFooterSideLayout.threeColFooterLayout.withFooterBalance{
  margin-top:10px!important;
  padding-top:0!important;
  gap:12px!important;
  align-items:start!important;
}

/* كروت رصيد العميل */
.footerBalanceColumn .balanceCard{
  border-radius:16px!important;
  border:1px solid #d7e3f3!important;
  background:linear-gradient(180deg,#ffffff 0%,#f4f9ff 100%)!important;
  box-shadow:0 8px 18px rgba(15,23,42,.05)!important;
}

.footerBalanceColumn .balanceCard small{
  color:#64748b!important;
  font-size:12px!important;
}

.footerBalanceColumn .balanceCard strong{
  color:#0f766e!important;
  font-size:22px!important;
}

/* صندوق الكراتين والمواسير */
.compactPackingAtRight{
  border-radius:16px!important;
}

.compactPackingAtRight .flatPackingTitle{
  border-radius:16px 16px 0 0!important;
  background:linear-gradient(135deg,#eef6ff 0%,#f8fbff 100%)!important;
}

.compactPackingAtRight .flatPackingTitle strong{
  color:#0f172a!important;
}

.compactPackingAtRight .flatPackingBox{
  background:#fff!important;
}

.compactPackingAtRight .packingIconCard{
  background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%)!important;
  border:1px solid #d7e3f3!important;
  box-shadow:0 6px 12px rgba(15,23,42,.04)!important;
}

/* كروت التوقيع */
.signatureCardsAtLeft .signatureIconCard{
  border:1px solid #d7e3f3!important;
  background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%)!important;
  box-shadow:0 8px 18px rgba(15,23,42,.05)!important;
}

.signatureWriteLine{
  border-bottom:2px dashed #8fa3bf!important;
}

/* طباعة مضغوطة واحترافية */
@media print{
  @page{
    size:A4 portrait;
    margin:4mm;
  }

  body.invoicePrintMode .premiumInvoicePaper,
  body.invoicePrintMode .flatInvoicePaper{
    padding:4mm!important;
    border-radius:8px!important;
    box-shadow:none!important;
  }

  body.invoicePrintMode .premiumInvoicePaper > * + *,
  body.invoicePrintMode .flatInvoicePaper > * + *{
    margin-top:3px!important;
  }

  body.invoicePrintMode .flatInvoiceHeader{
    border-radius:6px!important;
    box-shadow:none!important;
  }

  body.invoicePrintMode .flatInvoiceInfo{
    padding:3px!important;
    border-radius:7px!important;
    box-shadow:none!important;
    margin-top:3px!important;
  }

  body.invoicePrintMode .flatInvoiceInfo div{
    min-height:18px!important;
    border-radius:5px!important;
  }

  body.invoicePrintMode .flatInvoiceItemsTable{
    margin-top:3px!important;
    border-radius:6px!important;
    box-shadow:none!important;
  }

  body.invoicePrintMode .flatInvoiceItemsTable th,
  body.invoicePrintMode .flatInvoiceItemsTable td{
    padding:1.8px 1.5px!important;
    font-size:5.9px!important;
    line-height:1.12!important;
  }

  body.invoicePrintMode .realCategoryTotals,
  body.invoicePrintMode .activeCategorySummary{
    margin-top:3px!important;
    margin-bottom:3px!important;
    border-radius:5px!important;
    box-shadow:none!important;
  }

  body.invoicePrintMode .realCategoryTotals th,
  body.invoicePrintMode .activeCategorySummary th,
  body.invoicePrintMode .realCategoryTotals td,
  body.invoicePrintMode .activeCategorySummary td{
    padding:1.7px 1.5px!important;
    font-size:5.9px!important;
  }

  body.invoicePrintMode .totalsWithoutDiscountCard,
  body.invoicePrintMode .totalsWithoutPaid{
    gap:4px!important;
    margin-top:3px!important;
    margin-bottom:3px!important;
  }

  body.invoicePrintMode .totalsWithoutDiscountCard div,
  body.invoicePrintMode .totalsWithoutPaid div{
    min-height:24px!important;
    border-radius:6px!important;
    box-shadow:none!important;
  }

  body.invoicePrintMode .totalsWithoutDiscountCard b,
  body.invoicePrintMode .totalsWithoutPaid b{
    font-size:5.8px!important;
  }

  body.invoicePrintMode .totalsWithoutDiscountCard span,
  body.invoicePrintMode .totalsWithoutPaid span{
    font-size:8px!important;
  }

  body.invoicePrintMode .flatInvoiceFooterSideLayout.threeColFooterLayout.withFooterBalance{
    margin-top:3px!important;
    gap:4px!important;
  }

  body.invoicePrintMode .footerBalanceColumn .balanceCard,
  body.invoicePrintMode .signatureCardsAtLeft .signatureIconCard,
  body.invoicePrintMode .compactPackingAtRight .packingIconCard{
    box-shadow:none!important;
  }
}


/* =====================================================================
   ULTIMATE LUXURY INVOICE THEME
   الشكل فقط بدون تغيير أي بيانات أو حسابات
===================================================================== */

.luxuryInvoiceTheme{
  --lux-navy:#081225;
  --lux-navy-2:#111f36;
  --lux-blue:#2563eb;
  --lux-cyan:#06b6d4;
  --lux-green:#0f766e;
  --lux-gold:#b7791f;
  --lux-line:#d6e4f5;
  --lux-soft:#f6f9ff;
  --lux-white:#ffffff;

  position:relative!important;
  overflow:hidden!important;
  border:0!important;
  border-radius:26px!important;
  padding:22px!important;
  background:
    radial-gradient(circle at 8% 0%, rgba(37,99,235,.12), transparent 26%),
    radial-gradient(circle at 95% 10%, rgba(6,182,212,.10), transparent 22%),
    linear-gradient(180deg,#ffffff 0%,#f8fbff 100%)!important;
  box-shadow:
    0 24px 60px rgba(8,18,37,.16),
    inset 0 0 0 2px rgba(8,18,37,.95)!important;
}

.luxuryInvoiceTheme::before{
  content:"";
  position:absolute;
  inset:10px;
  pointer-events:none;
  border:1px solid rgba(183,121,31,.28);
  border-radius:20px;
  z-index:0;
}

.luxuryInvoiceTheme > *{
  position:relative;
  z-index:1;
}

/* ===== Header ===== */
.luxuryInvoiceTheme .flatInvoiceHeader{
  display:grid!important;
  grid-template-columns:380px 1fr 340px!important;
  min-height:116px!important;
  border:0!important;
  border-radius:22px!important;
  background:
    linear-gradient(135deg,rgba(8,18,37,.96) 0%,rgba(17,31,54,.96) 55%,rgba(11,45,74,.94) 100%)!important;
  box-shadow:0 18px 38px rgba(8,18,37,.20)!important;
  overflow:hidden!important;
}

.luxuryInvoiceTheme .flatInvoiceHeader::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  height:5px;
  background:linear-gradient(90deg,var(--lux-gold),var(--lux-cyan),var(--lux-blue));
}

.luxuryInvoiceTheme .flatHeaderLeft,
.luxuryInvoiceTheme .flatHeaderCenter,
.luxuryInvoiceTheme .flatHeaderRight{
  min-height:116px!important;
  border:0!important;
  background:transparent!important;
}

/* Logos */
.luxuryInvoiceTheme .flatHeaderLeft{
  justify-content:flex-start!important;
  padding:16px 18px!important;
}

.luxuryInvoiceTheme .flatInvoiceLogos{
  gap:12px!important;
  justify-content:flex-start!important;
  align-items:center!important;
}

.luxuryInvoiceTheme .flatInvoiceLogos img{
  width:76px!important;
  height:60px!important;
  padding:7px!important;
  border-radius:18px!important;
  background:#ffffff!important;
  border:1px solid rgba(214,228,245,.9)!important;
  box-shadow:
    0 12px 24px rgba(0,0,0,.20),
    inset 0 0 0 1px rgba(255,255,255,.7)!important;
  object-fit:contain!important;
}

/* Title */
.luxuryInvoiceTheme .flatHeaderCenter{
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:12px!important;
  text-align:center!important;
}

.luxuryInvoiceTheme .flatHeaderCenter h1{
  margin:0!important;
  color:#ffffff!important;
  font-size:42px!important;
  line-height:1!important;
  font-weight:950!important;
  letter-spacing:.3px!important;
  text-shadow:0 6px 18px rgba(0,0,0,.28)!important;
}

.luxuryInvoiceTheme .flatHeaderCenter h1::before{
  content:"🧾"!important;
  font-size:26px!important;
  margin-inline-end:10px!important;
}

.luxuryInvoiceTheme .flatInvoiceNoRow{
  min-width:220px!important;
  padding:9px 20px!important;
  gap:5px!important;
  border-radius:999px!important;
  background:rgba(255,255,255,.10)!important;
  border:1px solid rgba(255,255,255,.24)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.12)!important;
}

.luxuryInvoiceTheme .flatInvoiceNoRow span{
  color:#cbd5e1!important;
  font-size:12px!important;
}

.luxuryInvoiceTheme .flatInvoiceNoRow strong{
  color:#ffffff!important;
  font-size:16px!important;
  letter-spacing:.4px!important;
}

/* Company */
.luxuryInvoiceTheme .flatHeaderRight{
  padding:16px 18px!important;
  align-items:flex-end!important;
  text-align:right!important;
}

.luxuryInvoiceTheme .flatHeaderRight .megaThermHeaderBrand{
  background:linear-gradient(135deg,#dcfce7,#bbf7d0)!important;
  color:#047857!important;
  border:0!important;
  padding:8px 16px!important;
  font-size:16px!important;
  font-weight:950!important;
  box-shadow:0 8px 18px rgba(16,185,129,.20)!important;
}

.luxuryInvoiceTheme .flatHeaderRight strong{
  color:#ffffff!important;
  font-size:16px!important;
  line-height:1.45!important;
  max-width:300px!important;
  text-shadow:0 4px 12px rgba(0,0,0,.22)!important;
}

/* ===== Info cards ===== */
.luxuryInvoiceTheme .flatInvoiceInfo{
  display:grid!important;
  grid-template-columns:repeat(2,1fr)!important;
  gap:8px!important;
  padding:0!important;
  margin:12px 0!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
}

.luxuryInvoiceTheme .flatInvoiceInfo div{
  min-height:44px!important;
  padding:9px 14px!important;
  border:1px solid var(--lux-line)!important;
  border-radius:16px!important;
  background:linear-gradient(180deg,#ffffff 0%,#f7fbff 100%)!important;
  box-shadow:0 8px 18px rgba(8,18,37,.055)!important;
}

.luxuryInvoiceTheme .flatInvoiceInfo b{
  color:#65758d!important;
  font-size:12px!important;
}

.luxuryInvoiceTheme .flatInvoiceInfo span{
  color:#081225!important;
  font-size:14px!important;
}

/* ===== Main item table ===== */
.luxuryInvoiceTheme .flatInvoiceItemsTable{
  margin-top:10px!important;
  border:0!important;
  border-radius:20px!important;
  overflow:hidden!important;
  box-shadow:0 16px 35px rgba(8,18,37,.10)!important;
  outline:1px solid var(--lux-line)!important;
}

.luxuryInvoiceTheme .flatInvoiceItemsTable th{
  padding:10px 6px!important;
  background:linear-gradient(180deg,#0b1528 0%,#111f36 100%)!important;
  color:#ffffff!important;
  border-color:#24344f!important;
  font-size:10.8px!important;
  font-weight:950!important;
}

.luxuryInvoiceTheme .flatInvoiceItemsTable td{
  padding:8px 6px!important;
  border-color:#e0e9f6!important;
  background:#ffffff!important;
  color:#081225!important;
  font-size:10.8px!important;
  font-weight:800!important;
}

.luxuryInvoiceTheme .flatInvoiceItemsTable tbody tr:nth-child(even) td{
  background:#f7fbff!important;
}

.luxuryInvoiceTheme .flatInvoiceItemsTable tbody tr:hover td{
  background:#eef6ff!important;
}

/* Code column accent */
.luxuryInvoiceTheme .flatInvoiceItemsTable td:first-child{
  color:#1d4ed8!important;
  font-weight:950!important;
}

/* ===== Discount list table ===== */
.luxuryInvoiceTheme .realCategoryTotals,
.luxuryInvoiceTheme .activeCategorySummary{
  margin-top:12px!important;
  margin-bottom:10px!important;
  border:0!important;
  border-radius:20px!important;
  overflow:hidden!important;
  outline:1px solid #cfe0f5!important;
  box-shadow:0 14px 30px rgba(8,18,37,.08)!important;
}

.luxuryInvoiceTheme .realCategoryTotals th,
.luxuryInvoiceTheme .activeCategorySummary th{
  padding:10px 6px!important;
  background:linear-gradient(180deg,#eaf3ff 0%,#dcecff 100%)!important;
  color:#081225!important;
  border-color:#cfe0f5!important;
  font-size:11.5px!important;
  font-weight:950!important;
}

.luxuryInvoiceTheme .realCategoryTotals td,
.luxuryInvoiceTheme .activeCategorySummary td{
  padding:9px 6px!important;
  background:#ffffff!important;
  border-color:#d7e6f7!important;
  color:#081225!important;
  font-size:11.5px!important;
  font-weight:900!important;
}

.luxuryInvoiceTheme .realCategoryTotals td:first-child{
  color:#0f172a!important;
  background:#f8fbff!important;
}

/* ===== Totals ===== */
.luxuryInvoiceTheme .totalsWithoutDiscountCard,
.luxuryInvoiceTheme .totalsWithoutPaid{
  margin-top:10px!important;
  margin-bottom:10px!important;
  gap:12px!important;
}

.luxuryInvoiceTheme .totalsWithoutDiscountCard div,
.luxuryInvoiceTheme .totalsWithoutPaid div{
  min-height:72px!important;
  border:0!important;
  border-radius:22px!important;
  background:
    linear-gradient(135deg,#ffffff 0%,#f4f9ff 100%)!important;
  box-shadow:
    0 14px 30px rgba(8,18,37,.08),
    inset 0 0 0 1px #d7e6f7!important;
}

.luxuryInvoiceTheme .totalsWithoutDiscountCard b,
.luxuryInvoiceTheme .totalsWithoutPaid b{
  color:#64748b!important;
  font-size:13px!important;
  font-weight:950!important;
}

.luxuryInvoiceTheme .totalsWithoutDiscountCard span,
.luxuryInvoiceTheme .totalsWithoutPaid span{
  color:#047857!important;
  font-size:24px!important;
  font-weight:950!important;
}

/* ===== Bottom three-column area ===== */
.luxuryInvoiceTheme .flatInvoiceFooterSideLayout.withFooterBalance{
  grid-template-columns:240px 1fr 330px!important;
  gap:14px!important;
  margin-top:12px!important;
  align-items:stretch!important;
}

/* Packing box */
.luxuryInvoiceTheme .compactPackingAtRight{
  width:240px!important;
  max-width:240px!important;
  border-radius:20px!important;
  overflow:hidden!important;
  box-shadow:0 14px 30px rgba(8,18,37,.08)!important;
}

.luxuryInvoiceTheme .compactPackingAtRight .flatPackingTitle{
  background:linear-gradient(135deg,#0b1528,#13233d)!important;
  color:#ffffff!important;
  border:0!important;
  padding:10px 12px!important;
}

.luxuryInvoiceTheme .compactPackingAtRight .flatPackingTitle strong{
  color:#ffffff!important;
  font-size:15px!important;
}

.luxuryInvoiceTheme .compactPackingAtRight .flatPackingContent{
  background:#ffffff!important;
  padding:8px!important;
}

.luxuryInvoiceTheme .compactPackingAtRight .flatPackingIconsWrap,
.luxuryInvoiceTheme .compactPackingAtRight .onlyActivePackingIcons{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:7px!important;
}

.luxuryInvoiceTheme .compactPackingAtRight .packingIconCard{
  min-height:58px!important;
  border-radius:14px!important;
  background:linear-gradient(180deg,#ffffff 0%,#f7fbff 100%)!important;
  border:1px solid #d7e6f7!important;
  box-shadow:none!important;
}

.luxuryInvoiceTheme .compactPackingAtRight .packingIconTitle{
  font-size:10.5px!important;
  font-weight:950!important;
}

.luxuryInvoiceTheme .compactPackingAtRight .packingIconCount{
  font-size:16px!important;
  color:#047857!important;
  font-weight:950!important;
}

/* Balance center */
.luxuryInvoiceTheme .footerBalanceColumn .customerBalanceStrip{
  grid-template-columns:1fr!important;
  gap:10px!important;
  margin:0!important;
}

.luxuryInvoiceTheme .footerBalanceColumn .balanceCard{
  min-height:92px!important;
  border:0!important;
  border-radius:22px!important;
  background:
    linear-gradient(135deg,#ffffff 0%,#f2f8ff 100%)!important;
  box-shadow:
    0 14px 30px rgba(8,18,37,.08),
    inset 0 0 0 1px #d7e6f7!important;
}

.luxuryInvoiceTheme .footerBalanceColumn .balanceCard small{
  font-size:14px!important;
  color:#64748b!important;
  font-weight:950!important;
}

.luxuryInvoiceTheme .footerBalanceColumn .balanceCard strong{
  font-size:27px!important;
  color:#047857!important;
}

/* Signature cards */
.luxuryInvoiceTheme .signatureCardsAtLeft{
  grid-template-columns:1fr!important;
  gap:10px!important;
}

.luxuryInvoiceTheme .signatureCardsAtLeft .signatureIconCard{
  min-height:62px!important;
  border:0!important;
  border-radius:18px!important;
  background:#ffffff!important;
  box-shadow:
    0 10px 24px rgba(8,18,37,.08),
    inset 0 0 0 1px #d7e6f7!important;
}

.luxuryInvoiceTheme .signatureIconSymbol{
  background:#eef5ff!important;
  color:#0f172a!important;
}

.luxuryInvoiceTheme .signatureIconLabel{
  font-size:14px!important;
  font-weight:950!important;
  color:#081225!important;
}

.luxuryInvoiceTheme .signatureWriteLine{
  height:18px!important;
  border-bottom:2px dashed #94a3b8!important;
}

/* ===== Print: premium but compact ===== */
@media print{
  body.invoicePrintMode .luxuryInvoiceTheme{
    padding:4mm!important;
    border-radius:8px!important;
    box-shadow:none!important;
    background:#ffffff!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme::before{
    inset:2mm!important;
    border-radius:6px!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme .flatInvoiceHeader{
    min-height:48px!important;
    grid-template-columns:230px 1fr 210px!important;
    border-radius:7px!important;
    box-shadow:none!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme .flatHeaderLeft,
  body.invoicePrintMode .luxuryInvoiceTheme .flatHeaderCenter,
  body.invoicePrintMode .luxuryInvoiceTheme .flatHeaderRight{
    min-height:48px!important;
    padding:4px 6px!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme .flatInvoiceLogos{
    gap:4px!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme .flatInvoiceLogos img{
    width:48px!important;
    height:34px!important;
    padding:2px!important;
    border-radius:6px!important;
    box-shadow:none!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme .flatHeaderCenter h1{
    font-size:16px!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme .flatInvoiceNoRow{
    min-width:105px!important;
    padding:3px 6px!important;
    gap:2px!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme .flatInvoiceNoRow span{
    font-size:5.8px!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme .flatInvoiceNoRow strong{
    font-size:7.5px!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme .flatHeaderRight .megaThermHeaderBrand{
    font-size:6px!important;
    padding:2px 5px!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme .flatHeaderRight strong{
    font-size:6.2px!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme .flatInvoiceInfo{
    gap:3px!important;
    margin:3px 0!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme .flatInvoiceInfo div{
    min-height:17px!important;
    padding:2px 4px!important;
    border-radius:5px!important;
    box-shadow:none!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme .flatInvoiceInfo b,
  body.invoicePrintMode .luxuryInvoiceTheme .flatInvoiceInfo span{
    font-size:5.8px!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme .flatInvoiceItemsTable,
  body.invoicePrintMode .luxuryInvoiceTheme .realCategoryTotals,
  body.invoicePrintMode .luxuryInvoiceTheme .activeCategorySummary{
    margin-top:3px!important;
    border-radius:5px!important;
    box-shadow:none!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme .flatInvoiceItemsTable th,
  body.invoicePrintMode .luxuryInvoiceTheme .flatInvoiceItemsTable td,
  body.invoicePrintMode .luxuryInvoiceTheme .realCategoryTotals th,
  body.invoicePrintMode .luxuryInvoiceTheme .realCategoryTotals td{
    padding:1.5px 1.2px!important;
    font-size:5.35px!important;
    line-height:1.08!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme .totalsWithoutDiscountCard,
  body.invoicePrintMode .luxuryInvoiceTheme .totalsWithoutPaid{
    gap:3px!important;
    margin:3px 0!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme .totalsWithoutDiscountCard div,
  body.invoicePrintMode .luxuryInvoiceTheme .totalsWithoutPaid div{
    min-height:22px!important;
    border-radius:6px!important;
    box-shadow:none!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme .totalsWithoutDiscountCard b,
  body.invoicePrintMode .luxuryInvoiceTheme .totalsWithoutPaid b{
    font-size:5.2px!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme .totalsWithoutDiscountCard span,
  body.invoicePrintMode .luxuryInvoiceTheme .totalsWithoutPaid span{
    font-size:7.2px!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme .flatInvoiceFooterSideLayout.withFooterBalance{
    grid-template-columns:116px 1fr 145px!important;
    gap:3px!important;
    margin-top:3px!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme .compactPackingAtRight{
    width:116px!important;
    max-width:116px!important;
    border-radius:6px!important;
    box-shadow:none!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme .compactPackingAtRight .flatPackingTitle{
    padding:2px 3px!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme .compactPackingAtRight .flatPackingTitle strong{
    font-size:5.5px!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme .compactPackingAtRight .flatPackingContent{
    padding:2px!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme .compactPackingAtRight .packingIconCard{
    min-height:20px!important;
    padding:1px!important;
    border-radius:4px!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme .compactPackingAtRight .packingIconSymbol{
    width:8px!important;
    height:8px!important;
    font-size:5px!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme .compactPackingAtRight .packingIconTitle{
    font-size:4.5px!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme .compactPackingAtRight .packingIconCount{
    font-size:6px!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme .footerBalanceColumn .balanceCard{
    min-height:22px!important;
    padding:2px!important;
    border-radius:6px!important;
    box-shadow:none!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme .footerBalanceColumn .balanceCard small{
    font-size:5px!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme .footerBalanceColumn .balanceCard strong{
    font-size:7px!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme .signatureCardsAtLeft{
    gap:2px!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme .signatureCardsAtLeft .signatureIconCard{
    min-height:20px!important;
    border-radius:5px!important;
    padding:2px!important;
    box-shadow:none!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme .signatureIconSymbol{
    width:8px!important;
    height:8px!important;
    font-size:5px!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme .signatureIconLabel{
    font-size:5.2px!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme .signatureWriteLine{
    height:7px!important;
    border-bottom:1px dashed #94a3b8!important;
  }
}


/* ===== Sales invoice delete button ===== */
.btn.danger{
  background:#fee2e2!important;
  color:#dc2626!important;
  border:1px solid #fecaca!important;
  box-shadow:none!important;
}

.btn.danger:hover{
  background:#fecaca!important;
  color:#991b1b!important;
}


/* ===== Compact sidebar + visible invoice items catalog columns ===== */

/* تصغير الشريط الجانبي */
.app{
  grid-template-columns:250px 1fr!important;
}

aside{
  width:250px!important;
  min-width:250px!important;
  padding:20px 14px!important;
}

.brand{
  gap:10px!important;
  padding-bottom:14px!important;
}

.logoBox{
  width:54px!important;
  height:54px!important;
  font-size:15px!important;
  border-radius:16px!important;
}

.brand h1{
  font-size:17px!important;
  line-height:1.2!important;
}

.brand p{
  font-size:10.5px!important;
  line-height:1.35!important;
}

nav{
  gap:5px!important;
}

nav button{
  min-height:44px!important;
  padding:10px 10px!important;
  font-size:13px!important;
  border-radius:14px!important;
  gap:8px!important;
}

nav button small,
nav .navGroupTitle,
.navGroupTitle{
  font-size:10px!important;
}

.userCard{
  padding:12px!important;
  border-radius:16px!important;
}

.userCard strong{
  font-size:12px!important;
}

.userCard small{
  font-size:10px!important;
}

.avatar{
  width:42px!important;
  height:42px!important;
}

.logout{
  height:46px!important;
  font-size:13px!important;
  border-radius:14px!important;
}

/* تكبير مساحة المحتوى بعد تصغير السايدبار */
main{
  min-width:0!important;
}

/* جدول فاتورة الأصناف: إظهار الأعمدة بدل ما تختفي شمال */
.invoiceCatalogPanel{
  overflow:hidden!important;
}

.invoiceCatalogPanel .tableScroll,
.invoiceCatalogPanel div[style*="overflow"],
.invoiceCatalogPanel .itemsTableWrap{
  overflow-x:auto!important;
  max-width:100%!important;
}

/* جدول اختيار الأصناف */
.invoiceCatalogTable,
.catalogItemsTable,
.invoiceItemsCatalogTable,
.invoiceCatalogPanel table{
  width:100%!important;
  min-width:0!important;
  table-layout:fixed!important;
  border-collapse:collapse!important;
}

/* ضغط الخلايا */
.invoiceCatalogPanel table th,
.invoiceCatalogPanel table td{
  padding:8px 6px!important;
  font-size:12px!important;
  line-height:1.35!important;
  white-space:normal!important;
  word-break:normal!important;
  overflow-wrap:anywhere!important;
  vertical-align:middle!important;
  text-align:center!important;
}

/* توزيع أعمدة فاتورة الأصناف حسب الصورة */
.invoiceCatalogPanel table th:nth-child(1),
.invoiceCatalogPanel table td:nth-child(1){
  width:78px!important; /* اختيار */
}

.invoiceCatalogPanel table th:nth-child(2),
.invoiceCatalogPanel table td:nth-child(2){
  width:105px!important; /* اللوجو */
}

.invoiceCatalogPanel table th:nth-child(3),
.invoiceCatalogPanel table td:nth-child(3){
  width:120px!important; /* كود */
  white-space:nowrap!important;
}

.invoiceCatalogPanel table th:nth-child(4),
.invoiceCatalogPanel table td:nth-child(4){
  width:34%!important; /* البيان ياخد أكبر مساحة */
  text-align:right!important;
}

.invoiceCatalogPanel table th:nth-child(5),
.invoiceCatalogPanel table td:nth-child(5){
  width:90px!important; /* الوحدة */
}

.invoiceCatalogPanel table th:nth-child(6),
.invoiceCatalogPanel table td:nth-child(6){
  width:95px!important; /* السعر */
}

.invoiceCatalogPanel table th:nth-child(7),
.invoiceCatalogPanel table td:nth-child(7){
  width:105px!important; /* نظام التعبئة */
}

/* أي أعمدة زيادة تظهر صغيرة بدل ما تختفي */
.invoiceCatalogPanel table th:nth-child(n+8),
.invoiceCatalogPanel table td:nth-child(n+8){
  width:90px!important;
}

/* زر اختيار أصغر */
.invoiceCatalogPanel .btn,
.invoiceCatalogPanel button{
  min-width:62px!important;
  padding:8px 10px!important;
  font-size:13px!important;
  border-radius:14px!important;
}

/* اللوجو داخل جدول الأصناف */
.invoiceCatalogPanel img{
  max-width:72px!important;
  max-height:38px!important;
  object-fit:contain!important;
}

/* كسر مشكلة بداية الجدول من اليمين وإخفاء الشمال */
.invoiceCatalogPanel table{
  direction:rtl!important;
}

.invoiceCatalogPanel{
  direction:rtl!important;
}

/* للشاشات الأقل */
@media(max-width:1200px){
  .app{
    grid-template-columns:220px 1fr!important;
  }

  aside{
    width:220px!important;
    min-width:220px!important;
    padding:16px 10px!important;
  }

  .brand h1{
    font-size:15px!important;
  }

  nav button{
    font-size:12px!important;
    padding:9px 8px!important;
  }

  .invoiceCatalogPanel table th,
  .invoiceCatalogPanel table td{
    font-size:11px!important;
    padding:7px 4px!important;
  }
}

@media(max-width:900px){
  .app{
    grid-template-columns:1fr!important;
  }

  aside{
    position:relative!important;
    width:100%!important;
    min-width:0!important;
  }
}


/* ===== 100% zoom catalog fit fix ===== */
/* الهدف: جدول فاتورة الأصناف يبقى مظبوط على زوم 100% بدون تكسير الكلام بالطول */

/* تصغير الشريط الجانبي أكثر */
.app{
  grid-template-columns:205px minmax(0,1fr)!important;
}

aside{
  width:205px!important;
  min-width:205px!important;
  max-width:205px!important;
  padding:16px 9px!important;
}

.brand{
  gap:8px!important;
}

.logoBox{
  width:46px!important;
  height:46px!important;
  font-size:13px!important;
  border-radius:14px!important;
}

.brand h1{
  font-size:15px!important;
}

.brand p{
  font-size:9.5px!important;
  line-height:1.25!important;
}

nav button{
  min-height:40px!important;
  padding:8px 8px!important;
  font-size:12px!important;
  border-radius:12px!important;
}

.userCard{
  padding:10px!important;
}

.logout{
  height:42px!important;
  font-size:12px!important;
}

/* تقليل مساحة المحتوى الخارجية */
main{
  padding-inline:18px!important;
  min-width:0!important;
}

.panel,
.invoiceCatalogPanel{
  padding:22px!important;
}

/* جدول فاتورة الأصناف على عرض 100% */
.invoiceCatalogPanel .tableScroll,
.invoiceCatalogPanel .tableWrap,
.invoiceCatalogPanel .dataTableWrap,
.invoiceCatalogPanel div[style*="overflow"]{
  width:100%!important;
  max-width:100%!important;
  overflow-x:hidden!important;
}

/* كل جداول فاتورة الأصناف */
.invoiceCatalogPanel table{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  table-layout:fixed!important;
  border-collapse:collapse!important;
}

/* منع تكسير الكلمات بالطول */
.invoiceCatalogPanel table th,
.invoiceCatalogPanel table td{
  padding:8px 4px!important;
  font-size:11px!important;
  line-height:1.25!important;
  vertical-align:middle!important;
  text-align:center!important;
  white-space:nowrap!important;
  word-break:normal!important;
  overflow-wrap:normal!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}

/* البيان ياخد أكبر مساحة ولا يتكسر بالطول */
.invoiceCatalogPanel table th:nth-child(4),
.invoiceCatalogPanel table td:nth-child(4){
  width:22%!important;
  min-width:180px!important;
  text-align:right!important;
  white-space:nowrap!important;
  word-break:normal!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}

/* توزيع باقي الأعمدة حسب ترتيب الجدول الحالي */
.invoiceCatalogPanel table th:nth-child(1),
.invoiceCatalogPanel table td:nth-child(1){
  width:64px!important; /* اختيار */
}

.invoiceCatalogPanel table th:nth-child(2),
.invoiceCatalogPanel table td:nth-child(2){
  width:78px!important; /* اللوجو */
}

.invoiceCatalogPanel table th:nth-child(3),
.invoiceCatalogPanel table td:nth-child(3){
  width:82px!important; /* كود */
}

.invoiceCatalogPanel table th:nth-child(5),
.invoiceCatalogPanel table td:nth-child(5){
  width:58px!important; /* الوحدة */
}

.invoiceCatalogPanel table th:nth-child(6),
.invoiceCatalogPanel table td:nth-child(6){
  width:64px!important; /* السعر */
}

.invoiceCatalogPanel table th:nth-child(7),
.invoiceCatalogPanel table td:nth-child(7){
  width:78px!important; /* نظام التعبئة */
}

.invoiceCatalogPanel table th:nth-child(8),
.invoiceCatalogPanel table td:nth-child(8){
  width:66px!important; /* عدد التعبئة */
}

.invoiceCatalogPanel table th:nth-child(9),
.invoiceCatalogPanel table td:nth-child(9){
  width:86px!important; /* التصنيف */
}

.invoiceCatalogPanel table th:nth-child(10),
.invoiceCatalogPanel table td:nth-child(10){
  width:66px!important; /* رصيد المخزن */
}

.invoiceCatalogPanel table th:nth-child(11),
.invoiceCatalogPanel table td:nth-child(11){
  width:70px!important; /* الحالة */
}

.invoiceCatalogPanel table th:nth-child(12),
.invoiceCatalogPanel table td:nth-child(12){
  width:84px!important; /* الكمية */
}

/* الزر أصغر عشان العمود ما يكبرش */
.invoiceCatalogPanel table .btn,
.invoiceCatalogPanel table button{
  min-width:52px!important;
  height:42px!important;
  padding:7px 8px!important;
  font-size:12px!important;
  border-radius:12px!important;
}

/* اللوجو أصغر */
.invoiceCatalogPanel table img,
.invoiceCatalogPanel .brandChip img,
.invoiceCatalogPanel .brandPill img{
  max-width:56px!important;
  max-height:30px!important;
  object-fit:contain!important;
}

/* خلايا الحالة والكمية */
.invoiceCatalogPanel .tag,
.invoiceCatalogPanel .pill{
  padding:6px 8px!important;
  font-size:10px!important;
  border-radius:12px!important;
}

/* منع وجود شريط أفقي أسفل الجدول إلا لو الشاشة صغيرة جدًا */
.invoiceCatalogPanel{
  overflow:hidden!important;
}

/* عند الشاشات الأصغر من 1300 نضغط أكثر */
@media(max-width:1300px){
  .app{
    grid-template-columns:190px minmax(0,1fr)!important;
  }

  aside{
    width:190px!important;
    min-width:190px!important;
    max-width:190px!important;
  }

  main{
    padding-inline:14px!important;
  }

  .panel,
  .invoiceCatalogPanel{
    padding:18px!important;
  }

  .invoiceCatalogPanel table th,
  .invoiceCatalogPanel table td{
    font-size:10.3px!important;
    padding:7px 3px!important;
  }

  .invoiceCatalogPanel table th:nth-child(4),
  .invoiceCatalogPanel table td:nth-child(4){
    min-width:160px!important;
  }

  .invoiceCatalogPanel table th:nth-child(2),
  .invoiceCatalogPanel table td:nth-child(2){
    width:68px!important;
  }

  .invoiceCatalogPanel table th:nth-child(3),
  .invoiceCatalogPanel table td:nth-child(3){
    width:74px!important;
  }

  .invoiceCatalogPanel table th:nth-child(7),
  .invoiceCatalogPanel table td:nth-child(7){
    width:68px!important;
  }

  .invoiceCatalogPanel table th:nth-child(9),
  .invoiceCatalogPanel table td:nth-child(9){
    width:78px!important;
  }

  .invoiceCatalogPanel table .btn,
  .invoiceCatalogPanel table button{
    min-width:48px!important;
    height:38px!important;
    font-size:11px!important;
  }

  .invoiceCatalogPanel table img,
  .invoiceCatalogPanel .brandChip img,
  .invoiceCatalogPanel .brandPill img{
    max-width:48px!important;
    max-height:26px!important;
  }
}

/* لو الشاشة صغيرة جدًا رجّع التمرير بدل تخريب الجدول */
@media(max-width:1050px){
  .invoiceCatalogPanel .tableScroll,
  .invoiceCatalogPanel .tableWrap,
  .invoiceCatalogPanel .dataTableWrap,
  .invoiceCatalogPanel div[style*="overflow"]{
    overflow-x:auto!important;
  }

  .invoiceCatalogPanel table{
    min-width:980px!important;
  }
}


/* ===== Extra discount after all invoice discounts ===== */
.invoiceExtraTotalsBar{
  display:grid!important;
  grid-template-columns:220px 220px 220px auto!important;
  gap:14px!important;
  align-items:center!important;
  justify-content:start!important;
}

.invoiceExtraTotalsBar .invoiceTotalCard{
  min-height:88px!important;
  border:1px solid #d7e3f3!important;
  border-radius:20px!important;
  background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%)!important;
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
  align-items:center!important;
  gap:8px!important;
  padding:12px!important;
}

.invoiceExtraTotalsBar .invoiceTotalCard span{
  font-size:14px!important;
  font-weight:900!important;
  color:#64748b!important;
}

.invoiceExtraTotalsBar .invoiceTotalCard strong{
  font-size:24px!important;
  font-weight:900!important;
  color:#0f766e!important;
}

.extraDiscountInputWrap{
  width:100%!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
}

.extraDiscountInputWrap input{
  width:120px!important;
  height:42px!important;
  text-align:center!important;
  border:1px solid #d7e3f3!important;
  border-radius:14px!important;
  background:#fff!important;
  color:#dc2626!important;
  font-size:19px!important;
  font-weight:900!important;
}

.extraDiscountInputWrap small{
  font-size:13px!important;
  font-weight:900!important;
  color:#64748b!important;
}

.netInvoiceCard{
  background:linear-gradient(180deg,#ecfdf5 0%,#ffffff 100%)!important;
  border-color:#bbf7d0!important;
}

.extraDiscountInvoiceCard{
  background:linear-gradient(180deg,#fff7ed 0%,#ffffff 100%)!important;
  border-color:#fed7aa!important;
}

.invoiceExtraTotalsBar #invoiceSaveButton{
  min-width:170px!important;
  height:60px!important;
  font-size:16px!important;
  font-weight:900!important;
  border-radius:18px!important;
}

.invoicePreviewExtraTotals{
  grid-template-columns:repeat(3,1fr)!important;
}

.invoicePreviewExtraTotals div:nth-child(2) span{
  color:#dc2626!important;
}

@media(max-width:1100px){
  .invoiceExtraTotalsBar{
    grid-template-columns:1fr 1fr!important;
  }

  .invoiceExtraTotalsBar #invoiceSaveButton{
    width:100%!important;
  }
}

@media print{
  body.invoicePrintMode .invoicePreviewExtraTotals{
    grid-template-columns:repeat(3,1fr)!important;
  }
}


/* ===== Extra discount layout fix: current invoice + registered list + preview ===== */

/* 1) أصناف الفاتورة الحالية: الإجماليات والخصم الإضافي جنب بعض بدون تداخل */
.invoiceExtraTotalsBar,
.currentInvoiceTotalsBar.invoiceExtraTotalsBar{
  display:grid!important;
  grid-template-columns: minmax(190px,1fr) minmax(220px,1fr) minmax(190px,1fr) 170px!important;
  gap:12px!important;
  align-items:stretch!important;
  justify-content:stretch!important;
  padding:16px 18px!important;
}

.invoiceExtraTotalsBar .invoiceTotalCard{
  min-height:78px!important;
  height:78px!important;
  padding:10px 12px!important;
  border-radius:18px!important;
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
  align-items:center!important;
  gap:6px!important;
}

.invoiceExtraTotalsBar .invoiceTotalCard span{
  font-size:13px!important;
  line-height:1.2!important;
}

.invoiceExtraTotalsBar .invoiceTotalCard strong{
  font-size:22px!important;
  line-height:1!important;
}

.extraDiscountInputWrap{
  width:100%!important;
  height:42px!important;
  display:grid!important;
  grid-template-columns:1fr 34px!important;
  gap:6px!important;
  align-items:center!important;
}

.extraDiscountInputWrap input{
  width:100%!important;
  max-width:none!important;
  height:40px!important;
  font-size:18px!important;
  border-radius:13px!important;
  padding:0 8px!important;
}

.extraDiscountInputWrap small{
  font-size:12px!important;
  white-space:nowrap!important;
}

.invoiceExtraTotalsBar #invoiceSaveButton{
  width:100%!important;
  min-width:0!important;
  height:78px!important;
  margin:0!important;
  border-radius:18px!important;
  align-self:stretch!important;
  justify-self:stretch!important;
}

/* لما مفيش أصناف، مايبقاش فيه فراغ قبيح */
.currentInvoiceTotalsBar{
  min-height:auto!important;
}

/* 2) فواتير البيع المسجلة: الأزرار جنب بعض والجدول ميتكسرش */
.invoiceRegisteredActions,
td .invoiceRegisteredActions,
.table .invoiceRegisteredActions{
  display:flex!important;
  flex-direction:row!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
  flex-wrap:nowrap!important;
  min-width:250px!important;
}

.invoiceRegisteredActions .btn{
  min-width:72px!important;
  height:42px!important;
  padding:8px 10px!important;
  border-radius:14px!important;
  font-size:12px!important;
  white-space:nowrap!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
}

.invoiceRegisteredActions .btn.primary{
  min-width:105px!important;
}

.btn.danger{
  background:#fee2e2!important;
  color:#dc2626!important;
  border:1px solid #fecaca!important;
  box-shadow:none!important;
}

.btn.danger:hover{
  background:#fecaca!important;
  color:#991b1b!important;
}

/* جدول فواتير البيع المسجلة */
#content table td,
#content table th{
  vertical-align:middle!important;
}

#content table td:last-child{
  min-width:260px!important;
}

/* منع كسر التاريخ ورقم الفاتورة بشكل مبالغ */
#content table td:nth-child(1),
#content table td:nth-child(2),
#content table th:nth-child(1),
#content table th:nth-child(2){
  white-space:nowrap!important;
}

/* 3) معاينة الفاتورة: إجمالي + خصم إضافي + صافي في صف واحد */
.invoicePreviewExtraTotals,
.flatInvoicePaper .invoicePreviewExtraTotals,
.premiumInvoicePaper .invoicePreviewExtraTotals{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:10px!important;
  margin-top:8px!important;
  margin-bottom:8px!important;
}

.invoicePreviewExtraTotals div{
  min-height:66px!important;
  border-radius:18px!important;
  padding:10px 12px!important;
}

.invoicePreviewExtraTotals b{
  font-size:12px!important;
  margin-bottom:6px!important;
}

.invoicePreviewExtraTotals span{
  font-size:22px!important;
  line-height:1!important;
}

.invoicePreviewExtraTotals div:nth-child(2) span{
  color:#dc2626!important;
}

.invoicePreviewExtraTotals div:nth-child(3){
  background:linear-gradient(180deg,#ecfdf5 0%,#ffffff 100%)!important;
  border-color:#bbf7d0!important;
}

/* تحسين على الزوم 100% */
@media(max-width:1250px){
  .invoiceExtraTotalsBar,
  .currentInvoiceTotalsBar.invoiceExtraTotalsBar{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }

  .invoiceExtraTotalsBar #invoiceSaveButton{
    height:64px!important;
  }

  .invoiceRegisteredActions{
    min-width:220px!important;
    gap:6px!important;
  }

  .invoiceRegisteredActions .btn{
    min-width:64px!important;
    font-size:11px!important;
    padding-inline:8px!important;
  }

  .invoiceRegisteredActions .btn.primary{
    min-width:92px!important;
  }

  #content table td:last-child{
    min-width:230px!important;
  }
}

@media(max-width:850px){
  .invoiceExtraTotalsBar,
  .currentInvoiceTotalsBar.invoiceExtraTotalsBar{
    grid-template-columns:1fr!important;
  }

  .invoicePreviewExtraTotals{
    grid-template-columns:1fr!important;
  }

  .invoiceRegisteredActions{
    flex-wrap:wrap!important;
    min-width:0!important;
  }
}

/* الطباعة */
@media print{
  body.invoicePrintMode .invoicePreviewExtraTotals{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:3px!important;
    margin:3px 0!important;
  }

  body.invoicePrintMode .invoicePreviewExtraTotals div{
    min-height:22px!important;
    border-radius:6px!important;
    padding:2px 4px!important;
  }

  body.invoicePrintMode .invoicePreviewExtraTotals b{
    font-size:5.5px!important;
    margin-bottom:1px!important;
  }

  body.invoicePrintMode .invoicePreviewExtraTotals span{
    font-size:7px!important;
  }
}


/* ===== Full width workspace + remove empty gap beside sidebar ===== */

/* السايدبار أصغر والمساحة كلها للمحتوى */
.app{
  grid-template-columns:185px minmax(0, 1fr)!important;
  gap:0!important;
}

aside{
  width:185px!important;
  min-width:185px!important;
  max-width:185px!important;
  padding:14px 8px!important;
}

.brand{
  gap:7px!important;
  padding-bottom:12px!important;
}

.logoBox{
  width:42px!important;
  height:42px!important;
  font-size:12px!important;
  border-radius:13px!important;
}

.brand h1{
  font-size:14px!important;
  line-height:1.15!important;
}

.brand p{
  font-size:9px!important;
  line-height:1.25!important;
}

nav button{
  min-height:39px!important;
  padding:8px 7px!important;
  font-size:11.5px!important;
  border-radius:12px!important;
  gap:6px!important;
}

.userCard{
  padding:9px!important;
  border-radius:14px!important;
}

.logout{
  height:40px!important;
  font-size:12px!important;
  border-radius:13px!important;
}

/* المحتوى يتمدد لآخر المساحة بدون max-width يسيب فراغ يمين */
main{
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  padding:22px 18px 28px 18px!important;
  box-sizing:border-box!important;
}

#content{
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
}

.panel,
.card,
.invoiceCatalogPanel,
#content > .panel,
#content > .card{
  width:100%!important;
  max-width:none!important;
  box-sizing:border-box!important;
}

/* صفحة فواتير البيع لا تترك فراغ جنب السايدبار */
#content .panel,
#content .invoiceCatalogPanel{
  margin-inline:0!important;
}

/* الكروت الكبيرة تمتد */
.grid4,
.grid3,
.statsGrid{
  width:100%!important;
  max-width:none!important;
}

/* ===== فاتورة الأصناف: خلي الجدول ياخد العرض كله بدل ما يضغط ناحية الشمال ===== */
.invoiceCatalogPanel{
  padding:22px!important;
  overflow:hidden!important;
}

.invoiceCatalogPanel .tableScroll,
.invoiceCatalogPanel .tableWrap,
.invoiceCatalogPanel .dataTableWrap,
.invoiceCatalogPanel div[style*="overflow"]{
  width:100%!important;
  max-width:100%!important;
  overflow-x:hidden!important;
  margin:0!important;
}

/* الجدول يتمدد على عرض الكارت كله */
.invoiceCatalogPanel table{
  width:100%!important;
  max-width:100%!important;
  min-width:100%!important;
  table-layout:fixed!important;
  border-collapse:collapse!important;
}

/* لا نخلي عمود البيان يتكسر بالطول */
.invoiceCatalogPanel table th,
.invoiceCatalogPanel table td{
  white-space:nowrap!important;
  word-break:normal!important;
  overflow-wrap:normal!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  vertical-align:middle!important;
  text-align:center!important;
  padding:8px 5px!important;
  font-size:11px!important;
  line-height:1.3!important;
}

/* توزيع أعمدة فاتورة الأصناف على كامل المساحة */
.invoiceCatalogPanel table th:nth-child(1),
.invoiceCatalogPanel table td:nth-child(1){
  width:66px!important; /* اختيار */
}

.invoiceCatalogPanel table th:nth-child(2),
.invoiceCatalogPanel table td:nth-child(2){
  width:74px!important; /* اللوجو */
}

.invoiceCatalogPanel table th:nth-child(3),
.invoiceCatalogPanel table td:nth-child(3){
  width:82px!important; /* كود */
}

.invoiceCatalogPanel table th:nth-child(4),
.invoiceCatalogPanel table td:nth-child(4){
  width:auto!important; /* البيان يتمدد في المساحة الفاضية */
  min-width:240px!important;
  text-align:right!important;
}

.invoiceCatalogPanel table th:nth-child(5),
.invoiceCatalogPanel table td:nth-child(5){
  width:62px!important; /* الوحدة */
}

.invoiceCatalogPanel table th:nth-child(6),
.invoiceCatalogPanel table td:nth-child(6){
  width:68px!important; /* السعر */
}

.invoiceCatalogPanel table th:nth-child(7),
.invoiceCatalogPanel table td:nth-child(7){
  width:78px!important; /* نظام التعبئة */
}

.invoiceCatalogPanel table th:nth-child(8),
.invoiceCatalogPanel table td:nth-child(8){
  width:70px!important; /* عدد التعبئة */
}

.invoiceCatalogPanel table th:nth-child(9),
.invoiceCatalogPanel table td:nth-child(9){
  width:92px!important; /* التصنيف */
}

.invoiceCatalogPanel table th:nth-child(10),
.invoiceCatalogPanel table td:nth-child(10){
  width:72px!important; /* رصيد المخزن */
}

.invoiceCatalogPanel table th:nth-child(11),
.invoiceCatalogPanel table td:nth-child(11){
  width:72px!important; /* الحالة */
}

.invoiceCatalogPanel table th:nth-child(12),
.invoiceCatalogPanel table td:nth-child(12){
  width:86px!important; /* الكمية */
}

/* أزرار ولوجو الجدول */
.invoiceCatalogPanel table button,
.invoiceCatalogPanel table .btn{
  min-width:54px!important;
  height:40px!important;
  padding:7px 8px!important;
  font-size:12px!important;
  border-radius:12px!important;
}

.invoiceCatalogPanel table img,
.invoiceCatalogPanel .brandChip img,
.invoiceCatalogPanel .brandPill img{
  max-width:54px!important;
  max-height:30px!important;
  object-fit:contain!important;
}

/* إزالة شريط التمرير الأفقي داخل جدول الأصناف في العرض الطبيعي */
.invoiceCatalogPanel *{
  scrollbar-width:thin;
}

/* إصلاح المساحة البيضاء يمين الكارت بسبب أي max-width داخلي */
.invoiceCatalogPanel > *,
.panel > *{
  max-width:100%!important;
}

/* أصناف الفاتورة الحالية أيضًا تستخدم العرض كله */
.invoiceLinesTable{
  width:100%!important;
  min-width:0!important;
  table-layout:fixed!important;
}

.invoiceLinesTable th,
.invoiceLinesTable td{
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}

/* عند الشاشات الضيقة فقط نسمح بالتمرير بدل تكسير الجدول */
@media(max-width:1150px){
  .app{
    grid-template-columns:170px minmax(0,1fr)!important;
  }

  aside{
    width:170px!important;
    min-width:170px!important;
    max-width:170px!important;
  }

  main{
    padding-inline:12px!important;
  }

  .invoiceCatalogPanel table th,
  .invoiceCatalogPanel table td{
    font-size:10px!important;
    padding:7px 3px!important;
  }

  .invoiceCatalogPanel table th:nth-child(4),
  .invoiceCatalogPanel table td:nth-child(4){
    min-width:190px!important;
  }
}

@media(max-width:980px){
  .app{
    grid-template-columns:1fr!important;
  }

  aside{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
  }

  .invoiceCatalogPanel .tableScroll,
  .invoiceCatalogPanel .tableWrap,
  .invoiceCatalogPanel .dataTableWrap,
  .invoiceCatalogPanel div[style*="overflow"]{
    overflow-x:auto!important;
  }

  .invoiceCatalogPanel table{
    min-width:1050px!important;
  }
}


/* ===== Restore sidebar width + remove wrong empty gap ===== */
/* تصحيح مهم: لا تصغير للشريط الجانبي، ولا فراغ بين المحتوى والسايدبار */

/* رجوع الشريط الجانبي للمقاس الطبيعي */
aside{
  width:340px!important;
  min-width:340px!important;
  max-width:340px!important;
  padding:30px 26px 22px!important;
}

/* رجوع شكل الشعار والنصوص في السايدبار */
.logoBox{
  width:64px!important;
  height:64px!important;
  font-size:18px!important;
  border-radius:18px!important;
}

.brand{
  gap:14px!important;
  padding-bottom:18px!important;
}

.brand h1{
  font-size:20px!important;
  line-height:1.2!important;
}

.brand p{
  font-size:12px!important;
  line-height:1.45!important;
}

nav button{
  min-height:48px!important;
  padding:12px 14px!important;
  font-size:14px!important;
  border-radius:16px!important;
  gap:10px!important;
}

.userCard{
  padding:16px!important;
  border-radius:18px!important;
}

.logout{
  height:50px!important;
  font-size:14px!important;
  border-radius:16px!important;
}

/* المهم: المحتوى يبدأ بعد السايدبار مباشرة، لا فراغ زيادة */
main{
  margin-right:340px!important;
  width:calc(100% - 340px)!important;
  max-width:none!important;
  min-width:0!important;
  padding:38px 28px!important;
  box-sizing:border-box!important;
}

#content{
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
}

/* الكروت والبانلات تستخدم عرض المحتوى بالكامل */
#content > .panel,
#content > .card,
.panel,
.card,
.invoiceCatalogPanel{
  width:100%!important;
  max-width:none!important;
  box-sizing:border-box!important;
}

/* إلغاء أي إعداد سابق كان بيعمل مساحة فاضية */
.app{
  display:flex!important;
  direction:rtl!important;
  gap:0!important;
}

/* ===== إصلاح جدول فاتورة الأصناف ===== */
/* مايتقصش من الشمال، ولو الجدول أكبر يبقى فيه سحب طبيعي بدل قص الكلام */
.invoiceCatalogPanel{
  overflow:visible!important;
}

.invoiceCatalogPanel .tableScroll,
.invoiceCatalogPanel .tableWrap,
.invoiceCatalogPanel .dataTableWrap,
.invoiceCatalogPanel div[style*="overflow"]{
  width:100%!important;
  max-width:100%!important;
  overflow-x:auto!important;
  overflow-y:auto!important;
  margin:0!important;
}

/* الجدول يملأ الكارت ولا يسيب فراغ */
.invoiceCatalogPanel table{
  width:100%!important;
  min-width:1180px!important;
  max-width:none!important;
  table-layout:fixed!important;
  border-collapse:collapse!important;
}

/* منع قص الكلام بالطول */
.invoiceCatalogPanel table th,
.invoiceCatalogPanel table td{
  white-space:nowrap!important;
  word-break:normal!important;
  overflow-wrap:normal!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  vertical-align:middle!important;
  text-align:center!important;
  padding:8px 5px!important;
  font-size:11px!important;
  line-height:1.3!important;
}

/* البيان ياخد مساحة كويسة */
.invoiceCatalogPanel table th:nth-child(4),
.invoiceCatalogPanel table td:nth-child(4){
  width:260px!important;
  min-width:260px!important;
  text-align:right!important;
}

/* أزرار الكمية في الشمال تظهر كاملة */
.invoiceCatalogPanel table th:nth-child(12),
.invoiceCatalogPanel table td:nth-child(12){
  width:120px!important;
  min-width:120px!important;
  overflow:visible!important;
}

.invoiceCatalogPanel table td:nth-child(12) button,
.invoiceCatalogPanel table td:nth-child(12) .btn{
  min-width:100px!important;
  white-space:nowrap!important;
}

/* زر اختيار واللوجو */
.invoiceCatalogPanel table th:nth-child(1),
.invoiceCatalogPanel table td:nth-child(1){
  width:80px!important;
}

.invoiceCatalogPanel table th:nth-child(2),
.invoiceCatalogPanel table td:nth-child(2){
  width:90px!important;
}

.invoiceCatalogPanel table th:nth-child(3),
.invoiceCatalogPanel table td:nth-child(3){
  width:92px!important;
}

.invoiceCatalogPanel table img{
  max-width:62px!important;
  max-height:34px!important;
  object-fit:contain!important;
}

.invoiceCatalogPanel table .btn,
.invoiceCatalogPanel table button{
  height:42px!important;
  border-radius:13px!important;
  font-size:12px!important;
}

/* للشاشات الصغيرة فقط */
@media(max-width:900px){
  aside{
    position:relative!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
  }

  main{
    margin-right:0!important;
    width:100%!important;
    padding:24px 14px!important;
  }

  .app{
    display:block!important;
  }
}


/* ===== Print should match invoice preview ===== */
/* الطباعة بنفس شكل المعاينة قدر الإمكان بدون تغيير البيانات */
@media print{
  @page{
    size:A4 portrait;
    margin:6mm;
  }

  html,
  body{
    width:210mm!important;
    min-height:297mm!important;
    background:#ffffff!important;
    -webkit-print-color-adjust:exact!important;
    print-color-adjust:exact!important;
  }

  body.invoicePrintMode{
    background:#ffffff!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
  }

  body.invoicePrintMode *{
    -webkit-print-color-adjust:exact!important;
    print-color-adjust:exact!important;
  }

  /* إخفاء كل النظام وترك الفاتورة فقط */
  body.invoicePrintMode aside,
  body.invoicePrintMode .topBar,
  body.invoicePrintMode .desktopBadge,
  body.invoicePrintMode .panel:not(.invoicePrintArea):not(.invoicePreviewPanel),
  body.invoicePrintMode .noPrint,
  body.invoicePrintMode button,
  body.invoicePrintMode .btn{
    visibility:hidden!important;
  }

  body.invoicePrintMode #app,
  body.invoicePrintMode main,
  body.invoicePrintMode #content,
  body.invoicePrintMode .invoicePreviewPanel,
  body.invoicePrintMode .invoicePrintArea,
  body.invoicePrintMode .salesInvoicePaper,
  body.invoicePrintMode .flatInvoicePaper,
  body.invoicePrintMode .premiumInvoicePaper,
  body.invoicePrintMode .luxuryInvoiceTheme{
    visibility:visible!important;
  }

  body.invoicePrintMode #app{
    display:block!important;
  }

  body.invoicePrintMode main{
    margin:0!important;
    padding:0!important;
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
    background:#fff!important;
  }

  body.invoicePrintMode #content{
    margin:0!important;
    padding:0!important;
    width:100%!important;
    max-width:none!important;
  }

  body.invoicePrintMode .invoicePreviewPanel,
  body.invoicePrintMode .invoicePrintArea{
    margin:0!important;
    padding:0!important;
    width:100%!important;
    max-width:none!important;
    background:#fff!important;
    box-shadow:none!important;
    border:0!important;
  }

  /* الورقة نفسها: نفس شكل المعاينة مع مقاس مناسب للطباعة */
  body.invoicePrintMode .salesInvoicePaper,
  body.invoicePrintMode .flatInvoicePaper,
  body.invoicePrintMode .premiumInvoicePaper,
  body.invoicePrintMode .luxuryInvoiceTheme{
    width:100%!important;
    max-width:198mm!important;
    min-height:auto!important;
    margin:0 auto!important;
    padding:7mm!important;
    box-sizing:border-box!important;
    border:2px solid #0f172a!important;
    border-radius:12px!important;
    background:
      radial-gradient(circle at 8% 0%, rgba(37,99,235,.08), transparent 26%),
      radial-gradient(circle at 95% 10%, rgba(6,182,212,.08), transparent 22%),
      linear-gradient(180deg,#ffffff 0%,#f8fbff 100%)!important;
    box-shadow:none!important;
    overflow:visible!important;
    transform:none!important;
  }

  body.invoicePrintMode .luxuryInvoiceTheme::before{
    inset:3mm!important;
    border-radius:9px!important;
    border:1px solid rgba(183,121,31,.28)!important;
  }

  /* نفس الهيدر بتاع المعاينة */
  body.invoicePrintMode .flatInvoiceHeader{
    display:grid!important;
    grid-template-columns:35% 30% 35%!important;
    min-height:74px!important;
    border:0!important;
    border-radius:16px!important;
    background:linear-gradient(135deg,rgba(8,18,37,.96) 0%,rgba(17,31,54,.96) 55%,rgba(11,45,74,.94) 100%)!important;
    box-shadow:none!important;
    overflow:hidden!important;
    position:relative!important;
  }

  body.invoicePrintMode .flatInvoiceHeader::after{
    content:""!important;
    position:absolute!important;
    left:0!important;
    right:0!important;
    bottom:0!important;
    height:4px!important;
    background:linear-gradient(90deg,#b7791f,#06b6d4,#2563eb)!important;
  }

  body.invoicePrintMode .flatHeaderLeft,
  body.invoicePrintMode .flatHeaderCenter,
  body.invoicePrintMode .flatHeaderRight{
    min-height:74px!important;
    padding:8px 10px!important;
    background:transparent!important;
    border:0!important;
  }

  body.invoicePrintMode .flatInvoiceLogos{
    gap:7px!important;
    flex-wrap:nowrap!important;
  }

  body.invoicePrintMode .flatInvoiceLogos img{
    width:48px!important;
    height:36px!important;
    padding:3px!important;
    border-radius:9px!important;
    background:#fff!important;
    border:1px solid #d5e1f1!important;
    object-fit:contain!important;
    box-shadow:none!important;
  }

  body.invoicePrintMode .flatHeaderCenter{
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    gap:7px!important;
    text-align:center!important;
  }

  body.invoicePrintMode .flatHeaderCenter h1{
    margin:0!important;
    color:#fff!important;
    font-size:22px!important;
    line-height:1!important;
    font-weight:950!important;
    text-shadow:none!important;
  }

  body.invoicePrintMode .flatInvoiceNoRow{
    min-width:118px!important;
    padding:5px 10px!important;
    gap:3px!important;
    border-radius:999px!important;
    background:rgba(255,255,255,.12)!important;
    border:1px solid rgba(255,255,255,.24)!important;
    box-shadow:none!important;
  }

  body.invoicePrintMode .flatInvoiceNoRow span{
    font-size:7px!important;
    color:#cbd5e1!important;
    font-weight:800!important;
  }

  body.invoicePrintMode .flatInvoiceNoRow strong{
    font-size:9px!important;
    color:#fff!important;
    font-weight:900!important;
  }

  body.invoicePrintMode .flatHeaderRight{
    align-items:flex-end!important;
    justify-content:center!important;
    text-align:right!important;
    gap:5px!important;
  }

  body.invoicePrintMode .megaThermHeaderBrand{
    font-size:8px!important;
    padding:3px 7px!important;
    border-radius:999px!important;
    background:linear-gradient(135deg,#dcfce7,#bbf7d0)!important;
    color:#047857!important;
    font-weight:950!important;
  }

  body.invoicePrintMode .flatHeaderRight strong{
    color:#fff!important;
    font-size:8px!important;
    line-height:1.35!important;
    max-width:170px!important;
  }

  /* بيانات العميل */
  body.invoicePrintMode .flatInvoiceInfo{
    display:grid!important;
    grid-template-columns:repeat(2,1fr)!important;
    gap:4px!important;
    margin:5px 0!important;
    padding:0!important;
    border:0!important;
    background:transparent!important;
    box-shadow:none!important;
  }

  body.invoicePrintMode .flatInvoiceInfo div{
    min-height:23px!important;
    padding:4px 6px!important;
    border:1px solid #d8e4f5!important;
    border-radius:8px!important;
    background:linear-gradient(180deg,#ffffff 0%,#f7fbff 100%)!important;
    box-shadow:none!important;
  }

  body.invoicePrintMode .flatInvoiceInfo b,
  body.invoicePrintMode .flatInvoiceInfo span{
    font-size:7px!important;
    line-height:1.2!important;
  }

  /* جدول الأصناف */
  body.invoicePrintMode .flatInvoiceItemsTable{
    width:100%!important;
    margin-top:5px!important;
    border-radius:10px!important;
    overflow:hidden!important;
    border:1px solid #d7e3f3!important;
    outline:0!important;
    box-shadow:none!important;
    table-layout:fixed!important;
    border-collapse:collapse!important;
  }

  body.invoicePrintMode .flatInvoiceItemsTable th{
    background:linear-gradient(180deg,#0b1528 0%,#111f36 100%)!important;
    color:#fff!important;
    border-color:#24344f!important;
    padding:3px 2px!important;
    font-size:6.2px!important;
    line-height:1.15!important;
    font-weight:900!important;
  }

  body.invoicePrintMode .flatInvoiceItemsTable td{
    padding:3px 2px!important;
    font-size:6.2px!important;
    line-height:1.18!important;
    border-color:#e0e9f6!important;
    background:#fff!important;
    color:#081225!important;
    font-weight:800!important;
  }

  body.invoicePrintMode .flatInvoiceItemsTable tbody tr:nth-child(even) td{
    background:#f7fbff!important;
  }

  /* جدول قائمة الخصم */
  body.invoicePrintMode .realCategoryTotals,
  body.invoicePrintMode .activeCategorySummary{
    width:100%!important;
    margin-top:5px!important;
    margin-bottom:5px!important;
    border-radius:10px!important;
    overflow:hidden!important;
    border:1px solid #cfe0f5!important;
    box-shadow:none!important;
    table-layout:fixed!important;
    border-collapse:collapse!important;
  }

  body.invoicePrintMode .realCategoryTotals th,
  body.invoicePrintMode .activeCategorySummary th,
  body.invoicePrintMode .realCategoryTotals td,
  body.invoicePrintMode .activeCategorySummary td{
    padding:3px 2px!important;
    font-size:6.5px!important;
    line-height:1.18!important;
    border-color:#d7e6f7!important;
  }

  body.invoicePrintMode .realCategoryTotals th,
  body.invoicePrintMode .activeCategorySummary th{
    background:linear-gradient(180deg,#eaf3ff 0%,#dcecff 100%)!important;
    color:#081225!important;
  }

  body.invoicePrintMode .realCategoryTotals td,
  body.invoicePrintMode .activeCategorySummary td{
    background:#fff!important;
    color:#081225!important;
  }

  /* إجماليات المعاينة جنب بعض */
  body.invoicePrintMode .invoicePreviewExtraTotals,
  body.invoicePrintMode .totalsWithoutDiscountCard,
  body.invoicePrintMode .totalsWithoutPaid{
    display:grid!important;
    grid-template-columns:repeat(3,1fr)!important;
    gap:4px!important;
    margin:5px 0!important;
  }

  body.invoicePrintMode .invoicePreviewExtraTotals div,
  body.invoicePrintMode .totalsWithoutDiscountCard div,
  body.invoicePrintMode .totalsWithoutPaid div{
    min-height:32px!important;
    padding:5px 6px!important;
    border-radius:9px!important;
    background:linear-gradient(180deg,#ffffff 0%,#f7fbff 100%)!important;
    border:1px solid #d7e3f3!important;
    box-shadow:none!important;
  }

  body.invoicePrintMode .invoicePreviewExtraTotals b,
  body.invoicePrintMode .totalsWithoutDiscountCard b,
  body.invoicePrintMode .totalsWithoutPaid b{
    font-size:6.5px!important;
    margin-bottom:3px!important;
    color:#64748b!important;
  }

  body.invoicePrintMode .invoicePreviewExtraTotals span,
  body.invoicePrintMode .totalsWithoutDiscountCard span,
  body.invoicePrintMode .totalsWithoutPaid span{
    font-size:9px!important;
    color:#0f766e!important;
    font-weight:950!important;
  }

  /* الفوتر: كروت التعبئة + الرصيد + التوقيع */
  body.invoicePrintMode .flatInvoiceFooterSideLayout.withFooterBalance,
  body.invoicePrintMode .flatInvoiceFooterSideLayout.threeColFooterLayout.withFooterBalance{
    display:grid!important;
    grid-template-columns:125px 1fr 150px!important;
    gap:4px!important;
    margin-top:5px!important;
    align-items:start!important;
  }

  body.invoicePrintMode .compactPackingAtRight{
    width:125px!important;
    max-width:125px!important;
    border-radius:8px!important;
    overflow:hidden!important;
    box-shadow:none!important;
  }

  body.invoicePrintMode .compactPackingAtRight .flatPackingTitle{
    padding:3px 4px!important;
    background:linear-gradient(135deg,#0b1528,#13233d)!important;
    color:#fff!important;
  }

  body.invoicePrintMode .compactPackingAtRight .flatPackingTitle strong{
    font-size:6.2px!important;
    color:#fff!important;
  }

  body.invoicePrintMode .compactPackingAtRight .flatPackingContent{
    padding:3px!important;
    background:#fff!important;
  }

  body.invoicePrintMode .compactPackingAtRight .flatPackingIconsWrap,
  body.invoicePrintMode .compactPackingAtRight .onlyActivePackingIcons{
    display:grid!important;
    grid-template-columns:repeat(2,1fr)!important;
    gap:2px!important;
    padding:0!important;
  }

  body.invoicePrintMode .compactPackingAtRight .packingIconCard{
    min-height:24px!important;
    padding:2px!important;
    border-radius:5px!important;
    border:1px solid #d7e6f7!important;
    background:#fff!important;
    box-shadow:none!important;
  }

  body.invoicePrintMode .compactPackingAtRight .packingIconSymbol{
    width:10px!important;
    height:10px!important;
    font-size:6px!important;
    border-radius:3px!important;
  }

  body.invoicePrintMode .compactPackingAtRight .packingIconTitle{
    font-size:5px!important;
    line-height:1.05!important;
  }

  body.invoicePrintMode .compactPackingAtRight .packingIconCount{
    font-size:6.8px!important;
    line-height:1!important;
  }

  body.invoicePrintMode .footerBalanceColumn .customerBalanceStrip{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:4px!important;
    margin:0!important;
  }

  body.invoicePrintMode .footerBalanceColumn .balanceCard{
    min-height:30px!important;
    padding:4px!important;
    border-radius:8px!important;
    border:1px solid #d7e6f7!important;
    background:#fff!important;
    box-shadow:none!important;
  }

  body.invoicePrintMode .footerBalanceColumn .balanceCard small{
    font-size:6px!important;
    margin-bottom:2px!important;
  }

  body.invoicePrintMode .footerBalanceColumn .balanceCard strong{
    font-size:8.5px!important;
    color:#0f766e!important;
  }

  body.invoicePrintMode .signatureCardsAtLeft{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:3px!important;
    margin:0!important;
  }

  body.invoicePrintMode .signatureCardsAtLeft .signatureIconCard{
    min-height:30px!important;
    padding:4px!important;
    border-radius:8px!important;
    border:1px solid #d7e6f7!important;
    background:#fff!important;
    box-shadow:none!important;
  }

  body.invoicePrintMode .signatureLabelLine{
    gap:3px!important;
  }

  body.invoicePrintMode .signatureIconSymbol{
    width:11px!important;
    height:11px!important;
    border-radius:4px!important;
    font-size:6px!important;
  }

  body.invoicePrintMode .signatureIconLabel{
    font-size:6.2px!important;
  }

  body.invoicePrintMode .signatureWriteLine{
    height:9px!important;
    border-bottom:1px dashed #94a3b8!important;
  }
}


/* ===== Signature cards text right aligned ===== */
/* جعل كلام المستلم / المندوب / أمين المخزن ناحية اليمين */
.signatureCardsAtLeft .signatureIconCard{
  align-items:stretch!important;
  text-align:right!important;
  direction:rtl!important;
}

.signatureCardsAtLeft .signatureLabelLine{
  width:100%!important;
  display:flex!important;
  flex-direction:row!important;
  justify-content:flex-start!important;
  align-items:center!important;
  text-align:right!important;
  direction:rtl!important;
  gap:8px!important;
}

.signatureCardsAtLeft .signatureIconLabel{
  text-align:right!important;
  margin:0!important;
}

.signatureCardsAtLeft .signatureIconSymbol{
  flex:0 0 auto!important;
}

.signatureCardsAtLeft .signatureWriteLine{
  width:100%!important;
}

/* نفس المحاذاة في الطباعة */
@media print{
  body.invoicePrintMode .signatureCardsAtLeft .signatureIconCard{
    align-items:stretch!important;
    text-align:right!important;
    direction:rtl!important;
  }

  body.invoicePrintMode .signatureCardsAtLeft .signatureLabelLine{
    justify-content:flex-start!important;
    text-align:right!important;
    direction:rtl!important;
    gap:3px!important;
  }

  body.invoicePrintMode .signatureCardsAtLeft .signatureIconLabel{
    text-align:right!important;
  }
}


/* ===== Force print invoice totals to match preview layout ===== */
/* إصلاح اختلاف شكل إجمالي الفاتورة / خصم إضافي / صافي الفاتورة في الطباعة */
@media print{
  body.invoicePrintMode .flatInvoicePaper .flatTotalsStrip.financialTotalsStrip.totalsWithoutPaid.totalsWithoutDiscountCard.invoicePreviewExtraTotals,
  body.invoicePrintMode .premiumInvoicePaper .flatTotalsStrip.financialTotalsStrip.totalsWithoutPaid.totalsWithoutDiscountCard.invoicePreviewExtraTotals,
  body.invoicePrintMode .luxuryInvoiceTheme .flatTotalsStrip.financialTotalsStrip.totalsWithoutPaid.totalsWithoutDiscountCard.invoicePreviewExtraTotals,
  body.invoicePrintMode .salesInvoicePaper .flatTotalsStrip.financialTotalsStrip.totalsWithoutPaid.totalsWithoutDiscountCard.invoicePreviewExtraTotals{
    width:100%!important;
    max-width:100%!important;
    display:grid!important;
    grid-template-columns:repeat(3, minmax(0, 1fr))!important;
    grid-auto-flow:column!important;
    gap:4px!important;
    margin:5px 0!important;
    align-items:stretch!important;
  }

  body.invoicePrintMode .flatInvoicePaper .invoicePreviewExtraTotals > div,
  body.invoicePrintMode .premiumInvoicePaper .invoicePreviewExtraTotals > div,
  body.invoicePrintMode .luxuryInvoiceTheme .invoicePreviewExtraTotals > div,
  body.invoicePrintMode .salesInvoicePaper .invoicePreviewExtraTotals > div{
    width:auto!important;
    max-width:none!important;
    min-width:0!important;
    min-height:34px!important;
    height:auto!important;
    margin:0!important;
    padding:5px 6px!important;
    border-radius:9px!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    text-align:center!important;
    background:linear-gradient(180deg,#ffffff 0%,#f7fbff 100%)!important;
    border:1px solid #d7e3f3!important;
    box-shadow:none!important;
    break-inside:avoid!important;
    page-break-inside:avoid!important;
  }

  body.invoicePrintMode .flatInvoicePaper .invoicePreviewExtraTotals > div b,
  body.invoicePrintMode .premiumInvoicePaper .invoicePreviewExtraTotals > div b,
  body.invoicePrintMode .luxuryInvoiceTheme .invoicePreviewExtraTotals > div b,
  body.invoicePrintMode .salesInvoicePaper .invoicePreviewExtraTotals > div b{
    display:block!important;
    font-size:6.5px!important;
    line-height:1.1!important;
    margin:0 0 3px!important;
    color:#64748b!important;
    font-weight:900!important;
    white-space:nowrap!important;
  }

  body.invoicePrintMode .flatInvoicePaper .invoicePreviewExtraTotals > div span,
  body.invoicePrintMode .premiumInvoicePaper .invoicePreviewExtraTotals > div span,
  body.invoicePrintMode .luxuryInvoiceTheme .invoicePreviewExtraTotals > div span,
  body.invoicePrintMode .salesInvoicePaper .invoicePreviewExtraTotals > div span{
    display:block!important;
    font-size:9px!important;
    line-height:1.1!important;
    color:#0f766e!important;
    font-weight:950!important;
    white-space:nowrap!important;
  }

  body.invoicePrintMode .flatInvoicePaper .invoicePreviewExtraTotals > div:nth-child(2) span,
  body.invoicePrintMode .premiumInvoicePaper .invoicePreviewExtraTotals > div:nth-child(2) span,
  body.invoicePrintMode .luxuryInvoiceTheme .invoicePreviewExtraTotals > div:nth-child(2) span,
  body.invoicePrintMode .salesInvoicePaper .invoicePreviewExtraTotals > div:nth-child(2) span{
    color:#dc2626!important;
  }

  body.invoicePrintMode .flatInvoicePaper .invoicePreviewExtraTotals > div:nth-child(3),
  body.invoicePrintMode .premiumInvoicePaper .invoicePreviewExtraTotals > div:nth-child(3),
  body.invoicePrintMode .luxuryInvoiceTheme .invoicePreviewExtraTotals > div:nth-child(3),
  body.invoicePrintMode .salesInvoicePaper .invoicePreviewExtraTotals > div:nth-child(3){
    background:linear-gradient(180deg,#ecfdf5 0%,#ffffff 100%)!important;
    border-color:#bbf7d0!important;
  }
}


/* ===== Clean current invoice extra discount bar ===== */
/* تحسين شكل إجمالي الفاتورة / خصم إضافي / صافي الفاتورة / حفظ الفاتورة */
.currentInvoiceTotalsBar.invoiceExtraTotalsBar,
.invoiceExtraTotalsBar{
  display:grid!important;
  grid-template-columns:220px 1fr 1fr 1fr!important;
  gap:14px!important;
  align-items:stretch!important;
  padding:18px 22px!important;
  border-radius:22px!important;
}

/* ترتيب الأعمدة في RTL:
   إجمالي الفاتورة يمين، خصم إضافي، صافي الفاتورة، حفظ الفاتورة شمال */
.invoiceExtraTotalsBar .invoiceTotalCard{
  height:86px!important;
  min-height:86px!important;
  padding:12px 16px!important;
  border-radius:18px!important;
  background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%)!important;
  border:1px solid #d7e3f3!important;
  box-shadow:none!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
  overflow:hidden!important;
}

.invoiceExtraTotalsBar .invoiceTotalCard span{
  display:block!important;
  font-size:14px!important;
  font-weight:900!important;
  color:#64748b!important;
  line-height:1.1!important;
  margin:0!important;
  text-align:center!important;
}

.invoiceExtraTotalsBar .invoiceTotalCard strong{
  display:block!important;
  font-size:25px!important;
  font-weight:950!important;
  line-height:1!important;
  color:#0f766e!important;
  margin:0!important;
  text-align:center!important;
}

/* كارت خصم إضافي */
.invoiceExtraTotalsBar .extraDiscountInvoiceCard{
  background:linear-gradient(180deg,#fff7ed 0%,#ffffff 100%)!important;
  border-color:#fed7aa!important;
  position:relative!important;
}

.invoiceExtraTotalsBar .extraDiscountInputWrap{
  width:100%!important;
  height:42px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
  background:transparent!important;
  border:0!important;
  padding:0!important;
  margin:0!important;
}

.invoiceExtraTotalsBar .extraDiscountInputWrap input{
  width:150px!important;
  max-width:150px!important;
  height:40px!important;
  padding:0 12px!important;
  border:1px solid #fdba74!important;
  border-radius:14px!important;
  background:#ffffff!important;
  color:#dc2626!important;
  font-size:22px!important;
  font-weight:950!important;
  text-align:center!important;
  line-height:40px!important;
  box-shadow:inset 0 1px 0 rgba(15,23,42,.03)!important;
}

.invoiceExtraTotalsBar .extraDiscountInputWrap input:focus{
  outline:none!important;
  border-color:#f97316!important;
  box-shadow:0 0 0 3px rgba(249,115,22,.12)!important;
}

.invoiceExtraTotalsBar .extraDiscountInputWrap small{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  height:40px!important;
  min-width:34px!important;
  font-size:13px!important;
  font-weight:900!important;
  color:#9a3412!important;
  margin:0!important;
  white-space:nowrap!important;
}

/* صافي الفاتورة */
.invoiceExtraTotalsBar .netInvoiceCard{
  background:linear-gradient(180deg,#ecfdf5 0%,#ffffff 100%)!important;
  border-color:#bbf7d0!important;
}

/* زر حفظ الفاتورة */
.invoiceExtraTotalsBar #invoiceSaveButton{
  width:100%!important;
  height:86px!important;
  min-height:86px!important;
  margin:0!important;
  border-radius:18px!important;
  font-size:19px!important;
  font-weight:950!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  align-self:stretch!important;
  justify-self:stretch!important;
  box-shadow:0 18px 32px rgba(37,99,235,.20)!important;
}

/* منع أي تداخل قديم */
.invoiceExtraTotalsBar .extraDiscountInvoiceCard .extraDiscountInputWrap,
.invoiceExtraTotalsBar .extraDiscountInvoiceCard input{
  position:relative!important;
  inset:auto!important;
  transform:none!important;
}

/* الشاشات المتوسطة */
@media(max-width:1200px){
  .currentInvoiceTotalsBar.invoiceExtraTotalsBar,
  .invoiceExtraTotalsBar{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }

  .invoiceExtraTotalsBar #invoiceSaveButton{
    height:72px!important;
    min-height:72px!important;
  }
}

/* الموبايل */
@media(max-width:760px){
  .currentInvoiceTotalsBar.invoiceExtraTotalsBar,
  .invoiceExtraTotalsBar{
    grid-template-columns:1fr!important;
    padding:14px!important;
  }

  .invoiceExtraTotalsBar .invoiceTotalCard,
  .invoiceExtraTotalsBar #invoiceSaveButton{
    height:72px!important;
    min-height:72px!important;
  }
}


/* ===== Final neat extra discount bar ===== */
/* شكل أبسط وأنضف لكروت الإجمالي / الخصم الإضافي / الصافي / الحفظ */
.currentInvoiceTotalsBar.invoiceExtraTotalsBar,
.invoiceExtraTotalsBar{
  display:grid!important;
  grid-template-columns:1fr 1fr 1fr 220px!important;
  gap:16px!important;
  align-items:stretch!important;
  padding:18px 22px!important;
  border-radius:24px!important;
  background:linear-gradient(180deg,#f8fbff 0%,#eef6ff 100%)!important;
  border:1px solid #d7e3f3!important;
}

/* الكروت العامة */
.invoiceExtraTotalsBar .invoiceTotalCard{
  height:88px!important;
  min-height:88px!important;
  padding:12px 16px!important;
  border-radius:20px!important;
  background:#ffffff!important;
  border:1px solid #d7e3f3!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
  box-shadow:0 8px 18px rgba(15,23,42,.04)!important;
}

.invoiceExtraTotalsBar .invoiceTotalCard span{
  font-size:14px!important;
  font-weight:900!important;
  color:#64748b!important;
  line-height:1.15!important;
  margin:0!important;
}

.invoiceExtraTotalsBar .invoiceTotalCard strong{
  font-size:25px!important;
  font-weight:950!important;
  color:#0f766e!important;
  line-height:1!important;
  margin:0!important;
}

/* كارت الخصم الإضافي */
.invoiceExtraTotalsBar .extraDiscountInvoiceCard{
  background:linear-gradient(180deg,#fffaf5 0%,#ffffff 100%)!important;
  border:1px solid #fed7aa!important;
}

/* خانة الخصم كحقل واحد أنيق بدل ج.م منفصلة */
.invoiceExtraTotalsBar .extraDiscountInputWrap{
  width:100%!important;
  max-width:230px!important;
  height:44px!important;
  display:flex!important;
  flex-direction:row-reverse!important;
  align-items:center!important;
  justify-content:center!important;
  gap:0!important;
  padding:0 10px!important;
  margin:0!important;
  border:1px solid #fdba74!important;
  border-radius:15px!important;
  background:#ffffff!important;
  box-shadow:inset 0 1px 0 rgba(15,23,42,.03)!important;
}

.invoiceExtraTotalsBar .extraDiscountInputWrap input{
  flex:1!important;
  width:100%!important;
  max-width:none!important;
  height:40px!important;
  min-width:0!important;
  border:0!important;
  background:transparent!important;
  color:#dc2626!important;
  font-size:22px!important;
  font-weight:950!important;
  text-align:center!important;
  padding:0!important;
  margin:0!important;
  box-shadow:none!important;
  outline:none!important;
}

.invoiceExtraTotalsBar .extraDiscountInputWrap input:focus{
  outline:none!important;
  border:0!important;
  box-shadow:none!important;
}

.invoiceExtraTotalsBar .extraDiscountInputWrap small{
  width:38px!important;
  height:40px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  font-size:13px!important;
  font-weight:900!important;
  color:#9a3412!important;
  margin:0!important;
  white-space:nowrap!important;
}

/* الصافي */
.invoiceExtraTotalsBar .netInvoiceCard{
  background:linear-gradient(180deg,#ecfdf5 0%,#ffffff 100%)!important;
  border-color:#bbf7d0!important;
}

/* زر الحفظ متوازن */
.invoiceExtraTotalsBar #invoiceSaveButton{
  width:100%!important;
  min-width:0!important;
  height:88px!important;
  min-height:88px!important;
  margin:0!important;
  border-radius:20px!important;
  font-size:19px!important;
  font-weight:950!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  box-shadow:0 14px 26px rgba(37,99,235,.18)!important;
}

/* إزالة أي تأثيرات قديمة على الخصم */
.invoiceExtraTotalsBar .extraDiscountInvoiceCard *,
.invoiceExtraTotalsBar .extraDiscountInputWrap *{
  transform:none!important;
}

/* متوسط */
@media(max-width:1200px){
  .currentInvoiceTotalsBar.invoiceExtraTotalsBar,
  .invoiceExtraTotalsBar{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }

  .invoiceExtraTotalsBar #invoiceSaveButton{
    height:74px!important;
    min-height:74px!important;
  }
}

/* موبايل */
@media(max-width:760px){
  .currentInvoiceTotalsBar.invoiceExtraTotalsBar,
  .invoiceExtraTotalsBar{
    grid-template-columns:1fr!important;
    padding:14px!important;
  }

  .invoiceExtraTotalsBar .invoiceTotalCard,
  .invoiceExtraTotalsBar #invoiceSaveButton{
    height:74px!important;
    min-height:74px!important;
  }
}


/* ===== Hide zero discounts in print ===== */
/* إخفاء خصم إضافي في الطباعة لو قيمته صفر */
@media print{
  body.invoicePrintMode .invoicePreviewExtraTotals.noExtraDiscountForPrint{
    grid-template-columns:repeat(2, minmax(0, 1fr))!important;
  }

  body.invoicePrintMode .invoicePreviewExtraTotals.noExtraDiscountForPrint .extraDiscountPrintCard{
    display:none!important;
  }

  /* إخفاء صف نسبة خصم التصنيف في الطباعة لو كل النسب صفر */
  body.invoicePrintMode .realCategoryTotals.noCategoryDiscountForPrint .categoryDiscountPrintRow,
  body.invoicePrintMode .activeCategorySummary.noCategoryDiscountForPrint .categoryDiscountPrintRow{
    display:none!important;
  }
}


/* ===== Hide zero category discount cells ===== */
/* لا تعرض 0% داخل صف نسبة الخصم؛ يظهر الخصم فقط للتصنيف الذي عليه خصم فعلي */
.zeroCategoryDiscountCell{
  color:transparent!important;
}

.zeroCategoryDiscountCell::after{
  content:""!important;
}

.hasCategoryDiscountCell{
  color:#dc2626!important;
  font-weight:900!important;
}

@media print{
  body.invoicePrintMode .zeroCategoryDiscountCell{
    color:transparent!important;
  }

  body.invoicePrintMode .hasCategoryDiscountCell{
    color:#dc2626!important;
    font-weight:900!important;
  }
}


/* ===== Hide category discount summary when no category discount exists ===== */
/* في الطباعة: لو لا يوجد خصم تصنيف، اخفِ جدول قائمة الخصم كله */
@media print{
  body.invoicePrintMode .realCategoryTotals.hideCategorySummaryWhenNoDiscount,
  body.invoicePrintMode .activeCategorySummary.hideCategorySummaryWhenNoDiscount{
    display:none!important;
  }
}

/* لو فيه خصم تصنيف، تظهر فقط أعمدة التصنيفات التي عليها خصم فعلي */
.onlyDiscountedCategoryColumns .hasCategoryDiscountCell{
  color:#dc2626!important;
  font-weight:900!important;
}

@media print{
  body.invoicePrintMode .onlyDiscountedCategoryColumns .hasCategoryDiscountCell{
    color:#dc2626!important;
    font-weight:900!important;
  }
}


/* ===== Inline invoice item input: remove line total and move notes to the end ===== */
.inlineQtyControls{
  grid-template-columns:160px 140px 140px 150px minmax(260px,1fr) auto!important;
  gap:12px!important;
  align-items:end!important;
}

.inlineNotesField{
  min-width:0!important;
}

.inlineNotesField label{
  display:block!important;
  text-align:right!important;
  margin-bottom:6px!important;
  color:#667085!important;
  font-weight:900!important;
  font-size:13px!important;
}

.inlineNotesField input{
  width:100%!important;
  height:52px!important;
  border-radius:14px!important;
  border:1px solid #d9e4f3!important;
  background:#f8fbff!important;
  padding:0 14px!important;
  font-weight:800!important;
}

.inlineTotalQtyEstimate{
  min-height:52px!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
}

.inlineAddInvoiceBtn{
  height:52px!important;
  min-width:130px!important;
  white-space:nowrap!important;
}

/* إلغاء أي مساحة كانت محجوزة لكارت إجمالي السطر القديم */
.inlineQtyControls .inlineEstimate{
  margin:0!important;
}

@media(max-width:1200px){
  .inlineQtyControls{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }

  .inlineNotesField{
    grid-column:1 / -1!important;
  }

  .inlineAddInvoiceBtn{
    width:100%!important;
  }
}

@media(max-width:900px){
  .inlineQtyControls{
    grid-template-columns:1fr!important;
  }
}


/* ===== Notes after add invoice button ===== */
/* ترتيب صف إدخال الصنف: طريقة الكمية، الكمية، الخصم، الإجمالي، إضافة للفاتورة، ملاحظات */
.inlineQtyControls{
  grid-template-columns:160px 140px 140px 150px 130px minmax(300px,1fr)!important;
  gap:12px!important;
  align-items:end!important;
}

.inlineAddInvoiceBtn{
  height:52px!important;
  min-width:130px!important;
  white-space:nowrap!important;
}

.inlineNotesField{
  min-width:0!important;
}

.inlineNotesField input{
  height:52px!important;
}

/* في الشاشات المتوسطة الملاحظات تأخذ صف كامل بعد الزر */
@media(max-width:1200px){
  .inlineQtyControls{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }

  .inlineAddInvoiceBtn{
    width:100%!important;
  }

  .inlineNotesField{
    grid-column:1 / -1!important;
  }
}

@media(max-width:900px){
  .inlineQtyControls{
    grid-template-columns:1fr!important;
  }
}


/* ===== Locked profits section ===== */
.lockedProfitsPanel{
  min-height:420px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
}

.lockedSectionCard{
  width:min(520px,100%)!important;
  text-align:center!important;
  padding:42px 34px!important;
  border:1px solid #d7e3f3!important;
  border-radius:28px!important;
  background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%)!important;
  box-shadow:0 18px 40px rgba(15,23,42,.08)!important;
}

.lockedSectionIcon{
  width:76px!important;
  height:76px!important;
  margin:0 auto 16px!important;
  border-radius:24px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  background:#eef6ff!important;
  font-size:36px!important;
}

.lockedSectionCard h2{
  margin:0 0 10px!important;
  color:#0f172a!important;
  font-size:30px!important;
  font-weight:950!important;
}

.lockedSectionCard p{
  margin:0 auto 22px!important;
  color:#64748b!important;
  font-size:15px!important;
  line-height:1.8!important;
  max-width:420px!important;
}

.lockedSectionCard .btn{
  min-width:190px!important;
  height:54px!important;
  border-radius:16px!important;
  font-size:16px!important;
  font-weight:900!important;
}


/* ===== VAT 14% toggle on invoice ===== */
.currentInvoiceTotalsBar.invoiceExtraTotalsBar,
.invoiceExtraTotalsBar{
  grid-template-columns:1fr 1fr 1fr 1fr 220px!important;
}

.invoiceVatCard{
  background:linear-gradient(180deg,#f0f9ff 0%,#ffffff 100%)!important;
  border-color:#bae6fd!important;
}

.invoiceVatCard.vatActive{
  background:linear-gradient(180deg,#ecfeff 0%,#ffffff 100%)!important;
  border-color:#67e8f9!important;
}

.vatCardHeader{
  width:100%!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:10px!important;
}

.vatCardHeader span{
  margin:0!important;
  white-space:nowrap!important;
}

.vatSwitch{
  width:48px!important;
  height:26px!important;
  display:inline-flex!important;
  align-items:center!important;
  cursor:pointer!important;
  position:relative!important;
  flex:0 0 auto!important;
}

.vatSwitch input{
  position:absolute!important;
  opacity:0!important;
  pointer-events:none!important;
}

.vatSwitch i{
  width:48px!important;
  height:26px!important;
  border-radius:999px!important;
  background:#cbd5e1!important;
  border:1px solid #cbd5e1!important;
  position:relative!important;
  transition:.2s!important;
}

.vatSwitch i::after{
  content:""!important;
  position:absolute!important;
  width:20px!important;
  height:20px!important;
  border-radius:50%!important;
  top:2px!important;
  right:2px!important;
  background:#fff!important;
  box-shadow:0 2px 6px rgba(15,23,42,.25)!important;
  transition:.2s!important;
}

.vatSwitch input:checked + i{
  background:#06b6d4!important;
  border-color:#06b6d4!important;
}

.vatSwitch input:checked + i::after{
  right:24px!important;
}

#invoiceVatAmount{
  color:#0891b2!important;
}

/* معاينة وطباعة القيمة المضافة */
.invoicePreviewExtraTotals.hasVatForPrint{
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
}

.invoicePreviewExtraTotals.hasVatForPrint.noExtraDiscountForPrint{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
}

.invoicePreviewExtraTotals.noVatForPrint.noExtraDiscountForPrint{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
}

.vatPrintCard span{
  color:#0891b2!important;
}

@media print{
  body.invoicePrintMode .invoicePreviewExtraTotals.hasVatForPrint{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
  }

  body.invoicePrintMode .invoicePreviewExtraTotals.hasVatForPrint.noExtraDiscountForPrint{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }

  body.invoicePrintMode .invoicePreviewExtraTotals.noVatForPrint.noExtraDiscountForPrint{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }

  body.invoicePrintMode .vatPrintCard span{
    color:#0891b2!important;
  }
}

@media(max-width:1300px){
  .currentInvoiceTotalsBar.invoiceExtraTotalsBar,
  .invoiceExtraTotalsBar{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }

  .invoiceExtraTotalsBar #invoiceSaveButton{
    grid-column:auto!important;
  }
}

@media(max-width:900px){
  .currentInvoiceTotalsBar.invoiceExtraTotalsBar,
  .invoiceExtraTotalsBar{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
}

@media(max-width:680px){
  .currentInvoiceTotalsBar.invoiceExtraTotalsBar,
  .invoiceExtraTotalsBar{
    grid-template-columns:1fr!important;
  }
}


/* ===== Hide disabled distributor accounts and supplier transfer shortcuts ===== */
button[onclick="go('distributorAccounts')"],
button[onclick="go('supplierTransfers')"],
[data-section="distributorAccounts"],
[data-section="supplierTransfers"],
.navItem[data-id="distributorAccounts"],
.navItem[data-id="supplierTransfers"]{
  display:none!important;
}


/* ===== Payroll Excel-like editable salary sheet ===== */
.payrollHeadWide{
  align-items:flex-start;
}
.monthPickerLabel{
  display:flex;
  align-items:center;
  gap:8px;
  margin:0;
  color:#334155;
  white-space:nowrap;
}
.monthPickerLabel input{
  min-width:150px;
  background:#fff;
}
.payrollQuickAdd{
  display:grid;
  grid-template-columns:repeat(6,1fr);
  gap:12px;
  align-items:end;
  margin:0 0 18px;
  padding:14px;
  border:1px solid #dbeafe;
  border-radius:22px;
  background:#f8fbff;
}
.payrollQuickAddButton{
  display:flex;
  align-items:end;
}
.payrollQuickAddButton .btn{
  width:100%;
}
.payrollGrandTotal{
  min-width:190px;
  border:1px solid #c7e9d7;
  background:#ecfff8;
  color:#0f766e;
  border-radius:18px;
  padding:12px 16px;
  text-align:center;
}
.payrollGrandTotal span{
  display:block;
  font-size:12px;
  font-weight:900;
  color:#64748b;
  margin-bottom:4px;
}
.payrollGrandTotal strong{
  display:block;
  font-size:22px;
  font-weight:900;
}
.payrollExcelWrap{
  overflow:auto;
  border:1px solid #e2e8f0;
  border-radius:22px;
  background:#fff;
}
.payrollExcelTable{
  min-width:1820px;
  border-collapse:collapse;
}
.payrollExcelTable th,
.payrollExcelTable td{
  border:1px solid #e5e7eb;
  text-align:center;
  padding:8px 6px;
  font-size:12px;
}
.payrollExcelTable th{
  position:sticky;
  top:0;
  z-index:2;
  background:#172033;
  color:#fff;
  white-space:nowrap;
}
.payrollExcelTable tfoot td{
  background:#fff7ed;
  color:#172033;
  font-weight:900;
}
.payrollNameCell{
  min-width:170px;
  text-align:right!important;
  font-weight:900;
}
.payrollNameCell small{
  display:block;
  color:#64748b;
  margin-top:3px;
  font-weight:800;
}
.payrollCellInput{
  width:100%;
  min-width:92px;
  padding:8px 7px;
  border-radius:10px;
  background:#fff;
  text-align:center;
  font-size:12px;
  font-weight:900;
}
.payrollCellSelect{
  min-width:115px;
}
.payrollNetCell{
  background:#ecfff8;
  color:#0f766e;
  min-width:120px;
}
.payrollNetCell strong{
  color:#0f766e!important;
  font-size:14px;
}
@media(max-width:1200px){
  .payrollQuickAdd{
    grid-template-columns:repeat(3,1fr);
  }
}
@media(max-width:700px){
  .payrollQuickAdd{
    grid-template-columns:1fr;
  }
  .payrollHeadWide{
    flex-direction:column;
  }
}
@media print{
  body.payrollPrintMode .payrollExcelWrap{
    border:0!important;
    overflow:visible!important;
  }
  body.payrollPrintMode .payrollExcelTable{
    min-width:0!important;
    width:100%!important;
    table-layout:fixed!important;
  }
  body.payrollPrintMode .payrollExcelTable th,
  body.payrollPrintMode .payrollExcelTable td{
    padding:3px 2px!important;
    font-size:7px!important;
    line-height:1.15!important;
  }
  body.payrollPrintMode .payrollExcelTable th{
    position:static!important;
    background:#111827!important;
    color:#fff!important;
  }
  body.payrollPrintMode .payrollCellInput,
  body.payrollPrintMode .payrollCellSelect{
    border:0!important;
    background:transparent!important;
    padding:0!important;
    min-width:0!important;
    font-size:7px!important;
    box-shadow:none!important;
    appearance:none!important;
  }
  body.payrollPrintMode .payrollGrandTotal{
    border:1px solid #111827!important;
    background:#fff!important;
    color:#111827!important;
    padding:6px!important;
  }
}


/* ===== Mega Therm Professional Off-canvas Icon Sidebar =====
   الشريط لا يحجز مساحة من الصفحة: تظهر الأيقونات فقط، وعند الوقوف يفتح بشكل احترافي فوق الصفحة. */
:root{
  --mt-drawer-width:350px;
  --mt-rail-width:78px;
  --mt-rail-gap:14px;
  --mt-page-pad:38px;
  --mt-drawer-bg:#0d172a;
  --mt-drawer-bg-2:#101e35;
  --mt-drawer-line:rgba(255,255,255,.10);
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .app{
  display:block!important;
  direction:rtl!important;
  min-height:100vh!important;
}

/* مساحة القسم كاملة مع هامش صغير فقط حتى لا تغطي الأيقونات أول حروف الصفحة */
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) main{
  margin-right:0!important;
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  padding:var(--mt-page-pad) calc(var(--mt-rail-width) + 24px) 42px var(--mt-page-pad)!important;
  box-sizing:border-box!important;
  transition:filter .22s ease!important;
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) #content,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .panel,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .card{
  max-width:none!important;
  box-sizing:border-box!important;
}

/* الدرج نفسه: يتحرك خارج الشاشة ولا يظهر منه إلا شريط الأيقونات */
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside{
  position:fixed!important;
  top:14px!important;
  right:14px!important;
  bottom:14px!important;
  width:var(--mt-drawer-width)!important;
  min-width:var(--mt-drawer-width)!important;
  max-width:var(--mt-drawer-width)!important;
  height:auto!important;
  min-height:0!important;
  padding:16px 14px!important;
  z-index:1200!important;
  overflow:hidden!important;
  display:flex!important;
  flex-direction:column!important;
  gap:14px!important;
  border:1px solid rgba(255,255,255,.08)!important;
  border-radius:30px 0 0 30px!important;
  background:
    radial-gradient(circle at 100% 0,rgba(33,199,220,.22),transparent 34%),
    linear-gradient(180deg,var(--mt-drawer-bg),#081122 76%)!important;
  box-shadow:-12px 16px 34px rgba(15,23,42,.18)!important;
  transform:translateX(calc(var(--mt-drawer-width) - var(--mt-rail-width)))!important;
  transition:transform .28s cubic-bezier(.2,.8,.2,1), box-shadow .28s ease, border-radius .28s ease!important;
  will-change:transform!important;
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within{
  transform:translateX(0)!important;
  border-radius:30px!important;
  box-shadow:-34px 24px 80px rgba(2,6,23,.38)!important;
}

/* لمسة هادئة على الصفحة أثناء فتح القائمة */
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode):has(aside:hover) main,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode):has(aside:focus-within) main{
  filter:brightness(.985)!important;
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .brand{
  width:100%!important;
  min-height:74px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:14px!important;
  padding:10px 6px 15px 0!important;
  border-bottom:1px solid var(--mt-drawer-line)!important;
  overflow:hidden!important;
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .logoBox{
  order:-1!important;
  width:54px!important;
  height:54px!important;
  min-width:54px!important;
  border-radius:18px!important;
  background:rgba(255,255,255,.08)!important;
  border:1px solid rgba(255,255,255,.12)!important;
  box-shadow:0 10px 24px rgba(0,0,0,.18)!important;
  overflow:hidden!important;
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .logoBox img,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .logoBox .brandLogoImg{
  width:100%!important;
  height:100%!important;
  object-fit:contain!important;
  display:block!important;
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .brand h1,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .brand p{
  opacity:0!important;
  transform:translateX(12px)!important;
  max-width:0!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  transition:opacity .18s ease, transform .22s ease, max-width .22s ease!important;
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover .brand h1,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover .brand p,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within .brand h1,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within .brand p{
  opacity:1!important;
  transform:translateX(0)!important;
  max-width:245px!important;
}

/* القائمة بدون سكرول ظاهر قبيح، مع استمرار التمرير */
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) nav{
  flex:1!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  display:flex!important;
  flex-direction:column!important;
  gap:6px!important;
  padding:2px 0 2px 4px!important;
  scrollbar-width:thin!important;
  scrollbar-color:rgba(255,255,255,.22) transparent!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) nav::-webkit-scrollbar{width:4px!important}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) nav::-webkit-scrollbar-track{background:transparent!important}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) nav::-webkit-scrollbar-thumb{background:rgba(255,255,255,.22)!important;border-radius:999px!important}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .navGroupTitle{
  opacity:0!important;
  height:0!important;
  margin:0!important;
  padding:0!important;
  overflow:hidden!important;
  transform:translateX(10px)!important;
  transition:opacity .18s ease, height .18s ease, margin .18s ease, transform .18s ease!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover .navGroupTitle,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within .navGroupTitle{
  opacity:1!important;
  height:auto!important;
  margin:13px 12px 5px!important;
  color:#8da0bd!important;
  transform:translateX(0)!important;
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .navItem{
  width:100%!important;
  min-height:52px!important;
  border:1px solid transparent!important;
  background:transparent!important;
  color:#d9e7fb!important;
  border-radius:18px!important;
  padding:5px 6px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  text-align:right!important;
  overflow:hidden!important;
  box-shadow:none!important;
  transform:none!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .navItem:hover{
  background:rgba(255,255,255,.07)!important;
  border-color:rgba(255,255,255,.08)!important;
  transform:none!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .navItem.active{
  background:linear-gradient(90deg,rgba(33,199,220,.20),rgba(255,255,255,.08))!important;
  border-color:rgba(33,199,220,.30)!important;
  box-shadow:inset -4px 0 0 var(--cyan), 0 10px 24px rgba(33,199,220,.10)!important;
  color:#fff!important;
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .navItemInner{
  width:100%!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:12px!important;
  overflow:hidden!important;
  white-space:nowrap!important;
}

/* الأيقونات موجودة في الجزء الظاهر من الدرج */
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .navIcon{
  order:-1!important;
  width:48px!important;
  min-width:48px!important;
  height:42px!important;
  display:grid!important;
  place-items:center!important;
  border-radius:15px!important;
  font-size:22px!important;
  font-style:normal!important;
  line-height:1!important;
  background:rgba(255,255,255,.06)!important;
  border:1px solid rgba(255,255,255,.07)!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .navItem.active .navIcon{
  background:rgba(33,199,220,.16)!important;
  border-color:rgba(33,199,220,.28)!important;
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .navLabel{
  display:block!important;
  opacity:0!important;
  max-width:0!important;
  overflow:hidden!important;
  color:inherit!important;
  font-style:normal!important;
  font-size:15px!important;
  font-weight:900!important;
  transform:translateX(12px)!important;
  transition:opacity .18s ease, max-width .22s ease, transform .22s ease!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover .navLabel,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within .navLabel{
  opacity:1!important;
  max-width:220px!important;
  transform:translateX(0)!important;
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .userCard{
  width:100%!important;
  min-height:64px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:13px!important;
  padding:10px 6px!important;
  border:1px solid rgba(255,255,255,.08)!important;
  border-radius:20px!important;
  background:rgba(255,255,255,.07)!important;
  overflow:hidden!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .avatar{
  order:-1!important;
  width:50px!important;
  min-width:50px!important;
  height:50px!important;
  border-radius:17px!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .userCard div:not(.avatar),
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .logout{
  opacity:0!important;
  max-width:0!important;
  overflow:hidden!important;
  white-space:nowrap!important;
  pointer-events:none!important;
  transition:opacity .18s ease, max-width .22s ease!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover .userCard div:not(.avatar),
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover .logout,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within .userCard div:not(.avatar),
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within .logout{
  opacity:1!important;
  max-width:240px!important;
  pointer-events:auto!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .logout{
  width:100%!important;
  margin-top:2px!important;
  border-radius:18px!important;
}

/* تلميح صغير عند المرور على الأيقونة في الوضع المقفول */
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:not(:hover):not(:focus-within) .navItem::after{
  content:attr(title);
  position:fixed;
  right:calc(var(--mt-rail-width) + 24px);
  top:50%;
  transform:translateY(-50%) translateX(8px);
  opacity:0;
  pointer-events:none;
  background:#101827;
  color:#fff;
  border:1px solid rgba(255,255,255,.12);
  border-radius:12px;
  padding:8px 12px;
  font-size:13px;
  font-weight:900;
  white-space:nowrap;
  box-shadow:0 12px 28px rgba(2,6,23,.24);
  transition:opacity .16s ease, transform .16s ease;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:not(:hover):not(:focus-within) .navItem:hover::after{
  opacity:1;
  transform:translateY(-50%) translateX(0);
}

/* الشاشات الصغيرة: القائمة تظهر كاملة فوق الصفحة بدل الدرج الجانبي */
@media(max-width:900px){
  body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .app{
    display:block!important;
  }
  body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside{
    position:relative!important;
    top:auto!important;
    right:auto!important;
    bottom:auto!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:auto!important;
    min-height:auto!important;
    transform:none!important;
    border-radius:0 0 28px 28px!important;
    padding:22px 18px!important;
    overflow:auto!important;
  }
  body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) main{
    padding:24px 14px!important;
  }
  body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .brand h1,
  body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .brand p,
  body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .navLabel,
  body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .userCard div:not(.avatar),
  body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .logout,
  body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .navGroupTitle{
    opacity:1!important;
    max-width:none!important;
    height:auto!important;
    transform:none!important;
    pointer-events:auto!important;
  }
}

/* ===== Mega Therm Transparent Glass Icon Sidebar =====
   إلغاء شكل الشريط الصلب: أيقونات عائمة شفافة، وعند الوقوف يظهر Drawer زجاجي احترافي. */
:root{
  --mt-drawer-width:360px;
  --mt-rail-width:78px;
  --mt-page-pad:38px;
  --mt-glass-bg:rgba(8,17,34,.68);
  --mt-glass-bg-strong:rgba(8,17,34,.82);
  --mt-glass-border:rgba(255,255,255,.14);
  --mt-glass-icon:rgba(255,255,255,.10);
  --mt-glass-icon-hover:rgba(33,199,220,.18);
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) main{
  margin-right:0!important;
  width:100%!important;
  max-width:none!important;
  padding:var(--mt-page-pad) calc(var(--mt-rail-width) + 20px) 42px var(--mt-page-pad)!important;
  transition:filter .24s ease!important;
}

/* الوضع المقفول: لا يوجد شريط صلب، فقط مساحة شفافة تحمل الأيقونات */
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside{
  top:12px!important;
  right:10px!important;
  bottom:12px!important;
  width:var(--mt-drawer-width)!important;
  min-width:var(--mt-drawer-width)!important;
  max-width:var(--mt-drawer-width)!important;
  padding:12px 10px!important;
  border:1px solid transparent!important;
  border-radius:34px 0 0 34px!important;
  background:transparent!important;
  box-shadow:none!important;
  transform:translateX(calc(var(--mt-drawer-width) - var(--mt-rail-width)))!important;
  transition:
    transform .30s cubic-bezier(.2,.8,.2,1),
    background .24s ease,
    box-shadow .24s ease,
    border-color .24s ease,
    border-radius .24s ease!important;
}

/* الوضع المفتوح: زجاج شفاف بخطوط ولمسات احترافية */
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within{
  transform:translateX(0)!important;
  border-radius:34px!important;
  border-color:var(--mt-glass-border)!important;
  background:
    radial-gradient(circle at 96% 5%,rgba(33,199,220,.24),transparent 28%),
    radial-gradient(circle at 12% 92%,rgba(255,159,28,.14),transparent 26%),
    linear-gradient(180deg,rgba(15,24,43,.78),rgba(4,11,25,.74))!important;
  backdrop-filter:blur(22px) saturate(145%)!important;
  -webkit-backdrop-filter:blur(22px) saturate(145%)!important;
  box-shadow:-28px 24px 90px rgba(2,6,23,.32)!important;
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode):has(aside:hover) main,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode):has(aside:focus-within) main{
  filter:none!important;
}

/* اللوجو في الوضع المقفول يبقى Badge زجاجي صغير فقط */
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .brand{
  min-height:64px!important;
  padding:6px 4px 12px 0!important;
  border-bottom:1px solid transparent!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover .brand,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within .brand{
  border-bottom-color:rgba(255,255,255,.12)!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .logoBox{
  width:52px!important;
  height:52px!important;
  min-width:52px!important;
  border-radius:18px!important;
  background:rgba(255,255,255,.10)!important;
  border:1px solid rgba(255,255,255,.16)!important;
  box-shadow:0 10px 30px rgba(2,6,23,.16)!important;
  backdrop-filter:blur(16px)!important;
  -webkit-backdrop-filter:blur(16px)!important;
}

/* إخفاء الكلام في المقفول، وإظهاره في الفتح */
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .brand h1,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .brand p{
  opacity:0!important;
  max-width:0!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover .brand h1,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover .brand p,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within .brand h1,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within .brand p{
  opacity:1!important;
  max-width:250px!important;
}

/* القائمة نفسها: لا خلفية عامة في الوضع المقفول */
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) nav{
  padding:2px 0 2px 6px!important;
  gap:8px!important;
  scrollbar-width:none!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) nav::-webkit-scrollbar{width:0!important;height:0!important}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover nav,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within nav{
  scrollbar-width:thin!important;
  scrollbar-color:rgba(255,255,255,.20) transparent!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover nav::-webkit-scrollbar,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within nav::-webkit-scrollbar{width:4px!important}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .navItem{
  min-height:54px!important;
  padding:5px 6px!important;
  background:transparent!important;
  border-color:transparent!important;
  box-shadow:none!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .navItem:hover{
  background:transparent!important;
  border-color:transparent!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .navItem.active{
  background:transparent!important;
  border-color:transparent!important;
  box-shadow:none!important;
}

/* الأيقونات العائمة الشفافة */
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .navIcon{
  width:52px!important;
  min-width:52px!important;
  height:46px!important;
  border-radius:17px!important;
  font-size:21px!important;
  color:#ffffff!important;
  background:rgba(15,24,43,.28)!important;
  border:1px solid rgba(255,255,255,.14)!important;
  box-shadow:0 12px 32px rgba(2,6,23,.13)!important;
  backdrop-filter:blur(16px) saturate(140%)!important;
  -webkit-backdrop-filter:blur(16px) saturate(140%)!important;
  transition:transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .navItem:hover .navIcon{
  transform:translateX(-2px) scale(1.03)!important;
  background:rgba(33,199,220,.20)!important;
  border-color:rgba(33,199,220,.38)!important;
  box-shadow:0 14px 34px rgba(33,199,220,.18)!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .navItem.active .navIcon{
  background:linear-gradient(135deg,rgba(33,199,220,.34),rgba(255,255,255,.13))!important;
  border-color:rgba(33,199,220,.52)!important;
  box-shadow:0 16px 38px rgba(33,199,220,.22), inset -3px 0 0 rgba(255,255,255,.28)!important;
}

/* عند فتح القائمة تتحول الأيقونة إلى جزء من عنصر menu زجاجي */
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover .navItem,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within .navItem{
  border-radius:19px!important;
  border-color:rgba(255,255,255,.06)!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover .navItem:hover,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within .navItem:hover{
  background:rgba(255,255,255,.07)!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover .navItem.active,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within .navItem.active{
  background:linear-gradient(90deg,rgba(33,199,220,.22),rgba(255,255,255,.08))!important;
  border-color:rgba(33,199,220,.30)!important;
  box-shadow:inset -4px 0 0 var(--cyan), 0 12px 30px rgba(33,199,220,.12)!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover .navIcon,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within .navIcon{
  background:rgba(255,255,255,.10)!important;
  border-color:rgba(255,255,255,.13)!important;
  box-shadow:none!important;
}

/* كارت المستخدم وزر الخروج لا يظهران كبلوكات في الوضع المقفول */
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .userCard{
  min-height:58px!important;
  padding:5px 6px!important;
  border-color:transparent!important;
  background:transparent!important;
  box-shadow:none!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .avatar{
  width:52px!important;
  min-width:52px!important;
  height:52px!important;
  border-radius:18px!important;
  background:linear-gradient(135deg,rgba(232,40,53,.82),rgba(2,6,23,.50),rgba(34,179,107,.82))!important;
  border:1px solid rgba(255,255,255,.14)!important;
  box-shadow:0 14px 34px rgba(2,6,23,.18)!important;
  backdrop-filter:blur(16px)!important;
  -webkit-backdrop-filter:blur(16px)!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover .userCard,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within .userCard{
  border-color:rgba(255,255,255,.10)!important;
  background:rgba(255,255,255,.08)!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .logout{
  background:rgba(232,40,53,.16)!important;
  color:#ffe5e5!important;
  border:1px solid rgba(232,40,53,.20)!important;
}

/* تلميح الاسم بجانب الأيقونة، زجاجي وخفيف */
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:not(:hover):not(:focus-within) .navItem::after{
  right:calc(var(--mt-rail-width) + 18px)!important;
  background:rgba(9,17,31,.74)!important;
  border-color:rgba(255,255,255,.14)!important;
  backdrop-filter:blur(16px)!important;
  -webkit-backdrop-filter:blur(16px)!important;
}

@media(max-width:900px){
  body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside{
    background:linear-gradient(180deg,rgba(15,24,43,.90),rgba(8,17,34,.92))!important;
    backdrop-filter:blur(18px)!important;
    -webkit-backdrop-filter:blur(18px)!important;
    border-color:rgba(255,255,255,.12)!important;
  }
  body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) main{
    padding:24px 14px!important;
  }
}

/* ===== Mega Therm Floating Neon Icons Sidebar =====
   بناء على المرجع المرسل: إلغاء شكل الشريط في الوضع المقفول وتحويله لأيقونات عائمة نيون/Glass.
   عند الوقوف على منطقة الأيقونات يفتح Drawer زجاجي كامل بدون تحريك محتوى القسم. */
:root{
  --mt-drawer-width:360px;
  --mt-floating-rail:78px;
  --mt-page-pad:38px;
  --mt-floating-right:14px;
  --mt-glass-panel:rgba(8,18,38,.76);
  --mt-glass-panel-2:rgba(3,10,25,.82);
  --mt-glass-line:rgba(255,255,255,.14);
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) main{
  margin-right:0!important;
  width:100%!important;
  max-width:none!important;
  padding:var(--mt-page-pad)!important;
  transition:none!important;
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside{
  top:18px!important;
  right:var(--mt-floating-right)!important;
  bottom:18px!important;
  width:var(--mt-drawer-width)!important;
  min-width:var(--mt-drawer-width)!important;
  max-width:var(--mt-drawer-width)!important;
  padding:18px 10px!important;
  border:0!important;
  border-radius:34px!important;
  background:transparent!important;
  box-shadow:none!important;
  overflow:visible!important;
  transform:translateX(calc(var(--mt-drawer-width) - var(--mt-floating-rail)))!important;
  transition:transform .34s cubic-bezier(.18,.9,.22,1), background .24s ease, box-shadow .24s ease, border-color .24s ease!important;
  z-index:999!important;
}

/* الخط الخفيف خلف الأيقونات مثل الأشكال العائمة في المرجع */
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside::before{
  content:"";
  position:absolute;
  left:38px;
  top:94px;
  bottom:108px;
  width:2px;
  border-radius:999px;
  background:linear-gradient(180deg,transparent,rgba(33,199,220,.38),rgba(255,159,28,.28),transparent);
  box-shadow:0 0 22px rgba(33,199,220,.22);
  opacity:.82;
  pointer-events:none;
  transition:opacity .18s ease!important;
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:34px;
  pointer-events:none;
  opacity:0;
  background:
    radial-gradient(circle at 18% 18%,rgba(33,199,220,.18),transparent 28%),
    radial-gradient(circle at 92% 8%,rgba(255,255,255,.10),transparent 24%),
    radial-gradient(circle at 15% 92%,rgba(255,159,28,.12),transparent 25%);
  transition:opacity .24s ease!important;
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within{
  transform:translateX(0)!important;
  padding:22px 18px!important;
  border:1px solid rgba(255,255,255,.15)!important;
  background:linear-gradient(180deg,var(--mt-glass-panel),var(--mt-glass-panel-2))!important;
  backdrop-filter:blur(24px) saturate(145%)!important;
  -webkit-backdrop-filter:blur(24px) saturate(145%)!important;
  box-shadow:-30px 28px 95px rgba(2,6,23,.32), inset 0 1px 0 rgba(255,255,255,.08)!important;
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover::before,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within::before{
  opacity:0!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover::after,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within::after{
  opacity:1!important;
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode):has(aside:hover) main,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode):has(aside:focus-within) main{
  margin-right:0!important;
  width:100%!important;
  filter:none!important;
}

/* العلامة التجارية تتحول إلى أيقونة عائمة في الوضع المقفول */
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .brand{
  width:var(--mt-floating-rail)!important;
  min-height:68px!important;
  align-self:flex-start!important;
  padding:0!important;
  margin:0 0 12px!important;
  border-bottom:0!important;
  display:flex!important;
  justify-content:center!important;
  align-items:center!important;
  overflow:visible!important;
  gap:0!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .logoBox{
  width:56px!important;
  height:56px!important;
  min-width:56px!important;
  border-radius:19px!important;
  background:linear-gradient(135deg,rgba(33,199,220,.40),rgba(255,255,255,.10))!important;
  border:1px solid rgba(33,199,220,.42)!important;
  box-shadow:0 14px 34px rgba(33,199,220,.22), inset 0 1px 0 rgba(255,255,255,.18)!important;
  backdrop-filter:blur(16px) saturate(140%)!important;
  -webkit-backdrop-filter:blur(16px) saturate(140%)!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .logoBox img,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .logoBox .brandLogoImg{
  max-width:48px!important;
  max-height:36px!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .brand h1,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .brand p{
  opacity:0!important;
  max-width:0!important;
  overflow:hidden!important;
  transition:opacity .18s ease, max-width .24s ease!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover .brand,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within .brand{
  width:100%!important;
  justify-content:flex-start!important;
  gap:14px!important;
  padding:0 2px 16px!important;
  margin-bottom:16px!important;
  border-bottom:1px solid rgba(255,255,255,.12)!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover .brand h1,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover .brand p,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within .brand h1,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within .brand p{
  opacity:1!important;
  max-width:250px!important;
}

/* القائمة في الوضع المقفول: لا شريط، فقط Bubbles */
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) nav{
  position:relative!important;
  z-index:2!important;
  width:100%!important;
  padding:0 0 0 4px!important;
  gap:12px!important;
  overflow-y:auto!important;
  overflow-x:visible!important;
  scrollbar-width:none!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) nav::-webkit-scrollbar{width:0!important;height:0!important}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover nav,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within nav{
  padding-left:4px!important;
  gap:8px!important;
  scrollbar-width:thin!important;
  scrollbar-color:rgba(33,199,220,.30) transparent!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover nav::-webkit-scrollbar,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within nav::-webkit-scrollbar{width:5px!important}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover nav::-webkit-scrollbar-thumb,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within nav::-webkit-scrollbar-thumb{background:rgba(33,199,220,.35)!important;border-radius:999px!important}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .navGroupTitle{
  opacity:0!important;
  height:0!important;
  margin:0!important;
  padding:0!important;
  overflow:hidden!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover .navGroupTitle,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within .navGroupTitle{
  opacity:.76!important;
  height:auto!important;
  margin:12px 13px 5px!important;
  padding:0!important;
  overflow:visible!important;
  color:#9fb3cc!important;
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .navItem{
  width:var(--mt-floating-rail)!important;
  min-height:62px!important;
  align-self:flex-start!important;
  display:flex!important;
  justify-content:flex-start!important;
  padding:4px 9px!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
  overflow:visible!important;
  transform:none!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .navItemInner{
  width:100%!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:12px!important;
  overflow:visible!important;
  white-space:nowrap!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover .navItem,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within .navItem{
  width:100%!important;
  min-height:54px!important;
  align-self:stretch!important;
  padding:6px 8px!important;
  border:1px solid rgba(255,255,255,.06)!important;
  border-radius:19px!important;
  background:rgba(255,255,255,.025)!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover .navItem:hover,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within .navItem:hover{
  background:rgba(255,255,255,.075)!important;
  border-color:rgba(33,199,220,.20)!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover .navItem.active,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within .navItem.active{
  background:linear-gradient(90deg,rgba(33,199,220,.22),rgba(255,255,255,.07))!important;
  border-color:rgba(33,199,220,.34)!important;
  box-shadow:inset -4px 0 0 #21c7dc,0 14px 34px rgba(33,199,220,.12)!important;
}

/* ألوان الأيقونات العائمة مثل مربعات المثال */
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .navIcon{
  --bubble-a:#21c7dc;
  --bubble-b:#2867e8;
  order:-1!important;
  width:54px!important;
  min-width:54px!important;
  height:54px!important;
  display:grid!important;
  place-items:center!important;
  border-radius:18px!important;
  font-size:22px!important;
  line-height:1!important;
  font-style:normal!important;
  color:#fff!important;
  background:linear-gradient(135deg,var(--bubble-a),var(--bubble-b))!important;
  border:1px solid rgba(255,255,255,.22)!important;
  box-shadow:0 16px 36px color-mix(in srgb, var(--bubble-a) 32%, transparent), inset 0 1px 0 rgba(255,255,255,.22)!important;
  backdrop-filter:blur(18px) saturate(150%)!important;
  -webkit-backdrop-filter:blur(18px) saturate(150%)!important;
  transform:translateZ(0)!important;
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease, filter .18s ease!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .navItem:nth-of-type(6n+1) .navIcon{--bubble-a:#22d3ee;--bubble-b:#2563eb}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .navItem:nth-of-type(6n+2) .navIcon{--bubble-a:#34d399;--bubble-b:#16a34a}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .navItem:nth-of-type(6n+3) .navIcon{--bubble-a:#fb923c;--bubble-b:#ef4444}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .navItem:nth-of-type(6n+4) .navIcon{--bubble-a:#a855f7;--bubble-b:#ec4899}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .navItem:nth-of-type(6n+5) .navIcon{--bubble-a:#2dd4bf;--bubble-b:#06b6d4}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .navItem:nth-of-type(6n+6) .navIcon{--bubble-a:#facc15;--bubble-b:#f97316}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .navItem:hover .navIcon{
  transform:translateX(-4px) scale(1.08)!important;
  filter:saturate(1.12) brightness(1.05)!important;
  border-color:rgba(255,255,255,.38)!important;
  box-shadow:0 18px 44px color-mix(in srgb, var(--bubble-a) 42%, transparent),0 0 0 5px rgba(255,255,255,.06),inset 0 1px 0 rgba(255,255,255,.32)!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .navItem.active .navIcon{
  transform:scale(1.05)!important;
  border-color:rgba(255,255,255,.44)!important;
  box-shadow:0 20px 50px color-mix(in srgb, var(--bubble-a) 48%, transparent),0 0 0 6px rgba(33,199,220,.12),inset 0 1px 0 rgba(255,255,255,.34)!important;
}

/* عند فتح الدرج تقل حدة الألوان وتبقى جزء من عنصر القائمة */
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover .navIcon,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within .navIcon{
  width:44px!important;
  min-width:44px!important;
  height:44px!important;
  border-radius:15px!important;
  font-size:19px!important;
  box-shadow:0 10px 24px color-mix(in srgb, var(--bubble-a) 20%, transparent), inset 0 1px 0 rgba(255,255,255,.18)!important;
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .navLabel{
  display:block!important;
  opacity:0!important;
  max-width:0!important;
  overflow:hidden!important;
  color:#eef6ff!important;
  font-style:normal!important;
  font-size:15px!important;
  font-weight:900!important;
  transform:translateX(10px)!important;
  transition:opacity .20s ease, max-width .24s ease, transform .24s ease!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover .navLabel,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within .navLabel{
  opacity:1!important;
  max-width:230px!important;
  transform:translateX(0)!important;
}

/* Tooltip بسيط عند الوقوف على أيقونة وهي مقفولة */
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:not(:hover):not(:focus-within) .navItem::after{
  content:attr(title)!important;
  position:fixed!important;
  right:calc(var(--mt-floating-rail) + var(--mt-floating-right) + 10px)!important;
  top:auto!important;
  transform:translateY(0) translateX(8px)!important;
  opacity:0!important;
  pointer-events:none!important;
  background:rgba(7,15,32,.78)!important;
  color:#fff!important;
  border:1px solid rgba(255,255,255,.16)!important;
  backdrop-filter:blur(16px)!important;
  -webkit-backdrop-filter:blur(16px)!important;
  box-shadow:0 14px 34px rgba(2,6,23,.24)!important;
  border-radius:14px!important;
  padding:9px 12px!important;
  font-size:12px!important;
  font-weight:900!important;
  white-space:nowrap!important;
  transition:opacity .16s ease, transform .16s ease!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:not(:hover):not(:focus-within) .navItem:hover::after{
  opacity:1!important;
  transform:translateY(0) translateX(0)!important;
}

/* كارت المستخدم والخروج: مخفيان كأشرطة في الوضع المقفول ويظهران داخل الدرج فقط */
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .userCard,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .logout{
  opacity:0!important;
  transform:translateX(18px)!important;
  pointer-events:none!important;
  height:0!important;
  min-height:0!important;
  padding:0!important;
  margin:0!important;
  overflow:hidden!important;
  border:0!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover .userCard,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within .userCard{
  opacity:1!important;
  transform:translateX(0)!important;
  pointer-events:auto!important;
  height:auto!important;
  min-height:64px!important;
  padding:12px 14px!important;
  margin-top:12px!important;
  border:1px solid rgba(255,255,255,.11)!important;
  border-radius:21px!important;
  background:rgba(255,255,255,.07)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.08)!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover .logout,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within .logout{
  opacity:1!important;
  transform:translateX(0)!important;
  pointer-events:auto!important;
  height:auto!important;
  min-height:auto!important;
  padding:13px 18px!important;
  margin-top:8px!important;
  border:1px solid rgba(232,40,53,.28)!important;
  border-radius:18px!important;
  background:rgba(232,40,53,.16)!important;
  color:#ffe4e6!important;
}

@media(max-width:900px){
  body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside{
    position:relative!important;
    right:auto!important;
    top:auto!important;
    bottom:auto!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    transform:none!important;
    padding:20px!important;
    border-radius:0 0 28px 28px!important;
    background:linear-gradient(180deg,rgba(15,24,43,.92),rgba(3,10,25,.94))!important;
    border:1px solid rgba(255,255,255,.10)!important;
  }
  body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside::before,
  body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside::after{display:none!important}
  body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) main{padding:24px 14px!important}
  body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .brand,
  body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .navItem{
    width:100%!important;
    align-self:stretch!important;
  }
  body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .brand h1,
  body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .brand p,
  body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .navLabel,
  body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .userCard,
  body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .logout{
    opacity:1!important;
    max-width:none!important;
    height:auto!important;
    transform:none!important;
    pointer-events:auto!important;
  }
}

/* Tooltip position fix for floating bubble mode */
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .navItem{position:relative!important}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:not(:hover):not(:focus-within) .navItem::after{
  position:absolute!important;
  top:50%!important;
  right:calc(100% + 10px)!important;
  left:auto!important;
  bottom:auto!important;
  transform:translateY(-50%) translateX(8px)!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:not(:hover):not(:focus-within) .navItem:hover::after{
  transform:translateY(-50%) translateX(0)!important;
}

/* ===== Final sections menu: one fixed button + grouped icon popup ===== */
:root{
  --sections-launcher-size:66px;
  --sections-popup-width:min(440px,calc(100vw - 32px));
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) main{
  margin-right:0!important;
  width:100%!important;
  max-width:none!important;
  padding-right:38px!important;
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside{
  position:fixed!important;
  top:94px!important;
  right:20px!important;
  bottom:auto!important;
  left:auto!important;
  width:var(--sections-popup-width)!important;
  min-width:0!important;
  max-width:440px!important;
  height:auto!important;
  max-height:calc(100vh - 116px)!important;
  min-height:0!important;
  padding:16px!important;
  margin:0!important;
  display:block!important;
  overflow:hidden!important;
  border:1px solid rgba(255,255,255,.60)!important;
  border-radius:24px!important;
  background:linear-gradient(145deg,rgba(255,255,255,.90),rgba(236,246,255,.78))!important;
  box-shadow:-20px 28px 80px rgba(15,35,65,.24),inset 0 1px 0 #fff!important;
  backdrop-filter:blur(24px) saturate(145%)!important;
  -webkit-backdrop-filter:blur(24px) saturate(145%)!important;
  opacity:0!important;
  visibility:hidden!important;
  pointer-events:none!important;
  transform:translateX(22px) scale(.96)!important;
  transition:opacity .2s ease,transform .24s cubic-bezier(.2,.8,.2,1),visibility .2s!important;
  z-index:1602!important;
}

body.sectionMenuOpen:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside,
body.sectionMenuOpen:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover,
body.sectionMenuOpen:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within{
  opacity:1!important;
  visibility:visible!important;
  pointer-events:auto!important;
  transform:translateX(0) scale(1)!important;
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside::before,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside::after,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .brand,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .userCard,
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .logout{
  display:none!important;
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside nav{
  width:100%!important;
  max-height:calc(100vh - 148px)!important;
  padding:2px 4px 6px!important;
  margin:0!important;
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:8px!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  scrollbar-width:thin!important;
  scrollbar-color:rgba(40,103,232,.28) transparent!important;
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside nav::-webkit-scrollbar{width:5px!important}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside nav::-webkit-scrollbar-thumb{background:rgba(40,103,232,.28)!important;border-radius:999px!important}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .navGroupTitle,
body.sectionMenuOpen:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .navGroupTitle{
  grid-column:1/-1!important;
  display:block!important;
  width:100%!important;
  height:auto!important;
  opacity:1!important;
  overflow:visible!important;
  margin:8px 2px 0!important;
  padding:7px 10px 6px!important;
  color:#52657d!important;
  background:linear-gradient(90deg,rgba(40,103,232,.10),transparent)!important;
  border-right:4px solid #21c7dc!important;
  border-radius:0 12px 12px 0!important;
  font-size:13px!important;
  font-weight:950!important;
  transform:none!important;
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .navItem,
body.sectionMenuOpen:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .navItem,
body.sectionMenuOpen:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover .navItem{
  position:relative!important;
  width:100%!important;
  min-width:0!important;
  height:44px!important;
  min-height:44px!important;
  padding:7px 12px!important;
  margin:0!important;
  display:grid!important;
  place-items:stretch!important;
  overflow:visible!important;
  border:1px solid rgba(255,255,255,.72)!important;
  border-radius:14px!important;
  background:rgba(255,255,255,.50)!important;
  box-shadow:0 9px 24px rgba(29,60,105,.08)!important;
  transform:none!important;
}

body.sectionMenuOpen:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .navItem:hover{
  background:#fff!important;
  border-color:rgba(33,199,220,.54)!important;
  box-shadow:0 15px 32px rgba(33,104,180,.18)!important;
  transform:translateY(-3px)!important;
}

body.sectionMenuOpen:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .navItem.active{
  background:linear-gradient(145deg,rgba(33,199,220,.18),rgba(40,103,232,.12))!important;
  border-color:rgba(33,199,220,.58)!important;
  box-shadow:0 13px 30px rgba(33,199,220,.20),inset 0 0 0 2px rgba(255,255,255,.62)!important;
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .navItemInner,
body.sectionMenuOpen:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .navItemInner{
  width:100%!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  overflow:visible!important;
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .navIcon,
body.sectionMenuOpen:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .navIcon,
body.sectionMenuOpen:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover .navIcon{
  display:none!important;
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .navLabel{
  display:block!important;
  width:100%!important;
  max-width:none!important;
  opacity:1!important;
  overflow:visible!important;
  color:#243b5a!important;
  font-size:14px!important;
  font-weight:900!important;
  text-align:right!important;
  transform:none!important;
}

body.sectionMenuOpen:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .navItem::after{
  content:none!important;
  position:absolute!important;
  top:calc(100% + 7px)!important;
  right:50%!important;
  left:auto!important;
  bottom:auto!important;
  z-index:20!important;
  padding:8px 11px!important;
  color:#fff!important;
  background:rgba(10,25,48,.94)!important;
  border:1px solid rgba(255,255,255,.16)!important;
  border-radius:11px!important;
  box-shadow:0 10px 26px rgba(2,10,25,.24)!important;
  font-size:12px!important;
  font-weight:900!important;
  line-height:1.2!important;
  white-space:nowrap!important;
  opacity:0!important;
  visibility:hidden!important;
  pointer-events:none!important;
  transform:translate(50%,-4px)!important;
  transition:opacity .15s ease,transform .15s ease,visibility .15s!important;
}

body.sectionMenuOpen:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .navItem:hover::after{
  opacity:1!important;
  visibility:visible!important;
  transform:translate(50%,0)!important;
}

.sectionMenuLauncher{
  position:fixed;
  top:20px;
  right:20px;
  z-index:1604;
  width:var(--sections-launcher-size);
  height:var(--sections-launcher-size);
  padding:0;
  display:grid;
  place-items:center;
  border:1px solid rgba(255,255,255,.72);
  border-radius:23px;
  color:#fff;
  background:linear-gradient(145deg,#21c7dc,#2867e8);
  box-shadow:0 18px 44px rgba(40,103,232,.32),inset 0 1px 0 rgba(255,255,255,.36);
  cursor:pointer;
  transform:none;
  transition:transform .18s ease,box-shadow .18s ease,border-radius .18s ease;
}
.sectionMenuLauncher:hover{transform:scale(1.07);box-shadow:0 22px 52px rgba(40,103,232,.42),0 0 0 7px rgba(33,199,220,.10)}
.sectionMenuLauncherIcon{font-size:29px;font-weight:900;line-height:1}
.sectionMenuLauncherText{position:absolute;right:calc(100% + 10px);padding:8px 11px;border-radius:11px;background:rgba(10,25,48,.92);color:#fff;font-size:12px;font-weight:900;white-space:nowrap;opacity:0;pointer-events:none;transform:translateX(5px);transition:.16s}
.sectionMenuLauncher:hover .sectionMenuLauncherText{opacity:1;transform:translateX(0)}
body.sectionMenuOpen .sectionMenuLauncher{border-radius:50%;background:linear-gradient(145deg,#ff6b6b,#e82835)}

.sectionMenuBackdrop{
  position:fixed;
  inset:0;
  z-index:1601;
  display:block;
  border:0;
  padding:0;
  background:rgba(12,26,48,.18);
  backdrop-filter:blur(3px);
  -webkit-backdrop-filter:blur(3px);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:opacity .2s ease,visibility .2s;
}
body.sectionMenuOpen .sectionMenuBackdrop{opacity:1;visibility:visible;pointer-events:auto}

@media(max-width:900px){
  :root{--sections-popup-width:calc(100vw - 28px)}
  body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) main{padding-right:14px!important}
  body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside,
  body.sectionMenuOpen:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside{
    top:84px!important;
    right:14px!important;
    width:var(--sections-popup-width)!important;
    max-width:none!important;
    max-height:calc(100vh - 100px)!important;
    padding:15px!important;
    border-radius:24px!important;
    transform:scale(.97)!important;
  }
  body.sectionMenuOpen:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside{transform:scale(1)!important}
  body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside nav{grid-template-columns:repeat(2,minmax(0,1fr))!important;max-height:calc(100vh - 132px)!important;gap:8px!important}
  .sectionMenuLauncher{top:14px;right:14px;bottom:auto;width:58px;height:58px;transform:none}
  .sectionMenuLauncher:hover{transform:scale(1.05)}
}

@media print{
  .sectionMenuLauncher,.sectionMenuBackdrop{display:none!important}
}

/* ===== Final polish: clear launcher lane + dark menu that turns white on hover ===== */
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) main{
  padding-right:112px!important;
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside{
  background:linear-gradient(155deg,rgba(35,50,74,.98),rgba(18,31,51,.98))!important;
  border-color:rgba(255,255,255,.15)!important;
  box-shadow:-20px 28px 80px rgba(8,20,39,.30),inset 0 1px 0 rgba(255,255,255,.10)!important;
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .navGroupTitle{
  color:#d8e5f5!important;
  background:linear-gradient(90deg,rgba(82,142,232,.20),rgba(255,255,255,.035))!important;
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .navItem,
body.sectionMenuOpen:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .navItem{
  color:#f4f8ff!important;
  background:rgba(255,255,255,.14)!important;
  border-color:rgba(255,255,255,.38)!important;
  box-shadow:0 8px 20px rgba(1,9,23,.14)!important;
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .navLabel{
  color:#f4f8ff!important;
}

body.sectionMenuOpen:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover,
body.sectionMenuOpen:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within{
  background:linear-gradient(145deg,rgba(255,255,255,.96),rgba(236,246,255,.90))!important;
  border-color:rgba(255,255,255,.76)!important;
  box-shadow:-20px 28px 80px rgba(15,35,65,.24),inset 0 1px 0 #fff!important;
}

body.sectionMenuOpen:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover .navGroupTitle,
body.sectionMenuOpen:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within .navGroupTitle{
  color:#52657d!important;
  background:linear-gradient(90deg,rgba(40,103,232,.10),transparent)!important;
}

body.sectionMenuOpen:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover .navItem,
body.sectionMenuOpen:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within .navItem{
  color:#243b5a!important;
  background:rgba(255,255,255,.62)!important;
  border-color:rgba(255,255,255,.86)!important;
  box-shadow:0 9px 24px rgba(29,60,105,.08)!important;
}

body.sectionMenuOpen:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover .navLabel,
body.sectionMenuOpen:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within .navLabel{
  color:#243b5a!important;
}

body.sectionMenuOpen:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover .navItem:hover{
  background:#fff!important;
  border-color:rgba(33,199,220,.58)!important;
  box-shadow:0 15px 32px rgba(33,104,180,.18)!important;
}

@media(max-width:900px){
  body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) main{
    padding-right:14px!important;
    padding-top:88px!important;
  }
}

/* ===== Accordion groups inside the compact sections menu ===== */
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside nav{
  display:block!important;
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .navGroup{
  display:block!important;
  width:100%!important;
  margin:0 0 8px!important;
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .navGroupTitle,
body.sectionMenuOpen:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .navGroupTitle{
  width:100%!important;
  min-height:42px!important;
  margin:0!important;
  padding:8px 13px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
  border:0!important;
  border-right:4px solid #21c7dc!important;
  border-radius:0 13px 13px 0!important;
  color:#d8e5f5!important;
  background:linear-gradient(90deg,rgba(82,142,232,.20),rgba(255,255,255,.035))!important;
  font-family:inherit!important;
  font-size:14px!important;
  font-weight:950!important;
  text-align:right!important;
  cursor:pointer!important;
  opacity:1!important;
  visibility:visible!important;
  overflow:visible!important;
  transform:none!important;
}

.navGroupArrow{
  flex:0 0 auto;
  color:#21c7dc;
  font-size:19px;
  font-style:normal;
  line-height:1;
  transform:rotate(0deg);
  transition:transform .2s ease;
}
.navGroup.open .navGroupArrow{transform:rotate(180deg)}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .navGroupItems{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:8px!important;
  max-height:0!important;
  padding:0 2px!important;
  overflow:hidden!important;
  opacity:0!important;
  transform:translateY(-5px)!important;
  transition:max-height .28s ease,padding .22s ease,opacity .18s ease,transform .22s ease!important;
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .navGroup.open .navGroupItems{
  max-height:520px!important;
  padding:9px 2px 4px!important;
  opacity:1!important;
  transform:translateY(0)!important;
}

body.sectionMenuOpen:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:hover .navGroupTitle,
body.sectionMenuOpen:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside:focus-within .navGroupTitle{
  color:#52657d!important;
  background:linear-gradient(90deg,rgba(40,103,232,.10),transparent)!important;
}

body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .navGroup.open>.navGroupTitle{
  border-right-color:#2867e8!important;
  box-shadow:inset -5px 0 0 rgba(33,199,220,.10)!important;
}

@media(max-width:520px){
  body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .navGroupItems{
    grid-template-columns:1fr!important;
  }
}

/* ===== Individual employee payroll sheets ===== */
.payrollIndividualPrintArea{
  background:linear-gradient(180deg,#f8fbff,#eef5fb)!important;
}

.payrollEmployeeSheets{
  display:grid;
  grid-template-columns:1fr;
  gap:22px;
}

.payrollEmployeeSheet{
  direction:rtl;
  background:#fff;
  border:1px solid #dce8f5;
  border-radius:24px;
  padding:22px;
  overflow:hidden;
  box-shadow:0 15px 38px rgba(31,64,104,.09);
}

.payrollEmployeeHead{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:15px;
  margin-bottom:18px;
  padding-bottom:16px;
  border-bottom:2px solid #e7f0f8;
}

.payrollEmployeeHead h3{
  margin:5px 0 3px;
  color:#0d2340;
  font-size:24px;
  font-weight:950;
}

.payrollEmployeeHead p{
  margin:0;
  color:#6c7f99;
  font-size:13px;
  font-weight:800;
}

.payrollSheetNo{
  display:inline-flex;
  padding:5px 10px;
  border-radius:999px;
  color:#2867e8;
  background:#eaf2ff;
  font-size:11px;
  font-weight:950;
}

.payrollEmployeeNet{
  min-width:155px;
  padding:12px 16px;
  border:1px solid #bde8dc;
  border-radius:17px;
  background:#eafbf5;
  text-align:center;
}
.payrollEmployeeNet span{display:block;color:#64748b;font-size:12px;font-weight:900;margin-bottom:3px}
.payrollEmployeeNet strong{display:block;color:#047857;font-size:22px;font-weight:950}

.payrollEmployeeActions{
  grid-column:1/-1;
  justify-content:flex-start;
}

.payrollEmployeeTable{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  table-layout:fixed;
  overflow:hidden;
  border:1px solid #dce7f2;
  border-radius:17px;
}

.payrollEmployeeTable th,
.payrollEmployeeTable td{
  border-left:1px solid #dce7f2;
  border-bottom:1px solid #dce7f2;
  padding:10px 11px;
  vertical-align:middle;
}
.payrollEmployeeTable tr:last-child th,
.payrollEmployeeTable tr:last-child td{border-bottom:0}
.payrollEmployeeTable tr>*:last-child{border-left:0}
.payrollEmployeeTable th{
  width:17%;
  color:#405570;
  background:#f0f6fc;
  font-size:13px;
  font-weight:950;
  text-align:right;
}
.payrollEmployeeTable td{
  width:33%;
  color:#152b48;
  background:#fff;
  font-size:14px;
  font-weight:850;
}

.payrollEmployeeTable .payrollCellInput,
.payrollEmployeeTable .payrollCellSelect{
  width:100%!important;
  min-width:0!important;
  height:40px!important;
  padding:7px 10px!important;
  border:1px solid #d4e2f0!important;
  border-radius:11px!important;
  color:#102640!important;
  background:#fbfdff!important;
  font-family:inherit!important;
  font-size:13px!important;
  font-weight:850!important;
  box-sizing:border-box!important;
}

.payrollEmployeeTotalRow th{
  color:#fff!important;
  background:#13233d!important;
  font-size:16px!important;
}
.payrollEmployeeTotalRow td{
  color:#fff!important;
  background:#13233d!important;
  text-align:center;
}
.payrollEmployeeTotalRow strong{color:#66e3cf!important;font-size:24px!important}

.payrollEmployeeFooter{
  display:flex;
  justify-content:space-between;
  gap:20px;
  margin-top:20px;
  padding:15px 12px 3px;
  color:#52657d;
  font-size:13px;
  font-weight:900;
}

.payrollEmptyState{
  padding:44px 20px;
  border:2px dashed #cbdbea;
  border-radius:20px;
  color:#6c7f99;
  background:#fff;
  text-align:center;
  font-weight:900;
}

@media(max-width:760px){
  .payrollEmployeeSheet{padding:14px;border-radius:18px}
  .payrollEmployeeHead{grid-template-columns:1fr}
  .payrollEmployeeNet{width:100%;box-sizing:border-box}
  .payrollEmployeeTable,.payrollEmployeeTable tbody,.payrollEmployeeTable tr,.payrollEmployeeTable th,.payrollEmployeeTable td{display:block;width:100%!important;box-sizing:border-box}
  .payrollEmployeeTable tr{border-bottom:1px solid #dce7f2}
  .payrollEmployeeTable th{border:0!important;padding:8px 10px 4px}
  .payrollEmployeeTable td{border:0!important;padding:5px 10px 10px}
  .payrollEmployeeFooter{flex-direction:column}
}

@media print{
  body.payrollPrintMode .payrollIndividualPrintArea>.panelHead{display:none!important}
  body.payrollPrintMode .payrollEmployeeSheets{display:block!important}
  body.payrollPrintMode .payrollEmployeeSheet{
    display:block!important;
    width:100%!important;
    min-height:0!important;
    margin:0!important;
    padding:10mm!important;
    border:0!important;
    border-radius:0!important;
    box-shadow:none!important;
    break-after:page!important;
    page-break-after:always!important;
    box-sizing:border-box!important;
  }
  body.payrollPrintMode .payrollEmployeeSheet:last-child{break-after:auto!important;page-break-after:auto!important}
  body.payrollPrintMode.payrollSingleEmployeePrintMode .payrollEmployeeSheet:not(.payrollPrintTarget){display:none!important}
  body.payrollPrintMode.payrollSingleEmployeePrintMode .payrollPrintTarget{break-after:auto!important;page-break-after:auto!important}
  body.payrollPrintMode .payrollEmployeeTable th,
  body.payrollPrintMode .payrollEmployeeTable td{padding:7px 8px!important;font-size:11px!important}
  body.payrollPrintMode .payrollEmployeeTable .payrollCellInput,
  body.payrollPrintMode .payrollEmployeeTable .payrollCellSelect{
    height:30px!important;
    padding:3px 6px!important;
    border:0!important;
    background:transparent!important;
    appearance:none!important;
  }
  body.payrollPrintMode .payrollEmployeeHead h3{font-size:20px!important}
  body.payrollPrintMode .payrollEmployeeFooter{margin-top:12px!important}
}

/* ===== Imported supplier PDF statements ===== */
.supplierAccountsPanel{
  background:linear-gradient(180deg,#fff,#f6faff)!important;
}
.supplierAccountGrid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:13px;
}
.supplierAccountCard{
  min-height:128px;
  padding:16px;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:5px;
  border:1px solid #dbe7f4;
  border-radius:20px;
  color:#1c3554;
  background:#fff;
  box-shadow:0 10px 25px rgba(34,70,112,.07);
  font-family:inherit;
  text-align:right;
  cursor:pointer;
  transition:.18s ease;
}
.supplierAccountCard:hover{transform:translateY(-3px);border-color:#7edbe8;box-shadow:0 16px 32px rgba(40,103,232,.13)}
.supplierAccountCard.active{border-color:#21c7dc;background:linear-gradient(145deg,#ecfcff,#edf4ff);box-shadow:inset 0 0 0 2px rgba(33,199,220,.15),0 14px 30px rgba(33,199,220,.13)}
.supplierAccountCard span{font-size:15px;font-weight:950}
.supplierAccountCard small{color:#7588a1;font-size:12px;font-weight:850}
.supplierAccountCard strong{margin-top:auto;color:#087f73;font-size:21px;font-weight:950}
.supplierAccountCard em{color:#2867e8;font-size:11px;font-style:normal;font-weight:900}

.supplierStatementPrintArea{
  direction:rtl;
  overflow:hidden;
  background:#fff!important;
}
.supplierStatementHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  padding:18px 20px;
  border-radius:22px;
  color:#fff;
  background:linear-gradient(135deg,#102541,#173d64);
}
.supplierStatementHeader span{color:#69dce8;font-size:12px;font-weight:950}
.supplierStatementHeader h3{margin:4px 0!important;font-size:27px!important;color:#fff!important}
.supplierStatementHeader p{margin:0;color:#cbd8e8;font-size:12px;font-weight:800}
.supplierStatementBalance{min-width:190px;padding:12px 17px;border:1px solid rgba(255,255,255,.16);border-radius:17px;background:rgba(255,255,255,.08);text-align:center}
.supplierStatementBalance small{display:block;color:#b9c9dc;font-weight:900}
.supplierStatementBalance strong{display:block;margin-top:3px;color:#62ead3;font-size:24px;font-weight:950}

.supplierStatementTotals{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
  margin:14px 0;
}
.supplierStatementTotals div{padding:13px 15px;border:1px solid #dce8f4;border-radius:15px;background:#f7faff}
.supplierStatementTotals span{display:block;color:#6c7f98;font-size:11px;font-weight:900}
.supplierStatementTotals strong{display:block;margin-top:3px;color:#173452;font-size:18px;font-weight:950}
.supplierStatementToolbar{margin:14px 0!important}
.supplierStatementToolbar .search{flex:1;max-width:600px}

.supplierStatementTableWrap{
  overflow:auto;
  border:1px solid #d8e4f0;
  border-radius:17px;
}
.supplierStatementTable{
  width:100%;
  min-width:1380px;
  border-collapse:separate;
  border-spacing:0;
  table-layout:auto;
}
.supplierStatementTable.manufacturingStatementTable{min-width:1680px}
.supplierStatementTable th{
  position:sticky;
  top:0;
  z-index:2;
  padding:11px 9px;
  color:#fff;
  background:#17243a;
  border-left:1px solid rgba(255,255,255,.12);
  font-size:12px;
  font-weight:950;
  white-space:nowrap;
}
.supplierStatementTable td{
  padding:9px;
  border-left:1px solid #e0e8f1;
  border-bottom:1px solid #e0e8f1;
  color:#243b58;
  background:#fff;
  font-size:12px;
  font-weight:800;
  line-height:1.5;
  white-space:nowrap;
}
.supplierStatementTable tbody tr:nth-child(even) td{background:#f8fbfe}
.supplierStatementTable tbody tr:hover td{background:#eef9fb}
.supplierStatementTable .supplierDebit{color:#a84418;font-weight:950}
.supplierStatementTable .supplierCredit{color:#07805f;font-weight:950}
.supplierStatementTable td:nth-child(4),.supplierStatementTable .supplierNotes{white-space:normal;min-width:190px}
.supplierStatement_دفعة td{background-color:#f3fbf5!important}
.supplierStatement_تصفية td{background-color:#fff4f4!important}

@media(max-width:1050px){.supplierAccountGrid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:650px){
  .supplierAccountGrid{grid-template-columns:1fr}
  .supplierStatementHeader{align-items:stretch;flex-direction:column}
  .supplierStatementBalance{min-width:0}
  .supplierStatementTotals{grid-template-columns:1fr}
}

@page supplierLedger{size:A4 landscape;margin:8mm}
@media print{
  body.supplierStatementPrintMode aside,
  body.supplierStatementPrintMode .topBar,
  body.supplierStatementPrintMode .supplierStatementStats,
  body.supplierStatementPrintMode .supplierAccountsPanel,
  body.supplierStatementPrintMode .panel:not(.supplierStatementPrintArea),
  body.supplierStatementPrintMode .noPrint,
  body.supplierStatementPrintMode .sectionMenuLauncher,
  body.supplierStatementPrintMode .sectionMenuBackdrop{display:none!important}
  body.supplierStatementPrintMode main{margin:0!important;width:100%!important;padding:0!important}
  body.supplierStatementPrintMode .supplierStatementPrintArea{display:block!important;page:supplierLedger;box-shadow:none!important;border:0!important;border-radius:0!important;padding:0!important;margin:0!important}
  body.supplierStatementPrintMode .supplierStatementHeader{padding:8px 12px!important;border-radius:0!important}
  body.supplierStatementPrintMode .supplierStatementHeader h3{font-size:18px!important}
  body.supplierStatementPrintMode .supplierStatementBalance{padding:6px 10px!important}
  body.supplierStatementPrintMode .supplierStatementBalance strong{font-size:17px!important}
  body.supplierStatementPrintMode .supplierStatementTotals{margin:6px 0!important;gap:6px!important}
  body.supplierStatementPrintMode .supplierStatementTotals div{padding:5px 8px!important;border-radius:0!important}
  body.supplierStatementPrintMode .supplierStatementTotals strong{font-size:12px!important}
  body.supplierStatementPrintMode .supplierStatementTableWrap{overflow:visible!important;border-radius:0!important}
  body.supplierStatementPrintMode .supplierStatementTable{min-width:0!important;width:100%!important;table-layout:fixed!important}
  body.supplierStatementPrintMode .supplierStatementTable th,
  body.supplierStatementPrintMode .supplierStatementTable td{position:static!important;padding:3px 2px!important;font-size:6.5px!important;line-height:1.15!important;white-space:normal!important;word-break:break-word!important}
  body.supplierStatementPrintMode .supplierStatementTable th:nth-child(1){width:3%}
  body.supplierStatementPrintMode .supplierStatementTable th:nth-child(2){width:8%}
  body.supplierStatementPrintMode .supplierStatementTable th:nth-child(3){width:8%}
  body.supplierStatementPrintMode .supplierStatementTable th:nth-child(4){width:19%}
  body.supplierStatementPrintMode .supplierStatementTable th:nth-child(5){width:6%}
  body.supplierStatementPrintMode .supplierStatementTable th:nth-child(6){width:7%}
  body.supplierStatementPrintMode .supplierStatementTable th:nth-child(7),
  body.supplierStatementPrintMode .supplierStatementTable th:nth-child(8),
  body.supplierStatementPrintMode .supplierStatementTable th:nth-child(9){width:9%}
  body.supplierStatementPrintMode .supplierStatementTable th:nth-child(10){width:13%}
  body.supplierStatementPrintMode .detailedCustomerStatementTable th:nth-child(1){width:3%}
  body.supplierStatementPrintMode .detailedCustomerStatementTable th:nth-child(2){width:7%}
  body.supplierStatementPrintMode .detailedCustomerStatementTable th:nth-child(3){width:5%}
  body.supplierStatementPrintMode .detailedCustomerStatementTable th:nth-child(4){width:8%}
  body.supplierStatementPrintMode .detailedCustomerStatementTable th:nth-child(5){width:6%}
  body.supplierStatementPrintMode .detailedCustomerStatementTable th:nth-child(6){width:12%}
  body.supplierStatementPrintMode .detailedCustomerStatementTable th:nth-child(7),
  body.supplierStatementPrintMode .detailedCustomerStatementTable th:nth-child(8),
  body.supplierStatementPrintMode .detailedCustomerStatementTable th:nth-child(9),
  body.supplierStatementPrintMode .detailedCustomerStatementTable th:nth-child(10),
  body.supplierStatementPrintMode .detailedCustomerStatementTable th:nth-child(11),
  body.supplierStatementPrintMode .detailedCustomerStatementTable th:nth-child(12){width:7%}
  body.supplierStatementPrintMode .detailedCustomerStatementTable th:nth-child(13){width:8%}
  body.supplierStatementPrintMode .detailedCustomerStatementTable th:nth-child(14){width:9%}
  body.supplierStatementPrintMode .manufacturingStatementTable th:nth-child(1){width:3%}
  body.supplierStatementPrintMode .manufacturingStatementTable th:nth-child(2){width:7%}
  body.supplierStatementPrintMode .manufacturingStatementTable th:nth-child(3){width:7%}
  body.supplierStatementPrintMode .manufacturingStatementTable th:nth-child(4){width:15%}
  body.supplierStatementPrintMode .manufacturingStatementTable th:nth-child(5){width:6%}
  body.supplierStatementPrintMode .manufacturingStatementTable th:nth-child(6){width:6%}
  body.supplierStatementPrintMode .manufacturingStatementTable th:nth-child(7){width:6%}
  body.supplierStatementPrintMode .manufacturingStatementTable th:nth-child(8){width:7%}
  body.supplierStatementPrintMode .manufacturingStatementTable th:nth-child(9){width:6%}
  body.supplierStatementPrintMode .manufacturingStatementTable th:nth-child(10){width:9%}
  body.supplierStatementPrintMode .manufacturingStatementTable th:nth-child(11){width:8%}
  body.supplierStatementPrintMode .manufacturingStatementTable th:nth-child(12){width:8%}
  body.supplierStatementPrintMode .manufacturingStatementTable th:nth-child(13){width:12%}
}

/* ===== Supplier statements editable mode ===== */
.supplierEditActions{justify-content:flex-end;gap:10px}
.supplierEditNotice{
  margin:8px 0 14px;
  padding:12px 15px;
  border-radius:16px;
  background:#fff8e7;
  border:1px solid #f2cf7a;
  color:#7a5307;
  font-weight:900;
  line-height:1.8;
}
.supplierStatementEditableTable td{
  padding:8px 6px;
}
.editableSupplierRow td{
  background:#fffdf6!important;
}
.supplierStatementEditInput{
  min-width:115px;
  width:100%;
  height:42px;
  padding:8px 10px;
  border-radius:12px;
  border:1px solid #cfe0f1;
  background:#fff;
  color:#13213a;
  font-family:inherit;
  font-weight:900;
  font-size:12px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.7);
}
.supplierStatementEditInput:focus{
  border-color:#21c7dc;
  box-shadow:0 0 0 4px rgba(33,199,220,.16);
}
.supplierStatementTypeSelect{
  min-width:130px;
}
.supplierRowActions{min-width:92px;text-align:center!important}
.supplierRowActions .btn{
  padding:8px 12px;
  border-radius:12px;
  font-size:12px;
}
@media(max-width:900px){
  .supplierEditActions{width:100%;justify-content:stretch}
  .supplierEditActions .btn{flex:1 1 auto}
}
@media print{
  .supplierEditNotice,.supplierRowActions{display:none!important}
}

/* ===== Purchase invoices prices update ===== */
.purchaseInlineQtyControls{
  align-items:end!important;
}
.purchaseCostEstimate strong{
  color:#0f766e!important;
}
.purchaseCatalogTable{
  min-width:1180px!important;
}
.purchaseLinesTable th,
.purchaseLinesTable td{
  white-space:nowrap;
}
@media(max-width:1200px){
  .purchaseInlineQtyControls{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
}
@media(max-width:900px){
  .purchaseInlineQtyControls{
    grid-template-columns:1fr!important;
  }
}

/* ===== Purchase invoice matches sales invoice layout - no discounts ===== */
.purchaseInvoiceCustomerFormGrid{
  grid-template-columns:repeat(3,1fr);
}
.salesLikePurchaseCatalogTable th,
.salesLikePurchaseCatalogTable td,
.salesLikePurchaseLinesTable th,
.salesLikePurchaseLinesTable td{
  text-align:center;
}
.salesLikePurchaseCatalogTable td:nth-child(4),
.salesLikePurchaseLinesTable td:nth-child(3){
  text-align:right;
  font-weight:900;
}
.salesLikePurchaseInlineBox{
  direction:rtl;
  text-align:right;
}
.salesLikePurchaseQtyControls{
  direction:rtl;
  justify-content:flex-start;
  grid-template-columns:210px 130px 160px 155px 155px auto minmax(220px,1fr)!important;
}
.purchaseInvoiceTotalsBar{
  justify-content:flex-end;
}
.purchaseInvoiceTotalsBar .invoiceTotalCard{
  min-width:220px;
}
.purchaseNoDiscountItemsTable th,
.purchaseNoDiscountItemsTable td{
  text-align:center;
}
.purchaseNoDiscountItemsTable td:nth-child(2){
  text-align:right;
  font-weight:900;
}
.purchaseNoDiscountCategorySummary th,
.purchaseNoDiscountCategorySummary td{
  text-align:center;
}
.purchaseNoDiscountTotalsStrip{
  grid-template-columns:repeat(2,minmax(220px,1fr));
}
.purchaseAsSalesPaper .flatInvoiceInfo div b{
  min-width:105px;
}
@media(max-width:1200px){
  .salesLikePurchaseQtyControls{grid-template-columns:repeat(3,1fr)!important}
}
@media(max-width:900px){
  .purchaseInvoiceCustomerFormGrid,
  .salesLikePurchaseQtyControls{grid-template-columns:1fr!important}
  .purchaseNoDiscountTotalsStrip{grid-template-columns:1fr}
}

/* ===== Generic table print toolbar ===== */
.tableToolbarActions{justify-content:flex-start;gap:10px}
.tableToolbarActions .search{max-width:360px;min-width:260px}
@media(max-width:700px){.tableToolbarActions{width:100%}.tableToolbarActions .search{min-width:0;max-width:none;flex:1 1 100%}}


/* ===== Home Dashboard: professional ERP landing page ===== */
.homeHeroPanel{
  position:relative;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  padding:28px 30px;
  margin-bottom:24px;
  border:1px solid rgba(255,255,255,.72);
  border-radius:32px;
  background:linear-gradient(135deg,#0f1f39 0%,#173b63 52%,#16bdd7 140%);
  color:#fff;
  box-shadow:0 28px 70px rgba(15,35,65,.18);
}
.homeHeroPanel::before{content:"";position:absolute;inset:-80px auto auto -80px;width:260px;height:260px;border-radius:50%;background:rgba(33,199,220,.22);filter:blur(8px)}
.homeHeroPanel::after{content:"";position:absolute;right:34%;top:0;bottom:0;width:2px;background:linear-gradient(transparent,rgba(255,255,255,.20),transparent)}
.homeHeroText{position:relative;z-index:1;max-width:760px}
.homeHeroText span{display:inline-flex;padding:8px 13px;border-radius:999px;background:rgba(255,255,255,.11);border:1px solid rgba(255,255,255,.18);font-weight:900;color:#bcefff;margin-bottom:12px}
.homeHeroText h2{margin:0;font-size:42px;font-weight:950;letter-spacing:-.5px}
.homeHeroText p{margin:10px 0 0;color:#d9e9fb;font-size:15px;font-weight:800;line-height:1.9}
.homeHeroLogo{position:relative;z-index:1;display:grid;place-items:center;width:180px;min-width:180px;height:110px;border-radius:28px;background:rgba(255,255,255,.10);border:1px solid rgba(255,255,255,.20);box-shadow:inset 0 1px 0 rgba(255,255,255,.22)}
.homeHeroLogoImg{max-width:150px;max-height:86px;object-fit:contain;filter:drop-shadow(0 10px 18px rgba(0,0,0,.20))}
.dashboardKpiGrid .statCard{min-height:130px;border-color:rgba(33,199,220,.16)}
.dashboardKpiGrid.secondary .statCard{min-height:116px;background:linear-gradient(180deg,#fff,#f9fcff)}
.homeDashboardGrid{display:grid;grid-template-columns:1.35fr .9fr;gap:24px;align-items:start}
.homeDashboardGrid.bottom{grid-template-columns:.9fr 1.1fr}
.dashboardQuickPanel,.dashboardAlertsPanel{min-height:360px}
.dashboardQuickGrid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:13px}
.dashboardQuickCard{position:relative;overflow:hidden;min-height:122px;border:1px solid #e3edf7;border-radius:24px;background:#fff;color:#13213a;padding:17px 15px;text-align:right;cursor:pointer;font-family:inherit;box-shadow:0 16px 34px rgba(15,24,43,.07);transition:.22s}
.dashboardQuickCard::before{content:"";position:absolute;inset:auto auto 0 0;width:100%;height:5px;background:linear-gradient(90deg,#2867e8,#21c7dc)}
.dashboardQuickCard span{display:grid;place-items:center;width:46px;height:46px;border-radius:18px;background:#eef6ff;font-size:23px;margin-bottom:13px}
.dashboardQuickCard strong{display:block;font-size:16px;font-weight:950;color:#10213c;margin-bottom:5px}
.dashboardQuickCard small{display:block;color:#6c7e95;font-weight:800;line-height:1.6}
.dashboardQuickCard:hover{transform:translateY(-5px);border-color:#bfeeff;box-shadow:0 24px 45px rgba(40,103,232,.14)}
.dashboardQuickCard.green::before{background:linear-gradient(90deg,#119b6d,#20c997)}
.dashboardQuickCard.red::before{background:linear-gradient(90deg,#e82835,#ff8a80)}
.dashboardQuickCard.orange::before{background:linear-gradient(90deg,#ff9f1c,#ffd166)}
.dashboardQuickCard.cyan::before{background:linear-gradient(90deg,#12b6d2,#21c7dc)}
.dashboardQuickCard.purple::before{background:linear-gradient(90deg,#8b5cf6,#d946ef)}
.dashboardAlertsList{display:grid;gap:10px;max-height:420px;overflow:auto;padding-left:4px}
.dashboardAlert{display:flex;align-items:center;gap:12px;width:100%;border:1px solid #e6eef7;border-radius:20px;padding:13px 14px;background:#fff;text-align:right;font-family:inherit;cursor:pointer;transition:.2s;color:#13213a}
.dashboardAlert span{display:grid;place-items:center;width:42px;height:42px;border-radius:16px;background:#eef6ff;font-size:20px;flex:0 0 auto}
.dashboardAlert strong{display:block;font-size:14px;font-weight:950;margin-bottom:3px}
.dashboardAlert small{display:block;color:#6e8198;font-weight:800;line-height:1.5}
.dashboardAlert:hover{transform:translateX(-4px);box-shadow:0 18px 34px rgba(15,24,43,.08)}
.dashboardAlert.danger{border-color:#ffd9d9;background:#fffafa}.dashboardAlert.danger span{background:#fff0f0}
.dashboardAlert.warning{border-color:#ffe9ad;background:#fffdf5}.dashboardAlert.warning span{background:#fff5d6}
.dashboardAlert.info{border-color:#d9edff;background:#fbfdff}.dashboardAlert.info span{background:#eef7ff}
.dashboardEmptyAlerts{padding:22px;border:1px dashed #cfe0ef;border-radius:20px;background:#f8fbff;color:#13213a;font-weight:900;line-height:1.8}
.dashboardEmptyAlerts span{display:block;color:#6e8198;font-size:13px}
.dashboardAccountList{display:grid;gap:10px}
.dashboardAccountLine{display:grid;grid-template-columns:90px 1fr auto;gap:10px;align-items:center;padding:12px 14px;border:1px solid #e6eef7;border-radius:18px;background:#f9fcff;font-weight:900}
.dashboardAccountLine span{color:#64748b;font-size:12px}.dashboardAccountLine b{color:#13213a}.dashboardAccountLine strong{color:#0f766e}
.dashboardMiniTable th,.dashboardMiniTable td{font-size:12px;padding:11px 8px}
.dashboardShortcutSettingsGrid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.dashboardShortcutToggle{display:grid;grid-template-columns:auto 1fr;grid-template-areas:"input title" "icon desc";gap:6px 10px;align-items:center;padding:14px;border:1px solid #e3edf7;border-radius:20px;background:#f8fbff;cursor:pointer;transition:.2s}
.dashboardShortcutToggle input{grid-area:input;width:auto}.dashboardShortcutToggle span{grid-area:icon;font-size:23px}.dashboardShortcutToggle b{grid-area:title;color:#13213a;font-weight:950}.dashboardShortcutToggle small{grid-area:desc;color:#6c7e95;font-weight:800;line-height:1.5}
.dashboardShortcutToggle.active{background:#effaff;border-color:#bdefff;box-shadow:0 14px 28px rgba(33,199,220,.08)}
.dashboardShortcutToggle.fixed{background:#f2fff9;border-color:#bdf3d9}
.dashboardAdminDetails{padding:0;overflow:hidden}
.dashboardAdminDetails>summary{list-style:none;cursor:pointer;padding:20px 24px;font-weight:950;font-size:18px;color:#13213a;background:linear-gradient(90deg,#f7fbff,#fff);border-bottom:1px solid #e3edf7}
.dashboardAdminDetails>summary::-webkit-details-marker{display:none}
.dashboardAdminDetails[open]>summary{background:#eef7ff;color:#2867e8}
.dashboardAdminDetails>.dashboardNotice,.dashboardAdminDetails>.panel,.dashboardAdminDetails>.grid4{margin:18px 24px}
@media(max-width:1300px){.dashboardQuickGrid,.dashboardShortcutSettingsGrid{grid-template-columns:repeat(3,1fr)}.homeDashboardGrid,.homeDashboardGrid.bottom{grid-template-columns:1fr}}
@media(max-width:900px){.homeHeroPanel{flex-direction:column;align-items:flex-start}.homeHeroLogo{width:100%;min-width:0}.dashboardQuickGrid,.dashboardShortcutSettingsGrid{grid-template-columns:repeat(2,1fr)}.dashboardAccountLine{grid-template-columns:1fr}.homeHeroText h2{font-size:32px}}
@media(max-width:560px){.dashboardQuickGrid,.dashboardShortcutSettingsGrid{grid-template-columns:1fr}}

/* ===== Hover-open categories in sections menu ===== */
@media (hover:hover){
  body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .navGroupTitle{transition:background .18s ease,color .18s ease,border-color .18s ease,box-shadow .18s ease!important}
  body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .navGroupTitle:hover{background:linear-gradient(90deg,rgba(255,255,255,.18),rgba(255,255,255,.04))!important;border-right-color:#4ad8ea!important}
}

/* ===== Working Reports Center ===== */
.reportsControlPanel{overflow:hidden}
.reportFilterGrid{display:grid;grid-template-columns:1.2fr 1fr 1fr auto;gap:14px;align-items:end}
.reportFilterActions{display:flex;gap:8px;flex-wrap:wrap;align-items:end}
.reportCardsGrid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-top:16px}
.reportCard{border:1px solid #dbe8f5;background:#fff;color:#13213a;border-radius:22px;padding:20px 22px;min-height:116px;text-align:right;font-family:inherit;cursor:pointer;box-shadow:0 14px 30px rgba(15,24,43,.05);transition:.2s}
.reportCard strong{display:block;font-size:20px;font-weight:950;margin-bottom:10px}.reportCard span{display:block;color:#72839b;font-weight:800;line-height:1.7;font-size:13px}.reportCard:hover,.reportCard.active{transform:translateY(-3px);border-color:#21c7dc;box-shadow:0 20px 42px rgba(40,103,232,.12)}.reportCard.active{background:linear-gradient(145deg,#eef9ff,#fff)}
.reportPreviewPanel{min-height:220px}.reportPreviewHead{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:16px}.reportPreviewHead h3{margin:0;font-size:26px;font-weight:950}.reportPreviewHead p{margin:7px 0 0;color:#72839b;font-weight:800}
.reportSummaryGrid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:16px}.reportSummaryCard{background:#f8fbff;border:1px solid #dbe8f5;border-radius:18px;padding:15px}.reportSummaryCard span{display:block;color:#64748b;font-weight:900;font-size:12px}.reportSummaryCard strong{display:block;color:#0f213a;font-size:20px;font-weight:950;margin-top:6px}
.reportTableWrap{max-height:560px;overflow:auto;border:1px solid #e3edf7;border-radius:20px}.reportTable{min-width:980px}.reportTable th{position:sticky;top:0;background:#13213a;color:#fff;z-index:1}.reportTable td,.reportTable th{font-size:13px}.emptyReportState{padding:30px;border:1px dashed #cbd8e6;border-radius:18px;text-align:center;color:#64748b;font-weight:900;background:#f8fbff}
@media(max-width:1100px){.reportFilterGrid{grid-template-columns:1fr 1fr}.reportCardsGrid{grid-template-columns:repeat(2,1fr)}.reportSummaryGrid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:700px){.reportFilterGrid,.reportCardsGrid,.reportSummaryGrid{grid-template-columns:1fr}.reportPreviewHead{flex-direction:column}.reportFilterActions .btn{width:100%}}


/* ===== Employee permissions matrix ===== */
.permissionsMatrixLayout{
  display:grid;
  grid-template-columns:320px 1fr;
  gap:18px;
  align-items:start;
}
.permissionsEmployeesList{
  background:#f7fbff;
  border:1px solid #e3edf7;
  border-radius:22px;
  padding:16px;
}
.permissionsEmployeesList h4{
  margin:0 0 12px;
  font-size:18px;
  font-weight:900;
  color:#13213a;
}
#permissionEmployeeCards{
  display:flex;
  flex-direction:column;
  gap:9px;
  margin-top:12px;
  max-height:540px;
  overflow:auto;
  padding-left:4px;
}
.permissionEmployeeCard{
  width:100%;
  border:1px solid #dfe8f2;
  background:#fff;
  border-radius:18px;
  padding:13px 14px;
  text-align:right;
  font-family:inherit;
  cursor:pointer;
  transition:.18s;
}
.permissionEmployeeCard:hover,
.permissionEmployeeCard.active{
  border-color:#21c7dc;
  background:linear-gradient(135deg,#e9fbff,#ffffff);
  box-shadow:0 12px 26px rgba(33,199,220,.12);
}
.permissionEmployeeCard strong,
.permissionEmployeeCard span,
.permissionEmployeeCard small{
  display:block;
}
.permissionEmployeeCard strong{
  color:#13213a;
  font-size:15px;
  font-weight:900;
}
.permissionEmployeeCard span{
  color:#64748b;
  font-size:12px;
  font-weight:800;
  margin-top:3px;
}
.permissionEmployeeCard small{
  color:#0f766e;
  font-size:12px;
  font-weight:900;
  margin-top:7px;
}
.permissionSelectedHeader{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  flex-wrap:wrap;
  margin-bottom:14px;
  padding:16px;
  border:1px solid #e3edf7;
  border-radius:20px;
  background:#fff;
}
.permissionSelectedHeader span,
.permissionSelectedHeader small{
  display:block;
  color:#64748b;
  font-weight:800;
}
.permissionSelectedHeader strong{
  display:block;
  color:#13213a;
  font-size:24px;
  font-weight:900;
  margin-top:4px;
}
.permissionTableWrap{
  max-height:620px;
  overflow:auto;
  border:1px solid #e3edf7;
  border-radius:22px;
  background:#fff;
}
.permissionsMatrixTable th{
  position:sticky;
  top:0;
  background:#f3f7fc;
  z-index:1;
}
.permissionsMatrixTable td:first-child strong{
  display:block;
  color:#13213a;
  font-weight:900;
}
.permissionsMatrixTable td:first-child small{
  display:block;
  color:#7b8aa0;
  font-size:12px;
  font-weight:800;
  margin-top:4px;
}
.permissionCheck{
  display:inline-flex;
  align-items:center;
  gap:8px;
  margin:0;
  cursor:pointer;
  color:#13213a;
}
.permissionCheck input{
  width:20px;
  height:20px;
  accent-color:#21c7dc;
}
.emptyPermissionsEmployees{
  padding:18px;
  border-radius:18px;
  background:#fff8e8;
  border:1px solid #ffe0a6;
  color:#8a5c00;
  font-weight:900;
  line-height:1.8;
}
@media(max-width:1000px){
  .permissionsMatrixLayout{
    grid-template-columns:1fr;
  }
}

/* ===== Remove employee from permissions ===== */
.dangerBadge{
  background:#ffe2e2!important;
  color:#dc2626!important;
}
.okBadge{
  background:#dcfce7!important;
  color:#15803d!important;
}
.permissionsDetails .btn.danger{
  white-space:nowrap;
}


/* ===== Professional main landing ===== */
.companyLandingHero{
  display:grid;
  grid-template-columns:1.15fr 1.2fr 1fr;
  gap:22px;
  margin-bottom:24px;
  align-items:stretch;
}
.cardBlur{
  position:relative;
  overflow:hidden;
  border-radius:34px;
  border:1px solid rgba(196,214,230,.75);
  background:linear-gradient(180deg,rgba(255,255,255,.94),rgba(245,249,253,.92));
  box-shadow:0 18px 50px rgba(18,35,58,.08);
  padding:24px;
}
.cardBlur::before{
  content:"";
  position:absolute;
  inset:0;
  background:radial-gradient(circle at top right, rgba(43,196,255,.12), transparent 34%),
             radial-gradient(circle at bottom left, rgba(1,86,255,.08), transparent 30%);
  pointer-events:none;
}
.companyLandingIntro h1{
  margin:10px 0 14px;
  font-size:34px;
  line-height:1.35;
  color:#0f2340;
  font-weight:950;
}
.companyLandingIntro p,
.companyLandingAbout p{
  color:#61748a;
  line-height:2;
  font-weight:700;
}
.landingEyebrow{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:9px 16px;
  border-radius:999px;
  background:rgba(18,122,255,.09);
  color:#127aff;
  font-weight:900;
}
.landingBrandStrip{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:18px;
}
.landingBrandStrip span{
  padding:10px 14px;
  border-radius:999px;
  background:#fff;
  border:1px solid #dbe7f2;
  color:#163050;
  font-weight:900;
  box-shadow:0 10px 24px rgba(18,35,58,.05);
}
.landingMiniStats{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
  margin-top:20px;
}
.landingMiniStats div,
.landingHeroMeta div{
  background:#fff;
  border:1px solid #e3edf6;
  border-radius:22px;
  padding:14px;
  text-align:center;
}
.landingMiniStats b,
.landingHeroMeta b{
  display:block;
  color:#0f2340;
  font-size:22px;
  font-weight:950;
}
.landingMiniStats small,
.landingHeroMeta span{
  display:block;
  margin-top:5px;
  color:#71839a;
  font-weight:800;
}
.companyLandingCenter{
  display:flex;
  flex-direction:column;
  gap:18px;
}
.companyLandingLogo{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
}
.landingLogoWrap{
  flex:1;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:120px;
}
.landingLogoWrap img{
  max-width:100%;
  max-height:90px;
  object-fit:contain;
}
.landingCurrentUser{
  min-width:180px;
  background:#fff;
  border:1px solid #e1ebf5;
  border-radius:24px;
  padding:14px 16px;
  text-align:right;
}
.landingCurrentUser span,
.landingCurrentUser small{
  display:block;
  color:#7387a0;
  font-weight:800;
}
.landingCurrentUser strong{
  display:block;
  margin:4px 0;
  color:#0f2340;
  font-size:20px;
  font-weight:950;
}
.landingAccessPanel .panelHead{
  margin-bottom:14px;
}
.landingAccessGrid{
  display:grid;
  grid-template-columns:1fr;
  gap:14px;
}
.landingAccessCard{
  background:rgba(255,255,255,.86);
  border:1px solid #dfeaf4;
  border-radius:24px;
  padding:16px;
  box-shadow:0 10px 20px rgba(15,35,64,.05);
}
.landingAccessCardHead{
  margin-bottom:10px;
}
.landingAccessCardHead strong{
  display:block;
  color:#0f2340;
  font-size:18px;
  font-weight:950;
}
.landingAccessCardHead span{
  display:block;
  margin-top:4px;
  color:#70829b;
  line-height:1.7;
  font-weight:700;
  font-size:13px;
}
.landingAccessCard label{
  display:block;
  margin:8px 0 6px;
  color:#51657d;
  font-weight:800;
  font-size:13px;
}
.landingAccessCard input{
  width:100%;
  height:48px;
  border-radius:16px;
  border:1px solid #d8e4ef;
  background:#fff;
  padding:0 14px;
  font-family:inherit;
}
.landingAccessActions{
  display:flex;
  gap:10px;
  margin-top:12px;
}
.companyLandingAbout h3{
  margin:0 0 14px;
  font-size:28px;
  color:#0f2340;
  font-weight:950;
}
.landingFeatureList{
  list-style:none;
  padding:0;
  margin:18px 0;
  display:grid;
  gap:10px;
}
.landingFeatureList li{
  background:#fff;
  border:1px solid #e1ebf5;
  border-radius:18px;
  padding:12px 14px;
  color:#153150;
  font-weight:800;
}
.landingHeroMeta{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
  margin-top:16px;
}
.landingSectionsBoard{
  margin-bottom:24px;
}
.landingSectionsGroup + .landingSectionsGroup{
  margin-top:18px;
}
.landingGroupHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.landingGroupHead h3{
  margin:0;
  color:#0f2340;
  font-size:24px;
  font-weight:950;
}
.landingGroupHead span{
  color:#6f829c;
  font-weight:900;
}
.landingSectionsGrid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}
.landingSectionCard{
  width:100%;
  border:none;
  background:linear-gradient(180deg,#ffffff,#f7fbff);
  border:1px solid #dce8f2;
  border-radius:24px;
  padding:16px;
  display:flex;
  gap:14px;
  align-items:flex-start;
  text-align:right;
  cursor:pointer;
  box-shadow:0 12px 26px rgba(15,35,64,.05);
  transition:.18s ease;
}
.landingSectionCard:hover{
  transform:translateY(-3px);
  border-color:#21c7dc;
  box-shadow:0 18px 32px rgba(33,199,220,.12);
}
.landingSectionIcon{
  width:54px;
  height:54px;
  border-radius:18px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg,#13294b,#1f89ff);
  color:#fff;
  font-size:22px;
  flex:none;
}
.landingSectionText strong{
  display:block;
  color:#0f2340;
  font-size:18px;
  font-weight:950;
}
.landingSectionText small{
  display:block;
  margin-top:6px;
  color:#72859d;
  line-height:1.8;
  font-weight:700;
}
@media(max-width:1200px){
  .companyLandingHero{
    grid-template-columns:1fr;
  }
  .landingSectionsGrid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media(max-width:760px){
  .landingMiniStats,
  .landingHeroMeta{
    grid-template-columns:1fr;
  }
  .landingSectionsGrid{
    grid-template-columns:1fr;
  }
  .companyLandingLogo{
    flex-direction:column;
    align-items:stretch;
  }
  .landingAccessActions{
    flex-direction:column;
  }
}


/* ===== Minimal landing only ===== */
.minimalLandingPage{
  max-width:980px;
  margin:0 auto;
}
.minimalTopCard{
  display:grid;
  grid-template-columns:280px 1fr;
  gap:18px;
  align-items:center;
  margin-bottom:22px;
}
.minimalTopSession{
  background:rgba(255,255,255,.9);
  border:1px solid #dce7f2;
  border-radius:30px;
  padding:22px;
  text-align:center;
}
.minimalTopSession span,
.minimalTopSession small{
  display:block;
  color:#8091a7;
  font-weight:800;
}
.minimalTopSession strong{
  display:block;
  margin:12px 0 10px;
  color:#102542;
  font-size:26px;
  font-weight:950;
}
.minimalTopLogo{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:170px;
}
.minimalTopLogo img{
  max-width:240px;
  max-height:110px;
  object-fit:contain;
}
.minimalAccessPanel{
  padding:26px;
}
.landingPanelHead.centered{
  justify-content:center;
  text-align:center;
}
.minimalAccessGrid{
  display:grid;
  grid-template-columns:1fr;
  gap:16px;
}
.minimalAccessGrid .landingAccessCard{
  max-width:720px;
  margin:0 auto;
}
.minimalAccessGrid .landingAccessCard + .landingAccessCard{
  margin-top:0;
}
.minimalAccessGrid .landingAccessCard input{
  text-align:right;
}
@media(max-width:760px){
  .minimalTopCard{
    grid-template-columns:1fr;
  }
  .minimalTopLogo{
    min-height:110px;
  }
}

/* ===== Separate home and control panel polish ===== */
.minimalLandingPage{
  max-width:760px!important;
}
.minimalAccessGrid{
  grid-template-columns:1fr!important;
}
.minimalAccessGrid .landingAccessCard{
  max-width:560px!important;
}
.controlPanelHero{
  margin-bottom:22px;
}


/* ===== Landing only before login ===== */
#app.landingOnlyMode .sectionMenuLauncher,
#app.landingOnlyMode .sectionMenuBackdrop,
#app.landingOnlyMode aside{
  display:none!important;
}
.minimalCompanyHeading{
  text-align:center;
  margin-bottom:22px;
}
.minimalCompanyHeading h1{
  margin:10px 0 12px;
  color:#102542;
  font-size:32px;
  line-height:1.45;
  font-weight:950;
}
.minimalCompanyHeading p{
  margin:0;
  color:#6e8199;
  line-height:1.9;
  font-weight:800;
}
.minimalLandingPage{
  max-width:780px!important;
}
.minimalTopCard{
  grid-template-columns:260px 1fr!important;
}
.minimalTopSession small{
  line-height:1.7;
}


/* ===== Hide program navigation while landing/login is shown ===== */
#app.landingOnlyMode .sectionMenuLauncher,
#app.landingOnlyMode .sectionMenuBackdrop,
#app.landingOnlyMode aside{
  display:none!important;
}


/* ===== Clean company login landing ===== */
#app.landingOnlyMode .sectionMenuLauncher,
#app.landingOnlyMode .sectionMenuBackdrop,
#app.landingOnlyMode aside{
  display:none!important;
}
#app.landingOnlyMode .hero,
#app.landingOnlyMode .pageHero,
#app.landingOnlyMode header,
#app.landingOnlyMode .topbar{
  min-height:0!important;
}
#app.landingOnlyMode #title,
#app.landingOnlyMode #subtitle{
  display:none!important;
}
.cleanLoginLanding{
  max-width:760px!important;
  margin:0 auto!important;
  padding-top:10px;
}
.cleanCompanyCard{
  text-align:center;
  margin:0 0 22px!important;
  padding:34px 34px 30px!important;
}
.cleanCompanyLogo{
  display:flex;
  justify-content:center;
  align-items:center;
  margin-bottom:12px;
}
.cleanCompanyLogo img{
  max-width:190px;
  max-height:92px;
  object-fit:contain;
}
.cleanCompanyCard h1{
  margin:12px auto 12px!important;
  color:#102542!important;
  font-size:34px!important;
  line-height:1.45!important;
  font-weight:950!important;
  max-width:680px;
}
.cleanCompanyCard p{
  margin:0 auto!important;
  color:#6e8199!important;
  line-height:1.9!important;
  font-weight:800!important;
  max-width:620px;
}
.cleanLoginPanel{
  padding:28px!important;
}
.cleanEmployeeLoginCard{
  max-width:460px!important;
  margin:0 auto!important;
  padding:28px!important;
}
.cleanEmployeeLoginCard .landingAccessCardHead{
  display:none!important;
}
.cleanEmployeeLoginCard label{
  font-size:15px!important;
  color:#53677f!important;
  font-weight:900!important;
}
.cleanEmployeeLoginCard input{
  height:58px!important;
  font-size:16px!important;
  border-radius:20px!important;
  text-align:right!important;
}
.cleanLoginActions{
  justify-content:center!important;
  margin-top:18px!important;
}
.cleanLoginActions .btn.primary{
  min-width:150px!important;
  height:58px!important;
  border-radius:20px!important;
  font-size:18px!important;
}
.cleanLoginActions .btn:not(.primary){
  display:none!important;
}
@media(max-width:760px){
  .cleanCompanyCard h1{
    font-size:26px!important;
  }
  .cleanLoginLanding{
    padding:0 10px;
  }
}


/* ===== Login landing cards side by side ===== */
.cleanLoginLanding{
  max-width:1180px!important;
  margin:0 auto!important;
  padding-top:10px;
  display:grid!important;
  grid-template-columns:minmax(0,1.45fr) minmax(360px,.95fr);
  gap:26px!important;
  align-items:stretch!important;
}
.cleanCompanyCard,
.cleanLoginPanel{
  margin:0!important;
  height:100%;
}
.cleanCompanyCard{
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
  min-height:430px;
}
.cleanLoginPanel{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-height:430px;
}
.cleanLoginPanel .minimalAccessGrid{
  width:100%!important;
}
.cleanEmployeeLoginCard{
  max-width:100%!important;
  width:100%!important;
  margin:0 auto!important;
}
@media(max-width:980px){
  .cleanLoginLanding{
    grid-template-columns:1fr!important;
    max-width:760px!important;
  }
  .cleanCompanyCard,
  .cleanLoginPanel{
    min-height:auto!important;
  }
}


/* ===== Final clean landing header/card cleanup ===== */
#app.landingOnlyMode .sectionMenuLauncher,
#app.landingOnlyMode .sectionMenuBackdrop,
#app.landingOnlyMode aside{
  display:none!important;
}
#app.landingOnlyMode #title,
#app.landingOnlyMode #subtitle{
  display:none!important;
}
#app.landingOnlyMode .pageTitle,
#app.landingOnlyMode .pageSubtitle,
#app.landingOnlyMode .heroTitle,
#app.landingOnlyMode .heroSubtitle{
  display:none!important;
}
.cleanCompanyCard .landingEyebrow,
.cleanCompanyCard p{
  display:none!important;
}
.cleanLoginLanding{
  max-width:1180px!important;
  margin:0 auto!important;
  padding-top:20px!important;
}
.cleanCompanyCard{
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
  align-items:center!important;
  text-align:center!important;
}
.cleanCompanyLogo{
  margin-bottom:20px!important;
}
.cleanCompanyCard h1{
  margin:0 auto!important;
  max-width:720px!important;
  font-size:38px!important;
  line-height:1.45!important;
}
.cleanLoginPanel{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
}
@media(max-width:980px){
  .cleanCompanyCard h1{
    font-size:28px!important;
  }
}



/* ===== Keep login landing clean before sign in ===== */
#app.landingOnlyMode .sectionMenuLauncher,
#app.landingOnlyMode .sectionMenuBackdrop,
#app.landingOnlyMode .sectionHistoryBar,
#app.landingOnlyMode aside{
  display:none!important;
}


/* ===== Hide demo version badge when history navigation is used ===== */
.desktopBadge,
.demoBadge,
.versionBadge,
.trialBadge,
.buildBadge,
.appBadge{
  display:none!important;
}


/* ===== In-app back / forward navigation ===== */
.sectionHistoryBar{
  position:fixed;
  left:42px;
  top:22px;
  z-index:9998;
  display:flex;
  flex-direction:row;
  align-items:center;
  gap:10px;
  padding:10px;
  border-radius:26px;
  background:rgba(255,255,255,.86);
  border:1px solid rgba(197,216,232,.95);
  box-shadow:0 18px 40px rgba(15,35,64,.12);
  backdrop-filter:blur(16px);
}
.sectionHistoryBar.hidden{
  display:none!important;
}
.sectionHistoryBar button{
  min-width:96px;
  border:none;
  border-radius:18px;
  padding:12px 16px;
  font-family:inherit;
  font-weight:900;
  font-size:15px;
  color:#0f2340;
  background:linear-gradient(180deg,#ffffff,#eef6ff);
  border:1px solid #d7e5f2;
  cursor:pointer;
  transition:.18s ease;
}
.sectionHistoryBar button:hover:not(:disabled){
  transform:translateY(-2px);
  border-color:#21c7dc;
  box-shadow:0 10px 22px rgba(33,199,220,.15);
}
.sectionHistoryBar button:disabled{
  opacity:.42;
  cursor:not-allowed;
}
#app.landingOnlyMode .sectionHistoryBar{
  display:none!important;
}
@media(max-width:760px){
  .sectionHistoryBar{
    left:18px;
    top:18px;
    right:auto;
    bottom:auto;
    padding:8px;
    gap:8px;
  }
  .sectionHistoryBar button{
    min-width:76px;
    padding:10px 12px;
    font-size:13px;
  }
}


body.historyNavReplacesDemoBadge .desktopModeBadge,
body.historyNavReplacesDemoBadge .desktopVersion,
body.historyNavReplacesDemoBadge .demoVersion,
body.historyNavReplacesDemoBadge .versionPill,
body.historyNavReplacesDemoBadge .desktopPill,
body.historyNavReplacesDemoBadge .modeBadge{
  display:none!important;
}


/* ===== Section menu groups: click only, hover is visual only ===== */
.navGroupTitle:hover{cursor:pointer;}


/* ===== Search in all sections ===== */
.universalSectionSearchPanel{
  margin-bottom:18px!important;
  padding:18px!important;
}
.universalSectionSearchBox{
  display:flex;
  gap:12px;
  align-items:center;
}
.universalSectionSearchBox input{
  flex:1;
  height:56px;
  border-radius:18px;
  border:1px solid #dbe7f2;
  background:#f8fbff;
  padding:0 18px;
  font-family:inherit;
  font-weight:800;
  color:#102542;
}
.universalSectionSearchBox .btn{
  height:56px;
  white-space:nowrap;
}
@media(max-width:760px){
  .universalSectionSearchBox{
    flex-direction:column;
    align-items:stretch;
  }
}


/* ===== Advanced text + date search for all sections ===== */
.advancedSectionSearchPanel{
  margin-bottom:18px!important;
  padding:18px!important;
}
.advancedSectionSearchHead{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:14px;
  flex-wrap:wrap;
}
.advancedSectionSearchHead strong{
  color:#102542;
  font-size:20px;
  font-weight:950;
}
.advancedSectionSearchHead span{
  color:#6e8199;
  font-weight:800;
}
.advancedSectionSearchGrid{
  display:grid;
  grid-template-columns:1.4fr .8fr .8fr auto;
  gap:12px;
  align-items:end;
}
.advancedSectionSearchGrid label{
  display:block;
  margin-bottom:7px;
  color:#53677f;
  font-weight:900;
}
.advancedSectionSearchGrid input{
  width:100%;
  height:56px;
  border-radius:18px;
  border:1px solid #dbe7f2;
  background:#f8fbff;
  padding:0 18px;
  font-family:inherit;
  font-weight:800;
  color:#102542;
}
.advancedSectionSearchActions{
  display:flex;
  gap:10px;
}
.advancedSectionSearchActions .btn{
  height:56px;
  white-space:nowrap;
}
@media(max-width:980px){
  .advancedSectionSearchGrid{
    grid-template-columns:1fr 1fr;
  }
}
@media(max-width:640px){
  .advancedSectionSearchGrid{
    grid-template-columns:1fr;
  }
  .advancedSectionSearchActions{
    flex-direction:column;
  }
}



/* ===== VAT 14% card professional style fix ===== */
.invoiceExtraTotalsBar .invoiceTotalCard.invoiceVatCard,
.invoiceVatCard{
  min-height:96px!important;
  height:96px!important;
  padding:14px 18px!important;
  align-items:stretch!important;
  justify-content:space-between!important;
  gap:10px!important;
  overflow:hidden!important;
  background:linear-gradient(180deg,#f8fdff 0%,#ffffff 100%)!important;
  border:1px solid #bfe7f5!important;
}

.invoiceVatCard.vatActive{
  background:linear-gradient(180deg,#effcff 0%,#ffffff 100%)!important;
  border-color:#5dd6ee!important;
  box-shadow:0 10px 22px rgba(8,145,178,.08)!important;
}

.invoiceVatCard .vatCardHeader{
  width:100%!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
  direction:rtl!important;
  flex-wrap:nowrap!important;
}

.invoiceVatCard .vatCardHeader span{
  margin:0!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  color:#64748b!important;
  font-size:15px!important;
  font-weight:900!important;
  line-height:1.2!important;
  flex:1 1 auto!important;
  text-align:right!important;
}

.invoiceVatCard .vatSwitch{
  width:56px!important;
  height:30px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  cursor:pointer!important;
  position:relative!important;
  flex:0 0 56px!important;
}

.invoiceVatCard .vatSwitch i{
  width:56px!important;
  height:30px!important;
  border-radius:999px!important;
  background:#cfd8e3!important;
  border:1px solid #cfd8e3!important;
  position:relative!important;
  transition:.2s!important;
  box-shadow:inset 0 1px 3px rgba(15,23,42,.08)!important;
}

.invoiceVatCard .vatSwitch i::after{
  content:""!important;
  position:absolute!important;
  width:24px!important;
  height:24px!important;
  border-radius:50%!important;
  top:2px!important;
  right:2px!important;
  background:#fff!important;
  box-shadow:0 3px 8px rgba(15,23,42,.18)!important;
  transition:.22s ease!important;
}

.invoiceVatCard .vatSwitch input:checked + i{
  background:linear-gradient(135deg,#25b4f2,#16c7d5)!important;
  border-color:#22b8e2!important;
}

.invoiceVatCard .vatSwitch input:checked + i::after{
  right:30px!important;
}

.invoiceVatCard #invoiceVatAmount{
  display:block!important;
  width:100%!important;
  text-align:center!important;
  color:#0f9ab0!important;
  font-size:24px!important;
  font-weight:950!important;
  line-height:1!important;
  margin:0!important;
}

@media (max-width: 900px){
  .invoiceExtraTotalsBar .invoiceTotalCard.invoiceVatCard,
  .invoiceVatCard{
    min-height:90px!important;
    height:auto!important;
  }
  .invoiceVatCard .vatCardHeader span{
    font-size:14px!important;
  }
  .invoiceVatCard #invoiceVatAmount{
    font-size:22px!important;
  }
}



/* ===== Distributor discount field like category discount ===== */
.distributorDiscountField{
  max-width:100%;
}
.distributorDiscountField > label{
  margin-bottom:10px;
}
.distributorDiscountCard{
  max-width:420px;
  margin-inline-start:auto;
  background:linear-gradient(180deg,#ffffff,#f8fbff);
}
.distributorDiscountCard input{
  background:#f8fbff;
  border:1px solid #dfe8f2;
  border-radius:16px;
  padding:14px 12px;
}
.distributorDiscountCard input:focus{
  background:#fff;
  border-color:#25bfd8;
  box-shadow:0 0 0 4px rgba(33,199,220,.12);
}
.distributorDiscountCard span{
  font-size:13px;
}
@media(max-width:900px){
  .distributorDiscountCard{
    max-width:100%;
  }
}


/* ===== Distributor category discount cards ===== */
.formGrid .distributorDiscountField{
  min-width:0;
}
.distributorDiscountField .distributorDiscountCard{
  height:100%;
}
.distributorDiscountField .distributorDiscountCard input{
  text-align:center;
  font-size:18px;
  font-weight:900;
  color:#0f766e;
}


/* ===== Party autocomplete fields in sales/purchase invoices ===== */
.partyAutocompleteField{
  position:relative;
}
.partyAutocompleteField input{
  font-weight:900;
  padding-inline-start:58px;
}
.partyAutocompleteField input::-webkit-calendar-picker-indicator{
  opacity:.75;
}
.partyAutocompleteField::after{
  content:"بحث";
  position:absolute;
  left:14px;
  top:38px;
  font-size:11px;
  font-weight:900;
  color:#1d9bd8;
  background:#eaf6ff;
  border:1px solid #cfe8ff;
  border-radius:999px;
  padding:3px 8px;
  pointer-events:none;
}


/* ===== Global autocomplete visual hint ===== */
.globalAutocompleteInput{
  background-image:linear-gradient(90deg,rgba(33,199,220,.10),rgba(33,199,220,0))!important;
  background-size:42px 100%!important;
  background-repeat:no-repeat!important;
  background-position:left center!important;
}
.globalAutocompleteInput:focus{
  border-color:#25bfd8!important;
  box-shadow:0 0 0 4px rgba(33,199,220,.12)!important;
}


/* ===== Reports category shortcuts in sections menu ===== */
.navItem[data-id^="report_"],
button.navItem[onclick*="report_"]{
  background:linear-gradient(180deg,#ffffff,#f8fbff)!important;
  border-color:#dbeafe!important;
}
.navItem[data-id^="report_"]:hover,
button.navItem[onclick*="report_"]:hover{
  border-color:#21c7dc!important;
  box-shadow:0 12px 24px rgba(33,199,220,.12)!important;
}




/* ===== Professional Analytics / Statistics Decision Dashboard ===== */
.proStatsPage{display:grid;gap:20px}.proStatsHero{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:24px;align-items:stretch;padding:30px;border-radius:34px;background:radial-gradient(circle at 12% 20%,rgba(34,199,220,.34),transparent 36%),linear-gradient(135deg,#0d213d 0%,#0f6f86 100%);box-shadow:0 28px 65px rgba(13,33,61,.20);color:#fff;overflow:hidden;position:relative}.proStatsHero::before{content:"";position:absolute;inset:-120px auto auto -120px;width:280px;height:280px;border-radius:50%;background:rgba(255,255,255,.09)}.proStatsHeroText{position:relative;z-index:1}.proStatsHeroText span{display:inline-flex;padding:8px 15px;border-radius:999px;background:rgba(255,255,255,.15);border:1px solid rgba(255,255,255,.24);color:#fff;font-weight:950}.proStatsHeroText h2{margin:18px 0 12px;font-size:42px;line-height:1.25;font-weight:950;letter-spacing:-.6px}.proStatsHeroText p{margin:0;max-width:860px;color:rgba(255,255,255,.87);font-weight:800;line-height:2}.proStatsHeroCards{display:grid;gap:12px;position:relative;z-index:1}.proStatsHeroCards div{border-radius:24px;padding:18px;background:rgba(255,255,255,.13);border:1px solid rgba(255,255,255,.20);backdrop-filter:blur(12px)}.proStatsHeroCards small{display:block;color:rgba(255,255,255,.75);font-weight:900}.proStatsHeroCards strong{display:block;margin-top:8px;color:#fff;font-size:28px;font-weight:950}.proStatsFilters{padding:18px!important}.proStatsFiltersTitle{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:14px}.proStatsFiltersTitle b{color:#102542;font-size:20px;font-weight:950}.proStatsFiltersTitle span{color:#64748b;font-weight:800}.proStatsFilterGrid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr)) auto;gap:12px;align-items:end}.proStatsFilterGrid label{display:block;margin-bottom:7px;color:#52657d;font-weight:950}.proStatsFilterGrid input{width:100%;height:54px;border-radius:18px;border:1px solid #dbe7f2;background:#f8fbff;padding:0 14px;color:#102542;font-family:inherit;font-weight:850}.proStatsFilterActions{display:flex;gap:10px}.proStatsFilterActions .btn{height:54px;white-space:nowrap}.proKpiGrid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}.proKpi{display:flex;align-items:center;gap:16px;padding:20px;border-radius:26px;background:#fff;border:1px solid #dce8f2;box-shadow:0 18px 38px rgba(15,35,64,.06);min-height:126px}.proKpiIcon{width:58px;height:58px;border-radius:20px;display:grid;place-items:center;background:#eff6ff;font-size:24px;flex:0 0 58px}.proKpi span{display:block;color:#64748b;font-weight:950}.proKpi strong{display:block;margin:7px 0;color:#0f2340;font-size:28px;font-weight:950;line-height:1.1}.proKpi small{color:#8ba0b8;font-weight:800;line-height:1.5}.proKpi.green .proKpiIcon{background:#ecfdf5}.proKpi.red .proKpiIcon{background:#fff1f2}.proKpi.orange .proKpiIcon{background:#fff7ed}.proKpi.purple .proKpiIcon{background:#f5f3ff}.proKpi.cyan .proKpiIcon{background:#ecfeff}.proStatsGrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.proStatsCard{padding:22px!important;min-height:320px;overflow:hidden}.proStatsCard.span2{grid-column:span 2}.proCardHead{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:16px}.proCardHead h3{margin:0;color:#0f2340;font-size:25px;font-weight:950}.proCardHead p{margin:7px 0 0;color:#7689a3;font-weight:850}.proChartWrap{width:100%}.proLineChart{width:100%;min-height:245px}.proLineChart .statGridLines line{stroke:#dbe7f2;stroke-width:1}.proLineChart text{fill:#60758f;font-size:14px;font-weight:900}.proChartLegend{display:flex;flex-wrap:wrap;gap:12px;margin-top:10px}.proChartLegend span{display:inline-flex;align-items:center;gap:7px;color:#52657d;font-weight:900}.proChartLegend i{width:12px;height:12px;border-radius:50%}.proDonutBox{display:grid;grid-template-columns:190px 1fr;gap:22px;align-items:center}.proDonut{width:190px;height:190px;border-radius:50%;display:flex;flex-direction:column;align-items:center;justify-content:center;position:relative;box-shadow:inset 0 0 0 16px rgba(255,255,255,.55),0 18px 40px rgba(15,35,64,.10)}.proDonut::after{content:"";position:absolute;inset:42px;border-radius:50%;background:#fff;box-shadow:0 8px 20px rgba(15,35,64,.08)}.proDonut strong,.proDonut span{position:relative;z-index:1}.proDonut strong{color:#0f2340;font-size:20px;font-weight:950}.proDonut span{color:#7b8fa8;font-size:12px;font-weight:900}.proDonutLegend{display:grid;gap:10px}.proDonutLegend span{display:flex;align-items:center;gap:9px;color:#52657d;font-weight:900}.proDonutLegend i{width:14px;height:14px;border-radius:5px}.statsInsightsList{display:grid;gap:12px}.statsInsight{display:flex;gap:12px;align-items:flex-start;width:100%;border:1px solid #dde8f2;border-radius:20px;padding:14px;background:linear-gradient(180deg,#fff,#f9fcff);text-align:right;font-family:inherit;cursor:pointer}.statsInsight span{width:38px;height:38px;border-radius:14px;display:grid;place-items:center;background:#eff6ff}.statsInsight b{display:block;color:#102542;font-weight:950}.statsInsight small{display:block;margin-top:4px;color:#71859d;font-weight:800;line-height:1.6}.statsInsight.risk span{background:#fff1f2}.statsInsight.good span{background:#ecfdf5}.statsInsight.info span{background:#eff6ff}.proCompareBars{display:grid;gap:14px}.proCompareRow{display:grid;grid-template-columns:100px 1fr 1fr 1fr;gap:10px;align-items:center}.proCompareRow strong{color:#102542;font-weight:950}.proCompareTrack{height:18px;border-radius:999px;background:#eef5fb;overflow:hidden}.proCompareTrack span{display:block;height:100%;border-radius:999px}.proCompareTrack .sales{background:linear-gradient(90deg,#1fbfd0,#2878ff)}.proCompareTrack .cost{background:linear-gradient(90deg,#f59e0b,#fb7185)}.proCompareTrack .profit{background:linear-gradient(90deg,#10b981,#84cc16)}.proHorizontalBars{display:grid;gap:14px}.proHBarTop{display:flex;justify-content:space-between;gap:12px;margin-bottom:7px}.proHBarTop b{color:#102542;font-weight:950}.proHBarTop span{color:#64748b;font-size:12px;font-weight:950}.proHBar em{display:block;height:14px;background:#edf4fb;border-radius:999px;overflow:hidden}.proHBar i{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,#1fbfd0,#f59e0b)}.proForecastGrid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.proForecastGrid div{border:1px solid #dce8f2;border-radius:22px;padding:18px;background:linear-gradient(180deg,#fff,#f8fbff)}.proForecastGrid span{display:block;color:#64748b;font-weight:950}.proForecastGrid strong{display:block;margin-top:8px;color:#0f2340;font-size:25px;font-weight:950}.proForecastGrid small{display:block;margin-top:6px;color:#8ba0b8;font-weight:800}.statisticsEmpty{padding:28px;border:1px dashed #d8e6f2;border-radius:20px;color:#64748b;font-weight:900;text-align:center;background:#f8fbff}@media(max-width:1180px){.proStatsHero,.proStatsFilterGrid,.proKpiGrid,.proStatsGrid,.proForecastGrid{grid-template-columns:1fr 1fr}.proStatsCard.span2{grid-column:span 2}}@media(max-width:780px){.proStatsHero,.proStatsFilterGrid,.proKpiGrid,.proStatsGrid,.proForecastGrid,.proDonutBox{grid-template-columns:1fr}.proStatsCard.span2{grid-column:auto}.proStatsHeroText h2{font-size:30px}.proCompareRow{grid-template-columns:1fr}.proStatsFilterActions{flex-direction:column}}


/* ===== Split vouchers visual polish ===== */
button[onclick*="receiptVouchers"],
button[onclick*="paymentVouchers"]{
  position:relative;
}
select[data-fixed-voucher-type="1"]{
  background:#eef7ff!important;
  color:#0f2340!important;
  font-weight:950!important;
  cursor:not-allowed!important;
}



/* ===== Professional Mega Therm printed voucher design ===== */
.voucherTypeFixed{
  height:58px;
  border-radius:18px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:950;
  border:1px solid #dbe7f2;
  background:linear-gradient(180deg,#f8fbff,#eef7ff);
  color:#0f2340;
}
.voucherTypeFixed.receipt{
  border-color:#99f6e4;
  background:linear-gradient(180deg,#ecfdf5,#ffffff);
  color:#047857;
}
.voucherTypeFixed.payment{
  border-color:#fed7aa;
  background:linear-gradient(180deg,#fff7ed,#ffffff);
  color:#c2410c;
}
.voucherPreviewToolbar{
  margin-top:18px;
}
.voucherPrintCard.megaVoucherPrint{
  direction:rtl;
  position:relative;
  max-width:1080px;
  min-height:520px;
  margin:24px auto 0;
  padding:34px 46px 24px 86px;
  border:0!important;
  border-radius:0!important;
  background:
    radial-gradient(circle at 0% 50%,rgba(15,35,64,.08),transparent 17%),
    linear-gradient(180deg,#ffffff 0%,#fbfdff 100%);
  color:#13253d;
  box-shadow:0 28px 65px rgba(15,35,64,.15),0 2px 0 rgba(15,35,64,.08);
  overflow:hidden;
  font-family:inherit;
}
.voucherPrintCard.megaVoucherPrint::before{
  content:"";
  position:absolute;
  inset:18px 22px;
  border:1px solid rgba(218,179,91,.42);
  border-radius:3px;
  pointer-events:none;
}
.megaVoucherPadCurl{
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  width:74px;
  background:
    linear-gradient(90deg,#f3f0eb 0%,#ffffff 42%,#ece7df 100%);
  box-shadow:12px 0 25px rgba(15,35,64,.13);
  border-radius:0 46px 46px 0;
  z-index:3;
}
.megaVoucherCorner{
  position:absolute;
  width:120px;
  height:120px;
  border-radius:50%;
  border:18px solid #15263c;
  opacity:.96;
}
.megaVoucherCorner::after{
  content:"";
  position:absolute;
  width:92px;
  height:12px;
  background:#d9ad4f;
  transform:rotate(-17deg);
  border-radius:999px;
}
.megaVoucherCornerLeft{
  left:30px;
  bottom:52px;
}
.megaVoucherCornerLeft::after{
  right:-48px;
  top:38px;
}
.megaVoucherCornerRight{
  right:-68px;
  bottom:-70px;
}
.megaVoucherCornerRight::after{
  left:-32px;
  top:18px;
}
.megaVoucherTop{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:20px;
  position:relative;
  z-index:4;
}
.megaVoucherMeta{
  display:grid;
  gap:8px;
  min-width:220px;
}
.megaVoucherMeta div{
  display:grid;
  grid-template-columns:82px 1fr;
  align-items:center;
  gap:8px;
}
.megaVoucherMeta span{
  background:#13253d;
  color:#fff;
  border-radius:10px;
  padding:7px 10px;
  font-size:13px;
  font-weight:950;
  text-align:center;
}
.megaVoucherMeta b{
  direction:ltr;
  text-align:center;
  min-height:32px;
  border:1px solid #cdd9e6;
  border-radius:10px;
  padding:5px 10px;
  font-weight:950;
  background:#fff;
}
.megaVoucherBrand{
  display:flex;
  align-items:center;
  gap:16px;
  text-align:right;
}
.megaVoucherBrandText strong{
  display:block;
  color:#13253d;
  font-size:19px;
  font-weight:950;
}
.megaVoucherBrandText small{
  display:block;
  color:#6c7d92;
  margin-top:3px;
  font-weight:850;
}
.megaVoucherBrandText em{
  display:block;
  margin-top:5px;
  color:#c28c28;
  font-style:normal;
  letter-spacing:.5px;
  font-weight:950;
}
.megaVoucherLogoBox{
  width:132px;
  height:78px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.megaVoucherLogoImg{
  max-width:132px;
  max-height:78px;
  object-fit:contain;
}
.megaVoucherTitleLine{
  display:grid;
  grid-template-columns:170px 1fr 170px;
  align-items:center;
  margin:28px 0 16px;
  position:relative;
  z-index:4;
}
.megaVoucherTitleLine::before,
.megaVoucherTitleLine::after{
  content:"";
  height:1px;
  background:linear-gradient(90deg,transparent,#d9ad4f,transparent);
}
.megaVoucherTitleLine h1{
  text-align:center;
  margin:0;
  font-size:42px;
  color:#13253d;
  font-weight:950;
  letter-spacing:-.5px;
}
.megaVoucherCurrency{
  justify-self:start;
  display:flex;
  gap:6px;
}
.megaVoucherCurrency span{
  min-width:60px;
  text-align:center;
  padding:8px 12px;
  border-radius:11px;
  background:#13253d;
  color:#fff;
  font-weight:950;
  direction:ltr;
}
.megaVoucherCurrency span+span{
  background:#fff;
  color:#13253d;
  border:1px solid #cdd9e6;
}
.megaVoucherContent{
  position:relative;
  z-index:4;
}
.megaVoucherFormLines{
  display:grid;
  gap:9px;
}
.megaVoucherField{
  display:grid;
  grid-template-columns:150px 1fr;
  align-items:center;
  gap:12px;
}
.megaVoucherField label{
  color:#13253d;
  font-weight:950;
  font-size:15px;
  text-align:right;
}
.megaVoucherField p{
  min-height:34px;
  margin:0;
  border:1px solid #d8e1eb;
  border-radius:9px;
  background:linear-gradient(180deg,#fafafa,#f4f6f8);
  padding:6px 14px;
  color:#13253d;
  font-weight:850;
  display:flex;
  align-items:center;
}
.megaVoucherPayRow{
  display:flex;
  align-items:center;
  gap:22px;
  padding:8px 0;
  border-top:1px dashed rgba(218,179,91,.65);
  border-bottom:1px dashed rgba(218,179,91,.65);
}
.megaVoucherPayRow b{
  margin-inline-end:auto;
  color:#13253d;
  font-weight:950;
}
.megaVoucherCheck{
  display:inline-flex;
  align-items:center;
  gap:8px;
  color:#13253d;
  font-weight:950;
}
.megaVoucherCheck i{
  width:18px;
  height:18px;
  border-radius:50%;
  border:2px solid #d9ad4f;
  background:#fff;
  display:inline-block;
  position:relative;
}
.megaVoucherCheck.checked i::after{
  content:"";
  position:absolute;
  inset:4px;
  border-radius:50%;
  background:#13253d;
}
.megaVoucherSignatures{
  position:relative;
  z-index:4;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:70px;
  margin-top:28px;
  padding:0 84px 0 22px;
}
.megaVoucherSignatures div{
  text-align:center;
  border-top:2px solid #13253d;
  padding-top:8px;
  min-height:60px;
}
.megaVoucherSignatures span{
  display:block;
  color:#13253d;
  font-weight:950;
}
.megaVoucherSignatures b{
  display:block;
  margin-top:5px;
  color:#52677f;
  font-weight:850;
}
.megaVoucherSignatures small{
  display:block;
  margin-top:4px;
  color:#8a9bb0;
  font-weight:800;
}
.megaVoucherFooter{
  position:relative;
  z-index:4;
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:18px;
  margin-top:18px;
  padding-top:12px;
  border-top:1px solid rgba(218,179,91,.58);
  color:#52677f;
  font-size:13px;
  font-weight:850;
}
.voucherPrintCard.megaVoucherPrint.payment .megaVoucherTitleLine h1{
  color:#0f2340;
}
.voucherPrintCard.megaVoucherPrint.payment .megaVoucherCurrency span:first-child{
  background:#4a2a2a;
}
.voucherPrintCard.megaVoucherPrint.payment .megaVoucherCheck.checked i::after{
  background:#c2410c;
}
@media(max-width:900px){
  .voucherPrintCard.megaVoucherPrint{
    padding:28px 24px 24px 70px;
  }
  .megaVoucherTop,
  .megaVoucherBrand{
    flex-direction:column;
    align-items:flex-end;
  }
  .megaVoucherTitleLine{
    grid-template-columns:1fr;
    gap:10px;
  }
  .megaVoucherTitleLine::before,
  .megaVoucherTitleLine::after{
    display:none;
  }
  .megaVoucherCurrency{
    justify-self:center;
  }
  .megaVoucherField{
    grid-template-columns:1fr;
    gap:6px;
  }
  .megaVoucherPayRow{
    flex-wrap:wrap;
  }
  .megaVoucherSignatures{
    grid-template-columns:1fr;
    padding:0;
    gap:26px;
  }
}
@media print{
  @page{size:A4 landscape;margin:8mm}
  body.voucherPrintMode aside,
  body.voucherPrintMode .topBar,
  body.voucherPrintMode #content>.grid4,
  body.voucherPrintMode #content>.panel,
  body.voucherPrintMode .noPrint,
  body.voucherPrintMode .sectionMenuLauncher,
  body.voucherPrintMode .sectionHistoryBar{
    display:none!important;
  }
  body.voucherPrintMode main{
    margin:0!important;
    width:100%!important;
    padding:0!important;
  }
  body.voucherPrintMode #voucherPreview{
    display:block!important;
    padding:0!important;
    margin:0!important;
  }
  body.voucherPrintMode .voucherPrintCard.megaVoucherPrint{
    display:block!important;
    box-shadow:none!important;
    max-width:none!important;
    width:278mm!important;
    min-height:128mm!important;
    margin:0 auto!important;
    page-break-inside:avoid;
    print-color-adjust:exact;
    -webkit-print-color-adjust:exact;
  }
}



/* ===== Voucher print cleanup fixes ===== */
.megaVoucherPrint .megaVoucherPadCurl,
.megaVoucherPrint .megaVoucherCorner{display:none!important}
.voucherPrintCard.megaVoucherPrint{
  padding:30px 34px 22px 34px!important;
  max-width:1000px!important;
}
.voucherPrintCard.megaVoucherPrint::before{
  inset:14px!important;
  border-color:rgba(218,179,91,.5)!important;
}
.megaVoucherTop{
  align-items:flex-start!important;
}
.megaVoucherBrand{
  display:flex!important;
  align-items:center!important;
  gap:18px!important;
}
.megaVoucherMeta{
  min-width:265px!important;
}
.megaVoucherTitleCenter{
  display:flex;
  justify-content:center;
  align-items:center;
  margin:18px 0 8px;
}
.megaVoucherTitleCenter h1{
  margin:0;
  font-size:56px;
  line-height:1.05;
  color:#13253d;
  font-weight:1000;
  text-align:center;
}
.megaVoucherCurrencyRow{
  display:flex;
  justify-content:center;
  margin:0 0 12px;
}
.megaVoucherCurrency{
  justify-self:center!important;
}
.megaVoucherFormLines{
  gap:8px!important;
}
.megaVoucherField{
  grid-template-columns:170px 1fr!important;
}
.megaVoucherField p{
  min-height:36px!important;
  font-size:15px;
}
.megaVoucherPayRow{
  justify-content:flex-end;
}
.megaVoucherSignatures{
  margin-top:24px!important;
  padding:0 32px!important;
}
.megaVoucherFooter{
  margin-top:16px!important;
}
@media print{
  body.voucherPrintMode .voucherPrintCard.megaVoucherPrint{
    width:276mm!important;
    min-height:180mm!important;
    padding:24px 28px 18px 28px!important;
  }
}


/* ===== Final clean voucher print style ===== */
.megaVoucherBrandText em{
  display:none!important;
}
.megaVoucherFooter.cleanFooter,
.megaVoucherFooter:empty{
  min-height:14px;
  border-top:1px solid rgba(218,179,91,.55);
  margin-top:18px!important;
  padding-top:0!important;
}
.megaVoucherFooter.cleanFooter span,
.megaVoucherFooter:empty span{
  display:none!important;
}
.megaVoucherField.amountWordsRow p{
  justify-content:center;
  text-align:center;
  font-weight:950!important;
  color:#13253d!important;
  line-height:1.8;
}
.megaVoucherField.amountWordsRow label{
  font-weight:950!important;
}
@media print{
  .megaVoucherBrandText em,
  .megaVoucherFooter span{
    display:none!important;
  }
}



/* ===== Final 17 × 9.5 cm Mega Therm voucher print design ===== */
.mtPrintVoucher{
  --voucher-w:17cm;
  --voucher-h:9.5cm;
  direction:rtl;
  position:relative;
  width:var(--voucher-w);
  height:var(--voucher-h);
  box-sizing:border-box;
  margin:22px auto;
  padding:.34cm .42cm .28cm;
  background:#fff;
  color:#102542;
  border:1px solid #0d315a;
  border-radius:10px;
  box-shadow:0 22px 50px rgba(15,35,64,.14);
  overflow:hidden;
  font-family:inherit;
}
.mtVoucherBorder{
  position:absolute;
  inset:.11cm;
  border:1px solid rgba(13,49,90,.25);
  border-radius:8px;
  pointer-events:none;
}
.mtVoucherHeader{
  position:relative;
  z-index:2;
  display:grid;
  grid-template-columns:3.8cm 1fr 5.1cm;
  gap:.25cm;
  align-items:start;
  min-height:1.95cm;
}
.mtVoucherNoDate{
  display:grid;
  gap:.10cm;
  direction:ltr;
}
.mtVoucherNoDate div{
  display:grid;
  grid-template-columns:1.05cm 1fr;
  min-height:.48cm;
  border:1px solid #bfd0e2;
  border-radius:6px;
  overflow:hidden;
  background:#fff;
}
.mtVoucherNoDate b{
  display:grid;
  place-items:center;
  background:#102542;
  color:#fff;
  font-size:8.5px;
  font-weight:950;
  direction:rtl;
}
.mtVoucherNoDate span{
  display:grid;
  place-items:center;
  color:#102542;
  font-size:9px;
  font-weight:950;
}
.mtVoucherTitleBox{
  text-align:center;
}
.mtVoucherTitleBox h1{
  margin:0;
  color:#102542;
  font-size:32px;
  line-height:1;
  font-weight:1000;
  letter-spacing:-1px;
}
.mtVoucherTitleLine{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:.1cm;
  margin:.06cm auto .08cm;
}
.mtVoucherTitleLine::before,
.mtVoucherTitleLine::after{
  content:"";
  width:1.45cm;
  height:1px;
  background:#102542;
  opacity:.8;
}
.mtVoucherTitleLine i{
  width:.13cm;
  height:.13cm;
  background:#0f7492;
  transform:rotate(45deg);
  display:block;
}
.mtVoucherCurrency{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  border:1px solid #aebfd2;
  border-radius:6px;
  height:.42cm;
  direction:ltr;
}
.mtVoucherCurrency span,
.mtVoucherCurrency strong{
  display:grid;
  place-items:center;
  min-width:.78cm;
  height:100%;
  padding:0 .12cm;
  font-size:9px;
  font-weight:950;
}
.mtVoucherCurrency strong{
  background:#102542;
  color:#fff;
}
.mtVoucherCompany{
  display:grid;
  grid-template-columns:1.34cm 1fr;
  gap:.16cm;
  align-items:center;
  text-align:right;
}
.mtVoucherCompanyText{
  border-right:1px solid #102542;
  padding-right:.20cm;
  padding-left:0;
}
.mtVoucherCompanyText strong{
  display:block;
  color:#102542;
  font-size:12.4px;
  font-weight:1000;
  line-height:1.34;
}
.mtVoucherCompanyText span{
  display:none;
}
.mtVoucherLogo,
.mtVoucherCompany img{
  max-width:1.25cm!important;
  max-height:.82cm!important;
  object-fit:contain!important;
}
.mtVoucherRows{
  position:relative;
  z-index:2;
  display:grid;
  gap:.07cm;
  margin-top:.08cm;
}
.mtVoucherRow{
  display:grid;
  grid-template-columns:3.72cm 1fr;
  min-height:.46cm;
  border:1px solid #b7ccdf;
  border-radius:5px;
  overflow:hidden;
  background:#fff;
}
.mtVoucherRow label{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  padding:0 .18cm;
  background:linear-gradient(180deg,#f7fbff,#eef6fb);
  border-left:1px solid #c5d7e7;
  color:#102542;
  font-size:9px;
  font-weight:1000;
  white-space:nowrap;
}
.mtVoucherRow p{
  margin:0;
  min-width:0;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  padding:0 .18cm;
  background:#fff;
  color:#102542;
  font-size:9px;
  font-weight:900;
  border-bottom:1px dotted rgba(15,35,64,.55);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.mtVoucherRow.amountWords p{
  justify-content:center;
  white-space:normal;
  text-align:center;
  line-height:1.25;
  font-size:8.5px;
}
.mtVoucherRow.paymentMethod p{
  justify-content:space-around;
  gap:.28cm;
  border-bottom:0;
}
.mtPrintRadio{
  display:inline-flex;
  align-items:center;
  gap:.08cm;
  font-size:9px;
  font-weight:950;
  white-space:nowrap;
}
.mtPrintRadio i{
  width:.18cm;
  height:.18cm;
  border:1.4px solid #0f7492;
  border-radius:50%;
  display:inline-block;
  position:relative;
}
.mtPrintRadio.checked i::after{
  content:"";
  position:absolute;
  inset:.035cm;
  border-radius:50%;
  background:#102542;
}
.mtVoucherSigns{
  position:relative;
  z-index:2;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:.60cm;
  margin-top:.15cm;
  padding:0 .55cm;
}
.mtVoucherSigns div{
  text-align:center;
  border-top:1px solid #102542;
  padding-top:.08cm;
  min-height:.62cm;
}
.mtVoucherSigns b{
  display:block;
  color:#102542;
  font-size:9.2px;
  font-weight:1000;
}
.mtVoucherSigns span{
  display:block;
  margin-top:.03cm;
  color:#5b6f86;
  font-size:8px;
  font-weight:900;
}
.mtVoucherSigns small{
  display:block;
  margin-top:.02cm;
  color:#8aa0b6;
  font-size:7px;
  font-weight:850;
}
@media screen{
  .mtPrintVoucher{
    transform-origin:top center;
    max-width:100%;
  }
}
@media print{
  @page{
    size:17cm 9.5cm landscape;
    margin:0;
  }
  body.voucherPrintMode *{
    visibility:hidden!important;
  }
  body.voucherPrintMode #voucherPrintCard,
  body.voucherPrintMode #voucherPrintCard *{
    visibility:visible!important;
  }
  body.voucherPrintMode{
    margin:0!important;
    background:#fff!important;
  }
  body.voucherPrintMode main,
  body.voucherPrintMode #content,
  body.voucherPrintMode #voucherPreview{
    margin:0!important;
    padding:0!important;
    width:17cm!important;
    height:9.5cm!important;
    overflow:hidden!important;
  }
  body.voucherPrintMode .mtPrintVoucher{
    position:absolute!important;
    inset:0!important;
    width:17cm!important;
    height:9.5cm!important;
    margin:0!important;
    padding:.34cm .42cm .28cm!important;
    box-shadow:none!important;
    border-radius:0!important;
    border:1px solid #0d315a!important;
    page-break-inside:avoid!important;
    print-color-adjust:exact!important;
    -webkit-print-color-adjust:exact!important;
  }
}




/* ===== A5 landscape voucher print size override ===== */
.mtPrintVoucher{
  --voucher-w:21cm!important;
  --voucher-h:14.8cm!important;
  width:21cm!important;
  height:14.8cm!important;
  padding:.62cm .70cm .48cm!important;
  border-radius:12px!important;
}
.mtVoucherBorder{
  inset:.18cm!important;
  border-radius:10px!important;
}
.mtVoucherHeader{
  grid-template-columns:4.8cm 1fr 6.2cm!important;
  gap:.36cm!important;
  min-height:2.55cm!important;
}
.mtVoucherNoDate div{
  min-height:.66cm!important;
  border-radius:8px!important;
}
.mtVoucherNoDate b{
  font-size:11px!important;
}
.mtVoucherNoDate span{
  font-size:11.5px!important;
}
.mtVoucherTitleBox h1{
  font-size:46px!important;
}
.mtVoucherTitleLine{
  margin:.12cm auto .16cm!important;
}
.mtVoucherTitleLine::before,
.mtVoucherTitleLine::after{
  width:2.1cm!important;
}
.mtVoucherCurrency{
  height:.58cm!important;
  border-radius:8px!important;
}
.mtVoucherCurrency span,
.mtVoucherCurrency strong{
  min-width:1.02cm!important;
  font-size:11.5px!important;
}
.mtVoucherCompany{
  grid-template-columns:1fr 1.75cm!important;
  gap:.24cm!important;
}
.mtVoucherCompanyText strong{
  font-size:16px!important;
}
.mtVoucherCompanyText span{
  font-size:11px!important;
}
.mtVoucherLogo,
.mtVoucherCompany img{
  max-width:1.65cm!important;
  max-height:1.12cm!important;
}
.mtVoucherRows{
  gap:.13cm!important;
  margin-top:.18cm!important;
}
.mtVoucherRow{
  grid-template-columns:4.65cm 1fr!important;
  min-height:.68cm!important;
  border-radius:7px!important;
}
.mtVoucherRow label{
  padding:0 .26cm!important;
  font-size:11.5px!important;
}
.mtVoucherRow p{
  padding:0 .28cm!important;
  font-size:12px!important;
}
.mtVoucherRow.amountWords p{
  font-size:11.5px!important;
  line-height:1.45!important;
}
.mtPrintRadio{
  font-size:11.5px!important;
  gap:.12cm!important;
}
.mtPrintRadio i{
  width:.24cm!important;
  height:.24cm!important;
}
.mtPrintRadio.checked i::after{
  inset:.045cm!important;
}
.mtVoucherSigns{
  gap:1.25cm!important;
  margin-top:.38cm!important;
  padding:0 1.25cm!important;
}
.mtVoucherSigns div{
  min-height:.95cm!important;
  padding-top:.13cm!important;
}
.mtVoucherSigns b{
  font-size:12px!important;
}
.mtVoucherSigns span{
  font-size:10.5px!important;
}
.mtVoucherSigns small{
  font-size:9px!important;
}
@media print{
  @page{
    size:A5 landscape;
    margin:0;
  }
  body.voucherPrintMode main,
  body.voucherPrintMode #content,
  body.voucherPrintMode #voucherPreview{
    width:21cm!important;
    height:14.8cm!important;
  }
  body.voucherPrintMode .mtPrintVoucher{
    width:21cm!important;
    height:14.8cm!important;
    padding:.62cm .70cm .48cm!important;
    border-radius:0!important;
  }
}




/* ===== Voucher data RTL/right alignment fix ===== */
.mtPrintVoucher,
.mtPrintVoucher *{
  direction: rtl;
}

.mtVoucherRows,
.mtVoucherRows .mtVoucherRow{
  direction: rtl !important;
}

.mtVoucherRow{
  grid-template-columns: 4.65cm 1fr !important;
}

.mtVoucherRow label{
  text-align: right !important;
  justify-content: flex-start !important;
  direction: rtl !important;
}

.mtVoucherRow p,
.mtVoucherRow .value,
.mtVoucherRow .mtVoucherValue{
  text-align: right !important;
  direction: rtl !important;
  unicode-bidi: plaintext;
  justify-content: flex-start !important;
  align-items: center !important;
}

.mtVoucherRow.amountWords p{
  text-align: right !important;
  direction: rtl !important;
  line-height: 1.5 !important;
}

.mtVoucherSigns,
.mtVoucherSigns div,
.mtVoucherSigns b,
.mtVoucherSigns span,
.mtVoucherSigns small{
  direction: rtl !important;
  text-align: center !important;
}

.mtVoucherNoDate div,
.mtVoucherNoDate span,
.mtVoucherNoDate b{
  direction: ltr !important;
  text-align: center !important;
}

.mtVoucherCurrency{
  direction: ltr !important;
}

.mtVoucherCompany,
.mtVoucherCompanyText{
  direction: rtl !important;
}

.mtVoucherFooter,
.mtVoucherFooter *{
  text-align: center !important;
}

@media print{
  .mtPrintVoucher,
  .mtPrintVoucher *{
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}



/* ===== Voucher header left-right layout fix ===== */
.mtVoucherHeader{
  direction:ltr !important;
  grid-template-columns:3.8cm 1fr 5.1cm !important;
}
.mtVoucherNoDate{
  direction:ltr !important;
  justify-self:start;
}
.mtVoucherTitleBox{
  direction:rtl !important;
}
.mtVoucherCompany{
  direction:rtl !important;
  justify-self:end;
  text-align:right !important;
  grid-template-columns:1fr 1.34cm !important;
}
.mtVoucherCompanyText{
  border-left:1px solid #102542 !important;
  border-right:0 !important;
  padding-left:.20cm !important;
  padding-right:0 !important;
}
.mtVoucherCompany img,
.mtVoucherLogo{
  justify-self:end;
}


/* Logo first + unified full company name */
.mtVoucherCompany{
  align-items:center;
}
.mtVoucherCompany .mtVoucherLogo,
.mtVoucherCompany img{
  justify-self:start;
}
.mtVoucherCompanyText{
  text-align:right;
}


/* Final override: logo first and full company name unified */
.mtVoucherCompany{
  grid-template-columns:1.34cm 1fr !important;
  direction:ltr !important;
  justify-self:end !important;
  text-align:right !important;
}
.mtVoucherCompany .mtVoucherLogo,
.mtVoucherCompany img{
  justify-self:start !important;
}
.mtVoucherCompanyText{
  direction:rtl !important;
  border-right:1px solid #102542 !important;
  border-left:0 !important;
  padding-right:.20cm !important;
  padding-left:0 !important;
  text-align:right !important;
}
.mtVoucherCompanyText strong{
  font-size:12.4px !important;
  line-height:1.34 !important;
}
.mtVoucherCompanyText span{
  display:none !important;
}


/* ===== Fix browser Arabic-locale date placeholders ===== */
input[type="date"],
input.fixedDateInput{
  direction:ltr!important;
  unicode-bidi:plaintext!important;
  text-align:center!important;
  font-family:Arial, Tahoma, sans-serif!important;
  letter-spacing:0!important;
}

html[dir="rtl"] input[type="date"]{
  direction:ltr!important;
  text-align:center!important;
}

input[type="date"]::-webkit-datetime-edit,
input.fixedDateInput::-webkit-datetime-edit{
  direction:ltr!important;
  unicode-bidi:plaintext!important;
  text-align:center!important;
}

input[type="date"]::-webkit-datetime-edit-year-field,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-text{
  direction:ltr!important;
  unicode-bidi:plaintext!important;
}



/* ===== New professional home dashboard page ===== */
.megaHomePage{
  direction:rtl;
  max-width:1640px;
  margin:0 auto;
}
.megaHomeTop{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  margin:0 0 22px;
}
.megaHomeTop h1{
  margin:0;
  color:#102542;
  font-size:48px;
  line-height:1.2;
  font-weight:1000;
}
.megaHomeTop p{
  margin:6px 0 0;
  color:#7890aa;
  font-size:18px;
  font-weight:900;
}
.megaHomeSession{
  min-width:260px;
  background:rgba(255,255,255,.82);
  border:1px solid #d8e6f2;
  border-radius:26px;
  padding:18px 22px;
  box-shadow:0 18px 40px rgba(15,35,64,.08);
}
.megaHomeSession span,
.megaHomeSession small{
  display:block;
  color:#7b91aa;
  font-weight:900;
}
.megaHomeSession strong{
  display:block;
  color:#102542;
  font-size:20px;
  font-weight:1000;
  margin:4px 0;
}
.megaHomeGrid{
  display:grid;
  grid-template-columns:1.1fr .82fr 1.35fr;
  gap:22px;
  align-items:start;
}
.megaHomePanel{
  background:rgba(255,255,255,.94);
  border:1px solid #dbe8f3;
  border-radius:34px;
  padding:28px;
  box-shadow:0 24px 55px rgba(15,35,64,.08);
}
.megaHomePanelHead{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:20px;
}
.megaHomePanelHead h2{
  margin:0;
  color:#102542;
  font-size:32px;
  font-weight:1000;
  line-height:1.25;
}
.megaHomePanelHead p{
  margin:6px 0 0;
  color:#7d93ac;
  font-weight:900;
  line-height:1.7;
}
.megaHomePanelHead em{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:84px;
  height:56px;
  padding:0 16px;
  border-radius:999px;
  background:#fff3c4;
  color:#9a6a00;
  font-style:normal;
  font-weight:1000;
}
.megaHomeRoundIcon,.megaHomeBigIcon{
  display:grid;
  place-items:center;
  width:74px;
  height:74px;
  border-radius:24px;
  background:#eef5ff;
  font-size:32px;
}
.megaHomeAlertsList,
.megaHomeTestList{
  display:grid;
  gap:14px;
  max-height:560px;
  overflow:auto;
  padding-left:6px;
}
.megaHomeAlert{
  width:100%;
  border:1px solid #e0ebf5;
  border-radius:24px;
  background:#fff;
  padding:18px;
  display:grid;
  grid-template-columns:62px 1fr;
  gap:16px;
  align-items:center;
  text-align:right;
  cursor:pointer;
  transition:.18s ease;
}
.megaHomeAlert:hover{
  transform:translateY(-2px);
  box-shadow:0 16px 32px rgba(15,35,64,.08);
}
.megaHomeAlertIcon{
  width:58px;
  height:58px;
  border-radius:20px;
  display:grid;
  place-items:center;
  background:#f0f6ff;
  font-size:28px;
}
.megaHomeAlert strong{
  display:block;
  color:#102542;
  font-size:19px;
  font-weight:1000;
}
.megaHomeAlert small{
  display:block;
  color:#7188a2;
  font-size:14px;
  font-weight:900;
  margin-top:6px;
}
.megaHomeAlert.danger{background:linear-gradient(90deg,#fff,#fff7f7);border-color:#ffd4d4}
.megaHomeAlert.warning{background:linear-gradient(90deg,#fff,#fffaf0);border-color:#ffe2a8}
.megaHomeAlert.info{background:linear-gradient(90deg,#fff,#f5fbff);border-color:#cfe8ff}
.megaHomeAlert.success{background:linear-gradient(90deg,#fff,#f3fff8);border-color:#c9f2dd}
.megaHomeLink{
  margin-top:18px;
  border:0;
  background:#eef6ff;
  color:#2672df;
  border-radius:18px;
  padding:13px 20px;
  font-weight:1000;
  cursor:pointer;
}
.megaHomeShortcutsPanel{
  grid-column:auto;
}
.megaHomeShortcutsGrid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:16px;
}
.megaHomeShortcut{
  position:relative;
  min-height:170px;
  border:1px solid #dbe8f3;
  border-radius:24px;
  background:#fff;
  padding:20px 16px 18px;
  text-align:right;
  cursor:pointer;
  overflow:hidden;
  transition:.18s ease;
}
.megaHomeShortcut::after{
  content:"";
  position:absolute;
  inset:auto 0 0 0;
  height:5px;
  background:#1e88ff;
}
.megaHomeShortcut:hover{
  transform:translateY(-3px);
  box-shadow:0 18px 35px rgba(15,35,64,.09);
}
.megaHomeShortcut span{
  display:grid;
  place-items:center;
  width:58px;
  height:58px;
  border-radius:20px;
  background:#eef5ff;
  font-size:28px;
  margin-bottom:20px;
}
.megaHomeShortcut strong{
  display:block;
  color:#102542;
  font-size:21px;
  font-weight:1000;
}
.megaHomeShortcut small{
  display:block;
  color:#758da8;
  font-weight:900;
  margin-top:8px;
  line-height:1.55;
}
.megaHomeShortcut.red::after{background:#ff4d4f}
.megaHomeShortcut.green::after{background:#05b889}
.megaHomeShortcut.orange::after{background:#ffad1f}
.megaHomeShortcut.cyan::after{background:#18c3d6}
.megaHomeStockPanel{
  display:flex;
  align-items:center;
  gap:22px;
  min-height:250px;
}
.megaHomeStockPanel h2{
  margin:0;
  color:#637991;
  font-size:25px;
  font-weight:1000;
}
.megaHomeStockPanel strong{
  display:block;
  color:#102542;
  font-size:58px;
  font-weight:1000;
  line-height:1;
  margin:10px 0;
}
.megaHomeStockPanel p{
  color:#7d93ac;
  font-size:18px;
  font-weight:900;
  margin:0;
}
.megaHomeAccountsPanel{
  grid-column:span 2;
}
.megaHomeAccountsList{
  display:grid;
  gap:12px;
}
.megaHomeAccountRow{
  border:1px solid #dbe8f3;
  background:#f9fcff;
  border-radius:18px;
  min-height:56px;
  padding:0 18px;
  display:grid;
  grid-template-columns:130px 1fr 170px;
  gap:14px;
  align-items:center;
  cursor:pointer;
}
.megaHomeAccountRow span{
  color:#7890aa;
  font-weight:900;
}
.megaHomeAccountRow b{
  color:#102542;
  font-size:18px;
  font-weight:1000;
}
.megaHomeAccountRow strong{
  color:#087f73;
  font-size:19px;
  font-weight:1000;
  direction:ltr;
  text-align:left;
}
.megaHomeEmpty{
  padding:22px;
  border-radius:22px;
  background:#f6fbff;
  color:#7188a2;
  font-weight:950;
}
@media(max-width:1280px){
  .megaHomeGrid{grid-template-columns:1fr}
  .megaHomeAccountsPanel{grid-column:auto}
  .megaHomeShortcutsGrid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:720px){
  .megaHomeTop{display:block}
  .megaHomeTop h1{font-size:36px}
  .megaHomePanel{padding:20px;border-radius:26px}
  .megaHomeShortcutsGrid{grid-template-columns:1fr}
  .megaHomeAccountRow{grid-template-columns:1fr}
  .megaHomeAccountRow strong{text-align:right}
}




/* ===== Login-first screen visibility fix ===== */
#app.hidden{
  display:none!important;
}
#login:not(.hidden){
  display:block!important;
}
body:has(#app.hidden) .sectionMenuLauncher,
body:has(#login:not(.hidden)) .sectionMenuLauncher{
  display:none!important;
}




/* ===== Fix duplicate home title and pre-login menu ===== */
#app.hidden{
  display:none!important;
}
#login:not(.hidden){
  display:block!important;
}
body:has(#login:not(.hidden)) .sectionMenuLauncher,
body:has(#app.hidden) .sectionMenuLauncher,
body:has(#login:not(.hidden)) .sectionMenuBackdrop,
body:has(#app.hidden) .sectionMenuBackdrop{
  display:none!important;
}

/* The page hero already shows "الرئيسة", so hide the repeated title inside the home content */
.megaHomeTop > div:first-child{
  display:none!important;
}
.megaHomeTop{
  justify-content:flex-end!important;
  margin-top:-8px!important;
}




/* ===== Compact home dashboard spacing fix ===== */
body.homeCompactPage main,
#app.homeCompactPage main{
  padding-top:18px!important;
}

body.homeCompactPage .pageHero,
body.homeCompactPage .hero,
body.homeCompactPage header,
#app.homeCompactPage .pageHero,
#app.homeCompactPage .hero,
#app.homeCompactPage header{
  margin-bottom:8px!important;
  min-height:auto!important;
  padding-bottom:0!important;
}

body.homeCompactPage #pageTitle,
#app.homeCompactPage #pageTitle{
  margin-bottom:4px!important;
}

body.homeCompactPage #pageSubtitle,
#app.homeCompactPage #pageSubtitle{
  margin-bottom:0!important;
}

body.homeCompactPage .megaHomePage,
#app.homeCompactPage .megaHomePage{
  margin-top:-70px!important;
}

body.homeCompactPage .megaHomeTop,
#app.homeCompactPage .megaHomeTop{
  display:flex!important;
  justify-content:flex-start!important;
  align-items:center!important;
  min-height:0!important;
  margin:0 0 14px!important;
  padding:0!important;
  pointer-events:none;
}

body.homeCompactPage .megaHomeTop > div:first-child,
#app.homeCompactPage .megaHomeTop > div:first-child{
  display:none!important;
}

body.homeCompactPage .megaHomeSession,
#app.homeCompactPage .megaHomeSession{
  pointer-events:auto;
  min-width:230px!important;
  width:230px!important;
  padding:13px 16px!important;
  border-radius:22px!important;
  transform:translateY(-4px);
  box-shadow:0 12px 28px rgba(15,35,64,.07)!important;
}

body.homeCompactPage .megaHomeSession strong,
#app.homeCompactPage .megaHomeSession strong{
  font-size:17px!important;
  margin:2px 0!important;
}

body.homeCompactPage .megaHomeSession span,
body.homeCompactPage .megaHomeSession small,
#app.homeCompactPage .megaHomeSession span,
#app.homeCompactPage .megaHomeSession small{
  font-size:13px!important;
}

body.homeCompactPage .megaHomeGrid,
#app.homeCompactPage .megaHomeGrid{
  margin-top:0!important;
  gap:18px!important;
  align-items:start!important;
}

body.homeCompactPage .megaHomePanel,
#app.homeCompactPage .megaHomePanel{
  padding:24px!important;
  border-radius:30px!important;
}

body.homeCompactPage .megaHomePanelHead,
#app.homeCompactPage .megaHomePanelHead{
  margin-bottom:14px!important;
}

body.homeCompactPage .megaHomePanelHead h2,
#app.homeCompactPage .megaHomePanelHead h2{
  font-size:29px!important;
}

body.homeCompactPage .megaHomeShortcutsGrid,
#app.homeCompactPage .megaHomeShortcutsGrid{
  gap:13px!important;
}

body.homeCompactPage .megaHomeShortcut,
#app.homeCompactPage .megaHomeShortcut{
  min-height:148px!important;
  padding:16px 14px!important;
}

body.homeCompactPage .megaHomeShortcut span,
#app.homeCompactPage .megaHomeShortcut span{
  width:50px!important;
  height:50px!important;
  margin-bottom:14px!important;
}

body.homeCompactPage .megaHomeShortcut strong,
#app.homeCompactPage .megaHomeShortcut strong{
  font-size:19px!important;
}

body.homeCompactPage .megaHomeAlert,
#app.homeCompactPage .megaHomeAlert{
  padding:14px!important;
  border-radius:21px!important;
}

body.homeCompactPage .megaHomeAlertsList,
body.homeCompactPage .megaHomeTestList,
#app.homeCompactPage .megaHomeAlertsList,
#app.homeCompactPage .megaHomeTestList{
  max-height:500px!important;
  gap:11px!important;
}

/* Hide duplicated internal title but keep session card; this avoids empty vertical space */
body.homeCompactPage .megaHomeTop > div:first-child,
#app.homeCompactPage .megaHomeTop > div:first-child{
  display:none!important;
}

@media(max-width:1280px){
  body.homeCompactPage .megaHomePage,
  #app.homeCompactPage .megaHomePage{
    margin-top:-25px!important;
  }
  body.homeCompactPage .megaHomeTop,
  #app.homeCompactPage .megaHomeTop{
    justify-content:flex-end!important;
  }
}
@media(max-width:720px){
  body.homeCompactPage .megaHomePage,
  #app.homeCompactPage .megaHomePage{
    margin-top:0!important;
  }
  body.homeCompactPage .megaHomeSession,
  #app.homeCompactPage .megaHomeSession{
    width:100%!important;
    min-width:0!important;
  }
}




/* ===== Final home session position fix ===== */
body.homeCompactPage .megaHomePage,
#app.homeCompactPage .megaHomePage{
  margin-top:8px!important;
  position:relative!important;
}

body.homeCompactPage .megaHomeTop,
#app.homeCompactPage .megaHomeTop{
  position:absolute!important;
  top:-118px!important;
  left:54px!important;
  right:auto!important;
  width:auto!important;
  display:block!important;
  margin:0!important;
  padding:0!important;
  z-index:4!important;
  pointer-events:none!important;
}

body.homeCompactPage .megaHomeTop > div:first-child,
#app.homeCompactPage .megaHomeTop > div:first-child{
  display:none!important;
}

body.homeCompactPage .megaHomeSession,
#app.homeCompactPage .megaHomeSession{
  pointer-events:auto!important;
  min-width:238px!important;
  width:238px!important;
  padding:15px 18px!important;
  border-radius:22px!important;
  transform:none!important;
  background:rgba(255,255,255,.88)!important;
  box-shadow:0 16px 36px rgba(15,35,64,.08)!important;
}

body.homeCompactPage .megaHomeGrid,
#app.homeCompactPage .megaHomeGrid{
  margin-top:16px!important;
  gap:18px!important;
}

body.homeCompactPage .pageHero,
body.homeCompactPage .hero,
#app.homeCompactPage .pageHero,
#app.homeCompactPage .hero{
  min-height:150px!important;
}

body.homeCompactPage #pageTitle,
#app.homeCompactPage #pageTitle{
  position:relative!important;
  z-index:2!important;
}

@media(max-width:1280px){
  body.homeCompactPage .megaHomeTop,
  #app.homeCompactPage .megaHomeTop{
    position:static!important;
    margin:0 0 12px!important;
  }
  body.homeCompactPage .megaHomePage,
  #app.homeCompactPage .megaHomePage{
    margin-top:0!important;
  }
}
@media(max-width:720px){
  body.homeCompactPage .megaHomeSession,
  #app.homeCompactPage .megaHomeSession{
    width:100%!important;
    min-width:0!important;
  }
}




/* ===== Full program review safety CSS ===== */
body.loginOnlyMode #app,
#app.hidden{
  display:none!important;
}
body.loginOnlyMode .sectionMenuLauncher,
body.loginOnlyMode .sectionMenuBackdrop,
body.loginOnlyMode .sectionHistoryBar,
#app.hidden .sectionMenuLauncher{
  display:none!important;
}

#pageTitle,
#pageSubtitle{
  position:relative;
  z-index:2;
}

input[type="date"],
input.fixedDateInput{
  direction:ltr!important;
  unicode-bidi:plaintext!important;
  text-align:center!important;
  font-family:Arial,Tahoma,sans-serif!important;
}

input[type="date"]::-webkit-datetime-edit,
input.fixedDateInput::-webkit-datetime-edit{
  direction:ltr!important;
  unicode-bidi:plaintext!important;
  text-align:center!important;
}

body.homeCompactPage .megaHomeTop,
#app.homeCompactPage .megaHomeTop{
  z-index:3!important;
}
body.homeCompactPage .megaHomeGrid,
#app.homeCompactPage .megaHomeGrid{
  position:relative;
  z-index:1;
}

table th, table td{
  vertical-align:middle;
}
.actions{
  flex-wrap:wrap;
}

.card, .panel, .stat, .megaHomePanel, .megaHomeShortcut, .megaHomeAlert{
  overflow-wrap:anywhere;
}




/* ===== Login open fix CSS ===== */
#login.hidden{display:none!important}
#app.hidden{display:none!important}
body:not(.loginOnlyMode) #app:not(.hidden){display:block!important}
body.loginOnlyMode #app{display:none!important}




/* ===== Dedicated supplier statement section styles ===== */
.supplierStatementPage .supplierAccountsPanel{
  margin-top:22px;
}
.supplierStatementSearchBar{
  margin:12px 0 18px;
}
.supplierStatementSearchBar .search{
  max-width:520px;
}
.supplierStatementAllTableWrap{
  overflow:auto;
  margin-top:18px;
  border:1px solid #dbe8f3;
  border-radius:18px;
}
.supplierStatementSummaryTable{
  width:100%;
  border-collapse:collapse;
  min-width:980px;
}
.supplierStatementSummaryTable th,
.supplierStatementSummaryTable td{
  border-bottom:1px solid #e3edf6;
  padding:12px 14px;
  text-align:right;
  vertical-align:middle;
}
.supplierStatementSummaryTable th{
  background:#f1f7ff;
  color:#102542;
  font-weight:1000;
}
.supplierStatementSummaryTable tr:hover td{
  background:#fbfdff;
}
.supplierStatementsShortcutPanel{
  border:1px solid #bfe7ff;
  background:linear-gradient(135deg,#fff,#f5fbff);
}
.emptySupplierStatements{
  text-align:center;
  padding:40px;
}
@media print{
  .supplierStatementPage .supplierAccountsPanel,
  .supplierStatementPage .supplierStatementStats,
  .supplierStatementsShortcutPanel{
    display:none!important;
  }
}




/* ===== Dedicated distributor statement section styles ===== */
.distributorStatementPage .supplierStatementBalance strong{
  color:#087f73;
}
.distributorStatementTable th,
.distributorStatementTable td{
  white-space:nowrap;
}
.distributorStatementsShortcutPanel{
  border:1px solid #bfe7ff;
  background:linear-gradient(135deg,#fff,#f4fbff);
}
.distributorAccountCard.active{
  border-color:#1bbfe7!important;
  box-shadow:0 16px 35px rgba(25,170,210,.16)!important;
}
@media print{
  .distributorStatementPage .supplierAccountsPanel,
  .distributorStatementPage .supplierStatementStats,
  .distributorStatementsShortcutPanel{
    display:none!important;
  }
}




/* ===== Client labels 1/2/3 visual consistency ===== */
.clientLabelHint{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  background:#eef6ff;
  color:#1d5fd1;
  font-weight:900;
}




/* ===== Client 1 discount cards readability fix ===== */
body .discountCard label,
body .discountCard .fieldLabel,
body .categoryDiscountCard label{
  white-space:nowrap;
  font-weight:900;
}
body .discountCard,
body .categoryDiscountCard{
  min-height:120px;
}




/* ===== Hide deleted Client 1 general discount field if old DOM survives ===== */
#f_companyClients_discount,
[id*="_companyClients_discount"]{
  display:none!important;
}




/* ===== Client 1 category discount table ===== */
.client1MainFormGrid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:18px;
  margin-bottom:22px;
}
.client1MainFormGrid label,
.client1NotesRow label{
  display:block;
  color:#667991;
  font-weight:1000;
  margin-bottom:8px;
}
.client1DiscountTablePanel{
  border:1px solid #dbe8f3;
  border-radius:24px;
  background:linear-gradient(135deg,#ffffff,#f7fbff);
  padding:18px;
  margin:10px 0 22px;
}
.client1DiscountTableHead{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  margin-bottom:14px;
}
.client1DiscountTableHead h4{
  margin:0;
  color:#102542;
  font-size:24px;
  font-weight:1000;
}
.client1DiscountTableHead p{
  margin:4px 0 0;
  color:#7c90a8;
  font-weight:900;
}
.client1DiscountTableWrap{
  overflow:auto;
  border:1px solid #dbe8f3;
  border-radius:18px;
  background:#fff;
}
.client1DiscountTable{
  width:100%;
  border-collapse:collapse;
  min-width:720px;
}
.client1DiscountTable th,
.client1DiscountTable td{
  padding:14px 16px;
  border-bottom:1px solid #e4eef7;
  text-align:right;
  vertical-align:middle;
}
.client1DiscountTable th{
  background:#f1f7ff;
  color:#102542;
  font-weight:1000;
}
.client1DiscountInputWrap{
  display:flex;
  align-items:center;
  gap:8px;
  max-width:220px;
}
.client1DiscountInputWrap input{
  width:100%;
  min-height:48px;
  border:1px solid #d3e1ef;
  border-radius:14px;
  background:#f9fcff;
  padding:0 14px;
  text-align:center;
  font-weight:1000;
  color:#0e253f;
}
.client1DiscountInputWrap span{
  display:grid;
  place-items:center;
  width:44px;
  height:44px;
  border-radius:12px;
  background:#eef6ff;
  color:#1d6fe9;
  font-weight:1000;
}
.client1NotesRow{
  margin-bottom:18px;
}
.client1NotesRow input{
  width:100%;
}
.client1DiscountSummaryCell{
  min-width:360px;
  color:#526985;
  font-weight:850;
  line-height:1.7;
}
.client1Table th,
.client1Table td{
  vertical-align:middle;
}
@media(max-width:1100px){
  .client1MainFormGrid{grid-template-columns:1fr 1fr}
}
@media(max-width:720px){
  .client1MainFormGrid{grid-template-columns:1fr}
}




/* ===== Client 1 discount percent input fix ===== */
.client1DiscountTable td:last-child{
  min-width:220px;
}
.client1DiscountInputWrap{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:8px!important;
  max-width:220px!important;
}
.client1DiscountInputWrap input,
.client1DiscountPercentInput{
  display:block!important;
  width:150px!important;
  min-height:46px!important;
  border:1px solid #cfe0f0!important;
  border-radius:14px!important;
  background:#f8fcff!important;
  color:#102542!important;
  font-weight:1000!important;
  text-align:center!important;
  direction:ltr!important;
  padding:0 12px!important;
}
.client1DiscountInputWrap span{
  display:grid!important;
  place-items:center!important;
  width:42px!important;
  height:42px!important;
  border-radius:12px!important;
  background:#edf6ff!important;
  color:#1d6fe9!important;
  font-weight:1000!important;
}




/* ===== Final Client 1 discount text input style ===== */
.finalClient1DiscountInputWrap,
.client1DiscountInputWrap{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:10px!important;
  max-width:260px!important;
}
.client1DiscountPercentInput{
  display:block!important;
  width:170px!important;
  height:54px!important;
  min-height:54px!important;
  border:1px solid #cfe0f0!important;
  border-radius:16px!important;
  background:#f8fcff!important;
  color:#102542!important;
  font-weight:1000!important;
  font-size:18px!important;
  text-align:center!important;
  direction:ltr!important;
  padding:0 14px!important;
  outline:none!important;
}
.client1DiscountPercentInput:focus{
  border-color:#67d9ef!important;
  box-shadow:0 0 0 5px rgba(103,217,239,.18)!important;
}
.client1DiscountInputWrap span{
  display:grid!important;
  place-items:center!important;
  width:48px!important;
  height:48px!important;
  border-radius:14px!important;
  background:#edf6ff!important;
  color:#1d6fe9!important;
  font-weight:1000!important;
}
.client1DiscountPercentInput::-webkit-outer-spin-button,
.client1DiscountPercentInput::-webkit-inner-spin-button{
  -webkit-appearance:none!important;
  margin:0!important;
}




/* ===== Sales invoice freeze fix styles ===== */
.invoiceCatalogLimitNotice td{
  background:#fff8e8!important;
  color:#8a6200!important;
  font-weight:1000!important;
  text-align:center!important;
  padding:16px!important;
}
.salesInvoiceErrorPanel{
  border:1px solid #ffd2d2!important;
  background:linear-gradient(135deg,#fff,#fff7f7)!important;
}
.salesInvoiceErrorPanel h3{
  color:#102542;
  font-size:28px;
  margin:0 0 10px;
}
.salesInvoiceErrorPanel pre{
  direction:ltr;
  text-align:left;
  white-space:pre-wrap;
  background:#fff;
  border:1px solid #f1d2d2;
  border-radius:16px;
  padding:14px;
  color:#b42318;
  max-height:220px;
  overflow:auto;
}



/* ===== Client 1 category discounts look like invoice ===== */
.client1InvoiceLikeDiscountPanel{
  margin:16px 0 22px!important;
}
.client1InvoiceLikeDiscountPanel .panelHead{
  margin-bottom:14px!important;
}
.client1InvoiceLikeGrid{
  grid-template-columns:repeat(5,minmax(0,1fr));
}
.client1InvoiceLikeCard{
  min-height:unset;
}
.client1InvoiceLikeCard input,
.client1InvoiceLikeInput{
  width:100%!important;
  height:52px!important;
  min-height:52px!important;
  border:1px solid #d3e1ef!important;
  border-radius:14px!important;
  background:#f9fcff!important;
  padding:0 14px!important;
  text-align:center!important;
  font-weight:1000!important;
  color:#0e253f!important;
  font-size:18px!important;
  direction:ltr!important;
  box-sizing:border-box!important;
}
.client1InvoiceLikeCard input:focus,
.client1InvoiceLikeInput:focus{
  border-color:#67d9ef!important;
  box-shadow:0 0 0 5px rgba(103,217,239,.18)!important;
  outline:none!important;
}
.client1InvoiceLikeCard span{
  display:block!important;
  width:auto!important;
  height:auto!important;
  border-radius:0!important;
  background:transparent!important;
  color:#64748b!important;
  margin-top:7px!important;
  font-size:12px!important;
  font-weight:900!important;
}
@media(max-width:1200px){
  .client1InvoiceLikeGrid{grid-template-columns:repeat(3,minmax(0,1fr));}
}
@media(max-width:800px){
  .client1InvoiceLikeGrid{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media(max-width:560px){
  .client1InvoiceLikeGrid{grid-template-columns:1fr;}
}



/* ===== Make Client 1 discount cards visible like invoice ===== */
.client1InvoiceLikeDiscountPanel{
  margin:16px 0 22px!important;
  min-height:0!important;
}
.client1InvoiceLikeDiscountPanel .panelHead{
  margin-bottom:16px!important;
}
.client1InvoiceLikeGrid{
  display:grid!important;
  grid-template-columns:repeat(5,minmax(0,1fr))!important;
  gap:12px!important;
}
.client1InvoiceLikeCard{
  display:block!important;
  border:1px solid #dbe4f0!important;
  border-radius:18px!important;
  background:#fff!important;
  padding:14px!important;
  min-height:142px!important;
  box-shadow:0 6px 14px rgba(15,23,42,.04)!important;
}
.client1InvoiceLikeCard label{
  display:block!important;
  font-weight:900!important;
  color:#0f172a!important;
  margin-bottom:8px!important;
  text-align:center!important;
}
.client1InvoiceLikeCard input,
.client1InvoiceLikeInput{
  display:block!important;
  width:100%!important;
  height:52px!important;
  min-height:52px!important;
  border:1px solid #d3e1ef!important;
  border-radius:14px!important;
  background:#f9fcff!important;
  padding:0 14px!important;
  text-align:center!important;
  font-weight:1000!important;
  color:#0e253f!important;
  font-size:18px!important;
  direction:ltr!important;
  box-sizing:border-box!important;
}
.client1InvoiceLikeCard input:focus,
.client1InvoiceLikeInput:focus{
  border-color:#67d9ef!important;
  box-shadow:0 0 0 5px rgba(103,217,239,.18)!important;
  outline:none!important;
}
.client1InvoiceLikeCard span{
  display:block!important;
  text-align:center!important;
  margin-top:7px!important;
  color:#64748b!important;
  font-size:12px!important;
  font-weight:900!important;
  background:transparent!important;
  width:auto!important;
  height:auto!important;
  border-radius:0!important;
}
@media(max-width:1200px){
  .client1InvoiceLikeGrid{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
}
@media(max-width:800px){
  .client1InvoiceLikeGrid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
}
@media(max-width:560px){
  .client1InvoiceLikeGrid{grid-template-columns:1fr!important;}
}




/* ===== Client 2 category discount cards like Client 1/invoice ===== */
.client2MainFormGrid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:18px;
  margin-bottom:22px;
}
.client2MainFormGrid label,
.client2NotesRow label{
  display:block;
  color:#667991;
  font-weight:1000;
  margin-bottom:8px;
}
.client2InvoiceLikeDiscountPanel{
  margin:16px 0 22px!important;
  min-height:0!important;
}
.client2InvoiceLikeDiscountPanel .panelHead{
  margin-bottom:16px!important;
}
.client2InvoiceLikeGrid{
  display:grid!important;
  grid-template-columns:repeat(5,minmax(0,1fr))!important;
  gap:12px!important;
}
.client2InvoiceLikeCard{
  display:block!important;
  border:1px solid #dbe4f0!important;
  border-radius:18px!important;
  background:#fff!important;
  padding:14px!important;
  min-height:142px!important;
  box-shadow:0 6px 14px rgba(15,23,42,.04)!important;
}
.client2InvoiceLikeCard label{
  display:block!important;
  font-weight:900!important;
  color:#0f172a!important;
  margin-bottom:8px!important;
  text-align:center!important;
}
.client2InvoiceLikeCard input,
.client2InvoiceLikeInput{
  display:block!important;
  width:100%!important;
  height:52px!important;
  min-height:52px!important;
  border:1px solid #d3e1ef!important;
  border-radius:14px!important;
  background:#f9fcff!important;
  padding:0 14px!important;
  text-align:center!important;
  font-weight:1000!important;
  color:#0e253f!important;
  font-size:18px!important;
  direction:ltr!important;
  box-sizing:border-box!important;
}
.client2InvoiceLikeCard input:focus,
.client2InvoiceLikeInput:focus{
  border-color:#67d9ef!important;
  box-shadow:0 0 0 5px rgba(103,217,239,.18)!important;
  outline:none!important;
}
.client2InvoiceLikeCard span{
  display:block!important;
  text-align:center!important;
  margin-top:7px!important;
  color:#64748b!important;
  font-size:12px!important;
  font-weight:900!important;
  background:transparent!important;
  width:auto!important;
  height:auto!important;
  border-radius:0!important;
}
.client2NotesRow{
  margin-bottom:18px;
}
.client2NotesRow input{
  width:100%;
}
.client2DiscountSummaryCell{
  min-width:360px;
  color:#526985;
  font-weight:850;
  line-height:1.7;
}
.client2Table th,
.client2Table td{
  vertical-align:middle;
}
@media(max-width:1200px){
  .client2InvoiceLikeGrid{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
}
@media(max-width:1100px){
  .client2MainFormGrid{grid-template-columns:1fr 1fr}
}
@media(max-width:800px){
  .client2InvoiceLikeGrid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
}
@media(max-width:720px){
  .client2MainFormGrid{grid-template-columns:1fr}
}
@media(max-width:560px){
  .client2InvoiceLikeGrid{grid-template-columns:1fr!important;}
}




/* ===== Force Client 2 custom discount-card page styles ===== */
.client2MainFormGrid{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:18px!important;
  margin-bottom:22px!important;
}
.client2MainFormGrid label,
.client2NotesRow label{
  display:block!important;
  color:#667991!important;
  font-weight:1000!important;
  margin-bottom:8px!important;
}
.client2InvoiceLikeDiscountPanel{
  margin:16px 0 22px!important;
  min-height:0!important;
}
.client2InvoiceLikeDiscountPanel .panelHead{
  margin-bottom:16px!important;
}
.client2InvoiceLikeGrid{
  display:grid!important;
  grid-template-columns:repeat(5,minmax(0,1fr))!important;
  gap:12px!important;
}
.client2InvoiceLikeCard{
  display:block!important;
  border:1px solid #dbe4f0!important;
  border-radius:18px!important;
  background:#fff!important;
  padding:14px!important;
  min-height:142px!important;
  box-shadow:0 6px 14px rgba(15,23,42,.04)!important;
}
.client2InvoiceLikeCard label{
  display:block!important;
  font-weight:900!important;
  color:#0f172a!important;
  margin-bottom:8px!important;
  text-align:center!important;
}
.client2InvoiceLikeCard input,
.client2InvoiceLikeInput{
  display:block!important;
  width:100%!important;
  height:52px!important;
  min-height:52px!important;
  border:1px solid #d3e1ef!important;
  border-radius:14px!important;
  background:#f9fcff!important;
  padding:0 14px!important;
  text-align:center!important;
  font-weight:1000!important;
  color:#0e253f!important;
  font-size:18px!important;
  direction:ltr!important;
  box-sizing:border-box!important;
}
.client2InvoiceLikeCard input:focus,
.client2InvoiceLikeInput:focus{
  border-color:#67d9ef!important;
  box-shadow:0 0 0 5px rgba(103,217,239,.18)!important;
  outline:none!important;
}
.client2InvoiceLikeCard span{
  display:block!important;
  text-align:center!important;
  margin-top:7px!important;
  color:#64748b!important;
  font-size:12px!important;
  font-weight:900!important;
  background:transparent!important;
  width:auto!important;
  height:auto!important;
  border-radius:0!important;
}
.client2NotesRow{
  margin-bottom:18px!important;
}
.client2NotesRow input{
  width:100%!important;
}
.client2DiscountSummaryCell{
  min-width:360px;
  color:#526985;
  font-weight:850;
  line-height:1.7;
}
.client2Table th,
.client2Table td{
  vertical-align:middle;
}
@media(max-width:1200px){
  .client2InvoiceLikeGrid{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
}
@media(max-width:1100px){
  .client2MainFormGrid{grid-template-columns:1fr 1fr!important;}
}
@media(max-width:800px){
  .client2InvoiceLikeGrid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
}
@media(max-width:720px){
  .client2MainFormGrid{grid-template-columns:1fr!important;}
}
@media(max-width:560px){
  .client2InvoiceLikeGrid{grid-template-columns:1fr!important;}
}




/* ===== Home dashboard + powerful control dashboard ===== */
.powerDashboardHero{
  background:linear-gradient(135deg,#102542,#116b7d 55%,#18a7c9)!important;
  color:#fff;
}
.powerDashboardHero h2,
.powerDashboardHero p,
.powerDashboardHero span{
  color:#fff!important;
}
.powerBackupPanel{
  border:1px solid #cfe4f4!important;
  background:linear-gradient(135deg,#fff,#f5fbff)!important;
}
.powerDataActions{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
}
.powerActionCard{
  border:none;
  border-radius:22px;
  padding:18px;
  min-height:142px;
  text-align:right;
  cursor:pointer;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:8px;
  font-family:inherit;
  color:#102542;
  background:#f3f8ff;
  box-shadow:0 12px 24px rgba(15,35,64,.06);
  text-decoration:none;
}
.powerActionCard span{
  width:48px;
  height:48px;
  border-radius:16px;
  display:grid;
  place-items:center;
  background:rgba(255,255,255,.75);
  font-size:24px;
}
.powerActionCard strong{
  font-size:20px;
  font-weight:1000;
}
.powerActionCard small{
  color:#60758f;
  font-weight:800;
  line-height:1.6;
}
.powerActionCard.green{background:linear-gradient(135deg,#ecfff8,#dffbef)}
.powerActionCard.blue{background:linear-gradient(135deg,#edf6ff,#dcecff)}
.powerActionCard.orange{background:linear-gradient(135deg,#fff8e8,#ffefd0)}
.powerActionCard.red{background:linear-gradient(135deg,#fff1f1,#ffe1e1)}
.powerFinanceList{
  display:grid;
  gap:12px;
}
.powerFinanceList div{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  border:1px solid #dce8f4;
  border-radius:16px;
  background:#f9fcff;
}
.powerFinanceList span{
  color:#64748b;
  font-weight:900;
}
.powerFinanceList strong{
  color:#0f766e;
  font-size:20px;
  font-weight:1000;
}
.powerSectionsGrid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}
.powerSectionCard{
  border:1px solid #dbe8f4;
  border-radius:24px;
  background:#fff;
  padding:16px;
  box-shadow:0 12px 28px rgba(15,35,64,.05);
}
.powerSectionTop{
  display:flex;
  align-items:center;
  gap:12px;
}
.powerSectionTop > span{
  width:50px;
  height:50px;
  border-radius:16px;
  display:grid;
  place-items:center;
  background:#eef6ff;
  font-size:24px;
}
.powerSectionTop strong{
  display:block;
  color:#102542;
  font-size:20px;
  font-weight:1000;
}
.powerSectionTop small{
  display:block;
  color:#71849b;
  font-weight:900;
  margin-top:3px;
}
.powerSectionTop em{
  margin-inline-start:auto;
  border-radius:999px;
  padding:7px 11px;
  font-style:normal;
  font-weight:1000;
  font-size:12px;
}
.powerSectionTop em.on{
  background:#e8fff5;
  color:#047857;
}
.powerSectionTop em.off{
  background:#fff1f1;
  color:#b42318;
}
.powerSectionCount{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:10px;
  margin:14px 0;
  padding:14px;
  border-radius:18px;
  background:#f7fbff;
  border:1px solid #e0edf8;
}
.powerSectionCount b{
  color:#102542;
  font-size:30px;
  font-weight:1000;
}
.powerSectionCount small{
  color:#7488a0;
  font-weight:900;
}
.powerSwitchGrid{
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:6px;
  margin-bottom:12px;
}
.powerSwitchGrid button{
  border:1px solid #d7e4f1;
  background:#f8fbff;
  border-radius:12px;
  padding:9px 4px;
  color:#667991;
  font-family:inherit;
  font-weight:1000;
  cursor:pointer;
}
.powerSwitchGrid button.active{
  background:#e8f8ff;
  border-color:#67d9ef;
  color:#087da0;
}
.powerSectionActions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.powerSectionActions .btn{
  padding:10px 12px;
}
.powerAdvancedDetails summary{
  cursor:pointer;
  font-size:22px;
  font-weight:1000;
  color:#102542;
  padding:12px 0;
}
@media(max-width:1250px){
  .powerDataActions{grid-template-columns:repeat(2,minmax(0,1fr))}
  .powerSectionsGrid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:760px){
  .powerDataActions,
  .powerSectionsGrid{grid-template-columns:1fr}
  .powerSwitchGrid{grid-template-columns:repeat(3,1fr)}
}




/* ===== Dashboard owner access fix styles ===== */
.accessDeniedPanel{
  border-color:#dbe8f4!important;
}




/* ===== Settings page fix styles ===== */
.settingsGrid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px;
  margin-bottom:18px;
}
.settingsGrid label{
  display:block;
  color:#667991;
  font-weight:1000;
  margin-bottom:8px;
}
.settingsGrid input{
  width:100%;
}
.settingsDataActions{
  grid-template-columns:repeat(4,minmax(0,1fr));
}
.settingsTableWrap{
  overflow:auto;
  border:1px solid #dbe8f3;
  border-radius:18px;
}
.settingsSectionsTable{
  width:100%;
  border-collapse:collapse;
  min-width:850px;
}
.settingsSectionsTable th,
.settingsSectionsTable td{
  padding:13px 14px;
  border-bottom:1px solid #e5eef7;
  text-align:right;
}
.settingsSectionsTable th{
  background:#f1f7ff;
  color:#102542;
  font-weight:1000;
}
.settingsSectionsTable small{
  color:#71849b;
  font-weight:850;
}
@media(max-width:900px){
  .settingsGrid,
  .settingsDataActions{
    grid-template-columns:1fr;
  }
}




/* ===== Client 2 statement section styles ===== */
.client2StatementPage .supplierStatementBalance strong{
  color:#087f73;
}
.client2StatementCard.active{
  border-color:#1bbfe7!important;
  box-shadow:0 16px 35px rgba(25,170,210,.16)!important;
}
.client2StatementTable th,
.client2StatementTable td{
  white-space:nowrap;
}
@media print{
  .client2StatementPage .supplierAccountsPanel,
  .client2StatementPage .supplierStatementStats{
    display:none!important;
  }
}




/* ===== Inventory Item Card section styles ===== */
.itemCardSelector,
.itemCardDetailsPanel{
  margin-top:22px;
}
.itemCardSearchBar{
  margin:12px 0 16px;
}
.itemCardSearchBar .search{
  max-width:520px;
}
.itemCardSelectGrid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
  max-height:380px;
  overflow:auto;
  padding:4px;
}
.itemCardSelectCard{
  border:1px solid #dbe8f4;
  border-radius:18px;
  background:#fff;
  padding:14px;
  text-align:right;
  font-family:inherit;
  cursor:pointer;
  box-shadow:0 8px 18px rgba(15,35,64,.04);
}
.itemCardSelectCard.active{
  border-color:#1bbfe7;
  background:#f2fbff;
  box-shadow:0 16px 35px rgba(25,170,210,.14);
}
.itemCardSelectCard span{
  display:block;
  color:#102542;
  font-weight:1000;
  line-height:1.5;
}
.itemCardSelectCard small{
  display:block;
  color:#71849b;
  font-weight:850;
  margin:6px 0;
}
.itemCardSelectCard strong{
  color:#0f766e;
  font-size:22px;
  font-weight:1000;
}
.itemCardSelectCard em{
  float:left;
  font-style:normal;
  padding:5px 10px;
  border-radius:999px;
  background:#eef6ff;
  color:#1d6fe9;
  font-weight:1000;
}
.itemCardHeader{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  border-bottom:1px solid #dfeaf5;
  padding-bottom:16px;
  margin-bottom:16px;
}
.itemCardHeader span{
  display:inline-flex;
  padding:8px 14px;
  border-radius:999px;
  background:#eef6ff;
  color:#1d6fe9;
  font-weight:1000;
}
.itemCardHeader h3{
  margin:12px 0 6px;
  font-size:34px;
  color:#102542;
}
.itemCardHeader p{
  margin:0;
  color:#6a7d94;
  font-weight:900;
}
.itemCardStatus{
  min-width:140px;
  border-radius:18px;
  padding:14px;
  text-align:center;
}
.itemCardStatus small{
  display:block;
  color:#60758f;
  font-weight:900;
}
.itemCardStatus strong{
  display:block;
  font-size:24px;
  font-weight:1000;
}
.itemCardStatus.ok{background:#e8fff5;color:#047857}
.itemCardStatus.warn{background:#fff8e5;color:#a16207}
.itemCardStatus.bad{background:#fff1f1;color:#b42318}
.itemCardInfoGrid{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:12px;
  margin-bottom:18px;
}
.itemCardInfoGrid div{
  border:1px solid #dbe8f4;
  border-radius:18px;
  padding:14px;
  background:#f9fcff;
}
.itemCardInfoGrid span{
  display:block;
  color:#6a7d94;
  font-weight:900;
  margin-bottom:7px;
}
.itemCardInfoGrid strong{
  display:block;
  color:#102542;
  font-weight:1000;
}
.itemCardToolbar{
  gap:12px;
  align-items:center;
}
.itemCardToolbar .search{
  flex:1;
  min-width:280px;
}
.itemCardTableWrap{
  overflow:auto;
  border:1px solid #dbe8f4;
  border-radius:18px;
}
.itemCardMovementTable{
  width:100%;
  border-collapse:collapse;
  min-width:980px;
}
.itemCardMovementTable th,
.itemCardMovementTable td{
  border-bottom:1px solid #e4eef7;
  padding:12px 14px;
  text-align:right;
  vertical-align:middle;
}
.itemCardMovementTable th{
  background:#f1f7ff;
  color:#102542;
  font-weight:1000;
}
.itemCardMovementTable tr:hover td{
  background:#fbfdff;
}
.emptyItemCard{
  text-align:center;
  padding:38px;
}
@media(max-width:1200px){
  .itemCardSelectGrid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .itemCardInfoGrid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:800px){
  .itemCardSelectGrid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .itemCardInfoGrid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:560px){
  .itemCardSelectGrid,.itemCardInfoGrid{grid-template-columns:1fr}
  .itemCardHeader{display:block}
}
@media print{
  body.itemCardPrintMode .noPrint,
  body.itemCardPrintMode .itemCardSelector,
  body.itemCardPrintMode .itemCardKpis{
    display:none!important;
  }
  body.itemCardPrintMode .itemCardDetailsPanel{
    box-shadow:none!important;
    border:none!important;
  }
}




/* ===== Item Card entry date style ===== */
.itemCardEntryDateBox{
  border:1px solid #dbe8f4;
  border-radius:18px;
  padding:14px;
  background:linear-gradient(135deg,#f9fcff,#eef8ff);
}
.itemCardEntryDateBox span{
  display:block;
  color:#6a7d94;
  font-weight:900;
  margin-bottom:7px;
}
.itemCardEntryDateBox strong{
  display:block;
  color:#0f766e;
  font-weight:1000;
}
.itemCardEntryDateLine{
  margin-top:6px!important;
  color:#6a7d94!important;
  font-weight:900!important;
}
.itemCardEntryDateLine strong{
  color:#0f766e!important;
}




/* ===== Compact print size for Item Card ===== */
@media print{
  @page{
    size:A4 portrait;
    margin:7mm;
  }

  body.itemCardPrintMode{
    background:#fff!important;
  }

  body.itemCardPrintMode *{
    box-shadow:none!important;
  }

  body.itemCardPrintMode header,
  body.itemCardPrintMode .appHeader,
  body.itemCardPrintMode .pageHeader,
  body.itemCardPrintMode .topNav,
  body.itemCardPrintMode .navBackForward,
  body.itemCardPrintMode .menuButton,
  body.itemCardPrintMode .floatingMenu,
  body.itemCardPrintMode .noPrint,
  body.itemCardPrintMode .itemCardSelector,
  body.itemCardPrintMode .itemCardKpis,
  body.itemCardPrintMode .itemCardToolbar{
    display:none!important;
  }

  body.itemCardPrintMode #content,
  body.itemCardPrintMode main,
  body.itemCardPrintMode .page,
  body.itemCardPrintMode .screen,
  body.itemCardPrintMode .itemCardPage{
    width:100%!important;
    max-width:100%!important;
    margin:0!important;
    padding:0!important;
    background:#fff!important;
  }

  body.itemCardPrintMode .itemCardDetailsPanel{
    width:100%!important;
    max-width:190mm!important;
    margin:0 auto!important;
    padding:8mm!important;
    border:1px solid #102542!important;
    border-radius:6mm!important;
    background:#fff!important;
    page-break-inside:auto!important;
    font-size:10px!important;
  }

  body.itemCardPrintMode .itemCardHeader{
    padding-bottom:6px!important;
    margin-bottom:8px!important;
    border-bottom:1px solid #d8e2ee!important;
    gap:8px!important;
  }

  body.itemCardPrintMode .itemCardHeader span{
    padding:4px 9px!important;
    font-size:10px!important;
  }

  body.itemCardPrintMode .itemCardHeader h3{
    font-size:22px!important;
    margin:5px 0 3px!important;
    line-height:1.25!important;
  }

  body.itemCardPrintMode .itemCardHeader p,
  body.itemCardPrintMode .itemCardEntryDateLine{
    font-size:10px!important;
    margin:2px 0!important;
    line-height:1.4!important;
  }

  body.itemCardPrintMode .itemCardStatus{
    min-width:90px!important;
    padding:7px!important;
    border-radius:10px!important;
  }

  body.itemCardPrintMode .itemCardStatus small{
    font-size:9px!important;
  }

  body.itemCardPrintMode .itemCardStatus strong{
    font-size:14px!important;
  }

  body.itemCardPrintMode .itemCardInfoGrid{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:6px!important;
    margin-bottom:8px!important;
  }

  body.itemCardPrintMode .itemCardInfoGrid div,
  body.itemCardPrintMode .itemCardEntryDateBox{
    padding:7px!important;
    border-radius:9px!important;
  }

  body.itemCardPrintMode .itemCardInfoGrid span,
  body.itemCardPrintMode .itemCardEntryDateBox span{
    font-size:9px!important;
    margin-bottom:3px!important;
  }

  body.itemCardPrintMode .itemCardInfoGrid strong,
  body.itemCardPrintMode .itemCardEntryDateBox strong{
    font-size:11px!important;
  }

  body.itemCardPrintMode .itemCardTableWrap{
    border-radius:8px!important;
    overflow:visible!important;
  }

  body.itemCardPrintMode .itemCardMovementTable{
    width:100%!important;
    min-width:0!important;
    table-layout:fixed!important;
    border-collapse:collapse!important;
  }

  body.itemCardPrintMode .itemCardMovementTable th,
  body.itemCardPrintMode .itemCardMovementTable td{
    padding:4px 5px!important;
    font-size:8.5px!important;
    line-height:1.25!important;
    white-space:normal!important;
    word-break:break-word!important;
    border:1px solid #d9e4ee!important;
  }

  body.itemCardPrintMode .itemCardMovementTable th{
    background:#eef4fb!important;
    color:#102542!important;
    font-weight:900!important;
  }

  body.itemCardPrintMode .itemCardMovementTable th:nth-child(1),
  body.itemCardPrintMode .itemCardMovementTable td:nth-child(1){
    width:5%!important;
  }

  body.itemCardPrintMode .itemCardMovementTable th:nth-child(2),
  body.itemCardPrintMode .itemCardMovementTable td:nth-child(2){
    width:10%!important;
  }

  body.itemCardPrintMode .itemCardMovementTable th:nth-child(3),
  body.itemCardPrintMode .itemCardMovementTable td:nth-child(3){
    width:12%!important;
  }

  body.itemCardPrintMode .itemCardMovementTable th:nth-child(4),
  body.itemCardPrintMode .itemCardMovementTable td:nth-child(4){
    width:10%!important;
  }

  body.itemCardPrintMode .itemCardMovementTable th:nth-child(5),
  body.itemCardPrintMode .itemCardMovementTable td:nth-child(5){
    width:13%!important;
  }

  body.itemCardPrintMode .itemCardMovementTable th:nth-child(6),
  body.itemCardPrintMode .itemCardMovementTable td:nth-child(6),
  body.itemCardPrintMode .itemCardMovementTable th:nth-child(7),
  body.itemCardPrintMode .itemCardMovementTable td:nth-child(7),
  body.itemCardPrintMode .itemCardMovementTable th:nth-child(8),
  body.itemCardPrintMode .itemCardMovementTable td:nth-child(8),
  body.itemCardPrintMode .itemCardMovementTable th:nth-child(9),
  body.itemCardPrintMode .itemCardMovementTable td:nth-child(9){
    width:9%!important;
  }

  body.itemCardPrintMode .itemCardMovementTable th:nth-child(10),
  body.itemCardPrintMode .itemCardMovementTable td:nth-child(10){
    width:14%!important;
  }
}




/* ===== Final professional client names style ===== */
.navItem .title,
.moduleCard h4,
.panelHead h3{
  overflow-wrap:anywhere;
}




/* ===== Consumer customer final location guard ===== */
[data-hidden-from-sales="true"]{
  display:none!important;
}




/* ===== Mega Therm Offers & Campaigns full system styles ===== */
.offerTabs{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin:0 0 18px;
}
.offerTab{
  border:1px solid #dbe8f4;
  background:#fff;
  color:#102542;
  border-radius:18px;
  padding:12px 18px;
  font-weight:1000;
  font-family:inherit;
  cursor:pointer;
  box-shadow:0 12px 24px rgba(15,35,64,.06);
}
.offerTab span{
  margin-left:8px;
}
.offerTab.active{
  color:#fff;
  border-color:#19a8e8;
  background:linear-gradient(135deg,#1eb8f0,#1768df);
  box-shadow:0 18px 35px rgba(25,132,220,.22);
}
.offersHeroPanel,
.offersResultsHero{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  background:linear-gradient(135deg,#ffffff,#eef8ff);
  border:1px solid #dcecf8;
}
.offerHeroLabel{
  display:inline-flex;
  align-items:center;
  gap:8px;
  border-radius:999px;
  padding:8px 14px;
  color:#1266c4;
  background:#eaf6ff;
  font-weight:1000;
}
.offersHeroPanel h2,
.offersResultsHero h2{
  margin:10px 0 6px;
  color:#102542;
  font-size:32px;
}
.offersHeroPanel p,
.offersResultsHero p{
  margin:0;
  color:#6b7d93;
  font-weight:900;
}
.offersFilterPanel .toolbar{
  align-items:center;
}
.offersFilterPanel select,
.offersResultSelect select{
  min-width:190px;
}
.offerCardsGrid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px;
}
.offerCampaignCard{
  display:grid;
  grid-template-columns:245px 1fr;
  gap:18px;
  border:1px solid #dbe8f4;
  border-radius:26px;
  padding:16px;
  background:#fff;
  box-shadow:0 18px 45px rgba(16,37,66,.08);
  overflow:hidden;
}
.offerCampaignCard.stopped{
  opacity:.76;
  filter:saturate(.7);
}
.offerPosterWrap{
  position:relative;
  min-height:300px;
  border-radius:22px;
  overflow:hidden;
  background:#06152b;
}
.offerPosterWrap img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.offerPosterZoom{
  position:absolute;
  inset:auto 12px 12px 12px;
  border:0;
  border-radius:14px;
  padding:10px 12px;
  background:rgba(16,37,66,.88);
  color:#fff;
  font-family:inherit;
  font-weight:1000;
  cursor:pointer;
  backdrop-filter:blur(8px);
}
.offerCardBody h3{
  margin:12px 0 6px;
  color:#102542;
  font-size:26px;
}
.offerCardBody p{
  margin:0 0 12px;
  color:#65788f;
  font-weight:900;
}
.offerCardTop{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}
.offerTypeBadge,
.offerStatus{
  display:inline-flex;
  align-items:center;
  gap:6px;
  border-radius:999px;
  padding:7px 11px;
  font-weight:1000;
  font-size:13px;
}
.offerTypeBadge{
  color:#1266c4;
  background:#eaf6ff;
}
.offerStatus.active{
  color:#047857;
  background:#e9fff5;
}
.offerStatus.stopped{
  color:#b42318;
  background:#fff1f1;
}
.offerMetaGrid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  margin:14px 0;
}
.offerMetaGrid div{
  border:1px solid #e1edf7;
  border-radius:16px;
  padding:10px;
  background:#f9fcff;
}
.offerMetaGrid span{
  display:block;
  color:#71849b;
  font-weight:900;
  font-size:12px;
  margin-bottom:5px;
}
.offerMetaGrid strong{
  display:block;
  color:#102542;
  font-weight:1000;
}
.offerTierList{
  display:grid;
  gap:8px;
}
.offerTierList div{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  border:1px solid #dbe8f4;
  border-radius:14px;
  padding:9px 12px;
  background:#fbfdff;
}
.offerTierList div.grand{
  border-color:#f3c85d;
  background:linear-gradient(135deg,#fff9e8,#fff);
}
.offerTierList b{
  color:#0e7490;
  font-weight:1000;
}
.offerTierList span{
  color:#102542;
  font-weight:950;
}
.offerActions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:14px;
}
.offersFormGrid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:16px;
}
.offersFormGrid .full{
  grid-column:1/-1;
}
.offersFormGrid label{
  display:block;
  color:#60758f;
  font-weight:1000;
  margin-bottom:7px;
}
.offersFormGrid input,
.offersFormGrid select,
.offersFormGrid textarea{
  width:100%;
}
.offersFormGrid textarea{
  resize:vertical;
  min-height:92px;
}
.offerPreviewBox{
  margin-top:18px;
}
.offerPreviewBox .offerCampaignCard{
  max-width:980px;
}
.offersTableWrap{
  overflow:auto;
  border:1px solid #dbe8f4;
  border-radius:18px;
}
.offersManagerTable,
.offersResultsTable{
  width:100%;
  border-collapse:collapse;
  min-width:850px;
}
.offersManagerTable th,
.offersManagerTable td,
.offersResultsTable th,
.offersResultsTable td{
  border-bottom:1px solid #e5eef7;
  padding:13px 14px;
  text-align:right;
  vertical-align:middle;
}
.offersManagerTable th,
.offersResultsTable th{
  background:#f1f7ff;
  color:#102542;
  font-weight:1000;
}
.offersManagerTable small{
  color:#70839a;
  font-weight:850;
}
.offersResultSelect label{
  display:block;
  color:#60758f;
  font-weight:1000;
  margin-bottom:7px;
}
.selectedOfferResultCard{
  display:grid;
  grid-template-columns:180px 1fr;
  gap:18px;
  align-items:stretch;
}
.selectedOfferMiniPoster{
  border-radius:18px;
  overflow:hidden;
  background:#07172c;
  min-height:230px;
}
.selectedOfferMiniPoster img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.selectedOfferResultInfo span{
  display:inline-flex;
  padding:7px 12px;
  border-radius:999px;
  color:#1266c4;
  background:#eaf6ff;
  font-weight:1000;
}
.selectedOfferResultInfo h3{
  margin:12px 0 6px;
  color:#102542;
  font-size:30px;
}
.selectedOfferResultInfo p{
  margin:0;
  color:#667991;
  font-weight:900;
}
.offerProgress{
  height:12px;
  min-width:140px;
  border-radius:999px;
  background:#eaf2fb;
  overflow:hidden;
}
.offerProgress span{
  display:block;
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,#1eb8f0,#1768df);
}
.offersKpis{
  margin-bottom:18px;
}
@media(max-width:1100px){
  .offerCardsGrid{
    grid-template-columns:1fr;
  }
  .offersFormGrid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media(max-width:760px){
  .offersHeroPanel,
  .offersResultsHero,
  .selectedOfferResultCard{
    display:block;
  }
  .offerCampaignCard{
    grid-template-columns:1fr;
  }
  .offerPosterWrap{
    height:420px;
  }
  .offersFormGrid{
    grid-template-columns:1fr;
  }
  .offerMetaGrid{
    grid-template-columns:1fr;
  }
}
@media print{
  .offerTabs,
  .offersFilterPanel,
  .offersHeroPanel .actions,
  .offerActions,
  .noPrint{
    display:none!important;
  }
  .offerCampaignCard{
    box-shadow:none!important;
    border:1px solid #cbd8e6!important;
    break-inside:avoid;
  }
}




/* ===== Home inside sections menu style ===== */
.homeNavGroup .navGroupTitle{
  background:linear-gradient(90deg,#eef8ff,#ffffff)!important;
}




/* ===== Back to home fix visual hint ===== */
.sectionHistoryBar button[data-history="back"]:not(:disabled){
  cursor:pointer;
}




/* ===== Home shortcut settings moved to Dashboard ===== */
body:not(.dashboardPage) .dashboardShortcutSettings.movedFromHome{
  display:none!important;
}




/* ===== Section editor save persistence fix styles ===== */
.dashboardEditorPanel .sectionControlActions .btn.primary{
  box-shadow:0 14px 30px rgba(24,126,230,.18);
}




/* ===== Ultimate section name edit fix styles ===== */
#dashboardSectionEditor input[id$="_title"]:focus,
#dashboardSectionEditor input[id$="_group"]:focus,
#dashboardSectionEditor input[id$="_icon"]:focus,
#dashboardSectionEditor input[id$="_subtitle"]:focus{
  border-color:#1fb6e9!important;
  box-shadow:0 0 0 4px rgba(31,182,233,.12)!important;
}




/* ===== Specialized Inspections Report styles ===== */
.inspectionReportHero{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  background:linear-gradient(135deg,#ffffff,#eef8ff);
  border:1px solid #dbeaf7;
}
.inspectionReportBadge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 14px;
  border-radius:999px;
  background:#eaf6ff;
  color:#1266c4;
  font-weight:1000;
}
.inspectionReportHero h2{
  margin:10px 0 6px;
  color:#102542;
  font-size:30px;
}
.inspectionReportHero p{
  margin:0;
  color:#6a7d94;
  font-weight:900;
}
.inspectionReportFiltersGrid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
}
.inspectionReportFiltersGrid .wide{
  grid-column:span 2;
}
.inspectionReportFilters label{
  display:block;
  color:#60758f;
  font-weight:1000;
  margin-bottom:7px;
}
.inspectionReportFilters select,
.inspectionReportFilters input{
  width:100%;
}
.inspectionReportFilters .actions{
  margin-top:16px;
}
.inspectionReportKpis{
  margin-top:18px;
  margin-bottom:18px;
}
.inspectionReportPanel{
  margin-top:18px;
}
.inspectionReportTableWrap{
  overflow:auto;
  border:1px solid #dbe8f4;
  border-radius:18px;
}
.inspectionReportTable{
  width:100%;
  min-width:1120px;
  border-collapse:collapse;
}
.inspectionReportTable th,
.inspectionReportTable td{
  padding:12px 13px;
  border-bottom:1px solid #e5eef7;
  text-align:right;
  vertical-align:middle;
  white-space:nowrap;
}
.inspectionReportTable th{
  background:#f1f7ff;
  color:#102542;
  font-weight:1000;
}
.inspectionReportTable td{
  color:#20364f;
  font-weight:850;
}
.inspectionReportTable tr:hover td{
  background:#fbfdff;
}
@media(max-width:1100px){
  .inspectionReportFiltersGrid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media(max-width:700px){
  .inspectionReportHero{
    display:block;
  }
  .inspectionReportFiltersGrid{
    grid-template-columns:1fr;
  }
  .inspectionReportFiltersGrid .wide{
    grid-column:auto;
  }
}
@media print{
  body.inspectionReportPrintMode .noPrint,
  body.inspectionReportPrintMode .menuButton,
  body.inspectionReportPrintMode .sectionHistoryBar{
    display:none!important;
  }
  body.inspectionReportPrintMode .inspectionReportHero,
  body.inspectionReportPrintMode .panel{
    box-shadow:none!important;
    border:1px solid #d8e3ee!important;
  }
  body.inspectionReportPrintMode .inspectionReportTable{
    min-width:0!important;
    font-size:9px!important;
  }
  body.inspectionReportPrintMode .inspectionReportTable th,
  body.inspectionReportPrintMode .inspectionReportTable td{
    padding:5px!important;
    white-space:normal!important;
  }
}




/* ===== Installation Inspections calculated for Technician styles ===== */
.iiHero{display:flex;align-items:center;justify-content:space-between;gap:18px;background:linear-gradient(135deg,#fff,#eef8ff);border:1px solid #dbeaf7}.iiBadge{display:inline-flex;align-items:center;gap:8px;padding:8px 14px;border-radius:999px;background:#eaf6ff;color:#1266c4;font-weight:1000}.iiHero h2{margin:10px 0 6px;color:#102542;font-size:32px}.iiHero p{margin:0;color:#667991;font-weight:900}.iiFormula{min-width:260px;border-radius:22px;padding:18px;background:linear-gradient(135deg,#123a61,#1489aa);color:#fff;box-shadow:0 18px 35px rgba(18,82,122,.18)}.iiFormula small{display:block;opacity:.85;font-weight:900;margin-bottom:6px}.iiFormula strong{display:block;font-size:20px;font-weight:1000}.iiFormPanel,.iiFilters,.iiPanel{margin-top:18px}.iiFormGrid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.iiFormGrid .wide{grid-column:span 2}.iiFormGrid .full{grid-column:1/-1}.iiFormGrid label,.iiFilters label{display:block;color:#60758f;font-weight:1000;margin-bottom:7px}.iiFormGrid input,.iiFormGrid select,.iiFormGrid textarea,.iiFilters input,.iiFilters select{width:100%}.iiLinesHead{display:flex;justify-content:space-between;align-items:center;gap:16px;margin:20px 0 12px}.iiLinesHead h4{margin:0;color:#102542;font-size:22px}.iiLinesHead p{margin:5px 0 0;color:#6c7e94;font-weight:850}.iiLinesWrap,.iiTableWrap{overflow:auto;border:1px solid #dbe8f4;border-radius:18px}.iiLinesTable,.iiTable{width:100%;min-width:1080px;border-collapse:collapse}.iiLinesTable th,.iiLinesTable td,.iiTable th,.iiTable td{border-bottom:1px solid #e5eef7;padding:10px 11px;text-align:right;vertical-align:middle;white-space:nowrap}.iiLinesTable th,.iiTable th{background:#f1f7ff;color:#102542;font-weight:1000}.iiLinesTable input{min-width:90px}.iiLinesTable .ii_name{min-width:220px}.ii_net_cell{font-weight:1000;color:#0f766e}.iiTotalsBox{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:16px 0}.iiTotalsBox div{border:1px solid #dbe8f4;border-radius:18px;padding:14px;background:#f9fcff}.iiTotalsBox span{display:block;color:#6a7d94;font-weight:900;margin-bottom:6px}.iiTotalsBox strong{display:block;color:#102542;font-weight:1000}.iiFiltersGrid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px}.iiFilters .actions{margin-top:14px}.iiKpis{margin-top:18px;margin-bottom:18px}.miniBtn{padding:8px 10px!important;min-height:auto!important}@media(max-width:1150px){.iiFormGrid,.iiFiltersGrid,.iiTotalsBox{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:720px){.iiHero,.iiLinesHead{display:block}.iiFormula{margin-top:14px}.iiFormGrid,.iiFiltersGrid,.iiTotalsBox{grid-template-columns:1fr}.iiFormGrid .wide{grid-column:auto}}@media print{body.iiPrintMode .noPrint,body.iiPrintMode .menuButton,body.iiPrintMode .sectionHistoryBar,body.iiPrintMode .iiFilters,body.iiPrintMode .iiFormPanel .actions{display:none!important}body.iiPrintMode .panel{box-shadow:none!important;border:1px solid #d8e3ee!important}body.iiPrintMode .iiTable,body.iiPrintMode .iiLinesTable{min-width:0!important;font-size:8.5px!important}body.iiPrintMode .iiTable th,body.iiPrintMode .iiTable td,body.iiPrintMode .iiLinesTable th,body.iiPrintMode .iiLinesTable td{padding:4px!important;white-space:normal!important}}







/* ===== Hide old clients import notice; clients are normal manual entries now ===== */
.clients2026ImportNotice{
  display:none!important;
}




/* ===== HARD FIX clients are normal entries, no import banner ===== */
.clients2026ImportNotice{
  display:none!important;
}




/* ===== V231 Cash Treasury Statement: canonical screen + scoped print only ===== */
.cashTreasuryFiltersV231{border-inline-start:5px solid #0f766e!important}
.cashTreasuryFilterGridV231{grid-template-columns:repeat(6,minmax(150px,1fr))!important;align-items:end}
.cashTreasuryFilterGridV231 label{display:block;font-weight:900;margin-bottom:6px;color:#334155}
.cashTreasuryFilterGridV231 input,.cashTreasuryFilterGridV231 select{width:100%}
.cashTreasuryOutputV231{display:grid;gap:12px}
.cashTreasuryReportV231{overflow:hidden}
.cashTreasuryStatsV231{margin:12px 0}
.cashTreasuryFilterSummaryV231{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin:12px 0;padding:10px 12px;border-radius:12px;background:#f8fafc;border:1px solid #e2e8f0;color:#334155}
.cashTreasuryFilterSummaryV231 b{color:#0f766e}
.cashTreasuryFilterSummaryV231 small{width:100%;color:#64748b;font-weight:800}
.cashTreasuryTableWrapV231{overflow:auto;border:1px solid #e2e8f0;border-radius:14px}
.cashTreasuryTableV231{min-width:1280px;width:100%;border-collapse:collapse}
.cashTreasuryTableV231 th,.cashTreasuryTableV231 td{padding:10px 8px;border-bottom:1px solid #e2e8f0;text-align:center;vertical-align:top}
.cashTreasuryTableV231 th{background:#eff6ff;color:#0f3b66;font-weight:1000;white-space:nowrap}
.cashTreasuryTableV231 tbody tr:hover{background:#f8fafc}
.cashTreasuryTableV231 tfoot th{background:#e0f2fe;color:#0f3b66}
.cashTreasuryNegativeCellV231{color:#b91c1c!important;font-weight:1000;background:#fef2f2!important}
.cashTreasuryAlertV231{display:flex;align-items:center;justify-content:space-between;gap:14px;border-inline-start:5px solid transparent!important}
.cashTreasuryAlertV231>div{display:grid;gap:4px}
.cashTreasuryAlertErrorV231{border-inline-start-color:#dc2626!important;background:#fef2f2!important;color:#7f1d1d}
.cashTreasuryAlertOkV231{border-inline-start-color:#16a34a!important;background:#f0fdf4!important;color:#166534}
.cashTreasuryEmptyV231{text-align:center;padding:28px!important}
.cashTreasuryEmptyV231 h2,.cashTreasuryEmptyV231 h3{margin-top:0}
.cashTreasuryPrintHeaderV231{display:none}
.cashTreasuryPrintOnlyV231{display:none}

@media(max-width:1250px){.cashTreasuryFilterGridV231{grid-template-columns:repeat(3,minmax(180px,1fr))!important}}
@media(max-width:760px){.cashTreasuryFilterGridV231{grid-template-columns:1fr!important}.cashTreasuryAlertV231{display:grid}.cashTreasuryStatsV231{grid-template-columns:1fr 1fr!important}}

@media print{
  body.cashTreasuryPrintV231{background:#fff!important;direction:rtl!important;-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}
  body.cashTreasuryPrintV231 *{visibility:hidden!important}
  body.cashTreasuryPrintV231 #ct_output,body.cashTreasuryPrintV231 #ct_output *{visibility:visible!important}
  body.cashTreasuryPrintV231 #ct_output{position:absolute!important;inset:0!important;width:100%!important;max-width:none!important;margin:0!important;padding:0!important}
  body.cashTreasuryPrintV231 .cashTreasuryNoPrintV231{display:none!important}
  body.cashTreasuryPrintV231 .cashTreasuryPrintOnlyV231{display:inline!important}
  body.cashTreasuryPrintV231 .cashTreasuryPrintHeaderV231{display:grid!important;grid-template-columns:150px 1fr 250px;align-items:center;gap:14px;border:1px solid #cbd5e1;border-radius:12px;padding:10px 14px;margin-bottom:10px;background:#fff!important}
  body.cashTreasuryPrintV231 .cashTreasuryPrintLogoV231{text-align:center}
  body.cashTreasuryPrintV231 .cashTreasuryPrintLogoV231 img{max-height:58px;max-width:135px;object-fit:contain}
  body.cashTreasuryPrintV231 .cashTreasuryPrintHeaderV231 h1{margin:0;color:#0f3b66;font-size:24px;text-align:center}
  body.cashTreasuryPrintV231 .cashTreasuryPrintHeaderV231 p{margin:4px 0 0;text-align:center;color:#475569;font-size:11px;font-weight:800}
  body.cashTreasuryPrintV231 .cashTreasuryPrintMetaV231{font-size:10px;line-height:1.8;color:#334155}
  body.cashTreasuryPrintV231 .cashTreasuryAlertV231{padding:7px 10px!important;margin:6px 0!important;font-size:10px!important;page-break-inside:avoid!important;break-inside:avoid!important}
  body.cashTreasuryPrintV231 .cashTreasuryReportV231{box-shadow:none!important;border:1px solid #cbd5e1!important;border-radius:10px!important;padding:9px!important}
  body.cashTreasuryPrintV231 .cashTreasuryReportV231 .panelHead{margin-bottom:6px!important}
  body.cashTreasuryPrintV231 .cashTreasuryReportV231 .panelHead h3{font-size:17px!important;margin:0!important}
  body.cashTreasuryPrintV231 .cashTreasuryReportV231 .miniText{font-size:9px!important}
  body.cashTreasuryPrintV231 .cashTreasuryStatsV231{display:grid!important;grid-template-columns:repeat(4,1fr)!important;gap:6px!important;margin:6px 0!important}
  body.cashTreasuryPrintV231 .cashTreasuryStatsV231 .stat{padding:7px!important;min-height:auto!important;border-radius:8px!important}
  body.cashTreasuryPrintV231 .cashTreasuryStatsV231 span{font-size:9px!important}
  body.cashTreasuryPrintV231 .cashTreasuryStatsV231 strong{font-size:14px!important}
  body.cashTreasuryPrintV231 .cashTreasuryFilterSummaryV231{display:none!important}
  body.cashTreasuryPrintV231 .cashTreasuryTableWrapV231{overflow:visible!important;border:0!important}
  body.cashTreasuryPrintV231 .cashTreasuryTableV231{min-width:0!important;width:100%!important;table-layout:fixed!important;font-size:8.5px!important}
  body.cashTreasuryPrintV231 .cashTreasuryTableV231 th,body.cashTreasuryPrintV231 .cashTreasuryTableV231 td{padding:4px 3px!important;font-size:8.5px!important;white-space:normal!important;overflow-wrap:anywhere!important}
  body.cashTreasuryPrintV231 .cashTreasuryTableV231 th:nth-child(1){width:8%}
  body.cashTreasuryPrintV231 .cashTreasuryTableV231 th:nth-child(2){width:8%}
  body.cashTreasuryPrintV231 .cashTreasuryTableV231 th:nth-child(3){width:10%}
  body.cashTreasuryPrintV231 .cashTreasuryTableV231 th:nth-child(4){width:9%}
  body.cashTreasuryPrintV231 .cashTreasuryTableV231 th:nth-child(5){width:10%}
  body.cashTreasuryPrintV231 .cashTreasuryTableV231 th:nth-child(6){width:15%}
  body.cashTreasuryPrintV231 .cashTreasuryTableV231 th:nth-child(7){width:16%}
  body.cashTreasuryPrintV231 .cashTreasuryTableV231 th:nth-child(8),body.cashTreasuryPrintV231 .cashTreasuryTableV231 th:nth-child(9),body.cashTreasuryPrintV231 .cashTreasuryTableV231 th:nth-child(10){width:8%}
  body.cashTreasuryPrintV231 .cashTreasuryTableV231 tr{page-break-inside:avoid!important;break-inside:avoid!important}
}

/* ===== Sales Invoice Review Fixes ===== */
.salesInvoicesModernFix > .salesInvoiceHiddenStats,
.salesInvoicesModernFix > .grid4:first-child{
  display:none!important;
}
.salesInvoicesModernFix .invoiceCategoryDiscountPanel{
  display:block!important;
}
.salesInvoicesModernFix #invoiceDefaultDiscount{
  pointer-events:none;
}
.salesInvoicesModernFix #invoiceDefaultDiscount.closestHidden{}
.salesInvoicesModernFix .invoiceCustomerFormGrid > div:has(#invoiceDefaultDiscount){
  display:none!important;
}
.autoInvoiceNoInput{
  background:#eef8ff!important;
  color:#102542!important;
  font-weight:1000!important;
  cursor:not-allowed;
}
.extraDiscountInvoiceCard small{
  font-weight:1000;
  color:#9a6400!important;
}
.salesInvoiceInlineCardRTL{
  direction:rtl!important;
  text-align:right!important;
}
.salesInvoiceInlineCardRTL .inlineQtyControls{
  direction:rtl!important;
  justify-content:flex-start!important;
}
.inlineModeButtonCol{
  min-width:210px;
}
.invoiceModeButtons{
  display:flex;
  gap:8px;
  padding:6px;
  border:1px solid #dbe8f4;
  border-radius:16px;
  background:#f8fbff;
}
.invoiceModeBtn{
  border:0;
  border-radius:12px;
  padding:11px 18px;
  background:#fff;
  color:#58708b;
  font-weight:1000;
  cursor:pointer;
  min-width:82px;
}
.invoiceModeBtn.active{
  background:linear-gradient(135deg,#0b57d0,#14b8d4);
  color:#fff;
  box-shadow:0 10px 22px rgba(11,87,208,.18);
}
.stockOutRow{
  opacity:.72;
  background:#fff7f7!important;
}
.stockOutRow td{
  color:#9f1d1d!important;
}
#salesInvoiceToastBox{
  position:fixed;
  top:20px;
  left:20px;
  z-index:999999;
  display:grid;
  gap:10px;
  width:min(360px,calc(100vw - 40px));
  direction:rtl;
}
.salesInvoiceToast{
  transform:translateY(-12px);
  opacity:0;
  transition:.22s ease;
  border-radius:18px;
  padding:14px 16px;
  background:#102542;
  color:#fff;
  box-shadow:0 18px 42px rgba(15,35,64,.18);
  font-weight:1000;
}
.salesInvoiceToast.show{
  transform:translateY(0);
  opacity:1;
}
.salesInvoiceToast.danger{
  background:#b91c1c;
}
.packingStatementNotice{
  margin:14px 0;
  padding:12px 16px;
  border-radius:16px;
  background:#eef8ff;
  border:1px solid #d5e9fb;
  color:#153d72;
  font-weight:1000;
  text-align:center;
}
.packingStatementTable th,
.packingStatementTable td{
  text-align:center!important;
}
.packingStatementFooter{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin:16px 0;
}
.packingStatementFooter div{
  border:1px solid #dbe8f4;
  border-radius:16px;
  padding:12px 14px;
  background:#f8fbff;
  display:flex;
  justify-content:space-between;
  gap:12px;
  font-weight:1000;
}
.packingStatementFooter span{
  color:#60758f;
}
.packingStatementFooter strong{
  color:#102542;
}
.invoiceRegisteredActions .btn.orange,
.btn.orange{
  background:#fff7e6!important;
  color:#9a6400!important;
  border:1px solid #f1c96d!important;
}
@media print{
  body.invoicePrintMode .packingStatementNotice{
    background:#fff!important;
    border:1px solid #dbe8f4!important;
  }
}




/* ===== Restore category discount in sales invoices ===== */
.salesInvoicesModernFix .invoiceCategoryDiscountPanel,
.invoiceCategoryDiscountPanel{
  display:block!important;
  visibility:visible!important;
  opacity:1!important;
}
.salesInvoicesModernFix .invoiceCategoryDiscountPanel input{
  pointer-events:auto!important;
}
.salesInvoicesModernFix .invoiceCategoryDiscountPanel::before{
  content:"خصومات التصنيف";
  display:block;
  margin:0 0 10px;
  color:#102542;
  font-size:20px;
  font-weight:1000;
}




/* ===== Correct Packing Statement: no prices, RTL customer data, clear items ===== */
.cleanPackingPreviewPanel{
  margin-top:20px;
}
.cleanPackingPaper{
  direction:rtl;
  background:#fff;
  border:2px solid #102542;
  border-radius:22px;
  padding:18px;
  color:#102542;
  box-shadow:0 18px 40px rgba(15,35,64,.10);
}
.psHeader{
  display:grid;
  grid-template-columns:1.1fr 1.4fr .9fr;
  gap:12px;
  align-items:stretch;
  background:linear-gradient(135deg,#102542,#173b62);
  border-radius:18px;
  padding:14px;
  color:#fff;
}
.psCompany,
.psTitle,
.psStatus{
  border:1px solid rgba(255,255,255,.18);
  border-radius:16px;
  padding:12px;
  background:rgba(255,255,255,.06);
}
.psLogoGroup{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:10px;
}
.psLogoGroup img{
  width:56px;
  height:42px;
  object-fit:contain;
  border-radius:12px;
  background:#fff;
  padding:5px;
}
.psCompany strong,
.psCompany span{
  display:block;
}
.psCompany strong{
  font-size:15px;
  font-weight:1000;
}
.psCompany span{
  margin-top:5px;
  color:rgba(255,255,255,.82);
  font-weight:850;
}
.psTitle{
  text-align:center;
}
.psTitle h1{
  margin:0;
  font-size:42px;
  font-weight:1000;
  color:#fff;
}
.psTitle p{
  margin:8px 0;
  color:#cfe0f3;
  font-weight:900;
}
.psTitle b{
  display:inline-flex;
  padding:8px 18px;
  border-radius:999px;
  background:rgba(255,255,255,.12);
  color:#fff;
}
.psStatus{
  display:flex;
  flex-direction:column;
  justify-content:center;
  text-align:center;
  gap:10px;
}
.psStatus span{
  align-self:center;
  padding:8px 14px;
  border-radius:999px;
  background:#d9fae7;
  color:#087a4c;
  font-weight:1000;
}
.psStatus strong{
  color:#fff;
  font-size:18px;
}
.psNoMoneyNotice{
  margin:12px 0;
  padding:12px 16px;
  border-radius:16px;
  background:#eef8ff;
  border:1px solid #d5e9fb;
  color:#153d72;
  font-weight:1000;
  text-align:center;
}
.psCustomerGrid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
  margin-bottom:12px;
}
.psDataBox{
  border:1px solid #dbe8f4;
  background:#f8fbff;
  border-radius:14px;
  padding:10px 12px;
  text-align:right;
}
.psDataBox span{
  display:block;
  color:#60758f;
  font-weight:1000;
  font-size:12px;
  margin-bottom:5px;
}
.psDataBox strong{
  display:block;
  color:#102542;
  font-weight:1000;
  font-size:15px;
}
.psItemsTable{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
  border:1px solid #dbe8f4;
  border-radius:16px;
}
.psItemsTable th{
  background:#102542;
  color:#fff;
  padding:11px 10px;
  font-weight:1000;
  text-align:center;
}
.psItemsTable td{
  padding:12px 10px;
  border-bottom:1px solid #e5eef7;
  text-align:center;
  color:#102542;
  font-weight:900;
  background:#fff;
}
.psItemsTable tr:nth-child(even) td{
  background:#f7fbff;
}
.psIndex{
  color:#0b57d0!important;
}
.psCode{
  font-family:Tahoma,Arial,sans-serif;
  direction:ltr;
  font-weight:1000!important;
}
.psItemName{
  text-align:right!important;
  min-width:260px;
}
.psItemName strong{
  display:block;
  font-size:15px;
}
.psItemName small{
  display:block;
  margin-top:4px;
  color:#6d819a;
  font-weight:900;
}
.psEmpty{
  padding:30px!important;
  color:#789!important;
}
.psSummaryNoMoney{
  display:grid;
  grid-template-columns:180px 180px 1fr;
  gap:10px;
  margin:12px 0;
}
.psSummaryNoMoney > div{
  border:1px solid #dbe8f4;
  border-radius:14px;
  background:#f8fbff;
  padding:10px 12px;
}
.psSummaryNoMoney span{
  display:block;
  color:#60758f;
  font-weight:1000;
  margin-bottom:5px;
}
.psSummaryNoMoney strong{
  color:#102542;
  font-size:20px;
  font-weight:1000;
}
.psPackSummary > div{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.psPackChip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:7px 10px;
  border-radius:12px;
  background:#fff;
  border:1px solid #dbe8f4;
}
.psPackChip span{
  margin:0;
  color:#60758f;
}
.psPackChip strong{
  font-size:15px;
}
.psSignatures{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
  margin-top:14px;
}
.psSignatures div{
  min-height:62px;
  border:1px dashed #9bb5d1;
  border-radius:14px;
  padding:10px;
  background:#fbfdff;
  display:flex;
  align-items:flex-start;
  justify-content:flex-end;
}
.psSignatures span{
  color:#102542;
  font-weight:1000;
}
@media(max-width:1000px){
  .psHeader,
  .psCustomerGrid,
  .psSummaryNoMoney{
    grid-template-columns:1fr;
  }
}
@page{size:A4 landscape;margin:7mm}
@media print{
  body.invoicePrintMode .cleanPackingPreviewPanel > .panelHead{
    display:none!important;
  }
  body.invoicePrintMode .cleanPackingPaper{
    box-shadow:none!important;
    border-radius:12px!important;
    padding:10px!important;
  }
  body.invoicePrintMode .psHeader{
    grid-template-columns:1.05fr 1.5fr .9fr!important;
    gap:7px!important;
    padding:8px!important;
    border-radius:12px!important;
  }
  body.invoicePrintMode .psTitle h1{
    font-size:30px!important;
  }
  body.invoicePrintMode .psTitle p,
  body.invoicePrintMode .psCompany span{
    font-size:11px!important;
    margin:4px 0!important;
  }
  body.invoicePrintMode .psLogoGroup img{
    width:44px!important;
    height:32px!important;
  }
  body.invoicePrintMode .psNoMoneyNotice{
    padding:7px 10px!important;
    margin:8px 0!important;
    font-size:12px!important;
  }
  body.invoicePrintMode .psCustomerGrid{
    grid-template-columns:repeat(3,1fr)!important;
    gap:6px!important;
    margin-bottom:8px!important;
  }
  body.invoicePrintMode .psDataBox{
    padding:7px 9px!important;
    border-radius:10px!important;
  }
  body.invoicePrintMode .psDataBox span{
    font-size:10px!important;
    margin-bottom:3px!important;
  }
  body.invoicePrintMode .psDataBox strong{
    font-size:12px!important;
  }
  body.invoicePrintMode .psItemsTable th,
  body.invoicePrintMode .psItemsTable td{
    padding:6px 5px!important;
    font-size:10.5px!important;
  }
  body.invoicePrintMode .psItemName strong{
    font-size:11px!important;
  }
  body.invoicePrintMode .psItemName small{
    font-size:9px!important;
  }
  body.invoicePrintMode .psSummaryNoMoney{
    grid-template-columns:150px 150px 1fr!important;
    gap:6px!important;
    margin:8px 0!important;
  }
  body.invoicePrintMode .psSummaryNoMoney > div{
    padding:7px!important;
  }
  body.invoicePrintMode .psSignatures{
    gap:7px!important;
    margin-top:8px!important;
  }
  body.invoicePrintMode .psSignatures div{
    min-height:44px!important;
    padding:7px!important;
  }
}




/* ===== Packing Statement same invoice shape, no prices only ===== */
.packingSameInvoicePaper{
  direction:rtl;
}
.packingSameInvoicePaper .flatInvoiceHeader{
  margin-bottom:10px;
}
.packingSameInvoiceHeader .flatHeaderCenter h1{
  font-size:44px;
}
.packingSameInvoiceInfo{
  direction:rtl!important;
  grid-template-columns:repeat(3,1fr)!important;
}
.packingSameInvoiceInfo div{
  text-align:right!important;
}
.packingInfoCustomer{
  order:-6;
}
.packingSameNotice{
  margin:12px 0;
  padding:12px 16px;
  border-radius:16px;
  background:#eef8ff;
  border:1px solid #d5e9fb;
  color:#153d72;
  font-weight:1000;
  text-align:center;
}
.packingSameItemsTable{
  table-layout:fixed!important;
}
.packingSameItemsTable th,
.packingSameItemsTable td{
  text-align:center!important;
}
.packingSameItemsTable th:nth-child(3),
.packingSameItemsTable td:nth-child(3){
  width:30%!important;
  text-align:right!important;
}
.packingSameItemsTable th:nth-child(2),
.packingSameItemsTable td:nth-child(2){
  width:110px!important;
  direction:ltr;
}
.packingItemNameCell{
  font-weight:1000!important;
  color:#102542!important;
}
.packingSameInvoiceBottom{
  display:grid;
  grid-template-columns:1fr 260px 1fr;
  gap:12px;
  align-items:start;
  margin-top:12px;
}
.packingNoMoneyTotals{
  display:grid;
  gap:10px;
}
.packingNoMoneyTotals div{
  border:1px solid #dbe8f4;
  border-radius:14px;
  background:#f8fbff;
  padding:12px 14px;
  display:flex;
  justify-content:space-between;
  gap:12px;
  font-weight:1000;
}
.packingNoMoneyTotals b{
  color:#60758f;
}
.packingNoMoneyTotals span{
  color:#102542;
  font-size:20px;
}
.packingNoSummary{
  padding:12px;
  text-align:center;
  color:#789;
  font-weight:1000;
}
.packingSignatureSame{
  margin-top:0!important;
}
@media(max-width:1000px){
  .packingSameInvoiceInfo,
  .packingSameInvoiceBottom{
    grid-template-columns:1fr!important;
  }
}
@page{size:A4 landscape;margin:7mm}
@media print{
  body.invoicePrintMode .packingSameInvoicePreview > .panelHead{
    display:none!important;
  }
  body.invoicePrintMode .packingSameInvoicePaper{
    max-width:none!important;
    box-shadow:none!important;
    padding:10px!important;
  }
  body.invoicePrintMode .packingSameInvoiceInfo{
    grid-template-columns:repeat(3,1fr)!important;
    gap:5px!important;
  }
  body.invoicePrintMode .packingSameNotice{
    padding:7px 10px!important;
    margin:7px 0!important;
    font-size:11px!important;
  }
  body.invoicePrintMode .packingSameItemsTable th,
  body.invoicePrintMode .packingSameItemsTable td{
    padding:5px 4px!important;
    font-size:10px!important;
  }
  body.invoicePrintMode .packingSameInvoiceBottom{
    grid-template-columns:1fr 210px 1fr!important;
    gap:7px!important;
    margin-top:8px!important;
  }
  body.invoicePrintMode .packingNoMoneyTotals div{
    padding:7px 8px!important;
    border-radius:8px!important;
  }
  body.invoicePrintMode .packingNoMoneyTotals span{
    font-size:14px!important;
  }
}




/* ===== Packing Statement exact invoice layout final ===== */
.exactPackingInvoicePaper{
  direction:rtl;
}
.invoiceLikeCustomerInfo{
  direction:rtl!important;
  grid-template-columns:1fr 1fr!important;
}
.invoiceLikeCustomerInfo div{
  direction:rtl!important;
  text-align:right!important;
}
.exactPackingItemsTable{
  table-layout:fixed!important;
}
.exactPackingItemsTable th,
.exactPackingItemsTable td{
  text-align:center!important;
}
.exactPackingItemsTable th:nth-child(3),
.exactPackingItemsTable td:nth-child(3){
  width:34%!important;
  text-align:right!important;
}
.exactPackingItemsTable th:nth-child(2),
.exactPackingItemsTable td:nth-child(2){
  width:110px!important;
  direction:ltr!important;
}
.packingNameCell{
  font-weight:1000!important;
  color:#102542!important;
}
.packingCodeCell{
  font-weight:1000!important;
  color:#0b57d0!important;
}
.packingInvoiceBottomSame{
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:12px;
  align-items:start;
  margin-top:12px;
}
.packingInvoiceBottomSame .packingSignatureSame{
  margin-top:0!important;
}
.packingPrepNotesBox{
  border:1px solid #dbe8f4;
  border-radius:16px;
  background:#f8fbff;
  padding:14px 16px;
  min-height:112px;
  color:#102542;
}
.packingPrepNotesBox strong{
  display:block;
  font-size:17px;
  margin-bottom:12px;
  font-weight:1000;
}
.packingPrepNotesBox span{
  display:block;
  color:#789;
  line-height:2.2;
  font-weight:900;
}
.packingOnlySummaryRight{
  margin-top:0!important;
}
.packingSameInvoicePaper .packingNoMoneyTotals,
.cleanPackingPaper,
.psSummaryNoMoney{
  display:none!important;
}
@media(max-width:1000px){
  .packingInvoiceBottomSame,
  .invoiceLikeCustomerInfo{
    grid-template-columns:1fr!important;
  }
}
@page{size:A4 landscape;margin:7mm}
@media print{
  body.invoicePrintMode .packingSameInvoicePreview > .panelHead{
    display:none!important;
  }
  body.invoicePrintMode .exactPackingInvoicePaper{
    box-shadow:none!important;
    padding:10px!important;
    max-width:none!important;
  }
  body.invoicePrintMode .invoiceLikeCustomerInfo{
    grid-template-columns:1fr 1fr!important;
    gap:5px!important;
  }
  body.invoicePrintMode .packingSameNotice{
    padding:7px 10px!important;
    margin:7px 0!important;
    font-size:11px!important;
  }
  body.invoicePrintMode .exactPackingItemsTable th,
  body.invoicePrintMode .exactPackingItemsTable td{
    padding:5px 4px!important;
    font-size:10px!important;
  }
  body.invoicePrintMode .packingInvoiceBottomSame{
    grid-template-columns:1fr 1fr 1fr!important;
    gap:7px!important;
    margin-top:8px!important;
  }
  body.invoicePrintMode .packingPrepNotesBox{
    min-height:76px!important;
    padding:8px!important;
    border-radius:10px!important;
  }
  body.invoicePrintMode .packingPrepNotesBox strong{
    font-size:12px!important;
    margin-bottom:5px!important;
  }
  body.invoicePrintMode .packingPrepNotesBox span{
    line-height:1.8!important;
    font-size:9px!important;
  }
}




/* ===== Packing Statement bottom order like invoice ===== */
.packingInvoiceBottomSame{
  direction:ltr!important;
  grid-template-columns:1fr 1.35fr .95fr!important;
  grid-template-areas:"signatures notes packing"!important;
}
.packingInvoiceBottomSame .packingSignatureSame{
  grid-area:signatures!important;
  direction:rtl!important;
}
.packingInvoiceBottomSame .packingPrepNotesBox{
  grid-area:notes!important;
  direction:rtl!important;
}
.packingInvoiceBottomSame .packingOnlySummaryRight{
  grid-area:packing!important;
  direction:rtl!important;
}
.packingInvoiceBottomSame .flatSignatureRow{
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:8px!important;
}
.packingInvoiceBottomSame .signatureIconCard{
  min-height:64px!important;
}
.packingInvoiceBottomSame .packingPrepNotesBox{
  min-height:208px!important;
}
.packingInvoiceBottomSame .packingOnlySummaryRight{
  justify-self:stretch!important;
}
.packingInvoiceBottomSame .flatPackingBox{
  min-height:126px!important;
}
@media(max-width:1000px){
  .packingInvoiceBottomSame{
    direction:rtl!important;
    grid-template-columns:1fr!important;
    grid-template-areas:
      "packing"
      "notes"
      "signatures"!important;
  }
}
@media print{
  body.invoicePrintMode .packingInvoiceBottomSame{
    direction:ltr!important;
    grid-template-columns:1fr 1.35fr .95fr!important;
    grid-template-areas:"signatures notes packing"!important;
  }
  body.invoicePrintMode .packingInvoiceBottomSame .signatureIconCard{
    min-height:44px!important;
  }
  body.invoicePrintMode .packingInvoiceBottomSame .packingPrepNotesBox{
    min-height:142px!important;
  }
  body.invoicePrintMode .packingInvoiceBottomSame .flatPackingBox{
    min-height:82px!important;
  }
}




/* ===== Invoice totals one row + packing summary right ===== */

/* بيان التجهيز: إجمالي الكراتين والمواسير في اليمين */
.packingInvoiceBottomSame{
  direction:rtl!important;
  grid-template-columns:.95fr 1.35fr 1fr!important;
  grid-template-areas:"packing notes signatures"!important;
}
.packingInvoiceBottomSame .packingOnlySummaryRight{
  grid-area:packing!important;
  direction:rtl!important;
  order:1!important;
}
.packingInvoiceBottomSame .packingPrepNotesBox{
  grid-area:notes!important;
  direction:rtl!important;
  order:2!important;
}
.packingInvoiceBottomSame .packingSignatureSame{
  grid-area:signatures!important;
  direction:rtl!important;
  order:3!important;
}

/* الفاتورة العادية: إجمالي الفاتورة + خصم إضافي + صافي الفاتورة على صف واحد */
.flatInvoicePaper:not(.packingSameInvoicePaper) .flatInvoiceTotals,
.flatInvoicePaper:not(.packingSameInvoicePaper) .invoiceTotalsGrid,
.flatInvoicePaper:not(.packingSameInvoicePaper) .flatInvoiceTotalCards,
.flatInvoicePaper:not(.packingSameInvoicePaper) .invoiceSummaryTotals,
.flatInvoicePaper:not(.packingSameInvoicePaper) .flatTotalsGrid{
  display:grid!important;
  grid-template-columns:repeat(3,1fr)!important;
  gap:12px!important;
  align-items:stretch!important;
}

/* التقاط كروت الإجماليات حتى لو أسماء الكلاسات مختلفة */
.flatInvoicePaper:not(.packingSameInvoicePaper) .invoiceTotalBox,
.flatInvoicePaper:not(.packingSameInvoicePaper) .flatTotalBox,
.flatInvoicePaper:not(.packingSameInvoicePaper) .flatSummaryBox,
.flatInvoicePaper:not(.packingSameInvoicePaper) .invoiceExtraDiscountBox,
.flatInvoicePaper:not(.packingSameInvoicePaper) .invoiceNetTotalBox{
  min-height:74px!important;
  margin:0!important;
}

/* لو الكروت الحالية جاية داخل الكونتينر بعد جدول الخصم، اجبرها تبقى صف واحد */
.flatInvoicePaper:not(.packingSameInvoicePaper) .flatInvoiceItemsTable + .flatDiscountTable + div,
.flatInvoicePaper:not(.packingSameInvoicePaper) .flatDiscountTable + div{
  display:grid!important;
  grid-template-columns:repeat(3,1fr)!important;
  gap:12px!important;
  align-items:stretch!important;
}

/* منع كارت صافي الفاتورة إنه ينزل سطر لوحده */
.flatInvoicePaper:not(.packingSameInvoicePaper) [class*="Net"],
.flatInvoicePaper:not(.packingSameInvoicePaper) [class*="Total"],
.flatInvoicePaper:not(.packingSameInvoicePaper) [class*="Discount"]{
  max-width:none!important;
}

/* تحسين شكل الصف في المعاينة */
.flatInvoicePaper:not(.packingSameInvoicePaper) .invoiceTotalBox,
.flatInvoicePaper:not(.packingSameInvoicePaper) .flatTotalBox{
  border-radius:16px!important;
}

@media(max-width:1000px){
  .packingInvoiceBottomSame{
    grid-template-columns:1fr!important;
    grid-template-areas:
      "packing"
      "notes"
      "signatures"!important;
  }
}

@media print{
  body.invoicePrintMode .packingInvoiceBottomSame{
    direction:rtl!important;
    grid-template-columns:.95fr 1.35fr 1fr!important;
    grid-template-areas:"packing notes signatures"!important;
  }
  body.invoicePrintMode .flatInvoicePaper:not(.packingSameInvoicePaper) .flatInvoiceTotals,
  body.invoicePrintMode .flatInvoicePaper:not(.packingSameInvoicePaper) .invoiceTotalsGrid,
  body.invoicePrintMode .flatInvoicePaper:not(.packingSameInvoicePaper) .flatInvoiceTotalCards,
  body.invoicePrintMode .flatInvoicePaper:not(.packingSameInvoicePaper) .invoiceSummaryTotals,
  body.invoicePrintMode .flatInvoicePaper:not(.packingSameInvoicePaper) .flatTotalsGrid,
  body.invoicePrintMode .flatInvoicePaper:not(.packingSameInvoicePaper) .flatDiscountTable + div{
    display:grid!important;
    grid-template-columns:repeat(3,1fr)!important;
    gap:7px!important;
  }
}


.invoiceTotalsOneRowForce{
  display:grid!important;
  grid-template-columns:repeat(3,1fr)!important;
  gap:12px!important;
  align-items:stretch!important;
}
@media print{
  body.invoicePrintMode .invoiceTotalsOneRowForce{
    grid-template-columns:repeat(3,1fr)!important;
    gap:7px!important;
  }
}



/* ===== Fill empty space in packing statement with packing notes ===== */
.packingInvoiceBottomSame{
  direction: rtl !important;
  grid-template-columns: 1.08fr 1.75fr .92fr !important;
  grid-template-areas: "packing notes signatures" !important;
  column-gap: 14px !important;
  align-items: stretch !important;
}

.packingInvoiceBottomSame .packingOnlySummaryRight{
  grid-area: packing !important;
  align-self: stretch !important;
  min-width: 0 !important;
  height: 100% !important;
}

.packingInvoiceBottomSame .packingPrepNotesBox{
  grid-area: notes !important;
  align-self: stretch !important;
  min-width: 0 !important;
  width: 100% !important;
  max-width: none !important;
  flex: 1 1 auto !important;
  min-height: 100% !important;
}

.packingInvoiceBottomSame .packingPrepNotesBox .prepNotesBody,
.packingInvoiceBottomSame .packingPrepNotesBox .packingPrepNotesBody,
.packingInvoiceBottomSame .packingPrepNotesBox .notesBody{
  min-height: 165px !important;
}

.packingInvoiceBottomSame .packingSignatureSame{
  grid-area: signatures !important;
  align-self: stretch !important;
  min-width: 0 !important;
}

@media print{
  body.invoicePrintMode .packingInvoiceBottomSame{
    direction: rtl !important;
    grid-template-columns: 1.08fr 1.75fr .92fr !important;
    grid-template-areas: "packing notes signatures" !important;
    column-gap: 10px !important;
    align-items: stretch !important;
  }

  body.invoicePrintMode .packingInvoiceBottomSame .packingPrepNotesBox{
    width: 100% !important;
    max-width: none !important;
    min-height: 100% !important;
  }

  body.invoicePrintMode .packingInvoiceBottomSame .packingPrepNotesBox .prepNotesBody,
  body.invoicePrintMode .packingInvoiceBottomSame .packingPrepNotesBox .packingPrepNotesBody,
  body.invoicePrintMode .packingInvoiceBottomSame .packingPrepNotesBox .notesBody{
    min-height: 150px !important;
  }
}

@media (max-width: 1100px){
  .packingInvoiceBottomSame{
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "packing"
      "notes"
      "signatures" !important;
  }
}


/* ===== FORCE regular invoice preview totals on one row ===== */
.flatInvoicePaper:not(.packingSameInvoicePaper) .flatTotalsStrip.financialTotalsStrip.invoicePreviewExtraTotals{
  display:grid !important;
  grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  gap:12px !important;
  align-items:stretch !important;
}
.flatInvoicePaper:not(.packingSameInvoicePaper) .flatTotalsStrip.financialTotalsStrip.invoicePreviewExtraTotals.hasVatForPrint{
  grid-template-columns:repeat(4,minmax(0,1fr)) !important;
}
.flatInvoicePaper:not(.packingSameInvoicePaper) .flatTotalsStrip.financialTotalsStrip.invoicePreviewExtraTotals.noVatForPrint.noExtraDiscountForPrint{
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
}
.flatInvoicePaper:not(.packingSameInvoicePaper) .flatTotalsStrip.financialTotalsStrip.invoicePreviewExtraTotals > div{
  width:auto !important;
  min-width:0 !important;
  margin:0 !important;
}
@media print{
  body.invoicePrintMode .flatInvoicePaper:not(.packingSameInvoicePaper) .flatTotalsStrip.financialTotalsStrip.invoicePreviewExtraTotals{
    display:grid !important;
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:8px !important;
    align-items:stretch !important;
  }
  body.invoicePrintMode .flatInvoicePaper:not(.packingSameInvoicePaper) .flatTotalsStrip.financialTotalsStrip.invoicePreviewExtraTotals.hasVatForPrint{
    grid-template-columns:repeat(4,minmax(0,1fr)) !important;
  }
  body.invoicePrintMode .flatInvoicePaper:not(.packingSameInvoicePaper) .flatTotalsStrip.financialTotalsStrip.invoicePreviewExtraTotals.noVatForPrint.noExtraDiscountForPrint{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
}



/* ===== STRONG FIX: invoice preview totals one row + packing notes fill space ===== */

/* الفاتورة العادية: الإجماليات على صف واحد بالقوة */
.flatInvoicePaper:not(.packingSameInvoicePaper) .invoicePreviewTotalsThreeRow,
.flatInvoicePaper:not(.packingSameInvoicePaper) .flatTotalsStrip.financialTotalsStrip.invoicePreviewExtraTotals{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:12px!important;
  align-items:stretch!important;
  width:100%!important;
}
.flatInvoicePaper:not(.packingSameInvoicePaper) .invoicePreviewTotalsThreeRow.hasVatForPrint,
.flatInvoicePaper:not(.packingSameInvoicePaper) .flatTotalsStrip.financialTotalsStrip.invoicePreviewExtraTotals.hasVatForPrint{
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
}
.flatInvoicePaper:not(.packingSameInvoicePaper) .invoicePreviewTotalsThreeRow > div,
.flatInvoicePaper:not(.packingSameInvoicePaper) .flatTotalsStrip.financialTotalsStrip.invoicePreviewExtraTotals > div{
  width:auto!important;
  max-width:none!important;
  min-width:0!important;
  margin:0!important;
  min-height:82px!important;
}
.flatInvoicePaper:not(.packingSameInvoicePaper) .invoicePreviewTotalsThreeRow .invoiceNetPreviewCard,
.flatInvoicePaper:not(.packingSameInvoicePaper) .flatTotalsStrip.financialTotalsStrip.invoicePreviewExtraTotals > div:last-child{
  grid-column:auto!important;
}

/* إلغاء أي قواعد قديمة كانت بتخلي الإجماليات عمودين عند عدم وجود خصم */
.invoicePreviewExtraTotals.noVatForPrint.noExtraDiscountForPrint,
.flatInvoicePaper .invoicePreviewExtraTotals.noVatForPrint.noExtraDiscountForPrint,
.premiumInvoicePaper .invoicePreviewExtraTotals.noVatForPrint.noExtraDiscountForPrint{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
}
.invoicePreviewExtraTotals.noExtraDiscountForPrint .extraDiscountPrintCard{
  display:block!important;
}

/* بيان التجهيز: ملاحظات التجهيز تتمدد وتملأ الفراغ */
.packingInvoiceBottomSame,
.packingInvoiceBottomSame.packingNotesFilledFinal{
  display:grid!important;
  direction:rtl!important;
  grid-template-columns:.95fr 2.25fr .9fr!important;
  grid-template-areas:"packing notes signatures"!important;
  column-gap:12px!important;
  align-items:stretch!important;
}
.packingInvoiceBottomSame .packingOnlySummaryRight{
  grid-area:packing!important;
  width:100%!important;
  max-width:none!important;
  height:100%!important;
}
.packingInvoiceBottomSame .packingPrepNotesBox{
  grid-area:notes!important;
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  min-height:210px!important;
  height:100%!important;
}
.packingInvoiceBottomSame .packingSignatureSame{
  grid-area:signatures!important;
  width:100%!important;
  max-width:none!important;
  height:100%!important;
}
.packingInvoiceBottomSame .packingPrepNotesBox span{
  width:100%!important;
}
@media(max-width:1000px){
  .packingInvoiceBottomSame,
  .packingInvoiceBottomSame.packingNotesFilledFinal{
    grid-template-columns:1fr!important;
    grid-template-areas:
      "packing"
      "notes"
      "signatures"!important;
  }
}
@media print{
  body.invoicePrintMode .flatInvoicePaper:not(.packingSameInvoicePaper) .invoicePreviewTotalsThreeRow,
  body.invoicePrintMode .flatInvoicePaper:not(.packingSameInvoicePaper) .flatTotalsStrip.financialTotalsStrip.invoicePreviewExtraTotals{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:7px!important;
  }
  body.invoicePrintMode .flatInvoicePaper:not(.packingSameInvoicePaper) .invoicePreviewTotalsThreeRow.hasVatForPrint,
  body.invoicePrintMode .flatInvoicePaper:not(.packingSameInvoicePaper) .flatTotalsStrip.financialTotalsStrip.invoicePreviewExtraTotals.hasVatForPrint{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
  }
  body.invoicePrintMode .packingInvoiceBottomSame,
  body.invoicePrintMode .packingInvoiceBottomSame.packingNotesFilledFinal{
    grid-template-columns:.95fr 2.25fr .9fr!important;
    grid-template-areas:"packing notes signatures"!important;
    column-gap:8px!important;
  }
  body.invoicePrintMode .packingInvoiceBottomSame .packingPrepNotesBox{
    min-height:145px!important;
  }
}




/* ===== FINAL PACKING-ONLY FIX: hide notice + full preparation notes lines ===== */
.packingSameInvoicePaper .packingSameNotice,
.packingSameInvoicePaper .packingStatementNotice{
  display:none !important;
}

.packingSameInvoicePaper .packingPrepNotesBox{
  display:flex !important;
  flex-direction:column !important;
  justify-content:flex-start !important;
  align-items:stretch !important;
  padding:16px 18px !important;
  min-height:230px !important;
  height:100% !important;
  overflow:hidden !important;
}

.packingSameInvoicePaper .packingPrepNotesBox > strong{
  display:block !important;
  text-align:center !important;
  margin:0 0 12px 0 !important;
}

.packingSameInvoicePaper .packingPrepNotesBox .packingPrepNotesBody{
  display:flex !important;
  flex-direction:column !important;
  justify-content:space-between !important;
  gap:10px !important;
  flex:1 1 auto !important;
  width:100% !important;
  min-height:0 !important;
}

.packingSameInvoicePaper .packingPrepNotesBox .packingPrepNotesLine{
  display:block !important;
  width:100% !important;
  min-height:28px !important;
  border-bottom:2px dotted #8ea2ba !important;
}

/* اخفاء أي السطور القديمة لو ظهرت من تحديثات سابقة */
.packingSameInvoicePaper .packingPrepNotesBox > span{
  display:none !important;
}

@media print{
  body.invoicePrintMode .packingSameInvoicePaper .packingPrepNotesBox{
    min-height:200px !important;
    padding:14px 16px !important;
  }
  body.invoicePrintMode .packingSameInvoicePaper .packingPrepNotesBox .packingPrepNotesBody{
    gap:8px !important;
  }
  body.invoicePrintMode .packingSameInvoicePaper .packingPrepNotesBox .packingPrepNotesLine{
    min-height:24px !important;
  }
}




/* ===== Send sales invoice to customer via WhatsApp ===== */
.btn.whatsapp,
.invoiceWhatsAppPreviewBtn,
.invoiceWhatsAppRowBtn{
  background:#e9fbf2!important;
  color:#087a4c!important;
  border:1px solid #9fe3bd!important;
  font-weight:1000!important;
}
.btn.whatsapp::before,
.invoiceWhatsAppPreviewBtn::before,
.invoiceWhatsAppRowBtn::before{
  content:"📲";
  margin-left:6px;
}
.invoiceWhatsAppPreviewBtn{
  box-shadow:0 10px 22px rgba(16,166,106,.14);
}
@media print{
  body.invoicePrintMode .invoiceWhatsAppPreviewBtn,
  body.invoicePrintMode .invoiceWhatsAppRowBtn{
    display:none!important;
  }
}




/* ===== Send sales invoice PDF via WhatsApp workflow ===== */
.btn.whatsappPdf,
.invoiceWhatsAppPdfPreviewBtn,
.invoiceWhatsAppPdfRowBtn{
  background:#fff7e6!important;
  color:#9a6400!important;
  border:1px solid #f1c96d!important;
  font-weight:1000!important;
}
.btn.whatsappPdf::before,
.invoiceWhatsAppPdfPreviewBtn::before,
.invoiceWhatsAppPdfRowBtn::before{
  content:"📄";
  margin-left:6px;
}
.invoiceWhatsAppPdfPreviewBtn{
  box-shadow:0 10px 22px rgba(245,158,11,.14);
}
@media print{
  body.invoicePrintMode .invoiceWhatsAppPdfPreviewBtn,
  body.invoicePrintMode .invoiceWhatsAppPdfRowBtn{
    display:none!important;
  }
}




/* ===== Send sales invoice to customer via SMS ===== */
.btn.sms,
.invoiceSmsPreviewBtn,
.invoiceSmsRowBtn{
  background:#eef6ff!important;
  color:#0b57d0!important;
  border:1px solid #b8d5ef!important;
  font-weight:1000!important;
}
.btn.sms::before,
.invoiceSmsPreviewBtn::before,
.invoiceSmsRowBtn::before{
  content:"💬";
  margin-left:6px;
}
.invoiceSmsPreviewBtn{
  box-shadow:0 10px 22px rgba(11,87,208,.12);
}
@media print{
  body.invoicePrintMode .invoiceSmsPreviewBtn,
  body.invoicePrintMode .invoiceSmsRowBtn{
    display:none!important;
  }
}




/* ===== Direct SMS via local Twilio server ===== */
.btn.directSms,
.invoiceDirectSmsPreviewBtn,
.invoiceDirectSmsRowBtn{
  background:#e7f0ff!important;
  color:#0b57d0!important;
  border:1px solid #8cbcff!important;
  font-weight:1000!important;
}
.btn.directSms::before,
.invoiceDirectSmsPreviewBtn::before,
.invoiceDirectSmsRowBtn::before{
  content:"📡";
  margin-left:6px;
}
.invoiceDirectSmsPreviewBtn{
  box-shadow:0 10px 22px rgba(11,87,208,.14);
}
@media print{
  body.invoicePrintMode .invoiceDirectSmsPreviewBtn,
  body.invoicePrintMode .invoiceDirectSmsRowBtn{
    display:none!important;
  }
}




/* ===== Cleanup: remove WhatsApp PDF and Direct SMS buttons ===== */
.invoiceWhatsAppPdfPreviewBtn,
.invoiceWhatsAppPdfRowBtn,
.invoiceDirectSmsPreviewBtn,
.invoiceDirectSmsRowBtn,
.btn.whatsappPdf,
.btn.directSms{
  display:none!important;
}




/* ===== FINAL Cleanup: remove ALL SMS buttons and PDF WhatsApp buttons ===== */
.invoiceSmsPreviewBtn,
.invoiceSmsRowBtn,
.btn.sms,
.invoiceWhatsAppPdfPreviewBtn,
.invoiceWhatsAppPdfRowBtn,
.btn.whatsappPdf,
.invoiceDirectSmsPreviewBtn,
.invoiceDirectSmsRowBtn,
.btn.directSms{
  display:none!important;
}










/* ===== Distributor statement company logo/name header ===== */
.distributorStatementBrandBlock{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:16px!important;
  width:100%!important;
  margin-bottom:14px!important;
  direction:rtl!important;
}

.distributorStatementLogos{
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
  flex-wrap:wrap!important;
}

.distributorStatementLogos img,
.distributorStatementLogos .logoBox,
.distributorStatementLogos .flatLogoBox,
.distributorStatementLogos .invoiceLogoBox{
  width:58px!important;
  height:44px!important;
  object-fit:contain!important;
  background:#fff!important;
  border-radius:14px!important;
  padding:6px!important;
  box-shadow:0 8px 18px rgba(0,0,0,.16)!important;
}

.distributorStatementCompanyText{
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-start!important;
  justify-content:center!important;
  color:#fff!important;
}

.distributorStatementCompanyText strong{
  font-size:28px!important;
  font-weight:1000!important;
  line-height:1.1!important;
  color:#fff!important;
}

.distributorStatementCompanyText span{
  font-size:14px!important;
  font-weight:900!important;
  color:#dbeafe!important;
  margin-top:4px!important;
}

.statementLogoFallback{
  width:58px!important;
  height:44px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  background:#fff!important;
  color:#e11d48!important;
  font-size:10px!important;
  font-weight:1000!important;
  border-radius:14px!important;
}

@media print{
  body.invoicePrintMode .distributorStatementBrandBlock,
  body.printMode .distributorStatementBrandBlock{
    margin-bottom:10px!important;
  }
  body.invoicePrintMode .distributorStatementCompanyText strong,
  body.printMode .distributorStatementCompanyText strong{
    font-size:22px!important;
  }
}




/* ===== Distributor statement header logos only ===== */
.distributorStatementHeaderWithLogos{
  display:grid!important;
  grid-template-columns:minmax(260px,1fr) auto minmax(190px,240px)!important;
  align-items:center!important;
  gap:18px!important;
}
.distributorStatementTitleInfo{
  min-width:0!important;
}
.distributorStatementHeaderLogos{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-width:250px!important;
}
.distributorStatementHeaderLogos .flatInvoiceLogos{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:10px!important;
  flex-wrap:nowrap!important;
  margin:0!important;
}
.distributorStatementHeaderLogos .flatInvoiceLogos img{
  width:60px!important;
  height:48px!important;
  object-fit:contain!important;
  background:#fff!important;
  border-radius:14px!important;
  padding:6px!important;
  box-shadow:0 10px 22px rgba(0,0,0,.18)!important;
}
@media(max-width:900px){
  .distributorStatementHeaderWithLogos{
    grid-template-columns:1fr!important;
    text-align:center!important;
  }
  .distributorStatementHeaderLogos{
    min-width:0!important;
    order:2!important;
  }
  .distributorStatementHeaderWithLogos .supplierStatementBalance{
    width:100%!important;
    min-width:0!important;
  }
}
@media print{
  body.supplierStatementPrintMode .distributorStatementHeaderWithLogos{
    grid-template-columns:minmax(180px,1fr) auto minmax(150px,190px)!important;
    gap:10px!important;
  }
  body.supplierStatementPrintMode .distributorStatementHeaderLogos .flatInvoiceLogos img{
    width:42px!important;
    height:34px!important;
    border-radius:10px!important;
    padding:4px!important;
  }
}


/* Inspection rep signature upload */
.signatureUploadField{display:flex;flex-direction:column;gap:10px}
.signaturePreviewBox{min-height:72px;border:1px dashed #cbd8e8;border-radius:14px;background:#fff;display:flex;align-items:center;justify-content:center;gap:10px;color:#66758d;font-weight:900;padding:10px;text-align:center}
.signaturePreviewBox img{max-height:72px;max-width:190px;object-fit:contain;display:block}


/* ===== Mega Therm ERP - Admin Login Only ===== */
body.loginOnlyMode{
  overflow:hidden!important;
}
body.loginOnlyMode #login{
  display:grid!important;
}
body.loginOnlyMode #app,
body.loginOnlyMode .sectionMenuLauncher,
body.loginOnlyMode .sectionMenuBackdrop,
body.loginOnlyMode .sectionHistoryBar{
  display:none!important;
}
#login .megaLoginHint{
  display:block;
  margin-top:10px;
  color:#64748b;
  font-size:13px;
  font-weight:900;
  text-align:center;
}

/* ===== Sales invoices A4 portrait multi-page final override ===== */
@media print{
  @page{size:A4 portrait;margin:7mm}
  body.invoicePrintMode .flatInvoicePaper,
  body.invoicePrintMode .salesInvoicePaper{
    width:100%!important;
    max-width:none!important;
    min-height:auto!important;
    height:auto!important;
    overflow:visible!important;
    page-break-inside:auto!important;
    break-inside:auto!important;
  }
  body.invoicePrintMode .flatInvoiceHeader{
    page-break-inside:avoid!important;
    break-inside:avoid!important;
  }
  body.invoicePrintMode .flatInvoiceItemsTable{
    width:100%!important;
    page-break-inside:auto!important;
    break-inside:auto!important;
  }
  body.invoicePrintMode .flatInvoiceItemsTable tr{
    page-break-inside:avoid!important;
    break-inside:avoid!important;
  }
  body.invoicePrintMode .flatInvoiceFooterSideLayout,
  body.invoicePrintMode .flatTotalsStrip,
  body.invoicePrintMode .flatDiscountTable,
  body.invoicePrintMode .flatSignatureRow{
    page-break-inside:avoid!important;
    break-inside:avoid!important;
  }
}

/* ===== Clean A5 landscape receipt/payment voucher print ===== */
.mtPrintVoucher.mtPrintVoucherClean{
  width:210mm!important;height:148mm!important;min-height:148mm!important;box-sizing:border-box!important;
  margin:18px auto!important;padding:8mm 9mm 7mm!important;background:#fff!important;color:#102542!important;
  border:1.4px solid #11355e!important;border-radius:12px!important;box-shadow:0 18px 42px rgba(16,37,66,.12)!important;
  overflow:hidden!important;position:relative!important;direction:rtl!important;
}
.mtPrintVoucherClean .mtPVCornerMark{position:absolute;inset:5mm;border:1px solid #b9cde0;border-radius:10px;pointer-events:none}
.mtPrintVoucherClean .mtPVHeader{position:relative;z-index:2;display:grid;grid-template-columns:48mm 1fr 58mm;gap:5mm;align-items:start;margin-bottom:5mm;direction:ltr}
.mtPrintVoucherClean .mtPVMeta{display:grid;gap:2mm;direction:ltr}
.mtPrintVoucherClean .mtPVMetaItem{display:grid;grid-template-columns:18mm 1fr;min-height:12mm;border:1px solid #c5d8ea;border-radius:8px;overflow:hidden;background:#fff}
.mtPrintVoucherClean .mtPVMetaItem span{display:grid;place-items:center;background:#102542;color:#fff;font-size:12px;font-weight:1000;direction:rtl}
.mtPrintVoucherClean .mtPVMetaItem strong{display:grid;place-items:center;color:#102542;font-size:16px;font-weight:1000}
.mtPrintVoucherClean .mtPVTitleWrap{direction:rtl;text-align:center;padding-top:1mm}
.mtPrintVoucherClean .mtPVTitleWrap h1{margin:0;font-size:34px;line-height:1;color:#102542;font-weight:1000}
.mtPrintVoucherClean .mtPVTitleRule{width:68%;height:2px;margin:4mm auto 3mm;background:linear-gradient(90deg,transparent,#102542 18%,#0f7492 50%,#102542 82%,transparent)}
.mtPrintVoucherClean .mtPVCurrency{display:inline-flex;direction:ltr;align-items:center;overflow:hidden;border:1px solid #b8cadc;border-radius:8px}
.mtPrintVoucherClean .mtPVCurrency span,.mtPrintVoucherClean .mtPVCurrency b{min-width:20mm;height:10mm;display:grid;place-items:center;font-size:13px;font-weight:1000;padding:0 3mm}
.mtPrintVoucherClean .mtPVCurrency b{background:#102542;color:#fff}
.mtPrintVoucherClean .mtPVCompany{display:grid;grid-template-columns:16mm 1fr;gap:3mm;align-items:center;direction:ltr}
.mtPrintVoucherClean .mtPVCompanyLogo img,.mtPrintVoucherClean .mtPVCompany img{width:100%!important;max-width:16mm!important;max-height:13mm!important;object-fit:contain!important}
.mtPrintVoucherClean .mtPVCompanyText{direction:rtl;border-right:1px solid #102542;padding-right:3mm;text-align:right}
.mtPrintVoucherClean .mtPVCompanyText strong,.mtPrintVoucherClean .mtPVCompanyText small{display:block;color:#102542;font-weight:1000;line-height:1.35}
.mtPrintVoucherClean .mtPVCompanyText strong{font-size:15px}.mtPrintVoucherClean .mtPVCompanyText small{font-size:13px}
.mtPrintVoucherClean .mtPVBody{position:relative;z-index:2;display:grid;gap:2mm}
.mtPrintVoucherClean .mtPVRow{display:grid;grid-template-columns:43mm 1fr;min-height:11mm;border:1px solid #c5d8ea;border-radius:8px;overflow:hidden;background:#fff}
.mtPrintVoucherClean .mtPVRow label{display:flex;align-items:center;justify-content:flex-start;background:linear-gradient(180deg,#f8fbff,#eef5fb);color:#102542;font-size:13px;font-weight:1000;padding:0 4mm;border-left:1px solid #d4e2ef;white-space:nowrap}
.mtPrintVoucherClean .mtPVRow>div{display:flex;align-items:center;justify-content:flex-start;padding:0 4mm;color:#102542;font-size:14px;font-weight:900;text-align:right;line-height:1.35}
.mtPrintVoucherClean .mtPVAmountRow>div{font-size:18px;color:#0d2b55}.mtPrintVoucherClean .mtPVWordsRow>div{font-size:13px}
.mtPrintVoucherClean .mtPVPayMethods{width:100%;display:flex;align-items:center;justify-content:flex-start;gap:10mm}
.mtPrintVoucherClean .mtPrintRadio{display:inline-flex;align-items:center;gap:2mm;font-size:13px;font-weight:1000}
.mtPrintVoucherClean .mtPrintRadio i{width:4.5mm;height:4.5mm;border:1.5px solid #0f7492;border-radius:50%;position:relative}
.mtPrintVoucherClean .mtPrintRadio.checked i::after{content:"";position:absolute;inset:1mm;border-radius:50%;background:#102542}
.mtPrintVoucherClean .mtPVSignatureGrid{position:relative;z-index:2;display:grid;grid-template-columns:repeat(3,1fr);gap:8mm;margin-top:6mm;padding:0 6mm}
.mtPrintVoucherClean .mtPVSignCard{text-align:center;border-top:1.5px solid #102542;padding-top:3mm;min-height:18mm}
.mtPrintVoucherClean .mtPVSignCard span,.mtPrintVoucherClean .mtPVSignCard strong,.mtPrintVoucherClean .mtPVSignCard small{display:block}
.mtPrintVoucherClean .mtPVSignCard span{font-size:13px;font-weight:1000;color:#102542}.mtPrintVoucherClean .mtPVSignCard strong{margin-top:2mm;font-size:13px;font-weight:900;color:#5a6f87}.mtPrintVoucherClean .mtPVSignCard small{margin-top:1mm;font-size:11px;font-weight:850;color:#90a4b9}
@media print{
  @page{size:A5 landscape;margin:0}
  body.voucherPrintMode *{visibility:hidden!important}
  body.voucherPrintMode #voucherPrintCard,body.voucherPrintMode #voucherPrintCard *{visibility:visible!important}
  body.voucherPrintMode,body.voucherPrintMode main,body.voucherPrintMode #content,body.voucherPrintMode #voucherPreview{margin:0!important;padding:0!important;width:210mm!important;height:148mm!important;overflow:hidden!important;background:#fff!important}
  body.voucherPrintMode .mtPrintVoucher.mtPrintVoucherClean{position:absolute!important;inset:0!important;width:210mm!important;height:148mm!important;min-height:148mm!important;margin:0!important;border-radius:0!important;box-shadow:none!important;print-color-adjust:exact!important;-webkit-print-color-adjust:exact!important}
}

/* ===== Voucher A5 compact fit correction v3 ===== */
.mtPrintVoucher.mtPrintVoucherClean{
  width:210mm!important;
  height:148mm!important;
  min-height:148mm!important;
  padding:5mm 7mm 4.5mm!important;
  margin:16px auto!important;
  border-width:1.2px!important;
  border-radius:10px!important;
  box-shadow:0 14px 34px rgba(16,37,66,.11)!important;
}
.mtPrintVoucherClean .mtPVCornerMark{
  inset:2.8mm!important;
  border-color:#c4d5e5!important;
  border-radius:8px!important;
}
.mtPrintVoucherClean .mtPVHeader{
  grid-template-columns:40mm minmax(64mm,1fr) 51mm!important;
  gap:4mm!important;
  align-items:center!important;
  min-height:21mm!important;
  margin-bottom:2.8mm!important;
}
.mtPrintVoucherClean .mtPVMeta{gap:1.3mm!important;}
.mtPrintVoucherClean .mtPVMetaItem{
  grid-template-columns:15mm 1fr!important;
  min-height:8.8mm!important;
  height:8.8mm!important;
  border-radius:6px!important;
}
.mtPrintVoucherClean .mtPVMetaItem span{font-size:9.5px!important;}
.mtPrintVoucherClean .mtPVMetaItem strong{font-size:11px!important;}
.mtPrintVoucherClean .mtPVTitleWrap{padding-top:0!important;align-self:center!important;}
.mtPrintVoucherClean .mtPVTitleWrap h1{
  font-size:29px!important;
  line-height:1.05!important;
  letter-spacing:-.4px!important;
}
.mtPrintVoucherClean .mtPVTitleRule{
  width:62%!important;
  height:1.5px!important;
  margin:1.8mm auto 1.5mm!important;
}
.mtPrintVoucherClean .mtPVCurrency{border-radius:6px!important;}
.mtPrintVoucherClean .mtPVCurrency span,
.mtPrintVoucherClean .mtPVCurrency b{
  min-width:14mm!important;
  height:7mm!important;
  padding:0 2mm!important;
  font-size:10px!important;
}
.mtPrintVoucherClean .mtPVCompany{
  grid-template-columns:13mm 1fr!important;
  gap:2mm!important;
}
.mtPrintVoucherClean .mtPVCompanyLogo img,
.mtPrintVoucherClean .mtPVCompany img{
  max-width:13mm!important;
  max-height:10mm!important;
}
.mtPrintVoucherClean .mtPVCompanyText{
  padding-right:2mm!important;
}
.mtPrintVoucherClean .mtPVCompanyText strong{
  font-size:11.5px!important;
  line-height:1.28!important;
}
.mtPrintVoucherClean .mtPVCompanyText small{
  font-size:10px!important;
  line-height:1.28!important;
}
.mtPrintVoucherClean .mtPVBody{
  gap:1.05mm!important;
}
.mtPrintVoucherClean .mtPVRow{
  grid-template-columns:36mm minmax(0,1fr)!important;
  min-height:8.1mm!important;
  height:8.1mm!important;
  border-radius:5px!important;
}
.mtPrintVoucherClean .mtPVRow label{
  padding:0 2.7mm!important;
  font-size:10.5px!important;
  line-height:1.2!important;
}
.mtPrintVoucherClean .mtPVRow>div{
  min-width:0!important;
  padding:0 3mm!important;
  font-size:11.2px!important;
  line-height:1.25!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
.mtPrintVoucherClean .mtPVAmountRow>div{
  font-size:14px!important;
}
.mtPrintVoucherClean .mtPVWordsRow{
  min-height:9.2mm!important;
  height:9.2mm!important;
}
.mtPrintVoucherClean .mtPVWordsRow>div{
  font-size:10.3px!important;
  white-space:normal!important;
  overflow:hidden!important;
  line-height:1.22!important;
}
.mtPrintVoucherClean .mtPVPayMethods{
  gap:8mm!important;
}
.mtPrintVoucherClean .mtPrintRadio{
  gap:1.3mm!important;
  font-size:10.5px!important;
}
.mtPrintVoucherClean .mtPrintRadio i{
  width:3.5mm!important;
  height:3.5mm!important;
}
.mtPrintVoucherClean .mtPrintRadio.checked i::after{
  inset:.75mm!important;
}
.mtPrintVoucherClean .mtPVSignatureGrid{
  gap:9mm!important;
  margin-top:3.5mm!important;
  padding:0 5mm!important;
}
.mtPrintVoucherClean .mtPVSignCard{
  min-height:14mm!important;
  padding-top:2mm!important;
}
.mtPrintVoucherClean .mtPVSignCard span{
  font-size:10.8px!important;
}
.mtPrintVoucherClean .mtPVSignCard strong{
  margin-top:1mm!important;
  font-size:10.2px!important;
}
.mtPrintVoucherClean .mtPVSignCard small{
  margin-top:.6mm!important;
  font-size:8.3px!important;
}
@media screen and (max-width:900px){
  .mtPrintVoucher.mtPrintVoucherClean{
    transform:scale(.88)!important;
    transform-origin:top center!important;
    margin-bottom:-10mm!important;
  }
}
@media print{
  @page{size:A5 landscape;margin:0!important;}
  body.voucherPrintMode .mtPrintVoucher.mtPrintVoucherClean{
    padding:5mm 7mm 4.5mm!important;
    border-radius:0!important;
    transform:none!important;
  }
}

/* ===== Voucher A5 compact fit visual balance v3.1 ===== */
.mtPrintVoucherClean .mtPVHeader{min-height:23mm!important;}
.mtPrintVoucherClean .mtPVMetaItem{min-height:9.4mm!important;height:9.4mm!important;}
.mtPrintVoucherClean .mtPVMetaItem span{font-size:10px!important;}
.mtPrintVoucherClean .mtPVMetaItem strong{font-size:11.5px!important;}
.mtPrintVoucherClean .mtPVTitleWrap h1{font-size:31px!important;}
.mtPrintVoucherClean .mtPVCompanyText strong{font-size:12.2px!important;}
.mtPrintVoucherClean .mtPVCompanyText small{font-size:10.5px!important;}
.mtPrintVoucherClean .mtPVRow{min-height:8.55mm!important;height:8.55mm!important;}
.mtPrintVoucherClean .mtPVRow label{font-size:11px!important;}
.mtPrintVoucherClean .mtPVRow>div{font-size:11.6px!important;}
.mtPrintVoucherClean .mtPVAmountRow>div{font-size:15px!important;}
.mtPrintVoucherClean .mtPVWordsRow{min-height:9.6mm!important;height:9.6mm!important;}
.mtPrintVoucherClean .mtPVWordsRow>div{font-size:10.7px!important;}
.mtPrintVoucherClean .mtPVSignCard{min-height:15.5mm!important;}
.mtPrintVoucherClean .mtPVSignCard span{font-size:11.2px!important;}
.mtPrintVoucherClean .mtPVSignCard strong{font-size:10.7px!important;}

/* ===== Approved professional A5 landscape voucher design v5 ===== */
.mtPrintVoucher.mtPrintVoucherClean.mtVoucherApproved{
  width:210mm!important;height:148mm!important;min-height:148mm!important;box-sizing:border-box!important;
  position:relative!important;overflow:hidden!important;margin:18px auto!important;padding:5.5mm 7mm 4.5mm!important;
  border:1.25px solid #173c68!important;border-radius:12px!important;background:#fff!important;color:#0e315f!important;
  box-shadow:0 16px 38px rgba(18,48,84,.14)!important;direction:rtl!important;transform:none!important;
  font-family:Cairo,Tahoma,Arial,sans-serif!important;
}
.mtVoucherApproved .mtApprovedInnerFrame{position:absolute;inset:2.3mm;border:1px solid #b8cce0;border-radius:10px;pointer-events:none;z-index:0}
.mtVoucherApproved .mtApprovedCorner{position:absolute;top:0;left:0;width:37mm;height:22mm;overflow:hidden;pointer-events:none;z-index:1}
.mtVoucherApproved .mtApprovedCorner::before{content:"";position:absolute;inset:0;background:#0b315d;clip-path:polygon(0 0,100% 0,0 100%)}
.mtVoucherApproved .mtApprovedCorner::after{content:"";position:absolute;top:-1mm;left:19mm;width:5mm;height:31mm;background:#0aa1ac;transform:rotate(48deg);box-shadow:2mm 0 0 #fff}
.mtVoucherApproved .mtApprovedHeader{position:relative;z-index:2;display:grid;grid-template-columns:46mm minmax(64mm,1fr) 59mm;gap:5mm;min-height:25mm;align-items:center;direction:ltr;margin:0 3mm 2.7mm}
.mtVoucherApproved .mtApprovedMeta{display:grid;gap:2mm;direction:ltr;align-self:center}
.mtVoucherApproved .mtApprovedMeta>div{display:grid;grid-template-columns:1fr 18mm;height:10mm;border:1px solid #b8cce0;border-radius:6px;overflow:hidden;background:#fff}
.mtVoucherApproved .mtApprovedMeta strong,.mtVoucherApproved .mtApprovedMeta span{display:grid;place-items:center;color:#102f59;font-weight:950;line-height:1}
.mtVoucherApproved .mtApprovedMeta strong{font-size:11.5px;direction:ltr}
.mtVoucherApproved .mtApprovedMeta span{direction:rtl;border-left:1px solid #c7d8e8;font-size:9.5px;background:#fbfdff}
.mtVoucherApproved .mtApprovedMeta .dateLabel::before{content:"▣";margin-left:1.2mm;font-size:8px;color:#0b7995}
.mtVoucherApproved .mtApprovedTitle{text-align:center;direction:rtl;align-self:center}
.mtVoucherApproved .mtApprovedTitle h1{margin:0;color:#0d315f;font-size:33px;line-height:1;font-weight:1000;letter-spacing:-.5px}
.mtVoucherApproved .mtApprovedTitleLine{position:relative;width:48mm;height:4mm;margin:1.8mm auto .9mm}
.mtVoucherApproved .mtApprovedTitleLine::before,.mtVoucherApproved .mtApprovedTitleLine::after{content:"";position:absolute;top:50%;width:20mm;height:1px;background:linear-gradient(90deg,transparent,#8da8c3)}
.mtVoucherApproved .mtApprovedTitleLine::before{left:0;transform:scaleX(-1)}.mtVoucherApproved .mtApprovedTitleLine::after{right:0}
.mtVoucherApproved .mtApprovedTitleLine span{position:absolute;left:50%;top:50%;width:3mm;height:3mm;background:#0aa1ac;transform:translate(-50%,-50%) rotate(45deg)}
.mtVoucherApproved .mtApprovedCurrency{display:inline-grid;grid-template-columns:18mm 18mm;direction:ltr;height:8mm;overflow:hidden;border:1px solid #8ea8c2;border-radius:6px;background:#fff}
.mtVoucherApproved .mtApprovedCurrency b,.mtVoucherApproved .mtApprovedCurrency span{display:grid;place-items:center;font-size:10.5px;font-weight:1000}
.mtVoucherApproved .mtApprovedCurrency b{background:linear-gradient(135deg,#07919d,#05abb5);color:#fff}.mtVoucherApproved .mtApprovedCurrency span{color:#0d315f;direction:rtl}
.mtVoucherApproved .mtApprovedCompany{display:grid;grid-template-columns:1fr 17mm;gap:3mm;align-items:center;direction:ltr;justify-self:end;width:100%}
.mtVoucherApproved .mtApprovedCompanyText{direction:rtl;text-align:right;padding-right:3mm;border-right:1.3px solid #0d315f}
.mtVoucherApproved .mtApprovedCompanyText strong,.mtVoucherApproved .mtApprovedCompanyText span{display:block;color:#102f59;font-weight:950;line-height:1.35}
.mtVoucherApproved .mtApprovedCompanyText strong{font-size:11.5px;margin-bottom:1mm}.mtVoucherApproved .mtApprovedCompanyText span{font-size:9.8px}
.mtVoucherApproved .mtApprovedLogo,.mtVoucherApproved .mtApprovedLogo>*{display:grid!important;place-items:center!important}
.mtVoucherApproved .mtApprovedLogo img{width:16mm!important;max-width:16mm!important;height:13mm!important;max-height:13mm!important;object-fit:contain!important}
.mtVoucherApproved .mtApprovedDetails{position:relative;z-index:2;margin:0 4mm;border:1px solid #aec5dc;border-radius:7px;overflow:hidden;background:#fff}
.mtVoucherApproved .mtApprovedRow{display:grid;grid-template-columns:minmax(0,1fr) 47mm;min-height:7.35mm;direction:ltr;border-bottom:1px dashed #bccedf}
.mtVoucherApproved .mtApprovedRow:last-child{border-bottom:0}
.mtVoucherApproved .mtApprovedValue{display:flex;align-items:center;justify-content:flex-start;min-width:0;padding:0 4mm;direction:rtl;text-align:right;color:#12355f;font-size:10.7px;line-height:1.2;font-weight:850;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;border-right:1px solid #c7d7e6}
.mtVoucherApproved .mtApprovedRow.words .mtApprovedValue{white-space:normal;font-size:9.8px;line-height:1.25}.mtVoucherApproved .mtApprovedRow.amount .mtApprovedValue{font-size:12px;font-weight:1000}
.mtVoucherApproved .mtApprovedLabel{display:grid;grid-template-columns:1fr 7mm;gap:1.2mm;align-items:center;direction:rtl;padding:0 2.8mm;background:linear-gradient(180deg,#fff,#f8fbfe);color:#0e315f;font-size:10.4px;font-weight:1000;text-align:right}
.mtVoucherApproved .mtApprovedLabel i,.mtVoucherApproved .mtApprovedSignTitle i{display:grid;place-items:center;color:#103a6e}
.mtVoucherApproved .mtApprovedLabel svg{width:5mm;height:5mm;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.mtVoucherApproved .mtApprovedPaymentMethods{display:flex;align-items:center;justify-content:flex-start;gap:8mm;direction:rtl}
.mtVoucherApproved .mtPrintRadio{display:inline-flex;align-items:center;gap:1.3mm;color:#12355f;font-size:9.8px;font-weight:950;white-space:nowrap}
.mtVoucherApproved .mtPrintRadio i{width:3.3mm;height:3.3mm;border:1.2px solid #0a91a0;border-radius:50%;position:relative}
.mtVoucherApproved .mtPrintRadio.checked i::after{content:"";position:absolute;inset:.65mm;border-radius:50%;background:#0d315f}
.mtVoucherApproved .mtApprovedDivider{position:relative;z-index:2;height:4mm;margin:1.8mm 4mm 0}
.mtVoucherApproved .mtApprovedDivider::before,.mtVoucherApproved .mtApprovedDivider::after{content:"";position:absolute;top:50%;width:48%;height:1px;background:#0aa1ac}
.mtVoucherApproved .mtApprovedDivider::before{left:0}.mtVoucherApproved .mtApprovedDivider::after{right:0}
.mtVoucherApproved .mtApprovedDivider span{position:absolute;top:50%;left:50%;width:2.6mm;height:2.6mm;background:#0aa1ac;transform:translate(-50%,-50%) rotate(45deg)}
.mtVoucherApproved .mtApprovedSignatures{position:relative;z-index:2;display:grid;grid-template-columns:repeat(3,1fr);gap:8mm;margin:0 4mm;direction:ltr}
.mtVoucherApproved .mtApprovedSignCard{height:22mm;box-sizing:border-box;border:1px solid #b7cade;border-radius:7px;padding:2mm 3mm 1.5mm;text-align:center;direction:rtl;background:linear-gradient(180deg,#fff,#fcfdff)}
.mtVoucherApproved .mtApprovedSignTitle{display:flex;align-items:center;justify-content:center;gap:1.5mm;color:#0e315f;font-size:9.5px;font-weight:1000}
.mtVoucherApproved .mtApprovedSignTitle svg{width:4.4mm;height:4.4mm;stroke:#0aa1ac;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.mtVoucherApproved .mtApprovedSignCard>strong{display:block;margin-top:1.2mm;color:#12355f;font-size:9.3px;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mtVoucherApproved .mtApprovedSignLine{width:70%;height:4.5mm;margin:.6mm auto 0;border-bottom:1px dashed #9db1c5}
.mtVoucherApproved .mtApprovedSignCard small{display:block;margin-top:.6mm;color:#536d87;font-size:7.8px;font-weight:850}
.mtVoucherApproved .mtApprovedFooter{position:relative;z-index:2;display:flex;align-items:center;justify-content:center;gap:3mm;height:4mm;margin-top:1mm;color:#274b72}
.mtVoucherApproved .mtApprovedFooter p{margin:0;font-size:7.8px;font-weight:850}.mtVoucherApproved .mtApprovedFooter span{width:1.8mm;height:1.8mm;background:#0aa1ac;transform:rotate(45deg)}
@media screen and (max-width:900px){.mtPrintVoucher.mtPrintVoucherClean.mtVoucherApproved{transform:scale(.84)!important;transform-origin:top center!important;margin-bottom:-20mm!important}}
@media print{
  @page{size:A5 landscape;margin:0!important}
  body.voucherPrintMode *{visibility:hidden!important}
  body.voucherPrintMode #voucherPrintCard,body.voucherPrintMode #voucherPrintCard *{visibility:visible!important}
  body.voucherPrintMode,body.voucherPrintMode main,body.voucherPrintMode #content,body.voucherPrintMode #voucherPreview{width:210mm!important;height:148mm!important;margin:0!important;padding:0!important;overflow:hidden!important;background:#fff!important}
  body.voucherPrintMode .mtPrintVoucher.mtPrintVoucherClean.mtVoucherApproved{position:absolute!important;inset:0!important;width:210mm!important;height:148mm!important;min-height:148mm!important;margin:0!important;padding:5.5mm 7mm 4.5mm!important;border-radius:0!important;box-shadow:none!important;transform:none!important;page-break-inside:avoid!important;break-inside:avoid!important;-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}
}
/* Approved design vertical balance v5.1 */
.mtVoucherApproved .mtApprovedHeader{min-height:27mm!important;margin-bottom:3mm!important}
.mtVoucherApproved .mtApprovedRow{min-height:7.8mm!important}
.mtVoucherApproved .mtApprovedSignCard{height:24mm!important;padding-top:2.2mm!important}
.mtVoucherApproved .mtApprovedSignLine{height:5.5mm!important}
.mtVoucherApproved .mtApprovedFooter{height:4.5mm!important;margin-top:.8mm!important}

/* Employee online account workflow V25 */
.employeeAccessPanel{margin:6px 0 20px;padding:18px;border:1px solid #cfe0f1;border-radius:22px;background:linear-gradient(180deg,#f8fbff,#fff);box-shadow:0 12px 28px rgba(25,62,99,.06)}
.employeeAccessHead{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:16px}.employeeAccessHead h4{margin:0;color:#10213a;font-size:21px}.employeeAccessHead p{margin:6px 0 0;color:#6b7e94;font-weight:800}.employeeAccountBadge{display:inline-flex;align-items:center;min-height:36px;padding:0 13px;border-radius:999px;font-weight:950;white-space:nowrap}.employeeAccountBadge.active{background:#e8f8ef;color:#137547;border:1px solid #bfe8cf}.employeeAccountBadge.disabled{background:#fff2e5;color:#a6530a;border:1px solid #ffd4aa}.employeeAccountBadge.pending{background:#eef4fb;color:#526d88;border:1px solid #d6e3f0}.employeeAccountBadge.checking{background:#eef7ff;color:#126bb1;border:1px solid #cbe5fb}
.employeeAccessGrid{display:grid;grid-template-columns:minmax(220px,.8fr) minmax(300px,1.2fr);gap:14px}.employeeAccessGrid label{display:block;margin-bottom:7px;color:#263d58;font-weight:950}.employeeAccessGrid select,.employeeAccessGrid input{width:100%;height:46px;border:1px solid #d3e1ef;border-radius:14px;background:#fff;padding:0 12px;font:inherit;font-weight:800;color:#10213a}.employeeAccessGrid small{display:block;margin-top:6px;color:#71849a;font-weight:750}.employeePasswordField{display:grid;grid-template-columns:minmax(0,1fr) 44px 72px;gap:7px}.employeePasswordField button{border:0;border-radius:13px;background:#eaf3fc;color:#174b78;font:inherit;font-weight:950;cursor:pointer}.employeePasswordField button:last-child{background:#0e3a67;color:#fff}
.employeeAccessModes{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:17px 0 13px}.employeeAccessMode{position:relative;border:1px solid #d6e3f0;border-radius:17px;background:#fff;padding:13px;cursor:pointer;display:grid;gap:4px;min-height:76px}.employeeAccessMode input{position:absolute;opacity:0;pointer-events:none}.employeeAccessMode b{color:#16324e;font-size:15px}.employeeAccessMode span{color:#71849a;font-size:12px;font-weight:800}.employeeAccessMode.active{border-color:#138fc0;background:linear-gradient(180deg,#ecf9ff,#fff);box-shadow:0 8px 18px rgba(19,143,192,.12)}.employeeAccessMode.active:after{content:'✓';position:absolute;left:10px;top:9px;width:23px;height:23px;border-radius:50%;display:grid;place-items:center;background:#138fc0;color:#fff;font-weight:950}
.employeeAccessSummary{border:1px solid #d8e6f3;border-radius:17px;background:#fff;padding:14px}.employeeAccessSummary article{display:grid;gap:6px}.employeeAccessSummary b{color:#10213a;font-size:16px}.employeeAccessSummary span{color:#60758d;font-weight:800;line-height:1.7}.employeeAccessSummary em{font-style:normal;color:#174b78;font-weight:950}
.employeeCustomPermissions{margin-top:13px;max-height:390px;overflow:auto;border:1px solid #d8e6f3;border-radius:17px;background:#fff}.employeePermissionRow{display:grid;grid-template-columns:minmax(210px,1fr) 90px 90px;align-items:center;gap:8px;padding:11px 13px;border-bottom:1px solid #edf2f7}.employeePermissionRow:last-child{border-bottom:0}.employeePermissionRow>div{display:grid;gap:2px}.employeePermissionRow b{color:#16324e}.employeePermissionRow small{color:#7b8da2;font-weight:750}.employeePermissionRow label{display:flex;align-items:center;gap:6px;font-weight:900;color:#36536e}.employeePermissionRow input{width:18px;height:18px;accent-color:#128ec0}.employeeAccessActions{display:flex;gap:9px;flex-wrap:wrap;margin-top:14px}
.employeeAccessResultOverlay{position:fixed;inset:0;z-index:100050;background:rgba(6,24,43,.58);backdrop-filter:blur(5px);display:grid;place-items:center;padding:18px;direction:rtl}.employeeAccessResultCard{position:relative;width:min(560px,100%);background:#fff;border-radius:26px;padding:28px;box-shadow:0 25px 70px rgba(0,0,0,.25);text-align:center}.employeeAccessClose{position:absolute;left:16px;top:14px;width:38px;height:38px;border:0;border-radius:50%;background:#eef4fa;color:#173a5a;font-size:25px;cursor:pointer}.employeeAccessResultIcon{width:62px;height:62px;border-radius:50%;display:grid;place-items:center;margin:0 auto 12px;background:#e7f8ef;color:#15804c;font-size:34px;font-weight:950}.employeeAccessResultCard h3{margin:0;color:#10213a;font-size:25px}.employeeAccessResultCard p{color:#60758d;font-weight:800;line-height:1.8}.employeeAccessResultDetails{display:grid;gap:8px;text-align:right;background:#f7fbff;border:1px solid #dce8f4;border-radius:17px;padding:13px;margin:14px 0}.employeeAccessResultDetails span{color:#425d77;font-weight:800}.employeeAccessResultDetails b{color:#173a5a}.employeeAccessResultActions{display:flex;justify-content:center;gap:9px;flex-wrap:wrap}
@media(max-width:900px){.employeeAccessGrid{grid-template-columns:1fr}.employeeAccessModes{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:620px){.employeeAccessHead{flex-direction:column}.employeeAccessModes{grid-template-columns:1fr}.employeePermissionRow{grid-template-columns:1fr 72px 72px}.employeePasswordField{grid-template-columns:minmax(0,1fr) 42px 62px}.employeeAccessPanel{padding:13px}}


/* ===== Logout card repair v32 =====
   The card is deliberately scoped to the top bar to avoid legacy/global SVG
   and button rules stretching its icon or collapsing its text. */
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .topBar > .logoutCard{
  -webkit-appearance:none!important;
  appearance:none!important;
  box-sizing:border-box!important;
  width:190px!important;
  min-width:190px!important;
  max-width:190px!important;
  min-height:76px!important;
  height:auto!important;
  margin:0!important;
  padding:10px 14px!important;
  border:1px solid #d9e6f3!important;
  border-radius:20px!important;
  background:linear-gradient(145deg,#ffffff,#f2f7fc)!important;
  color:#102b4b!important;
  box-shadow:0 14px 34px rgba(24,63,103,.12),inset 0 1px 0 #fff!important;
  display:flex!important;
  flex-direction:row!important;
  align-items:center!important;
  justify-content:center!important;
  align-content:center!important;
  gap:10px!important;
  overflow:hidden!important;
  text-align:center!important;
  white-space:normal!important;
  font-family:inherit!important;
  cursor:pointer!important;
  opacity:1!important;
  visibility:visible!important;
  pointer-events:auto!important;
  transform:none!important;
  transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .topBar > .logoutCard:hover{
  transform:translateY(-2px)!important;
  border-color:#bcd4e9!important;
  box-shadow:0 18px 40px rgba(24,63,103,.17),inset 0 1px 0 #fff!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .topBar > .logoutCard:active{
  transform:translateY(0)!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .topBar > .logoutCard:focus-visible{
  outline:3px solid rgba(34,146,232,.22)!important;
  outline-offset:3px!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .topBar > .logoutCard .logoutCardIcon{
  box-sizing:border-box!important;
  width:42px!important;
  min-width:42px!important;
  max-width:42px!important;
  height:42px!important;
  min-height:42px!important;
  max-height:42px!important;
  flex:0 0 42px!important;
  padding:0!important;
  margin:0!important;
  border:1px solid #cde0f1!important;
  border-radius:14px!important;
  background:#eaf4fc!important;
  color:#14558b!important;
  display:grid!important;
  place-items:center!important;
  overflow:hidden!important;
  line-height:1!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .topBar > .logoutCard .logoutCardIcon svg{
  box-sizing:border-box!important;
  display:block!important;
  width:23px!important;
  min-width:23px!important;
  max-width:23px!important;
  height:23px!important;
  min-height:23px!important;
  max-height:23px!important;
  margin:0!important;
  padding:0!important;
  overflow:visible!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:2.15!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .topBar > .logoutCard .logoutCardIcon svg path{
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:2.15!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .topBar > .logoutCard .logoutCardText{
  min-width:0!important;
  margin:0!important;
  padding:0!important;
  display:grid!important;
  justify-items:center!important;
  align-items:center!important;
  gap:2px!important;
  text-align:center!important;
  line-height:1.35!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .topBar > .logoutCard .logoutCardText strong{
  display:block!important;
  margin:0!important;
  padding:0!important;
  color:#102b4b!important;
  font-size:15px!important;
  font-weight:950!important;
  line-height:1.35!important;
  white-space:nowrap!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .topBar > .logoutCard .logoutCardText small{
  display:block!important;
  margin:0!important;
  padding:0!important;
  color:#6b7f95!important;
  font-size:11px!important;
  font-weight:800!important;
  line-height:1.35!important;
  white-space:nowrap!important;
}

@media(max-width:900px){
  body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .topBar > .logoutCard{
    width:210px!important;
    min-width:210px!important;
    max-width:210px!important;
    align-self:center!important;
  }
}

@media(max-width:480px){
  body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) .topBar > .logoutCard{
    width:100%!important;
    min-width:0!important;
    max-width:260px!important;
    min-height:70px!important;
  }
}


/* ===== V36: clean focused home page ===== */
body.megaHomeFocusMode .topBar .pageTitle,
#app.megaHomeFocusMode .topBar .pageTitle{
  display:none!important;
}

body.megaHomeFocusMode .topBar,
#app.megaHomeFocusMode .topBar{
  justify-content:flex-start!important;
  align-items:center!important;
  min-height:54px!important;
  margin-bottom:18px!important;
}

body.megaHomeFocusMode .controlPanelHero.homeLogoOnlyHero,
#app.megaHomeFocusMode .controlPanelHero.homeLogoOnlyHero{
  justify-content:center!important;
  align-items:center!important;
  min-height:150px!important;
  padding:24px!important;
}

body.megaHomeFocusMode .controlPanelHero.homeLogoOnlyHero .homeHeroLogo,
#app.megaHomeFocusMode .controlPanelHero.homeLogoOnlyHero .homeHeroLogo{
  margin:0 auto!important;
}

body.megaHomeFocusMode .megaHomeEssentialPage,
#app.megaHomeFocusMode .megaHomeEssentialPage{
  display:grid!important;
  gap:18px!important;
}

body.megaHomeFocusMode .homeEssentialGrid,
#app.megaHomeFocusMode .homeEssentialGrid{
  margin-top:0!important;
  align-items:start!important;
}

/* Safety: settings for choosing home shortcuts must never appear on home. */
body.megaHomeFocusMode .dashboardShortcutSettings,
#app.megaHomeFocusMode .dashboardShortcutSettings,
body.megaHomeFocusMode .dashboardAdminDetails,
#app.megaHomeFocusMode .dashboardAdminDetails,
body.megaHomeFocusMode .dashboardKpiGrid,
#app.megaHomeFocusMode .dashboardKpiGrid,
body.megaHomeFocusMode .homeDashboardGrid.bottom,
#app.megaHomeFocusMode .homeDashboardGrid.bottom{
  display:none!important;
}

@media(max-width:720px){
  body.megaHomeFocusMode .topBar,
  #app.megaHomeFocusMode .topBar{
    flex-direction:row!important;
  }
  body.megaHomeFocusMode .controlPanelHero.homeLogoOnlyHero,
  #app.megaHomeFocusMode .controlPanelHero.homeLogoOnlyHero{
    min-height:120px!important;
    padding:18px!important;
  }
}


/* ===== V38: home logo in the left header, without the large blue banner ===== */
.topBar .homeTopBrand{
  display:none;
}

body.megaHomeFocusMode .controlPanelHero.homeLogoOnlyHero,
#app.megaHomeFocusMode .controlPanelHero.homeLogoOnlyHero{
  display:none!important;
}

body.megaHomeFocusMode .topBar,
#app.megaHomeFocusMode .topBar{
  width:100%!important;
  min-height:82px!important;
  margin-bottom:16px!important;
  padding:0!important;
  flex-direction:row!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:18px!important;
}

body.megaHomeFocusMode .topBar .homeTopBrand,
#app.megaHomeFocusMode .topBar .homeTopBrand{
  box-sizing:border-box!important;
  display:grid!important;
  place-items:center!important;
  order:99!important;
  width:190px!important;
  min-width:190px!important;
  height:82px!important;
  margin:0!important;
  padding:9px 16px!important;
  border:1px solid #d9e6f3!important;
  border-radius:22px!important;
  background:linear-gradient(145deg,#ffffff,#f2f7fc)!important;
  box-shadow:0 14px 34px rgba(24,63,103,.12),inset 0 1px 0 #fff!important;
  overflow:hidden!important;
}

body.megaHomeFocusMode .topBar .homeTopBrand img,
#app.megaHomeFocusMode .topBar .homeTopBrand img{
  display:block!important;
  max-width:154px!important;
  max-height:64px!important;
  width:auto!important;
  height:auto!important;
  object-fit:contain!important;
}

body.megaHomeFocusMode .megaHomeEssentialPage,
#app.megaHomeFocusMode .megaHomeEssentialPage{
  gap:0!important;
}

@media(max-width:720px){
  body.megaHomeFocusMode .topBar,
  #app.megaHomeFocusMode .topBar{
    min-height:70px!important;
    margin-bottom:12px!important;
    gap:10px!important;
  }
  body.megaHomeFocusMode .topBar .homeTopBrand,
  #app.megaHomeFocusMode .topBar .homeTopBrand{
    width:142px!important;
    min-width:142px!important;
    height:68px!important;
    padding:7px 10px!important;
    border-radius:18px!important;
  }
  body.megaHomeFocusMode .topBar .homeTopBrand img,
  #app.megaHomeFocusMode .topBar .homeTopBrand img{
    max-width:120px!important;
    max-height:52px!important;
  }
  body.megaHomeFocusMode .topBar > .logoutCard,
  #app.megaHomeFocusMode .topBar > .logoutCard{
    width:170px!important;
    min-width:170px!important;
    max-width:170px!important;
  }
}

@media(max-width:480px){
  body.megaHomeFocusMode .topBar .homeTopBrand,
  #app.megaHomeFocusMode .topBar .homeTopBrand{
    width:112px!important;
    min-width:112px!important;
    height:62px!important;
  }
  body.megaHomeFocusMode .topBar .homeTopBrand img,
  #app.megaHomeFocusMode .topBar .homeTopBrand img{
    max-width:96px!important;
    max-height:46px!important;
  }
  body.megaHomeFocusMode .topBar > .logoutCard,
  #app.megaHomeFocusMode .topBar > .logoutCard{
    width:150px!important;
    min-width:150px!important;
    max-width:150px!important;
    min-height:62px!important;
    padding:8px 10px!important;
  }
}

/* ===== V62: item-level category discount in sales invoices and returns ===== */
.salesCategoryDiscountDraftTable{
  min-width:1720px!important;
}
.salesCategoryDiscountDraftTable th,
.salesCategoryDiscountDraftTable td{
  vertical-align:middle!important;
}
.salesCategoryDiscountDraftTable th:nth-child(11),
.salesCategoryDiscountDraftTable td:nth-child(11){width:120px!important;min-width:120px!important;}
.salesCategoryDiscountDraftTable th:nth-child(12),
.salesCategoryDiscountDraftTable td:nth-child(12){width:125px!important;min-width:125px!important;}
.salesCategoryDiscountDraftTable th:nth-child(13),
.salesCategoryDiscountDraftTable td:nth-child(13){width:145px!important;min-width:145px!important;}
.salesCategoryDiscountDraftTable th:nth-child(14),
.salesCategoryDiscountDraftTable td:nth-child(14){width:130px!important;min-width:130px!important;}
.salesCategoryDiscountDraftTable th:nth-child(15),
.salesCategoryDiscountDraftTable td:nth-child(15){width:85px!important;min-width:85px!important;}

.lineCategoryDiscountValue{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
  line-height:1.2;
  white-space:nowrap;
}
.lineCategoryDiscountValue strong{
  font-size:1em;
  font-weight:950;
}
.lineCategoryDiscountValue small{
  font-size:.82em;
  font-weight:800;
  opacity:.78;
}

.salesCategoryDiscountPrintTable{
  width:100%!important;
  min-width:1260px!important;
  table-layout:fixed!important;
}
.salesCategoryDiscountPrintTable th,
.salesCategoryDiscountPrintTable td{
  white-space:normal!important;
  overflow-wrap:anywhere!important;
  padding:8px 5px!important;
  font-size:11px!important;
}
.salesCategoryDiscountPrintTable th:nth-child(1),
.salesCategoryDiscountPrintTable td:nth-child(1){width:6%!important;}
.salesCategoryDiscountPrintTable th:nth-child(2),
.salesCategoryDiscountPrintTable td:nth-child(2){width:15%!important;text-align:right!important;}
.salesCategoryDiscountPrintTable th:nth-child(3),
.salesCategoryDiscountPrintTable td:nth-child(3){width:7%!important;}
.salesCategoryDiscountPrintTable th:nth-child(4),
.salesCategoryDiscountPrintTable td:nth-child(4){width:7%!important;}
.salesCategoryDiscountPrintTable th:nth-child(5),
.salesCategoryDiscountPrintTable td:nth-child(5){width:8%!important;}
.salesCategoryDiscountPrintTable th:nth-child(6),
.salesCategoryDiscountPrintTable td:nth-child(6){width:5%!important;}
.salesCategoryDiscountPrintTable th:nth-child(7),
.salesCategoryDiscountPrintTable td:nth-child(7){width:8%!important;}
.salesCategoryDiscountPrintTable th:nth-child(8),
.salesCategoryDiscountPrintTable td:nth-child(8){width:8%!important;}
.salesCategoryDiscountPrintTable th:nth-child(9),
.salesCategoryDiscountPrintTable td:nth-child(9){width:9%!important;}
.salesCategoryDiscountPrintTable th:nth-child(10),
.salesCategoryDiscountPrintTable td:nth-child(10){width:7%!important;}
.salesCategoryDiscountPrintTable th:nth-child(11),
.salesCategoryDiscountPrintTable td:nth-child(11){width:8%!important;}
.salesCategoryDiscountPrintTable th:nth-child(12),
.salesCategoryDiscountPrintTable td:nth-child(12){width:6%!important;}
.salesCategoryDiscountPrintTable th:nth-child(13),
.salesCategoryDiscountPrintTable td:nth-child(13){width:6%!important;}

@media print{
  body.invoicePrintMode .salesCategoryDiscountPrintTable{
    min-width:0!important;
    width:100%!important;
    table-layout:fixed!important;
  }
  body.invoicePrintMode .salesCategoryDiscountPrintTable th,
  body.invoicePrintMode .salesCategoryDiscountPrintTable td{
    padding:4px 2px!important;
    font-size:7.3px!important;
    line-height:1.2!important;
  }
  body.invoicePrintMode .salesCategoryDiscountPrintTable .lineCategoryDiscountValue{
    gap:1px!important;
  }
  body.invoicePrintMode .salesCategoryDiscountPrintTable .lineCategoryDiscountValue small{
    font-size:6.6px!important;
  }
}

/* ===== Correct packing totals V63 ===== */
.correctedPackingTotals .packingIconCount{
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:4px!important;
  line-height:1.2!important;
}
.correctedPackingTotals .packingMainCount{
  display:block!important;
  font-size:inherit!important;
  font-weight:900!important;
  white-space:nowrap!important;
}
.correctedPackingTotals .packingIconRemainder{
  display:block!important;
  font-size:11px!important;
  line-height:1.35!important;
  font-weight:800!important;
  color:#475569!important;
  white-space:normal!important;
}
.correctedPackingTotals .packingIconCard.pvcPipes .packingIconSymbol,
.correctedPackingTotals .packingIconCard.pphPipes .packingIconSymbol,
.correctedPackingTotals .packingIconCard.polyPipes .packingIconSymbol{
  background:#eff6ff!important;
}
.compactPackingAtRight .correctedPackingTotals .packingIconRemainder{
  font-size:10px!important;
}
@media print{
  body.invoicePrintMode .correctedPackingTotals .packingIconRemainder{
    font-size:8px!important;
    color:#334155!important;
  }
}

/* V130 employee duplicate review and permanent-deletion guard */
.employeeDuplicateReview{margin:6px 0 18px;padding:16px 18px;border-radius:20px;border:1px solid #cfe0f1;background:#f8fbff}.employeeDuplicateReview.clean{display:flex;align-items:center;justify-content:space-between;gap:14px}.employeeDuplicateReview h4{margin:0;color:#10213a;font-size:20px}.employeeDuplicateReview p{margin:5px 0 0;color:#64748b;font-weight:800}.employeeDuplicateReview.warning{background:#fffaf0;border-color:#f3d59b}.employeeDuplicateReviewHead{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:12px}.employeeDuplicateGroup{padding:12px;border:1px solid #f0d7a8;border-radius:16px;background:#fff;margin-top:10px}.employeeDuplicateGroup>div:first-child{display:flex;align-items:center;justify-content:space-between;gap:10px}.employeeDuplicateGroup small{color:#7d6b4e;font-weight:800}.employeeDuplicateRows{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:8px;margin-top:10px}.employeeDuplicateRows button{border:1px solid #d9e4ef;border-radius:13px;background:#fff;padding:10px;text-align:right;cursor:pointer}.employeeDuplicateRows button:hover{border-color:#2f80ed;box-shadow:0 6px 16px rgba(47,128,237,.12)}.employeeDuplicateRows strong,.employeeDuplicateRows span{display:block}.employeeDuplicateRows span{margin-top:4px;color:#64748b;font-size:12px;font-weight:800;word-break:break-word}@media(max-width:620px){.employeeDuplicateReview.clean,.employeeDuplicateReviewHead,.employeeDuplicateGroup>div:first-child{flex-direction:column;align-items:flex-start}.employeeDuplicateRows{grid-template-columns:1fr}}


/* V146 — Sales representatives monthly/yearly performance */
.salesRepsPage{display:block}.salesRepPeriodPanel{display:flex;align-items:center;justify-content:space-between;gap:18px}.salesRepPeriodPanel h3{margin:0 0 5px}.salesRepPeriodPanel p{margin:0;color:#64748b;font-weight:800}.salesRepPeriodControls{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap}.salesRepPeriodControls label{display:flex;flex-direction:column;gap:5px;min-width:150px;font-weight:900;color:#334155}.salesRepPeriodControls input{min-height:42px}.salesRepSummaryGrid{margin-bottom:18px}.salesRepFormGrid{grid-template-columns:repeat(auto-fit,minmax(210px,1fr))}.salesRepsMetricsTable{min-width:1500px}.salesRepsMetricsTable td{vertical-align:top}.salesRepsMetricsTable td>small,.salesRepRowId{display:block;margin-top:4px;color:#94a3b8;font-size:10px;word-break:break-all}.salesRepAchievement{display:grid;grid-template-columns:1fr auto;gap:5px 8px;align-items:center;min-width:210px}.salesRepAchievement .salesRepProgress{grid-column:1/-1;height:8px;background:#e2e8f0;border-radius:999px;overflow:hidden}.salesRepAchievement .salesRepProgress i{display:block;height:100%;background:linear-gradient(90deg,#2f80ed,#27ae60);border-radius:inherit}.salesRepAchievement b{font-size:15px;color:#10213a}.salesRepAchievement small{color:#64748b;font-weight:800}.salesRepAchievement .tag{grid-column:1/-1;width:max-content}.salesRepCommissionCell{display:flex;flex-direction:column;gap:5px;min-width:140px}.salesRepCommissionCell b{font-size:16px;color:#10213a}.salesRepCommissionCell small{color:#64748b;font-weight:800}.salesRepUnlinkedWarning{border-color:#f3d59b!important;background:#fffaf0!important}.salesRepUnlinkedWarning strong{color:#8a5a00}.salesRepUnlinkedWarning p{margin:7px 0;color:#7d6b4e;font-weight:800}.salesRepUnlinkedWarning small{display:block;color:#9a6b16;font-weight:900}
@media(max-width:900px){.salesRepPeriodPanel{align-items:flex-start;flex-direction:column}.salesRepPeriodControls{width:100%}.salesRepPeriodControls label{flex:1}.salesRepSummaryGrid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){.salesRepSummaryGrid{grid-template-columns:1fr}.salesRepPeriodControls{align-items:stretch;flex-direction:column}.salesRepPeriodControls .tabs{width:100%}.salesRepPeriodControls .tab{flex:1}}
@media print{.salesRepsPage .noPrint,.salesRepsPage .actions,.salesRepsPage .salesRepUnlinkedWarning,.salesRepsPage .salesRepFormPanel{display:none!important}.salesRepsPage .salesRepsMetricsTable{min-width:0!important;width:100%!important;font-size:8px}.salesRepsPage .salesRepAchievement{min-width:0}.salesRepsPage .salesRepSummaryGrid{grid-template-columns:repeat(4,1fr)!important}}

/* ===== V147 Distributors: active records and preserved historical accounts ===== */
.historicalAccountBadge{display:inline-flex;align-items:center;gap:4px;margin-inline-start:8px;padding:4px 9px;border:1px solid #f59e0b;border-radius:999px;background:#fff7ed;color:#9a3412;font-size:11px;font-weight:900;line-height:1.2;vertical-align:middle}
.historicalAccountBadge.inlineBadge{margin-inline-start:6px;padding:3px 7px}
.historicalAccountCard{border-color:#fdba74!important;background:linear-gradient(180deg,#fffaf2,#fff7ed)!important}
.historicalAccountCard>span{display:flex;align-items:center;justify-content:center;gap:6px;flex-wrap:wrap}
.historicalStatementRow td{background:#fffaf2}
.distributorCategoryDiscountPanel{margin-top:18px}
#f_companyClients_salesRepId{width:100%}
@media print{.historicalAccountBadge{border:1px solid #9a3412;background:#fff!important;color:#7c2d12!important}}

/* ===== V148 Distributor statement: accounting period and historical archive ===== */
.distributorStatementPeriodPanel{margin-bottom:18px}
.distributorPeriodGrid{display:grid;grid-template-columns:repeat(4,minmax(180px,1fr));gap:12px;align-items:end}
.distributorPeriodGrid>div>label{display:block;margin-bottom:6px;color:#52657d;font-weight:900}
.distributorPeriodActions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.archivedAccountsToggle{display:flex;align-items:center;gap:9px;margin-top:14px;width:max-content;max-width:100%;padding:10px 13px;border:1px solid #d7e4f1;border-radius:14px;background:#f8fbff;color:#334155;font-weight:900;cursor:pointer}
.archivedAccountsToggle input{width:18px;height:18px}
.archivedStatementBadge{display:inline-flex;align-items:center;margin-inline-start:7px;padding:3px 8px;border:1px solid #94a3b8;border-radius:999px;background:#f1f5f9;color:#475569;font-size:10px;font-weight:950;vertical-align:middle}
.archivedAccountCard{border-style:dashed!important;opacity:.88}
.historicalStatementManagement{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:14px 0;padding:14px 16px;border:1px solid #f2cf91;border-radius:16px;background:#fffaf0}
.historicalStatementManagement>div:first-child{display:flex;flex-direction:column;gap:4px}
.historicalStatementManagement strong{color:#7c2d12;font-size:16px}
.historicalStatementManagement span,.historicalStatementManagement small{color:#7d6b4e;font-weight:800}
.historicalStatementManagement small{display:block;margin-top:8px}
.historicalStatementManagement .btn[disabled]{opacity:.45;cursor:not-allowed;filter:grayscale(.4)}
.distributorStatementTotalsV148{grid-template-columns:repeat(4,minmax(150px,1fr))}
.carriedForwardRow td{background:#eef6ff!important;font-weight:900;border-top:2px solid #93c5fd;border-bottom:2px solid #93c5fd}
.carriedForwardRow td:nth-child(4) .tag{background:#dbeafe!important;color:#1d4ed8!important}
.distributorStatementPage .detailedSummaryTable{min-width:1550px}
.dealerStatementPage .detailedSummaryTable{min-width:2150px}
.distributorStatementPage .supplierStatementStats .statCard small,
.dealerStatementPage .supplierStatementStats .statCard small{line-height:1.45}
.dealerStatementPartyMeta{display:flex;align-items:center;gap:8px 14px;flex-wrap:wrap;margin-top:8px;color:#dbeafe;font-weight:800;font-size:12px}
.dealerStatementPartyMeta span{display:inline-flex;gap:4px;align-items:center}
.dealerStatementPartyMeta b{color:#fff}
.supplierStatementBalance em{display:block;margin-top:4px;color:#dbeafe;font-size:11px;font-style:normal;font-weight:800}
.balanceNatureBadge{display:inline-flex;align-items:center;justify-content:center;padding:3px 8px;border-radius:999px;font-size:10px;font-weight:950;line-height:1.2;vertical-align:middle}
.balanceNatureBadge.debit{background:#fff1f2;color:#be123c;border:1px solid #fecdd3}
.balanceNatureBadge.credit{background:#ecfdf5;color:#047857;border:1px solid #a7f3d0}
.balanceNatureBadge.settled{background:#eff6ff;color:#1d4ed8;border:1px solid #bfdbfe}
.client2StatementCard em{display:flex;align-items:center;justify-content:center;gap:6px;flex-wrap:wrap}
.historicalStatementReadOnly{display:flex;flex-direction:column;gap:5px;margin:14px 0;padding:14px 16px;border:1px solid #f2cf91;border-radius:16px;background:#fffaf0}
.historicalStatementReadOnly strong{color:#7c2d12;font-size:16px}
.historicalStatementReadOnly span{color:#7d6b4e;font-weight:800}
.dealerStatementSummaryTable td,.dealerStatementSummaryTable th{white-space:nowrap}
@media(max-width:1000px){.distributorPeriodGrid{grid-template-columns:repeat(2,minmax(0,1fr))}.distributorStatementTotalsV148{grid-template-columns:repeat(2,minmax(0,1fr))}.historicalStatementManagement{align-items:flex-start;flex-direction:column}}
@media(max-width:600px){.distributorPeriodGrid,.distributorStatementTotalsV148{grid-template-columns:1fr}.distributorPeriodActions{width:100%}.distributorPeriodActions .btn{flex:1}.historicalStatementManagement .actions{width:100%;flex-direction:column}.historicalStatementManagement .btn{width:100%}}
@media print{
  .distributorStatementPeriodPanel,.historicalStatementManagement,.historicalStatementReadOnly,.archivedAccountsToggle{display:none!important}
  .distributorStatementTotalsV148{grid-template-columns:repeat(4,1fr)!important}
  .dealerStatementPartyMeta{color:#334155!important;gap:4px 10px!important;font-size:8px!important}
  .dealerStatementPartyMeta b{color:#0f172a!important}
  .supplierStatementBalance em{color:#334155!important;font-size:8px!important}
  .carriedForwardRow td{background:#eef6ff!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
}


/* ===== V307R108: section menu long-title fit ===== */
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .navItem,
body.sectionMenuOpen:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .navItem{
  height:auto!important;
  min-height:52px!important;
  padding:9px 11px!important;
  overflow:hidden!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .navItemInner,
body.sectionMenuOpen:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .navItemInner{
  min-width:0!important;
  height:100%!important;
  align-items:center!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .navLabel,
body.sectionMenuOpen:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .navLabel{
  min-width:0!important;
  white-space:normal!important;
  overflow:hidden!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
  line-height:1.35!important;
  text-align:center!important;
  text-wrap:balance!important;
}
body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .navGroup.open .navGroupItems{
  max-height:760px!important;
  align-items:stretch!important;
}
@media(max-width:520px){
  body:not(.certificatePrintMode):not(.invoicePrintMode):not(.voucherPrintMode):not(.payrollPrintMode) aside .navItem{min-height:48px!important}
}

/* statement_print_v1 (2026-11-09): طباعة كشوف الحسابات وكارت الصنف.
   - زرار «رجوع/التالي» ما يطلعش على الورق في أي طباعة.
   - الكشف ياخد عرض الورقة كلها ويكمل على كذا صفحة: قاعدة شهادة الضمان (html,body 210mm×297mm overflow hidden)
     كانت بتقفل الطباعة على صفحة واحدة بالطول وتقص باقي الحركات، ومكان الشريط الجانبي كان فاضل محجوز.
   - خط جدول الكشف 9px بدل 6.5px، وجدول كارت الصنف 9.5px، والصف ما يتقسمش بين صفحتين.
   - خانة «بحث داخل …» ما تطلعش على الورق. */
@media print{
  #sectionHistoryBar,.sectionHistoryBar{display:none!important}
  html:has(body.supplierStatementPrintMode),html:has(body.client2StatementPrintMode),html:has(body.itemCardPrintMode),
  html body.supplierStatementPrintMode,html body.client2StatementPrintMode,html body.itemCardPrintMode{width:auto!important;min-width:0!important;max-width:none!important;height:auto!important;min-height:0!important;overflow:visible!important}
  body.supplierStatementPrintMode #app,body.client2StatementPrintMode #app,body.itemCardPrintMode #app{display:block!important;width:auto!important}
  body.supplierStatementPrintMode #app main,body.client2StatementPrintMode #app main,body.itemCardPrintMode #app main{margin:0!important;padding:0!important;width:100%!important;max-width:none!important}
  html body.supplierStatementPrintMode .supplierStatementTable th,
  html body.supplierStatementPrintMode .supplierStatementTable td{font-size:9px!important;line-height:1.35!important;padding:4px 3px!important}
  body.supplierStatementPrintMode #advancedSectionSearchPanel,body.client2StatementPrintMode #advancedSectionSearchPanel,body.itemCardPrintMode #advancedSectionSearchPanel{display:none!important}
  html body.supplierStatementPrintMode .supplierStatementTable tr,html body.itemCardPrintMode .itemCardMovementTable tr{break-inside:avoid!important;page-break-inside:avoid!important}
  html body.itemCardPrintMode .itemCardMovementTable th,
  html body.itemCardPrintMode .itemCardMovementTable td{font-size:9.5px!important;line-height:1.35!important}
  html body.itemCardPrintMode .itemCardMovementTable td .tag{font-size:8.5px!important;padding:2px 6px!important;white-space:nowrap!important}
  html body.supplierStatementPrintMode .supplierStatementTable td .tag{font-size:8.5px!important;padding:2px 6px!important;white-space:nowrap!important}
}
