.billing-page{padding:32px 38px 60px}.billing-head{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;margin-bottom:24px}.billing-head h1{margin:.2rem 0}.billing-head p{margin:.35rem 0}.billing-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:20px}.billing-kpis article{background:#fff;border:1px solid var(--line);border-radius:16px;padding:18px 20px;box-shadow:0 8px 26px rgba(52,52,55,.055);position:relative;overflow:hidden}.billing-kpis article:before{content:"";position:absolute;inset:0 auto 0 0;width:4px;background:var(--brand)}.billing-kpis span,.billing-kpis small{display:block;color:var(--muted)}.billing-kpis span{font-size:.78rem;font-weight:800;text-transform:uppercase;letter-spacing:.05em}.billing-kpis strong{display:block;font-size:1.65rem;margin:7px 0 3px}.billing-kpis small{font-size:.75rem}.billing-list{padding:0;overflow:hidden}.list-toolbar{display:flex;align-items:end;justify-content:space-between;gap:20px;padding:21px 22px;border-bottom:1px solid var(--line)}.list-toolbar h2{margin:0 0 4px}.list-toolbar p{margin:0}.toolbar-fields{display:flex;gap:10px;align-items:end}.toolbar-fields label{margin:0;min-width:170px}.toolbar-fields label:first-child{min-width:270px}.toolbar-fields label span{display:block;font-size:.72rem;color:var(--muted);margin-bottom:5px}.billing-list table{min-width:820px}.billing-list th{background:#faf9f8;padding:12px 16px}.billing-list td{padding:15px 16px}.billing-list td small{display:block;color:var(--muted);margin-top:4px}.num{text-align:right!important;font-variant-numeric:tabular-nums}.doc-number{font-weight:850;text-decoration:none;color:var(--brand-dark)}.table-action{white-space:nowrap;font-weight:750;text-decoration:none}.status-pill{display:inline-flex;padding:6px 9px;border-radius:999px;background:#ece9e8;color:#5e5a5a;font-size:.73rem;font-weight:800;white-space:nowrap}.status-accepte,.status-paid{background:#e3f4e8;color:#267143}.status-brouillon,.status-draft{background:#efedec;color:#666}.status-a_approuver,.status-to_validate,.status-overdue{background:#fff0d5;color:#925d00}.status-pret,.status-validated,.status-sent,.status-envoye,.status-vu{background:#e5effa;color:#285e8e}.status-refuse,.status-refuse_interne,.status-cancelled,.status-cancelled{background:#f9e3e1;color:#963e38}.empty-state{text-align:center;padding:50px 20px;color:var(--muted)}.empty-state strong,.empty-state span{display:block}.empty-state strong{color:var(--ink);font-size:1.05rem;margin-bottom:5px}.billing-dialog{width:min(1180px,calc(100vw - 32px));max-height:calc(100vh - 32px);border:0;border-radius:22px;padding:0;box-shadow:0 30px 90px rgba(25,20,20,.28);color:var(--ink)}.billing-dialog::backdrop{background:rgba(35,31,31,.58);backdrop-filter:blur(3px)}.billing-dialog form{padding:26px}.dialog-head,.line-editor-head,.dialog-actions,.quote-footer{display:flex;justify-content:space-between;align-items:flex-start;gap:22px}.dialog-head{padding-bottom:18px;border-bottom:1px solid var(--line)}.dialog-head h2,.line-editor-head h3{margin:3px 0}.dialog-head p,.line-editor-head p{margin:3px 0}.icon-button,.row-remove{border:0;background:#f0edec;color:#5a5555;border-radius:50%;cursor:pointer}.icon-button{width:38px;height:38px;font-size:1.5rem}.form-grid{display:grid;grid-template-columns:2fr 1fr 1fr;gap:14px;margin:8px 0 20px}.form-grid label{margin-top:10px}.line-editor{border:1px solid var(--line);border-radius:16px;overflow:hidden}.line-editor-head{padding:15px 16px;background:#faf9f8;align-items:center}.lines-table{min-width:970px}.lines-table th{background:#f5f3f2}.lines-table td{padding:8px 5px}.lines-table td:first-child{min-width:280px}.lines-table select,.lines-table input,.lines-table textarea{padding:9px;border-radius:8px}.lines-table select{margin-bottom:5px}.lines-table textarea{min-height:48px}.row-remove{width:30px;height:30px;font-size:1.2rem}.suffix-input{position:relative}.suffix-input span{position:absolute;right:8px;top:10px;color:var(--muted)}.suffix-input input{padding-right:24px}.quote-footer{margin-top:20px}.quote-footer .notes{flex:1;margin:0}.totals-box{width:min(340px,100%);background:#f5f3f2;border-radius:14px;padding:13px 18px}.totals-box>div{display:flex;justify-content:space-between;padding:7px 0}.totals-box .grand-total{border-top:1px solid #cfc9c7;margin-top:5px;padding-top:12px;font-size:1.1rem}.dialog-actions{justify-content:flex-end;border-top:1px solid var(--line);padding-top:18px;margin-top:16px}.form-message{min-height:22px;color:#287149}.form-message.error{color:var(--danger)}.invoice-create{padding:18px 22px}.invoice-create summary{font-weight:850;cursor:pointer}.invoice-create form{display:grid;grid-template-columns:2fr repeat(3,1fr) auto;gap:12px;align-items:end;margin-top:12px}.invoice-create label{margin:0}.balance-due{color:#a4483f}.billing-tabs{display:flex;gap:8px}.billing-tabs a{padding:9px 13px;border-radius:10px;text-decoration:none;background:#fff;border:1px solid var(--line);font-weight:750}.billing-tabs a.active{background:var(--brand);color:#fff;border-color:var(--brand)}
@media(max-width:1100px){.billing-kpis{grid-template-columns:repeat(2,1fr)}.invoice-create form{grid-template-columns:repeat(2,1fr)}.invoice-create form button{grid-column:span 2}.list-toolbar{align-items:stretch;flex-direction:column}.toolbar-fields{flex-wrap:wrap}.toolbar-fields label{flex:1}.billing-page{padding:24px}}
@media(max-width:650px){.billing-kpis{grid-template-columns:1fr 1fr}.billing-head{flex-direction:column}.billing-head .button{width:100%}.form-grid{grid-template-columns:1fr}.quote-footer{flex-direction:column}.totals-box{width:100%}.billing-dialog form{padding:18px}.billing-page{padding:18px}.toolbar-fields{display:grid}.toolbar-fields label,.toolbar-fields label:first-child{min-width:0}.invoice-create form{grid-template-columns:1fr}.invoice-create form button{grid-column:auto}}
.invoice-pager{display:flex;align-items:center;justify-content:flex-end;gap:9px;flex-wrap:wrap;padding:16px 22px;border-top:1px solid var(--line)}.invoice-pager button{min-width:95px}.invoice-pager button:disabled{opacity:.45;cursor:not-allowed}.invoice-pager span{min-width:120px;text-align:center;font-weight:700}.billing-list .toolbar-fields{flex-wrap:wrap}.billing-list .toolbar-fields label:has(#invoice-page-size){min-width:90px}

.invoice-duplicate{min-height:32px;padding:6px 10px;font-size:.75rem;white-space:nowrap}.billing-list td:last-child{min-width:170px}.invoice-create form{grid-template-columns:repeat(3,minmax(0,1fr))}.invoice-create form>button{align-self:end}.invoice-create #customer-search-status{grid-column:1/-1;margin:0}@media(max-width:800px){.invoice-create form{grid-template-columns:1fr 1fr}}@media(max-width:560px){.invoice-create form{grid-template-columns:1fr}}
.invoice-pdf-link{display:inline-flex;align-items:center;padding:6px 9px;border:1px solid #d9c5be;border-radius:8px;background:#fff;color:#813f36}.invoice-pdf-link:hover{background:#fbf0ed}.row-actions{align-items:center;gap:7px}
.invoice-pdf-preview{width:min(1050px,calc(100vw - 24px));height:min(92vh,1100px);padding:0;border:0;border-radius:16px;box-shadow:0 25px 75px #231e1d55}.invoice-pdf-preview::backdrop{background:#1d1e23aa}.invoice-preview-toolbar{height:54px;display:flex;align-items:center;justify-content:space-between;padding:8px 16px;background:#fff}.invoice-pdf-preview iframe{width:100%;height:calc(100% - 54px);border:0;background:#eee}.invoice-pdf-link{cursor:pointer;font-size:inherit}

/* Keep every invoice on one aligned table row, including its controls. */
.billing-list table{table-layout:fixed;min-width:1515px}
.billing-list th:nth-child(1),.billing-list td:nth-child(1){width:175px}
.billing-list th:nth-child(2),.billing-list td:nth-child(2){width:225px}
.billing-list th:nth-child(3),.billing-list td:nth-child(3){width:200px}
.billing-list th:nth-child(4),.billing-list td:nth-child(4){width:105px}
.billing-list th:nth-child(5),.billing-list td:nth-child(5){width:110px}
.billing-list th:nth-child(6),.billing-list td:nth-child(6){width:95px}
.billing-list th:nth-child(7),.billing-list td:nth-child(7){width:105px}
.billing-list th:nth-child(8),.billing-list td:nth-child(8){width:500px}
.billing-list th:nth-child(n+5):nth-child(-n+7){text-align:right}
.billing-list th:last-child{text-align:right}
.billing-list td{vertical-align:middle}
.billing-list td:last-child{min-width:0}
.billing-list .row-actions{display:flex;align-items:center;align-content:center;justify-content:flex-end;flex-wrap:wrap;gap:5px 6px;min-height:73px}
.billing-list .row-actions>*{flex:none;margin:0}
.billing-list .row-actions .compact-select{width:158px;min-width:158px;height:34px;padding:5px 8px;font-size:.77rem}
.billing-list .row-actions .table-action,.billing-list .row-actions .invoice-duplicate{display:inline-flex;align-items:center;justify-content:center;min-height:34px;padding:6px 8px;border-radius:8px;font-size:.76rem;line-height:1.1}
.billing-list .row-actions small{display:inline;color:var(--muted);font-size:.74rem;white-space:nowrap}
.billing-list td:first-child,.billing-list td.num,.billing-list td:nth-child(3){white-space:nowrap}
@media(min-width:1500px){.billing-list .list-toolbar{display:grid;grid-template-columns:minmax(240px,1fr) auto;align-items:center}.billing-list .toolbar-fields{flex-wrap:nowrap}.billing-list .toolbar-fields label{flex:none;min-width:0;width:160px}.billing-list .toolbar-fields label:first-child{width:260px}.billing-list .toolbar-fields label:has(#invoice-page-size){width:92px;min-width:0}.billing-list .toolbar-fields>a{white-space:nowrap}}
