:root { --ink:#111b2b; --muted:#7b8798; --line:#dfe3e9; --soft:#f7f8fa; --accent:#087f68; }
* { box-sizing:border-box; }
body { margin:0; background:#f8f9fb; color:var(--ink); font:14px/1.45 system-ui,-apple-system,"Segoe UI",sans-serif; }
button,input,textarea,select { font:inherit; color:inherit; }
button,a,summary { -webkit-tap-highlight-color:transparent; }
button,summary { cursor:pointer; }
a { color:var(--accent); text-underline-offset:3px; }
button { border:0; }
button:disabled { cursor:wait; opacity:.55; }
:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
[hidden] { display:none!important; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.skip-link { position:fixed; left:16px; top:-80px; z-index:50; background:white; padding:10px; }.skip-link:focus { top:8px; }
.editor-header { min-height:68px; padding:12px 32px; display:flex; align-items:center; gap:26px; background:white; border-top:3px solid #b9dcd4; border-bottom:1px solid var(--line); }
.brand { display:inline-flex; align-items:center; gap:10px; color:var(--ink); font-size:22px; font-weight:800; letter-spacing:-.6px; text-decoration:none; }.brand img { border-radius:9px; }
.editor-header nav { display:flex; gap:30px; margin-left:20px; align-items:center; }.editor-header nav a,.editor-header nav button,.sign-in { color:var(--ink); font-size:14px; text-decoration:none; background:transparent; padding:4px 0; white-space:nowrap; }.editor-header nav [aria-current] { color:var(--accent); font-weight:600; }.sign-in { margin-left:auto; }
.dark-button,.outline-button,.small-button { display:inline-flex; justify-content:center; align-items:center; gap:7px; padding:8px 12px; border-radius:6px; text-decoration:none; white-space:nowrap; font-size:13px; font-weight:500; }
.dark-button { background:var(--ink); color:white; border:1px solid var(--ink); }.dark-button:hover { background:#263546; color:white; }
.outline-button { border:1px solid var(--line); background:white; color:var(--ink); }.outline-button:hover { background:var(--soft); }
.small-button { background:#f2f3f5; color:var(--ink); padding:7px 12px; font-size:12px; }.small-button:hover { background:#e6e9ee; }
.toolbar { min-height:53px; padding:10px 32px; border-bottom:1px solid var(--line); display:flex; align-items:center; gap:16px; background:white; }
.draft-tools,.document-tools { display:flex; align-items:center; gap:8px; }.draft-tools select { width:250px; padding:6px 12px; height:34px; border:1px solid var(--line); border-radius:6px; background:white; }.draft-tools .dark-button { padding:6px 12px; height:34px; }.draft-tools .dark-button span { font-size:18px; line-height:1; }
.save-status { margin-left:auto; color:var(--muted); font-size:11px; }.document-tools { margin-left:auto; }.icon-button { display:grid; place-items:center; width:34px; height:34px; background:#f8f9fa; border-radius:6px; color:#818896; }.icon-button:hover,.icon-button.active { color:var(--ink); background:#eef0f3; }
svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
.export-menu { position:relative; }.export-menu summary { list-style:none; }.export-menu summary::-webkit-details-marker { display:none; }.export-options { position:absolute; top:calc(100% + 7px); right:0; z-index:10; width:216px; padding:5px; border:1px solid var(--line); border-radius:8px; box-shadow:0 10px 30px #1b29451a; background:white; }.export-options button { display:block; width:100%; padding:11px; text-align:left; font-size:13px; background:white; border-radius:4px; }.export-options button:hover { background:var(--soft); }
.workspace { padding:16px 32px 25px; }.invoice-paper { max-width:1400px; margin:0 auto; padding:54px 52px 58px; border:1px solid var(--line); border-radius:8px; background:white; box-shadow:0 5px 16px #1e293b05; }
.invoice-top { display:flex; justify-content:space-between; align-items:flex-start; gap:24px; margin-bottom:26px; }.logo-upload { display:flex; align-items:center; justify-content:center; width:180px; height:100px; border:2px dashed var(--line); background:white; border-radius:7px; color:#6d7c90; }.logo-placeholder { display:flex; align-items:center; flex-direction:column; gap:8px; font-size:13px; }.plus { display:grid; place-items:center; width:36px; height:36px; border-radius:50%; color:#97a0af; background:#f3f4f6; font-size:24px; font-weight:300; }.logo-upload img { max-width:100%; max-height:96px; object-fit:contain; }.logo-upload.has-logo { border-color:transparent; }.remove-logo { background:none; padding:5px 0; color:var(--muted); font-size:11px; }
.invoice-heading { text-align:right; }.invoice-heading h1 { font-size:25px; margin:0 0 5px; letter-spacing:-.6px; }.invoice-number { display:flex; align-items:center; justify-content:flex-end; gap:8px; padding:5px 10px; border-radius:6px; background:var(--soft); }.invoice-number input { max-width:170px; padding:0; background:none; }.currency-note { display:block; margin-top:8px; font-size:11px; color:var(--muted); }
input,textarea,select { min-width:0; border:1px solid transparent; border-radius:5px; background:var(--soft); padding:7px; outline-offset:1px; }input:hover,textarea:hover { border-color:#dfe4ea; }input:focus,textarea:focus,select:focus { border-color:#78b9a8; outline:2px solid #087f681a; background:#fff; }input::placeholder,textarea::placeholder { color:#8090a2; opacity:1; }textarea { display:block; width:100%; resize:vertical; min-height:96px; line-height:1.3; overflow:hidden; }input[type=number] { text-align:right; -moz-appearance:textfield; }input::-webkit-inner-spin-button,input::-webkit-outer-spin-button { -webkit-appearance:none; margin:0; }
.contact-grid { display:grid; grid-template-columns:1fr 1fr 1fr; gap:24px; margin-bottom:20px; align-items:start; }.contact-fields label,.notes-fields label { display:block; margin:0 0 7px; }.contact-fields label:not(:first-child),.notes-fields label:not(:first-child) { margin-top:16px; }.optional { color:var(--muted); font-size:11px; }.invoice-meta { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:4px 10px; padding-top:0; }.invoice-meta label { white-space:nowrap; }.invoice-meta input { width:100%; padding:6px 7px; }
.items-scroll { width:100%; overflow-x:auto; }.items-table { width:100%; table-layout:fixed; border-collapse:separate; border-spacing:0 2px; }.items-table th { background:#e6e7eb; padding:8px; text-align:left; font-weight:500; }.items-table th:first-child { border-radius:8px 0 0 8px; width:46%; }.items-table th:nth-child(2) { width:10%; text-align:right; }.items-table th:nth-child(3) { width:15%; text-align:right; }.items-table th:nth-child(4) { width:24%; text-align:right; }.items-table th:last-child { width:5%; border-radius:0 8px 8px 0; }.items-table td { padding:0 2px 3px; border-bottom:1px solid var(--line); vertical-align:top; }.items-table input,.items-table textarea { width:100%; background:white; border:1px solid var(--line); padding:6px; min-height:32px; }.items-table textarea { height:32px; resize:vertical; line-height:1.3; }.items-table .amount { display:block; padding:6px 7px; text-align:right; white-space:nowrap; }.row-actions { display:flex; align-items:center; justify-content:center; }.row-actions button { padding:5px 6px; color:var(--muted); background:transparent; font-size:18px; }.row-actions button:hover { color:#ba3434; }.row-actions button:disabled { visibility:hidden; }.invoice-paper>#add-row { margin-top:6px; }
.invoice-bottom { display:grid; grid-template-columns:1.4fr 1fr; gap:80px; margin-top:24px; }.notes-fields textarea { min-height:98px; }.total-row { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:7px 0; }.total-row input { width:112px; }.total-row strong { font-weight:500; }.adjustment-buttons { display:flex; justify-content:flex-end; gap:6px; margin:3px 0; flex-wrap:wrap; }.balance { padding:9px 14px; background:#e6e7eb; border-radius:7px; margin-top:3px; }.balance strong { font-weight:600; }.adjustment { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:7px 0; }.adjustment-inputs { display:flex; align-items:center; gap:5px; margin-top:4px; }.adjustment-inputs input { width:80px; padding:3px 6px; }.adjustment-inputs select { max-width:83px; padding:3px; }.adjustment-inputs button { background:none; color:var(--muted); font-size:18px; }.calculation-note { color:var(--muted); font-size:11px; }.workspace-note { text-align:center; font-size:12px; color:var(--muted); margin-top:20px; }.workspace-note a { margin-left:8px; }
.print-value { display:none; white-space:pre-wrap; overflow-wrap:anywhere; }.preview-banner { max-width:1400px; margin:0 auto 12px; padding:10px 16px; background:#eaf5f1; border:1px solid #d0e5dd; border-radius:7px; color:#27634f; }.preview-banner button { float:right; background:none; text-decoration:underline; color:inherit; }
.is-preview .edit-only,.is-preview .invoice-paper textarea,.is-preview .invoice-meta input,.is-preview #amount-paid { display:none; }.is-preview .print-value { display:block; }.is-preview .invoice-paper input { border-color:transparent; background:transparent; pointer-events:none; }.is-preview .invoice-number { background:transparent; }.is-preview .logo-upload { border:0; cursor:default; }.is-preview .logo-placeholder { visibility:hidden; }.is-preview .contact-fields .print-value { min-height:92px; padding:7px 0; }.is-preview .notes-fields .print-value { padding:7px 0; }.is-preview .items-table th:nth-child(4) { border-radius:0 8px 8px 0; }.is-preview .items-table td .print-value { padding:6px; }.is-preview .items-table input { text-align:right; }.is-preview .invoice-paper .invoice-number input { text-align:right; }
dialog { width:min(470px,calc(100% - 32px)); max-height:85vh; border:1px solid var(--line); border-radius:12px; padding:26px; color:var(--ink); box-shadow:0 25px 80px #111b2b30; }dialog::backdrop { background:#111b2b55; }.dialog-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:14px; }.dialog-heading h2 { margin:0; font-size:20px; }.dialog-heading button { background:none; font-size:25px; color:var(--muted); }dialog p { color:#667487; font-size:13px; line-height:1.6; }dialog>label:not(.file-picker) { display:block; margin:14px 0 6px; }dialog>select { width:100%; border-color:var(--line); }dialog .dark-button { margin-top:12px; }.file-picker { position:relative; cursor:pointer; }.file-picker input { position:absolute; inset:0; opacity:0; width:100%; cursor:pointer; }.import-bulk { margin-top:24px; padding-top:15px; border-top:1px solid var(--line); }.import-bulk h3 { font-size:15px; }.history-item { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:14px 0; border-bottom:1px solid var(--line); }.history-item button { color:var(--ink); background:none; text-align:left; }.history-item small { display:block; color:var(--muted); }.history-item .delete-draft { font-size:12px; color:#a33e3e; }.notification { position:fixed; bottom:24px; left:50%; transform:translateX(-50%); max-width:calc(100% - 32px); padding:12px 20px; border-radius:9px; background:var(--ink); color:white; box-shadow:0 8px 25px #111b2b33; z-index:40; font-size:13px; }.noscript { margin:24px; padding:24px; border:1px solid #e0ad40; background:#fff8df; }
@media(max-width:1100px) { .save-status { display:none; }.invoice-paper { padding:38px 32px; }.invoice-bottom { gap:36px; }.editor-header { gap:18px; }.editor-header nav { gap:24px; margin-left:8px; }.contact-grid { gap:18px; grid-template-columns:1fr 1fr; }.invoice-meta { grid-column:1 / -1; grid-template-columns:auto 1fr auto 1fr; gap:8px 12px; }.draft-tools select { width:190px; } }
@media(max-width:760px) { .editor-header { padding:10px 16px; flex-wrap:wrap; gap:12px; }.brand { font-size:20px; }.brand img { width:30px; height:30px; }.editor-header nav { order:3; width:100%; margin:0; justify-content:space-between; gap:16px; }.editor-header>.dark-button { font-size:11px; padding:7px 9px; }.sign-in { font-size:12px; }.toolbar { flex-wrap:wrap; padding:10px 16px; gap:10px; }.draft-tools { width:100%; }.draft-tools select { flex:1; width:0; }.document-tools { width:100%; margin:0; justify-content:flex-end; }.document-tools .icon-button { margin-right:auto; }.workspace { padding:12px 12px 24px; }.invoice-paper { padding:24px 18px; }.logo-upload { width:130px; height:85px; }.invoice-heading h1 { font-size:22px; }.invoice-number { max-width:150px; padding:4px 6px; }.invoice-number input { width:112px; font-size:12px; }.contact-grid { grid-template-columns:1fr; gap:16px; }.invoice-meta { grid-column:auto; grid-template-columns:auto minmax(0,1fr); margin-top:4px; }.invoice-bottom { grid-template-columns:1fr; gap:24px; }.notes-fields { order:2; }.items-table { min-width:520px; }.workspace-note { padding:0 12px; }.workspace-note a { display:block; margin:8px 0; }.invoice-top { gap:12px; }.invoice-paper { font-size:13px; }input,textarea,select { font-size:16px; }.adjustment-inputs select { font-size:13px; }.preview-banner { font-size:12px; }.is-preview .items-table { min-width:440px; } }
@page { size:A4; margin:14mm; }
.sr-only { top:0; left:0; }
.items-scroll { position:relative; }
.shipping-details { margin-top:10px; }
.shipping-details summary { color:var(--muted); cursor:pointer; font-size:12px; }
.shipping-details[open] summary { margin-bottom:12px; }
.is-preview .shipping-details:not([open]),.is-preview .shipping-details summary { display:none; }
.is-preview .items-table input { display:none; }
.is-preview .items-table td:nth-child(2),.is-preview .items-table td:nth-child(3) { text-align:right; }
@media(max-width:380px) {
  .document-tools { gap:5px; }
  .document-tools .icon-button { width:29px; }
  .document-tools .outline-button { padding:7px 9px; font-size:12px; }
  .editor-header>.dark-button { font-size:10px; padding:6px; }
  .editor-header { gap:10px; }
  .editor-header .brand { font-size:18px; gap:7px; }
}
@media print {
  .shipping-details:not([open]),.shipping-details summary { display:none; }
  body { background:white; font-size:10pt; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  .editor-header,.toolbar,.workspace-note,.notification,dialog,.preview-banner,.edit-only,.skip-link,.remove-logo,.logo-placeholder,.noscript { display:none!important; }
  .workspace { padding:0; }.invoice-paper { padding:0; border:0; box-shadow:none; max-width:none; border-radius:0; }
  .invoice-paper input,.invoice-paper textarea { display:none!important; }.invoice-paper .print-value { display:block!important; }
  .invoice-number { background:none; }.invoice-number::after { content:attr(data-number); }.invoice-number>span { display:none; }.invoice-heading h1 { font-size:23pt; }.currency-note { font-size:9pt; }
  .logo-upload { border:0; width:150px; height:85px; }.logo-area:has(.logo-placeholder:not([hidden])) { visibility:hidden; }
  .contact-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }.invoice-meta { grid-column:1 / -1; grid-template-columns:auto 1fr auto 1fr; gap:8px 12px; }.contact-fields .print-value { min-height:0; padding-bottom:10px; }.contact-fields label { font-weight:600; }
  .items-scroll { overflow:visible; }.items-table { min-width:0; font-size:10pt; }.items-table th:first-child { width:48%; }.items-table th:nth-child(2) { width:10%; }.items-table th:nth-child(3) { width:18%; }.items-table th:nth-child(4) { width:24%; border-radius:0 6px 6px 0; }.items-table td .print-value { padding:6px; }.items-table td:nth-child(2),.items-table td:nth-child(3) { text-align:right; }thead { display:table-header-group; }tr { break-inside:avoid; }
  .invoice-bottom { display:block; }.totals { width:45%; margin-left:auto; break-inside:avoid; }.notes-fields { margin-bottom:20px; }.notes-fields .print-value { padding-bottom:12px; }.invoice-top { break-inside:avoid; }.balance { background:#e6e7eb; }.optional { display:none; }
}
