:root{
  --ink:#1D1A17; --side:#231F1C; --side-2:#2F2A26; --red:#CB1C24; --red-d:#A3161D; --orange:#E28A15; --orange-soft:#FBE8C8;
  --bg:#F6F4F1; --card:#fff; --line:#E7E2DB; --soft:#FAF8F5; --text:#1D1A17; --muted:#6B645C;
  --green:#067647; --green-bg:#E7F6EC; --neg:#B42318; --neg-bg:#FEE4E2; --amber:#93540A; --amber-bg:#FFF4DC; --amber-line:#F1D48A;
  --r:14px;
}
*{box-sizing:border-box}
html,body{margin:0;background:var(--bg);color:var(--text);font-family:"Segoe UI",Tahoma,Arial,sans-serif;font-size:14px}
button,input,select{font-family:inherit;font-size:14px}
a{color:var(--red-d)}
.boot{display:flex;align-items:center;justify-content:center;height:100vh;color:var(--muted);font-size:18px}
.num{font-variant-numeric:tabular-nums;direction:ltr;unicode-bidi:isolate;white-space:nowrap}
.en{direction:ltr;unicode-bidi:isolate}

.shell{display:flex;min-height:100vh}
.side{width:236px;flex:none;background:#fff;border-right:1px solid var(--line);display:flex;flex-direction:column;gap:18px;padding:22px 14px;position:sticky;top:0;height:100vh;overflow-y:auto}
.brand{display:flex;align-items:center;gap:12px;padding:4px 8px 16px;border-bottom:1px solid var(--line)}
.brand img{width:50px;height:50px;border-radius:50%;flex:none;box-shadow:0 2px 8px rgba(203,28,36,.25)}
.brand b{display:block;font-size:18px;color:var(--ink)}
.brand small{color:var(--muted);font-size:12px}
.nav{display:flex;flex-direction:column;gap:4px}
.nav a{display:flex;align-items:center;gap:10px;min-height:44px;padding:0 14px;border-radius:12px;color:#4A443E;text-decoration:none;font-size:15px;border-left:3px solid transparent}
.nav a:hover{background:var(--soft)}
.nav a.on{background:#FDEDEE;color:var(--red-d);font-weight:700;border-left-color:var(--red)}
.nav a i{width:7px;height:7px;border-radius:50%;background:#D6CEC4;flex:none}
.nav a.on i{background:var(--red)}
.nav .sep{font-size:11px;color:#A39A90;padding:14px 14px 4px;letter-spacing:.3px}
.who{margin-top:auto;background:var(--soft);border:1px solid var(--line);border-radius:14px;padding:12px 14px;font-size:13px;color:var(--muted);display:flex;flex-direction:column;gap:6px}
.who b{color:var(--ink);font-size:15px}
.who button{background:#fff;border:1px solid var(--line);color:var(--ink);border-radius:9px;padding:7px;cursor:pointer}
.who button:hover{border-color:var(--red);color:var(--red-d)}
.main{flex:1;min-width:0;padding:28px 34px 60px;display:flex;flex-direction:column;gap:18px;max-width:1280px}

h1{margin:0;font-size:26px;letter-spacing:-.2px}
h2{margin:0;font-size:17px}
h2.sec{font-size:15px;color:var(--muted);font-weight:600;margin-bottom:-6px}
.muted{color:var(--muted)}
.head{display:flex;align-items:flex-end;justify-content:space-between;gap:14px;flex-wrap:wrap}
.head p{margin:4px 0 0;color:var(--muted)}
.tabs{display:inline-flex;gap:4px;flex-wrap:wrap;background:#ECE7E0;padding:4px;border-radius:12px}
.tabs a,.tabs button{padding:7px 18px;border-radius:9px;border:0;background:transparent;color:#4A443E;text-decoration:none;cursor:pointer;font-weight:600}
.tabs .on{background:#fff;color:var(--red-d);box-shadow:0 1px 3px rgba(0,0,0,.12)}

.card{background:var(--card);border:1px solid var(--line);border-radius:18px;padding:20px;box-shadow:0 1px 2px rgba(29,26,23,.04)}
.card>h2,.card>.head{margin-bottom:14px}
.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:14px}
.kpi{position:relative;background:#fff;border:1px solid var(--line);border-radius:18px;padding:18px 20px;display:flex;flex-direction:column;gap:5px;overflow:hidden;box-shadow:0 1px 2px rgba(29,26,23,.04)}
.kpi::before{content:"";position:absolute;top:0;right:0;left:0;height:4px;background:#D6CEC4}
.kpi>span{color:var(--muted);font-size:13px;font-weight:600}
.kpi b{font-size:27px;letter-spacing:-.3px}
.kpi small{color:var(--muted);font-size:12.5px}
.kpi.k2::before{background:var(--orange)} .kpi.k3::before{background:#6B645C} .kpi.k4::before{background:var(--green)} .kpi.kneg::before{background:var(--neg)}
.kpi.hero{background:linear-gradient(135deg,#CB1C24,#9E141B);border-color:#9E141B;color:#fff}
.kpi.hero::before{background:var(--orange)}
.kpi.hero>span,.kpi.hero small{color:#FBD9DB}
.kpi.hero small.up,.kpi.hero small.down{color:#fff;font-weight:600}
.up{color:var(--green)} .down{color:var(--neg)}
.pos{color:var(--green)} .neg{color:var(--neg)}

.alert{border:1px solid var(--amber-line);background:var(--amber-bg);color:var(--amber);border-radius:14px;padding:12px 16px;line-height:1.7;border-left:4px solid var(--orange)}
.alert b{color:#6B3B05}
.ok{border:1px solid #B7E4C7;background:var(--green-bg);color:var(--green);border-radius:14px;padding:12px 16px}
.err{border:1px solid #F5B5AF;background:var(--neg-bg);color:var(--neg);border-radius:14px;padding:12px 16px}

.tw{overflow-x:auto}
table{border-collapse:collapse;width:100%}
th,td{padding:10px 12px;border-bottom:1px solid #F0ECE6;text-align:left;vertical-align:middle}
th{font-size:12px;color:var(--muted);font-weight:700;background:#fff;border-bottom:2px solid var(--line);white-space:nowrap;position:sticky;top:0}
tbody tr:nth-child(even) td{background:#FCFBF9}
td.n,th.n{text-align:right}
tr.tot td{font-weight:700;background:#F4F0EA!important;border-top:2px solid var(--line);border-bottom:0}
tr.tot td:first-child{border-radius:0 10px 10px 0} tr.tot td:last-child{border-radius:10px 0 0 10px}
tr.sub td{font-weight:700}
tr.dim td{color:#A39A90}
tr.click{cursor:pointer}
tr.click:hover td{background:#FDF3E3!important}
td a{text-decoration:none;font-weight:600}
td a:hover{text-decoration:underline}
.tag{display:inline-block;padding:3px 10px;border-radius:999px;font-size:12px;font-weight:600;background:var(--soft);border:1px solid var(--line);color:var(--muted);white-space:nowrap}
.tag.warn{background:var(--amber-bg);border-color:var(--amber-line);color:var(--amber)}
.tag.good{background:var(--green-bg);border-color:#B7E4C7;color:var(--green)}
.tag.bad{background:var(--neg-bg);border-color:#F5B5AF;color:var(--neg)}
.bar{height:8px;border-radius:4px;background:var(--orange);min-width:2px}
.bar.red{background:var(--red)} .bar.grey{background:#B9B0A5}
.barcell{min-width:110px}
.matrix td,.matrix th{padding:8px 9px;font-size:13px}
.matrix td:first-child,.matrix th:first-child{position:sticky;left:0;background:#fff!important;white-space:nowrap;min-width:170px;border-right:1px solid var(--line)}
.matrix tr.tot td:first-child{background:#F4F0EA!important}

.chart{width:100%;height:auto;display:block}
.chart .grid{stroke:#EEE9E2;stroke-width:1}
.chart .ax{font-size:11px;fill:#8A8178;font-family:inherit}
.chart .bcur{fill:var(--red)} .chart .bprev{fill:#E9C28C}
.legend{display:flex;gap:16px;color:var(--muted);font-size:13px}
.legend i{display:inline-block;width:11px;height:11px;border-radius:3px;margin-right:6px;vertical-align:-1px}
.legend .lc{background:var(--red)} .legend .lp{background:#E9C28C}

.filters{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.filters select,.filters input{padding:8px 12px;border:1px solid var(--line);border-radius:11px;background:#fff;min-height:40px}
.filters select:focus,.filters input:focus,.login input:focus,label.f input:focus{outline:2px solid #F3B5B8;border-color:var(--red)}
.filters input[type=search]{flex:1;min-width:180px}
.btn{padding:10px 20px;border-radius:11px;border:1px solid var(--ink);background:var(--ink);color:#fff;cursor:pointer;font-weight:600}
.btn.sec{background:#fff;color:var(--ink);border-color:var(--line)}
.btn.red{background:var(--red);border-color:var(--red)}
.btn:disabled{opacity:.5;cursor:default}
.grid2{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:16px}
.kv{display:flex;justify-content:space-between;gap:12px;padding:8px 0;border-bottom:1px dashed var(--line)}
.kv:last-child{border-bottom:0}
.kv.strong{font-weight:700;border-bottom:0;margin-top:6px;padding:10px 12px;background:#F4F0EA;border-radius:10px}

.login{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:20px}
.login{background:linear-gradient(160deg,#F6F4F1 55%,#FBE8C8)}
.login form{background:#fff;border:1px solid var(--line);box-shadow:0 12px 40px rgba(29,26,23,.10);border-top:5px solid var(--red);border-radius:20px;padding:30px;width:100%;max-width:360px;display:flex;flex-direction:column;gap:14px;text-align:center}
.login img{width:96px;height:96px;margin:0 auto}
.login input{padding:11px 12px;border:1px solid var(--line);border-radius:10px;text-align:center}
label.f{display:flex;flex-direction:column;gap:6px;font-size:13px;color:var(--muted);text-align:left}
label.f input{padding:10px;border:1px solid var(--line);border-radius:10px}
.drop{border:2px dashed var(--line);border-radius:var(--r);padding:28px;text-align:center;background:var(--soft)}

@media (max-width:860px){
  .shell{flex-direction:column}
  .side{width:auto;height:auto;position:static;flex-direction:row;align-items:center;gap:10px;padding:10px;overflow-x:auto;border-right:0;border-bottom:1px solid var(--line)}
  .brand{border-bottom:0;padding:0 4px}
  .nav a{border-left:0}
  .brand small,.nav .sep,.who span{display:none}
  .brand b{font-size:15px;white-space:nowrap}
  .brand img{width:36px;height:36px}
  .nav{flex-direction:row}
  .nav a{white-space:nowrap;min-height:36px;padding:0 12px;font-size:14px}
  .who{margin:0;flex-direction:row;align-items:center;padding:6px 10px;white-space:nowrap}
  .main{padding:16px 12px 50px}
  h1{font-size:21px}
  .kpi b{font-size:20px}
}
.phead{display:none}
.tw.ledger{max-height:520px;overflow-y:auto}
tr.autorow td{background:#FFF8EA}
.pay td.pname{font-size:12.5px;font-weight:600;white-space:nowrap}
.pay td,.pay th{padding-top:7px;padding-bottom:7px}
.pvbar .filters{gap:8px}
.pvbar select{min-height:40px}
input[type=checkbox]{width:18px;height:18px;accent-color:var(--red);cursor:pointer}
#printbox{display:none}

/* payment voucher: two per A4 page, like the printed cash voucher */
.pvpage{height:268mm;overflow:hidden;display:flex;flex-direction:column;justify-content:space-between;break-after:page;page-break-after:always}
.pvpage:last-child{break-after:auto;page-break-after:auto}
.cut{border-top:1px dashed #999;margin:0 -4mm}
.pv{height:131mm;box-sizing:border-box;padding:2mm 8mm;font-family:Calibri,"Segoe UI",Arial,sans-serif;color:#000;direction:ltr;text-align:left;font-size:11.5pt;display:flex;flex-direction:column}
.pvh{display:flex;justify-content:space-between;align-items:flex-start}
.pvh b{font-size:13pt}
.pvh img{width:20mm;height:auto}
.pvt{text-align:center;font-weight:700;font-size:14pt;margin:-6mm 0 3mm}
.pvm{display:flex;justify-content:space-between;margin-bottom:1.5mm}
.dots{display:inline-block;width:38mm;border-bottom:1px dotted #000}
.pvtab{width:100%;border-collapse:collapse;margin-top:2mm}
.pvtab th,.pvtab td{border:1px solid #000;padding:1.1mm 3mm;font-size:11pt;text-align:left;background:#fff!important;color:#000;position:static}
.pvtab th{text-align:center;font-weight:700}
.pvtab td:last-child,.pvtab th:last-child{width:34mm;text-align:right;font-variant-numeric:tabular-nums}
.pvtab tbody td{border-top:0;border-bottom:0;height:5mm}
.pvtab tbody tr:last-child td{border-bottom:1px solid #000;padding-bottom:3mm}
.pvtab tfoot td{font-weight:700;border:0}
.pvtab tfoot td:last-child{border:1px solid #000}
.pvtab tfoot td:first-child{text-align:right}
.pvtab .rem{font-size:10.5pt;font-style:italic}
.pvw{margin-top:2mm;font-size:11pt;font-style:italic;border-bottom:1px solid #000;padding-bottom:1mm}
.pvs{display:flex;justify-content:space-between;margin-top:auto;padding:0 6mm 2mm;font-weight:700}
.pvs div{display:flex;flex-direction:column;gap:11mm;width:55mm}
.pvs i{display:block;border-bottom:1px solid #000}

@media print{
  .side,.filters,.tabs,.noprint{display:none!important}
  .main{padding:0}
  body{background:#fff;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .card{border:0;padding:0;box-shadow:none;break-inside:auto}
  th{position:static}
  .tw,.tw.ledger{max-height:none!important;overflow:visible!important}
  .phead{display:flex;align-items:center;gap:10px;border-bottom:2px solid var(--red);padding-bottom:8px;margin-bottom:6px}
  .phead img{width:44px;height:44px}
  .phead b{display:block;font-size:16px}
  .phead small{color:var(--muted)}
  .kpi{break-inside:avoid}
  tr{break-inside:avoid}
  body.landscape .matrix td,body.landscape .matrix th{padding:4px 5px;font-size:10.5px}
  body.landscape .matrix td:first-child{min-width:120px}
  body.printing .shell{display:none!important}
  body.printing #printbox{display:block}
}

.num.over{color:#fff;background:var(--red);padding:2px 7px;border-radius:6px;font-weight:700}
label.tgt{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--muted)}
label.tgt input{width:70px;min-height:36px}
.btn.sm{padding:5px 10px;min-height:0;font-size:12.5px}
.pay td.pname a{color:inherit;text-decoration:none}
.pay td.pname a:hover{color:var(--red);text-decoration:underline}
.slip .sh{display:flex;gap:10px;align-items:center;border-bottom:2px solid #000;padding-bottom:2mm}
.slip .sh img{width:16mm}
.slip .sh b{display:block;font-size:13pt}
.slip .sh small{display:block;font-size:9.5pt}
.slip .pvt{margin:3mm 0 3mm}
.sltab{width:100%;border-collapse:collapse;margin:1mm 0}
.sltab td{padding:0.9mm 2mm;font-size:11pt;border:0;background:#fff!important;color:#000}
.sltab td:first-child{width:55%}
.sltab td:nth-child(2){width:4%}
.sltab td:last-child{text-align:right;font-variant-numeric:tabular-nums;width:41%}
.sltab tr.b td{font-weight:700;border-top:1px solid #000}
.sltab tr.big td{font-size:12.5pt}

details summary{cursor:pointer;padding:4px 0}
details[open] summary{margin-bottom:10px}

/* key ratios */
.ratios .head{align-items:flex-start}
.ratios .legend{display:flex;gap:14px;font-size:12.5px;color:var(--muted)}
.ratios .legend span{display:flex;align-items:center;gap:6px}
i.lg{width:12px;height:12px;border-radius:4px;display:inline-block}
i.lg.xok,.hm.xok{background:#E3F4EA}
i.lg.xnear,.hm.xnear{background:#FFF1D6}
i.lg.xbad,.hm.xbad{background:#FBE0DE}
.rtiles{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin:6px 0 18px}
.rt{border:1px solid var(--line);border-radius:14px;padding:16px 18px;background:#fff;position:relative;overflow:hidden}
.rt:before{content:"";position:absolute;inset:0 0 auto 0;height:4px;background:#2E9E5B}
.rt.xnear:before{background:#E8A317}
.rt.xbad:before{background:var(--red)}
.rt-top{display:flex;justify-content:space-between;align-items:center;font-size:13px;color:var(--muted);font-weight:600}
.rt-top em{font-style:normal;font-size:11.5px;padding:3px 9px;border-radius:99px;background:#E3F4EA;color:#1F7A45}
.rt.xnear .rt-top em{background:#FFF1D6;color:#9A6400}
.rt.xbad .rt-top em{background:#FBE0DE;color:var(--red)}
.rt>b{display:block;font-size:34px;letter-spacing:-.5px;margin:8px 0 0;font-variant-numeric:tabular-nums}
.rt>b small{font-size:18px;color:var(--muted);margin-left:2px}
.rt-sub{font-size:12.5px;color:var(--muted)}
.rt-bar{position:relative;height:8px;border-radius:99px;background:#F0ECE6;margin:14px 0 12px}
.rt-bar i{position:absolute;inset:0 auto 0 0;border-radius:99px;background:#2E9E5B}
.rt.xnear .rt-bar i{background:#E8A317}
.rt.xbad .rt-bar i{background:var(--red)}
.rt-bar u{position:absolute;top:-4px;bottom:-4px;width:2px;background:#2B2622;border-radius:2px}
.rt-foot{display:flex;justify-content:space-between;gap:8px;font-size:11.5px;color:var(--muted);flex-wrap:wrap}
.rt-foot b{color:var(--text);font-weight:600}
table.heat{border-collapse:separate;border-spacing:4px}
table.heat th{font-size:12px;text-align:center;border:0;padding:4px}
table.heat td{border:0;text-align:center;padding:9px 6px;border-radius:8px;font-variant-numeric:tabular-nums;font-size:13px;min-width:46px}
table.heat td.lbl{text-align:left;font-weight:600;white-space:nowrap;padding-left:0;min-width:150px}
table.heat td.lbl small{display:block;font-weight:400;color:var(--muted);font-size:11px}
table.heat td.hm.xbad{color:var(--red);font-weight:700}
table.heat .ytd{font-weight:800;box-shadow:inset 0 0 0 2px rgba(0,0,0,.08)}
table.heat th.ytd{box-shadow:none}
@media (max-width:900px){.rtiles{grid-template-columns:1fr}}
.ratios .legend i.lg{width:12px;height:12px;border-radius:4px;margin:0}
.rt.xok>b{color:#1F7A45}.rt.xnear>b{color:#9A6400}.rt.xbad>b{color:var(--red)}

/* partners' accounts */
.accs .head{align-items:baseline}
.pcs{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.pc{border:1px solid var(--line);border-radius:14px;padding:18px 20px;background:#fff}
.pc-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;padding-bottom:14px;margin-bottom:6px;border-bottom:1px solid var(--line)}
.pc-head h3{margin:0 0 3px;font-size:17px}
.pc-head .muted{font-size:12.5px}
.pc-head>b{font-size:30px;letter-spacing:-.5px;color:#1F7A45}
.pc-steps{width:100%;border-collapse:collapse}
.pc-steps td{border:0;padding:7px 0;font-size:14px}
.pc-steps td.n{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap;padding-left:12px}
.pc-steps td.neg{color:var(--red)}
.pc-steps tr.tot td{font-weight:700;border-top:1.5px solid #2B2622;padding-top:9px}
.pc-steps tr.sub td{font-weight:600;border-top:1px solid var(--line)}
.pc-steps.small td{font-size:13px;padding:5px 0;color:var(--muted)}
.pc-steps.small tr.sub td{color:var(--text)}
.pc details{margin-top:10px;border-top:1px dashed var(--line);padding-top:8px}
.pc details summary{font-size:13px;color:var(--muted)}
.pc-note{font-size:12.5px;margin:8px 0 0}
.pc-pay{margin-top:10px;background:#FAF8F5;border-radius:10px;padding:6px 12px}
.pc-pay div{display:flex;gap:12px;align-items:center;padding:6px 0;font-size:13px}
.pc-pay div span.en{flex:1;color:var(--muted)}
.pc-est{display:flex;flex-wrap:wrap;gap:6px 14px;align-items:baseline;margin-top:16px;padding:12px 16px;border-radius:12px;background:#FAF8F5;font-size:13px}
.pc-est b{font-size:16px}
@media (max-width:900px){.pcs{grid-template-columns:1fr}}
