.purchases-window{display:flex;flex-direction:column;top:10px;left:12px;width:calc(100vw - 24px);height:calc(100dvh - 58px);max-width:1500px;max-height:none;font-family:"Segoe UI",Arial,sans-serif}.purchases-window.maximized{top:0;left:0;width:100vw;height:calc(100dvh - 42px);max-width:none}.purchases-window button,.purchases-window input,.purchases-window select,.purchases-window textarea{font-family:inherit}.purchases-content{display:flex;flex-direction:column;flex:1;min-height:0;padding:10px 12px;background:var(--nuvile-paper)}.purchases-content form{display:flex;flex-direction:column;gap:7px;flex:1;min-height:0;margin:0}.purchases-content section{border:1px solid var(--nuvile-soft);border-radius:4px;background:var(--nuvile-paper);padding:8px 12px}.purchases-content label{font-size:11px;margin:0}.purchases-content input,.purchases-content select{height:30px;font-size:12px;padding:4px 8px;min-width:0}.purchases-content button{width:auto;font-size:12px;padding:6px 12px;margin:0}.purchase-supplier{display:flex;align-items:center;gap:26px;flex:none}.purchase-supplier>div:first-child{width:315px;position:relative;flex-shrink:0}.purchase-search{display:flex;gap:7px}.purchase-search input{flex:1;width:100%;min-width:0}.purchase-search button{flex:none;white-space:nowrap}.purchase-supplier [data-supplier-info]{display:flex;flex-direction:column;gap:3px}.purchase-supplier strong{font-size:22px;color:#182333}.purchase-supplier span{font-size:12px}.purchase-supplier small{font-size:11px;color:#687069}.purchases-content .purchase-link{border:0;background:transparent;text-decoration:underline;font-size:10px;padding:3px 0}.purchase-supplier .lookup-results{position:absolute;top:46px;width:min(660px,80vw);z-index:100;max-height:230px;overflow:auto}.purchase-header{display:flex;gap:12px;flex:none}.purchase-header label{flex:1;min-width:0}.purchase-header label:first-child{flex:2}.purchase-header label:has([name=letra]){flex:.5}.purchase-condition{display:flex;gap:12px;align-items:end;flex:none}.purchase-condition label{width:170px}.purchase-condition label:has([name=deposito]){width:270px}.purchase-condition>button{margin-left:auto;height:34px}.purchase-detail{display:flex;flex-direction:column;flex:1;min-height:150px;gap:6px}.purchase-tools{display:flex;align-items:center;justify-content:space-between;flex:none;font-size:13px;min-height:25px}.purchase-grid{position:relative;flex:1;min-height:0;overflow:auto;border:1px solid var(--nuvile-border);background:var(--nuvile-paper)}.purchase-grid table{width:100%;border-collapse:collapse;font-size:12px}.purchase-grid th{background:var(--nuvile-soft);white-space:nowrap;font-size:11px;letter-spacing:0;padding:7px 8px;text-align:left;position:sticky;top:26px;z-index:1}.purchase-grid td{border:1px solid var(--nuvile-soft);padding:2px 5px;max-width:380px;overflow:hidden;text-overflow:ellipsis}.purchase-grid td input{width:100%;border:0;background:transparent;font-size:12px;height:27px}.purchase-grid td input[type=number]{text-align:right;min-width:64px}.purchase-grid td input[type=checkbox]{width:17px;height:17px}.purchase-grid th[data-column-key=producto]{width:165px}.purchase-grid th[data-column-key=descripcion]{width:32%}.purchase-grid th[data-column-key=total]{width:120px}.purchase-grid td:has([data-remove]){width:30px}.purchase-grid [data-remove]{border:0;background:transparent;padding:2px 5px;color:#617466}.purchase-grid .purchase-search{gap:0}.purchase-grid .purchase-search button{border:0;border-left:1px solid var(--nuvile-border);padding:3px 6px;font-size:10px;border-radius:0}.purchase-account{display:flex}.purchase-account input{min-width:65px}.purchase-account button{border:0;padding:2px 5px}.purchase-grid [data-line-total],.purchase-grid .num{text-align:right;white-space:nowrap}.purchase-detail>small{font-size:10px;color:var(--nuvile-muted)}.purchase-article-results{position:sticky;bottom:0;left:0;max-height:180px;overflow:auto;background:var(--nuvile-paper);box-shadow:0 -2px 10px #65768020;z-index:4}.purchase-article-results button{display:block;text-align:left;width:100%;border:0;border-radius:0;border-bottom:1px solid var(--nuvile-soft);padding:10px}.purchase-article-results button:hover,.purchase-article-results button:focus{background:var(--nuvile-soft)}.purchase-bottom{display:flex;gap:20px;align-items:center;flex:none}.purchase-bottom>label{flex:1}.purchase-bottom textarea{height:43px;font-size:12px;resize:none}.purchase-bottom [data-totals]{min-width:340px;display:flex;flex-direction:column;gap:3px;font-size:11px}.purchase-bottom [data-totals]>span,.purchase-bottom [data-totals]>strong{display:flex;justify-content:space-between;gap:30px}.purchase-bottom [data-totals]>strong{font-size:18px;border-top:1px solid var(--nuvile-border);padding-top:4px}.purchase-actions{display:flex;align-items:center;justify-content:space-between;gap:8px;flex:none;padding:3px 0}.purchase-actions>div{display:flex;gap:7px}.purchase-actions button{height:36px;white-space:nowrap;border-radius:3px}.purchase-actions small{font-size:10px;color:var(--nuvile-muted)}.purchase-empty{padding:15px;font-size:13px}.purchases-modal .purchase-origin-tools{display:flex;gap:12px;align-items:end;margin-bottom:10px}.purchase-origin-tools label{flex:1}.purchase-origin-tools [type=checkbox]{width:16px;display:inline}.purchases-modal [data-results]{max-height:48dvh;overflow:auto}.purchases-modal td,.purchases-modal th{font-size:12px;letter-spacing:0}.purchases-modal .payment-detail{font-size:11px}.purchases-modal [hidden],.purchases-window [hidden]{display:none!important}.purchases-window .payment-list td{height:33px;padding:3px 10px}.purchases-window .payment-list input{height:27px}.purchases-window .payment-list{margin:0 0 8px;max-height:none}.purchases-window .payment-modal .payment-list{max-height:43dvh}.purchases-window .payment-list th{position:sticky;top:0}.purchases-window .payment-remainder{font-size:10px}.purchases-window .payment-amount{display:flex}.purchases-window .payment-amount input{min-width:75px}.purchases-content>.error{flex:none;font-size:12px;padding:7px;margin:0 0 5px}.purchases-window[aria-busy=true] .purchase-actions button{pointer-events:none;opacity:.65}
@media(max-height:760px){.purchases-content{padding:7px 10px}.purchases-content section{padding:5px 10px}.purchase-supplier strong{font-size:20px}.purchase-header input,.purchase-header select,.purchase-condition input,.purchase-condition select{height:28px}.purchase-bottom textarea{height:36px}.purchase-detail{min-height:110px}}
@media(max-width:850px){.purchases-content{overflow:auto}.purchases-content form{min-height:680px}.purchase-header{flex-wrap:wrap}.purchase-header label{min-width:110px}.purchase-condition{flex-wrap:wrap}.purchase-supplier{gap:12px}.purchase-supplier>div:first-child{width:260px}.purchase-supplier strong{font-size:18px}.purchase-actions{flex-wrap:wrap}.purchase-actions>div{flex-wrap:wrap;margin-left:auto}.purchase-bottom [data-totals]{min-width:220px}.purchase-grid table{min-width:850px}}
.purchase-tax-editor{display:flex;flex-direction:column;gap:12px;font:12px "Segoe UI",Arial,sans-serif}.purchase-tax-editor nav{display:flex;gap:6px;flex-wrap:wrap}.purchase-tax-editor button{width:auto;margin:0;font:inherit;padding:7px 12px}.purchase-tax-scroll{height:min(430px,55dvh);overflow:auto;padding:2px 4px}.purchase-tax-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 20px}.purchase-tax-editor label{font-size:12px}.purchase-tax-editor input,.purchase-tax-editor select{height:30px;padding:4px 7px;font:12px "Segoe UI",Arial,sans-serif}.purchase-tax-editor input[type=number]{text-align:right}.purchase-tax-editor .purchase-check{display:flex;align-items:center;gap:8px;margin-bottom:15px}.purchase-tax-editor .purchase-check input{width:16px;height:16px}.purchase-tax-editor table{width:100%;border-collapse:collapse;margin:8px 0}.purchase-tax-editor th{background:var(--nuvile-soft);text-align:left;padding:7px;font-size:11px}.purchase-tax-editor td{padding:4px;border-bottom:1px solid var(--nuvile-soft)}.purchase-tax-editor td input,.purchase-tax-editor td select{width:100%;min-width:70px}.purchase-tax-editor footer{display:flex;gap:8px;align-items:center;border-top:1px solid var(--nuvile-border);padding-top:12px}.purchase-tax-editor [data-tax-summary]{flex:1;font-size:11px}.purchase-tax-editor [data-tax-summary] strong{display:block;font-size:16px;margin-top:4px}.purchase-tax-note{font-size:11px;color:var(--nuvile-muted)}.purchase-tax-editor h3{font-size:14px;margin:12px 0}.purchase-tax-editor .error{margin:0;padding:6px}.purchase-tax-editor [readonly],.purchase-tax-editor [disabled]{background:var(--nuvile-soft)}.purchase-tax-editor [hidden]{display:none!important}
.purchases-window .payment-list th:first-child{width:40%}.purchases-window .payment-list th:nth-child(2){width:27%}.purchases-window .payment-list th:nth-child(3){width:28%}.purchases-window .payment-list th:last-child{width:5%}.purchases-window .payment-amount input{background:var(--nuvile-paper);border:1px solid var(--nuvile-border);border-radius:3px;max-width:210px}.purchases-window .payment-amount{gap:7px}.purchases-window .payment-remainder{padding:2px 4px;white-space:nowrap}

.purchases-modal:has(.purchase-tax-editor) .dialog-head{font-family:"Segoe UI",Arial,sans-serif;font-size:14px;padding:12px 18px;min-height:48px}.purchase-tax-editor [data-panel=tax]>label:has([data-field=descuento_general]){display:inline-block;width:175px;margin-right:20px}.purchase-tax-editor .purchase-check{display:inline-flex;margin-bottom:8px}.purchase-tax-editor p{margin:5px 0 10px}.purchase-tax-fields{gap:8px 18px}.purchase-tax-editor label{font-weight:400}.purchase-fiscal-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:7px 20px;margin:12px 0;font-size:12px}.purchase-fiscal-summary span{display:flex;justify-content:space-between;gap:10px}

.purchase-detail-actions{display:flex;gap:7px;align-items:center}.purchases-content .purchase-inline-taxes{flex:none;padding:6px 10px}.purchase-inline-fields{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px 10px}.purchase-inline-fields input{width:100%;height:27px;text-align:right}.purchase-inline-fields label{font-size:10px}.purchase-inline-taxes .purchase-tools{margin-bottom:4px}.purchase-inline-check{display:flex;gap:6px;align-items:center}.purchase-inline-check input{width:15px;height:15px}.purchase-inline-fields .purchase-tax-detail{display:flex;align-items:center;gap:4px;width:100%;height:27px;border:1px solid var(--nuvile-border);background:var(--nuvile-paper);padding:3px 7px;border-radius:3px;font-size:12px}.purchase-tax-detail span{flex:1;text-align:right}.purchase-tax-detail b{padding-left:4px;color:var(--nuvile-primary)}.purchase-inline-fields input:disabled{background:var(--nuvile-soft);color:var(--nuvile-muted);opacity:1}.purchase-journal-grid{max-height:45dvh;overflow:auto}.purchase-journal-grid table{width:100%;border-collapse:collapse}.purchase-journal-grid input{height:30px;width:100%;font:12px "Segoe UI";padding:4px 6px}.purchase-journal-grid th{background:var(--nuvile-soft);padding:6px}.purchase-journal-grid td{padding:3px}.purchase-journal-grid td:first-child{width:150px}.purchase-journal-grid input[type=number]{text-align:right;min-width:100px}.purchase-journal-actions{display:flex;gap:8px;justify-content:flex-end}.purchase-journal-actions button{width:auto}.purchases-modal .dialog-head{font-family:"Segoe UI",Arial,sans-serif}
@media(max-height:760px){.purchase-inline-fields{gap:3px 8px}.purchases-content .purchase-inline-taxes{padding:4px 8px}.purchase-inline-fields input,.purchase-inline-fields .purchase-tax-detail{height:25px}.purchases-content .purchase-detail{min-height:110px}}
@media(max-width:1000px){.purchase-inline-fields{grid-template-columns:repeat(4,minmax(0,1fr))}.purchase-detail-actions{flex-wrap:wrap}}

@media(min-width:1001px) and (max-height:760px){
 .purchases-content form{gap:5px}
 .purchases-content .purchase-supplier{padding-top:3px;padding-bottom:3px}
 .purchase-supplier [data-supplier-info]{gap:1px}
 .purchases-content .purchase-header,.purchases-content .purchase-condition{padding-top:3px;padding-bottom:3px}
 .purchase-header input,.purchase-header select,.purchase-condition input,.purchase-condition select{height:25px}
 .purchase-detail-actions button{height:28px;padding:3px 8px;font-size:11px}
 .purchases-content .purchase-detail{min-height:155px}
 .purchase-bottom textarea{height:28px}
 .purchase-bottom [data-totals]{gap:1px}
 .purchase-bottom [data-totals]>strong{font-size:16px;padding-top:2px}
 .purchase-actions button{height:32px}
}

.supplier-create{width:min(760px,94vw)}.supplier-create .confirmation-content{padding:18px;max-height:75vh;overflow:auto}.supplier-create-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px 16px}.supplier-create-grid label{display:flex;flex-direction:column;gap:5px}.supplier-create footer{display:flex;justify-content:flex-end;gap:10px;margin-top:18px}.supplier-create footer button{width:auto}.supplier-create-grid label:first-child{grid-column:1/-1}@media(max-width:600px){.supplier-create-grid{grid-template-columns:1fr}}

.purchases-window .purchase-account{align-items:center;gap:4px;min-width:0}.purchases-window .purchase-account input{flex:1 1 0;width:0;min-width:0}.purchases-window .purchase-account button{flex:0 0 36px;min-width:36px;width:36px;height:30px;white-space:nowrap;word-break:normal;padding:2px 5px;line-height:1}

.purchase-review-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:8px 3px;flex:none}.purchase-review-heading h2{margin:4px 0;font-size:20px}.purchase-review-heading>div:last-child{display:flex;gap:8px}.purchase-review-heading button{width:auto;white-space:nowrap}.purchase-review-heading small,.purchase-muted{color:var(--nuvile-muted);font-size:12px}.purchase-review-notice{flex:none;background:#eaf2e9;color:#294c38;padding:10px 14px;border-radius:5px;margin:8px 0;border-left:3px solid #52866a}.purchase-review-notice.blocked{background:#fff0da;color:#644619;border-color:#ae8950}.purchase-review-layout{display:grid;grid-template-columns:minmax(0,1fr);gap:16px;flex:1;min-height:0;overflow:auto}.purchase-review-layout.with-files{grid-template-columns:minmax(0,1fr) 285px}.purchase-review-main{display:flex;flex-direction:column;gap:8px;min-width:0}.purchase-review-main .purchase-detail{min-height:230px}.purchase-review-main :disabled{opacity:1;color:var(--nuvile-ink);cursor:default}.purchase-review-main button:disabled{opacity:.45}.purchase-review-tabs{display:flex;gap:14px;margin:5px 0;flex:none}.purchase-review-tabs button{width:auto}.purchase-review-attachments{background:var(--nuvile-paper);border:1px solid var(--nuvile-border);border-radius:8px;padding:12px;min-width:0;align-self:start}.purchase-review-attachments h3{font-size:14px;margin:0}.purchase-review-attachments button{width:auto}.purchase-file-row{padding:10px 0;border-bottom:1px solid var(--nuvile-border)}.purchase-file-row button{display:block;text-align:left;white-space:normal;overflow-wrap:anywhere;width:100%}.purchase-file-row a{font-size:12px}.purchase-review-attachments img{max-width:100%;margin:12px 0}.purchase-review-attachments iframe{width:100%;height:380px;border:0;margin:12px 0}.purchase-review-filters{display:grid;grid-template-columns:2fr 1fr 1fr 1fr;gap:12px;align-items:end}.purchase-review-filters label{display:flex;flex-direction:column;gap:4px}.purchase-review-pagination{display:flex;justify-content:flex-end;align-items:center;gap:14px;margin-top:18px}.purchase-review-pagination button{width:auto;min-width:90px}.purchase-review-references{padding:16px}.purchases-window .purchase-review-main [hidden]{display:none!important}@media(max-width:1000px){.purchase-review-layout.with-files{grid-template-columns:minmax(0,1fr)}.purchase-review-filters{grid-template-columns:1fr 1fr}.purchase-review-heading{flex-wrap:wrap}}@media(max-width:600px){.purchase-review-filters{grid-template-columns:1fr}}

.purchases-window .purchase-review-attachments{color:var(--nuvile-ink);width:auto;display:block}.purchase-review-heading button,.purchase-review-tabs button,.purchase-review-attachments button,.purchase-review-pagination button,.purchase-actions [data-review-print],.purchase-actions [data-review-new],.purchase-actions [data-review-cancel]{background:var(--nuvile-paper);color:var(--nuvile-ink);border:1px solid var(--nuvile-border);border-radius:5px;padding:8px 12px;font:13px Segoe UI,Arial,sans-serif}.purchase-review-attachments a{color:var(--nuvile-primary)}.purchase-review-main .purchase-detail,.purchase-review-main .purchase-bottom,.purchase-review-main .purchase-inline-taxes{flex-shrink:0}.purchase-review-main .purchase-grid{min-height:170px}

.purchase-review-main .purchase-grid table:not(:has(.grid-tools)) th{top:0}
/* La grilla de compras reutiliza .edit-table de Facturación. */
.sales-window.purchases-window{max-width:1330px}
.sales-window .purchase-grid.edit-table{margin:0;flex:1;min-height:120px}
.sales-window .purchase-grid.edit-table table{min-width:1000px}
.sales-window .purchase-grid.edit-table td:nth-child(2) input{text-align:left}
.sales-window .purchase-grid.edit-table th[data-column-key=producto]{width:150px}
.sales-window .purchase-grid.edit-table th[data-column-key=descripcion]{width:36%}
.sales-window .purchase-grid.edit-table .new-article-row td:first-child{padding:0}
.sales-window .purchase-grid.edit-table .purchase-search{align-items:center}
.sales-window .purchase-grid.edit-table .purchase-search button{height:30px;margin:0}
.purchase-article-results.nv-floating-lookup{position:fixed;bottom:auto;max-height:340px}
.purchases-modal.purchase-article-search table{min-width:1900px}
.purchases-modal.purchase-article-search td{white-space:normal;overflow-wrap:anywhere}
@container comprobante (max-width:700px){
 .purchases-content{overflow:auto}
 .purchases-content .purchase-actions{position:sticky;bottom:0;z-index:5;background:var(--nuvile-paper);border-top:1px solid var(--nuvile-border);padding:8px 0}
 .purchase-actions>div{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%}
 .purchase-actions button{white-space:normal;height:auto;min-height:36px}
}
.sales-window .purchase-grid.edit-table table:not(:has(.grid-tools)) th{top:0}
