.tf-editor{display:flex;flex-direction:column;min-height:0;width:min(1290px,94vw);max-width:1330px;padding:0;background:#f7f9fa}.tf-editor>form{display:flex;flex-direction:column;min-height:0;flex:1;margin:0;overflow:hidden}.tf-scroll{flex:1;min-height:0;overflow:auto;padding:8px 10px;display:flex;flex-direction:column;gap:8px}.tf-top{display:grid;grid-template-columns:auto 145px 140px 1fr;gap:9px;align-items:end}.tf-top>.tr-types{margin:0;padding:0;display:flex;gap:5px}.tf-editor label{font-size:12px;display:flex;flex-direction:column;gap:3px;margin:0;min-width:0}.tf-editor input,.tf-editor select,.tf-editor textarea{width:100%;min-height:0;height:30px;padding:4px 8px;margin:0;border:1px solid #cbdce5;border-radius:4px;background:white;color:#193e50;box-sizing:border-box}.tf-editor textarea{height:45px;resize:vertical}.tf-editor button:not(.dialog-head button),.tf-review>footer button{height:32px;min-height:32px;width:auto;padding:5px 10px;margin:0;font:12px/20px 'Segoe UI',sans-serif;border:1px solid #cbdce5;border-radius:4px;white-space:nowrap;display:inline-flex;align-items:center;gap:5px;background:white;color:#115267}.tf-editor button.primary:not(.dialog-head button),.tf-review>footer button.primary{background:#115267;border-color:#115267;color:white}.tf-accounts{display:grid;grid-template-columns:1fr 1fr;gap:10px}.tf-card{border:1px solid #cbdce5;border-radius:4px;padding:9px;background:#f0f4f6;display:flex;flex-direction:column;gap:7px;min-width:0}.tf-values{display:grid;grid-template-columns:80px 1fr 1fr;gap:9px;align-items:start}.tf-values strong{display:flex;align-items:center;height:30px}.tf-card>small{font-size:11px}.tf-card p{font-size:12px;line-height:1.5;margin:2px 0}.tf-editor>.dialog-head{display:flex;align-items:center;gap:8px;flex:none}.tf-editor>.dialog-head>strong{flex:1}.tf-editor>form>footer{flex:none;display:flex;align-items:center;justify-content:flex-end;gap:7px;padding:8px 10px;border-top:1px solid #cbdce5;background:#f7f9fa}.tf-editor>form>footer>span{margin-right:auto;font-size:11px}.tf-distribution{display:flex;flex-direction:column;min-height:170px;flex:1;padding:7px;border:1px solid #cbdce5;border-radius:4px;background:white}.tf-distribution>.grid-toolbar{display:flex;gap:7px;align-items:center;margin-bottom:5px}.tf-distribution .grid-toolbar>strong{flex:1}.tf-grid{overflow:auto;min-height:0;flex:1}.tf-grid table{width:100%;border-collapse:collapse;font-size:12px}.tf-grid thead{position:sticky;top:0;z-index:1;background:#e8f0f4}.tf-grid th,.tf-grid td{padding:6px 8px;text-align:left;border-bottom:1px solid #d8e3ea}.tf-grid th{font-size:12px;letter-spacing:normal;position:static}.tf-grid td:nth-last-child(2){text-align:right}.tf-account-search{display:flex;gap:4px;min-width:200px}.tf-editor .tf-account-search input{min-width:80px}.tf-editor .tf-account-search button{height:30px;min-height:30px;padding:4px 8px}.tf-review{width:min(900px,94vw);padding:0;max-height:90dvh}.tf-review main{padding:12px;max-height:62dvh;overflow:auto}.tf-review>footer{display:flex;justify-content:flex-end;gap:7px;padding:8px 12px}.tf-review [data-error],.tf-editor [data-error]{font-size:12px;color:#a4452c;margin:0}.tf-editor .tr-instrument-config{margin:0;flex:none}.tf-editor .tr-instrument-side{margin:3px 0}.tf-scroll>.tr-instrument-config:empty{display:none}.tf-editor>form>.tf-scroll>.tf-top [data-type][aria-pressed=true]{background:#115267;color:white}.treasury-window .tr-shell>main>.tf-editor{width:100%;height:100%;border:0;border-radius:0;max-height:none}.treasury-window .tr-shell>main:has(>.tf-editor){padding:0;display:flex;overflow:hidden}.tf-editor:where(dialog){height:min(820px,92dvh)}.tf-editor [hidden]{display:none!important}@media(max-width:750px){.tf-top{grid-template-columns:1fr 1fr}.tf-top>.tr-types,.tf-top>label:last-child{grid-column:1/-1}.tf-accounts{grid-template-columns:1fr}.tf-scroll{padding:6px;gap:6px}.tf-card{padding:7px}.tf-editor [data-notice]{display:none}.tf-editor>form>footer{flex-wrap:wrap;padding:6px}.tf-editor>form>footer>span{display:none}.tf-values{grid-template-columns:65px 1fr 1fr}.tf-distribution{flex:none;min-height:160px}.tf-editor{width:96vw}.tf-editor:where(dialog){height:92dvh}}
.treasury-window .tf-editor .tf-values>.tr-amount{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:3px;padding:0;grid-template-columns:none}.treasury-window .tf-editor .tf-values>.tr-amount input{width:100%;font-size:12px;flex:none}.tf-editor .tf-values label{align-self:start}.tf-editor .tf-values .rate-lookup{height:27px;min-height:27px;font-size:11px;margin-top:2px;align-self:flex-end}.tf-editor .tf-values .rate-source{font-size:10px;line-height:1.3;white-space:normal;max-width:100%;overflow-wrap:anywhere}.tf-editor .tf-card .tr-amount::before,.tf-editor .tf-card .tr-amount::after{content:none}
.treasury-window .tr-shell>main>.tf-editor{max-width:none;margin:0}.treasury-window .tf-editor>form{padding:0;gap:0}.tf-editor .tr-amount{background:transparent;border:0;border-radius:0}.tf-review .tf-grid td:nth-last-child(-n+2){text-align:right;white-space:nowrap}

/* Two explicit ledger sides, with the shared compact Nuvile heading. */
.tf-simple>.dialog-head{box-sizing:border-box;width:100%;height:44px!important;min-height:44px!important;flex:0 0 44px!important;padding:6px 14px!important;background:#104f63;color:white}.tf-simple>.dialog-head strong{font:600 16px/24px "Segoe UI",sans-serif}.tf-simple>.dialog-head button{height:30px;min-height:30px;margin:0;padding:3px 8px;width:auto}.tf-simple .tf-top{grid-template-columns:145px 140px 1fr}.tf-simple .tf-values{grid-template-columns:80px minmax(110px,1fr) minmax(90px,1fr)}.tf-simple .tf-accounts{flex:none}.tf-simple .tf-card>label .tf-account-search{width:100%}.tf-simple .tf-account-search input{flex:1;min-width:0}.tf-simple .tr-instrument-config [data-sides]{display:grid;grid-template-columns:1fr 1fr;gap:10px}.tf-simple .tr-instrument-config .tr-instrument-side{align-items:end}.tf-simple .tf-scroll{gap:12px}.tf-simple .tf-scroll>label:has(textarea){margin-top:auto}.tf-simple .tf-values label:has([name=importe_destino])::after{content:"Mismo importe que sale si ambas cuentas usan la misma moneda";font-size:10px;color:#597c8d}.tf-simple .tr-types{display:none!important}@media(max-width:750px){.tf-simple .tf-top{grid-template-columns:1fr 1fr}.tf-simple .tf-top>label:last-child{grid-column:1/-1}.tf-simple .tr-instrument-config [data-sides]{grid-template-columns:1fr}.tf-simple .tf-values{grid-template-columns:65px 1fr 1fr}}

.tf-simple:where(dialog){height:min(590px,92dvh);width:min(1050px,94vw)}.tf-simple .tf-values>.tr-amount{display:flex;flex-direction:column;align-items:stretch;gap:3px;padding:0;grid-template-columns:none}.tf-simple .tf-values>.tr-amount input{width:100%;font-size:12px}.tf-simple .tf-values:has([name=paridad][readonly]),.tf-simple .tf-values:has([name=paridad_destino][readonly]){grid-template-columns:80px minmax(0,1fr)}.tf-simple .tr-instrument-side[data-side=detalle]{grid-column:2;grid-row:1}.tf-simple .tr-instrument-side[data-side=detalle_destino]{grid-column:1;grid-row:1}@media(max-width:750px){.tf-simple .tr-instrument-side[data-side]{grid-column:1;grid-row:auto}.tf-simple .tf-values:has(input[readonly]){grid-template-columns:65px minmax(0,1fr)}}

/* Multiple accounts on both sides, one reviewed atomic movement. */
.tm-editor:where(dialog){width:min(1290px,94vw);height:min(780px,92dvh)}.tm-columns{display:grid;grid-template-columns:1fr 1fr;gap:12px;min-height:180px;flex:1}.tm-side{display:flex;flex-direction:column;min-height:0;border:1px solid #cbdce5;border-radius:5px;background:#f0f4f6;overflow:hidden}.tm-side-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px;border-bottom:1px solid #cbdce5}.tm-side-head strong{font-size:13px}.tm-lines{flex:1;min-height:0;overflow:auto;padding:8px;display:flex;flex-direction:column;gap:8px}.tm-row{flex:none;display:flex;flex-direction:column;gap:6px;padding:8px;margin:0;border:1px solid #cbdce5;border-radius:4px;background:white}.tm-row-head{display:flex;align-items:end;gap:6px}.tm-row-head>label{flex:1;min-width:0}.tm-row-head>[data-remove]{flex:none}.tm-values{display:grid;grid-template-columns:65px 1fr 1fr;gap:8px}.tm-values:has([data-rate][hidden]){grid-template-columns:65px 1fr}.tm-values strong{display:flex;align-items:center;min-height:30px}.tm-row small{font-size:11px;color:#597c8d}.tm-row .tr-instrument-config{padding:0}.tm-row .tr-instrument-config [data-sides]{display:block}.tm-row .tr-instrument-side{display:flex;align-items:end;gap:6px;flex-wrap:wrap}.tm-row .tr-instrument-side>label{flex:1}.tm-row .tr-instrument-config p{font-size:11px;margin:4px 0 0}.tm-totals{display:flex;justify-content:flex-end;gap:20px;padding:8px 10px;border:1px solid #cbdce5;border-radius:4px;background:#edf4f7;font-size:12px}.tm-totals span{display:flex;flex-direction:column;gap:3px}.tm-totals strong{font-size:16px;font-variant-numeric:tabular-nums}.tm-unbalanced{color:#a4452c}.tm-editor>footer{flex:none;display:flex;align-items:center;justify-content:flex-end;gap:7px;padding:8px 10px;border-top:1px solid #cbdce5;background:#f7f9fa}.tm-editor>footer>span{font-size:11px;margin-right:auto}.tm-editor>footer button{font:12px/20px "Segoe UI",sans-serif}.tm-editor .tf-scroll>label:has(textarea){margin-top:0}.tm-saved-lines table{width:100%;border-collapse:collapse}.tm-saved-lines td,.tm-saved-lines th{padding:5px 8px;border-bottom:1px solid #cbdce5}@media(max-width:750px){.tm-columns{grid-template-columns:1fr;flex:none;min-height:0}.tm-side{max-height:360px;min-height:200px}.tm-editor>footer{flex-wrap:wrap}.tm-editor>footer>span{display:none}.tm-totals{justify-content:space-between;gap:8px}.tm-totals strong{font-size:14px}}

.tm-editor .tm-row{min-height:0;flex:none;gap:5px;padding:8px}.tm-row>.tr-instrument-config:not(:has([data-side])){display:none}.tm-row>[data-instrument-slot],.tm-row>input[type=hidden]{display:none!important}.tm-row .tr-instrument-config p:empty{display:none}

.tm-editor>.tm-totals{flex:none;margin:0 10px 8px}.tm-editor .tm-columns{min-height:150px}@media(max-width:750px){.tm-editor>.tm-totals{margin:0 6px 6px}.tm-editor .tm-columns{min-height:0}}

.treasury-window .tr-create.tm-editor{width:min(1290px,94vw);max-width:1330px;resize:both}.treasury-window .tr-shell>main>.tm-editor{width:100%;max-width:none}

/* Debe/Haber: headers, amounts and totals share the same right edge. */
.tf-review .tf-grid :is(th,td):nth-last-child(-n+2){text-align:right;white-space:nowrap}

/* Compact funds workspace; nested line forms must not inherit the old editor grid. */
.sales-window.treasury-window.treasury-transfer{width:min(1180px,calc(100vw - 32px));height:min(660px,calc(100dvh - 72px))}
.sales-window.treasury-transfer>.window-title{height:44px;min-height:44px;flex-basis:44px}
.treasury-window .tr-create.tm-editor .tm-row{display:flex;flex-direction:column;padding:10px;gap:6px;margin:0;flex:none;min-height:0}
.treasury-window .tm-editor .tm-lines{padding:10px;gap:10px}
.tm-editor .tm-side-head{padding:7px 10px}
.tm-editor .tm-totals>span{text-align:right;min-width:76px}
@media(max-width:750px){.sales-window.treasury-window.treasury-transfer{width:calc(100vw - 10px);height:calc(100dvh - 60px);left:5px;top:5px}.treasury-window .tr-create.tm-editor .tm-row{padding:8px}.treasury-window .tm-editor .tm-lines{padding:7px}}

.tm-quick{display:flex;flex-wrap:wrap;gap:6px;padding:10px 10px 0}.tm-quick button{padding:7px 10px}.tm-lines>select{margin:10px 10px 0;max-width:calc(100% - 20px)}
