.toolbar #invoiceViewOpen{background:#ffedd5;border-color:#f0ad61;color:#8a430b;font-weight:800}
.toolbar #invoiceViewOpen:hover{background:#fed7aa}
body.invoice-view-open{overflow:hidden}
.invoice-viewer[hidden]{display:none!important}
.invoice-viewer{position:fixed;inset:0;z-index:1000;background:#f5efe8;color:#2c1d13;font:16px/1.45 'Segoe UI',Arial,sans-serif}
.invoice-viewer *{box-sizing:border-box}
.invoice-shell{height:100%;display:flex;flex-direction:column;max-width:1650px;margin:auto;background:#fff8f0;box-shadow:0 0 40px #321d0a40}
.invoice-header{flex:none;display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:76px;padding:12px 22px;background:#24180e;color:#fff}
.invoice-header small{display:block;color:#e7c8a6;font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
.invoice-header h2{font-size:23px;line-height:1.15;margin:3px 0 0}
.invoice-header button,.invoice-detail-toolbar button{border:1px solid #d3b798;border-radius:10px;background:#fff;color:#8a430b;padding:10px 16px;font:inherit;font-weight:800;cursor:pointer}
.invoice-layout{min-height:0;flex:1;display:grid;grid-template-columns:minmax(320px,400px) minmax(0,1fr)}
.invoice-list-pane,.invoice-detail-pane{min-height:0;overflow:auto;overscroll-behavior:contain}
.invoice-list-pane{background:#fff3e4;border-right:1px solid #e8d3bc}
.invoice-filters{position:sticky;top:0;z-index:1;display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:16px;background:#fff3e4;border-bottom:1px solid #e8d3bc}
.invoice-filters label{display:grid;gap:5px;min-width:0;color:#694326;font-size:13px;font-weight:800}
.invoice-filters label:first-child,.invoice-search-label{grid-column:1/-1}
.invoice-filters select,.invoice-filters input{width:100%;min-width:0;height:45px;padding:0 11px;border:1px solid #c49b72;border-radius:10px;background:#fff;color:#2c1d13;font:inherit;font-size:15px}
.invoice-filters :focus-visible,.invoice-viewer button:focus-visible{outline:3px solid #d97706;outline-offset:2px}
.invoice-week-total{display:flex;flex-wrap:wrap;justify-content:space-between;gap:5px 12px;padding:12px 16px;background:#ffedd5;color:#8a430b;font-size:14px}
.invoice-week-total b{font-size:17px}
.invoice-orders{display:grid;align-content:start;gap:10px;padding:12px}
.invoice-order-card{display:grid;gap:6px;width:100%;min-height:135px;padding:15px;border:2px solid #e8c9a7;border-radius:14px;background:#fff;color:#2c1d13;text-align:left;font:inherit;cursor:pointer;box-shadow:0 3px 9px #321d0a0a}
.invoice-order-card:hover,.invoice-order-card.is-selected{border-color:#c56f16;background:#fffaf5}
.invoice-order-number{color:#a85410;font-weight:900;font-size:14px}
.invoice-order-card>strong{font-size:19px;line-height:1.2;overflow-wrap:anywhere}
.invoice-order-sub{font-size:13px;color:#795b43}
.invoice-order-bottom{display:flex;justify-content:space-between;align-items:baseline;gap:12px;border-top:1px solid #eedbc7;padding-top:8px;font-size:14px}
.invoice-order-bottom b{font-size:20px;color:#874008}
.invoice-detail-pane{background:#fffaf5}
.invoice-detail-toolbar{position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 18px;background:#fff2e2;border-bottom:1px solid #e8d3bc}
.invoice-detail-toolbar>div{display:flex;gap:8px}
.invoice-detail-toolbar button{padding:8px 12px;font-size:14px}
.invoice-detail-toolbar button:disabled{opacity:.45;cursor:default}
#invoiceBack{display:none}
.invoice-detail{max-width:1000px;margin:auto;padding:24px}
.invoice-placeholder,.invoice-empty{padding:35px 18px;color:#795b43;text-align:center;font-size:16px}
.invoice-detail-heading{padding:18px 20px;border-radius:16px;background:#8a430b;color:#fff}
.invoice-detail-heading>span{display:inline-block;padding:4px 9px;border-radius:7px;background:#ffedd5;color:#8a430b;font-size:14px;font-weight:900}
.invoice-detail-heading h3{margin:10px 0 5px;font-size:26px;line-height:1.18;overflow-wrap:anywhere}
.invoice-detail-heading small{color:#f2d7b9}
.invoice-customer{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1px;margin:14px 0;background:#ecd6bd;border:1px solid #ecd6bd;border-radius:12px;overflow:hidden}
.invoice-field{display:grid;gap:3px;min-width:0;padding:12px 14px;background:#fff}
.invoice-field span{font-size:12px;color:#795b43;font-weight:800;text-transform:uppercase}
.invoice-field strong{font-size:16px;overflow-wrap:anywhere}
.invoice-section-title{display:flex;justify-content:space-between;align-items:center;margin:24px 0 12px;font-size:19px}
.invoice-section-title span{display:grid;place-items:center;width:29px;height:29px;border-radius:50%;background:#ffedd5;color:#8a430b;font-size:15px}
.invoice-item-list{display:grid;gap:12px}
.invoice-item{border:1px solid #e7ceb1;border-radius:14px;background:#fff;overflow:hidden;box-shadow:0 3px 10px #321d0a08}
.invoice-item-title{display:flex;align-items:flex-start;gap:10px;padding:14px 15px}
.invoice-item-title>span{flex:none;display:grid;place-items:center;width:27px;height:27px;border-radius:8px;background:#ffedd5;color:#8a430b;font-weight:900}
.invoice-item-title strong{font-size:18px;line-height:1.3;overflow-wrap:anywhere}
.invoice-variations{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1px;background:#f0ddc7;border-top:1px solid #efdfce;border-bottom:1px solid #efdfce}
.invoice-variations>div{display:flex;justify-content:space-between;gap:8px;padding:9px 12px;background:#fffaf5;font-size:14px}
.invoice-variations>div>span{overflow-wrap:anywhere}
.invoice-variations strong{white-space:nowrap}
.invoice-item-values{display:flex;flex-wrap:wrap;justify-content:space-between;gap:6px 12px;padding:11px 15px;font-size:14px;color:#765031}
.invoice-item-values strong{font-size:17px;color:#8a430b}
.invoice-calculation{margin-top:16px;border:1px solid #d9b58c;border-radius:14px;overflow:hidden;background:#fff}
.invoice-calculation>div{display:flex;justify-content:space-between;gap:12px;padding:10px 15px;border-bottom:1px solid #eddbc7}
.invoice-calculation>div:last-child{border-bottom:0}
.invoice-calculation strong{white-space:nowrap}
.invoice-credit{color:#9f1239}
.invoice-calculation .invoice-grand-total{padding:15px;background:#ffedd5;color:#8a430b;font-size:19px;font-weight:900}
.invoice-notes{margin:16px 0;padding:16px;border:1px solid #e7ceb1;border-radius:12px;background:#fff}
.invoice-notes p{white-space:pre-wrap;overflow-wrap:anywhere;margin:8px 0 0}
@media(max-width:850px){
  .invoice-header{min-height:67px;padding:10px 14px}
  .invoice-header h2{font-size:20px}
  .invoice-header button{padding:9px 12px}
  .invoice-layout{display:block;position:relative}
  .invoice-list-pane,.invoice-detail-pane{height:100%;border:0}
  .invoice-viewer[data-screen="list"] .invoice-detail-pane{display:none}
  .invoice-viewer[data-screen="detail"] .invoice-list-pane{display:none}
  .invoice-filters{padding:12px}
  .invoice-orders{padding:10px}
  .invoice-detail-toolbar{padding:8px;gap:4px}
  .invoice-detail-toolbar>div{gap:4px}
  .invoice-detail-toolbar button{padding:8px 7px;font-size:12px;min-height:38px}
  #invoiceBack{display:inline-flex}
  .invoice-detail{padding:12px 10px 30px}
  .invoice-detail-heading h3{font-size:23px}
  .invoice-customer{grid-template-columns:1fr 1fr}
  .invoice-variations{grid-template-columns:1fr}
  .invoice-item-values{display:grid;grid-template-columns:1fr 1fr}
  .invoice-item-values span:last-child{grid-column:1/-1;display:flex;justify-content:space-between;border-top:1px solid #efdfce;padding-top:8px}
}
@media(max-width:420px){.invoice-customer{grid-template-columns:1fr}.invoice-header small{font-size:10px}.invoice-detail-toolbar button{font-size:11px}}

.invoice-shell{height:100dvh}.invoice-filters input,.invoice-filters select{font-size:16px}.invoice-order-bottom,.invoice-calculation>div{flex-wrap:wrap}.invoice-item-title strong,.invoice-variations>div>span{min-width:0}.invoice-customer:empty{display:none}
