:root{--g:#0b6b4f;--gd:#084c38;--bg:#f3f6f5;--bd:#dde5e2;--tx:#1b2a26;--mu:#6b7c77;--rd:#c0392b}
*{box-sizing:border-box}body{margin:0;font-family:"Segoe UI",Tahoma,"Noto Naskh Arabic","Noto Sans Arabic",sans-serif;background:var(--bg);color:var(--tx)}
button,input,textarea,select{font:inherit}
.login{min-height:100vh;display:grid;place-items:center;padding:16px}
.card{background:#fff;border:1px solid var(--bd);border-radius:14px;padding:24px;box-shadow:0 2px 10px #0001}
.login .card{width:100%;max-width:380px}
.brand{display:flex;align-items:center;gap:10px;font-weight:700;font-size:20px;color:var(--g);margin-bottom:6px}
.logo{width:36px;height:36px;border-radius:10px;background:var(--g);color:#fff;display:grid;place-items:center;font-size:20px}
.sub{color:var(--mu);margin:0 0 18px;font-size:14px}
label{display:block;font-size:14px;margin:12px 0 4px}
input,textarea,select{width:100%;padding:10px 12px;border:1px solid var(--bd);border-radius:8px;background:#fff}
input:focus,textarea:focus,select:focus{outline:2px solid #0b6b4f55;border-color:var(--g)}
.btn{background:var(--g);color:#fff;border:0;border-radius:8px;padding:10px 16px;cursor:pointer;font-weight:600}
.btn:hover{background:var(--gd)}.btn.sec{background:#fff;color:var(--tx);border:1px solid var(--bd)}.btn.dng{background:#fff;color:var(--rd);border:1px solid #e7c3be}
.btn.full{width:100%;margin-top:18px}
.hint{background:#eef7f3;border:1px dashed #9cc9b8;border-radius:8px;padding:8px 10px;font-size:13px;margin-top:14px;color:var(--gd)}
.err{background:#fdeceb;color:var(--rd);border-radius:8px;padding:8px 10px;margin-top:12px;font-size:14px}
.shell{display:flex;min-height:100vh}
.side{width:230px;background:var(--gd);color:#fff;padding:16px 10px;flex-shrink:0}
.side .brand{color:#fff;padding:0 8px 16px}.side .logo{background:#fff2;}
.side a{display:flex;gap:10px;align-items:center;color:#d6ebe3;text-decoration:none;padding:10px 12px;border-radius:8px;margin-bottom:2px;cursor:pointer}
.side a:hover{background:#ffffff14}.side a.on{background:#fff;color:var(--gd);font-weight:700}
.main{flex:1;min-width:0}
.top{background:#fff;border-bottom:1px solid var(--bd);padding:12px 20px;display:flex;justify-content:space-between;align-items:center;gap:8px}
.top .menu{display:none}
.content{padding:20px}
h2{margin:0 0 16px;font-size:22px}
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;margin-bottom:16px}
.stat .n{font-size:26px;font-weight:700;color:var(--g)}.stat .l{color:var(--mu);font-size:14px}
.bar{display:flex;gap:10px;margin-bottom:12px;flex-wrap:wrap}.bar input{flex:1;min-width:160px}
table{width:100%;border-collapse:collapse;background:#fff}
th,td{text-align:right;padding:10px 12px;border-bottom:1px solid var(--bd);font-size:14px}
th{background:#f7faf9;color:var(--mu);font-weight:600}
.tw{overflow-x:auto;border:1px solid var(--bd);border-radius:12px;background:#fff}
.acts{display:flex;gap:6px;white-space:nowrap}.acts .btn{padding:5px 10px;font-size:13px}
.empty{text-align:center;color:var(--mu);padding:40px 10px}
.soon{text-align:center;padding:50px 16px}.soon .big{font-size:42px}
.modal{position:fixed;inset:0;background:#0007;display:grid;place-items:center;padding:12px;z-index:9}
.modal .card{width:100%;max-width:480px;max-height:92vh;overflow:auto}
.row2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.ltr{direction:ltr;text-align:right;unicode-bidi:plaintext}
@media(max-width:800px){
.side{position:fixed;inset:0 0 0 auto;transform:translateX(100%);transition:.2s;z-index:8;width:240px}
.side.open{transform:none}.top .menu{display:inline-block}.row2{grid-template-columns:1fr}.content{padding:12px}
th:nth-child(n+4),td:nth-child(n+4){display:none}th:last-child,td:last-child{display:table-cell}}

select{width:100%;padding:10px 12px;border:1px solid var(--bd);border-radius:8px;background:#fff;font:inherit}
.side a svg{flex-shrink:0}
.tag{padding:3px 10px;border-radius:99px;font-size:12px;font-weight:600;background:#eee}
.tag.draft{background:#eef0f2;color:#556}.tag.issued{background:#fff3d6;color:#8a5a00}.tag.paid{background:#dcf3e8;color:var(--gd)}
.tot{margin:14px 0;display:grid;gap:4px;justify-content:end;text-align:left;min-width:200px;margin-inline-start:auto;width:max-content}
.tot .g{font-size:18px;color:var(--g);border-top:1px solid var(--bd);padding-top:6px}
.dh{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:14px}
.parties{margin-bottom:12px}.dm{margin-bottom:12px;color:var(--mu)}
#it td input{padding:7px 8px}
@media print{.side,.top,.noprint{display:none!important}.content{padding:0}body{background:#fff}.card.doc{border:0;box-shadow:none}}
@media(max-width:800px){#il th:nth-child(n+4),#il td:nth-child(n+4),#it th:nth-child(n+4),#it td:nth-child(n+4){display:table-cell}.doc .tw th:nth-child(n+4),.doc .tw td:nth-child(n+4){display:table-cell}}

.net{margin-top:0;text-align:center;padding:20px}.net .n{font-size:30px;font-weight:700}.net.pay{background:#fff6e0;border-color:#e8cf90}.net.pay .n{color:#8a5a00}.net.ref{background:#e6f5ee}.net.ref .n{color:var(--gd)}
.stat .l+.n,.stat .n+.l{margin-top:2px}.stat .n{font-size:22px}
@media(max-width:800px){#xl th:nth-child(n+4),#xl td:nth-child(n+4){display:none}#xl th:last-child,#xl td:last-child{display:table-cell}#xl th:nth-child(6),#xl td:nth-child(6){display:table-cell}}
@media(max-width:800px){#xl th:nth-child(3),#xl td:nth-child(3){display:none}#xl .acts{flex-direction:column}}

.lh{display:flex;justify-content:space-between;align-items:center;gap:12px;border-bottom:2px solid var(--g);padding-bottom:12px;margin-bottom:14px;flex-wrap:wrap}
.lh-id{display:flex;align-items:center;gap:12px}.lh-n{font-size:18px;font-weight:700}
.logo-img{max-height:64px;max-width:140px;object-fit:contain}
.bc{width:190px;height:auto;max-height:60px}
.logo-up{display:flex;gap:12px;align-items:center}.logo-box{width:120px;height:80px;border:1px dashed var(--bd);border-radius:8px;display:grid;place-items:center;overflow:hidden;background:#fafcfb}.logo-box img{max-width:100%;max-height:100%}
.tag.cancelled{background:#fdeceb;color:var(--rd)}
.vrows{display:grid;gap:0;margin:8px 0}.vrows>div{display:flex;justify-content:space-between;gap:12px;padding:10px 0;border-bottom:1px dashed var(--bd)}.vrows span{color:var(--mu)}.vamt{font-size:20px;color:var(--g)}
.sig{display:flex;justify-content:space-around;margin-top:40px;text-align:center;color:var(--mu)}.sig div{width:40%}.sig i{display:block;border-bottom:1px solid #999;height:34px}
@media(max-width:800px){#vl th:nth-child(n+4),#vl td:nth-child(n+4){display:table-cell}#vl th:nth-child(3),#vl td:nth-child(3){display:none}.bc{width:150px}}
@media print{.logo-img{max-height:70px}.lh{border-color:#000}.bc{max-height:56px}}
@media(max-width:800px){#pl th:nth-child(4),#pl td:nth-child(4){display:none}#pl th:nth-child(n+4):last-child,#pl td:last-child{display:table-cell}#pl .acts{flex-direction:column}#pl td:first-child{min-width:110px}}

.codes{display:flex;align-items:center;gap:10px}.qr{flex-shrink:0;border:1px solid #ddd}
@media(max-width:800px){.codes{width:100%;justify-content:flex-start}}
@media print{.qr{border:0}}

.tq{margin:14px 0;padding:10px 12px;border:1px solid var(--bd);border-radius:8px;background:#fafcfb}
@media(max-width:800px){#cl th:nth-child(n+4),#cl td:nth-child(n+4){display:table-cell}#cl th:nth-child(3),#cl td:nth-child(3){display:none}#ct2 th:nth-child(2),#ct2 td:nth-child(2),#ct2 th:nth-child(3),#ct2 td:nth-child(3){display:none}#ct2 th:nth-child(n+4),#ct2 td:nth-child(n+4){display:table-cell}}
@page{size:A4;margin:10mm}
@media print{.card.doc{padding:0}.dh{margin-bottom:8px}.parties{margin-bottom:6px}.tq{margin:8px 0}.tot{margin:8px 0}.lh{margin-bottom:8px}}

table.is td{padding:9px 12px}table.is .num{text-align:left;direction:ltr;white-space:nowrap;font-variant-numeric:tabular-nums}
table.is tr.isS td{font-weight:700;border-top:1px solid #aab}table.is tr.isT td{font-weight:700;background:#f2f7f5;font-size:15px}
table.is tr.isH td{background:#fafcfb;color:var(--mu);font-weight:700}table.is tr.isG td{color:var(--gd);background:#e6f5ee}table.is tr.isL td{color:#8a2a20;background:#fdeceb}
@media print{.net{break-inside:avoid}}
.net.loss{background:#fdeceb;border-color:#e7b4ae}.net.loss .n{color:#8a2a20}
@media print{table.is td{padding:5px 10px;font-size:12px}.net.ref,.net.loss{padding:10px}}

.dtypes{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:14px}
.dtype{text-align:right;display:flex;flex-direction:column;gap:8px;cursor:pointer;font:inherit;color:var(--tx);align-items:flex-start;border:1px solid var(--bd)}
.dtype:hover{border-color:var(--g);box-shadow:0 2px 10px #0b6b4f22}.dtype b{font-size:18px}.dtype .di{color:var(--g)}.dtype .di svg{width:34px;height:34px}.dtype .cnt{color:var(--mu);font-size:13px}
.kind{display:inline-block;padding:2px 10px;border-radius:99px;font-size:12px;font-weight:700;background:#e6f5ee;color:var(--gd)}.kind.k-supplier{background:#fff1da;color:#8a5a00}.kind.k-both{background:#e5eefc;color:#1d4e9e}
.bal{font-weight:700}.bal.on{color:#8a5a00}.bal.ow{color:var(--gd)}

.ibc{margin-top:3px}.ibc .bc{max-height:34px;width:auto}.tabs{flex-wrap:wrap}.tabs .btn{padding:7px 12px;font-size:14px}
@media print{.ibc .bc{max-height:26px}}
