:root{--green:#08633e;--green2:#0b8a55;--orange:#f47b0a;--bg:#f4f7f6;--card:#fff;--text:#183044;--muted:#748392;--danger:#d83b3b;--line:#dfe7e3}
*{box-sizing:border-box}body{margin:0;font-family:Tahoma,Arial,sans-serif;background:var(--bg);color:var(--text);direction:rtl}a{text-decoration:none;color:inherit}.app{display:grid;grid-template-columns:245px 1fr;min-height:100vh}.sidebar{background:linear-gradient(180deg,#075a39,#06472f);color:#fff;padding:18px 12px;position:sticky;top:0;height:100vh;overflow:auto}.brand{text-align:center;padding:8px 6px 18px;border-bottom:1px solid rgba(255,255,255,.18)}.brand img{max-width:110px;max-height:95px;object-fit:contain;background:#fff;border-radius:16px;padding:7px}.brand h2{font-size:20px;margin:8px 0 2px}.brand small{color:#ffd7b0}.nav{margin-top:14px}.nav a{display:flex;gap:10px;align-items:center;padding:11px 12px;border-radius:9px;margin:3px 0;color:#f7fffb}.nav a:hover,.nav a.active{background:#fff;color:var(--green);font-weight:700}.nav .sep{height:1px;background:rgba(255,255,255,.18);margin:10px 4px}.main{min-width:0}.topbar{height:72px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:18px;padding:0 24px;position:sticky;top:0;z-index:10}.search{flex:1;max-width:650px;background:#f0f4f3;border:1px solid #e2e9e6;border-radius:24px;padding:4px 10px;color:var(--muted);display:flex;align-items:center}.search input{flex:1;border:0;background:transparent;padding:8px;outline:0;font:inherit}.search button{border:0;background:transparent;color:var(--green);font-size:22px;cursor:pointer}.userbox{margin-right:auto;text-align:left}.content{padding:18px 20px 38px}.hero{height:160px;border-radius:16px;overflow:hidden;position:relative;background:linear-gradient(90deg,#f7fbf8 0%,#e8f3ea 58%,#fdf5e8 100%);border:1px solid #e1ebe5;display:flex;align-items:center;padding:24px 34px;margin-bottom:16px}.hero .copy{z-index:2;max-width:55%}.hero h1{color:var(--green);font-size:33px;margin:0 0 8px}.hero p{font-size:18px;color:#365}.hero .sacks{position:absolute;left:24px;bottom:0;height:100%;display:flex;gap:4px;align-items:end;opacity:.94}.hero .sacks img{height:138px;max-width:110px;object-fit:contain;filter:drop-shadow(0 5px 6px rgba(0,0,0,.12))}.grid{display:grid;gap:14px}.kpis{grid-template-columns:repeat(5,1fr)}.card{background:#fff;border:1px solid #e1e7e4;border-radius:14px;padding:16px;box-shadow:0 2px 8px rgba(17,67,46,.04)}.kpi{display:flex;align-items:center;gap:12px}.kpi .icon{width:52px;height:52px;border-radius:13px;background:#e9f6f0;color:var(--green);display:flex;align-items:center;justify-content:center;font-size:26px}.kpi strong{display:block;font-size:24px;color:var(--green)}.muted{color:var(--muted);font-size:13px}.quick{grid-template-columns:repeat(4,1fr);margin:14px 0}.btn{border:0;border-radius:9px;padding:10px 15px;font-weight:700;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:7px}.btn.green{background:var(--green2);color:#fff}.btn.orange{background:var(--orange);color:#fff}.btn.light{background:#eef4f1;color:var(--green)}.btn.danger{background:#ffe9e9;color:var(--danger)}.quick .btn{font-size:17px;padding:15px}.two{grid-template-columns:1.6fr 1fr}.three{grid-template-columns:repeat(3,1fr)}.section-title{font-size:20px;color:#173a2d;margin:0 0 12px;display:flex;justify-content:space-between;align-items:center}.table-wrap{overflow:auto}.table{width:100%;border-collapse:collapse;font-size:14px}.table th{background:#eef3f1;color:#3b4d47;font-weight:700;padding:10px;border-bottom:1px solid #dbe4e0;white-space:nowrap}.table td{padding:9px 10px;border-bottom:1px solid #edf1ef;white-space:nowrap}.table tr:hover td{background:#fbfdfc}.badge{display:inline-block;padding:4px 9px;border-radius:20px;font-size:12px;font-weight:700}.badge.ok{background:#def4e8;color:#087248}.badge.warn{background:#fff0d5;color:#aa6600}.badge.bad{background:#ffe4e4;color:#c23030}.form-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.field label{display:block;font-size:13px;font-weight:700;margin-bottom:6px;color:#354b43}.field input,.field select,.field textarea{width:100%;padding:10px 11px;border:1px solid #ccd9d3;border-radius:8px;background:#fff;font:inherit}.field textarea{min-height:88px;resize:vertical}.span-2{grid-column:span 2}.span-3{grid-column:span 3}.span-4{grid-column:span 4}.form-actions{display:flex;gap:8px;margin-top:14px;flex-wrap:wrap}.flash{padding:12px 14px;border-radius:9px;margin-bottom:12px}.flash.ok{background:#e6f5ec;color:#0b6a43}.flash.error{background:#ffe8e8;color:#a12525}.page-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}.page-head h1{margin:0;font-size:28px;color:#173f30}.warehouse-cards{grid-template-columns:repeat(3,1fr)}.warehouse-card{display:flex;align-items:center;gap:12px}.warehouse-card .bigicon{font-size:38px;color:var(--green)}.bar-chart{height:220px;display:flex;align-items:end;gap:22px;padding:18px 12px 30px;border-bottom:1px solid #dfe6e2}.bar-chart .bar{flex:1;background:linear-gradient(#29a86b,#0d7a4e);border-radius:7px 7px 0 0;min-height:3px;position:relative}.bar-chart .bar span{position:absolute;bottom:-26px;right:50%;transform:translateX(50%);font-size:12px;white-space:nowrap}.metric-list{display:grid;grid-template-columns:repeat(2,1fr);gap:9px}.metric{background:#f5faf7;border:1px solid #e2eee8;border-radius:10px;padding:12px}.metric b{font-size:20px;color:var(--green)}.line-row{display:grid;grid-template-columns:2fr 1fr 1fr 1fr auto;gap:8px;align-items:end;margin-bottom:7px}.line-row input,.line-row select{padding:8px;border:1px solid #ccd9d3;border-radius:7px;width:100%}.print-only{display:none}@media(max-width:1100px){.app{grid-template-columns:88px 1fr}.brand h2,.brand small,.nav .label{display:none}.brand img{max-width:58px}.kpis{grid-template-columns:repeat(2,1fr)}.quick{grid-template-columns:repeat(2,1fr)}.form-grid{grid-template-columns:repeat(2,1fr)}.span-4{grid-column:span 2}.hero .copy{max-width:70%}.two,.three,.warehouse-cards{grid-template-columns:1fr}}@media print{.sidebar,.topbar,.no-print{display:none!important}.app{display:block}.content{padding:0}.card{box-shadow:none;border:0}.print-only{display:block}}
/* v1.1 enhancements */
.actions{display:flex;gap:6px;align-items:center;flex-wrap:wrap}.inline-form{display:inline;margin:0}.btn.small{padding:6px 9px;font-size:12px}.info-box,.unit-help{background:#eef8f3;border:1px solid #d4eadf;color:#285847;padding:10px 12px;border-radius:9px;margin-bottom:12px;font-size:13px}.sale-line-head,.production-head{display:grid;gap:8px;color:#5b6d65;font-size:12px;font-weight:bold;margin:6px 0}.sale-line-head{grid-template-columns:2fr 1.4fr .8fr .8fr .9fr .7fr .9fr auto}.sale-line{grid-template-columns:2fr 1.4fr .8fr .8fr .9fr .7fr .9fr auto}.sale-line-total{align-self:center;text-align:center;font-weight:900;color:var(--green);white-space:nowrap}.production-head,.production-output{grid-template-columns:1.8fr 1.8fr .7fr .8fr 1fr auto}.report-kpis{grid-template-columns:repeat(6,1fr);margin-top:12px}.kpi-mini span{display:block;color:var(--muted);font-size:12px}.kpi-mini b{display:block;color:var(--green);font-size:20px;margin-top:6px}.kpi-mini .red{color:#c23030}.kpi-mini .orange-text{color:var(--orange)}.kpi-mini small{color:var(--muted)}.report-range{text-align:center;color:#53665e;margin:12px}.count-table input{min-width:110px;padding:7px;border:1px solid #ccd9d3;border-radius:6px}
.a5-sheet{position:relative;width:148mm;min-height:210mm;margin:0 auto;background:#fff;color:#202b31;padding:8mm 7mm 7mm;box-shadow:0 3px 18px rgba(0,0,0,.12);overflow:hidden}.draft-watermark{position:absolute;z-index:0;top:88mm;left:14mm;right:14mm;text-align:center;font-size:72px;font-weight:900;color:rgba(190,70,50,.07);transform:rotate(-28deg);pointer-events:none}.a5-sheet>*{position:relative;z-index:1}.inv-brand{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #9a6b48;padding-bottom:5mm}.inv-logo{display:flex;align-items:center;gap:4mm}.inv-logo img{width:27mm;height:25mm;object-fit:contain}.inv-logo h1{margin:0;color:#1f2c30;font-size:25px}.inv-logo p{margin:2px 0 0;color:#775139;font-weight:bold}.inv-tagline{font-size:11px;color:#4b5558;border-bottom:1px solid #9a6b48;padding-bottom:2mm}.inv-title-row{display:flex;justify-content:space-between;align-items:stretch;margin:7mm -7mm 6mm}.inv-title{background:linear-gradient(125deg,#5a3825,#8b5b38);color:#fff;padding:5mm 10mm 5mm 8mm;min-width:64mm;display:flex;align-items:center;gap:4mm;clip-path:polygon(0 0,88% 0,100% 100%,0 100%)}.inv-title strong{display:block;font-size:27px}.inv-title small{display:block;letter-spacing:3px;margin-top:1mm}.cart-icon{font-size:30px}.inv-meta{flex:1;background:linear-gradient(90deg,#fafafa,#e8ecee);display:flex;align-items:center;justify-content:center;gap:8mm;padding:4mm}.inv-meta>div{border-left:1px solid #999;padding-left:7mm}.inv-meta>div:first-child{border-left:0}.inv-meta span{display:block;font-weight:bold;font-size:11px}.inv-meta b{font-size:14px}.customer-box{background:linear-gradient(90deg,#f8f9f9,#e9edef);border-radius:5mm;padding:7mm 5mm 4mm;position:relative;margin-bottom:5mm}.box-label{position:absolute;right:0;top:-4mm;background:linear-gradient(120deg,#222,#5c5c5c);color:#fff;padding:2.5mm 7mm;border-radius:0 4mm 0 4mm;font-weight:bold}.customer-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:4mm;text-align:center}.customer-grid span{display:block;font-size:10px;font-weight:bold}.customer-grid b{display:block;margin-top:2mm;font-size:12px}.invoice-table{width:100%;border-collapse:separate;border-spacing:0;border:1px solid #555;border-radius:4mm;overflow:hidden;font-size:10px}.invoice-table th{background:linear-gradient(#2b2b2b,#505050);color:#fff;padding:3mm 2mm}.invoice-table td{padding:3mm 2mm;text-align:center;border-top:1px solid #d3d3d3;border-left:1px solid #d3d3d3}.invoice-table td:first-child{border-left:0}.invoice-table td:first-child{text-align:right;font-weight:bold}.invoice-summary{display:grid;grid-template-columns:1fr 1fr;gap:4mm;margin-top:5mm}.net-box{background:linear-gradient(120deg,#5b3925,#8b5d3d);color:#fff;border-radius:4mm;padding:5mm;display:flex;align-items:center;justify-content:space-between}.net-box span{font-size:17px;font-weight:bold}.net-box b{font-size:27px}.net-box small{font-size:13px}.pay-box{background:linear-gradient(90deg,#f6f7f7,#e6e9ea);border-radius:4mm;padding:3mm 5mm}.pay-box div{display:flex;justify-content:space-between;padding:1.5mm 0;border-bottom:1px solid #bbb}.pay-box div:last-child{border:0}.invoice-notes{margin-top:7mm;font-size:10px}.invoice-notes div{height:13mm;border-bottom:1px solid #666;padding-top:2mm}.invoice-footer{margin-top:8mm;border-top:1px solid #93613d;padding-top:4mm;display:flex;align-items:flex-end;gap:4mm}.rabbit-mark{font-size:34px;opacity:.16}.company-lines{flex:1;font-size:9px;line-height:1.8}.footer-slogan{text-align:left;font-weight:bold;color:#6b442d;margin-top:2mm}
@media(max-width:1200px){.report-kpis{grid-template-columns:repeat(3,1fr)}}
@media(max-width:800px){.sale-line-head,.production-head{display:none}.sale-line,.production-output{grid-template-columns:1fr 1fr}.report-kpis{grid-template-columns:1fr 1fr}}
@media print{@page{size:A5 portrait;margin:0}.a5-sheet{width:148mm;height:210mm;min-height:210mm;margin:0;padding:7mm 7mm 6mm;box-shadow:none;page-break-after:avoid}.a5-sheet .invoice-table{font-size:9px}.a5-sheet .inv-brand{padding-bottom:3mm}.a5-sheet .inv-title-row{margin-top:4mm;margin-bottom:4mm}.a5-sheet .customer-box{margin-bottom:4mm;padding-top:6mm}.a5-sheet .invoice-summary{margin-top:4mm}.a5-sheet .invoice-notes{margin-top:5mm}.a5-sheet .invoice-footer{margin-top:5mm}}

/* v1.2 Hybrid PWA / responsive layer */
.connectivity-banner{position:fixed;z-index:2000;top:0;right:0;left:0;background:#7d2e1f;color:#fff;padding:9px 14px;text-align:center;font-size:13px;box-shadow:0 2px 8px rgba(0,0,0,.18)}
.is-offline body{padding-top:38px}.is-offline .sidebar{top:38px;height:calc(100vh - 38px)}.is-offline .topbar{top:38px}
.install-pwa-btn,.mobile-menu-btn{border:0;border-radius:9px;background:#e8f4ee;color:var(--green);font:inherit;font-weight:700;padding:9px 12px;cursor:pointer;white-space:nowrap}
.mobile-menu-btn{display:none;font-size:20px;padding:7px 11px}
.offline-write-toast{position:fixed;z-index:3000;bottom:22px;left:50%;transform:translate(-50%,20px);opacity:0;max-width:90vw;background:#7d2e1f;color:#fff;padding:12px 18px;border-radius:10px;box-shadow:0 7px 25px rgba(0,0,0,.25);transition:.2s ease;text-align:center}
.offline-write-toast.show{transform:translate(-50%,0);opacity:1}.offline-body{min-height:100vh;display:grid;place-items:center;background:linear-gradient(140deg,#edf6f1,#f8f5ed)}.offline-card{width:min(540px,92vw);background:#fff;border:1px solid var(--line);border-radius:20px;padding:30px;text-align:center;box-shadow:0 12px 38px rgba(7,75,47,.12)}.offline-card img{width:125px;max-height:150px;object-fit:contain}.offline-card h1{color:var(--green);margin:12px 0 2px}.offline-card h2{margin:14px 0 6px;color:#7d2e1f}.offline-card p{line-height:1.9;color:#52665d}
.sidebar-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.35);z-index:998}.sidebar-backdrop[hidden]{display:none}
@media(max-width:760px){
  .app{display:block}.main{width:100%}.sidebar{position:fixed;z-index:999;right:0;top:0;width:min(82vw,310px);height:100dvh;transform:translateX(110%);transition:transform .22s ease;box-shadow:-8px 0 30px rgba(0,0,0,.22)}.sidebar.mobile-open{transform:translateX(0)}
  .brand h2,.brand small,.nav .label{display:block}.brand img{max-width:82px}.mobile-menu-btn{display:inline-flex}.topbar{height:auto;min-height:62px;padding:8px 10px;gap:8px;flex-wrap:wrap}.app-title{font-size:17px!important}.search{order:3;flex-basis:100%;max-width:none}.userbox{display:none}.install-pwa-btn{margin-right:auto;font-size:12px}.content{padding:12px 10px 28px}
  .hero{height:auto;min-height:140px;padding:18px}.hero .copy{max-width:100%}.hero h1{font-size:24px}.hero .sacks{opacity:.18;left:4px}.kpis,.quick,.two,.three,.warehouse-cards,.form-grid,.report-kpis{grid-template-columns:1fr}.span-2,.span-3,.span-4{grid-column:span 1}.card{padding:12px}.page-head{align-items:flex-start;gap:10px}.page-head h1{font-size:22px}.table{font-size:12px}.table th,.table td{padding:8px 7px}.line-row,.sale-line,.production-output{grid-template-columns:1fr}.sale-line-head,.production-head{display:none}
  .form-actions{position:sticky;bottom:0;background:rgba(244,247,246,.96);padding:9px 0;z-index:8}.form-actions .btn{flex:1;min-width:120px}.a5-sheet{transform-origin:top right;box-shadow:none;max-width:100%}.invoice-summary{grid-template-columns:1fr}.customer-grid{grid-template-columns:1fr}.inv-brand{gap:3mm}.inv-logo h1{font-size:18px}.inv-logo img{width:22mm;height:20mm}.inv-title-row{display:block;margin-left:0;margin-right:0}.inv-title{clip-path:none;width:100%;min-width:0}.inv-meta{margin-top:2mm}.company-lines{font-size:8px}
}
@media(max-width:420px){.app-title{max-width:165px}.install-pwa-btn{padding:7px 9px}.kpi strong{font-size:20px}.hero h1{font-size:21px}.page-head{flex-direction:column}.page-head>.btn{width:100%}}
@media(display-mode:standalone){body{padding-top:env(safe-area-inset-top)}.topbar{padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right))}.install-pwa-btn{display:none!important}}

.searchable-select-wrap{display:grid;grid-template-columns:minmax(105px,.9fr) minmax(130px,1.4fr);gap:6px;align-items:center;width:100%}.searchable-select-wrap .select-filter{width:100%;padding:8px;border:1px solid #b9cec5;border-radius:7px;background:#f7fbf9;font:inherit;min-width:0}.searchable-select-wrap select{min-width:0}.actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.doc-company-footer{margin-top:26px;padding-top:12px;border-top:2px solid var(--green);font-size:12px;color:#455;display:grid;gap:4px}.share-hint{font-size:12px;color:var(--muted);margin-top:5px}@media(max-width:760px){.searchable-select-wrap{grid-template-columns:1fr}.select-filter{font-size:16px}}

/* v1.5 production packaging + monochrome invoice designer */
.production-output-card{display:block!important;border:1px solid var(--line);border-radius:12px;padding:12px;margin-bottom:12px;background:#fff}.production-main-grid{display:grid;grid-template-columns:1.5fr 1.5fr .75fr .75fr auto;gap:9px;align-items:end}.production-main-grid .remove-output{margin-bottom:1px}.packing-box{margin-top:10px;padding:10px;border:1px dashed #aebdb6;border-radius:10px;background:#f9fbfa}.packing-title{font-weight:800;margin-bottom:9px}.packing-title small{font-weight:400;color:var(--muted);margin-right:8px}.packing-grid{display:grid;grid-template-columns:repeat(4,minmax(125px,1fr));gap:8px}.free-consume-row{grid-template-columns:3fr 1fr auto!important}.error-box{border-color:#e2a6a6!important;color:#9b2929!important}.invoice-options{display:grid;grid-template-columns:1fr 1fr;gap:12px}.invoice-options label{display:flex;gap:8px;align-items:center;padding:8px;border:1px solid var(--line);border-radius:8px;background:#fafafa}.invoice-options input{width:auto}
.invoice-bw{--invoice-font:13px;color:#111!important;background:#fff!important;font-size:var(--invoice-font)!important}.bw-header{display:flex;justify-content:space-between;align-items:center;border-bottom:2px solid #111;padding-bottom:4mm;margin-bottom:3mm}.bw-brand{display:flex;align-items:center;gap:4mm}.bw-brand img{width:26mm;height:23mm;object-fit:contain;filter:grayscale(1)}.bw-brand h1{font-size:21px;margin:0;color:#111}.bw-brand p{font-size:10px;margin:1mm 0 0;color:#222}.bw-doc-title{text-align:left}.bw-doc-title strong{display:block;font-size:21px}.bw-doc-title small{font-size:8px;letter-spacing:2px}.bw-meta{display:grid;grid-template-columns:repeat(3,1fr);border:1px solid #111;margin-bottom:4mm}.bw-meta>div{padding:2.5mm;border-left:1px solid #111;text-align:center}.bw-meta>div:last-child{border-left:0}.bw-meta b,.bw-meta span{display:block}.bw-meta b{font-size:9px}.bw-meta span{font-size:11px;margin-top:1mm}.bw-section{margin-bottom:4mm;border:1px solid #111}.bw-section-title{font-weight:800;padding:1.5mm 2mm;border-bottom:1px solid #111}.bw-customer{display:grid;grid-template-columns:repeat(3,1fr);gap:2mm;padding:2.5mm}.bw-table{border-collapse:collapse!important;border-radius:0!important;border:1px solid #111!important;color:#111!important;background:#fff!important}.bw-table th{background:#fff!important;color:#111!important;border:1px solid #111!important;padding:2.2mm 1.5mm!important}.bw-table td{border:1px solid #111!important;padding:2.2mm 1.5mm!important;background:#fff!important}.bw-totals{display:flex;justify-content:flex-end;gap:0;margin-top:4mm}.bw-totals>div{min-width:35mm;border:1px solid #111;border-left:0;padding:2.5mm 3mm;display:flex;justify-content:space-between;gap:5mm}.bw-totals>div:first-child{border-left:1px solid #111}.bw-notes{margin-top:4mm;border-bottom:1px solid #111;min-height:12mm;padding:2mm}.bw-notes b{margin-left:3mm}.bw-footer{margin-top:7mm;border-top:1px solid #111;padding-top:2.5mm;text-align:center;font-size:8.5px;line-height:1.7}.bw-footer strong{display:block;margin-top:1mm}.invoice-bw.compact{--invoice-font:11px}.invoice-bw.compact .bw-table th,.invoice-bw.compact .bw-table td{padding:1.5mm 1mm!important}.invoice-bw.compact .bw-footer{margin-top:4mm}.print-document{max-width:850px;margin:auto}.print-document .generic-doc-body .table{border-collapse:collapse}.print-document .generic-doc-body .table th,.print-document .generic-doc-body .table td{background:#fff!important;color:#111!important;border:1px solid #111!important}.print-document .generic-doc-body h1,.print-document .generic-doc-body h2,.print-document .generic-doc-body h3{color:#111!important}.print-document .generic-doc-body .badge{background:#fff!important;color:#111!important;border:1px solid #111}
@media(max-width:900px){.production-main-grid{grid-template-columns:1fr 1fr}.packing-grid{grid-template-columns:1fr 1fr}.invoice-options{grid-template-columns:1fr}}
@media(max-width:600px){.production-main-grid,.packing-grid{grid-template-columns:1fr}.free-consume-row{grid-template-columns:1fr!important}}
@media print{
  .invoice-bw,.invoice-bw *{-webkit-print-color-adjust:economy!important;print-color-adjust:economy!important;color:#000!important;background:#fff!important;box-shadow:none!important;text-shadow:none!important}
  .invoice-bw img{filter:grayscale(1)!important}.bw-header,.bw-meta,.bw-section,.bw-table,.bw-table th,.bw-table td,.bw-totals>div,.bw-footer{border-color:#000!important}
  .print-document{border:0!important;box-shadow:none!important;padding:7mm!important;width:148mm!important;min-height:200mm!important;margin:0 auto!important}
}
.balance-picks{max-height:260px;overflow:auto}

/* v1.6 invoice designer + permissions */
.permission-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 14px}.permission-grid label{display:flex;align-items:center;gap:8px;padding:8px 10px;border:1px solid #dfe7e3;border-radius:9px;background:#fafcfb}.permission-grid input{width:auto}
.invoice-template-grid{display:grid;grid-template-columns:repeat(5,minmax(150px,1fr));gap:10px}.invoice-template-card{border:2px solid #dce4e0;border-radius:12px;padding:12px;cursor:pointer;background:#fff;display:flex;flex-direction:column;gap:5px;min-height:135px}.invoice-template-card input{width:auto;align-self:flex-start}.invoice-template-card b{color:#173f32}.invoice-template-card span{font-size:12px;color:#66736e}.invoice-template-card.selected{border-color:#0b8656;box-shadow:0 0 0 2px rgba(11,134,86,.08)}.template-mini{margin-top:auto;border:1px solid #333;padding:5px;height:45px;display:flex;flex-direction:column;gap:4px}.template-mini i{display:block;height:5px;background:#333}.template-mini i:nth-child(2){width:70%}.template-mini i:nth-child(3){width:88%}.template-minimal{border-style:dashed}.template-modern i:first-child{width:45%}.template-bordered{border-width:2px}.template-compact{gap:2px;padding:3px}
.invoice-signature{margin-top:7mm;display:flex;justify-content:flex-end;gap:4mm;align-items:flex-end}.invoice-signature span{font-weight:700}.invoice-signature i{display:block;width:48mm;border-bottom:1px solid #111;height:7mm}
/* Template 1: classic */
.tpl-classic .bw-header{border-bottom:2px solid #111}.tpl-classic .bw-section-title{background:#fff}
/* Template 2: compact */
.tpl-compact{padding:5mm 5mm 5mm!important}.tpl-compact .bw-header{padding-bottom:2mm;margin-bottom:2mm}.tpl-compact .bw-brand img{width:20mm;height:18mm}.tpl-compact .bw-brand h1{font-size:17px}.tpl-compact .bw-meta{margin-bottom:2mm}.tpl-compact .bw-meta>div,.tpl-compact .bw-customer{padding:1.5mm}.tpl-compact .bw-section{margin-bottom:2mm}.tpl-compact .bw-table th,.tpl-compact .bw-table td{padding:1.2mm .8mm!important}.tpl-compact .bw-totals{margin-top:2mm}.tpl-compact .bw-footer{margin-top:3mm}
/* Template 3: modern */
.tpl-modern .bw-header{border:0;border-right:5px solid #111;padding:2mm 4mm 2mm 0}.tpl-modern .bw-doc-title{border:1px solid #111;padding:2mm 4mm}.tpl-modern .bw-meta{border:0;border-bottom:1px solid #111}.tpl-modern .bw-meta>div{border:0}.tpl-modern .bw-section{border:0;border-bottom:1px solid #111}.tpl-modern .bw-section-title{border:0;font-size:11px}.tpl-modern .bw-table{border-left:0!important;border-right:0!important}.tpl-modern .bw-table th,.tpl-modern .bw-table td{border-left:0!important;border-right:0!important}
/* Template 4: bordered */
.tpl-bordered{border:2px solid #111!important;padding:6mm!important}.tpl-bordered .bw-header{border:2px solid #111;padding:3mm;margin-bottom:3mm}.tpl-bordered .bw-meta,.tpl-bordered .bw-section,.tpl-bordered .bw-table{border-width:2px!important}.tpl-bordered .bw-footer{border-top:2px double #111}
/* Template 5: minimal */
.tpl-minimal .bw-header{border-bottom:1px solid #111}.tpl-minimal .bw-brand img{width:20mm;height:18mm}.tpl-minimal .bw-doc-title strong{font-size:17px}.tpl-minimal .bw-meta{border:0;margin-bottom:2mm}.tpl-minimal .bw-meta>div{border:0;padding:1mm;text-align:right}.tpl-minimal .bw-section{border:0;margin-bottom:2mm}.tpl-minimal .bw-section-title{display:none}.tpl-minimal .bw-customer{padding:1mm 0}.tpl-minimal .bw-table{border:0!important}.tpl-minimal .bw-table th{border-top:1px solid #111!important;border-bottom:1px solid #111!important;border-left:0!important;border-right:0!important}.tpl-minimal .bw-table td{border-left:0!important;border-right:0!important}.tpl-minimal .bw-totals>div{border:0;border-top:1px solid #111}.tpl-minimal .bw-footer{font-size:8px}
@media(max-width:1000px){.invoice-template-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:620px){.invoice-template-grid,.permission-grid{grid-template-columns:1fr}}

/* v1.6.1 multi-page A5 invoices: never truncate long invoices. */
.a5-sheet{overflow:visible}
@media print{
  @page{size:A5 portrait;margin:6mm}
  .a5-sheet,.print-document{
    width:auto!important;
    height:auto!important;
    min-height:198mm!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
    box-shadow:none!important;
    page-break-after:auto!important;
  }
  .invoice-table,.bw-table{overflow:visible!important}
  .invoice-table thead,.bw-table thead{display:table-header-group!important}
  .invoice-table tfoot,.bw-table tfoot{display:table-footer-group!important}
  .invoice-table tr,.bw-table tr{break-inside:avoid!important;page-break-inside:avoid!important}
  .bw-header,.bw-meta,.bw-section,.bw-totals,.bw-notes,.bw-footer,.invoice-signature{
    break-inside:avoid!important;page-break-inside:avoid!important;
  }
}
.invoice-items-cell{white-space:normal;min-width:260px;line-height:1.7}.invoice-items-cell>div{border-bottom:1px dashed #e5ece8;padding:2px 0}.invoice-items-cell>div:last-child{border-bottom:0}.sensitive-permissions{border:1px solid #f0c7c7;background:#fffafa}.sensitive-permissions h3,.sensitive-permissions h4{color:#a22}

/* v1.6.4 grouped navigation */
.nav-group{margin:4px 0;border-radius:10px;overflow:hidden}.nav-group>summary{list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:11px 12px;border-radius:9px;color:#f7fffb;font-weight:700;user-select:none}.nav-group>summary::-webkit-details-marker{display:none}.nav-group>summary:hover,.nav-group[open]>summary{background:rgba(255,255,255,.12)}.nav-main-right{display:flex;align-items:center;gap:10px}.nav-chevron{font-size:24px;line-height:1;transition:transform .18s ease}.nav-group[open] .nav-chevron{transform:rotate(-90deg)}.nav-submenu{padding:3px 8px 6px 2px}.nav-submenu a{padding:9px 12px!important;margin:2px 0!important;font-size:14px;background:rgba(255,255,255,.035)}.nav-submenu a span:first-child{width:21px;text-align:center}.nav-home{font-weight:800}.list-search-form{display:flex;gap:7px;align-items:center;flex-wrap:wrap}.list-search-form input,.warehouse-selector select{min-width:260px;padding:9px 11px;border:1px solid var(--line);border-radius:8px;background:#fff;font:inherit}.warehouse-selector{display:flex;gap:8px;align-items:end;flex-wrap:wrap}.warehouse-selector .field{min-width:300px}.invoice-live-summary{display:grid;grid-template-columns:repeat(3,minmax(160px,1fr));gap:10px;margin-top:14px}.invoice-live-summary .summary-box{border:1px solid var(--line);border-radius:11px;padding:12px;background:#f9fbfa}.invoice-live-summary .summary-box span{display:block;color:var(--muted);font-size:13px}.invoice-live-summary .summary-box b{display:block;font-size:22px;margin-top:5px}.invoice-live-summary .remaining b{color:var(--orange)}.quick .finance-quick{background:#fff;color:var(--green);border:1px solid #bdd8cc}.inventory-filter{display:flex;gap:8px;align-items:end;flex-wrap:wrap;margin-bottom:12px}.inventory-filter .field{min-width:220px}
@media(max-width:760px){.invoice-live-summary{grid-template-columns:1fr}.nav-group>summary{padding:12px}.list-search-form input,.warehouse-selector .field{min-width:100%;width:100%}}
.warehouse-card.warehouse-selected{border:2px solid var(--green);box-shadow:0 0 0 2px rgba(8,99,62,.07)}

/* v1.6.7 advanced invoice designer */
.invoice-bw{padding:var(--designer-pad,8mm)!important;font-family:var(--designer-font,Arial),sans-serif!important;line-height:var(--designer-line-height,1.35)!important}
.invoice-bw.designer-page-border{outline:1.5px solid #111;outline-offset:-4mm}
.custom-invoice-layout{display:flex;flex-direction:column;align-items:stretch;min-height:100%}
.designer-print-section{box-sizing:border-box;max-width:100%}
.designer-print-section .bw-header,.designer-print-section .bw-meta,.designer-print-section .bw-section,.designer-print-section .bw-table,.designer-print-section .bw-totals,.designer-print-section .bw-notes,.designer-print-section .bw-footer{margin-top:0!important;margin-bottom:0!important}
.designer-header.header-layout-stacked{flex-direction:column;gap:2mm;align-items:center;text-align:center}
.designer-header.header-layout-stacked .bw-doc-title{text-align:center}
.designer-header.logo-side-left{direction:ltr}.designer-header.logo-side-left .bw-brand{direction:rtl}.designer-header.logo-side-left .bw-doc-title{direction:rtl;text-align:right}
.designer-header.logo-side-center{flex-direction:column;align-items:center;text-align:center}.designer-header.logo-side-center .bw-doc-title{text-align:center}
.designer-header .bw-brand img{width:var(--designer-logo-width,26mm)!important;height:auto!important;max-height:32mm!important}
.designer-table{table-layout:fixed;width:100%!important}
.designer-table th,.designer-table td{overflow-wrap:anywhere;word-break:normal;vertical-align:middle}
.section-totals .bw-totals{width:100%}
.section-footer .bw-footer{width:100%}
@media print{
  .invoice-bw{padding:var(--designer-pad,8mm)!important}
  .designer-print-section{break-inside:auto}
  .section-header,.section-meta,.section-customer,.section-totals,.section-notes,.section-signature,.section-footer{break-inside:avoid!important;page-break-inside:avoid!important}
  .section-table{break-inside:auto!important;page-break-inside:auto!important}
  .designer-table thead{display:table-header-group!important}
  .designer-table tr{break-inside:avoid!important;page-break-inside:avoid!important}
}

/* v1.7.0 workspace tabs */
.main{height:100vh;display:flex;flex-direction:column;overflow:hidden}.topbar{flex:0 0 72px}.workspace-tabs{flex:0 0 43px;display:flex;align-items:flex-end;gap:4px;padding:5px 10px 0;background:#edf2ef;border-bottom:1px solid #d6e0db;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;direction:rtl}.workspace-tab{height:34px;min-width:145px;max-width:260px;border:1px solid #d2ddd7;border-bottom:0;background:#f7faf8;color:#43564d;border-radius:9px 9px 0 0;padding:0 10px;display:flex;align-items:center;justify-content:space-between;gap:10px;cursor:pointer;font:inherit;font-size:13px}.workspace-tab:hover{background:#fff}.workspace-tab.active{background:#fff;color:var(--green);font-weight:800;border-color:#b8cdc2;box-shadow:0 -2px 6px rgba(0,0,0,.04)}.workspace-tab-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.workspace-tab-close{font-size:19px;line-height:1;color:#8b9992;border-radius:50%;width:22px;height:22px;display:grid;place-items:center;flex:0 0 22px}.workspace-tab-close:hover{background:#fee8e8;color:#b32626}.workspace-tab.dirty .workspace-tab-title:before{content:'●';font-size:8px;color:var(--orange);margin-left:6px}.workspace-frames{flex:1;min-height:0;position:relative;background:var(--bg)}.workspace-frame{position:absolute;inset:0;width:100%;height:100%;border:0;background:var(--bg)}#rootContent{flex:1;min-height:0;overflow:auto}.workspace-frames:empty{display:none}.embedded-page body,.embedded-page body.embedded-page{overflow:auto!important}.embedded-page .sidebar,.embedded-page .topbar,.embedded-page #workspaceTabs,.embedded-page #workspaceFrames{display:none!important}.embedded-page .app{display:block!important;min-height:100vh}.embedded-page .main{height:auto!important;display:block!important;overflow:visible!important}.embedded-page #rootContent,.embedded-page .content{display:block!important;overflow:visible!important;min-height:100vh;padding:18px 20px 38px}.embedded-page .no-print.page-head{display:flex!important}
@media(max-width:760px){.workspace-tab{min-width:125px;max-width:210px}.workspace-tabs{padding-right:6px}.main{height:100vh}}
@media print{.workspace-tabs,.workspace-frames{display:none!important}.main{height:auto!important;display:block!important;overflow:visible!important}#rootContent{overflow:visible!important}}

/* v1.7.0 professional A5 invoice */
.invoice-bw{color:#1f2a27!important}.invoice-bw .bw-header{border-bottom:1.4px solid #555!important;padding-bottom:3mm!important}.invoice-bw .bw-brand h1{font-weight:800;letter-spacing:.1px}.invoice-bw .bw-doc-title strong{font-weight:800}.invoice-bw .bw-meta{border:1px solid #777!important;border-radius:5px!important;overflow:hidden!important}.invoice-bw .bw-meta>div{border-color:#aaa!important;padding:1.7mm 2mm!important}.invoice-bw .bw-section{border:1px solid #8b928e!important;border-radius:5px!important;overflow:hidden!important}.invoice-bw .bw-section-title{font-size:10px!important;font-weight:800!important;padding:1.1mm 2mm!important;border-bottom:1px solid #b2b6b4!important}.invoice-bw .bw-customer{padding:1.6mm 2mm!important}.invoice-bw .designer-table{font-size:9px!important;border:1.2px solid #656b68!important;border-radius:5px!important;overflow:hidden!important;border-collapse:separate!important;border-spacing:0!important;table-layout:fixed!important;width:100%!important}.invoice-bw .designer-table th{font-size:8.6px!important;font-weight:800!important;padding:1.4mm .8mm!important;border:0!important;border-left:1px solid #9fa5a2!important;border-bottom:1.2px solid #666!important;background:#f4f5f5!important;color:#111!important;white-space:normal!important}.invoice-bw .designer-table td{font-size:8.7px!important;padding:1.35mm .8mm!important;border:0!important;border-left:1px solid #c7cbc9!important;border-bottom:1px solid #d5d8d6!important;white-space:normal!important;line-height:1.35!important}.invoice-bw .designer-table th:last-child,.invoice-bw .designer-table td:last-child{border-left:0!important}.invoice-bw .designer-table tbody tr:last-child td{border-bottom:0!important}.invoice-bw .items-total-row td{padding:1.4mm 1.6mm!important;border-top:1.3px solid #666!important;border-bottom:0!important;background:#fafafa!important}.items-grand-total{display:flex;align-items:center;justify-content:flex-end;gap:6mm;font-size:9px}.items-grand-total span{font-weight:700}.items-grand-total b{font-size:10px}.invoice-bw .professional-totals{display:grid!important;grid-template-columns:1fr 1fr!important;gap:3mm!important;width:100%!important;margin-top:2.5mm!important}.invoice-bw .totals-stack{border:1px solid #858b88;border-radius:5px;overflow:hidden;background:#fff}.invoice-bw .total-line{display:flex;align-items:center;justify-content:space-between;gap:4mm;padding:2mm 2.5mm;border-bottom:1px solid #d2d5d3;font-size:9px}.invoice-bw .total-line:last-child{border-bottom:0}.invoice-bw .total-line span{color:#4e5954;font-weight:700}.invoice-bw .total-line b{font-size:10px;color:#111}.invoice-bw .total-line.invoice-total,.invoice-bw .total-line.remaining{font-weight:800}.invoice-bw .total-line.invoice-total b,.invoice-bw .total-line.remaining b{font-size:11px}.invoice-bw .total-line small{font-size:7.5px;font-weight:400}.invoice-bw .bw-notes{border:0!important;border-bottom:1px solid #999!important;min-height:10mm!important;padding:2mm 0!important}.invoice-bw .invoice-signature i{border-bottom:1px solid #888!important}.invoice-bw .bw-footer{border-top:1px solid #aaa!important;color:#333!important;font-size:7.8px!important}.tpl-classic .bw-header,.tpl-minimal .bw-header{border-bottom-color:#555!important}.tpl-modern .bw-header{border-right:3px solid #555!important}.tpl-bordered{border:1.5px solid #666!important}.tpl-bordered .bw-header{border:1px solid #777!important}.tpl-bordered .bw-meta,.tpl-bordered .bw-section,.tpl-bordered .bw-table{border-width:1px!important}
@media print{.invoice-bw .designer-table{border-color:#555!important}.invoice-bw .designer-table th{background:#f2f2f2!important;-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}.invoice-bw .professional-totals{break-inside:avoid!important}.invoice-bw .items-total-row{break-inside:avoid!important}}

/* ===== v1.7.0 reference A5 invoice layout ===== */
.invoice-bw .custom-invoice-layout{
  display:flex!important; flex-direction:row!important; flex-wrap:wrap!important;
  align-items:stretch!important; justify-content:space-between!important;
  column-gap:2.5%!important; row-gap:0!important; min-height:100%!important;
}
.invoice-bw .designer-print-section{box-sizing:border-box;min-width:0}
.invoice-bw .designer-header{
  display:grid!important; grid-template-columns:.70fr 1.18fr 1.35fr!important;
  grid-template-areas:"logo doc company"!important; align-items:center!important;
  gap:4mm!important; direction:ltr!important; width:100%!important;
  border-bottom:1.7px solid #444!important; padding:1mm 0 3.2mm!important;
}
.invoice-bw .designer-header .bw-logo-mark{grid-area:logo;display:flex;align-items:center;justify-content:flex-start;direction:rtl}
.invoice-bw .designer-header .bw-logo-mark img{width:var(--designer-logo-width,23mm)!important;height:auto!important;max-height:27mm!important;object-fit:contain;filter:grayscale(1)}
.invoice-bw .designer-header .bw-doc-title{grid-area:doc;text-align:center!important;direction:rtl;line-height:1.12}
.invoice-bw .designer-header .bw-doc-title strong{font-size:17px!important;font-weight:900!important;display:block}
.invoice-bw .designer-header .bw-doc-title small{font-size:7.5px!important;letter-spacing:1.5px!important;display:block;margin-top:1mm;direction:ltr}
.invoice-bw .designer-header .bw-company-title{grid-area:company;text-align:right!important;direction:rtl}
.invoice-bw .designer-header .bw-company-title h1{margin:0!important;font-size:16px!important;font-weight:900!important;line-height:1.2}
.invoice-bw .designer-header .bw-company-title p{margin:1.2mm 0 0!important;font-size:8.5px!important;font-weight:700!important;color:#333!important}
.invoice-bw .designer-header.logo-side-right{grid-template-areas:"company doc logo"!important}
.invoice-bw .designer-header.logo-side-right .bw-logo-mark{justify-content:flex-end}
.invoice-bw .designer-header.logo-side-center{grid-template-columns:1fr .72fr 1fr!important;grid-template-areas:"doc logo company"!important}
.invoice-bw .designer-header.logo-side-center .bw-logo-mark{justify-content:center}
.invoice-bw .designer-header.header-layout-stacked{display:flex!important;flex-direction:column!important;gap:1.4mm!important;text-align:center!important}
.invoice-bw .designer-header.header-layout-stacked .bw-logo-mark{justify-content:center}
.invoice-bw .designer-header.header-layout-stacked .bw-company-title{text-align:center!important}

/* Side-by-side document/customer boxes like the approved reference. */
.invoice-bw .section-meta .bw-meta,
.invoice-bw .section-customer .bw-section{
  height:100%!important; margin:0!important; border:1.25px solid #666!important;
  border-radius:5px!important; overflow:hidden!important; background:#fff!important;
}
.invoice-bw .section-meta .bw-meta{display:flex!important;flex-direction:column!important;justify-content:stretch!important}
.invoice-bw .section-meta .bw-meta>div{
  flex:1 1 auto!important; display:flex!important;align-items:center!important;justify-content:space-between!important;
  gap:2mm!important;text-align:right!important;padding:1.5mm 2.3mm!important;
  border:0!important;border-bottom:1px solid #d0d0d0!important;direction:rtl!important;
}
.invoice-bw .section-meta .bw-meta>div:last-child{border-bottom:0!important}
.invoice-bw .section-meta .bw-meta b,.invoice-bw .section-meta .bw-meta span{display:inline!important;margin:0!important;font-size:8.5px!important}
.invoice-bw .section-meta .bw-meta b{font-weight:800!important}.invoice-bw .section-meta .bw-meta span{font-weight:600!important}
.invoice-bw .section-customer .bw-section-title{
  padding:1.4mm 2.2mm!important;background:#eeeeee!important;border-bottom:1px solid #b9b9b9!important;
  text-align:center!important;font-size:9.5px!important;font-weight:800!important;
  -webkit-print-color-adjust:exact!important;print-color-adjust:exact!important;
}
.invoice-bw .section-customer .bw-customer{display:flex!important;flex-direction:column!important;gap:1.1mm!important;padding:1.7mm 2.4mm!important;font-size:8.6px!important}
.invoice-bw .section-customer .bw-customer>div{display:flex;gap:1.5mm;line-height:1.35}

/* Softer, balanced item table. */
.invoice-bw .designer-table{
  width:100%!important;max-width:100%!important;table-layout:fixed!important;border-collapse:separate!important;border-spacing:0!important;
  border:1.25px solid #606060!important;border-radius:5px!important;overflow:hidden!important;font-size:8.7px!important;
}
.invoice-bw .designer-table th{
  background:#ededed!important;color:#111!important;font-size:8.4px!important;font-weight:900!important;
  padding:1.35mm .75mm!important;border:0!important;border-left:1px solid #a7a7a7!important;border-bottom:1.25px solid #666!important;
  line-height:1.25!important;word-break:normal!important;overflow-wrap:anywhere!important;
  -webkit-print-color-adjust:exact!important;print-color-adjust:exact!important;
}
.invoice-bw .designer-table td{
  background:#fff!important;color:#111!important;font-size:8.45px!important;font-weight:600!important;
  padding:1.25mm .75mm!important;border:0!important;border-left:1px solid #c9c9c9!important;border-bottom:1px solid #d7d7d7!important;
  line-height:1.28!important;overflow-wrap:anywhere!important;
}
.invoice-bw .designer-table tbody tr:nth-child(even) td{background:#fafafa!important;-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}
.invoice-bw .designer-table th:last-child,.invoice-bw .designer-table td:last-child{border-left:0!important}
.invoice-bw .designer-table tbody tr:last-child td{border-bottom:0!important}
.invoice-bw .items-total-row td{background:#f3f3f3!important;border-top:1.35px solid #666!important;padding:1.45mm 2mm!important;-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}
.invoice-bw .items-grand-total{display:flex!important;justify-content:flex-end!important;align-items:center!important;gap:4mm!important;font-size:8.7px!important}
.invoice-bw .items-grand-total b{font-size:9.5px!important}

/* Accounting summary: right = previous/paid, left = current invoice/remaining. */
.invoice-bw .professional-totals{display:grid!important;grid-template-columns:1fr 1fr!important;gap:3mm!important;width:100%!important;direction:rtl!important;margin-top:0!important}
.invoice-bw .totals-stack{border:1.25px solid #737373!important;border-radius:5px!important;overflow:hidden!important;background:#fff!important}
.invoice-bw .total-line{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:3mm!important;padding:1.7mm 2.2mm!important;border-bottom:1px solid #d0d0d0!important;font-size:8.7px!important;min-height:7mm!important}
.invoice-bw .total-line:last-child{border-bottom:0!important}.invoice-bw .total-line span{font-weight:800!important;color:#333!important}.invoice-bw .total-line b{font-size:9.4px!important;color:#111!important}
.invoice-bw .total-line.remaining b,.invoice-bw .total-line.invoice-total b{font-size:10px!important;font-weight:900!important}
.invoice-bw .total-line small{font-size:7px!important}
.invoice-bw .bw-notes{font-size:8.5px!important;min-height:8mm!important}.invoice-bw .invoice-signature{font-size:8.5px!important}
.invoice-bw .bw-footer{font-size:7.5px!important;line-height:1.45!important;margin-top:auto!important;padding-top:2mm!important}

@media print{
  .invoice-bw .custom-invoice-layout{column-gap:2.5%!important}
  .invoice-bw .section-meta,.invoice-bw .section-customer,.invoice-bw .section-totals,.invoice-bw .section-header{break-inside:avoid!important}
  .invoice-bw .designer-table thead{display:table-header-group!important}
  .invoice-bw .designer-table tfoot{display:table-row-group!important}
  .invoice-bw .designer-table tr{break-inside:avoid!important;page-break-inside:avoid!important}
}

/* ===== v1.7.2 A5 print hardening ===== */
@media print{
  html,body{margin:0!important;padding:0!important;background:#fff!important}
  .page-head,.no-print{display:none!important;height:0!important;min-height:0!important;margin:0!important;padding:0!important;overflow:hidden!important}
  .content{margin:0!important;padding:0!important}
  .a5-sheet{width:148mm!important;min-height:0!important;height:auto!important;margin:0!important;padding:4.5mm 6mm 4mm!important;box-shadow:none!important;overflow:visible!important;page-break-after:auto!important}
  .invoice-bw .designer-header{padding-top:0!important;padding-bottom:2.2mm!important;gap:3mm!important}
  .invoice-bw .section-meta .bw-meta>div{padding:1.1mm 2mm!important}
  .invoice-bw .section-customer .bw-section-title{padding:1.05mm 2mm!important}
  .invoice-bw .section-customer .bw-customer{padding:1.25mm 2mm!important;gap:.7mm!important}
  .invoice-bw .designer-table th{padding:1.05mm .65mm!important}
  .invoice-bw .designer-table td{padding:1.0mm .65mm!important}
  .invoice-bw .items-total-row td{padding:1.05mm 1.7mm!important}
  .invoice-bw .total-line{min-height:5.8mm!important;padding:1.25mm 2mm!important}
  .invoice-bw .bw-notes{min-height:6mm!important;margin-top:1.5mm!important}
  .invoice-bw .invoice-signature{margin-top:1.8mm!important}
  .invoice-bw .bw-footer{margin-top:2mm!important;padding-top:1.2mm!important}
}

/* ===== v1.9.0 orders / accounting / HR ===== */
.order-grid{display:grid!important;grid-template-columns:2.1fr 1.35fr .75fr .8fr .9fr 1.15fr 46px!important;gap:8px;align-items:center}.order-summary>div{padding:10px;border:1px solid #e6ece8;border-radius:10px}.order-summary h3{margin:4px 0}.accounting-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:18px}.accounting-card{display:flex;align-items:center;gap:14px;text-decoration:none;color:inherit;transition:.15s}.accounting-card:hover{transform:translateY(-2px);box-shadow:0 8px 28px rgba(15,74,51,.09)}.accounting-card>span{font-size:30px}.accounting-card h3{margin:0 0 5px}.accounting-card p{margin:0;color:#64756c}.coa-table .coa-group{font-weight:800;background:#f7faf8}.coa-level-0 td:nth-child(2){font-size:17px}.coa-level-1 td:nth-child(2){padding-right:28px}.coa-level-2 td:nth-child(2){padding-right:50px}.journal-grid{display:grid!important;grid-template-columns:2.2fr .8fr .8fr 1.5fr 46px!important;gap:8px;align-items:center}.journal-live-total{display:flex;gap:22px;justify-content:flex-end;padding:14px;margin-top:10px;background:#f8faf9;border-radius:10px}.statement-grid{display:grid;grid-template-columns:1fr 1fr;gap:24px}.statement-grid>div{border:1px solid #dce6e1;border-radius:12px;overflow:hidden}.statement-grid h2{margin:0;padding:12px 14px;background:#f2f7f4}.statement-line,.statement-total,.statement-grand{display:flex;justify-content:space-between;gap:14px;padding:10px 14px;border-top:1px solid #edf1ef}.statement-total{font-weight:800;background:#f7faf8}.statement-grand{margin-top:18px;border:2px solid #0b6945;border-radius:12px;font-size:20px;font-weight:900;background:#effaf5}.payroll-toolbar{margin-bottom:14px}.payroll-kpis{display:flex;gap:18px;flex-wrap:wrap}.payroll-kpis span{background:#f2f7f4;padding:7px 10px;border-radius:8px}

/* Professional payment/collection receipt inspired by the approved reference. */
.money-receipt{direction:rtl;width:min(100%,1120px);margin:0 auto;background:#fff;border:1px solid #e5ece8;border-radius:18px;padding:26px 28px 20px;box-sizing:border-box;color:#0a2d22;font-family:Tahoma,Arial,sans-serif;box-shadow:0 8px 30px rgba(13,64,45,.08)}.mr-header{display:flex;align-items:flex-start;justify-content:space-between;gap:30px;margin-bottom:18px}.mr-title{text-align:left;direction:rtl}.mr-title h1{font-size:35px;margin:6px 0 10px;color:#075438;font-weight:900}.mr-title span{display:block;width:78px;height:7px;background:#ff7416;border-radius:8px;margin-right:auto}.mr-brand{display:flex;align-items:center;gap:14px}.mr-brand img{width:78px;height:78px;object-fit:contain}.mr-brand h2{font-size:29px;color:#075438;margin:2px 0}.mr-brand p{margin:0;color:#344b44;font-weight:700}.mr-meta{display:grid;grid-template-columns:1fr 1fr;border:1.5px solid #a9b9b1;border-radius:14px;overflow:hidden;margin-bottom:20px}.mr-meta>div{display:flex;align-items:center;gap:14px;padding:15px 22px}.mr-meta>div+div{border-right:1px solid #cbd5d0}.mr-meta b{display:block;color:#126148;margin-bottom:5px}.mr-meta strong{font-size:18px;color:#142b24}.mr-icon{font-size:25px;color:#ff7416}.mr-party,.mr-section-title{display:flex;align-items:center;gap:10px;margin:12px 0 9px}.mr-party{justify-content:flex-start}.mr-party i,.mr-section-title i{width:6px;height:30px;background:#ff7416;border-radius:4px}.mr-party h2,.mr-section-title h2{margin:0;font-size:22px}.mr-amount{background:linear-gradient(90deg,#effbf5,#f8fffb);border:1.5px solid #b4dac8;border-radius:14px;text-align:center;padding:15px;margin-bottom:14px}.mr-amount span{display:block;font-size:18px}.mr-amount strong{display:block;font-size:43px;color:#075438;margin-top:3px}.mr-amount strong small{font-size:25px}.mr-amount i{display:block;width:55px;height:5px;background:#ff7416;border-radius:5px;margin:8px auto 0}.mr-table{width:100%;border-collapse:separate;border-spacing:0;border:1px solid #bdcbc4;border-radius:12px;overflow:hidden}.mr-table th{background:#08623f;color:#fff;padding:11px;font-size:17px}.mr-table td{padding:10px 12px;text-align:center;border-top:1px solid #dce5e0}.mr-table th+th,.mr-table td+td{border-right:1px solid #cbd6d0}.mr-summary{display:grid;grid-template-columns:1fr 1fr 1fr;gap:16px}.mr-summary-card{border:1.3px solid #cfdad5;border-radius:12px;padding:13px 15px;text-align:center;background:#f9fbfa}.mr-summary-card span{display:block;font-weight:800;margin-bottom:7px}.mr-summary-card strong{font-size:20px}.mr-summary-card.paid{background:#effbf5;border-color:#add8c3}.mr-summary-card.paid strong{color:#08734a}.mr-summary-card.remaining{background:#fff8f0;border-color:#ffd3ac}.mr-notes{margin-top:12px;border:1px dashed #c9d5cf;border-radius:10px;padding:10px 12px}.mr-footer{border-top:1px solid #bcc9c3;margin-top:18px;padding-top:11px;text-align:center;font-size:12px;color:#315046;line-height:1.7}.mr-footer strong{display:block;color:#075438}.mr-footer div:first-child::first-letter,.mr-footer div:nth-child(2)::first-letter{color:#08734a}
@media(max-width:1000px){.accounting-cards{grid-template-columns:1fr 1fr}.order-grid{grid-template-columns:1.6fr 1fr .7fr .8fr .8fr 1fr 42px}.mr-title h1{font-size:27px}.mr-brand h2{font-size:24px}}@media(max-width:700px){.accounting-cards,.statement-grid,.mr-summary,.mr-meta{grid-template-columns:1fr}.order-grid,.journal-grid{display:grid!important;grid-template-columns:1fr!important}.line-head.order-grid,.line-head.journal-grid{display:none!important}.mr-header{flex-direction:column-reverse}.mr-meta>div+div{border-right:0;border-top:1px solid #cbd5d0}}
@media print{@page receiptLandscape{size:A5 landscape;margin:0}.money-receipt{page:receiptLandscape;width:210mm!important;min-height:148mm!important;max-width:none!important;margin:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;padding:8mm 9mm 6mm!important;-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}.money-receipt .mr-title h1{font-size:24px!important}.money-receipt .mr-brand img{width:22mm!important;height:22mm!important}.money-receipt .mr-brand h2{font-size:20px!important}.money-receipt .mr-meta>div{padding:3mm 5mm!important}.money-receipt .mr-amount{padding:3mm!important}.money-receipt .mr-amount strong{font-size:28px!important}.money-receipt .mr-section-title h2,.money-receipt .mr-party h2{font-size:16px!important}.money-receipt .mr-table th,.money-receipt .mr-table td{padding:2mm!important;font-size:11px!important}.money-receipt .mr-summary-card{padding:2.5mm!important}.money-receipt .mr-footer{font-size:8px!important;margin-top:3mm!important}}


/* ===== v1.9.1 mobile-first shell ===== */
.mobile-bottom-nav{display:none}
@media(max-width:760px), (pointer:coarse) and (max-width:1024px){
  html{background:#f4f7f6;-webkit-text-size-adjust:100%}
  body{padding-bottom:calc(76px + env(safe-area-inset-bottom));overscroll-behavior-y:none}
  .main{min-height:100dvh;height:auto!important;overflow:visible!important}
  .content{padding:12px 10px calc(96px + env(safe-area-inset-bottom))}
  .workspace-tabs,.workspace-frames{display:none!important}
  .topbar{position:sticky;top:0;z-index:80;background:rgba(255,255,255,.96);backdrop-filter:blur(10px)}
  .topbar .app-title{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .search input,.field input,.field select,.field textarea,.line-row input,.line-row select,.select-filter{font-size:16px!important;min-height:44px}
  .btn,button,input[type=submit]{min-height:44px;touch-action:manipulation}
  .page-head{gap:9px;align-items:stretch}.page-head h1{font-size:23px;line-height:1.25}
  .page-head .actions,.page-head>div{max-width:100%}.page-head .btn{flex:1}
  .form-grid{grid-template-columns:1fr!important}.span-2,.span-3,.span-4{grid-column:span 1!important}
  .card{padding:13px;border-radius:13px}.section-title{font-size:18px;gap:8px}
  .hero{height:auto;min-height:112px;padding:18px 16px}.hero .copy{max-width:72%}.hero h1{font-size:23px}.hero p{font-size:14px;margin-bottom:0}.hero .sacks{left:5px;opacity:.7}.hero .sacks img{height:92px;max-width:66px}
  .kpis{grid-template-columns:1fr 1fr!important;gap:9px}.kpi{padding:11px;gap:8px}.kpi .icon{width:42px;height:42px;font-size:21px}.kpi strong{font-size:20px}
  .quick{grid-template-columns:1fr 1fr!important;gap:9px}.quick .btn{font-size:15px;padding:11px 8px}
  .two,.three,.warehouse-cards,.accounting-cards,.statement-grid{grid-template-columns:1fr!important}
  .table-wrap{margin-left:-2px;margin-right:-2px;padding-bottom:4px;-webkit-overflow-scrolling:touch;overflow-x:auto}
  .table{min-width:620px}.table th,.table td{padding:10px 9px}
  .line-row,.sale-line,.production-output,.order-grid,.journal-grid{grid-template-columns:1fr!important;gap:8px!important;padding:12px;border:1px solid #dde7e2;border-radius:12px;background:#fff;margin-bottom:10px}
  .line-head{display:none!important}
  .searchable-select-wrap{grid-template-columns:1fr!important}
  .form-actions{position:sticky;bottom:calc(66px + env(safe-area-inset-bottom));z-index:45;background:rgba(244,247,246,.96);padding:8px 0;margin:10px -2px 0;box-shadow:0 -8px 22px rgba(22,64,47,.07)}
  .form-actions .btn{flex:1;min-width:120px}
  .money-receipt{padding:15px 12px;border-radius:12px}.mr-header{gap:12px}.mr-title h1{font-size:24px}.mr-brand img{width:58px;height:58px}.mr-brand h2{font-size:21px}.mr-amount strong{font-size:34px}.mr-table{font-size:13px}
  .mobile-bottom-nav{position:fixed;display:grid;grid-auto-flow:column;grid-auto-columns:1fr;right:8px;left:8px;bottom:max(7px,env(safe-area-inset-bottom));z-index:950;background:rgba(255,255,255,.97);border:1px solid #dce7e1;border-radius:18px;box-shadow:0 8px 34px rgba(5,66,42,.18);padding:6px 6px calc(5px + env(safe-area-inset-bottom));direction:rtl;backdrop-filter:blur(12px)}
  .mobile-bottom-nav a,.mobile-bottom-nav button{border:0;background:transparent;color:#60726a;display:flex;min-width:0;min-height:50px;align-items:center;justify-content:center;flex-direction:column;gap:2px;border-radius:12px;font:inherit;padding:4px 3px;text-decoration:none}
  .mobile-bottom-nav span{font-size:21px;line-height:1}.mobile-bottom-nav b{font-size:10px;white-space:nowrap;font-weight:800}
  .mobile-bottom-nav a.active{color:#08633e;background:#eef8f3}
  .mobile-bottom-nav .mobile-primary-action{background:#08633e;color:#fff;margin-top:-17px;min-height:60px;border-radius:17px;box-shadow:0 6px 18px rgba(8,99,62,.24)}
  .mobile-bottom-nav .mobile-primary-action span{font-size:28px}.mobile-bottom-nav .mobile-primary-action b{font-size:11px}
  .sidebar{padding-bottom:calc(90px + env(safe-area-inset-bottom))}
  .nav a,.nav-group>summary{min-height:46px}
  .connectivity-banner{position:sticky;top:0;z-index:1200;font-size:12px}
}
@media(max-width:430px){
  .hero .copy{max-width:100%}.hero .sacks{display:none}.kpis{grid-template-columns:1fr 1fr!important}.kpi{align-items:flex-start}.kpi .icon{display:none}.kpi strong{font-size:18px}.quick .btn{font-size:14px}
  .mr-header{flex-direction:column-reverse!important}.mr-meta,.mr-summary{grid-template-columns:1fr!important}
}
@media(display-mode:standalone) and (max-width:1024px){
  .topbar{padding-top:max(8px,env(safe-area-inset-top))}
}


/* ===== v1.9.4 usability, pending orders and document sharing ===== */
.pending-orders-alert{border:1.5px solid #f1b36d!important;background:#fff9f1!important;color:#653b12!important;padding:12px 14px!important;border-radius:12px!important}
.pending-orders-alert strong{color:#82430a}.pending-order-chips{display:flex;flex-wrap:wrap;gap:7px;margin-top:9px}.pending-order-chips a{display:inline-flex;align-items:center;gap:5px;padding:7px 10px;border:1px solid #efd0aa;border-radius:999px;background:#fff;color:#704315;text-decoration:none;font-weight:800}.pending-order-chips a.customer-match{background:#fff0db;border-color:#ff8b2e;color:#9b4300;box-shadow:0 0 0 2px rgba(255,116,22,.08)}
.compact-info{margin:0!important;padding:9px 11px!important}.recipe-live-details{display:grid;gap:10px}.recipe-preview-card{border:1px solid #cddbd4;border-radius:12px;background:#fbfefc;overflow:hidden}.recipe-preview-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 13px;background:#edf8f2;border-bottom:1px solid #d6e7de;color:#0b5d3e}.recipe-preview-head strong{font-size:16px}.recipe-preview-head span{font-weight:800;color:#52675e}.recipe-preview-table{margin:0!important;min-width:520px!important}.recipe-preview-table th,.recipe-preview-table td{padding:8px 10px!important}

/* The shared/web sale invoice uses the same Delta green/orange visual language as receipts. */
@media screen{
.sale-share-card{max-width:1120px!important;width:min(100%,1120px)!important;margin:0 auto!important;background:#fff!important;color:#0a2d22!important;border:1px solid #e5ece8!important;border-radius:18px!important;box-shadow:0 8px 30px rgba(13,64,45,.08)!important;font-family:Tahoma,Arial,sans-serif!important;--invoice-font:14px!important}
.sale-share-card.designer-page-border{outline:0!important}.sale-share-card .designer-header{border-bottom:2px solid #08734a!important;padding-bottom:12px!important}.sale-share-card .designer-header .bw-logo-mark img{filter:none!important}.sale-share-card .designer-header .bw-company-title h1,.sale-share-card .designer-header .bw-doc-title strong{color:#075438!important;font-size:22px!important}.sale-share-card .designer-header .bw-company-title p{font-size:12px!important;color:#344b44!important}.sale-share-card .designer-header .bw-doc-title small{font-size:9px!important;color:#ff7416!important}.sale-share-card .section-meta .bw-meta,.sale-share-card .section-customer .bw-section{border-color:#b4c9be!important;border-radius:10px!important}.sale-share-card .section-meta .bw-meta>div{border-color:#d4dfd9!important;padding:8px 11px!important}.sale-share-card .section-meta .bw-meta b,.sale-share-card .section-meta .bw-meta span{font-size:12px!important}.sale-share-card .section-customer .bw-section-title{background:#eef8f3!important;color:#075438!important;border-bottom-color:#c5ddd0!important;font-size:13px!important;padding:8px 11px!important}.sale-share-card .section-customer .bw-customer{font-size:13px!important;padding:10px 12px!important;gap:6px!important}.sale-share-card .designer-table{font-size:13px!important;border-color:#aec2b8!important;border-radius:10px!important}.sale-share-card .designer-table th{font-size:12.5px!important;background:#08623f!important;color:#fff!important;padding:10px 8px!important;border-color:#2c7b5e!important}.sale-share-card .designer-table td{font-size:13px!important;padding:9px 8px!important;border-color:#d5e0da!important;background:#fff!important}.sale-share-card .designer-table tbody tr:nth-child(even) td{background:#f8fcfa!important}.sale-share-card .items-total-row td{background:#effbf5!important;border-top-color:#7cae97!important}.sale-share-card .items-grand-total{font-size:13px!important}.sale-share-card .items-grand-total b{font-size:16px!important;color:#075438!important}.sale-share-card .totals-stack{border-color:#b8c9c0!important;border-radius:10px!important}.sale-share-card .total-line{font-size:13px!important;padding:9px 11px!important;min-height:0!important;border-color:#d9e3de!important}.sale-share-card .total-line span{color:#3d554b!important}.sale-share-card .total-line b{font-size:14px!important;color:#123b2d!important}.sale-share-card .total-line.invoice-total{background:#effbf5!important}.sale-share-card .total-line.remaining{background:#fff8f0!important;border-right:4px solid #ff7416!important}.sale-share-card .total-line.invoice-total b,.sale-share-card .total-line.remaining b{font-size:16px!important;color:#075438!important}.sale-share-card .bw-notes,.sale-share-card .invoice-signature{font-size:12.5px!important}.sale-share-card .bw-footer{font-size:10.5px!important;color:#315046!important;border-top-color:#bdcdc5!important}
}

/* Larger, clearer type on A5 printed/shared documents. */
@media print{
.invoice-bw .designer-header .bw-company-title h1{font-size:17px!important}.invoice-bw .designer-header .bw-company-title p{font-size:9.5px!important}.invoice-bw .designer-header .bw-doc-title strong{font-size:18px!important}.invoice-bw .section-meta .bw-meta b,.invoice-bw .section-meta .bw-meta span{font-size:9.3px!important}.invoice-bw .section-customer .bw-section-title{font-size:10.3px!important}.invoice-bw .section-customer .bw-customer{font-size:9.5px!important}.invoice-bw .designer-table th{font-size:9.6px!important}.invoice-bw .designer-table td{font-size:9.7px!important}.invoice-bw .items-grand-total{font-size:9.6px!important}.invoice-bw .items-grand-total b{font-size:10.8px!important}.invoice-bw .total-line{font-size:9.5px!important}.invoice-bw .total-line b{font-size:10.5px!important}.invoice-bw .total-line.remaining b,.invoice-bw .total-line.invoice-total b{font-size:11.2px!important}.invoice-bw .bw-notes,.invoice-bw .invoice-signature{font-size:9.3px!important}.invoice-bw .bw-footer{font-size:8.3px!important}.money-receipt .mr-table th,.money-receipt .mr-table td{font-size:12px!important}.money-receipt .mr-footer{font-size:9.3px!important}
}


/* ===== v1.9.5 invoice print/share separation ===== */
@page invoicePortrait{size:A5 portrait;margin:0}
@media print{
  .sale-print-document{page:invoicePortrait!important;width:148mm!important;max-width:148mm!important;min-height:210mm!important;margin:0!important;padding:5mm 6mm!important;border:0!important;border-radius:0!important;box-shadow:none!important;background:#fff!important;color:#000!important}
  .sale-print-document .designer-table th{font-size:9.3px!important;font-weight:800!important;padding:1.05mm .65mm!important;background:#fff!important;color:#000!important}
  .sale-print-document .designer-table td{font-size:9.4px!important;font-weight:600!important;padding:1mm .65mm!important;color:#000!important;background:#fff!important}
  .sale-print-document .designer-header .bw-company-title h1{font-size:17px!important}.sale-print-document .designer-header .bw-doc-title strong{font-size:17px!important}
  .sale-print-document .bw-footer{font-size:8px!important}.sale-print-document img{filter:grayscale(1)!important}
}
@media screen{
  .sale-share-card.share-capture-mode{width:1120px!important;min-width:1120px!important;min-height:760px!important;padding:30px 34px!important;border-radius:18px!important;box-shadow:none!important;overflow:visible!important;--invoice-font:16px!important;font-weight:650!important}
  .sale-share-card.share-capture-mode .designer-header{padding-bottom:16px!important;margin-bottom:12px!important}
  .sale-share-card.share-capture-mode .designer-header .bw-company-title h1{font-size:30px!important;font-weight:900!important}
  .sale-share-card.share-capture-mode .designer-header .bw-company-title p{font-size:16px!important;font-weight:800!important}
  .sale-share-card.share-capture-mode .designer-header .bw-doc-title strong{font-size:29px!important;font-weight:900!important}
  .sale-share-card.share-capture-mode .section-meta .bw-meta b,.sale-share-card.share-capture-mode .section-meta .bw-meta span{font-size:15px!important;font-weight:800!important}
  .sale-share-card.share-capture-mode .section-customer .bw-section-title{font-size:16px!important;font-weight:900!important}
  .sale-share-card.share-capture-mode .section-customer .bw-customer{font-size:16px!important;font-weight:700!important}
  .sale-share-card.share-capture-mode .designer-table th{font-size:15px!important;font-weight:900!important;padding:12px 10px!important}
  .sale-share-card.share-capture-mode .designer-table td{font-size:16px!important;font-weight:700!important;padding:11px 10px!important}
  .sale-share-card.share-capture-mode .items-grand-total{font-size:16px!important;font-weight:800!important}.sale-share-card.share-capture-mode .items-grand-total b{font-size:20px!important;font-weight:900!important}
  .sale-share-card.share-capture-mode .total-line{font-size:16px!important;font-weight:800!important;padding:11px 14px!important}.sale-share-card.share-capture-mode .total-line b{font-size:19px!important;font-weight:900!important}
  .sale-share-card.share-capture-mode .bw-notes,.sale-share-card.share-capture-mode .invoice-signature{font-size:15px!important;font-weight:700!important}.sale-share-card.share-capture-mode .bw-footer{font-size:13px!important;font-weight:700!important}
}

/* ===== v1.9.5 manufacturing grouped workflow ===== */
.mfg-recipe-block{background:#fff;border:1.5px solid #cfe0d8;border-radius:16px;padding:16px;margin-top:14px;box-shadow:0 3px 12px rgba(8,99,62,.05)}
.mfg-block-head{display:flex;justify-content:space-between;align-items:center;gap:12px;border-bottom:2px solid #e7f0ec;padding-bottom:11px;margin-bottom:13px}.mfg-block-head b{display:block;color:#075438;font-size:20px}.mfg-block-head small{display:block;color:#71847b;margin-top:4px}.mfg-block-main{margin-bottom:12px}.mfg-subtitle{font-weight:900;color:#0a5d40;margin:14px 0 7px;padding-right:9px;border-right:5px solid #ff7a16}.mfg-line-head{color:#63746d;font-size:11px;font-weight:800;margin-bottom:5px}.mfg-detail-row{background:#fbfdfc;border:1px solid #e7efeb;border-radius:9px;padding:7px}.mfg-cost-grid,.mfg-result-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;align-items:end;margin-top:12px}.mfg-cost-grid{grid-template-columns:1.3fr 1fr}.mfg-live-total{background:#eef8f3;border:1px solid #d1e8dc;border-radius:10px;padding:10px 12px;min-height:63px;display:flex;flex-direction:column;justify-content:center}.mfg-live-total span{font-size:12px;color:#5f746a;font-weight:700}.mfg-live-total b{font-size:19px;color:#08633e;margin-top:5px}.mfg-block-summary{display:grid;grid-template-columns:1fr auto 1fr auto;gap:10px;align-items:center;background:#0b6342;color:#fff;border-radius:11px;padding:11px 14px;margin-top:14px}.mfg-block-summary strong{font-size:18px;color:#fff}.mfg-order-summary .report-kpis{grid-template-columns:repeat(5,1fr)}
@media(max-width:900px){.mfg-cost-grid,.mfg-result-grid,.mfg-block-summary{grid-template-columns:1fr}.mfg-order-summary .report-kpis{grid-template-columns:1fr 1fr}.mfg-line-head{display:none}}

/* ===== v1.9.5 monthly closing & performance ===== */
.monthly-close-kpis{grid-template-columns:repeat(6,1fr)}.monthly-close-kpis small{display:block;margin-top:5px;color:#718178}.performance-chart{overflow:hidden}.market-chart{width:100%;height:280px;background:linear-gradient(#fbfdfc,#f4f9f6);border:1px solid #dce9e2;border-radius:12px}.market-chart line{stroke:#b8c8c0;stroke-width:1}.market-chart polyline{stroke:#08734a}.market-chart circle{fill:#ff7a16;stroke:#fff;stroke-width:3}.chart-labels{display:flex;gap:8px;overflow:auto;margin-top:8px}.chart-labels span{min-width:76px;text-align:center;background:#f4f8f6;border-radius:8px;padding:6px}.chart-labels b,.chart-labels small{display:block}.season-grid{height:310px;display:grid;grid-template-columns:repeat(12,1fr);gap:7px;align-items:end;padding:14px 5px 0}.season-item{height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:5px;text-align:center}.season-item i{display:block;width:70%;max-height:180px;min-height:2px;background:linear-gradient(#ff9a4e,#f47b0a);border-radius:6px 6px 0 0}.season-item span{font-size:10px}.season-item b{font-size:12px;color:#08633e}.season-item small{font-size:8px;color:#7b8d84}.analysis-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.analysis-grid>div{background:#f5faf7;border:1px solid #deebe4;border-radius:10px;padding:12px}.analysis-grid span,.analysis-grid b{display:block}.analysis-grid b{font-size:20px;color:#08633e;margin-top:5px}@media(max-width:1100px){.monthly-close-kpis{grid-template-columns:repeat(2,1fr)}.season-grid{overflow:auto;grid-template-columns:repeat(12,58px)}.analysis-grid{grid-template-columns:1fr 1fr}}
.season-summary{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-top:12px}.season-summary>div{background:#f5faf7;border:1px solid #dfeae4;border-radius:10px;padding:9px;text-align:center}.season-summary span,.season-summary b,.season-summary small{display:block}.season-summary b{font-size:18px;color:#08633e;margin:3px 0}.season-summary small{font-size:10px;color:#6c7e75}@media(max-width:900px){.season-summary{grid-template-columns:1fr 1fr}}

/* ===== v1.9.6 A5 portrait invoice + clearer finance reports ===== */
.report-name-link{color:#08633e!important;font-weight:900!important;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px}.finance-accounts-table .cash-in,.cash-in{color:#087248;font-weight:800}.finance-accounts-table .cash-out,.cash-out{color:#b83a30;font-weight:800}.finance-accounts-card .table td,.finance-accounts-card .table th{vertical-align:middle}

@page invoiceA5Portrait{size:148mm 210mm;margin:0}
@media print{
  .sale-print-document{
    page:invoiceA5Portrait!important;
    width:148mm!important;max-width:148mm!important;min-width:148mm!important;
    min-height:210mm!important;height:auto!important;
    margin:0!important;padding:5.5mm 6mm 5mm!important;
    overflow:visible!important;border:0!important;border-radius:0!important;box-shadow:none!important;
    background:#fff!important;color:#102a20!important;
    font-family:Tahoma,Arial,sans-serif!important;font-weight:700!important;
    -webkit-print-color-adjust:exact!important;print-color-adjust:exact!important;
  }
  .sale-print-document .custom-invoice-layout{width:100%!important;overflow:visible!important}
  .sale-print-document .designer-header{padding-bottom:2.2mm!important;margin-bottom:2mm!important;border-bottom:1.5px solid #08633e!important}
  .sale-print-document .designer-header .bw-logo-mark img{filter:none!important;width:20mm!important;height:18mm!important}
  .sale-print-document .designer-header .bw-company-title h1{font-size:16px!important;font-weight:900!important;color:#075438!important}
  .sale-print-document .designer-header .bw-company-title p{font-size:8.6px!important;font-weight:700!important}
  .sale-print-document .designer-header .bw-doc-title strong{font-size:16px!important;font-weight:900!important;color:#075438!important}
  .sale-print-document .designer-header .bw-doc-title small{font-size:7.5px!important;font-weight:800!important;color:#f47b0a!important}
  .sale-print-document .section-meta .bw-meta{margin-bottom:2.3mm!important;border-color:#a7bdb2!important}
  .sale-print-document .section-meta .bw-meta>div{padding:1.5mm 1mm!important;border-color:#cbd9d2!important}
  .sale-print-document .section-meta .bw-meta b,.sale-print-document .section-meta .bw-meta span{font-size:8.6px!important;font-weight:800!important}
  .sale-print-document .section-customer .bw-section{margin-bottom:2.3mm!important;border-color:#a7bdb2!important}
  .sale-print-document .section-customer .bw-section-title{padding:1.25mm 1.6mm!important;font-size:9px!important;font-weight:900!important;background:#eef8f3!important;color:#075438!important}
  .sale-print-document .section-customer .bw-customer{padding:1.5mm!important;font-size:8.8px!important;font-weight:700!important;gap:1mm!important}
  .sale-print-document .designer-table{font-size:8.9px!important;border-color:#9fb8ac!important}
  .sale-print-document .designer-table th{font-size:8.8px!important;font-weight:900!important;padding:1.35mm .65mm!important;background:#08633e!important;color:#fff!important;border-color:#2b765b!important;white-space:normal!important}
  .sale-print-document .designer-table td{font-size:8.9px!important;font-weight:700!important;padding:1.25mm .65mm!important;color:#102a20!important;background:#fff!important;border-color:#d2ddd7!important;white-space:normal!important}
  .sale-print-document .designer-table tr{break-inside:avoid!important;page-break-inside:avoid!important}
  .sale-print-document .items-total-row td{background:#effbf5!important;border-top-color:#78a991!important}
  .sale-print-document .items-grand-total{font-size:9px!important;font-weight:900!important}.sale-print-document .items-grand-total b{font-size:10.5px!important;font-weight:900!important;color:#075438!important}
  .sale-print-document .bw-totals{margin-top:2.3mm!important;gap:2mm!important}.sale-print-document .totals-stack{border-color:#adbbb4!important}
  .sale-print-document .total-line{font-size:8.8px!important;font-weight:800!important;padding:1.6mm 2mm!important;min-height:0!important}.sale-print-document .total-line b{font-size:9.5px!important;font-weight:900!important}
  .sale-print-document .total-line.invoice-total{background:#effbf5!important}.sale-print-document .total-line.remaining{background:#fff8f0!important;border-right:2px solid #f47b0a!important}
  .sale-print-document .bw-notes,.sale-print-document .invoice-signature{font-size:8.5px!important;font-weight:700!important;margin-top:2mm!important}
  .sale-print-document .bw-footer{font-size:7.6px!important;font-weight:700!important;margin-top:3mm!important;padding-top:1.6mm!important;color:#234b3d!important;border-top-color:#9eb3a9!important}
  .sale-print-document img{filter:none!important}
}

@media screen{
  .sale-share-card{
    width:min(100%,148mm)!important;max-width:148mm!important;min-height:210mm!important;
    margin:0 auto!important;padding:5.5mm 6mm 5mm!important;
    border-radius:10px!important;box-shadow:0 5px 22px rgba(13,64,45,.10)!important;
    overflow:visible!important;background:#fff!important;color:#102a20!important;
    font-family:Tahoma,Arial,sans-serif!important;font-weight:700!important;
  }
  .sale-share-card.share-capture-mode{
    width:148mm!important;min-width:148mm!important;max-width:148mm!important;
    min-height:210mm!important;height:auto!important;
    margin:0!important;padding:5.5mm 6mm 5mm!important;
    border:0!important;border-radius:0!important;box-shadow:none!important;
    overflow:visible!important;--invoice-font:12px!important;font-weight:700!important;
  }
  .sale-share-card .designer-header,.sale-share-card.share-capture-mode .designer-header{padding-bottom:9px!important;margin-bottom:8px!important;border-bottom:2px solid #08734a!important}
  .sale-share-card .designer-header .bw-logo-mark img,.sale-share-card.share-capture-mode .designer-header .bw-logo-mark img{width:76px!important;height:68px!important;filter:none!important}
  .sale-share-card .designer-header .bw-company-title h1,.sale-share-card.share-capture-mode .designer-header .bw-company-title h1{font-size:20px!important;font-weight:900!important;color:#075438!important}
  .sale-share-card .designer-header .bw-company-title p,.sale-share-card.share-capture-mode .designer-header .bw-company-title p{font-size:11px!important;font-weight:800!important}
  .sale-share-card .designer-header .bw-doc-title strong,.sale-share-card.share-capture-mode .designer-header .bw-doc-title strong{font-size:20px!important;font-weight:900!important;color:#075438!important}
  .sale-share-card .designer-header .bw-doc-title small,.sale-share-card.share-capture-mode .designer-header .bw-doc-title small{font-size:9px!important;font-weight:900!important;color:#f47b0a!important}
  .sale-share-card .section-meta .bw-meta,.sale-share-card.share-capture-mode .section-meta .bw-meta{margin-bottom:9px!important}
  .sale-share-card .section-meta .bw-meta>div,.sale-share-card.share-capture-mode .section-meta .bw-meta>div{padding:7px 6px!important}
  .sale-share-card .section-meta .bw-meta b,.sale-share-card .section-meta .bw-meta span,.sale-share-card.share-capture-mode .section-meta .bw-meta b,.sale-share-card.share-capture-mode .section-meta .bw-meta span{font-size:11px!important;font-weight:800!important}
  .sale-share-card .section-customer .bw-section,.sale-share-card.share-capture-mode .section-customer .bw-section{margin-bottom:9px!important}
  .sale-share-card .section-customer .bw-section-title,.sale-share-card.share-capture-mode .section-customer .bw-section-title{font-size:11.5px!important;font-weight:900!important;padding:6px 8px!important}
  .sale-share-card .section-customer .bw-customer,.sale-share-card.share-capture-mode .section-customer .bw-customer{font-size:11px!important;font-weight:800!important;padding:7px 8px!important;gap:5px!important}
  .sale-share-card .designer-table,.sale-share-card.share-capture-mode .designer-table{font-size:11px!important;border-radius:6px!important}
  .sale-share-card .designer-table th,.sale-share-card.share-capture-mode .designer-table th{font-size:10.8px!important;font-weight:900!important;padding:7px 5px!important;white-space:normal!important}
  .sale-share-card .designer-table td,.sale-share-card.share-capture-mode .designer-table td{font-size:11px!important;font-weight:800!important;padding:7px 5px!important;white-space:normal!important}
  .sale-share-card .items-grand-total,.sale-share-card.share-capture-mode .items-grand-total{font-size:11.5px!important;font-weight:900!important}.sale-share-card .items-grand-total b,.sale-share-card.share-capture-mode .items-grand-total b{font-size:14px!important;font-weight:900!important}
  .sale-share-card .bw-totals,.sale-share-card.share-capture-mode .bw-totals{margin-top:9px!important;gap:7px!important}.sale-share-card .total-line,.sale-share-card.share-capture-mode .total-line{font-size:11px!important;font-weight:800!important;padding:7px 8px!important}.sale-share-card .total-line b,.sale-share-card.share-capture-mode .total-line b{font-size:12.5px!important;font-weight:900!important}
  .sale-share-card .bw-notes,.sale-share-card .invoice-signature,.sale-share-card.share-capture-mode .bw-notes,.sale-share-card.share-capture-mode .invoice-signature{font-size:10.5px!important;font-weight:800!important;margin-top:8px!important}
  .sale-share-card .bw-footer,.sale-share-card.share-capture-mode .bw-footer{font-size:9.2px!important;font-weight:800!important;margin-top:11px!important;padding-top:7px!important}
}

/* ===== v1.9.7 split-cash integrity + WhatsApp invoice image fit ===== */
.payment-detail{display:inline-block;line-height:1.6;font-weight:800;color:#0b5d3e;white-space:normal}
@media screen{
  /* Keep the shared invoice at a true A5 outer width. Previous content-box
     sizing added the padding on top of 148mm, which could push the left edge
     outside the capture area and clip the remaining-balance card. */
  .sale-share-card,.sale-share-card.share-capture-mode{
    box-sizing:border-box!important;
    width:148mm!important;min-width:148mm!important;max-width:148mm!important;
    overflow:visible!important;
  }
  .sale-share-card .custom-invoice-layout,.sale-share-card.share-capture-mode .custom-invoice-layout{
    width:100%!important;max-width:100%!important;box-sizing:border-box!important;overflow:visible!important;
  }
  .sale-share-card .professional-totals,.sale-share-card.share-capture-mode .professional-totals{
    width:100%!important;max-width:100%!important;box-sizing:border-box!important;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
  }
  .sale-share-card .totals-stack,.sale-share-card.share-capture-mode .totals-stack,
  .sale-share-card .total-line,.sale-share-card.share-capture-mode .total-line{
    min-width:0!important;box-sizing:border-box!important;
  }
  .sale-share-card .total-line span,.sale-share-card.share-capture-mode .total-line span{min-width:0!important;flex:1 1 auto!important}
  .sale-share-card .total-line b,.sale-share-card.share-capture-mode .total-line b{
    flex:0 0 auto!important;white-space:nowrap!important;max-width:62%!important;text-align:left!important;
  }
}


/* ===== v1.9.8 WhatsApp capture + readable invoice summary (SCREEN ONLY) ===== */
@media screen{
  /* The printed A5 template is intentionally untouched. On screen/share, make
     each summary tile self-contained so Arabic labels never collide with money. */
  .sale-share-card .professional-totals,
  .sale-share-card.share-capture-mode .professional-totals{
    display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:7px!important;
    width:100%!important;
    max-width:100%!important;
    overflow:visible!important;
    direction:rtl!important;
  }
  .sale-share-card .professional-totals .totals-stack,
  .sale-share-card.share-capture-mode .professional-totals .totals-stack{
    display:contents!important;
    border:0!important;
    min-width:0!important;
  }
  .sale-share-card .professional-totals .total-line,
  .sale-share-card.share-capture-mode .professional-totals .total-line{
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    gap:4px!important;
    min-width:0!important;
    width:100%!important;
    min-height:58px!important;
    padding:7px 5px!important;
    border:1px solid #bfd0c7!important;
    border-radius:9px!important;
    background:#fbfdfc!important;
    text-align:center!important;
    overflow:visible!important;
  }
  .sale-share-card .professional-totals .total-line.invoice-total,
  .sale-share-card.share-capture-mode .professional-totals .total-line.invoice-total{background:#effbf5!important}
  .sale-share-card .professional-totals .total-line.remaining,
  .sale-share-card.share-capture-mode .professional-totals .total-line.remaining{background:#fff8f0!important;border-right:3px solid #f47b0a!important}
  .sale-share-card .professional-totals .total-line span,
  .sale-share-card.share-capture-mode .professional-totals .total-line span{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    flex:none!important;
    color:#345348!important;
    font-size:10.5px!important;
    font-weight:900!important;
    line-height:1.25!important;
    white-space:normal!important;
    text-align:center!important;
  }
  .sale-share-card .professional-totals .total-line b,
  .sale-share-card.share-capture-mode .professional-totals .total-line b{
    display:block!important;
    width:100%!important;
    max-width:none!important;
    flex:none!important;
    color:#075438!important;
    font-size:13px!important;
    font-weight:900!important;
    line-height:1.25!important;
    white-space:nowrap!important;
    text-align:center!important;
    direction:rtl!important;
  }
  .sale-share-card .professional-totals .total-line b small,
  .sale-share-card.share-capture-mode .professional-totals .total-line b small{
    display:block!important;font-size:8px!important;white-space:normal!important;margin-top:2px!important
  }
  .sale-share-card.share-capture-mode{
    box-sizing:border-box!important;
    overflow:visible!important;
    height:auto!important;
    max-height:none!important;
    contain:none!important;
  }
  .sale-share-card.share-capture-mode .custom-invoice-layout,
  .sale-share-card.share-capture-mode .designer-print-section{
    overflow:visible!important;
    max-height:none!important;
  }
}
@media screen and (max-width:520px){
  .sale-share-card:not(.share-capture-mode) .professional-totals{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}

/* ===== v1.10 printer profile selector ===== */
.printer-profile-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:10px}.printer-profile{position:relative;display:grid;grid-template-columns:auto 1fr 88px;align-items:center;gap:12px;padding:14px;border:1.5px solid #cbdad2;border-radius:14px;background:#fff;cursor:pointer}.printer-profile.selected,.printer-profile:has(input:checked){border-color:#08734a;background:#f3fbf7;box-shadow:0 0 0 3px rgba(8,115,74,.08)}.printer-profile input{width:18px;height:18px}.printer-profile b,.printer-profile span{display:block}.printer-profile b{font-size:18px;color:#075438;margin-bottom:5px}.printer-profile span{font-size:12px;color:#60736a;line-height:1.55}.printer-profile i{justify-self:left;background:#fff;border:1px solid #b8c8c0;box-shadow:0 3px 9px rgba(0,0,0,.06);display:flex;flex-direction:column;gap:4px;padding:7px}.printer-profile i u{display:block;height:3px;background:#bfd2c8;border-radius:4px}.paper-a5{width:55px;height:76px}.paper-80{width:50px;height:92px}.paper-80 u:nth-child(2){width:75%}.paper-80 u:nth-child(3){width:90%}@media(max-width:780px){.printer-profile-grid{grid-template-columns:1fr}}

/* Dedicated 80mm thermal sales invoice. Hidden on normal screen; print CSS in
   sale_invoice_print.html activates it only when receipt80 is selected. */
.thermal80-document{display:none}.thermal80-document *{box-sizing:border-box}.thermal80-document{direction:rtl;font-family:Tahoma,Arial,sans-serif;color:#000;background:#fff}.thermal80-head{text-align:center;border-bottom:1px dashed #000;padding-bottom:2.5mm;margin-bottom:2mm}.thermal80-head img{width:17mm;height:15mm;object-fit:contain;filter:grayscale(1)}.thermal80-head h2{font-size:14px;margin:1mm 0 .5mm;font-weight:900}.thermal80-head p{font-size:9px;margin:0}.thermal80-title{text-align:center;font-weight:900;font-size:13px;margin:2mm 0}.thermal80-meta{font-size:9px;line-height:1.65;border-bottom:1px dashed #000;padding-bottom:1.5mm;margin-bottom:1.5mm}.thermal80-table{width:100%;border-collapse:collapse;table-layout:fixed;font-size:8.5px}.thermal80-table th{border-top:1px solid #000;border-bottom:1px solid #000;padding:1.3mm .7mm;font-weight:900}.thermal80-table td{border-bottom:1px dotted #999;padding:1.4mm .7mm;vertical-align:top}.thermal80-table .pname{width:42%;font-weight:800}.thermal80-table .num{text-align:center;white-space:nowrap}.thermal80-totals{margin-top:2mm;border-top:1px solid #000;border-bottom:1px solid #000;padding:1.5mm 0;font-size:9px}.thermal80-total-line{display:flex;justify-content:space-between;gap:3mm;padding:.7mm 0}.thermal80-total-line.grand{font-size:12px;font-weight:900}.thermal80-notes{font-size:8.5px;margin-top:2mm;line-height:1.5}.thermal80-footer{text-align:center;font-size:7.5px;line-height:1.55;margin-top:3mm;border-top:1px dashed #000;padding-top:2mm}
.return-settlement-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.settlement-card{display:flex;gap:10px;align-items:flex-start;border:1.5px solid #cbdad2;border-radius:12px;padding:12px;background:#fff;cursor:pointer}.settlement-card:has(input:checked){border-color:#08734a;background:#f1fbf6;box-shadow:0 0 0 3px rgba(8,115,74,.07)}.settlement-card input{width:18px;height:18px;margin-top:3px}.settlement-card b,.settlement-card span{display:block}.settlement-card b{color:#075438;font-size:16px}.settlement-card span{color:#60736a;font-size:12px;line-height:1.6;margin-top:4px}@media(max-width:720px){.return-settlement-grid{grid-template-columns:1fr}}

/* ===== v1.10 local smart assistant ===== */
.ai-assistant-card{max-width:1100px;margin:auto;padding:0;overflow:hidden}.ai-status{display:flex;align-items:center;gap:7px;padding:11px 15px;border-bottom:1px solid #dce7e1;background:#f5fbf8;color:#466158;font-size:12px}.ai-status .dot{width:9px;height:9px;border-radius:50%;background:#16a05d;box-shadow:0 0 0 4px rgba(22,160,93,.11)}.ai-status b{color:#08633e}.ai-chat{height:430px;overflow:auto;padding:18px;background:linear-gradient(180deg,#f8fbfa,#f2f7f4);display:flex;flex-direction:column;gap:13px}.ai-msg{display:flex;gap:9px;align-items:flex-start;max-width:82%}.ai-msg.user{align-self:flex-start;flex-direction:row-reverse}.ai-msg.assistant{align-self:flex-end}.ai-msg .avatar{width:36px;height:36px;display:grid;place-items:center;border-radius:11px;background:#fff;border:1px solid #d8e4de;flex:0 0 36px}.ai-msg .bubble{white-space:pre-line;line-height:1.8;padding:11px 14px;border-radius:14px;background:#fff;border:1px solid #d8e4de;box-shadow:0 2px 8px rgba(5,66,42,.04);font-size:14px}.ai-msg.user .bubble{background:#08633e;color:#fff;border-color:#08633e}.ai-msg.thinking .bubble{opacity:.7}.ai-open-link{display:inline-flex;margin-top:7px;color:#08734a;font-weight:900;text-decoration:none;border-bottom:1px solid #87bca6}.ai-suggestions{display:flex;gap:7px;overflow:auto;padding:10px 13px;background:#fff;border-top:1px solid #e1ebe6}.ai-suggestions button{border:1px solid #c9dad1;background:#f7fbf9;color:#245442;border-radius:999px;padding:7px 10px;white-space:nowrap;font:inherit;font-size:12px;cursor:pointer}.ai-suggestions button:hover{border-color:#08734a;background:#edf8f2}.ai-form{display:grid;grid-template-columns:1fr auto;gap:9px;padding:12px 13px;background:#fff;border-top:1px solid #e1ebe6}.ai-form textarea{resize:none;border:1px solid #cbdad2;border-radius:11px;padding:11px 12px;font:inherit;min-height:48px}.ai-form .btn{min-width:95px}.ai-example-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.ai-example-grid span{padding:9px 11px;border:1px solid #dce7e1;border-radius:10px;background:#f8fbfa;font-size:12px}@media(max-width:760px){.ai-chat{height:55vh}.ai-msg{max-width:94%}.ai-form{grid-template-columns:1fr}.ai-example-grid{grid-template-columns:1fr 1fr}}
.money-receipt-thermal80{display:none;direction:rtl;font-family:Tahoma,Arial,sans-serif;color:#000;background:#fff}.thermal80-receipt-amount{text-align:center;border:1px solid #000;padding:2mm;margin:2mm 0;font-size:10px}.thermal80-receipt-amount span,.thermal80-receipt-amount b{display:block}.thermal80-receipt-amount b{font-size:16px;margin-top:1mm}


/* ===== v1.10.1 dashboard navigation + brand icon system ===== */
.kpi-link{color:inherit;text-decoration:none;cursor:pointer;transition:transform .14s ease,box-shadow .14s ease,border-color .14s ease}
.kpi-link:hover{transform:translateY(-2px);box-shadow:0 7px 20px rgba(8,99,62,.10);border-color:#b8d5c7}
.kpi .icon.kpi-green{background:#e8f6ef;color:#078b57}.kpi .icon.kpi-orange{background:#fff2e7;color:#f4770b}
.dashboard-quick .brand-quick{background:#fff;border:1px solid #d6e5de;color:#173a2d;justify-content:center;position:relative;overflow:hidden}
.dashboard-quick .brand-quick:hover{border-color:#9fc7b3;background:#fbfefc}.dashboard-quick .brand-quick.q-orange:hover{border-color:#f6bd8a;background:#fffaf6}
.quick-icon{width:32px;height:32px;border-radius:9px;display:inline-grid;place-items:center;font-size:20px;font-weight:900;line-height:1;background:#eaf7f0;color:#078b57;flex:0 0 32px}
.q-orange .quick-icon{background:#fff0e4;color:#f4770b}.q-green .quick-icon{background:#eaf7f0;color:#078b57}
.brand-nav-icon{width:26px;height:26px;border-radius:8px;display:grid;place-items:center;background:#fff;color:#078b57;border:2px solid #f4770b;font-size:11px;font-weight:900;letter-spacing:-.5px}
.header-ai-btn{display:inline-flex;align-items:center;gap:7px;padding:7px 10px;border:1px solid #cfe2d8;border-radius:12px;background:#f8fcfa;color:#075a39;font-weight:900;white-space:nowrap}
.header-ai-btn:hover{background:#edf8f2;border-color:#9fc7b3}.header-ai-mark{width:31px;height:31px;border-radius:9px;background:linear-gradient(135deg,#078b57 0 58%,#f4770b 58% 100%);color:#fff;display:grid;place-items:center;font-size:12px;font-weight:900;box-shadow:0 2px 7px rgba(8,99,62,.14)}
@media(max-width:900px){.header-ai-label{display:none}.header-ai-btn{padding:5px;border:0;background:transparent}.header-ai-mark{width:34px;height:34px}}


/* ===== v1.10.2 sales pricing + purchase live totals + dashboard colors ===== */
.dashboard-quick .brand-quick{border:0!important;color:#fff!important;box-shadow:0 2px 7px rgba(15,74,50,.08);transition:transform .14s ease,filter .14s ease,box-shadow .14s ease}
.dashboard-quick .brand-quick.q-green{background:var(--green2)!important}
.dashboard-quick .brand-quick.q-orange{background:var(--orange)!important}
.dashboard-quick .brand-quick:hover{transform:translateY(-1px);filter:brightness(.98);box-shadow:0 6px 15px rgba(15,74,50,.13)}
.dashboard-quick .brand-quick .quick-icon{background:rgba(255,255,255,.17)!important;color:#fff!important;border:1px solid rgba(255,255,255,.24)}
.purchase-totals-row{display:grid;grid-template-columns:2fr .8fr .8fr .9fr 1fr auto;gap:8px;align-items:stretch;margin-top:10px;padding-top:10px;border-top:2px solid #dce8e2}
.purchase-total-cell{border:1px solid #cfe0d8;border-radius:9px;background:#f8fcfa;padding:8px 9px;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:58px;text-align:center}
.purchase-total-cell span{font-size:12px;color:#53685f;font-weight:900}.purchase-total-cell b{font-size:18px;color:#075a39;margin-top:4px}.purchase-total-cell.total-label,.purchase-total-cell.total-value{background:#eef8f3;border-color:#b9d9ca}.purchase-total-cell.total-value b{font-size:21px}.purchase-total-spacer{min-width:0}
@media(max-width:800px){.purchase-totals-row{grid-template-columns:1fr 1fr}.purchase-total-spacer{display:none}.purchase-total-cell.total-label,.purchase-total-cell.total-value{grid-column:auto}}

/* ===== v1.10.5 smart marketing ===== */
.smart-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.smart-kpi{background:#fff;border:1px solid #dce9e2;border-radius:15px;padding:15px;box-shadow:0 3px 14px rgba(8,99,62,.05)}.smart-kpi span,.smart-kpi b,.smart-kpi small{display:block}.smart-kpi span{font-weight:800;color:#425d52}.smart-kpi b{font-size:30px;color:#08633e;margin:6px 0}.smart-kpi small{color:#73877e}.smart-panel h3{margin:0}.smart-action{display:inline-block;padding:5px 8px;border-radius:999px;font-size:11px;font-weight:900;white-space:nowrap}.smart-action.warn-soft{background:#fff4e8;color:#9b510d}.smart-action.danger-soft{background:#fff0ef;color:#a23d34}.smart-action.ok-soft{background:#eaf8f1;color:#076744}@media(max-width:1050px){.smart-kpis{grid-template-columns:1fr 1fr}}@media(max-width:600px){.smart-kpis{grid-template-columns:1fr}}
.customer-inline-stats{display:flex;gap:8px;flex-wrap:wrap;margin-top:7px}.customer-inline-stat{display:inline-flex;align-items:center;gap:5px;background:#f3f9f6;border:1px solid #d6e8df;border-radius:9px;padding:6px 9px;font-size:12px}.customer-inline-stat b{color:#075438}

/* ===== v1.10.7 cloud-ready desktop ===== */
.cloud-connect-card{border:1px solid #cfe2d9;background:linear-gradient(135deg,#fff,#f6fbf8)}.cloud-mode-banner{display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:12px;background:#eef7f2}.cloud-mode-banner b,.cloud-mode-banner small{display:block}.cloud-mode-banner small{margin-top:3px;color:#667b71}.cloud-dot{width:14px;height:14px;border-radius:50%;background:#c16f26;box-shadow:0 0 0 5px rgba(193,111,38,.12)}.cloud-dot.online{background:#08734a;box-shadow:0 0 0 5px rgba(8,115,74,.12)}.cloud-steps{margin:0;padding-right:22px;line-height:2}.cloud-steps li::marker{color:#f47b0a;font-weight:900}

/* ===== v1.10.7 daily/monthly physical reconciliation ===== */
.reconciliation-card{border:1px solid #cfe0d7;background:linear-gradient(180deg,#fff,#fbfdfc)}.section-title-row{display:flex;justify-content:space-between;gap:18px;align-items:flex-start;margin-bottom:12px}.section-title-row h3{margin:0 0 4px}.recon-summary{display:flex;flex-wrap:wrap;gap:7px;justify-content:flex-end}.recon-summary span{background:#f0f6f3;border:1px solid #d8e5de;border-radius:9px;padding:7px 9px;font-size:12px}.recon-summary b{display:block;font-size:15px;color:#075438;margin-top:2px}.recon-input{width:125px!important;min-width:100px!important;text-align:center!important;font-weight:900!important;background:#fffaf4!important;border:1.5px solid #e9a76f!important}.recon-diff,.stock-diff{display:block;font-weight:900}.recon-label{display:block;font-size:10px;color:#728077;margin-top:2px}.recon-advice{margin-top:12px;padding:11px 13px;border-radius:10px;border:1px solid #efc8a5;background:#fff7ef;color:#744316}.recon-advice.ok{border-color:#b8dac8;background:#eff9f4;color:#155a40}.ok-box{border-color:#b8dac8!important;background:#eff9f4!important}.capital-hero{display:grid;grid-template-columns:1.1fr 1fr;gap:18px;background:linear-gradient(135deg,#063f31,#08734a);color:#fff;border-radius:18px;padding:20px 22px;box-shadow:0 10px 32px rgba(6,63,49,.17)}.capital-hero>div:first-child>span,.capital-hero>div:first-child>b,.capital-hero>div:first-child>small{display:block}.capital-hero>div:first-child>b{font-size:34px;margin:7px 0;color:#fff}.capital-hero small{color:#d4eee2}.capital-components{display:grid;grid-template-columns:1fr 1fr;gap:8px}.capital-components span{background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.18);padding:9px;border-radius:10px}.capital-components b{display:block;margin-top:3px;color:#fff}.capital-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:9px}.capital-grid>div{padding:12px;background:#f4f9f6;border:1px solid #dbe8e1;border-radius:11px}.capital-grid span,.capital-grid b{display:block}.capital-grid b{font-size:18px;color:#075438;margin-top:5px}.capital-grid .capital-total{grid-column:1/-1;background:linear-gradient(90deg,#fff7ef,#eff9f4);border-color:#e8c6a7}.capital-grid .capital-total b{font-size:26px}.monthly-stock-wrap{max-height:560px;overflow:auto}.monthly-stock-wrap .table th{position:sticky;top:0;z-index:2;background:#eff6f2}.daily-close-kpis{grid-template-columns:repeat(6,1fr)}
@media(max-width:1100px){.section-title-row,.capital-hero{grid-template-columns:1fr;display:grid}.capital-grid{grid-template-columns:1fr 1fr}.daily-close-kpis{grid-template-columns:1fr 1fr}.recon-summary{justify-content:flex-start}}
@media(max-width:650px){.capital-grid,.capital-components{grid-template-columns:1fr}.capital-hero>div:first-child>b{font-size:27px}.recon-input{width:100px!important}}
