/* Invoice geometry and colours taken from the supplied invoice_preview.php. */
.invoice-editor .party-address{display:flex;align-items:flex-start;gap:4px}.invoice-editor .party-address textarea{flex:1}.invoice-editor .party-registration input{width:150px}.invoice-editor .party-details>input{width:100%!important}.invoice-editor .party-email input{color:blue}.invoice-editor .party-name textarea{font-weight:700}.invoice-editor textarea{overflow:hidden;resize:none!important}.invoice-editor .invoice-title textarea{font-size:30px;font-weight:800;text-transform:uppercase;border:0;text-align:right;line-height:1.2;padding:0;color:#000;width:100%}.invoice-editor .invoice-title{width:280px;max-width:100%}.invoice-editor .service textarea{line-height:1.4}.invoice-editor input[type=number]{appearance:textfield;-moz-appearance:textfield}.invoice-editor input::-webkit-inner-spin-button{appearance:none}.invoice-editor td.right input{text-align:right}.invoice-editor td.center input{text-align:center}
.invoice-editor .party-details>input{width:calc(100% - 55px)}.invoice-editor .party-details textarea{min-height:0;field-sizing:content}.invoice-editor .invoice-title input{color:#157a4c!important}.invoice-editor .toolbar{position:sticky;top:0;z-index:2}
.invoice-editor .hl-nog{background:#ecfdf5;color:#047857;padding:2px 8px;border-radius:4px;font-weight:700;border:1px solid #a7f3d0;display:inline-block;margin-top:3px;text-transform:uppercase}.invoice-editor .hl-du{background:#fff7ed;color:#9a3412;padding:1px 4px;border-radius:4px;font-weight:700;border:1px solid #fed7aa;display:inline-block;margin-top:2px}.invoice-editor [contenteditable]{outline:none;min-height:1em}.invoice-editor [contenteditable]:focus{background:#e6fffa}
.invoice-editor{--primary:#157a4c;--border:#e5e7eb;font-family:Inter,Arial,sans-serif;color:#333;background:#2d3032;padding:20px 0;font-size:13px;line-height:normal}
dialog.invoice-dialog{width:960px;max-width:calc(100vw - 24px);max-height:94vh;background:#2d3032;padding:0;border:0}dialog.invoice-dialog #dialog-content{padding:0}
.invoice-editor *{box-sizing:border-box}.invoice-editor .toolbar{max-width:210mm;width:100%;margin:0 auto 15px;background:#1f2123;padding:15px;border-radius:8px;color:white;display:flex;flex-wrap:wrap;gap:15px;justify-content:space-between;align-items:center}
.invoice-editor button,.invoice-editor .sheet-button{padding:10px 16px;border:none;border-radius:4px;font-weight:600;cursor:pointer;color:white;background:#4b5563;font-size:14px;text-decoration:none}.invoice-editor .green{background:#10b981}
.invoice-editor .page-container{background:white;max-width:210mm;width:100%;min-height:297mm;padding:15mm 20mm;margin:0 auto 30px;box-shadow:0 10px 30px rgba(0,0,0,.5)}
.invoice-editor input,.invoice-editor textarea{min-width:0;border:none;border-bottom:1px dashed #ccc;border-radius:0;background:transparent;width:100%;font:inherit;padding:2px 4px;color:#000;height:auto;box-shadow:none}
.invoice-editor input:focus,.invoice-editor textarea:focus{outline:none;border-bottom:2px solid var(--primary);background:#e6fffa}.invoice-editor textarea{resize:vertical;white-space:pre-wrap;line-height:1.45;min-height:1.5em}.invoice-editor .header-row{display:flex;justify-content:space-between;align-items:flex-end;margin-bottom:30px;border-bottom:3px solid var(--primary);padding-bottom:0;flex-wrap:wrap;gap:20px}
.invoice-editor .logo img{max-height:80px;max-width:220px;display:block;padding-bottom:10px}.invoice-editor .invoice-title{font-size:30px;font-weight:800;color:var(--primary);text-transform:uppercase;text-align:right;width:220px}.invoice-editor .invoice-title input{font-size:30px;font-weight:800;text-align:right;border:0}.invoice-editor .parties-grid{display:grid;grid-template-columns:1fr 1fr;gap:40px;margin-bottom:25px}
.invoice-editor .party-label{font-size:10px;text-transform:uppercase;font-weight:700;color:#6b7280;border-bottom:1px solid var(--border);margin-bottom:5px}.invoice-editor .party-details{font-size:12px;line-height:1.5;color:#374151;margin-top:5px}.invoice-editor .party-name{font-weight:bold}.invoice-editor .info-bar{display:flex;justify-content:space-between;background:#f9fafb;border:1px solid var(--border);border-radius:6px;padding:10px 20px;margin-bottom:25px;flex-wrap:wrap;gap:10px}
.invoice-editor .info-bar>div{max-width:220px}.invoice-editor .info-bar input[type=date]{width:120px}.invoice-editor table{width:100%;border-collapse:collapse;font-size:13px;margin:0}.invoice-editor th{background:var(--primary);color:#fff;text-align:left;padding:8px 10px;font-size:10px;text-transform:uppercase;font-weight:700;white-space:normal}.invoice-editor td{padding:10px 8px;border-bottom:1px solid var(--border);vertical-align:top;border-right:1px solid var(--border);white-space:normal}.invoice-editor .right{text-align:right}.invoice-editor .center{text-align:center}.invoice-editor .details{font-size:11px;color:#555;line-height:1.6;white-space:pre-wrap}.invoice-editor .service{font-size:13px;font-weight:bold;margin-bottom:4px}.invoice-editor .totals{display:flex;justify-content:flex-end;margin-top:20px}.invoice-editor .total-box{border:2px solid var(--primary);border-radius:10px;padding:15px 20px;min-width:250px}.invoice-editor .total-line{display:flex;justify-content:space-between;align-items:center;gap:16px}.invoice-editor .total-amount{font-size:26px;font-weight:800;color:var(--primary)}.invoice-editor .footer{margin-top:40px;text-align:center;font-size:10px;color:#999}
.invoice-editor .row-add{background:transparent;color:#10b981;font-size:12px;margin:10px;font-weight:bold;padding:0}.invoice-editor .row-delete{background:transparent;color:#ef4444;padding:0}.invoice-editor .protocol-header{background:var(--primary);color:white;padding:8px 12px;font-weight:bold;border-radius:6px 6px 0 0;display:flex;justify-content:space-between;align-items:center;font-size:13px}.invoice-editor .protocol-header input{color:inherit}.invoice-editor .protocol-table{border:1px solid var(--border);margin-bottom:20px;font-size:11px}.invoice-editor .protocol-table td{border:1px solid #e5e7eb;vertical-align:middle}.invoice-editor .sheet-error{background:#fff0f0;color:#9b2323;padding:12px;max-width:210mm;margin:10px auto}.invoice-editor .protocol-title{text-align:center;margin-bottom:25px;padding-bottom:15px;border-bottom:3px solid var(--primary);font-size:13px;line-height:1.5}.invoice-editor .plain{white-space:pre-wrap;overflow-wrap:anywhere}.invoice-editor .sheet-note{max-width:210mm;margin:8px auto;color:white;font-size:13px}
@media(max-width:768px){.invoice-editor{padding:0;background:#f8f9fa}.invoice-editor .page-container{padding:15px;min-height:auto;margin:0 0 20px;box-shadow:none}.invoice-editor .toolbar{border-radius:0;gap:10px}.invoice-editor .header-row{flex-direction:column;align-items:center;text-align:center;gap:15px}.invoice-editor .parties-grid{display:flex;flex-direction:column;gap:20px}.invoice-editor .info-bar{flex-direction:column;gap:15px}.invoice-editor .table-wrapper{overflow-x:auto}.invoice-editor table{min-width:600px}.invoice-editor input,.invoice-editor textarea{font-size:16px}.invoice-editor .protocol-header{flex-wrap:wrap}.invoice-editor .sheet-note{color:#333}}
@media print{@page{size:A4;margin:0}body{margin:0!important;background:white!important}body:has(dialog.invoice-dialog)>:not(dialog.invoice-dialog){display:none!important}dialog.invoice-dialog{position:static;max-width:none;max-height:none;width:100%;overflow:visible}dialog.invoice-dialog::backdrop{display:none}.invoice-editor{padding:0;background:white}.invoice-editor .no-print{display:none!important}.invoice-editor .page-container{width:210mm;max-width:none;min-height:297mm;margin:0;box-shadow:none;break-after:page}.invoice-editor .page-container:last-child{break-after:auto}.invoice-editor input,.invoice-editor textarea{border:none;resize:none}.invoice-editor .print-value{white-space:pre-wrap;overflow-wrap:anywhere}.invoice-editor .table-wrapper{overflow:visible}.invoice-editor tr{break-inside:avoid}.invoice-editor th,.invoice-editor .protocol-header{print-color-adjust:exact;-webkit-print-color-adjust:exact}}
.invoice-editor .invoice-title{width:280px}.invoice-editor textarea{field-sizing:fixed!important;max-height:none!important}.invoice-editor .party-name textarea{line-height:1.5}.invoice-editor .invoice-title textarea{font-size:30px;line-height:1.2;white-space:pre-wrap;overflow-wrap:anywhere}
