.purchases {max-width:1380px;margin:auto}
.pur-layout {display:grid;grid-template-columns:minmax(220px,28%) minmax(0,1fr);gap:20px;align-items:start}
.pur-layout h2,.pur-dialog h2,.pur-dialog h3 {margin:0;letter-spacing:-.025em}
.pur-directory,.pur-invoices {min-width:0;padding:20px}
.pur-directory h2,.pur-invoices h2 {font-size:19px}
.pur-directory-toggle {display:none}
.pur-directory label {margin:16px 0 10px}
.pur-directory [data-directory] {max-height:60vh;overflow:auto}
.pur-all,.pur-vendor {width:100%;justify-content:flex-start;text-align:left}
.pur-all {background:#eff6f5;border:1px solid transparent;margin-bottom:5px;color:#19544e}
.pur-vendor {border:0;border-radius:8px;background:transparent;padding:11px 8px;gap:12px}
.pur-vendor[aria-pressed=true],.pur-all[aria-pressed=true] {background:#e4f3ef;box-shadow:inset 3px 0 #187866}
.pur-monogram,.pur-doc-icon {display:grid;place-items:center;background:#edf4f3;color:#20675d;border-radius:10px;flex:none;width:37px;height:40px}
.purchases small,.pur-dialog small {display:block;font-size:12px;font-weight:450;line-height:1.5;color:#50646c}
.purchases strong,.pur-dialog strong,.pur-ledger b {overflow-wrap:anywhere}
.pur-main {display:grid;gap:16px;min-width:0}
.pur-summary {background:#183e42;color:white;border-radius:16px;padding:22px 25px}
.pur-heading,.pur-heading>div,.pur-section,.pur-detail-head,.pur-line-head,.pur-ledger,.pur-dialog header,.pur-dialog footer {display:flex;align-items:center;justify-content:space-between;gap:12px}
.pur-heading>div {justify-content:flex-start;min-width:0}
.pur-heading h2 {font-size:22px;color:white;overflow-wrap:anywhere}
.pur-heading svg {color:#9cdbcf;flex:none}
.pur-heading button {background:transparent;border-color:#648b8b;color:white;font-size:13px}
.pur-contact {margin-top:6px;color:#c8dfdb;font-size:14px;overflow-wrap:anywhere}
.pur-summary dl {display:grid;grid-template-columns:1.4fr 1.3fr 1fr;margin:20px 0 0;padding-top:16px;border-top:1px solid #527477;gap:12px}
.pur-summary dl div+div {border-left:1px solid #527477;padding-left:14px}
.pur-summary dt {font-size:13px;color:#d2e3e2}
.pur-summary dd {margin:6px 0 0;font-size:clamp(18px,2vw,27px);font-weight:680;letter-spacing:-.035em;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.pur-summary dd small {display:inline;color:#d2e3e2}
.pur-details,.pur-extra {border:1px solid var(--border);border-radius:10px;background:white;padding:12px 15px}
.pur-details {margin-top:10px}
.pur-details summary,.pur-extra summary {cursor:pointer;font-weight:600}
.pur-details[open]>div {display:grid;grid-template-columns:auto 1fr;gap:7px 15px;font-size:14px;margin-top:12px;overflow-wrap:anywhere}
.pur-section {align-items:end}
.pur-section .pur-search {width:min(50%,260px)}
.pur-tabs {display:flex;gap:4px;flex-wrap:wrap;margin:15px 0 8px;border-bottom:1px solid var(--border)}
.pur-tabs button {border:0;border-radius:0;background:transparent;font-size:13px;padding:8px 10px}
.pur-tabs button[aria-pressed=true] {color:#18574e;box-shadow:inset 0 -3px #257768}
.pur-invoice {display:grid;grid-template-columns:auto minmax(0,1.25fr) minmax(105px,.9fr) minmax(80px,.8fr);width:100%;gap:12px;padding:14px 3px;border:0;border-bottom:1px solid var(--border);border-radius:0;text-align:left}
.pur-invoice:hover {background:#f6faf9}
.pur-amount {text-align:right;overflow-wrap:anywhere}
.pur-tag {display:inline-block;border-radius:6px;padding:3px 8px;font-size:12px;white-space:nowrap}
.pur-tag.pending {background:#fff1d7;color:#784800}
.pur-tag.done {background:#dff4e9;color:#165637}
.pur-empty {text-align:center;color:#496269;padding:35px 8px}
.pur-empty p {font-size:14px;margin:6px 0}
.pur-dialog {width:min(760px,calc(100vw - 24px));max-height:90vh;max-height:90dvh;padding:0;border:1px solid var(--border);border-radius:15px;color:var(--text);box-shadow:0 15px 65px #173a4133}
.pur-dialog::backdrop {background:#122e3580}
.pur-dialog>form {display:flex;flex-direction:column;max-height:89vh;max-height:89dvh;gap:0;margin:0}
.pur-dialog header,.pur-dialog footer {padding:13px 20px;background:white;color:var(--text);border:0;flex:none}
.pur-dialog header {border-bottom:1px solid var(--border)}
.pur-dialog header button {font-size:24px;line-height:1;padding:2px 10px}
.pur-dialog h2 {font-size:21px}
.pur-dialog h3 {font-size:16px}
.pur-dialog footer {border-top:1px solid var(--border);justify-content:flex-end}
.pur-body {padding:17px 20px;overflow:auto;min-height:0;overscroll-behavior:contain}
.pur-body>h3 {margin:20px 0 9px}
.pur-fields,.pur-line,.pur-extra[open] {display:grid;gap:12px}
.pur-dialog label,.purchases label {min-width:0}
.pur-dialog input,.pur-dialog select,.pur-dialog textarea {width:100%;min-width:0}
.pur-lookup,.pur-figures {display:grid;gap:10px;grid-template-columns:1fr 1.3fr}
.pur-figures {grid-template-columns:repeat(4,minmax(0,1fr))}
.pur-line {min-width:0;margin:0 0 10px;padding:12px;border:1px solid #c6d9d5;border-radius:10px;background:#f6faf9}
.pur-line legend {padding:0 6px;color:#29544e;font-weight:650}
.pur-line-head label {font-size:13px}
.pur-line-head button,.pur-extra button {font-size:13px}
.pur-subtotal {display:flex;justify-content:flex-end;gap:12px;font-size:13px}
.pur-subtotal output {font-weight:700}
.pur-totals {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;padding:14px;background:#eaf4f1;border-radius:10px}
.pur-totals span {font-size:12px;color:#3e625a}
.pur-totals b {display:block;color:#163e37;font-size:16px;overflow-wrap:anywhere}
.pur-dialog label.pur-check {display:flex;align-items:center;flex-direction:row;gap:8px}
.pur-dialog .pur-check input {width:18px;height:18px}
.pur-error {color:#8b3027;font-size:14px;margin-right:auto}
.pur-detail-head,.pur-ledger {padding:6px 0 12px}
.pur-detail-head {align-items:start}
.pur-ledger {border-bottom:1px solid var(--border);font-size:14px;margin:8px 0;overflow-wrap:anywhere}
.pur-ledger>b {text-align:right}
.pur-file {display:block;margin:8px 0;overflow-wrap:anywhere}
.pur-body>.pur-extra {margin-top:14px}
@media(max-width:780px){
 .pur-layout {grid-template-columns:minmax(180px,30%) minmax(0,1fr);gap:10px}
 .pur-directory,.pur-invoices,.pur-summary {padding:14px}
 .pur-doc-icon {display:none}
 .pur-invoice {grid-template-columns:minmax(0,1fr) auto}
 .pur-invoice>.pur-amount {grid-column:2;grid-row:1}
 .pur-summary dl {gap:6px}.pur-summary dl div+div {padding-left:8px}
}
@media(max-width:600px){
 .pur-directory h2 {display:none}.pur-directory-toggle {display:flex;width:100%;justify-content:space-between}
 .pur-directory-toggle::after {content:'⌄'}.pur-directory-toggle[aria-expanded=true]::after {content:'⌃'}
 .pur-directory-toggle[aria-expanded=false]+div {display:none}
 .pur-layout {grid-template-columns:minmax(0,1fr)}.pur-directory [data-directory] {max-height:140px}
 .pur-section,.pur-heading {flex-wrap:wrap}.pur-section .pur-search {width:100%}
 .pur-summary dl {grid-template-columns:1fr 1fr}.pur-summary dl div:last-child {grid-column:1/-1;border:0;padding:0}
 .pur-dialog {width:calc(100% - 12px)}.pur-dialog header,.pur-dialog footer,.pur-body {padding:12px}
 .pur-totals,.pur-figures {grid-template-columns:repeat(2,minmax(0,1fr))}
 .pur-lookup,.pur-dialog .two {grid-template-columns:minmax(0,1fr)}
 .pur-dialog footer {flex-wrap:wrap}.pur-error:empty {display:none}
 .pur-details[open]>div {grid-template-columns:1fr}.pur-invoice {font-size:14px}
}
