.treasury-window{inset:4vh 3vw;display:flex;flex-direction:column;background:var(--surface,#fffaf0);overflow:hidden}.treasury-window>main{padding:20px;overflow:auto}.tr-heading{display:flex;justify-content:space-between;align-items:center;gap:14px;margin:12px 0;flex-wrap:wrap}.tr-heading h2{margin:0}.tr-filters{display:grid;grid-template-columns:2fr 1fr 1fr auto;align-items:end;gap:12px}.treasury-window label,.tr-create label{display:grid;gap:5px}.tr-opening{display:flex;justify-content:space-between;align-items:center;padding:16px 0;border-bottom:1px solid #d8d9cc}.tr-opening strong{font-size:22px}.tr-grid{overflow:auto}.tr-grid table{width:100%;border-collapse:collapse}.tr-grid td,.tr-grid th{padding:11px 9px;border-bottom:1px solid #d8d9cc;text-align:left}.tr-grid td:nth-last-child(-n+3),.tr-grid th:nth-last-child(-n+3){text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}.tr-grid small{display:block}.tr-grid tfoot{font-weight:600;background:#f1ecdd}.treasury-window [data-detail]{padding:16px;border:1px solid #d8d9cc;border-radius:6px;margin-top:18px}.tr-create{width:min(680px,94vw)}.tr-create form{padding:18px;display:grid;gap:12px}.tr-create .tr-filters{grid-template-columns:1fr 1fr}.tr-account{display:flex;gap:8px}.tr-account input{min-width:0;flex:1}.tr-account button{flex-shrink:0;white-space:nowrap}.tr-create footer{display:flex;justify-content:flex-end;gap:10px}.tr-create [data-review]{padding:14px;border:1px solid #d8d9cc}.tr-create [data-error]{color:#a63520}@media(max-width:700px){.tr-filters{grid-template-columns:1fr 1fr}.treasury-window{inset:0}.treasury-window>main{padding:12px}}
.sales-window.treasury-window{width:94vw;height:92dvh;min-width:280px}.treasury-window>main{flex:1;min-height:0}.treasury-window .tr-heading>label{width:min(360px,100%)}.treasury-window .tr-heading>button{width:auto}.tr-grid button{width:auto;padding:4px 0;text-align:left}.tr-create button{width:auto}.tr-create [data-review] button{margin-top:10px}@media(max-width:700px){.sales-window.treasury-window{width:calc(100vw - 10px);height:calc(100dvh - 10px);left:5px;top:5px}}
.treasury-window .tr-shell{display:grid;grid-template-columns:150px minmax(0,1fr);flex:1;min-height:0}.treasury-window .tr-shell>main{padding:24px;overflow:auto;min-width:0}.treasury-window .tr-nav{border-right:1px solid var(--nuvile-border,#deded1);padding:22px 10px;background:var(--nuvile-paper,#fffef8)}.tr-nav>small{display:block;padding:0 10px 14px;letter-spacing:.09em;font-size:11px}.treasury-window .tr-nav button,.tr-nav>span{display:block;width:100%;text-align:left;padding:10px;margin-bottom:8px;border:0;background:transparent}.treasury-window .tr-nav button[aria-current]{background:var(--nuvile-soft,#f3efdf);border-left:3px solid #328a72;font-weight:600}.tr-nav>span{color:var(--nuvile-muted,#5b706f)}.tr-nav>span small{display:block;font-size:11px}
.treasury-window button,.tr-create button{font:14px/1.5 'Segoe UI',sans-serif;border:1px solid var(--nuvile-border,#deded1);border-radius:6px;background:var(--nuvile-paper,#fffef8);color:var(--nuvile-primary-hover,#243e49);padding:8px 12px;min-height:36px;width:auto}.treasury-window button:hover{background:var(--nuvile-soft,#f3efdf)}.treasury-window button.primary{background:var(--nuvile-primary,#214c59);color:white}.treasury-window>.window-title button{color:white;background:transparent;border:0}.treasury-window label{font-size:12px;font-weight:400}.treasury-window input,.treasury-window select,.treasury-window textarea{font:14px/1.5 'Segoe UI',sans-serif;min-width:0;min-height:38px;padding:8px 10px}.treasury-window h2{font-size:23px;font-weight:600;line-height:1.25;margin:0}.treasury-window h3{font-size:15px;margin:0;font-weight:600}.treasury-window small{font-size:12px;color:var(--nuvile-muted,#5b706f)}.treasury-window .tr-heading{margin:0 0 20px}.tr-heading>div>small{display:block;margin-bottom:5px}.treasury-window .tr-filters{grid-template-columns:minmax(180px,1.5fr) 1fr 1fr auto}.treasury-window .tr-opening{padding:14px 0;margin-top:8px}.tr-opening strong{font-size:20px;font-variant-numeric:tabular-nums}.treasury-window .tr-tools{display:flex;justify-content:space-between;gap:12px;align-items:end;flex-wrap:wrap;margin:16px 0 12px}.tr-tools>label{flex:1;max-width:330px}.tr-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.treasury-window [data-status]{font-size:12px;color:var(--nuvile-muted,#5b706f);margin:8px 0 12px}
.treasury-window .tr-grid table{font-size:12px;table-layout:auto}.treasury-window .tr-grid th{font-size:11px;font-weight:500;letter-spacing:.025em;text-transform:none;background:var(--nuvile-soft,#f3efdf);padding:10px 9px}.treasury-window .tr-grid td{padding:13px 9px}.treasury-window .tr-grid tbody button{border:0;background:transparent;padding:0;min-height:28px;text-align:left;color:#226c55;font:inherit}.treasury-window .tr-grid tr.selected{background:var(--nuvile-soft,#f3efdf)}.treasury-window .tr-grid tfoot{border-top:2px solid var(--nuvile-border,#deded1)}.treasury-window .tr-grid tfoot th{font-size:12px;color:inherit;font-weight:600}.tr-grid tfoot strong{display:block;font-size:14px;margin-top:4px}.tr-detail-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;flex-wrap:wrap}.tr-state{font-size:11px;color:#226c55}.tr-detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:14px}.tr-detail-grid strong{display:block;margin-top:3px;font-weight:600}.treasury-window [data-detail]>small{display:block;background:var(--nuvile-soft,#f3efdf);padding:11px 13px;border-radius:6px;margin:12px 0}.treasury-window [data-detail]>button{margin:0 8px 0 0}.tr-footer{margin-top:20px;padding-top:14px;border-top:1px solid var(--nuvile-border,#deded1);display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}
@media(max-width:760px){.treasury-window .tr-shell{grid-template-columns:1fr;grid-template-rows:auto minmax(0,1fr)}.treasury-window .tr-nav{display:flex;flex-wrap:wrap;padding:10px;border-right:0;border-bottom:1px solid var(--nuvile-border,#deded1);gap:4px}.treasury-window .tr-nav>small{display:none}.treasury-window .tr-nav button,.treasury-window .tr-nav>span{width:auto;margin:0;font-size:12px}.treasury-window .tr-shell>main{padding:16px}.treasury-window .tr-filters{grid-template-columns:1fr 1fr}.treasury-window .tr-filters label:first-child{grid-column:1/-1}.tr-detail-grid{grid-template-columns:1fr}.tr-tools>label{max-width:none;flex-basis:100%}}
.sales-window.treasury-window{font:14px/1.5 "Segoe UI",sans-serif;color:var(--nuvile-primary-hover,#243e49)}.treasury-window>.window-title{display:flex;align-items:center;gap:12px;min-height:52px;padding:10px 20px;background:var(--nuvile-primary,#214c59);color:white}.treasury-window>.window-title strong{font-size:17px}.treasury-window>.window-title [data-window-help]{margin-left:auto}.treasury-window>.window-title [data-close]{margin-left:0}.treasury-window .tr-shell>main{display:block;max-width:none;margin:0}.treasury-window input,.treasury-window select,.treasury-window textarea{margin:0;border:1px solid var(--nuvile-border,#deded1);border-radius:6px;background:var(--nuvile-paper,#fffef8)}.treasury-window .tr-tools label,.treasury-window .tr-filters label{margin:0}.treasury-window .tr-grid td{font-size:12px}.treasury-window .tr-grid small{font-size:11px}
.treasury-window>.window-title{flex:0 0 52px;height:52px;min-height:52px}.treasury-window .tr-heading>[data-new]{display:inline-flex;visibility:visible;opacity:1;align-items:center;justify-content:center;background:#214c59;color:#fff}

/* Shared floating-window dimensions follow Facturación. */
.sales-window.treasury-window{inset:auto;width:min(1330px,calc(100vw - 32px));height:calc(100dvh - 60px);max-height:1000px;left:16px;top:16px}.treasury-window .tr-shell{display:block;overflow:auto}.treasury-window .tr-shell>main{padding:16px}.treasury-window .tr-create:not(dialog){width:100%;max-width:760px;margin:auto;border:0;box-shadow:none}.treasury-window .tr-create:not(dialog) form{padding:0}@container comprobante (max-width:700px){.treasury-window .tr-filters{grid-template-columns:1fr 1fr}.treasury-window .tr-detail-grid{grid-template-columns:1fr}}

.treasury-window .tr-grid td,.treasury-window .tr-grid th{padding:5px 8px}.treasury-window .tr-grid button{min-height:0;padding:0;border:0;background:transparent;line-height:1.25}.treasury-window .tr-grid tfoot td{padding:6px 8px}.treasury-window .tr-grid tfoot strong{margin-top:2px}.treasury-window [data-detail]{margin-top:10px;padding:12px}.treasury-window .tr-detail-grid{gap:12px}.treasury-window .tr-grid small{line-height:1.3}

.sales-window.treasury-close{width:min(1000px,calc(100vw - 32px));height:min(740px,calc(100dvh - 60px))}.treasury-close main>p{margin:8px 0 14px}.treasury-close .tr-detail-grid{grid-template-columns:repeat(3,minmax(0,1fr));margin:10px 0}.treasury-close [data-count]{display:grid;grid-template-columns:1fr 2fr;gap:10px;align-items:end}.treasury-close [data-count]>.tr-opening{grid-column:1;grid-row:2;margin:0;padding:8px 0}.treasury-close [data-count]>label:has(textarea){grid-column:2;grid-row:1/3}.treasury-close textarea{min-height:90px}.treasury-close [data-count]>button{justify-self:start}.treasury-close [data-review]{margin:12px 0;padding:10px;border:1px solid var(--nuvile-border)}.treasury-close [data-review] p{margin:8px 0}.treasury-close h3{margin:12px 0 8px}.treasury-close .tr-grid{max-height:200px}@media(max-width:650px){.treasury-close [data-count]{display:flex;flex-direction:column;align-items:stretch}.treasury-close .tr-detail-grid{grid-template-columns:1fr}}

.treasury-reconcile [data-values] .tr-filters{grid-template-columns:1fr 1fr;margin-bottom:12px}.treasury-reconcile [data-items] input{min-height:0;width:16px;height:16px}.treasury-reconcile .tr-grid{max-height:300px}.treasury-reconcile [data-review]{padding:12px;border:1px solid var(--nuvile-border);margin:12px 0}.treasury-reconcile [data-values]>button{margin:12px 0}.treasury-reconcile h3{margin:12px 0}

.tr-create .tr-types{display:flex;gap:3px;background:var(--nuvile-soft);padding:3px;border-radius:6px}.tr-create .tr-types button{flex:1;border:0;margin:0}.tr-create .tr-types [aria-pressed=true]{background:var(--nuvile-primary);color:white}.tr-create .tr-accounts{display:grid;gap:12px;padding:12px 0;border-block:1px solid var(--nuvile-border)}.tr-create .tr-amount{display:grid;grid-template-columns:1fr 1fr;align-items:center;padding:12px;background:var(--nuvile-soft);border-radius:6px}.tr-create .tr-amount input{text-align:right;font-weight:600}.tr-create form{gap:12px}.tr-create footer{align-items:center;padding:12px 0 0;margin:0}.tr-create footer button{min-height:36px;margin:0;padding:8px 14px}.tr-create textarea{min-height:60px}.tr-create .tr-account-description{color:var(--nuvile-muted)}.tr-create label[hidden],.tr-create .tr-types[hidden]{display:none}

.treasury-window .tr-create .tr-filters{grid-template-columns:1fr 1fr}

/* F3 follows the compact inline control used by Facturación. */
.treasury-window .tr-account,.tr-create .tr-account{display:flex;align-items:stretch;gap:0;min-width:0}
.treasury-window .tr-account>select,.tr-account>input{flex:1;width:0;min-width:0;border-radius:6px 0 0 6px}
.treasury-window .tr-account>button,.tr-create .tr-account>button{flex:0 0 32px;width:32px;min-width:32px;padding:0;margin:0;border-radius:0 6px 6px 0;white-space:nowrap;font:600 11px 'Segoe UI',sans-serif}
.treasury-window .tr-footer{align-items:center}.treasury-window .tr-footer .tr-actions{margin-left:auto}

/* Fixed window footer; the ledger scrolls independently. */
.treasury-ledger .tr-shell{overflow:hidden;display:flex;min-height:0;flex:1}
.treasury-ledger .tr-shell>main{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}
.treasury-ledger .tr-shell>main> :not(.tr-grid):not([data-detail]){flex-shrink:0}
.treasury-ledger .tr-grid{flex:1;min-height:65px;overflow:auto;max-height:none}
.treasury-ledger .tr-grid thead{position:sticky;top:0;z-index:1}
.treasury-ledger .tr-grid tfoot{position:sticky;bottom:0;background:var(--nuvile-paper)}
.treasury-ledger [data-detail]{flex:none;max-height:none;overflow:visible}
.treasury-ledger>.tr-footer{flex:none;margin:0;padding:12px 16px;background:var(--nuvile-paper);border-top:1px solid var(--nuvile-border)}
/* Transfer uses the full form surface and the same anchored action bar. */
.treasury-transfer .tr-shell{display:flex;overflow:hidden;min-height:0}
.treasury-transfer .tr-shell>main{display:flex;flex:1;overflow:hidden;padding:0;min-height:0}
.treasury-transfer .tr-create:not(dialog){display:flex;flex:1;width:100%;max-width:none;margin:0;min-height:0;background:transparent}
.treasury-transfer .tr-create>form{display:flex;flex-direction:column;flex:1;min-height:0;gap:0}
.treasury-transfer .tr-form-body{overflow:auto;flex:1;min-height:0;padding:16px;display:flex;flex-direction:column;gap:14px}
.treasury-transfer .tr-accounts{grid-template-columns:1fr 1fr;background:var(--nuvile-paper);padding:14px;border:1px solid var(--nuvile-border);border-radius:6px}
.treasury-transfer .tr-create form>footer{flex:none;border-top:1px solid var(--nuvile-border);padding:12px 16px;background:var(--nuvile-paper)}
.treasury-transfer .tr-amount{grid-template-columns:1fr minmax(160px,30%)}
@media(max-width:650px){.treasury-transfer .tr-accounts{grid-template-columns:1fr}.treasury-ledger .tr-heading{margin-bottom:8px}.treasury-ledger .tr-opening{padding:6px 0}.treasury-ledger .tr-tools{margin:6px 0}}

/* Invoice-standard grouped data panels. */
.treasury-ledger .tr-heading{margin-bottom:8px;font-size:12px}
.treasury-ledger .tr-filters,.treasury-ledger .tr-opening,.treasury-transfer .tr-filters{border:1px solid var(--nuvile-border,#deded1);border-radius:6px;background:var(--nuvile-soft,#f6f1e5);padding:10px;gap:10px}
.treasury-ledger .tr-grid{border:1px solid var(--nuvile-border,#deded1)}
.treasury-ledger .tr-grid th,.treasury-ledger .tr-grid td{border-right:1px solid var(--nuvile-border,#deded1)}
.treasury-window .lookup-results{position:relative;max-height:180px;overflow:auto}.treasury-window .lookup-results button{display:block;text-align:left;width:100%;border:0}

/* Same semantic palette as Facturación; no treasury-specific surface colors. */
.sales-window.treasury-window,.treasury-window .tr-shell,.treasury-window .tr-shell>main{background:var(--nv-document-background)}
.treasury-window .tr-filters,.treasury-window .tr-opening,.treasury-window [data-detail],.treasury-window .tr-accounts,.treasury-window .tr-amount{background:var(--nv-document-panel);border-color:var(--nv-document-border)}
.treasury-window .tr-grid{background:var(--nv-document-grid);border-color:var(--nv-document-border)}
.treasury-window .tr-grid th{background:var(--nv-document-heading)}
.treasury-window .tr-grid tr.selected,.treasury-window .tr-grid tfoot,.treasury-window .tr-grid tfoot td,.treasury-window .tr-grid tfoot th{background:var(--nv-document-panel)}
.treasury-window>.tr-footer,.treasury-transfer .tr-create form>footer{background:var(--nv-document-background)}
.treasury-window .tr-grid tbody td{white-space:nowrap;padding:4px 8px;line-height:20px}
.treasury-window .tr-grid tbody td small{display:inline;font:inherit;color:inherit;line-height:inherit}
.treasury-window .tr-grid tbody td small:not(:empty)::before{content:' · ';white-space:pre}
.treasury-window .tr-grid tbody button{line-height:20px;vertical-align:baseline}

/* Selected movement is a compact, fully visible summary, not a nested scroller. */
.treasury-ledger [data-detail]{padding:8px 10px;margin-top:8px}
.treasury-ledger .tr-detail-head{margin-bottom:6px}
.treasury-ledger .tr-detail-head>div{display:flex;align-items:baseline;gap:8px}
.treasury-ledger .tr-detail-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:6px}
.treasury-ledger .tr-detail-grid strong{margin-top:0;overflow-wrap:anywhere}
.treasury-ledger [data-detail]>small{background:transparent;padding:0;margin:4px 0}
.treasury-ledger [data-detail]>p{margin:4px 0;overflow-wrap:anywhere}
.treasury-ledger [data-detail]>button{min-height:28px;padding:3px 9px}
/* Small windows scroll the content surface while keeping the action bar fixed. */
.treasury-ledger .tr-shell>main{overflow:auto}
@container comprobante (max-width:600px){.treasury-ledger .tr-shell>main{overflow:auto}.treasury-ledger .tr-grid{flex:1 0 120px;max-height:260px}.treasury-ledger .tr-detail-grid{grid-template-columns:1fr}.treasury-ledger .tr-detail-head{flex-wrap:wrap}}

.treasury-ledger .tr-grid tbody tr[tabindex]{cursor:pointer}.treasury-ledger .tr-grid tbody tr[tabindex]:hover{background:var(--nv-document-panel)}.treasury-ledger .tr-grid tbody tr[tabindex]:focus-visible{outline:2px solid var(--nuvile-primary);outline-offset:-2px}
.tr-create .tr-accounts{display:grid;grid-template-columns:1fr;gap:10px;min-height:0;flex:none}
.tr-create .nv-catalog-results:empty{display:none}
.treasury-window .nv-catalog-field>.nv-catalog-results{position:absolute;top:100%;left:0;right:0}
.tr-create .tr-accounts label{min-height:0;height:auto}
.tr-instrument-side{display:flex;gap:8px;align-items:end}.tr-instrument-side label{flex:1;min-width:0}
.tr-instrument-config{margin:8px 0}.tr-instrument-config p{font-size:12px;margin:5px 0}
.tr-instrument-picker{width:min(760px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:0}
.tr-instrument-picker[open]{display:flex;flex-direction:column;overflow:hidden}
.tr-instrument-picker .confirmation-content{min-height:0;overflow:auto;padding:12px}
.tr-instrument-picker table{width:100%;border-collapse:collapse;font-size:12px}.tr-instrument-picker td,.tr-instrument-picker th{padding:6px;text-align:left;border-bottom:1px solid var(--nuvile-soft)}
.tr-instrument-picker footer{display:flex;flex-direction:row;justify-content:space-between;padding:12px;flex:none}.tr-instrument-picker footer button{width:auto;margin:0}
.tr-instrument-picker [data-id]:hover{background:var(--nv-document-panel)}
