/* Invoices share the project and contract page theme; these are page-specific proportions. */
body:has(#invoicesView.active) #main-container{background:radial-gradient(ellipse at 60% 0,#e1eeff80,transparent 65%),#edf5ff!important}
body:has(#invoicesView.active) #content-area{padding:12px 18px 20px!important;overflow:auto!important;min-width:0}
#invoicesView .inv-kpis{grid-template-columns:repeat(5,minmax(0,1fr))}
#invoicesView .inv-filters{grid-template-columns:minmax(220px,1.5fr) repeat(4,minmax(150px,1fr)) auto}
#invoicesView .inv-table-header{direction:rtl;padding:9px 3px;min-height:52px}
#invoicesView .inv-table-header h2{font-weight:650;color:#365083;gap:10px}
#invoicesView .inv-table-header h2 strong{display:grid;place-items:center;min-width:33px;height:29px;padding:0 8px;border-radius:18px;background:#dae7ff;color:#193b79}
#invoicesView #tblInvoices{table-layout:fixed;min-width:1450px}
#invoicesView #tblInvoices thead th{white-space:normal;overflow-wrap:anywhere;line-height:1.35}
#invoicesView #tblInvoices tbody td{font-size:14px;padding:7px 6px!important}
#invoicesView #tblInvoices tbody td.inv-text-cell{max-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#invoicesView #tblInvoices tbody td.inv-contract-cell{max-width:0;white-space:normal;overflow:hidden;text-align:right}
#invoicesView #tblInvoices tbody td.inv-contract-cell span{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden;white-space:normal;line-height:1.4;overflow-wrap:anywhere;text-overflow:ellipsis}
#invoicesView #tblInvoices tbody td.inv-money,#invoicesView #tblInvoices tfoot td[dir="ltr"]{white-space:nowrap;font-variant-numeric:tabular-nums}
#invoicesView #tblInvoices tfoot td{font-size:13px;white-space:nowrap}
#invoicesView .pr-status-Rejected{color:#e65d63;background:#fff0f1;border-color:#ffd5db}
#invoicesView .pr-payment-pending{color:#ef773a;background:#fff0e5;border-color:#ffdeca}
#invoicesView .pr-pagination .pagination-bar{width:100%;margin:0;display:flex;align-items:center;gap:12px}
#invoicesView .pr-pagination .pagination-controls{display:flex;align-items:center;gap:5px;margin-right:auto}
#invoicesView .pr-pagination .pagination-controls button.active{background:linear-gradient(120deg,#075bff,#082b9c);border-color:#0757df;color:#fff}
#invoicesView .pr-pagination .pagination-info{color:#8094b9;font-size:13px}
#invoicesView .pr-pagination .pagination-size{display:flex;align-items:center;gap:8px;color:#8094b9;font-size:13px}
@media(max-width:1200px){#invoicesView .inv-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}#invoicesView .inv-filters{grid-template-columns:repeat(3,minmax(0,1fr))}#invoicesView .inv-filters .pr-search{grid-column:span 2}}
@media(max-width:1000px){#invoicesView .inv-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}#invoicesView .inv-filters{grid-template-columns:repeat(2,minmax(0,1fr))}#invoicesView .inv-filters .pr-search{grid-column:1/-1}}
@media(max-width:575px){body:has(#invoicesView.active) #content-area{padding:10px!important}#invoicesView .inv-filters{grid-template-columns:repeat(2,minmax(0,1fr))}#invoicesView .inv-filters .pr-search,#invoicesView .inv-filters .pr-reset{grid-column:1/-1}#invoicesView .inv-table-header{flex-wrap:wrap;gap:10px}#invoicesView .pr-header-actions{width:100%}#invoicesView .pr-header-actions .btn-primary{min-width:100%}#invoicesView .inv-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}#invoicesView .inv-kpis .pr-kpi:last-child{grid-column:1/-1}#invoicesView .pr-pagination .pagination-bar{flex-wrap:wrap;justify-content:center}#invoicesView .pr-pagination .pagination-controls{margin-right:0}}
@media print{#invoicesView .inv-filters,#invoicesView #invExport,#invoicesView .pr-pagination,#invoicesView .pr-row-actions{display:none!important}#invoicesView .data-table-wrapper{overflow:visible!important}#invoicesView #tblInvoices{min-width:0;table-layout:auto}#invoicesView #tblInvoices td,#invoicesView #tblInvoices th{font-size:9px;white-space:normal!important}}

/* Keep invoice numbers visible over opaque cells while scrolling. */
#invoicesView #tblInvoices{min-width:1940px;border-collapse:separate;border-spacing:0;isolation:isolate}
#invoicesView #tblInvoices th:nth-child(1){width:150px}
#invoicesView #tblInvoices th:nth-child(2){width:290px}
#invoicesView #tblInvoices th:nth-child(3){width:240px}
#invoicesView #tblInvoices th:nth-child(4){width:180px}
#invoicesView #tblInvoices th:nth-child(5){width:140px}
#invoicesView #tblInvoices th:nth-child(6){width:140px}
#invoicesView #tblInvoices th:nth-child(7){width:200px}
#invoicesView #tblInvoices th:nth-child(8){width:200px}
#invoicesView #tblInvoices th:nth-child(9){width:120px}
#invoicesView #tblInvoices th:nth-child(10){width:120px}
#invoicesView #tblInvoices th:nth-child(11){width:160px}
#invoicesView #tblInvoices :is(thead th,tbody td):first-child{position:sticky!important;inset-inline-start:0;right:0;left:auto;box-shadow:-2px 0 0 #bfd1eb;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#invoicesView #tblInvoices tbody td:first-child{z-index:3;background:#fff!important;background-clip:border-box}
#invoicesView #tblInvoices tbody tr:nth-child(even) td:first-child{background:#f7faff!important}
#invoicesView #tblInvoices tbody tr:hover td:first-child{background:#edf6ff!important}
#invoicesView #tblInvoices thead th:first-child{z-index:20;background:linear-gradient(100deg,#e5f2ff,#dfedff)!important}
@media print{#invoicesView #tblInvoices{min-width:0}#invoicesView #tblInvoices :is(thead th,tbody td):first-child{position:static!important;box-shadow:none}}

/* The desktop contract picker wraps long names inside the invoice dialog. */
.invoice-contract-select-overlay { display:block; padding:0; background:transparent; }
.invoice-contract-select-overlay .mobile-select-sheet { position:fixed; box-sizing:border-box; border:1px solid #dce5f2; border-radius:12px; min-height:0; background:#fff; box-shadow:0 12px 32px #183b6526,0 2px 6px #183b650a; }
.invoice-contract-select-overlay .mobile-select-head { display:none; }
.invoice-contract-select-overlay .mobile-select-search { flex:none; margin:10px; width:calc(100% - 20px); min-height:38px; border:1px solid #e3eaf4; border-radius:8px; padding:8px 12px; background:#f6f8fc; color:#233b60; font:inherit; font-size:13px; outline:none; transition:border-color .15s,box-shadow .15s; }
.invoice-contract-select-overlay .mobile-select-search::placeholder { color:#91a0b6; }
.invoice-contract-select-overlay .mobile-select-search:focus { border-color:#8bb5ff; box-shadow:0 0 0 3px #347bff0c; background:#fff; }
.invoice-contract-select-overlay .mobile-select-options { min-height:0; flex:1; padding:0 7px 7px; scrollbar-width:thin; scrollbar-color:#cbd8ec transparent; }
.invoice-contract-select-overlay .mobile-select-option { position:relative; min-height:42px; padding:10px 12px 10px 34px; border-radius:7px; color:#344967; font-size:13px; line-height:1.7; text-align:right; cursor:pointer; transition:background .15s,color .15s; }
.invoice-contract-select-overlay .mobile-select-option + .mobile-select-option { border-top:0; margin-top:3px; }
.invoice-contract-select-overlay .mobile-select-option:hover { background:#f1f6ff; color:#1c62d5; }
.invoice-contract-select-overlay .mobile-select-option:focus-visible { outline:2px solid #6499f4; outline-offset:-2px; background:#f1f6ff; }
.invoice-contract-select-overlay .mobile-select-option.is-selected { color:#175bd1; background:#eaf2ff; font-weight:600; box-shadow:inset -3px 0 #347bff; }
.invoice-contract-select-overlay .mobile-select-option.is-selected::after { content:'✓'; position:absolute; left:12px; top:11px; color:#347bff; font-size:15px; font-weight:700; }
.invoice-contract-select-overlay .mobile-select-empty { padding:18px 12px; color:#8593a8; font-size:13px; }
#modalInvoice #tabInvBasic .form-group { min-width:0; }
#modalInvoice #invContractId { width:100%; max-width:100%; min-width:0; text-overflow:ellipsis; appearance:none; padding-inline-end:32px; cursor:pointer; color:#29446b; background-color:#fff; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237488a6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:left 10px center; }
#modalInvoice #invContractId.is-picker-open { border-color:#79a7fa; box-shadow:0 0 0 3px #347bff12; }

/* Match the insurance summary outside the horizontal table scroll area. */
#invoicesView .inv-totals-bar{display:grid;grid-template-columns:1fr repeat(4,1.3fr);align-items:center;gap:16px;border-radius:9px;margin:12px 0;background:linear-gradient(100deg,#fff5e7,#f4f8ff 45%,#eff4ff);padding:14px 18px}
#invoicesView .inv-totals-bar>strong{display:flex;align-items:center;gap:12px;font-size:19px;color:#142442}
#invoicesView .inv-totals-bar>strong svg{width:24px;height:24px;color:#0865ff;flex:none}
#invoicesView .inv-totals-bar>div{min-width:0;border-inline-start:1px solid #d6e3fb;padding-inline-start:22px;color:#0865ff;font-size:12px}
#invoicesView .inv-totals-bar b{display:block;font-size:23px;font-variant-numeric:tabular-nums;margin-top:3px}
#invoicesView .inv-totals-bar>div:nth-child(2){color:#943dff}
#invoicesView .inv-totals-bar>div:last-child{color:#f49a00}
#invoicesView .inv-totals-bar small{font-size:13px;font-weight:500}
#invoicesView :is(#invFootGross,#invFootNet){direction:ltr;unicode-bidi:isolate;white-space:nowrap;text-align:right}
@media(max-width:900px){#invoicesView .inv-totals-bar{grid-template-columns:repeat(2,minmax(0,1fr))}#invoicesView .inv-totals-bar>strong{grid-column:1/-1}}
@media(max-width:650px){#invoicesView .inv-totals-bar{gap:14px 10px;padding:14px 12px}#invoicesView .inv-totals-bar>div{padding-inline-start:10px}#invoicesView .inv-totals-bar b{font-size:21px}}

#invoicesView #tblInvoices{min-width:2650px}
#invoicesView #tblInvoices th:nth-child(n+11){width:170px}
@media print{#invoicesView #tblInvoices{min-width:0;table-layout:auto}}
