/* Treasury integrated UI — local SVG icons and print styles, no external assets. */
.treasury-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:12px 0 18px}
.treasury-metric{background:linear-gradient(140deg,var(--card,#0d1b2b),var(--card2,#0a1726));border:1px solid var(--line,#20364b);padding:17px 19px;border-radius:15px;min-width:0}
.treasury-metric span{display:block;font-size:12px;color:var(--muted,#98aabe);margin-bottom:12px}.treasury-metric strong{font-size:21px;color:var(--text,#ebf2f7);line-height:1.4;overflow-wrap:anywhere}
.treasury-filters{display:flex;align-items:center;gap:12px;margin-bottom:16px;flex-wrap:wrap}.treasury-filters>.input{flex:1;min-width:220px}.treasury-filters .select{width:auto;min-width:180px}
.treasury-table{width:100%;border-collapse:collapse}.treasury-table th{white-space:nowrap}.treasury-table td{vertical-align:middle}.treasury-table td small{display:block;color:var(--muted,#95a7bb);margin-top:4px}.treasury-table .treasury-actions{white-space:nowrap}.treasury-table .treasury-actions .btn{margin:2px}
.treasury-table .ui-icon,.treasury-form-icon .ui-icon{width:16px;height:16px;vertical-align:middle}.treasury-tag{display:inline-flex;padding:3px 9px;background:rgba(57,116,251,.10);border:1px solid rgba(57,116,251,.35);color:var(--text,#dfeafa);border-radius:50px;font-size:11px;margin:2px}.treasury-tag.teal{background:rgba(10,193,162,.12);border-color:rgba(10,193,162,.32)}
.treasury-empty{padding:40px!important;text-align:center;color:var(--muted,#8da2b6)}.treasury-muted{padding:12px;color:var(--muted,#8fa3b5);font-size:12px}
.treasury-editor-card{max-width:1250px;margin:0 auto}.treasury-form-title{display:flex;align-items:center;gap:14px;padding-bottom:22px;margin-bottom:24px;border-bottom:1px solid var(--line,#29394a)}.treasury-form-title h3{margin:0 0 4px;font-size:19px}.treasury-form-title p{margin:0;color:var(--muted,#9eafc0);font-size:12px}.treasury-form-icon{display:grid;place-items:center;width:44px;height:44px;border-radius:13px;background:rgba(4,194,169,.12);color:#18c5a2}.treasury-form-icon svg{width:23px;height:23px}.treasury-chip{margin-right:auto;direction:ltr;background:rgba(75,112,168,.12);border:1px solid var(--line,#31445a);padding:7px 12px;border-radius:10px;font-size:12px;white-space:nowrap}
.treasury-form{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px}.treasury-form .span-2{grid-column:span 2}.treasury-form .span-4{grid-column:span 4}.treasury-form .field{min-width:0}.treasury-form .field label{display:block;margin-bottom:8px;font-size:12px}.treasury-party-picker{position:relative}.treasury-party-row{display:flex;gap:8px}.treasury-party-row input{min-width:0;flex:1}.treasury-party-row button{white-space:nowrap}.treasury-party-results{position:absolute;top:calc(100% - 4px);right:0;left:0;z-index:45;background:var(--card,#0e1a2a);border:1px solid var(--line,#33455b);border-radius:12px;box-shadow:0 15px 30px rgba(0,0,0,.28);max-height:220px;overflow-y:auto}.treasury-party-results[hidden]{display:none!important}.treasury-result{display:flex;justify-content:space-between;align-items:center;gap:8px;width:100%;border:0;border-bottom:1px solid var(--line,#283e52);padding:11px 14px;background:transparent;color:var(--text,#f3f7fa);cursor:pointer;text-align:right}.treasury-result:hover{background:rgba(74,133,220,.11)}.treasury-result small{opacity:.65}.treasury-help{display:block;margin-top:7px;font-size:11px;color:var(--muted,#859aab)}
.treasury-methods{display:flex;gap:8px;flex-wrap:wrap}.treasury-method{display:flex!important;align-items:center;gap:7px;border:1px solid var(--line,#35506b);padding:11px 14px;border-radius:10px;cursor:pointer;font-size:12px}.treasury-method:has(input:checked){border-color:#18b6a3;background:rgba(24,182,163,.1)}.treasury-method input{accent-color:#13b8a6}.treasury-inline-btn{border:none;background:transparent;color:#18b6a3;font-size:11px;text-align:right;cursor:pointer;margin-top:7px}.treasury-form-footer{display:flex;justify-content:space-between;gap:16px;align-items:center;padding-top:22px;margin-top:8px;border-top:1px solid var(--line,#35485a)}.treasury-form-footer span{font-size:12px;color:var(--muted,#9db0c0)}
.treasury-role-choices{display:flex;align-items:center;gap:12px}.treasury-role-choices label{display:flex;align-items:center;gap:6px;border:1px solid var(--line,#34506a);border-radius:10px;padding:12px 18px;cursor:pointer}.treasury-bank-head{display:flex;align-items:center;justify-content:space-between;padding-top:14px;margin-top:8px;border-top:1px solid var(--line,#33465c)}.treasury-bank-row{display:grid;grid-template-columns:.7fr .9fr 1fr 1.35fr 1fr 40px;gap:7px;margin:8px 0}.treasury-bank-row .input{min-width:0}.treasury-person-form{gap:13px}.treasury-person-form .span-4{grid-column:span 4}.treasury-person-form .span-2{grid-column:span 2}.modal:has(.treasury-person-form){width:min(1150px,95vw);max-height:88vh}.modal:has(.treasury-person-form) .modal-body{max-height:68vh;overflow:auto}
.treasury-preview-toolbar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;padding:12px 16px;margin:12px 0 18px;background:var(--card,#0b1b2b);border:1px solid var(--line,#304156);border-radius:12px}.treasury-preview-toolbar span{font-size:12px;color:var(--muted,#95a7b8)}.treasury-preview-toolbar label{display:flex;align-items:center;gap:12px;white-space:nowrap;font-size:12px}.treasury-preview-toolbar select{max-width:175px}
.treasury-paper{--tp-ink:#17202b;--tp-faint:#56616a;color:var(--tp-ink);direction:rtl;background:white!important;max-width:1020px;margin:0 auto 35px;padding:42px 48px 30px;min-height:640px;border-radius:8px;box-shadow:0 18px 40px rgba(0,0,0,.16);font-family:Tahoma,"Vazirmatn",Arial,sans-serif;font-size:12px;box-sizing:border-box;line-height:1.8}
.treasury-paper *{box-sizing:border-box;color:var(--tp-ink)}.tp-header{display:grid;grid-template-columns:1fr 1.3fr 1fr;gap:20px;align-items:center}.tp-brand strong{font-size:15px;display:block}.tp-brand span{font-size:11px;color:var(--tp-faint);display:block;margin-top:4px}.tp-heading{text-align:center}.tp-heading>span{font-size:11px;color:var(--tp-faint)}.tp-heading h1{font-size:25px;letter-spacing:-.4px;margin:0}.tp-meta{display:grid;gap:4px;text-align:left;font-size:11px}.tp-meta b{font-size:12px}.latin{font-family:Arial,sans-serif;direction:ltr;unicode-bidi:plaintext}.tp-rule{border-top:2px solid #1b2630;margin:25px 0}.tp-intro{font-size:12px;margin:0 0 22px}.tp-primary{display:grid;grid-template-columns:1fr 1fr;gap:22px;padding:20px 0;border-top:1px solid #b8c0c5;border-bottom:1px solid #b8c0c5}.tp-primary div{display:grid;gap:8px}.tp-primary small{font-size:11px;color:var(--tp-faint)}.tp-primary strong{font-size:19px}.tp-primary .tp-big{font-size:23px}.tp-section{padding:17px 0 10px;border-bottom:1px solid #d6dce1}.tp-section h3{margin:0 0 14px;font-size:13px}.tp-data{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px 23px}.tp-data>div{display:grid;gap:3px;min-width:0}.tp-data .tp-wide{grid-column:span 3}.tp-data small{font-size:10px;color:var(--tp-faint)}.tp-data b{font-size:12px;overflow-wrap:anywhere}.tp-notes{margin:0;white-space:pre-wrap}.tp-sign{display:grid;grid-template-columns:repeat(3,1fr);gap:25px;margin-top:42px;min-height:120px}.tp-sign>div{border-top:1px solid #66717c;text-align:center;padding-top:12px;display:flex;flex-direction:column;gap:7px}.tp-sign span{font-size:11px}.tp-sign strong{font-size:13px}.tp-sign em{font-style:normal;margin-top:auto;font-size:10px;color:#65727b}.tp-footer{display:flex;justify-content:space-between;gap:10px;border-top:1px solid #b5b9c0;padding-top:12px;font-size:10px;margin-top:22px}.treasury-report-rows{display:grid;gap:16px;margin-top:16px}.treasury-report-rows>div{display:grid;grid-template-columns:145px minmax(40px,1fr) 250px;align-items:center;gap:16px}.treasury-report-track{height:10px;border-radius:10px;background:var(--line,#2b3848);overflow:hidden}.treasury-report-track>span{display:block;height:100%;border-radius:10px;background:linear-gradient(90deg,#10b99f,#4e87fa)}.treasury-report-rows>div>span{text-align:left;font-size:12px}
@media(max-width:900px){.treasury-metrics{grid-template-columns:1fr 1fr}.treasury-form{grid-template-columns:repeat(2,1fr)}.treasury-form .span-4{grid-column:span 2}.treasury-bank-row{grid-template-columns:1fr 1fr}.treasury-bank-row .input:nth-child(n+3){grid-column:span 1}.treasury-paper{padding:24px 20px}.treasury-report-rows>div{grid-template-columns:1fr}}
@media screen and (max-width:520px){.treasury-metrics{grid-template-columns:1fr}.treasury-form{grid-template-columns:1fr}.treasury-form .span-2,.treasury-form .span-4{grid-column:span 1}.treasury-form-footer{flex-direction:column;align-items:stretch}.treasury-party-row{flex-direction:column}.treasury-chip{display:none}.tp-header{grid-template-columns:1fr 1fr}.tp-heading{grid-column:span 2;grid-row:1}.tp-meta{text-align:right}.tp-data{grid-template-columns:1fr 1fr}.tp-data .tp-wide{grid-column:span 2}.tp-primary{grid-template-columns:1fr}.treasury-paper{font-size:10px}.tp-sign{gap:8px}}
@media print{body{background:white!important}.treasury-paper{border:none!important;border-radius:0!important;box-shadow:none!important}}

/* V1.13.37 Beta6: compact list/date filters + consistent accessible icons */
.treasury-orders-card{padding:20px!important}
.treasury-order-filters{margin-bottom:10px!important;align-items:end!important;gap:10px!important}
.treasury-search{position:relative;display:flex;align-items:center;flex:2;min-width:210px}
.treasury-search>.ui-icon,.treasury-search>span{position:absolute;right:13px;pointer-events:none;color:var(--muted,#7a8da1);display:flex;align-items:center}
.treasury-search>.input{padding-right:42px!important;width:100%}
.treasury-date-filter{display:flex;flex-direction:column;gap:5px;min-width:144px;flex:1;font-size:12px;color:var(--muted,#8295aa)}
.treasury-date-filter>span{display:flex;align-items:center;gap:5px}.treasury-date-filter .ui-icon{width:15px;height:15px}
.treasury-date-filter>.input{width:100%;min-height:41px}
.treasury-filter-meta{display:flex;justify-content:space-between;gap:10px;margin:0 0 12px;font-size:12px;color:var(--muted,#8696aa)}
.treasury-date-warning{color:#d97735}.treasury-date-warning[hidden]{display:none}
.treasury-delete{color:var(--danger,#bf5656)!important}
.treasury-actions>.btn{display:inline-flex;align-items:center;gap:5px}
@media(max-width:700px){.treasury-search{flex-basis:100%}.treasury-date-filter{min-width:125px}.treasury-filter-clear{flex:1}}
/* Beta7: bank entry inside payment and refined line icons. */
.treasury-form .field>label:has(.ui-icon),.treasury-preview-toolbar label,.treasury-bank-inline-title,.treasury-bank-inline-note{display:flex;align-items:center;gap:7px}
.treasury-form .field>label .ui-icon{width:17px;height:17px;color:#1ab9a2}
.treasury-bank-selection .treasury-help{line-height:1.8}
.treasury-bank-inline{padding:18px;border:1px solid var(--line,#335067);border-radius:15px;background:linear-gradient(130deg,rgba(17,184,154,.065),rgba(16,73,122,.045));min-width:0}
.treasury-bank-inline[hidden]{display:none!important}
.treasury-bank-inline-title{margin-bottom:16px;align-items:flex-start}
.treasury-bank-inline-title>svg{width:21px;height:21px;color:#14b8a6;margin-top:2px;flex:none}
.treasury-bank-inline-title strong{display:block;font-size:13px}.treasury-bank-inline-title small{display:block;margin-top:5px;color:var(--muted,#97a9bb);font-size:11px;line-height:1.7}
.treasury-bank-inline-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.treasury-bank-inline-grid .field{min-width:0}.treasury-bank-inline-grid .input{text-align:left;direction:ltr}
.treasury-bank-inline-grid .field:first-child .input,.treasury-bank-inline-grid .field:nth-child(2) .input{direction:rtl;text-align:right}
.treasury-bank-inline-note{margin-top:15px;font-size:11px;color:var(--muted,#97aabb)}.treasury-bank-inline-note svg{width:16px;height:16px;color:#13bdad;flex:none}
.treasury-form-footer .btn,.treasury-actions .btn,.treasury-preview-toolbar .btn,.treasury-orders-card .btn{display:inline-flex;align-items:center;justify-content:center;gap:7px}.treasury-form-footer .btn svg,.treasury-preview-toolbar svg,.treasury-orders-card .btn svg{height:17px;width:17px;flex:none}
/* Actual A5 preview dimensions. Paper graphics are deliberately subtle for economical printing. */
.treasury-paper{--tp-ink:#203242;--tp-muted:#71808b;--tp-border:#d9e0e5;--tp-accent:#176b68;position:relative;width:min(100%,148mm);max-width:148mm;min-height:210mm;margin:0 auto 32px;padding:11mm 9mm 9mm;box-shadow:0 18px 40px rgba(0,0,0,.15);border-radius:3px;background:#fff!important;font:11px/1.55 Tahoma,Arial,sans-serif;color:var(--tp-ink);box-sizing:border-box}
.treasury-paper.is-landscape{width:min(100%,210mm);max-width:210mm;min-height:148mm;padding:9mm 9mm 7mm}
.treasury-paper *{box-sizing:border-box;color:var(--tp-ink)}
.treasury-paper .tp-header{display:grid;grid-template-columns:1.45fr 1.15fr 1fr;gap:10px;align-items:center}
.treasury-paper .tp-brand{display:flex;align-items:center;gap:8px}
.treasury-paper .tp-monogram{width:32px;height:32px;flex:none;border:1.4px solid var(--tp-accent);color:var(--tp-accent);display:grid;place-items:center;border-radius:8px;font-weight:800;font-size:17px}
.treasury-paper .tp-brand strong{display:block;font-size:11px;line-height:1.6;font-weight:700}.treasury-paper .tp-brand small{display:block;font-size:8px;color:var(--tp-muted)}
.treasury-paper .tp-heading{text-align:center}.treasury-paper .tp-heading small{font:7px/1.4 Arial,sans-serif;color:var(--tp-muted);letter-spacing:2px}.treasury-paper .tp-heading h1{font-size:18px;letter-spacing:0;font-weight:800;margin:2px 0}
.treasury-paper .tp-meta{display:grid;gap:6px;text-align:left;font-size:9px}.treasury-paper .tp-meta span{display:flex;justify-content:space-between;gap:5px;border-bottom:1px dotted var(--tp-border);padding-bottom:2px}.treasury-paper .tp-meta b{font-size:10px;font-weight:700}
.treasury-paper .tp-accent-rule{height:2px;background:linear-gradient(90deg,#b3d6d0,var(--tp-accent));margin:12px 0 10px;border-radius:5px}.treasury-paper .tp-intro{font-size:10px;color:#50616b;margin:0 0 10px}
.treasury-paper .tp-primary{display:grid;grid-template-columns:1.2fr 1fr;gap:14px;align-items:center;padding:13px 14px;border:1px solid #d7e4e4;border-radius:9px;background:#f6faf9}
.treasury-paper .tp-primary>div{display:flex;flex-direction:column;gap:5px}.treasury-paper .tp-primary small{font-size:9px;color:#59767c}.treasury-paper .tp-primary strong{font-size:13px;font-weight:800}.treasury-paper .tp-amount strong{font-size:20px;color:#145953}
.treasury-paper .tp-section{padding:10px 0 8px;border-bottom:1px solid var(--tp-border)}.treasury-paper .tp-section h3{display:flex;gap:7px;align-items:center;margin:0 0 9px;font-weight:800;font-size:10px}.treasury-paper .tp-section h3 span{font:700 8px Arial,sans-serif;color:var(--tp-accent);background:#ecf5f3;border-radius:4px;padding:4px 6px}
.treasury-paper .tp-data{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px 15px}.treasury-paper .tp-detail{min-width:0;display:flex;flex-direction:column;gap:3px}.treasury-paper .tp-detail span{font-size:9px;color:var(--tp-muted)}.treasury-paper .tp-detail strong{font-size:10px;font-weight:650;overflow-wrap:anywhere;word-break:break-word}
.treasury-paper .tp-notes p{margin:0;font-size:10px;white-space:pre-wrap;overflow-wrap:anywhere}
.treasury-paper .tp-sign{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-top:21px;min-height:115px}.treasury-paper .tp-sign>div{display:flex;flex-direction:column;align-items:center;text-align:center;border-top:1px solid #a3b0b9;padding-top:9px;gap:7px}.treasury-paper .tp-sign span{font-size:9px;color:var(--tp-muted)}.treasury-paper .tp-sign strong{font-size:10px}.treasury-paper .tp-sign small{font-size:8px;color:var(--tp-muted);margin-top:auto}
.treasury-paper .tp-footer{display:flex;justify-content:space-between;gap:8px;border-top:1px solid var(--tp-border);padding-top:8px;margin-top:12px;font-size:8px;color:var(--tp-muted)}.treasury-paper .tp-footer span,.treasury-paper .tp-footer b{color:#637581}
.treasury-paper.is-landscape .tp-section{padding:7px 0 5px}.treasury-paper.is-landscape .tp-section h3{margin-bottom:5px}.treasury-paper.is-landscape .tp-data{gap:5px 12px}.treasury-paper.is-landscape .tp-sign{margin-top:10px;min-height:46px;gap:10px}.treasury-paper.is-landscape .tp-primary{padding:9px 12px}.treasury-paper.is-landscape .tp-intro{margin-bottom:7px}.treasury-paper.is-landscape .tp-footer{margin-top:7px}
@media screen and (max-width:760px){.treasury-bank-inline-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.treasury-paper{padding:20px 16px}.treasury-paper .tp-header{grid-template-columns:1fr 1fr}.treasury-paper .tp-heading{grid-column:span 2;grid-row:1}.treasury-paper .tp-data{grid-template-columns:repeat(2,minmax(0,1fr))}.treasury-paper .tp-primary{grid-template-columns:1fr 1fr}}
@media screen and (max-width:520px){.treasury-bank-inline-grid{grid-template-columns:1fr}.treasury-paper .tp-primary{grid-template-columns:1fr}.treasury-paper .tp-sign{gap:6px}.treasury-paper .tp-footer{flex-wrap:wrap}}

/* V1.13.37 production icon polish: use the same line-icon language as payment orders. */
.treasury-orders-card .btn,.treasury-editor-card .btn,.treasury-preview-toolbar .btn,.treasury-table .btn { display:inline-flex;align-items:center;justify-content:center;gap:7px;transition:background-color .16s ease,border-color .16s ease,color .16s ease; }
.treasury-orders-card .ui-icon,.treasury-editor-card .btn .ui-icon,.treasury-preview-toolbar .ui-icon,.treasury-table .ui-icon { width:17px;height:17px;stroke-width:1.7;flex:none; }
.treasury-editor-card .field>label:has(> .ui-icon){display:flex;align-items:center;gap:7px;}
.treasury-editor-card .field>label>.ui-icon{width:16px;height:16px;color:var(--accent,#17b9a5);}
.modal:has(.treasury-person-form) .modal-foot .btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;}
.modal:has(.treasury-person-form) .modal-foot .ui-icon{width:17px;height:17px;}
.treasury-bank-row .btn{min-height:36px;min-width:36px;padding:7px!important;}
.treasury-bank-row .btn .ui-icon{width:17px;height:17px;}
.treasury-actions .btn:focus-visible,.treasury-orders-card .btn:focus-visible,.treasury-editor-card .btn:focus-visible{outline:2px solid var(--accent,#17b9a5);outline-offset:2px;}
@media print{.treasury-paper{print-color-adjust:exact;-webkit-print-color-adjust:exact;}}

/* v1.13.39: inline (not modal) bank-number detection and company account selector */
.treasury-inline-number{display:grid;grid-column:1/-1;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;padding:12px 14px;border:1px solid var(--line,#314657);border-radius:12px;background:rgba(94,174,163,.055);align-items:end}
.treasury-inline-number[hidden]{display:none!important}
.treasury-inline-number .field{min-width:0}
.treasury-inline-number .input.ltr{text-align:left;direction:ltr}
.treasury-input-error{color:#e07a60!important}
.treasury-source-picker{display:flex;align-items:center;gap:8px}
.treasury-source-picker>.select{flex:1;min-width:120px}
.treasury-source-add{white-space:nowrap;display:inline-flex;align-items:center;gap:5px}
.treasury-source-add svg{height:16px;width:16px}
.treasury-company-entry>.btn{min-height:40px}
.treasury-nav-title>.ui-icon{display:none}
@media(max-width:950px){.treasury-inline-number{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:620px){.treasury-inline-number{grid-template-columns:1fr}.treasury-source-picker{flex-wrap:wrap}}

/* V1.13.49: treasury has a sidebar heading icon like other main groups.
   Do not re-enable icons in the treasury page heading (requested to stay clean). */
#sidebar .treasury-nav-group > .treasury-nav-title > .group-title-icon{display:grid!important;}
#sidebar .treasury-nav-group > .treasury-nav-title > .group-title-icon svg{width:16px;height:16px;stroke-width:1.8;}
body:has(.treasury-orders-card) .page-head h2.modern-page-title > .ui-icon,
body:has(.treasury-editor-card) .page-head h2.modern-page-title > .ui-icon,
body:has(.treasury-preview-toolbar) .page-head h2.modern-page-title > .ui-icon,
body:has(.treasury-metrics) .page-head h2.modern-page-title > .ui-icon {display:none!important}
.treasury-add-party-icon{min-width:40px;width:40px;padding:9px!important;display:inline-flex;justify-content:center;align-items:center}
.treasury-add-party-icon .ui-icon{width:19px;height:19px}
#treasuryNewBankFields[hidden]{display:grid!important}

/* v1.13.42: a single optional beneficiary bank field; no secondary edit panel */
.treasury-account-combo{display:flex;align-items:stretch;gap:8px;min-width:0}
.treasury-account-combo>.input{flex:1;min-width:0}
.treasury-account-combo>.treasury-bank-add{flex:0 0 41px;width:41px;display:grid;place-items:center;padding:0!important;border-radius:10px}
.treasury-account-combo>.treasury-bank-add .ui-icon{width:18px;height:18px}
.treasury-account-combo>.treasury-bank-add:disabled{opacity:.45;cursor:not-allowed}

/* v1.13.44 - minimally styled source-account actions, scoped to treasury editor */
.treasury-editor-card .treasury-source-icon{display:inline-flex;align-items:center;justify-content:center;width:38px;min-width:38px;height:38px;padding:7px!important}
.treasury-editor-card .treasury-source-icon svg{width:16px;height:16px}
.treasury-editor-card .treasury-source-remove{color:var(--danger,#e99090)}
.treasury-editor-card .treasury-source-entry-heading{grid-column:1/-1;font-weight:700;font-size:13px}
.treasury-editor-card .treasury-source-entry-actions{grid-column:1/-1;display:flex;align-items:center;flex-wrap:wrap;gap:8px}
.treasury-editor-card .treasury-source-entry-actions button{min-height:38px}


/* v1.13.45: align company-account inputs and actions on a single grid row. */
.treasury-editor-card .treasury-company-entry {
  grid-template-columns: minmax(0,1.15fr) minmax(0,1fr) minmax(0,1fr) minmax(240px,.95fr);
  gap: 12px;
  align-items: end;
  padding: 16px;
}
.treasury-editor-card .treasury-company-entry .treasury-source-entry-heading {grid-column:1 / -1;margin:0 0 2px;}
.treasury-editor-card .treasury-company-entry > .field {min-width:0;align-self:end;}
.treasury-editor-card .treasury-company-entry > .field > label {min-height:18px;margin-bottom:8px;}
.treasury-editor-card .treasury-company-entry > .field > .input {height:41px;width:100%;box-sizing:border-box;}
.treasury-editor-card .treasury-company-entry > .field > small {min-height:0;}
.treasury-editor-card .treasury-company-entry .treasury-source-entry-actions {
  grid-column:auto;
  display:flex;
  flex-wrap:nowrap;
  gap:7px;
  align-self:end;
  align-items:stretch;
  margin:0 0 0;
  min-width:0;
}
.treasury-editor-card .treasury-company-entry .treasury-source-entry-actions .btn{height:41px;min-height:41px;min-width:0;padding:6px 9px!important;white-space:nowrap;font-size:11px;}
@media(max-width:1060px){
  .treasury-editor-card .treasury-company-entry{grid-template-columns:repeat(2,minmax(0,1fr));}
  .treasury-editor-card .treasury-company-entry .treasury-source-entry-actions{grid-column:span 2;justify-content:flex-start;}
}
@media(max-width:600px){
  .treasury-editor-card .treasury-company-entry{grid-template-columns:minmax(0,1fr);}
  .treasury-editor-card .treasury-company-entry .treasury-source-entry-actions{grid-column:1;flex-wrap:wrap;}
}
/* Keep the classification hint out of the input baseline so all three inputs align. */
.treasury-editor-card .treasury-company-entry{row-gap:22px;padding-bottom:30px;}
.treasury-editor-card .treasury-company-entry > .field{position:relative;}
.treasury-editor-card .treasury-company-entry > .field > small{position:absolute;top:calc(100% + 3px);right:0;left:0;margin:0;font-size:10px;line-height:1.35;}


/* A5 preview spacing: the same rules are honored in print. */
.treasury-paper{padding:10mm 9mm 7mm}
.treasury-paper.is-landscape{padding:6mm 7mm 5mm}
.treasury-paper.is-landscape .tp-accent-rule{margin:7px 0 6px}
.treasury-paper.is-landscape .tp-intro{margin:0 0 5px;font-size:9px}
.treasury-paper.is-landscape .tp-primary{padding:6px 10px;gap:9px}
.treasury-paper.is-landscape .tp-primary strong{font-size:12px}
.treasury-paper.is-landscape .tp-amount strong{font-size:17px}
.treasury-paper.is-landscape .tp-section{padding:4px 0 3px}
.treasury-paper.is-landscape .tp-section h3{margin:0 0 3px;font-size:9px}
.treasury-paper.is-landscape .tp-data{gap:3px 10px}
.treasury-paper.is-landscape .tp-sign{margin-top:6px;min-height:72px;gap:10px}
.treasury-paper.is-landscape .tp-sign>div{padding-top:5px;gap:2px}
.treasury-paper.is-landscape .tp-footer{margin-top:5px;padding-top:5px}
.treasury-paper.is-landscape .tp-notes p{font-size:9px}

/* v1.13.52: A5 print = screen preview; no alternate font/grid/padding reductions. */
@media print {
  html,body{margin:0!important;padding:0!important;background:#fff!important;overflow:visible!important;-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important;}
  .treasury-paper{
    display:block!important;width:148mm!important;max-width:148mm!important;min-width:148mm!important;
    min-height:205mm!important;height:auto!important;
    margin:0!important;padding:10mm 9mm 7mm!important;
    border:0!important;border-radius:0!important;box-shadow:none!important;
    zoom:1!important;transform:none!important;overflow:visible!important;
    -webkit-print-color-adjust:exact!important;print-color-adjust:exact!important;
  }
  .treasury-paper.is-landscape{width:210mm!important;max-width:210mm!important;min-width:210mm!important;min-height:143mm!important;padding:6mm 7mm 5mm!important;}
  .treasury-paper .tp-header{grid-template-columns:1.45fr 1.15fr 1fr!important;}
  .treasury-paper .tp-primary{grid-template-columns:1.2fr 1fr!important;}
  .treasury-paper .tp-data{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
  .treasury-paper .tp-sign{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
  .treasury-paper .tp-header,.treasury-paper .tp-primary,.treasury-paper .tp-section h3,.treasury-paper .tp-sign,.treasury-paper .tp-footer{break-inside:avoid;page-break-inside:avoid;}
  .treasury-paper .tp-detail,.treasury-paper .tp-primary>div{min-width:0;overflow-wrap:anywhere;}
  .treasury-paper{break-after:avoid-page!important;page-break-after:avoid!important;}
}

/* V1.13.53: larger sign/stamp space while avoiding a blank second A5 sheet. */
@media print {
  html,body{height:auto!important;min-height:0!important;max-height:none!important;}
  .treasury-paper .tp-sign,.treasury-paper .tp-footer{break-inside:avoid-page!important;}
}


/* V1.13.54: centered A5 printing, more readable typography and full-width purpose. */
.treasury-paper{font-size:12px;line-height:1.68;}
.treasury-paper .tp-brand strong{font-size:11.5px;}
.treasury-paper .tp-heading h1{font-size:19px;}
.treasury-paper .tp-meta{font-size:10px;}
.treasury-paper .tp-intro{font-size:11px;line-height:1.75;font-weight:600;margin-bottom:9px;}
.treasury-paper .tp-primary{gap:13px;padding:10px 12px;}
.treasury-paper .tp-primary small{font-size:10px;}
.treasury-paper .tp-primary strong{font-size:14px;}
.treasury-paper .tp-amount strong{font-size:20px;}
.treasury-paper .tp-amount .tp-amount-words{display:block;margin:2px 0 0;font-size:10.5px;font-weight:650;line-height:1.65;overflow-wrap:anywhere;white-space:normal;color:#334b53;}
.treasury-paper .tp-section h3{font-size:11px;margin-bottom:7px;}
.treasury-paper .tp-detail span{font-size:10px;}
.treasury-paper .tp-detail strong{font-size:11.3px;line-height:1.7;}
.treasury-paper .tp-data .tp-purpose{grid-column:1 / -1;min-height:51px;padding:6px 9px;border:1px solid #dbe6e8;border-radius:6px;background:#f8fbfb;}
.treasury-paper .tp-data .tp-purpose strong{font-size:12px;line-height:1.85;white-space:pre-wrap;overflow-wrap:anywhere;}
.treasury-paper .tp-sign span{font-size:10px;}.treasury-paper .tp-sign strong{font-size:11px;}
.treasury-paper.is-landscape .tp-intro{font-size:10.5px;margin-bottom:6px;}
.treasury-paper.is-landscape .tp-primary{padding:7px 11px;}
.treasury-paper.is-landscape .tp-amount strong{font-size:19px;}
.treasury-paper.is-landscape .tp-data .tp-purpose{min-height:37px;padding:3px 8px;}
.treasury-paper.is-landscape .tp-section h3{font-size:10.5px;}
.treasury-paper.is-landscape .tp-amount .tp-amount-words{font-size:10px;}
@media print {
  /* A5 has zero browser margins; physically center the document with matched gutters. */
  html,body{margin:0!important;padding:0!important;direction:rtl!important;width:100%!important;}
  .treasury-paper{width:142mm!important;min-width:142mm!important;max-width:142mm!important;
   min-height:204mm!important;margin:0 auto!important;padding:9mm 7mm 6mm!important;}
  .treasury-paper.is-landscape{width:204mm!important;min-width:204mm!important;max-width:204mm!important;
   min-height:142mm!important;margin:0 auto!important;padding:5mm 6mm 4mm!important;}
  .treasury-paper .tp-data .tp-purpose{grid-column:1 / -1!important;}
  .treasury-paper .tp-amount-words{break-inside:avoid;page-break-inside:avoid;}
}

/* v1.13.54 print-height budget: preserve the larger text, remove only unused gaps. */
.treasury-paper .tp-header{gap:8px;}
.treasury-paper .tp-accent-rule{margin:7px 0 5px;}
.treasury-paper .tp-intro{margin:0 0 6px;}
.treasury-paper .tp-primary{padding:7px 11px;gap:9px;}
.treasury-paper .tp-primary>div{gap:2px;}
.treasury-paper .tp-amount .tp-amount-words{line-height:1.45;font-size:10.3px;}
.treasury-paper .tp-section{padding:5px 0 4px;}
.treasury-paper .tp-section h3{margin:0 0 4px;}
.treasury-paper .tp-data{gap:4px 10px;}
.treasury-paper .tp-detail{gap:1px;}
.treasury-paper .tp-data .tp-purpose{min-height:48px;padding:4px 8px;}
.treasury-paper .tp-data .tp-purpose strong{line-height:1.58;}
.treasury-paper .tp-sign{margin-top:10px;min-height:100px;}
.treasury-paper .tp-sign>div{padding-top:6px;gap:4px;}
.treasury-paper .tp-footer{margin-top:5px;padding-top:5px;}
.treasury-paper.is-landscape .tp-sign{min-height:72px;margin-top:6px;}
.treasury-paper.is-landscape .tp-section{padding:3px 0 2px;}
.treasury-paper.is-landscape .tp-section h3{margin-bottom:3px;}
.treasury-paper.is-landscape .tp-data .tp-purpose{min-height:34px;}
.treasury-paper.is-landscape .tp-primary{padding:5px 10px;}
/* Landscape uses two balanced information columns to protect the A5 one-page limit. */
.treasury-paper.is-landscape{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:12px;align-content:start;}
.treasury-paper.is-landscape>.tp-header,
.treasury-paper.is-landscape>.tp-accent-rule,
.treasury-paper.is-landscape>.tp-intro,
.treasury-paper.is-landscape>.tp-primary,
.treasury-paper.is-landscape>.tp-sign,
.treasury-paper.is-landscape>.tp-footer{grid-column:1/-1;}
.treasury-paper.is-landscape>.tp-section{min-width:0;}
.treasury-paper.is-landscape .tp-data{grid-template-columns:repeat(2,minmax(0,1fr));}
.treasury-paper.is-landscape .tp-data .tp-purpose{grid-column:1/-1;}
.treasury-paper.is-landscape:not(:has(>.tp-notes))>.tp-section:nth-of-type(4){grid-column:1/-1;}
@media print {
 .treasury-paper.is-landscape{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;}
 .treasury-paper.is-landscape .tp-data{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
 .treasury-paper.is-landscape .tp-data .tp-purpose{grid-column:1/-1!important;}
 .treasury-paper{min-height:199mm!important;padding-bottom:4mm!important;}
 .treasury-paper.is-landscape{min-height:139mm!important;padding-bottom:3mm!important;}
}
.treasury-paper.is-landscape .tp-data .tp-purpose strong{font-size:11.2px;line-height:1.4;}
.treasury-paper.is-landscape .tp-sign{min-height:66px;}
@media print{.treasury-paper.is-landscape{padding-top:4mm!important;}}
.treasury-paper:not(.is-landscape) .tp-data .tp-iban{grid-column:span 2;}
.treasury-paper:not(.is-landscape) .tp-data .tp-iban strong{white-space:nowrap;font-size:10.8px;}
.treasury-paper.is-landscape .tp-iban strong{font-size:10px;}
@media print{.treasury-paper:not(.is-landscape) .tp-data .tp-iban{grid-column:span 2!important;}}


/* V1.13.55 - real A5 printer-safe single-sheet layout.
   The A5 body previously carried a forced 199mm/139mm min-height. Chrome or
   a printer with non-printable margins could move the footer onto sheet two.
   Keep the HTML, fields, signatures and type sizes; remove artificial paper
   height and reserve room for printer margins on BOTH orientations. */
@media print {
  .treasury-paper:not(.is-landscape){
    width:138mm!important;min-width:138mm!important;max-width:138mm!important;
    min-height:0!important;height:auto!important;
    padding:5mm 5mm 3mm!important;
    zoom:.97!important;
  }
  .treasury-paper.is-landscape{
    width:200mm!important;min-width:200mm!important;max-width:200mm!important;
    min-height:0!important;height:auto!important;
    padding:2mm 4mm 2mm!important;
    zoom:.89!important;
  }
  .treasury-paper:not(.is-landscape) .tp-sign{min-height:96px!important;margin-top:7px!important;}
  .treasury-paper.is-landscape .tp-sign{min-height:62px!important;margin-top:5px!important;}
  .treasury-paper .tp-footer{margin-top:4px!important;padding-top:4px!important;}
  .treasury-paper .tp-sign,.treasury-paper .tp-footer{break-inside:avoid!important;page-break-inside:avoid!important;}
}


/* 1.13.55 final: branch joins the bank and source account on ONE baseline.
   Enlarge writable signature zones without the artificial page min-height. */
.treasury-paper .tp-payment-details .tp-data,
.treasury-paper.is-landscape .tp-payment-details .tp-data{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px 10px;
}
.treasury-paper .tp-payment-details .tp-detail{min-width:0;}
.treasury-paper.is-landscape>.tp-payment-details{grid-column:1 / -1;}
.treasury-paper.is-landscape>.tp-notes{grid-column:1 / -1;}
.treasury-paper:not(.is-landscape) .tp-sign{min-height:125px;margin-top:10px;}
.treasury-paper.is-landscape .tp-sign{min-height:91px;margin-top:9px;}
.treasury-paper .tp-sign>div{padding-top:8px;gap:5px;}
@media print {
 .treasury-paper .tp-payment-details .tp-data,
 .treasury-paper.is-landscape .tp-payment-details .tp-data{
    display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;
 }
 .treasury-paper.is-landscape>.tp-payment-details,
 .treasury-paper.is-landscape>.tp-notes{grid-column:1/-1!important;}
 .treasury-paper:not(.is-landscape) .tp-sign{min-height:125px!important;margin-top:10px!important;}
 .treasury-paper.is-landscape .tp-sign{min-height:91px!important;margin-top:9px!important;}
}
/* Very long narration must still fit within the non-printable A5 printer area. */
@media print {.treasury-paper.is-landscape{zoom:.84!important;}}
@media print {.treasury-paper:not(.is-landscape){zoom:.92!important;}}


/* v1.13.57: Fill usable A5 page area with per-document fit-to-page scaling.
   Unlike v155's permanent .84/.92 zoom, standard documents print near full size.
   Measure their natural dimensions in the print iframe before opening Chrome print.
   Keep an 8mm safety zone for ordinary physical printer non-printable edges. */
body.tp-print-frame .treasury-paper:not(.is-landscape),
body.tp-print-frame .treasury-paper.is-landscape {
  min-height:0!important;height:auto!important;
  margin:0 auto!important;border:0!important;border-radius:0!important;
  box-shadow:none!important;overflow:visible!important;
  zoom:1!important;
}
body.tp-print-frame .treasury-paper:not(.is-landscape){
  width:var(--tp-print-layout-width,138mm)!important;min-width:var(--tp-print-layout-width,138mm)!important;max-width:var(--tp-print-layout-width,138mm)!important;
  padding:5mm 5mm 3mm!important;
}
body.tp-print-frame .treasury-paper.is-landscape{
  width:var(--tp-print-layout-width,200mm)!important;min-width:var(--tp-print-layout-width,200mm)!important;max-width:var(--tp-print-layout-width,200mm)!important;
  padding:3mm 5mm 3mm!important;
}
@media print {
  html,body{width:auto!important;margin:0!important;padding:0!important;overflow:visible!important;}
  body.tp-print-frame .treasury-paper:not(.is-landscape),body.tp-print-frame .treasury-paper.is-landscape {
    height:auto!important;min-height:0!important;
    margin:0 auto!important;border:0!important;box-shadow:none!important;
    /* Browser print zoom is resolved after measuring the final A5 grid. */
    zoom:var(--tp-fit-scale,.92)!important;
  }
  .treasury-paper:not(.is-landscape){
    width:var(--tp-print-layout-width,138mm)!important;min-width:var(--tp-print-layout-width,138mm)!important;max-width:var(--tp-print-layout-width,138mm)!important;
    padding:5mm 5mm 3mm!important;
  }
  .treasury-paper.is-landscape{
    width:var(--tp-print-layout-width,200mm)!important;min-width:var(--tp-print-layout-width,200mm)!important;max-width:var(--tp-print-layout-width,200mm)!important;
    padding:3mm 5mm 3mm!important;
  }
}

/* The print iframe is narrow on screen. Prevent the app's 760px/mobile
   breakpoint from changing the A5 paper grid while it is measured. */
body.tp-print-frame .treasury-paper .tp-header{grid-template-columns:1.45fr 1.15fr 1fr!important;}
body.tp-print-frame .treasury-paper .tp-heading{grid-column:auto!important;grid-row:auto!important;}
body.tp-print-frame .treasury-paper .tp-primary{grid-template-columns:1.2fr 1fr!important;}
body.tp-print-frame .treasury-paper .tp-data{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
body.tp-print-frame .treasury-paper.is-landscape .tp-data{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
body.tp-print-frame .treasury-paper .tp-data .tp-purpose{grid-column:1/-1!important;}
body.tp-print-frame .treasury-paper .tp-payment-details .tp-data{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
body.tp-print-frame .treasury-paper .tp-sign{grid-template-columns:repeat(3,minmax(0,1fr))!important;}

/* v1.13.57 - symmetric A5 printable area. The outer sheet never becomes wider
   than the paper. Chrome scaling then cannot push the RTL page to one side. */
body.tp-print-frame{
  direction:ltr!important;
  display:flex!important;justify-content:center!important;align-items:flex-start!important;
  width:100%!important;min-width:0!important;max-width:100%!important;
  margin:0!important;padding:0!important;overflow:visible!important;
}
body.tp-print-frame>.treasury-paper{
  direction:rtl!important;flex:0 1 auto!important;
  margin:0 auto!important;min-width:0!important;
  max-width:100%!important;
  box-sizing:border-box!important;
}
body.tp-print-frame>.treasury-paper.is-landscape{
  width:min(100%,var(--tp-print-layout-width,202mm))!important;
  max-width:min(100%,var(--tp-print-layout-width,202mm))!important;
  padding:3mm 4mm 3mm!important;
}
body.tp-print-frame>.treasury-paper:not(.is-landscape){
  width:min(100%,var(--tp-print-layout-width,140mm))!important;
  max-width:min(100%,var(--tp-print-layout-width,140mm))!important;
  padding:4mm 4mm 3mm!important;
}
@media print{
  html{margin:0!important;padding:0!important;}
  body.tp-print-frame{display:flex!important;justify-content:center!important;align-items:flex-start!important;}
  body.tp-print-frame>.treasury-paper{
    margin:0 auto!important;
    min-height:0!important;height:auto!important;
    transform:none!important;
    transform-origin:center top!important;
    zoom:var(--tp-fit-scale,1)!important;
  }
}
/* Keep full font sizes; recover printable space from internal whitespace. */
body.tp-print-frame>.treasury-paper.is-landscape .tp-section{padding:2px 0 1px!important;}
body.tp-print-frame>.treasury-paper.is-landscape .tp-section h3{margin-bottom:2px!important;}
body.tp-print-frame>.treasury-paper.is-landscape .tp-data{row-gap:2px!important;}
body.tp-print-frame>.treasury-paper.is-landscape .tp-detail strong{line-height:1.42!important;}
body.tp-print-frame>.treasury-paper.is-landscape .tp-sign{min-height:85px!important;margin-top:5px!important;}

/* V1.13.70 - Four-digit financial numbers and a more legible IBAN.
   Shared A5 preview/print rules; no changes to persisted bank fields. */
.treasury-paper .tp-data .tp-bank-number strong,
.treasury-paper .tp-data .tp-iban strong{
  direction:ltr;
  unicode-bidi:isolate;
  text-align:left;
  font-family:Arial,Tahoma,sans-serif;
  font-variant-numeric:tabular-nums;
  letter-spacing:.1px;
  overflow-wrap:anywhere;
}
/* A 26-character IBAN needs one complete line across the destination grid. */
.treasury-paper:not(.is-landscape) .tp-data .tp-iban,
.treasury-paper.is-landscape .tp-data .tp-iban{grid-column:1 / -1;}
.treasury-paper:not(.is-landscape) .tp-data .tp-iban strong{
  font-size:15.5px;font-weight:800;line-height:1.65;white-space:nowrap;
}
.treasury-paper.is-landscape .tp-data .tp-iban strong{
  font-size:14.2px;font-weight:800;line-height:1.55;white-space:nowrap;
}
.treasury-paper .tp-data .tp-bank-number strong{font-size:12px;font-weight:750;}
.treasury-paper.is-landscape .tp-data .tp-bank-number strong{font-size:11.5px;}
@media print{
  .treasury-paper:not(.is-landscape) .tp-data .tp-iban,
  .treasury-paper.is-landscape .tp-data .tp-iban{grid-column:1/-1!important;}
}

/* v1.13.71 - payment order signatory library, both light/dark friendly */
.treasury-signatory-picker{display:flex;align-items:stretch;gap:8px;min-width:0}
.treasury-signatory-picker>.input{flex:1;min-width:0}
.treasury-signatory-picker .treasury-signatory-add{width:42px;min-width:42px;padding:0!important;display:grid;place-items:center;border-radius:10px}
.treasury-signatory-add .ui-icon{width:18px;height:18px}
.modal:has(.treasury-signatory-manager){width:min(640px,95vw)}
.treasury-signatory-manager{display:grid;gap:15px;min-width:0}
.treasury-signatory-list{display:grid;gap:8px;max-height:290px;overflow:auto}
.treasury-signatory-row{display:flex;justify-content:space-between;align-items:center;gap:10px;border:1px solid var(--line,#314657);border-radius:10px;padding:10px 12px}
.treasury-signatory-row>div:first-child{min-width:0;overflow-wrap:anywhere}
.treasury-signatory-default{display:inline-block;margin:0 8px;padding:2px 8px;border-radius:20px;background:rgba(20,180,148,.13);color:var(--accent,#16ba9a);font-size:11px}
.treasury-signatory-row-buttons{display:flex;align-items:center;gap:5px;flex-wrap:wrap}
.treasury-signatory-row-buttons .btn{gap:5px;display:inline-flex;align-items:center}
.treasury-signatory-row-buttons .ui-icon,.treasury-signatory-form-actions .ui-icon{width:15px;height:15px}
.treasury-signatory-row-buttons .btn:disabled{opacity:.45}
#treasurySignatoryForm{display:grid;gap:9px;padding-top:12px;border-top:1px solid var(--line,#314657)}
#treasurySignatoryForm>label{font-size:12px}
.treasury-signatory-checkbox{display:flex;gap:8px;align-items:center;cursor:pointer}
.treasury-signatory-checkbox input{accent-color:var(--accent,#16ba9a)}
.treasury-signatory-form-actions{display:flex;gap:8px;flex-wrap:wrap}
@media(max-width:520px){.treasury-signatory-row{align-items:flex-start;flex-direction:column}.treasury-signatory-row-buttons{width:100%}}


/* v1.13.260 - Responsive Bale messenger settings, adaptive and print-safe. */
.treasury-approval-info,.treasury-workflow-panel{padding:15px 17px;margin-bottom:12px;border:1px solid var(--line,#314657);border-radius:12px}
.treasury-approval-info{display:flex;flex-wrap:wrap;align-items:center;gap:10px;font-size:13px;background:var(--surface,#ffffff)}
.treasury-approval-info .btn{margin-right:auto}
.treasury-workflow-head,.treasury-workflow-actions{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:9px}
.treasury-workflow-head>div:first-child{display:grid;gap:5px}
.treasury-workflow-panel p{margin:0}.treasury-workflow-panel small{display:block;margin-top:12px;opacity:.8}
.treasury-workflow-panel summary{cursor:pointer;margin-top:13px}.treasury-workflow-panel ol{margin:12px 18px;padding:0;line-height:2}
.treasury-approval-tag{display:inline-flex;border-radius:100px;padding:4px 10px;line-height:1.4;white-space:nowrap;font-size:11px;font-weight:750;border:1px solid rgba(90,106,125,.35)}
.treasury-approval-tag.status-DRAFT{background:rgba(118,130,145,.11)}
.treasury-approval-tag.status-PENDING_APPROVAL{background:rgba(240,170,55,.14);color:var(--warning,#bb842b)}
.treasury-approval-tag.status-APPROVED{background:rgba(30,145,210,.13);color:var(--accent,#147fae)}
.treasury-approval-tag.status-PAID{background:rgba(27,165,111,.12);color:#189569}
.treasury-table .treasury-actions{min-width:230px;white-space:normal}.treasury-table .treasury-actions .btn{margin:2px}
.treasury-messenger-settings{display:grid;gap:13px;max-width:100%}.treasury-messenger-settings .field{display:grid;gap:5px}
.treasury-messenger-settings p,.treasury-messenger-settings small{line-height:1.7;color:var(--muted,#697c8a)}
.treasury-messenger-clear{display:flex;gap:8px;align-items:center}
.treasury-messenger-buttons{display:flex;flex-wrap:wrap;gap:8px}
@media(max-width:600px){.treasury-workflow-actions,.treasury-workflow-actions>.btn{width:100%}.treasury-approval-info .btn{margin:0}}
@media print{.treasury-workflow-panel,.treasury-approval-info{display:none!important}}
/* v1.13.77: messenger management; inherits existing Treasury theme */
.bale-management .bale-tabs{display:flex;gap:8px;flex-wrap:wrap}
.bale-management .bale-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:12px}
.bale-management .bale-check{display:flex;align-items:center;gap:8px;line-height:1.8}
.bale-management h4{margin:4px 0;font-size:1rem}
.bale-management hr{border:0;border-top:1px solid var(--border,#d7e1eb)}

/* v1.13.80: compact actions, meaningful financial statuses, receipt metadata */
.treasury-compact-actions{display:inline-flex;flex-wrap:wrap;gap:4px;align-items:center;justify-content:center}
.treasury-table .treasury-actions{min-width:135px;max-width:210px;white-space:normal}
.treasury-operation{width:28px;height:29px;display:inline-flex;align-items:center;justify-content:center;border-radius:8px;border:1px solid var(--line,#34506a);background:rgba(123,140,162,.1);color:var(--text,#e8f1f8);cursor:pointer;padding:4px;transition:filter .12s,background .12s}
.treasury-operation:hover{filter:brightness(1.35);background:rgba(66,125,195,.26)}
.treasury-operation:focus-visible{outline:2px solid var(--accent,#18b7a8);outline-offset:2px}
.treasury-operation-approve,.treasury-operation-pay{background:rgba(24,174,122,.18);color:#43dca5;border-color:rgba(24,174,122,.48)}
.treasury-operation-reject,.treasury-operation-delete,.treasury-operation-cancel{background:rgba(225,68,79,.11);color:#ff8890;border-color:rgba(225,68,79,.35)}
.treasury-operation-return,.treasury-operation-edit{color:#7cb7ff;border-color:rgba(64,151,235,.4)}
.treasury-operation-send{color:#56d9c5}
.treasury-approval-tag{font-weight:900!important;font-size:12px!important;padding:6px 11px!important;border-width:1px!important;letter-spacing:.03px}
.treasury-approval-tag.status-DRAFT{color:#aebccc!important;background:rgba(134,150,167,.18)!important}
.treasury-approval-tag.status-PENDING_APPROVAL{color:#ffcf72!important;background:rgba(245,172,42,.17)!important;border-color:rgba(245,172,42,.48)}
.treasury-approval-tag.status-APPROVED{color:#48d69d!important;background:rgba(19,164,105,.2)!important;border-color:rgba(19,164,105,.5)}
.treasury-approval-tag.status-PAID{color:#76b8ff!important;background:rgba(36,123,220,.24)!important;border-color:rgba(36,123,220,.57)}
.treasury-approval-tag.status-REJECTED,.treasury-approval-tag.status-CANCELLED{color:#ff9197!important;background:rgba(211,57,72,.18)!important;border-color:rgba(211,57,72,.5)}
.treasury-doc-summary{font-size:10px!important;color:#51d4b5!important;margin-top:6px;white-space:normal!important}
.treasury-report-shortcuts{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 12px}

.bale-icon-btn{background:rgba(56,125,210,.15);border:1px solid rgba(73,144,228,.35);border-radius:8px;cursor:pointer;color:#8ac3ff;min-width:29px;height:30px;font-size:17px;line-height:1;margin:0 2px}
.bale-icon-btn.active{color:#37d6aa;border-color:rgba(42,197,139,.5)}
.bale-icon-btn.inactive,.bale-icon-btn.danger{color:#ff8289;border-color:rgba(217,78,89,.42)}
.bale-icon-btn:hover{filter:brightness(1.3)}

.treasury-operation-bale{font-size:13px;font-weight:900;color:#5ad9cb;border-color:rgba(31,181,158,.43)}

/* v1.13.81 Treasury: fixed two rows and alternating icon palettes. */
.treasury-table .treasury-actions{min-width:225px;width:225px!important;max-width:225px!important;vertical-align:middle;text-align:center}
.treasury-table .treasury-purpose-col{font-size:11px;line-height:1.5;max-width:205px;width:15%;overflow:hidden}
.treasury-purpose-col>span{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere}
.treasury-compact-actions{display:grid!important;grid-template-columns:repeat(5,36px);grid-template-rows:repeat(2,36px);gap:5px!important;align-items:center;justify-content:center;max-width:205px;margin:4px auto}
.treasury-compact-actions .treasury-operation{width:36px!important;height:36px!important;min-width:36px;font-size:16px;border-radius:10px}
.treasury-compact-actions .treasury-operation svg{width:20px;height:20px}
.treasury-compact-actions .treasury-operation:nth-child(even):not(.is-sent){filter:hue-rotate(36deg) brightness(1.13);border-style:solid}
.treasury-compact-actions .treasury-operation:nth-child(odd):not(.is-sent){filter:saturate(1.2)}
.treasury-operation-bale:not(.is-sent){background:rgba(30,160,230,.2)!important;color:#80dfff!important;border-color:#348ee0!important}
.treasury-operation.is-sent,.treasury-operation:disabled{color:#59d6a7!important;background:rgba(35,161,103,.13)!important;border-color:rgba(49,165,108,.5)!important;opacity:.74;cursor:not-allowed}
@media(max-width:1000px){.treasury-table .treasury-actions{min-width:212px;width:212px!important}.treasury-compact-actions{grid-template-columns:repeat(5,32px);grid-template-rows:repeat(2,32px)}.treasury-compact-actions .treasury-operation{width:32px!important;height:32px!important;min-width:32px}}

/* V1.13.82 - truly two-row icons; all actions belong to same grid */
.treasury-table .treasury-actions{min-width:172px!important;width:172px!important;max-width:172px!important;padding:4px 3px!important}
.treasury-compact-actions{display:grid!important;grid-template-columns:repeat(5,30px)!important;grid-template-rows:repeat(2,30px)!important;grid-auto-rows:30px;gap:3px!important;width:162px!important;max-width:162px!important;margin:0 auto!important;justify-content:center}
.treasury-compact-actions .treasury-operation{width:30px!important;height:30px!important;min-width:30px!important;border-radius:7px!important;padding:3px!important;margin:0!important}
.treasury-compact-actions .treasury-operation svg{width:17px!important;height:17px!important}
.treasury-table td{padding-top:5px!important;padding-bottom:5px!important}
.treasury-table .treasury-purpose-col{font-size:10px;max-width:140px;width:12%}
.treasury-purpose-col>span{-webkit-line-clamp:2;line-height:1.35}
.treasury-approval-slim{font-size:11px;padding:7px 12px;margin-bottom:9px;opacity:.85}
.treasury-compact-metrics{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 9px}
.treasury-compact-metrics>span{border:1px solid var(--line,#34475b);padding:6px 12px;border-radius:9px;background:var(--card,#0b1b2b);font-size:12px}
.treasury-compact-metrics b{font-size:17px;margin-left:5px}.treasury-compact-metrics .paid b{color:#4fd3a3}.treasury-compact-metrics .waiting b{color:#e8b967}
.treasury-report-actions{display:flex;gap:8px;flex-wrap:wrap}
@media(max-width:1000px){.treasury-table .treasury-actions{min-width:172px!important;width:172px!important}.treasury-compact-actions{grid-template-columns:repeat(5,30px)!important;grid-template-rows:repeat(2,30px)!important}.treasury-compact-actions .treasury-operation{width:30px!important;height:30px!important}}

.treasury-report-hub{display:grid;gap:12px;min-width:min(75vw,560px)}
.treasury-report-range{display:flex;gap:12px;flex-wrap:wrap}
.treasury-report-range label{display:grid;flex:1;min-width:170px;gap:5px}
.treasury-report-preview{max-height:45vh;overflow:auto}
.treasury-report-preview .treasury-table{font-size:11px;white-space:normal}
.treasury-report-print{min-width:0}.treasury-report-print td small{display:block;font-size:10px;color:#819aa8}

.treasury-messenger-toolbar{display:flex;align-items:center;justify-content:flex-start;margin:0 0 9px}.treasury-messenger-toolbar .btn{font-size:12px;padding:6px 12px}

/* V1.13.84 - Unified managerial treasury KPI card */
.treasury-summary-dashboard{padding:14px 18px!important;margin:0 0 12px!important;border-radius:15px!important;background:linear-gradient(125deg,rgba(47,99,151,.12),rgba(7,19,34,.04))!important;border:1px solid var(--line,rgba(145,172,195,.2))!important;}
.treasury-summary-heading{display:flex;gap:10px;align-items:center;margin-bottom:12px;}
.treasury-summary-heading strong{font-size:15px;display:block;line-height:1.4;}
.treasury-summary-heading small{display:block;font-size:11px;opacity:.72;margin-top:2px;}
.treasury-summary-icon{font-size:19px;line-height:1;color:#63baff;border-radius:10px;background:rgba(80,163,244,.15);padding:7px 10px;}
.treasury-summary-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;}
.treasury-summary-stat{min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:5px;padding:12px 14px;border-radius:11px;background:var(--card,rgba(15,37,53,.7));border:1px solid rgba(129,156,173,.23);}
.treasury-summary-stat>span{font-size:12px;font-weight:700;}
.treasury-summary-stat>strong{font-size:clamp(21px,2.2vw,30px);font-weight:900;line-height:1.3;font-variant-numeric:tabular-nums;}
.treasury-summary-stat.is-paid>strong{color:#45d2a5;}
.treasury-summary-stat.is-waiting>strong{color:#edba64;}
.treasury-summary-stat.is-total>strong{color:#77baff;}
.treasury-summary-stat>small{font-size:10px;opacity:.75;}
.treasury-summary-meter{width:100%;height:5px;background:rgba(140,161,179,.17);border-radius:99px;overflow:hidden;margin-top:3px;}
.treasury-summary-meter>i{display:block;height:100%;max-width:100%;border-radius:99px;transition:width .2s ease;background:#45d2a5;}
.treasury-summary-stat.is-waiting .treasury-summary-meter>i{background:#edba64;}
@media(max-width:650px){.treasury-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr));}.treasury-summary-stat.is-total{grid-column:1/-1}.treasury-summary-dashboard{padding:12px!important;}}

/* v1.13.131: smaller readable rows in supplier search suggestion list. */
.treasury-party-results .treasury-result{font-size:11px;padding:7px 11px;line-height:1.5}
.treasury-party-results .treasury-result strong{font-size:11px}
.treasury-party-results .treasury-result small{font-size:10px}


/* V1.13.146 - one-row, fluid Treasury action bar (reference clip styling) */
.treasury-table{width:100%;table-layout:auto}
.treasury-table th:nth-child(3),.treasury-table td.treasury-party-col{width:9.5%;max-width:108px;min-width:82px}
.treasury-table td.treasury-party-col strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:700;max-width:100px}
.treasury-table .treasury-purpose-col{width:12%!important;max-width:135px!important;overflow:hidden;text-overflow:ellipsis}
.treasury-table .treasury-actions{width:274px!important;min-width:274px!important;max-width:274px!important;padding:6px 4px 11px!important;white-space:nowrap!important;vertical-align:middle}
.treasury-compact-actions{
 --treasury-wave-x:26px;
 position:relative;isolation:isolate;display:flex!important;flex-flow:row nowrap!important;
 grid-template-columns:none!important;grid-template-rows:none!important;
 gap:3px!important;justify-content:center!important;align-items:center!important;
 width:max-content!important;max-width:none!important;min-width:0!important;
 margin:1px auto 9px!important;padding:3px 5px!important;
 border:1px solid rgba(48,154,175,.38);border-radius:999px;
 background:linear-gradient(110deg,rgba(13,45,66,.96),rgba(12,38,60,.96));
 box-shadow:inset 0 1px 0 rgba(163,221,236,.08),0 6px 14px rgba(0,0,0,.12)
}
.treasury-compact-actions::after{
 content:"";position:absolute;z-index:0;pointer-events:none;
 width:42px;height:14px;top:calc(100% - 1px);left:var(--treasury-wave-x,26px);
 transform:translateX(-50%);background:#10384e;
 clip-path:path('M0 0 C9 0 12 0 17 8 C19 11 23 11 25 8 C30 0 33 0 42 0 L42 0 Z');
 filter:drop-shadow(0 2px 1px rgba(35,207,169,.22));
 transition:left .09s ease-out
}
.treasury-compact-actions .treasury-operation{
 position:relative;z-index:1;display:inline-flex!important;flex:0 0 25px!important;
 width:25px!important;min-width:25px!important;height:25px!important;
 border-radius:999px!important;margin:0!important;padding:3px!important;
 transition:background .16s ease,color .16s ease,transform .16s ease,box-shadow .16s ease;
}
.treasury-compact-actions .treasury-operation svg{width:15px!important;height:15px!important}
.treasury-compact-actions .treasury-operation:hover:not(:disabled),
.treasury-compact-actions .treasury-operation.treasury-wave-selected:not(:disabled){
 transform:translateY(-2px);background:rgba(31,192,183,.20)!important;
 box-shadow:0 0 0 1px rgba(62,225,199,.2),0 3px 10px rgba(9,170,157,.14)
}
.treasury-compact-actions .treasury-operation:nth-child(even):not(.is-sent),
.treasury-compact-actions .treasury-operation:nth-child(odd):not(.is-sent){filter:none}
.treasury-compact-actions .treasury-operation:disabled{transform:none;box-shadow:none}
.treasury-operation-bale .treasury-bale-logo{display:block;width:18px;height:18px;max-width:100%;object-fit:contain;pointer-events:none}
.treasury-compact-actions .treasury-operation-bale:not(.is-sent){background:rgba(13,167,139,.15)!important;border-color:rgba(22,202,162,.54)!important}
.treasury-workflow-actions.treasury-compact-actions{margin:6px 2px 13px!important}
@media(max-width:1200px){
 .treasury-table{min-width:1040px}
 .treasury-table .treasury-actions{min-width:274px!important;width:274px!important;max-width:274px!important}
 .treasury-compact-actions{grid-template-columns:none!important;grid-template-rows:none!important}
}
@media(prefers-reduced-motion:reduce){
 .treasury-compact-actions::after,.treasury-compact-actions .treasury-operation{transition:none!important}
}
/* v1.13.249 — HR permissions are managed alongside Bale user permissions. */
.bale-management .bale-hr-permissions{grid-column:1/-1;display:grid;grid-template-columns:repeat(auto-fit,minmax(215px,1fr));gap:9px;padding:15px;border:1px solid rgba(16,185,129,.25);border-radius:12px;background:rgba(16,185,129,.04)}
.bale-management .bale-hr-permissions>strong{grid-column:1/-1;font-weight:700}
.bale-management .bale-hr-permissions .bale-check{padding:6px 8px;border-radius:7px;background:rgba(127,143,162,.06)}
@media(max-width:640px){.bale-management .bale-hr-permissions{grid-template-columns:1fr;padding:10px}}

/* V1.13.289 - treasury payment sums + click-to-filter, scoped to treasury only. */
.treasury-amount-heading{display:flex;gap:10px;align-items:baseline;justify-content:space-between;flex-wrap:wrap;margin:16px 0 10px;border-top:1px solid rgba(140,164,185,.16);padding-top:13px}
.treasury-amount-heading strong{font-size:13px;color:var(--text,#e6f0fb)}
.treasury-amount-heading small{font-size:11px;color:var(--muted,#9db1c6)}
.treasury-amount-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.treasury-amount-card{display:flex;flex-direction:column;align-items:stretch;text-align:right;gap:7px;cursor:pointer;min-width:0;min-height:120px;padding:13px 15px;border-radius:12px;background:rgba(18,45,65,.72);border:1px solid rgba(125,158,186,.32);color:var(--text,#e7f0ff);font-family:inherit;transition:background .18s,border-color .18s,box-shadow .18s,transform .18s}
.treasury-amount-card:hover{border-color:rgba(109,182,245,.68);background:rgba(28,63,86,.85);transform:translateY(-1px)}
.treasury-amount-card:focus-visible{outline:2px solid #74c8ed;outline-offset:3px}
.treasury-amount-card>span{font-size:12px;font-weight:800}
.treasury-amount-card>strong{font-size:clamp(15px,1.65vw,22px);font-weight:900;line-height:1.55;overflow-wrap:anywhere;font-variant-numeric:tabular-nums;direction:rtl}
.treasury-amount-card>small{color:var(--muted,#a3b4c7);font-size:10px;line-height:1.65}
.treasury-amount-card.is-ready>strong{color:#f0c47c}
.treasury-amount-card.is-paid>strong{color:#49dab8}
.treasury-amount-card.is-draft>strong{color:#88c2ff}
.treasury-amount-card.is-active{border-color:#57b9df!important;box-shadow:0 0 0 2px rgba(65,179,214,.22),inset 0 3px 0 rgba(65,179,214,.48);background:rgba(26,75,94,.84)}
.treasury-amount-filter-notice:not([hidden]){display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-top:12px;padding:9px 12px;border:1px solid rgba(84,189,204,.32);border-radius:10px;background:rgba(65,160,170,.09);color:var(--text,#e7f0ff);font-size:12px}
@media(max-width:820px){.treasury-amount-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:540px){.treasury-amount-grid{grid-template-columns:1fr}.treasury-amount-card{min-height:95px}.treasury-amount-heading{align-items:flex-start;flex-direction:column}}

/* v1.13.292 - unified count + amount by exact payment status */
.treasury-kpi-unified .treasury-summary-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.treasury-kpi-unified .treasury-kpi-card{min-height:170px;align-items:stretch;gap:6px;padding:14px 17px;text-align:right;direction:rtl}
.treasury-kpi-unified .treasury-kpi-title{font-size:12px;font-weight:850;color:#e0ebf7}
.treasury-kpi-unified .treasury-kpi-count{font-size:clamp(24px,2.25vw,32px);line-height:1.15;text-align:right;color:inherit}
.treasury-kpi-unified .treasury-kpi-amount-label{font-size:11px;color:#a6b9ce;margin-top:5px}
.treasury-kpi-unified .treasury-kpi-money{font-size:clamp(15px,1.48vw,21px);line-height:1.5;text-align:right;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.treasury-kpi-unified .treasury-kpi-card.is-paid .treasury-kpi-count,.treasury-kpi-unified .treasury-kpi-card.is-paid .treasury-kpi-money{color:#49dab8}
.treasury-kpi-unified .treasury-kpi-card.is-ready .treasury-kpi-count,.treasury-kpi-unified .treasury-kpi-card.is-ready .treasury-kpi-money{color:#f0c47c}
.treasury-kpi-unified .treasury-kpi-card.is-draft .treasury-kpi-count,.treasury-kpi-unified .treasury-kpi-card.is-draft .treasury-kpi-money{color:#88c2ff}
.treasury-kpi-unified .treasury-kpi-card .treasury-summary-meter{margin-top:4px}
.treasury-kpi-unified .treasury-kpi-card.is-ready .treasury-summary-meter>i{background:#edba64}
.treasury-kpi-unified .treasury-kpi-card>small{margin-top:auto}
.treasury-kpi-unified .treasury-kpi-extras{display:flex;justify-content:space-between;align-items:center;gap:8px 16px;flex-wrap:wrap;margin-top:10px;padding:8px 4px 0;color:#a8bfd3;font-size:11px}
.treasury-kpi-unified .treasury-kpi-extras strong{color:#e7f0fa;font-size:12px;margin-inline-start:3px}
@media(max-width:800px){.treasury-kpi-unified .treasury-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.treasury-kpi-unified .treasury-kpi-card.is-draft{grid-column:1/-1}}
@media(max-width:540px){.treasury-kpi-unified .treasury-summary-grid{grid-template-columns:1fr}.treasury-kpi-unified .treasury-kpi-card.is-draft{grid-column:auto}.treasury-kpi-unified .treasury-kpi-card{min-height:138px;padding:12px 14px}}


/* V1.13.293 - compact status dashboard only; preserve clickable cards and totals. */
.treasury-summary-dashboard.treasury-kpi-unified{padding:9px 12px!important;margin-bottom:9px!important;border-radius:12px!important}
.treasury-kpi-unified .treasury-summary-heading{margin-bottom:7px;gap:7px}
.treasury-kpi-unified .treasury-summary-heading strong{font-size:13px;line-height:1.25}
.treasury-kpi-unified .treasury-summary-heading small{font-size:9px;margin-top:1px;line-height:1.3}
.treasury-kpi-unified .treasury-summary-icon{font-size:15px;padding:5px 7px;border-radius:7px}
.treasury-kpi-unified .treasury-summary-grid{gap:8px}
.treasury-kpi-unified .treasury-kpi-card{min-height:114px;padding:8px 12px;gap:2px;border-radius:9px}
.treasury-kpi-unified .treasury-kpi-title{font-size:11px;line-height:1.25}
.treasury-kpi-unified .treasury-kpi-count{font-size:clamp(21px,1.9vw,26px);line-height:1.05}
.treasury-kpi-unified .treasury-kpi-amount-label{font-size:9px;margin-top:0;line-height:1.15}
.treasury-kpi-unified .treasury-kpi-money{font-size:clamp(13px,1.24vw,17px);line-height:1.22}
.treasury-kpi-unified .treasury-kpi-card .treasury-summary-meter{margin-top:2px;height:3px}
.treasury-kpi-unified .treasury-kpi-card>small{font-size:9px;line-height:1.15;margin-top:auto}
.treasury-kpi-unified .treasury-kpi-extras{margin-top:5px;padding:4px 2px 0;gap:5px 14px;font-size:10px}
.treasury-kpi-unified .treasury-kpi-extras strong{font-size:11px}
@media(max-width:540px){
 .treasury-summary-dashboard.treasury-kpi-unified{padding:9px!important}
 .treasury-kpi-unified .treasury-kpi-card{min-height:106px;padding:8px 10px}
 .treasury-kpi-unified .treasury-summary-heading small{display:none}
}
