#panelInvoices{padding:clamp(16px,3vw,38px);color:#19334e}
#panelInvoices .inv-heading,#panelInvoices .inv-actions{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:.6rem}
#panelInvoices .inv-actions{justify-content:flex-start;margin:.7rem 0}
#panelInvoices h2,#panelInvoices h3,#panelInvoices h4{margin:0 0 .5rem}
#panelInvoices .inv-layout{display:grid;grid-template-columns:minmax(200px,1fr) minmax(0,2.5fr);gap:1rem;align-items:start}
#panelInvoices .inv-list{display:grid;gap:.5rem}
#panelInvoices .inv-view:not(:empty),#panelInvoices .inv-card{background:#fff;border:1px solid #cfdce8;border-radius:.65rem;padding:1rem}
#panelInvoices button,#panelInvoices .inv-actions a{cursor:pointer;font:inherit;font-weight:600;border:1px solid #becfe1;border-radius:.4rem;background:white;padding:.45rem .75rem;color:#183953;text-decoration:none}
#panelInvoices button:disabled{opacity:.6;cursor:wait}
#panelInvoices .inv-primary{background:#185bc0;border-color:#185bc0;color:#fff}
#panelInvoices .inv-whatsapp{background:#096544;color:white;border-color:#096544}
#panelInvoices .inv-card{display:flex;width:100%;gap:.5rem;justify-content:space-between;text-align:left;align-items:center;flex-wrap:wrap}
#panelInvoices .inv-badge{background:#edf1f7;color:#364863;border-radius:1rem;padding:.2rem .6rem}
#panelInvoices .inv-paid{background:#dcf5e6;color:#135332}
#panelInvoices .inv-overdue{background:#ffebde;color:#8b3713}
#panelInvoices .inv-unpaid{background:#e4efff;color:#195485}
#panelInvoices .inv-fields,#panelInvoices .inv-line{display:grid;gap:.65rem;grid-template-columns:repeat(2,minmax(0,1fr));margin:.65rem 0}
#panelInvoices label{display:grid;gap:.25rem;font-size:.87rem}
#panelInvoices input,#panelInvoices textarea{width:100%;max-width:100%;min-width:0;padding:.55rem;border:1px solid #b9cbdc;border-radius:.3rem;font:inherit}
#panelInvoices .inv-line{grid-template-columns:2fr 1fr 1fr auto;align-items:end;border-bottom:1px solid #dae4ee;padding:.6rem 0}
#panelInvoices .inv-notice{min-height:1.35em}
#panelInvoices .inv-catalog{display:flex;gap:.4rem;flex-wrap:wrap}
#panelInvoices table{width:100%;border-collapse:collapse;margin:1rem 0}
#panelInvoices th,#panelInvoices td{text-align:right;padding:.45rem;border-bottom:1px solid #d9e2ed;overflow-wrap:anywhere}
#panelInvoices th:first-child,#panelInvoices td:first-child{text-align:left}
#panelInvoices :focus-visible{outline:3px solid #1768b3;outline-offset:2px}
@media(max-width:760px){#panelInvoices .inv-layout{grid-template-columns:1fr}#panelInvoices .inv-line{grid-template-columns:1fr 1fr}#panelInvoices .inv-line label:first-child{grid-column:1/-1}}
@media(max-width:420px){#panelInvoices .inv-fields{grid-template-columns:1fr}}

#panelInvoices .inv-dialog{position:fixed;inset:0;width:min(28rem,calc(100% - 2rem));max-height:calc(100dvh - 2rem);overflow:auto;padding:0;margin:auto;border:1px solid #b8cce1;border-radius:16px;background:white;color:#142d49;box-shadow:0 18px 70px #11264347;font:inherit}
#panelInvoices .inv-dialog::backdrop{background:rgb(12 32 52 / 46%)}
#panelInvoices .inv-dialog-body{padding:1.45rem 1.45rem 1rem;border-top:4px solid #2057a0}
#panelInvoices .inv-dialog h3{font-size:1.28rem;line-height:1.3}
#panelInvoices .inv-dialog p{line-height:1.5;margin:.5rem 0}
#panelInvoices .inv-dialog dl{display:grid;grid-template-columns:auto minmax(0,1fr);gap:.5rem .9rem;margin:.9rem 0 0;padding:.85rem;background:#f2f6fb;border-radius:8px}
#panelInvoices .inv-dialog dt{color:#4b627b}
#panelInvoices .inv-dialog dd{margin:0;font-weight:600;overflow-wrap:anywhere}
#panelInvoices .inv-dialog-actions{display:flex;gap:.65rem;justify-content:flex-end;padding:1rem 1.45rem;background:#f7f9fc;border-top:1px solid #dae4ef}
#panelInvoices .inv-dialog button{min-height:40px}
#panelInvoices .inv-danger{background:#9a2834;color:white;border-color:#9a2834}
#panelInvoices .inv-actions a.inv-whatsapp{color:white;background:#086044;border-color:#086044}
#panelInvoices .inv-logo-picker{display:flex;flex-wrap:wrap;gap:.6rem;align-items:center;margin:.8rem 0}
#panelInvoices .inv-logo-picker input{width:auto;max-width:100%;font-size:.8rem}
#panelInvoices .inv-logo-picker img{max-width:112px;max-height:54px;object-fit:contain}
#panelInvoices .inv-logo-edit{margin-top:1rem;border-top:1px solid #cfdce8;padding:.7rem 0}
#panelInvoices .inv-channel-note,#panelInvoices .inv-email-status{font-size:.86rem;color:#40566f}

#panelInvoices .inv-seller-logo{display:block;max-width:125px;max-height:60px;object-fit:contain;margin:0 0 .75rem}
#ownerBusinessNavigation .rail-icon svg{display:block;flex:none}
#ownerBusinessNavigation .rail-tab[data-owner-panel="invoices"][hidden]{display:none!important}

/* Invoice history fills the panel until an invoice opens to its left on wide screens. */
#panelInvoices .inv-overview {
  --invoice-border: #d8dfec;
  background: linear-gradient(115deg,#faf8ff,#f8fafe 65%,#f5f9fc);
  border: 1px solid var(--invoice-border);
  border-radius: 14px;
  padding: clamp(14px,1.8vw,24px);
  margin-top: 1.2rem;
}
#panelInvoices .inv-overview h3, #panelInvoices .inv-feed-bar h3 {font-size:1.1rem;margin:0}
#panelInvoices .inv-period {color:#4e6076;font-size:.85rem;margin:.35rem 0 1rem}
#panelInvoices .inv-metrics {display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px}
#panelInvoices button.inv-metric {
  --accent:#485cb0;
  display:flex;align-items:start;flex-direction:column;gap:.35rem;
  text-align:left;border:1px solid var(--invoice-border);border-top:3px solid var(--accent);
  background:#fff;border-radius:9px;padding:12px 14px;min-height:100px;
  box-shadow:0 2px 5px #172c4a08;
}
#panelInvoices .inv-metric[data-metric="draft"] {--accent:#714393}
#panelInvoices .inv-metric[data-metric="issued"] {--accent:#3c729d}
#panelInvoices .inv-metric[data-metric="sent"] {--accent:#23736c}
#panelInvoices .inv-metric[data-metric="pending"] {--accent:#99602d}
#panelInvoices .inv-metric[data-metric="paid"] {--accent:#2f7652}
#panelInvoices .inv-metric[aria-pressed="true"] {box-shadow:inset 0 0 0 1px var(--accent);background:#fcfbff}
#panelInvoices .inv-metric strong {font-size:clamp(1.35rem,2vw,1.9rem);line-height:1.06;letter-spacing:-.03em;font-variant-numeric:tabular-nums}
#panelInvoices .inv-metric-label {font-size:.85rem}
#panelInvoices .inv-metric small {font-size:.72rem;font-weight:500;color:#4c5c6e}
#panelInvoices .inv-tools {display:flex;align-items:end;flex-wrap:wrap;gap:.65rem 1rem;margin-top:1rem}
#panelInvoices .inv-tools label {color:#3c5169;min-width:0}
#panelInvoices .inv-tools input {box-sizing:border-box;min-height:38px;color:#233c53;background:white}
#panelInvoices .inv-tool-actions, #panelInvoices .inv-modes, #panelInvoices .inv-pages {display:flex;gap:.45rem;align-items:center;flex-wrap:wrap}
#panelInvoices .inv-notice:empty {min-height:0;margin:0}
#panelInvoices .inv-layout {grid-template-columns:minmax(0,1fr);margin-top:1.3rem;gap:1.2rem}
#panelInvoices .inv-view:empty {display:none}
#panelInvoices .inv-feed, #panelInvoices .inv-view {min-width:0}
#panelInvoices .inv-feed-bar {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:.7rem;margin-bottom:.75rem}
#panelInvoices .inv-modes {background:#f1f4fa;border:1px solid #dce3ee;border-radius:7px;padding:3px;gap:2px}
#panelInvoices .inv-modes button {background:transparent;border:1px solid transparent;padding:.35rem .8rem}
#panelInvoices .inv-modes button[aria-pressed="true"] {color:#532879;background:#fff;border-color:#d8c9e6;box-shadow:0 1px 3px #31204416}
#panelInvoices .inv-list {gap:.7rem}
#panelInvoices .inv-list[data-mode="grid"] {grid-template-columns:repeat(auto-fill,minmax(min(100%,245px),1fr))}
#panelInvoices button.inv-card {
  display:grid;grid-template-columns:minmax(0,1fr);justify-items:start;align-content:start;align-items:baseline;
  gap:.5rem;min-width:0;position:relative;text-align:left;padding:1rem 1.1rem;
  background:white;border:1px solid #d2deea;border-radius:10px;box-shadow:0 2px 5px #19395408;
}
#panelInvoices button.inv-card[data-kind="draft"] {border-color:#d9cde5;background:linear-gradient(120deg,#f9f5fc,#fff 68%)}
#panelInvoices button.inv-card:hover {border-color:#a08bb6;box-shadow:0 3px 10px #40246515}
#panelInvoices .inv-card-head {display:flex;align-items:center;justify-content:space-between;gap:.6rem;width:100%}
#panelInvoices .inv-card-ref {font-size:.8rem;font-weight:650;color:#58677c}
#panelInvoices .inv-badge {font-size:.76rem;line-height:1.35;white-space:nowrap}
#panelInvoices .inv-draft {background:#eee3f6;color:#622e7e}
#panelInvoices .inv-customer {overflow-wrap:anywhere;line-height:1.25;color:#172f47;font-size:1.02rem}
#panelInvoices .inv-amount {font-variant-numeric:tabular-nums;font-weight:700;color:#263b53}
#panelInvoices .inv-card-dates {display:flex;flex-wrap:wrap;gap:.2rem .85rem;font-size:.77rem;color:#51647b;font-weight:500}
#panelInvoices .inv-item-preview {display:flex;align-items:baseline;gap:.55rem;border-top:1px solid #e6dfed;padding-top:.55rem;width:100%;color:#51465b;font-size:.81rem;font-weight:500}
#panelInvoices .inv-item-preview b {white-space:nowrap}
#panelInvoices .inv-item-preview span {overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
#panelInvoices .inv-list[data-mode="list"] .inv-card {grid-template-columns:minmax(8.5em,1fr) minmax(0,2fr) minmax(7em,.9fr) minmax(0,1.4fr);align-items:center;gap:.5rem 1.2rem}
#panelInvoices .inv-list[data-mode="list"] .inv-item-preview {grid-column:2/-1}
#panelInvoices .inv-pages {justify-content:flex-end;margin-top:.85rem;color:#465b73;font-size:.85rem}
#panelInvoices .inv-pages span {padding:0 .4rem;font-variant-numeric:tabular-nums}
#panelInvoices .inv-pages button:disabled {cursor:default}
#panelInvoices .inv-empty {grid-column:1/-1;color:#536477;padding:1rem;border:1px dashed #c6d3e3;border-radius:8px;margin:0}
#panelInvoices .inv-timeline {display:flex;flex-wrap:wrap;gap:.75rem 1.2rem;padding:.75rem 0;margin:.4rem 0;border-block:1px solid #e2e8ef}
#panelInvoices .inv-timeline dt {font-size:.75rem;color:#5e6b79}
#panelInvoices .inv-timeline dd {margin:.15rem 0 0;font-size:.85rem}
#panelInvoices .inv-feed {container-type:inline-size}
@media(min-width:1120px){
  #panelInvoices .inv-layout:has(.inv-view:not(:empty)) {grid-template-columns:minmax(0,1.5fr) minmax(250px,.85fr)}
  #panelInvoices .inv-layout > .inv-view:not(:empty) {order:-1}
}
@container(max-width:680px){
  #panelInvoices .inv-list[data-mode="list"] .inv-card {grid-template-columns:minmax(0,1fr) auto;gap:.35rem .7rem}
  #panelInvoices .inv-list[data-mode="list"] .inv-card-head {grid-column:1/-1}
  #panelInvoices .inv-list[data-mode="list"] .inv-card-dates,#panelInvoices .inv-list[data-mode="list"] .inv-item-preview {grid-column:1/-1}
}
@media(max-width:1180px){#panelInvoices .inv-metrics {grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:680px){
  #panelInvoices .inv-metrics {grid-template-columns:repeat(2,minmax(0,1fr))}
  #panelInvoices .inv-tools label {flex:1 1 12rem}
  #panelInvoices .inv-view:not(:empty) {grid-row:1}
  #panelInvoices .inv-pages {justify-content:center}
}
@media(max-width:390px){#panelInvoices button.inv-metric {padding:10px;min-height:92px}}
