/* =============================================================================
   45 — Invoicing v2 (2026-11-05): Raise-invoice form (typed lines, VAT / WHT,
   staged billing), firm invoice detail breakdown, stages + SMS panels, portal
   stage tag. Reuses .panel / .firm-field / .btn; loads after 42-mobile-fixes.
   ============================================================================= */

.portal-shell.firm-shell .inv-form2{display:flex;flex-direction:column;gap:16px;max-width:980px}
.portal-shell.firm-shell .inv-form2 .inv-card,
.portal-shell.firm-shell .inv-form2 .panel{margin:0;padding:18px 20px;max-width:none !important;width:100%;box-sizing:border-box}
.portal-shell.firm-shell .inv-card .panel-head{padding:0 0 10px;margin:0 0 14px;border-bottom:1px solid #eef0f4;display:flex;justify-content:space-between;align-items:center}
.portal-shell.firm-shell .inv-form2 .firm-hint{display:block;margin-top:4px;font-size:12px;color:var(--mid)}

/* Line rows: type · description · amount · remove */
.portal-shell.firm-shell .inv-line2{
	display:grid;grid-template-columns:200px minmax(0,1fr) 150px 36px;gap:8px;align-items:center;
	padding:6px 0 6px 10px;margin-bottom:6px;border-left:3px solid #1f3b8f;border-radius:2px;
}
.portal-shell.firm-shell .inv-line2[data-section="disb"]{border-left-color:#d97706}
.portal-shell.firm-shell .inv-line2 select,
.portal-shell.firm-shell .inv-line2 input{width:100%;min-width:0}
.portal-shell.firm-shell .inv-line2 .inv-amount{text-align:right;font-variant-numeric:tabular-nums}
.portal-shell.firm-shell .inv-add-row{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0 4px}

.portal-shell.firm-shell .inv-tax-row{display:flex;flex-wrap:wrap;gap:12px 28px;align-items:center;margin:14px 0 6px;padding:12px 14px;background:#f8f9fc;border-radius:10px}
.portal-shell.firm-shell .inv-check{display:inline-flex;gap:8px;align-items:center;font-size:13.5px;font-weight:500;cursor:pointer}
.portal-shell.firm-shell .inv-check input,
.portal-shell.firm-shell .inv-mode input{width:16px !important;height:16px !important;flex:0 0 16px;margin:0;padding:0 !important}
.portal-shell.firm-shell .inv-wht{display:inline-flex;gap:8px;align-items:center;font-size:13.5px;font-weight:500}
.portal-shell.firm-shell .inv-wht select{width:auto}

.portal-shell.firm-shell .inv-summary{width:100%;max-width:460px;margin:12px 0 0 auto;border-collapse:collapse;font-size:14px}
.portal-shell.firm-shell .inv-summary th{text-align:left;font-weight:500;color:var(--mid);padding:5px 0}
.portal-shell.firm-shell .inv-summary td{text-align:right;padding:5px 0;white-space:nowrap}
.portal-shell.firm-shell .inv-summary .grand th,
.portal-shell.firm-shell .inv-summary .grand td{font-weight:700;color:var(--blue-ink,#0b1f4b);border-top:1px solid var(--hair);padding-top:9px;font-size:15px}
.portal-shell.firm-shell .inv-summary .inv-wht-row th,
.portal-shell.firm-shell .inv-summary .inv-wht-row td{font-size:12.5px;color:#6b7280}

.portal-shell.firm-shell .inv-billing-mode{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.portal-shell.firm-shell .inv-mode{display:flex;gap:10px;align-items:flex-start;padding:12px 14px;border:1px solid var(--hair);border-radius:10px;cursor:pointer;font-weight:400}
.portal-shell.firm-shell .inv-mode:has(input:checked){border-color:var(--blue-ink,#0b1f4b);background:#f6f8fd}
.portal-shell.firm-shell .inv-mode input{margin-top:3px}
.portal-shell.firm-shell .inv-mode b{display:block;font-size:14px}
.portal-shell.firm-shell .inv-mode small{display:block;font-size:12.5px;color:var(--mid);margin-top:2px;line-height:1.45}
.portal-shell.firm-shell .inv-stages{margin-top:12px;padding:14px;border:1px dashed var(--hair);border-radius:10px}
.portal-shell.firm-shell .inv-stage{display:grid;grid-template-columns:90px 18px minmax(0,1fr) 170px;gap:8px;align-items:center;margin-bottom:8px}
.portal-shell.firm-shell .inv-stage input{width:100%;min-width:0}
.portal-shell.firm-shell .inv-stage-amt{text-align:right;font-size:13px;color:var(--mid)}
.portal-shell.firm-shell .inv-stage-foot{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:4px 0 10px}

/* Detail: breakdown */
.portal-shell.firm-shell .inv-bd{padding:0 22px 22px}
.portal-shell.firm-shell .inv-bd-table{width:100%;border-collapse:collapse;border:1px solid var(--hair);border-radius:8px;font-size:14px}
.portal-shell.firm-shell .inv-bd-table td,
.portal-shell.firm-shell .inv-bd-table th{padding:8px 14px;border-bottom:1px solid #eef0f4;text-align:left}
.portal-shell.firm-shell .inv-bd-table td.mono{text-align:right;white-space:nowrap}
.portal-shell.firm-shell .inv-bd-sec th{background:#f8f9fc;font-size:11.5px;letter-spacing:.06em;text-transform:uppercase;color:var(--mid)}
.portal-shell.firm-shell .inv-bd-sub td{font-weight:600;color:#1f3b8f}
.portal-shell.firm-shell .inv-bd-grand td{font-weight:700;color:var(--blue-ink,#0b1f4b);background:#fbfbfd;font-size:15px}
.portal-shell.firm-shell .inv-bd-info td{font-size:12.5px;color:#6b7280}
.portal-shell.firm-shell .inv-bd-type{display:inline-block;margin-left:6px;padding:1px 7px;border-radius:999px;background:#fff4e5;color:#92400e;font-size:11px;font-weight:600}
.portal-shell.firm-shell .inv-bd-words{margin:8px 0 0;text-align:right;font-size:12.5px;font-weight:600;color:#b4161d}

.portal-shell.firm-shell .inv-stage-list{list-style:none;margin:0;padding:0}
.portal-shell.firm-shell .inv-stage-list li{display:grid;grid-template-columns:130px minmax(0,1fr) auto auto;gap:12px;align-items:center;padding:12px 22px;border-top:1px solid #eef0f4;font-size:13.5px}
.portal-shell.firm-shell .inv-stage-list li.is-current{background:#f6f8fd}

.portal-shell.firm-shell .inv-sms-body{padding:4px 22px 18px}
.portal-shell.firm-shell .inv-sms-form{display:flex;gap:10px;align-items:flex-end;margin:10px 0}
.portal-shell.firm-shell .inv-sms-form textarea{flex:1;min-width:0;font-size:13.5px}
.portal-shell.firm-shell .inv-sms-hist{margin-top:6px}

/* Portal: stage tag under the invoice number */
.portal-shell .inv-stage-tag{display:block;margin-top:3px;font-size:11.5px;font-weight:500;color:#1f3b8f;font-family:inherit}

@media (max-width:820px){
	.portal-shell.firm-shell .inv-billing-mode{grid-template-columns:1fr}
	.portal-shell.firm-shell .inv-stage-list li{grid-template-columns:1fr auto;gap:4px 10px;padding:12px 16px}
}
@media (max-width:640px){
	.portal-shell.firm-shell .inv-card{padding:16px 14px}
	.portal-shell.firm-shell .inv-line2{grid-template-columns:minmax(0,1fr) 40px !important;padding-left:8px}
	.portal-shell.firm-shell .inv-line2 select,
	.portal-shell.firm-shell .inv-line2 .inv-desc{grid-column:1 / -1}
	.portal-shell.firm-shell .inv-line2 .inv-amount{grid-column:1}
	.portal-shell.firm-shell .inv-summary{max-width:none}
	.portal-shell.firm-shell .inv-stage{grid-template-columns:72px 14px minmax(0,1fr)}
	.portal-shell.firm-shell .inv-stage-amt{grid-column:1 / -1;text-align:left}
	.portal-shell.firm-shell .inv-bd{padding:0 12px 16px}
	.portal-shell.firm-shell .inv-bd-table td,
	.portal-shell.firm-shell .inv-bd-table th{padding:7px 10px;font-size:13px}
	.portal-shell.firm-shell .inv-sms-form{flex-direction:column;align-items:stretch}
	.portal-shell.firm-shell .inv-sms-body{padding:4px 14px 16px}
}
