:root{font-family:'DM Sans',Segoe UI,sans-serif;color:#203c43;background:#f4f7f8;font-synthesis:none}*{box-sizing:border-box}body{margin:0;font-size:14px}button,input,select,textarea{font:inherit}button,a,input,select,textarea{outline-offset:4px}button{cursor:pointer}button:disabled{opacity:.45;cursor:not-allowed}button{border:1px solid #dce6e7;background:white;color:#24474e;border-radius:8px;padding:10px 15px;font-weight:500;display:inline-flex;align-items:center;justify-content:center;gap:8px}button:hover{background:#f0f6f5}button.primary{background:#096e62;color:#fff;border-color:#096e62}button.primary:hover{background:#07574f}button.danger{color:#ac3441}button.small{padding:6px 9px;font-size:12px}button.ghost{border-color:transparent;background:transparent}h1,h2,h3,p{margin:0}h1{font-size:28px;letter-spacing:-.8px;font-weight:600}h2{font-size:18px;font-weight:600}h3{font-size:15px;font-weight:600}small,.muted{color:#73868b;font-size:12px}a{color:#096e62}.shell{display:grid;grid-template-columns:220px minmax(0,1fr);min-height:100vh}.sidebar{background:#fff;border-right:1px solid #e0e9e9;padding:30px 18px;display:flex;flex-direction:column;gap:28px}.brand{display:flex;align-items:center;gap:10px;padding:0 8px}.brandmark{background:#096e62;border-radius:10px;color:white;display:grid;place-items:center;width:35px;height:38px;font-size:23px}.brand strong{letter-spacing:2px;font-size:17px}.brand small{display:block;font-size:10px;letter-spacing:1px;margin-top:2px}.section-label{font-size:10px;letter-spacing:1.6px;color:#91a2a6;margin:0 12px 10px}.nav{display:flex;flex-direction:column;gap:5px}.nav button{border:0;background:transparent;justify-content:flex-start;color:#6d8186;padding:12px 14px}.nav button.active{background:#e6f3ee;color:#096e62;font-weight:600}.icon{width:18px;height:18px;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center}.icon svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.sidefoot{margin-top:auto;background:#f4f8f7;padding:14px;border-radius:10px;font-size:12px;color:#718a85}.sidefoot strong{display:block;color:#315d54;margin-bottom:5px}.main{min-width:0}.topbar{height:78px;background:#fff;border-bottom:1px solid #e0e9e9;padding:0 34px;display:flex;justify-content:space-between;align-items:center;gap:12px}.crumb{font-size:12px;color:#819399}.profile{display:flex;align-items:center;gap:12px}.avatar{width:34px;height:34px;background:#e9f1ed;color:#096e62;border-radius:50%;display:grid;place-items:center;font-weight:600}.profile strong{display:block;font-size:12px}.profile small{font-size:11px}.page{padding:32px 34px;max-width:1600px;margin:auto}.pagehead{display:flex;justify-content:space-between;align-items:center;gap:18px;margin-bottom:26px;flex-wrap:wrap}.eyebrow{font-size:10px;letter-spacing:1.8px;color:#85979b;margin-bottom:7px}.pagehead p{margin-top:7px;color:#7b8f94;font-size:13px}.badge{font-size:11px;padding:5px 9px;border-radius:6px;background:#edf2f3;color:#61787f;white-space:nowrap;display:inline-block}.badge.paid,.badge.approved{background:#e3f3e9;color:#267052}.badge.pending,.badge.unpaid,.badge.partial{background:#fff2d9;color:#976d22}.badge.cancelled,.badge.rejected,.badge.overdue{background:#fbe9ec;color:#a14b58}.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:24px}.stat{background:#fff;border:1px solid #e0e9e9;border-radius:12px;padding:20px}.stat .label{display:flex;justify-content:space-between;align-items:center;color:#738a8e;font-size:12px}.stat .label .icon{color:#6d9489;background:#f0f6f3;width:30px;height:30px;border-radius:8px}.stat .value{font-size:27px;letter-spacing:-.7px;font-weight:600;margin:13px 0 5px;font-variant-numeric:tabular-nums}.stat .value small{font-size:11px;letter-spacing:0;font-weight:400;margin-right:5px}.stat .detail{font-size:11px;color:#899a9e}.board{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:22px}.panel{background:white;border:1px solid #e0e9e9;border-radius:12px;overflow:hidden}.panel-pad{padding:22px}.panelhead{padding:21px 22px;display:flex;align-items:center;justify-content:space-between;gap:10px;border-bottom:1px solid #edf1f1}.panelhead small{font-size:11px}.attention{padding:0 22px}.task{display:flex;align-items:center;gap:14px;padding:18px 0;border-bottom:1px solid #edf1f1}.task:last-child{border:0}.task .square{width:38px;height:38px;display:grid;place-items:center;background:#f6f2e8;color:#a98b41;border-radius:9px;flex-shrink:0}.task strong{font-weight:500;font-size:13px;display:block}.task small{font-size:11px;display:block;margin-top:3px}.task .arrow{margin-left:auto;padding:7px}.invoice-desk{padding:22px}.invoice-desk h2{margin-bottom:4px}.invoice-desk>small{display:block;margin-bottom:21px}.invoice-desk>button{width:100%;margin-bottom:9px}.latest{padding:16px;background:#f1f7f4;border-radius:9px;margin-top:18px}.latest .latestnum{display:flex;align-items:center;justify-content:space-between;margin:10px 0}.latest strong{font-weight:500}.latest p{font-size:12px;margin-top:6px;color:#657f77}.tablewrap{overflow:auto}table{border-collapse:collapse;width:100%;text-align:left;white-space:nowrap}th{font-weight:500;color:#82959a;background:#fafcfc;font-size:11px;padding:13px 22px}td{padding:16px 22px;border-top:1px solid #edf1f1;font-size:12px}td strong{font-weight:500}td.num,th.num{text-align:right;font-variant-numeric:tabular-nums}.table-actions{display:flex;gap:5px;justify-content:flex-end}.toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:18px}.toolbar input{max-width:320px}.toolbar .push{margin-left:auto}.empty{padding:40px;text-align:center;color:#7b8d92;font-size:13px}.recent{margin-top:22px}.report-grid{display:grid;grid-template-columns:1fr 1fr;gap:22px}.barrow{display:grid;grid-template-columns:90px 1fr 100px;align-items:center;gap:15px;margin:18px 0;font-size:12px}.track{background:#edf3f1;border-radius:4px;height:9px;overflow:hidden}.fill{height:100%;background:#0b8270}.login{min-height:100vh;display:grid;grid-template-columns:1fr 1fr}.login-story{background:#123f38;color:#fff;padding:65px;display:flex;flex-direction:column;justify-content:space-between}.login-story .brand{padding:0}.login-story .brand small{color:#a3c5b8}.login-story h1{font-size:44px;line-height:1.2;max-width:460px;margin:60px 0 22px}.login-story p{color:#a3c5b8;max-width:360px;line-height:1.8}.login-form{display:grid;place-items:center;padding:40px}.login-box{max-width:360px;width:100%}.login-box h1{margin-bottom:8px}.login-box p{margin-bottom:30px;color:#7d9094}.login-box .primary{width:100%;margin-top:8px}.demo{background:#eaf2ee;padding:14px;border-radius:9px;font-size:12px;line-height:1.8;margin-top:24px}.demo strong{display:block}.demo button{font-size:11px;padding:5px 8px;margin:8px 6px 0 0}label{font-size:12px;color:#557177;display:flex;flex-direction:column;gap:7px;margin-bottom:17px}input,select,textarea{border:1px solid #d8e3e4;background:#fff;border-radius:7px;color:#203c43;padding:10px 12px;min-width:0;width:100%}input[type=checkbox]{width:16px;height:16px;accent-color:#096e62}textarea{min-height:75px;resize:vertical}.fields{display:grid;grid-template-columns:1fr 1fr;gap:0 18px}.full{grid-column:1/-1}.hint{font-size:11px;color:#8a9a9e}.error{color:#ad3949;background:#fff1f2;padding:12px;border-radius:6px;font-size:12px;margin:10px 0}.hidden{display:none!important}dialog{border:0;border-radius:14px;padding:0;width:min(850px,calc(100% - 28px));max-height:90vh;color:#203c43;box-shadow:0 20px 100px #183f3333}dialog::backdrop{background:#13332e66;backdrop-filter:blur(3px)}.dialoghead{padding:23px 26px;border-bottom:1px solid #e5eceb;display:flex;align-items:center;justify-content:space-between}.dialogbody{padding:24px 26px}.dialogfoot{display:flex;justify-content:flex-end;gap:10px;padding-top:20px;border-top:1px solid #e5eceb;margin-top:20px}.line-item{display:grid;grid-template-columns:minmax(140px,2fr) 65px 100px 80px 90px 35px;gap:9px;align-items:center;margin-bottom:10px}.line-item input,.line-item select{padding:9px}.line-head{font-size:11px;color:#7c9196}.line-item .line-total{text-align:right;font-size:12px}.totals{max-width:300px;margin:18px 0 0 auto}.totals>div{display:flex;justify-content:space-between;margin:10px 0;color:#6d858c;font-size:13px}.totals .grand{padding-top:15px;border-top:1px solid #dfe9e6;font-size:18px;font-weight:600;color:#174c40}.check{flex-direction:row;align-items:center}.permission-table{white-space:normal}.permission-table th,.permission-table td{padding:10px;font-size:11px;text-align:center}.permission-table th:first-child,.permission-table td:first-child{text-align:left}.permission-table input{width:16px}.audit{padding:13px 0;border-bottom:1px solid #e7efed;font-size:12px}.audit small{display:block;font-size:11px;margin-top:5px}#toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:#164b3f;color:#fff;border-radius:9px;padding:12px 22px;box-shadow:0 8px 25px #0002;z-index:100;max-width:90%;display:none}#toast.show{display:block}.printsheet{display:none}.invoice-paper{padding:30px;background:white;color:#253d43}.invoice-paper header{display:flex;justify-content:space-between;border-bottom:2px solid #096e62;padding-bottom:24px;margin-bottom:24px}.invoice-paper h1{color:#096e62}.invoice-paper p{line-height:1.8;font-size:12px;white-space:pre-wrap}.invoice-paper .paperinfo{display:flex;justify-content:space-between;gap:20px;margin:20px 0}.invoice-paper th,.invoice-paper td{padding:12px;white-space:normal}.invoice-paper .paperfoot{margin-top:35px;border-top:1px solid #ddd;padding-top:20px;font-size:11px;color:#71867d}.settings-panel{max-width:850px}.currency-note{font-size:11px;color:#7e9690;margin-bottom:16px}.mobile-brand{display:none}@media(max-width:1150px){.shell{grid-template-columns:190px 1fr}.sidebar{padding:26px 12px}.page{padding:25px 22px}.topbar{padding:0 22px}.board{grid-template-columns:minmax(0,1fr) 260px}.stats{gap:10px}.stat{padding:15px}.stat .value{font-size:23px}}@media(max-width:900px){.shell{grid-template-columns:1fr}.sidebar{padding:15px 18px;gap:16px;border-right:0;border-bottom:1px solid #dfe9e6}.sidebar .brand{padding:0}.nav{flex-direction:row;flex-wrap:wrap;gap:4px}.nav button{padding:8px 10px;font-size:12px}.section-label,.sidefoot{display:none}.topbar{height:64px}.board{grid-template-columns:1fr 270px}.login-story{padding:35px}.login-story h1{font-size:35px}.stats{grid-template-columns:repeat(2,1fr)}}@media(max-width:650px){.page{padding:22px 15px}.board,.report-grid{grid-template-columns:1fr}.topbar{padding:0 15px}.profile strong,.profile small,.crumb{display:none}.topbar>.crumb{display:block}.profile{gap:5px}h1{font-size:23px}.fields{grid-template-columns:1fr}.dialogbody{padding:18px}.dialoghead{padding:18px}.line-item{grid-template-columns:minmax(105px,1.5fr) 50px 75px 60px 30px;gap:5px}.line-item .line-total{display:none}.line-item input,.line-item select{padding:8px 4px;font-size:12px}.login{grid-template-columns:1fr}.login-story{padding:25px}.login-story h1,.login-story p,.login-story>small{display:none}.login-form{padding:35px 22px}.stat .value{font-size:23px}.permission-table th,.permission-table td{padding:8px 5px}.toolbar input{max-width:none}.tablewrap td,.tablewrap th{padding:13px}.invoice-paper{padding:8px}.invoice-paper .paperinfo{flex-direction:column}}@media print{body{background:white}body>*{display:none!important}body>.printsheet{display:block!important}.printsheet{padding:0}.invoice-paper{padding:0}button{display:none!important}@page{size:A4;margin:16mm}}
/* Full-width workspace with a high-contrast Al Masar palette. */
@media screen {
 :root{color-scheme:light;--brand:#087f70;--navy:#112f3d;--muted:#526d79;background:#edf3f7;color:#183746}
 html,body,#app{width:100%;min-height:100%;margin:0}
 body{min-height:100dvh}
 .shell{width:100%;min-height:100dvh;grid-template-columns:212px minmax(0,1fr)}
 .main{width:100%;min-width:0;background:#edf3f7}
 .page{width:100%;max-width:none;margin:0;padding:24px 28px;min-height:calc(100dvh - 66px)}
 .sidebar{background:var(--navy);border-right:0;padding:25px 14px;color:#f4fbff;gap:30px}
 .sidebar .brand{padding:0 9px}
 .sidebar .brandmark{background:#18ab91;color:#fff}
 .sidebar .brand small{color:#a7c3ce}
 .sidebar .section-label{color:#93b3c1}
 .sidebar .nav button{color:#bfd0d8;border-radius:8px;padding:11px 13px}
 .sidebar .nav button:hover{background:#204655;color:#fff}
 .sidebar .nav button.active{background:#0b8977;color:#fff;box-shadow:0 4px 12px #001c2526}
 .sidebar .sidefoot{background:#1b3e4d;color:#b4ced8;border:1px solid #305362}
 .sidebar .sidefoot strong{color:#f2fbff}
 .topbar{height:66px;padding:0 28px;border-bottom-color:#d6e2e9;box-shadow:0 2px 8px #173e4c04}
 .crumb,.profile small{color:var(--muted)}
 .avatar{background:#d5f1e7;color:#096452}
 .pagehead{margin-bottom:19px}
 .pagehead p{color:#536f7d}
 .eyebrow{color:#557482;letter-spacing:1.5px}
 .currency-note{color:#5c7884;margin-bottom:15px}
 h1{color:#153a4b}
 .panel,.stat{border-color:#d9e4ea;box-shadow:0 3px 13px #14374605}
 .stats{gap:16px;margin-bottom:20px}
 .stat{position:relative;border-top:3px solid #0b8c78;padding:16px 19px}
 .stat:nth-child(2){border-top-color:#d6a13b}
 .stat:nth-child(3){border-top-color:#3579c7}
 .stat:nth-child(4){border-top-color:#bf6d47}
 .stat .label{color:#476977}
 .stat .label .icon{background:#e0f5ed;color:#0b7d67}
 .stat:nth-child(2) .label .icon{background:#fff3d9;color:#916713}
 .stat:nth-child(3) .label .icon{background:#e8f1fe;color:#306caa}
 .stat:nth-child(4) .label .icon{background:#fff0e8;color:#a35636}
 .stat .value{color:#163d4e;margin:9px 0 3px}
 .stat .detail{color:#5a7480}
 small,.muted,.hint{color:#597380}
 .board{grid-template-columns:minmax(0,1fr) minmax(270px,29%);gap:20px}
 .panelhead{padding:16px 20px;background:#fbfdff;border-bottom-color:#e1eaf0}
 .attention{padding:0 20px}
 .task{padding:14px 0;border-bottom-color:#e5edf2}
 .task .square{background:#fff3d7;color:#936e24}
 .task small{color:#617986}
 .task strong{color:#254b5d}
 .invoice-desk{padding:19px 20px}
 .invoice-desk>small{margin-bottom:15px}
 .invoice-desk>button{margin-bottom:8px}
 button.primary{background:#087f70;border-color:#087f70}
 button.primary:hover{background:#066556;border-color:#066556}
 button:not(.primary):not(.danger):not(.nav button){color:#315768}
 .latest{margin-top:12px;padding:13px 15px;background:#e8f5ef;border:1px solid #cee8dd}
 .latest p{color:#496d60}
 .recent{margin-top:20px}
 th{background:#f4f8fb;color:#4f6d7b}
 td{border-top-color:#e4ecf1}
 .tablewrap{max-width:100%}
 .fullscreen-toggle{white-space:nowrap;background:#edf5f8;border-color:#d4e3eb}
 .login{width:100%;min-height:100dvh}
 .login-story{background:var(--navy)}
 .login-story .eyebrow{color:#b6d7de}
 .login-story h1{color:white}
 :fullscreen{background:#edf3f7;overflow:auto}
 @media(min-width:1600px){.shell{grid-template-columns:236px minmax(0,1fr)}.page{padding:28px 36px}.topbar{padding:0 36px}.board{grid-template-columns:minmax(0,1fr) minmax(320px,27%)}}
 @media(max-width:1100px){.shell{grid-template-columns:184px minmax(0,1fr)}.page{padding:22px 20px}.board{grid-template-columns:minmax(0,1fr) 260px}.profile{gap:8px}.profile>.badge{display:none}}
 @media(max-width:900px){.shell{grid-template-columns:1fr}.sidebar{padding:14px 18px;gap:14px}.sidebar .brand{padding:0}.sidebar .nav button{padding:8px 10px}.topbar{padding:0 20px}.stats{grid-template-columns:repeat(2,minmax(0,1fr))}.board{grid-template-columns:minmax(0,1fr) 260px}.page{min-height:calc(100dvh - 180px)}}
 @media(max-width:650px){.page{padding:20px 14px}.topbar{padding:0 14px;gap:8px}.board{grid-template-columns:1fr}.profile{gap:5px}.profile>.avatar{display:none}.fullscreen-toggle{font-size:11px;padding:8px}.stats{gap:10px}.stat{padding:14px}.stat .value{font-size:22px}.pagehead{gap:12px}.sidebar .nav{gap:2px}.sidebar .nav button{font-size:11px;padding:7px 8px}.topbar .crumb{font-size:11px}.report-grid{grid-template-columns:1fr}}
}

/* Editable invoice lines and reference-matched A4 invoice. */
.invoice-line{border:1px solid #d8e4e8;border-radius:10px;background:#f8fbfc;padding:16px;margin-bottom:15px}
.invoice-line-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}
.invoice-line-fields{display:grid;grid-template-columns:minmax(180px,2fr) 75px 90px 115px 90px;gap:12px}
.invoice-line label{margin-bottom:12px}.invoice-line textarea{min-height:85px;background:white}
.invoice-line-total{display:flex;justify-content:flex-end;gap:18px;font-size:13px;color:#4b6b78}
.reference-invoice{font-family:Arial,Helvetica,sans-serif;font-size:12px;line-height:1.4;color:#4c4c4c;background:#fff;min-height:1050px;display:flex;flex-direction:column;padding:30px 28px 0;border:1px solid #e5e5e5}
.reference-invoice .invoice-content{flex:1}
.reference-invoice .reference-header{display:flex;justify-content:space-between;align-items:flex-start;gap:24px;border:0;padding:0;margin:0 0 22px}
.reference-invoice .invoice-logo{width:260px;max-width:48%;height:auto;object-fit:contain;margin:0}
.reference-meta{font-size:12px;min-width:235px;color:#454545}.reference-meta strong{font-size:14px;font-weight:600}.reference-meta>div{margin-top:1px}
.reference-parties{display:grid;grid-template-columns:1fr 1fr;margin-bottom:15px}
.reference-parties>div{min-width:0}
.reference-invoice .reference-parties h3{background:#303153;color:white;font-size:12px;font-weight:600;padding:9px 10px;margin:0;border-right:1px solid white}
.reference-invoice .party-body{padding:16px 6px 0;overflow-wrap:anywhere;min-height:95px}
.reference-invoice .party-body>strong{font-size:14px;font-weight:600;display:block;margin-bottom:3px}
.reference-invoice p{font-size:12px;line-height:1.4;white-space:pre-wrap;margin:0}
.invoice-email{color:#008fc7;overflow-wrap:anywhere}
.reference-table-wrap{width:100%}
.reference-invoice .reference-table{width:100%;table-layout:fixed;white-space:normal;border-collapse:collapse}
.reference-invoice .reference-table th{background:#303153!important;color:white!important;padding:7px 5px;font-size:11px;font-weight:400;border:none;white-space:normal}
.reference-invoice .reference-table td{font-size:12px;padding:18px 5px 14px;border:0;vertical-align:top;overflow-wrap:anywhere;white-space:normal}
.reference-invoice .reference-table td.num{white-space:nowrap;overflow-wrap:normal}
.reference-invoice .reference-item{color:#269500}
.reference-invoice .reference-description{white-space:pre-wrap!important;line-height:1.4}
.invoice-discount{font-size:10px;margin-top:6px;color:#666;white-space:normal}
.reference-totals{margin:12px 0 0 auto;width:245px;max-width:100%;break-inside:avoid}
.reference-totals>div{display:flex;justify-content:space-between;gap:20px;padding:5px 6px;font-size:13px}
.reference-totals .reference-grand{color:#299600;border-top:1px solid #43ac19;font-size:17px;margin-top:3px;padding-top:7px}
.reference-grand strong{font-weight:500}
.reference-words{text-align:right;margin:10px 0 18px;font-size:12px;break-inside:avoid}
.reference-words strong{font-weight:600;margin-right:7px}
.reference-payment{text-align:right;font-size:11px;margin:-5px 0 20px;color:#555}
.reference-bank{border-left:6px solid #008fc7;padding:10px 12px;margin:8px 0 22px;break-inside:avoid}
.reference-invoice .reference-bank h3{font-size:12px;font-weight:400;margin:0 0 12px}
.reference-bank dl{display:grid;grid-template-columns:82px 1fr;gap:1px 4px;margin:0;font-size:11px;max-width:450px}
.reference-bank dt,.reference-bank dd{margin:0;overflow-wrap:anywhere}
.reference-bank p{font-size:11px;color:#777}
.reference-notes{margin:18px 0;font-size:11px;break-inside:avoid}.reference-invoice .reference-notes p{font-size:11px;margin-top:4px;overflow-wrap:anywhere}
.reference-footer{padding-top:26px;margin-top:32px;break-inside:avoid}
.reference-invoice .reference-footer>p{border-top:1px solid #999;padding:16px 0;font-size:10px;text-align:center;color:#666}
.reference-contact{display:flex;background:#3d327b;color:#fff;justify-content:space-around;align-items:stretch;margin:0 -28px;font-size:11px}
.reference-contact span{flex:1;text-align:center;padding:11px 8px;overflow-wrap:anywhere;white-space:pre-line}
.reference-contact span:nth-child(2){background:#42a29d}
@media(max-width:700px){.invoice-line-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.invoice-line-fields>label:first-child{grid-column:1/-1}.reference-invoice{min-height:900px;padding:18px 12px 0}.reference-invoice .reference-header{gap:12px;flex-direction:column}.reference-invoice .invoice-logo{width:235px;max-width:80%}.reference-meta{min-width:0}.reference-invoice .reference-table td,.reference-invoice .reference-table th{font-size:10px;padding:8px 3px}.reference-contact{margin:0 -12px}.reference-parties{gap:1px}.reference-invoice .party-body>strong{font-size:12px}.reference-invoice .party-body{min-height:90px}.reference-words{text-align:left}}
@media print{
 @page{size:A4;margin:12mm 12mm 8mm}
 .reference-invoice{border:0;padding:0;min-height:275mm;display:flex;font-size:10pt;print-color-adjust:exact;-webkit-print-color-adjust:exact}
 .reference-invoice .reference-header{flex-direction:row;margin-bottom:18px}
 .reference-invoice .invoice-logo{width:67mm;max-width:45%}
 .reference-meta{font-size:9pt;min-width:65mm}.reference-meta strong{font-size:10pt}
 .reference-invoice .reference-table td,.reference-invoice .reference-table th{font-size:9pt}
 .reference-invoice .reference-table th{padding:6px 4px}
 .reference-invoice .reference-table td{padding:14px 4px}
 .reference-table thead{display:table-header-group}.reference-table tr{break-inside:avoid}
 .reference-invoice .party-body{min-height:88px}
 .reference-invoice .reference-contact{margin:0}
 .reference-invoice .reference-footer{padding-top:18px;margin-top:24px}
 .reference-invoice .reference-words{text-align:right}
 .reference-totals,.reference-bank,.reference-notes,.reference-footer{break-inside:avoid}
}


.invoice-preview-link{text-align:right;margin-bottom:12px;font-size:12px}.standalone-invoice-tools{max-width:794px;margin:20px auto;display:flex;align-items:center;justify-content:space-between;padding:0 12px;gap:14px}.standalone-invoice{width:100%;max-width:794px;margin:0 auto 24px}.standalone-invoice .reference-invoice{min-height:1123px}.standalone-invoice .reference-header{flex-direction:row}.standalone-invoice .invoice-logo{max-width:45%}.standalone-invoice .reference-meta{min-width:225px}@media(max-width:600px){.standalone-invoice .reference-header{flex-direction:column}.standalone-invoice .invoice-logo{max-width:80%}.standalone-invoice-tools{flex-wrap:wrap}}

/* Readable workspace typography and invoice status control. */
:root{font-family:'Segoe UI',Tahoma,Arial,sans-serif}body{font-size:15px}button,input,select,textarea{font-family:inherit}h1,h2,h3{font-family:inherit}h1{font-weight:650}.nav button{font-size:14px}.pagehead p{font-size:14px}td{font-size:13px}th{font-size:12px}.table-actions{align-items:center;flex-wrap:wrap}.table-actions .small{font-size:12px;padding:8px 10px}.invoice-status{width:118px;min-width:105px;font-size:13px;padding:8px 10px;background:#fff8e8;border-color:#ead7aa;color:#6d5320}.invoice-status:has(option[value="paid"]:checked){background:#e5f5ec;border-color:#b8dfca;color:#246047}.permission-table{min-width:850px}.reference-invoice{font-family:'Segoe UI',Tahoma,Arial,sans-serif}@media(max-width:900px){.sidebar .nav button{font-size:12px}}

.stats{gap:20px;margin-bottom:24px}.stat{padding:21px 22px}.stat .label{font-family:'Segoe UI',Tahoma,Arial,sans-serif;font-size:14px;font-weight:500;gap:14px}.stat .value{display:flex;align-items:baseline;gap:9px;flex-wrap:wrap;font-family:'Segoe UI',Tahoma,Arial,sans-serif;font-size:30px;font-weight:600;letter-spacing:-.5px;line-height:1.25;margin:15px 0 9px;font-variant-numeric:tabular-nums}.stat .value small{font-size:12px;font-weight:500;letter-spacing:.5px;margin-right:0}.stat .detail{font-size:12px;line-height:1.5}.invoice-status{width:145px;min-width:140px}.payment-summary{background:#edf6f3;border-radius:9px;padding:16px;margin-bottom:22px;display:grid;gap:10px}.payment-summary>div{display:flex;justify-content:space-between;gap:12px}.partial-balance{display:flex;justify-content:space-between;gap:12px;padding:16px 0;margin:4px 0 15px;color:#0b6e5d}@media(max-width:650px){.stats{gap:12px}.stat{padding:16px}.stat .label{font-size:12px}.stat .value{font-size:25px;gap:6px;margin:12px 0 7px}.stat .detail{font-size:11px}}

/* Centered Al Masar sign-in. */
.clean-login{min-height:100dvh;width:100%;display:grid;place-items:center;padding:36px 20px;background:#f7f9fb}.clean-login-stack{width:100%;max-width:430px}.clean-login-card{background:#fff;border:1px solid #dce3e9;border-radius:15px;padding:35px 38px 36px;box-shadow:0 12px 40px #1b344d0b}.clean-login-logo{display:block;width:230px;max-width:85%;height:auto;margin:0 auto 28px}.clean-login-card header{text-align:center;margin-bottom:28px}.clean-login-card h1{font-size:27px;letter-spacing:-.6px;color:#192e43;font-weight:650}.clean-login-card header p{font-size:13px;color:#617186;margin-top:9px;line-height:1.6}.clean-login-card label{font-size:13px;font-weight:500;color:#455b70;margin-bottom:19px;gap:8px}.clean-login-card input{font-size:14px;background:#fcfdff;border-color:#d4dee7;min-height:45px;padding:11px 13px}.clean-login-card input:focus{outline:2px solid #16917c66;border-color:#148876}.password-field{position:relative}.password-field input{padding-right:66px}.password-toggle{position:absolute;right:5px;top:5px;bottom:5px;padding:0 9px;border:0;background:transparent!important;font-size:12px;color:#536d80!important}.login-submit{width:100%;min-height:46px;margin-top:5px;font-size:15px;font-weight:600}.clean-login-footer{text-align:center;color:#7b8795;font-size:12px;margin-top:23px}.clean-login-card .error{font-weight:400}@media(max-width:480px){.clean-login{padding:24px 16px}.clean-login-card{padding:28px 24px 30px}.clean-login-logo{width:205px;margin-bottom:25px}.clean-login-card h1{font-size:25px}}
.clean-login-brand{display:flex;align-items:center;justify-content:center;gap:14px;margin:0 auto 28px}.clean-login-brand .clean-login-logo{width:215px;max-width:75%;margin:0}.clean-login-erp{font-size:17px;font-weight:600;letter-spacing:2px;color:#426071;border-left:1px solid #d5e0e7;padding:10px 0 10px 14px}@media(max-width:480px){.clean-login-brand{gap:10px}.clean-login-brand .clean-login-logo{width:190px}.clean-login-erp{font-size:15px;padding-left:10px}}

/* Larger, direct business interface. */
@media screen{body{font-size:16px}.pagehead{margin-bottom:24px}.pagehead h1{font-size:30px}h2{font-size:20px}h3{font-size:17px}.nav button,.sidebar .nav button{font-size:15px}button,input,select,textarea{font-size:15px}label{font-size:14px}th{font-size:13px}td{font-size:14px}.table-actions .small{font-size:13px}.hint{font-size:12px}.badge{font-size:12px}.task strong{font-size:15px}.task small{font-size:13px}.profile strong{font-size:14px}.profile small{font-size:12px}.clean-login-card header p{font-size:14px}.clean-login-card label{font-size:14px}.clean-login-card input{font-size:15px}.reference-invoice{font-size:12px}@media(max-width:650px){.pagehead h1{font-size:26px}.sidebar .nav button{font-size:13px}td{font-size:13px}}}
.sidebar .app-brand{display:flex;align-items:center;justify-content:center;gap:8px;background:#fff;border-radius:9px;padding:13px 9px;min-height:70px}.app-brand-logo{display:block;width:calc(100% - 35px);max-width:165px;height:auto}.app-brand-erp{color:#355268;font-size:11px;font-weight:600;letter-spacing:1px;border-left:1px solid #d8e1e8;padding-left:8px}@media(max-width:900px){.sidebar .app-brand{align-self:flex-start;min-height:62px;width:230px;padding:10px 12px}.app-brand-logo{max-width:170px}}

.stat>.detail{display:block}.stat-link{display:block;width:100%;text-align:left;font:inherit;cursor:pointer;transition:box-shadow .15s,transform .15s}.stat-link:hover{background:#fff;box-shadow:0 6px 20px #153c4a18;transform:translateY(-2px)}.stat-link:focus-visible{outline:3px solid #188c79;outline-offset:3px}.stat-link:active{transform:translateY(0)}@media(prefers-reduced-motion:reduce){.stat-link{transition:none}}

.report-controls{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px;margin-bottom:24px}.report-controls label{margin:0}@media(max-width:650px){.report-controls{grid-template-columns:1fr;gap:16px}}

.invoice-actions{width:125px;min-width:110px;margin-left:auto;display:block;padding:9px 12px;font-size:14px;background:#fff;border-color:#ccdade;color:#234e5f}

.add-expense-menu{width:190px;max-width:100%;min-height:43px;padding:10px 14px;background:#087f70;color:white;border:1px solid #087f70;border-radius:8px;font-weight:600}.add-expense-menu option{background:white;color:#203c43}

.expense-menu{position:relative;display:inline-block}.expense-menu>button{min-width:150px;min-height:44px}.expense-menu-options{position:absolute;top:calc(100% + 7px);right:0;width:245px;max-width:calc(100vw - 28px);padding:6px;background:white;border:1px solid #d6e2e8;border-radius:9px;box-shadow:0 10px 30px #17384720;z-index:30}.expense-menu-options[hidden]{display:none}.expense-menu-options>button{display:block;width:100%;border:0;border-radius:5px;text-align:left;justify-content:flex-start;padding:12px;font-size:15px;font-weight:400;background:white;color:#244653}.expense-menu-options>button:hover,.expense-menu-options>button:focus-visible{background:#eaf5f1;color:#086c5f}

.customer-name{padding:0;border:0;background:none!important;color:#087f70!important;text-align:left;font-weight:600;text-decoration:underline;text-underline-offset:3px}.customer-contact{margin:-8px 0 24px;color:#53717e;line-height:1.7;overflow-wrap:anywhere}

.invoice-payment-area{display:grid;grid-template-columns:minmax(0,1fr) minmax(220px,44%);gap:20px;align-items:start;break-inside:avoid;margin-top:8px}.invoice-payment-area .reference-bank{margin-top:0}.reference-invoice .invoice-pay-methods{padding:10px 0;margin:0;break-inside:avoid}.reference-invoice .invoice-pay-methods h3{font-size:12px;font-weight:500;color:#555;margin:0 0 13px}.invoice-pay-logos{display:flex;gap:12px;align-items:center;flex-wrap:wrap}.payment-mark{display:inline-flex;align-items:center;justify-content:center;color:#34465a;flex-shrink:0}.fawran-logo{position:relative;width:100px;height:28px;overflow:hidden}.reference-invoice .fawran-logo img{position:absolute;width:170px;max-width:none;height:auto;left:-32px;top:-43px}.mobile-pay,.pos-pay{flex-direction:column;gap:2px;font-size:9px}.mobile-pay svg,.pos-pay svg{width:23px;height:25px}.visa-pay{color:#15367c;font-family:Arial,sans-serif;font-weight:800;font-style:italic;font-size:22px;letter-spacing:-1px}.mastercard-pay{flex-direction:column;gap:0}.mastercard-pay svg{width:48px;height:29px}.mastercard-pay span{font-family:Arial,sans-serif;font-size:7px;color:#333}@media screen and (max-width:600px){.invoice-payment-area{grid-template-columns:1fr;gap:0}.invoice-pay-logos{gap:16px}.reference-invoice .invoice-pay-methods{padding-bottom:18px}}@media print{.invoice-payment-area{grid-template-columns:minmax(0,1fr) 44%;gap:15px}.invoice-pay-logos{gap:10px}.payment-mark{print-color-adjust:exact;-webkit-print-color-adjust:exact}}
.reference-invoice .invoice-pay-methods h3{display:inline-block;background:#087f70;color:#fff;font-size:13px;font-weight:700;padding:6px 12px;border-radius:5px;margin:0 0 14px;letter-spacing:.2px;print-color-adjust:exact;-webkit-print-color-adjust:exact}
/* Stack QuickPay below Account Details in screen and print layouts. */ .reference-invoice .invoice-payment-area{display:flex;flex-direction:column;align-items:stretch;gap:0}.reference-invoice .invoice-payment-area .reference-bank{margin-bottom:12px}.reference-invoice .invoice-payment-area .invoice-pay-methods{padding:0 0 12px 18px;margin:0}.reference-invoice .invoice-payment-area .invoice-pay-logos{justify-content:flex-start}@media print{.reference-invoice .invoice-payment-area{display:flex;flex-direction:column;gap:0}.reference-invoice .invoice-payment-area .invoice-pay-methods{padding-left:18px;break-inside:avoid}}
/* Invoice account heading and payment spacing. */ .reference-invoice .reference-bank h3{font-weight:700;font-size:13px}.reference-invoice .invoice-payment-area .reference-bank{margin-bottom:24px}.reference-invoice .invoice-payment-area .invoice-pay-methods{margin-top:8px}@media print{.reference-invoice .reference-bank h3{font-weight:700}.reference-invoice .invoice-payment-area .reference-bank{margin-bottom:24px}.reference-invoice .invoice-payment-area .invoice-pay-methods{margin-top:8px}}
.reference-invoice .reference-meta{text-align:right;margin-left:auto}@media print{.reference-invoice .reference-meta{text-align:right}}

.exact-payment-row{display:flex;align-items:center;gap:14px}.exact-fawran{position:relative;display:block;width:105px;height:29px;overflow:hidden}.exact-fawran img{position:absolute;width:183px;max-width:none;height:auto;left:-34px;top:-47px}.exact-payment-tile{width:72px;height:46px;border-radius:6px;display:flex;align-items:center;justify-content:center;box-shadow:0 3px 7px #0002;overflow:hidden}.visa-tile{background:#124698}.visa-tile img{width:57px;height:auto;filter:brightness(0) invert(1)}.mastercard-tile{background:#050505}.mastercard-tile img{width:53px;height:39px;object-fit:contain}.exact-payment-row img{display:block}@media print{.exact-payment-tile{box-shadow:none;print-color-adjust:exact;-webkit-print-color-adjust:exact}}
/* Tiny invoice payment marks. */ .exact-payment-row{gap:8px}.exact-fawran{width:62px;height:18px}.exact-fawran img{width:108px;left:-20px;top:-28px}.exact-payment-tile{width:42px;height:27px;border-radius:3px;box-shadow:none}.visa-tile img{width:33px}.mastercard-tile img{width:31px;height:23px}.generated-pay-logo{width:43px;height:24px;object-fit:contain}.generated-fawran{width:63px;height:24px;object-fit:contain}
/* Separation between amount in words and account information. */ .reference-invoice .invoice-payment-area{margin-top:30px}.exact-payment-row{gap:8px}.generated-fawran{width:63px;height:24px}.generated-pay-logo{width:43px;height:24px}.exact-payment-tile{width:42px;height:27px}@media print{.reference-invoice .invoice-payment-area{margin-top:30px}}
.reference-invoice .reference-bank dl{row-gap:7px;line-height:1.6}.reference-invoice .reference-bank h3{margin-bottom:16px}@media print{.reference-invoice .reference-bank dl{row-gap:7px;line-height:1.6}}
/* Place banking and payment details in the lower invoice area. */ .reference-invoice .invoice-content{display:flex;flex-direction:column}.reference-invoice .invoice-payment-area{margin-top:auto!important;padding-top:36px}.reference-invoice .reference-notes{flex-shrink:0}@media print{.reference-invoice .invoice-payment-area{margin-top:auto!important;padding-top:30px}}
.reference-invoice .reference-table tbody td{vertical-align:middle;background:#f3f3f3;padding-top:18px;padding-bottom:18px}.reference-invoice .reference-table th:nth-child(4),.reference-invoice .reference-table td:nth-child(4){text-align:center}.reference-invoice .reference-table th:nth-child(6),.reference-invoice .reference-table th:nth-child(7),.reference-invoice .reference-table td:nth-child(6),.reference-invoice .reference-table td:nth-child(7){text-align:right}
/* Banking follows invoice rows and totals naturally. */ .reference-invoice .invoice-payment-area{margin-top:22px!important;padding-top:0!important;flex-shrink:0}@media print{.reference-invoice .invoice-payment-area{margin-top:22px!important;padding-top:0!important}}

.description-suggestions{display:flex;flex-wrap:wrap;gap:6px;padding:7px 0 0}.description-suggestions button{font-size:13px;padding:6px 11px;background:#eaf5f1;border:1px solid #c7e3da;color:#146a57;border-radius:6px;font-weight:400}.description-suggestions button:hover,.description-suggestions .suggestion-selected{background:#087f70;color:#fff;border-color:#087f70}
.reference-invoice .reference-description{line-height:1.65!important;text-decoration:none!important;overflow:visible}.reference-invoice .reference-table tbody td{border-top:0;border-bottom:0}

/* Selected Minimal invoice design. */
.reference-invoice{color:#183048;font-family:Arial,sans-serif}.reference-invoice .minimal-invoice-title{font-size:30px;font-weight:700;letter-spacing:0;margin:0 0 15px;color:#112e49}.reference-invoice .reference-header{padding-bottom:22px;border-bottom:1px solid #d6dee6}.reference-invoice .reference-parties{padding:0 0 20px;border-bottom:1px solid #d6dee6}.reference-invoice .reference-parties h3{color:#617286;background:transparent;padding:0 6px;border:0;font-weight:400}.reference-invoice .party-body{min-height:0;padding-top:10px}.reference-invoice .party-body>strong{color:#112e49}.reference-invoice .reference-table th{background:white!important;color:#52647a!important;border-bottom:1px solid #d6dee6;padding:13px 5px;font-weight:600}.reference-invoice .reference-table tbody td{background:white!important;border-bottom:1px solid #d6dee6;padding:14px 5px;color:#183048}.reference-invoice .reference-item{color:#183048}.reference-invoice .reference-totals{margin-top:18px}.reference-invoice .reference-grand{color:#009f9a;border-top:0;font-weight:600;font-size:20px}.reference-invoice .reference-words{text-align:left;border-top:1px solid #d6dee6;border-bottom:1px solid #d6dee6;padding:17px 0;margin:22px 0}.reference-invoice .reference-words>strong{display:block;color:#617286;font-weight:400;margin-bottom:12px}.reference-invoice .reference-bank{border-left:0;padding-left:0}.reference-invoice .reference-bank h3{color:#112e49}.reference-invoice .invoice-payment-area .invoice-pay-methods{padding-left:0}.reference-invoice .invoice-pay-methods h3{background:transparent;color:#009f9a;padding:0;border-radius:0;font-size:16px}.reference-invoice .reference-footer>p{border-color:#d6dee6;color:#617286}.reference-invoice .reference-contact{background:white;color:#617286}.reference-invoice .reference-contact span:nth-child(2){background:white}@media print{.reference-invoice .reference-table th{background:white!important;color:#52647a!important}.reference-invoice .reference-table tbody td{background:white!important}}

/* Invoice heading bars */
.reference-invoice .reference-parties h3{background:#303153;color:#fff;padding:9px 10px;font-weight:600}.reference-invoice .reference-parties{border-bottom:0}.reference-invoice .reference-table th{background:#303153!important;color:#fff!important;border-bottom:0}@media print{.reference-invoice .reference-parties h3,.reference-invoice .reference-table th{background:#303153!important;color:#fff!important;print-color-adjust:exact;-webkit-print-color-adjust:exact}}

/* Full invoice page border */
.reference-invoice{border:1px solid #303153!important}@media print{.reference-invoice{border:1px solid #303153!important;padding:6mm;min-height:270mm;box-decoration-break:clone;-webkit-box-decoration-break:clone}}

/* Subtle item row background */
.reference-invoice .reference-table tbody td{background:#f3f3f7!important}@media print{.reference-invoice .reference-table tbody td{background:#f3f3f7!important;print-color-adjust:exact;-webkit-print-color-adjust:exact}}

/* Shift customer information slightly right. */
.reference-invoice .reference-parties{grid-template-columns:55% 45%;gap:0}

/* Readable branded invoice footer. */
.reference-invoice .reference-footer>p{font-family:Arial,sans-serif;font-size:10px;color:#526074;line-height:1.5;padding:12px 8px}.reference-invoice .reference-contact,.reference-invoice .reference-contact span:nth-child(2){background:#303153;color:#fff}.reference-invoice .reference-contact{font-family:Arial,sans-serif;font-size:11px;font-weight:500;margin:0}.reference-invoice .reference-contact span{padding:12px 8px;line-height:1.5}@media print{.reference-invoice .reference-contact,.reference-invoice .reference-contact span{background:#303153!important;color:#fff!important;print-color-adjust:exact;-webkit-print-color-adjust:exact}}

/* Amount in words directly below invoice total. */
.reference-invoice .reference-words{text-align:right;border:0;padding:0;margin:10px 0 0;line-height:1.6}.reference-invoice .reference-words>strong{display:inline;color:#617286;font-weight:400;margin:0 6px 0 0}

/* Circular contact icons. */
.reference-invoice .reference-contact .footer-contact-item{display:flex;align-items:center;justify-content:center;gap:8px}.reference-invoice .reference-contact .footer-contact-item>span{flex:0 1 auto;padding:0;text-align:left}.footer-contact-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 24px;width:24px;height:24px;border:1px solid #8c8daa;border-radius:50%;background:#454668;color:#fff}.footer-contact-icon svg{width:13px;height:13px}

.reference-invoice{position:relative;isolation:isolate}.reference-invoice:before{content:"";position:absolute;inset:0;background:url('/al-masar-logo.png?v=20261019-bilingual') center/65% auto no-repeat;opacity:.035;pointer-events:none;z-index:-1}.reference-invoice .reference-contact .footer-contact-item:last-child{flex:1.35}.reference-invoice .reference-contact .footer-contact-item>span{overflow-wrap:normal;word-break:normal;max-width:235px;line-height:1.5}
.letterhead-paper{width:794px;max-width:100%;min-height:1123px;margin:20px auto;background:white;padding:35px 28px 0;display:flex;flex-direction:column}.letterhead-paper .letterhead-top{border-bottom:1px solid #d6dee6;padding-bottom:22px}.letterhead-paper .letterhead-top img{width:240px;height:auto}.letterhead-space{flex:1;min-height:750px}.letterhead-paper .reference-contact{margin:0;font:11px Arial;background:#303153;color:white;display:flex;padding:12px;gap:20px}.letterhead-paper .reference-contact span{background:transparent;flex:1;line-height:1.5}.letterhead-paper:before{z-index:-1}@media print{.letterhead-tools{display:none}.letterhead-paper{width:100%;min-height:270mm;margin:0;padding:6mm}.letterhead-space{min-height:0}.letterhead-paper .reference-contact{background:#303153!important;color:white!important}}

.invoice-pdf-preview{display:block;width:100%;height:78vh;min-height:600px;border:0;background:#edf1f5}.full-page-pdf{height:90vh}

/* No outer page frame. */
.reference-invoice,.letterhead-paper{border:0!important}@media print{.reference-invoice,.letterhead-paper{border:0!important}}

.reference-invoice .reference-contact .footer-contact-item:last-child{gap:12px;min-width:0}.reference-invoice .reference-contact .footer-contact-item:last-child>span{max-width:210px;white-space:normal;overflow-wrap:break-word;line-height:1.45}.reference-invoice .reference-contact .footer-contact-icon{flex-shrink:0}

/* Clean invoice preview without nested viewer chrome. */
.invoice-pdf-preview{height:76vh;min-height:500px;background:white}.full-page-pdf{height:92vh}.dialogbody:has(.invoice-pdf-preview){overflow:hidden}.dialogbody:has(.invoice-pdf-preview) .dialogfoot{margin-top:12px}

.reference-invoice .reference-contact{min-height:60px;align-items:center;padding:8px 10px;gap:10px}.reference-invoice .reference-contact .footer-contact-item{padding:6px;min-width:0}.reference-invoice .reference-contact .footer-contact-item:last-child{flex:1.6;gap:12px}.reference-invoice .reference-contact .footer-contact-item:last-child>span{max-width:none;white-space:normal;font-size:10px;line-height:1.65}.reference-invoice .reference-contact .footer-contact-item:last-child>span br{display:block}

/* Letterhead shares the invoice footer and prints as one A4 sheet. */
.letterhead-paper .reference-footer{margin-top:auto}.letterhead-paper .reference-contact{font-family:Arial,sans-serif;font-size:11px;font-weight:500}.letterhead-paper .letterhead-space{min-height:0;flex:1}.letterhead-paper{height:1123px;min-height:1123px}.letterhead-paper .reference-contact span{background:transparent}
@media print{body>#letterhead{display:block!important}#letterhead .letterhead-paper{display:flex!important;width:100%;height:270mm;min-height:270mm;max-height:270mm;margin:0;padding:6mm 6mm 0;box-sizing:border-box;overflow:hidden}#letterhead .letterhead-space{min-height:0;flex:1}#letterhead .reference-footer{margin-top:auto;flex-shrink:0}#letterhead .reference-contact{background:#303153!important;color:#fff!important;print-color-adjust:exact;-webkit-print-color-adjust:exact}#letterhead .reference-contact span{background:transparent!important;color:inherit!important}}

.reference-invoice .reference-bank dl{grid-template-columns:90px minmax(0,1fr);column-gap:8px}.reference-invoice .reference-bank dd{position:relative;padding-left:12px}.reference-invoice .reference-bank dd::first-letter{color:transparent}.reference-invoice .reference-bank dd:before{content:":";position:absolute;left:0;color:#183048}

@media screen{#letterhead.printsheet{display:block}}
@media print{body>main#letterhead.printsheet{display:block!important;visibility:visible!important;position:relative!important}#letterhead,#letterhead *{visibility:visible!important}#letterhead .letterhead-top{display:block!important}#letterhead .letterhead-top img{display:block!important;width:64mm;height:auto}#letterhead .reference-footer{display:block!important}#letterhead .reference-contact{display:flex!important}#letterhead .letterhead-paper:before{z-index:0}#letterhead .letterhead-top,#letterhead .reference-footer{position:relative;z-index:1}}

/* One colon per bank detail, with consistent spacing. */
.reference-invoice .reference-bank dl{grid-template-columns:105px minmax(0,1fr);column-gap:12px;row-gap:9px}.reference-invoice .reference-bank dd{display:grid;grid-template-columns:10px minmax(0,1fr);column-gap:14px;padding-left:0}.reference-invoice .reference-bank dd:before{content:none}.reference-invoice .reference-bank dd::first-letter{color:inherit}.reference-invoice .bank-colon{color:inherit}

/* Position invoice logo lower within the header. */
.reference-invoice .reference-header .invoice-logo{margin-top:46px;align-self:flex-start}@media print{.reference-invoice .reference-header .invoice-logo{margin-top:12mm}}

/* Match invoice branding on the company letterhead. */
.letterhead-paper .letterhead-top img{width:260px;max-width:48%;height:auto;margin-top:46px}.letterhead-paper .reference-contact{min-height:60px;padding:8px 10px;gap:10px;align-items:center;font-family:Arial,sans-serif;font-size:11px;font-weight:500}.letterhead-paper .reference-contact .footer-contact-item{padding:6px}.letterhead-paper .reference-contact .footer-contact-item>span{padding:0}.letterhead-paper .reference-footer{padding-top:18px}
@page company-letterhead{size:A4;margin:0}
@media print{body:has(#letterhead){margin:0!important;padding:0!important}body>main#letterhead.printsheet{page:company-letterhead}#letterhead .letterhead-paper{height:297mm!important;min-height:297mm!important;max-height:297mm!important;padding:12mm 18mm 8mm!important}#letterhead .letterhead-top img{width:67mm!important;max-width:48%;margin-top:12mm!important}#letterhead .reference-contact{min-height:16mm;padding:2mm 2.6mm;font-size:8.25pt}#letterhead .reference-footer{padding-top:0}}

/* Slightly stronger company watermark. */
.reference-invoice:before{opacity:.07}

/* Translucent item rows reveal the watermark underneath. */
.reference-invoice .reference-table tbody td{background:rgba(48,49,83,.035)!important}@media print{.reference-invoice .reference-table tbody td{background:rgba(48,49,83,.035)!important}}

/* Keep workspace navigation visible while content scrolls. */
@media screen and (min-width:901px){.sidebar{position:sticky;top:0;height:100dvh;align-self:start;overflow-y:auto;overscroll-behavior:contain}.shell{align-items:start}}

/* Green invoice item names. */
.reference-invoice .reference-table tbody td.reference-item{color:#319b23!important}@media print{.reference-invoice .reference-table tbody td.reference-item{color:#319b23!important}}

/* Compact header with centred invoice title. */
.reference-invoice .reference-header .invoice-logo{margin-top:0!important}.reference-invoice .reference-header{padding-bottom:12px;margin-bottom:0;border-bottom:0}.reference-invoice .invoice-section-title{text-align:center;font:700 24px Arial,sans-serif;color:#112e49;margin:10px 0 14px;letter-spacing:1px}@media print{.reference-invoice{padding-top:3mm}.reference-invoice .invoice-section-title{font-size:18pt;margin:8px 0 12px}}

/* Restore the invoice title at the top right; keep header content high. */
.reference-invoice .reference-header{align-items:flex-start;padding-top:0;padding-bottom:20px}.reference-invoice .reference-meta{align-self:flex-start}.reference-invoice .minimal-invoice-title{margin-top:0;margin-bottom:12px}@media screen{.reference-invoice{padding-top:18px}}

.stamp-checkbox{display:flex;align-items:center;gap:10px}.stamp-checkbox input{width:18px;height:18px}.invoice-payment-area{position:relative}.invoice-stamp{display:flex;justify-content:flex-end;margin-top:8px}.invoice-stamp img{width:120px;height:auto;max-height:120px;object-fit:contain}

/* Stamp beside bank details instead of below payment logos. */
.reference-invoice .invoice-payment-area .invoice-stamp{position:absolute;right:0;top:8px;margin:0;width:120px}.reference-invoice .invoice-payment-area:has(.invoice-stamp) .reference-bank{padding-right:145px;min-height:130px}@media(max-width:500px){.reference-invoice .invoice-payment-area .invoice-stamp{width:90px}.reference-invoice .invoice-payment-area .invoice-stamp img{width:90px}.reference-invoice .invoice-payment-area:has(.invoice-stamp) .reference-bank{padding-right:105px}}

/* 1.5-inch stamp with a slight anticlockwise tilt. */
.reference-invoice .invoice-payment-area .invoice-stamp{width:1.5in;right:8px;top:12px}.reference-invoice .invoice-payment-area .invoice-stamp img{width:1.5in;height:auto;max-height:none;transform:rotate(-10deg)}.reference-invoice .invoice-payment-area:has(.invoice-stamp) .reference-bank{padding-right:170px;min-height:155px}

/* Stamp positioned in the marked area nearer the centre. */
.reference-invoice .invoice-payment-area .invoice-stamp{right:190px}@media(max-width:600px){.reference-invoice .invoice-payment-area .invoice-stamp{right:155px}}

.sales-trend{display:block;font-size:12px;font-weight:600}.sales-trend.up{color:#087f70}.sales-trend.down{color:#b43c49}.previous-sales{display:block;margin-top:5px;color:#617286;font-size:12px}.stats{grid-template-columns:repeat(auto-fit,minmax(210px,1fr))}

#app-loading{position:fixed;right:24px;bottom:24px;z-index:10000;display:flex;align-items:center;gap:12px;padding:14px 20px;background:#fff;color:#183746;border:1px solid #d9e5eb;border-radius:12px;box-shadow:0 6px 28px #112f3d22;font-size:14px;pointer-events:none}#app-loading[hidden]{display:none}.loading-spinner{width:22px;height:22px;border:3px solid #dcefeb;border-top-color:#087f70;border-radius:50%;animation:loading-spin .75s linear infinite}@keyframes loading-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.loading-spinner{animation:none;border-style:dotted}}@media print{#app-loading{display:none!important}}

/* Slim moving progress bar without text or spinner. */
#app-loading{top:0;left:0;right:0;bottom:auto;height:4px;padding:0;display:block;border:0;border-radius:0;background:#d7ece8;box-shadow:none;overflow:hidden;pointer-events:none}#app-loading[hidden]{display:none}.loading-bar-track{position:absolute;inset:0 auto 0 0;width:35%;background:linear-gradient(90deg,#087f70,#35cbb7,#087f70);border-radius:0 6px 6px 0;animation:loading-bar-slide 1.2s ease-in-out infinite}@keyframes loading-bar-slide{0%{transform:translateX(-110%)}100%{transform:translateX(390%)}}@media(prefers-reduced-motion:reduce){.loading-bar-track{animation:none;width:100%;opacity:.7}}

/* Centre the loading bar in the viewport. */
#app-loading{top:50%;left:50%;right:auto;bottom:auto;transform:translate(-50%,-50%);width:220px;max-width:65vw;height:6px;border-radius:99px;background:#d7ece8;box-shadow:0 2px 12px #112f3d15}.loading-bar-track{border-radius:99px}

/* Centred flowing colour loading bar. */
#app-loading{width:180px;height:7px;background:#e2e8f0;border-radius:99px;box-shadow:0 0 0 7px #ffffffb3,0 7px 24px #112f3d14}.loading-bar-track{width:55%;border-radius:99px;background:linear-gradient(90deg,#008ed6,#13c4b5,#8b40dc,#ef3883);animation:loading-colour-flow 1.5s ease-in-out infinite}@keyframes loading-colour-flow{0%{transform:translateX(-105%);opacity:.5}45%{opacity:1}100%{transform:translateX(195%);opacity:.5}}@media(prefers-reduced-motion:reduce){.loading-bar-track{animation:none;width:100%;opacity:1}}

/* Spinners on both sides of the centred loading bar. */
#app-loading{overflow:visible}#app-loading:before,#app-loading:after{content:"";position:absolute;top:50%;width:18px;height:18px;margin-top:-9px;border:2px solid #dce5ee;border-top-color:#087f70;border-radius:50%;box-sizing:border-box;animation:loading-spin .8s linear infinite}#app-loading:before{left:-35px}#app-loading:after{right:-35px;border-top-color:#8b40dc;animation-direction:reverse}#app-loading .loading-bar-track{clip-path:inset(0 round 99px);animation:loading-centre-pulse 1.5s ease-in-out infinite;left:0;width:100%;background-size:200% 100%}@keyframes loading-centre-pulse{0%,100%{opacity:.5;background-position:0% 50%}50%{opacity:1;background-position:100% 50%}}@media(prefers-reduced-motion:reduce){#app-loading:before,#app-loading:after,#app-loading .loading-bar-track{animation:none}}

/* Microsoft-style rotating dots. */
#app-loading{width:44px;height:44px;max-width:none;background:transparent;box-shadow:none;overflow:visible;border-radius:0}#app-loading:before,#app-loading:after{content:none}.ms-loading-dots{position:relative;display:block;width:44px;height:44px}.ms-loading-dots i{position:absolute;inset:0;animation:ms-dot-orbit 2.6s cubic-bezier(.15,.6,.8,.4) infinite;animation-delay:calc(var(--dot)*.16s);opacity:0}.ms-loading-dots i:before{content:"";position:absolute;top:0;left:20px;width:4px;height:4px;border-radius:50%;background:#087f70}@keyframes ms-dot-orbit{0%{transform:rotate(0deg);opacity:0}8%{opacity:1}75%{opacity:1}90%,100%{transform:rotate(720deg);opacity:0}}@media(prefers-reduced-motion:reduce){.ms-loading-dots i{animation:none;opacity:1;transform:rotate(calc(var(--dot)*72deg))}}

/* Block interaction while requests are running. */
.app-is-loading body:after{content:"";position:fixed;inset:0;z-index:9998;background:rgba(237,243,247,.35);pointer-events:all;cursor:wait}.app-is-loading dialog:after{content:"";position:fixed;inset:0;z-index:9998;background:rgba(237,243,247,.2);pointer-events:all;cursor:wait}#app-loading{z-index:10000;pointer-events:none}@media print{.app-is-loading body:after,.app-is-loading dialog:after{display:none}}

/* Keep the sidebar visually steady during navigation. */
@media screen{.app-is-loading body:after{background:rgba(237,243,247,.12)}.sidebar{animation:none!important;transition:none!important}}

/* Compact inline employee status checkbox. */
#employee-form .fields>label.stamp-checkbox{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;align-self:end;gap:9px;min-height:40px;margin:0;padding:0 0 2px}#employee-form .stamp-checkbox input[type=checkbox]{width:17px;height:17px;min-width:17px;flex:0 0 17px;margin:0;padding:0}

.chart-legend{display:flex;gap:20px;padding:0 22px 20px;font-size:12px;color:#617286}.chart-legend>span{display:flex;align-items:center;gap:7px}.chart-legend i{width:10px;height:10px;border-radius:3px}.income-key,.income-bar{background:#087f70}.expense-key,.expense-bar{background:#ec9262}.income-expense-chart{height:210px;margin:0 24px;display:flex;gap:15px;border-bottom:1px solid #dce6ec;background:repeating-linear-gradient(to top,transparent 0,transparent 49px,#edf2f6 50px)}.chart-month{flex:1;min-width:0;position:relative}.chart-bars{height:100%;display:flex;align-items:flex-end;justify-content:center;gap:6px}.chart-bar{width:24px;max-width:40%;border-radius:4px 4px 0 0;position:relative;min-height:0}.chart-bar span{display:none;position:absolute;bottom:100%;left:50%;transform:translateX(-50%);padding:6px 8px;background:#183746;color:white;font-size:11px;white-space:nowrap;border-radius:5px;z-index:2}.chart-bar:hover span{display:block}.chart-month-label{text-align:center;padding-top:9px;font-size:12px;color:#617286}.chart-summary{display:flex;justify-content:space-between;gap:12px;padding:42px 24px 22px;font-size:12px;color:#617286}.chart-summary strong{display:block;color:#183746;font-size:16px;margin-top:5px}

/* Animate dashboard graph bars on each render. */
.chart-bar{transform-origin:center bottom;animation:chart-bar-rise .85s cubic-bezier(.2,.7,.2,1) both}.chart-month:nth-child(2) .chart-bar{animation-delay:.07s}.chart-month:nth-child(3) .chart-bar{animation-delay:.14s}.chart-month:nth-child(4) .chart-bar{animation-delay:.21s}.chart-month:nth-child(5) .chart-bar{animation-delay:.28s}.chart-month:nth-child(6) .chart-bar{animation-delay:.35s}@keyframes chart-bar-rise{from{transform:scaleY(0);opacity:.3}to{transform:scaleY(1);opacity:1}}@media(prefers-reduced-motion:reduce){.chart-bar{animation:none}}

.sidebar-account{margin-top:auto;padding:18px 8px 0;border-top:1px solid #ffffff26}.sidebar-user{display:flex;align-items:center;gap:10px;padding-bottom:14px}.sidebar-user strong{display:block;color:#fff;font-size:14px}.sidebar-user small{display:block;color:#a7c3ce;font-size:12px;margin-top:3px}.sidebar-account .sidebar-logout{width:100%;justify-content:flex-start;background:#ffffff0d;border:1px solid #ffffff30;color:#fff;gap:10px}.sidebar-account .sidebar-logout:hover{background:#ffffff20}.topbar-actions{display:flex;align-items:center}

.sidebar-account button.sidebar-user{width:100%;border:0;border-radius:8px;background:transparent;text-align:left;justify-content:flex-start;padding:8px 0 14px}.sidebar-account button.sidebar-user:hover{background:#ffffff0d}.sidebar-account button.sidebar-logout{background:#c93543!important;border-color:#c93543!important;color:#fff!important;font-weight:600}.sidebar-account button.sidebar-logout:hover{background:#aa2634!important;border-color:#aa2634!important}.profile-details{display:flex;gap:22px;align-items:flex-start}.profile-details>.avatar{width:54px;height:54px;font-size:22px;flex-shrink:0}.profile-details dl{display:grid;grid-template-columns:110px 1fr;gap:16px 20px;margin:0}.profile-details dt{color:#617286}.profile-details dd{margin:0;font-weight:600;color:#183746}

.dashboard-date{font-size:22px;font-weight:650;color:#183746;line-height:1.4}@media(max-width:650px){.dashboard-date{font-size:17px}}

.quotation-terms{margin-top:20px;break-inside:avoid}.quotation-terms h3{font-size:13px;font-weight:700;margin-bottom:7px;color:#183746}.quotation-terms p{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.6;font-size:12px}#quotation-form>label{display:block;margin-top:16px}#quotation-form>label textarea{display:block;width:100%;min-height:75px;margin-top:7px}
