/* One physical canvas for editing, viewing, browser print and PDF capture. */
.invoice-grid-measure { position: fixed; left: -20000px; top: 0; width: 210mm; visibility: hidden; pointer-events: none; }
.invoice-grid-heading { position: relative; }
.tax-invoice-table:has(.invoice-grid-heading:hover), .tax-invoice-table:has(.invoice-grid-heading:focus-within) { position: relative; z-index: 60; overflow: visible !important; }
.tax-invoice-table thead .invoice-grid-heading { overflow: visible !important; }
.invoice-grid-heading:hover, .invoice-grid-heading:focus-within { z-index: 65; }
.invoice-column-resizer { position: absolute; top: 0; bottom: 0; width: 8px; margin-left: -8px; cursor: col-resize; z-index: 12; touch-action: none; }
.invoice-column-resizer:hover { background: #1976d240; }
.invoice-column-add, .invoice-column-edit { position: absolute; top: -23px; right: -11px; display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 1px solid #aecaf0; border-radius: 4px; background: #fff; color: #1565c0; z-index: 15; opacity: 0; pointer-events: none; }
.invoice-column-add .material-symbols-rounded, .invoice-column-edit .material-symbols-rounded { font-size: 17px; }
.invoice-column-edit { right: 14px; }
.invoice-grid-heading:hover > button, .invoice-grid-heading:focus-within > button { opacity: 1; pointer-events: auto; }
.invoice-grid-heading::before { content: ''; position: absolute; top: -24px; left: 0; right: -12px; height: 25px; }
.invoice-row-resizer { position: absolute; left: 0; right: 0; bottom: -4px; height: 8px; z-index: 12; cursor: row-resize; touch-action: none; }
.invoice-row-resizer:hover { background: #1976d240; }
body .tax-invoice-pages:is(.is-editable,.is-final) .tax-invoice-table tbody tr[data-tax-invoice-line][style*="--invoice-row-height"],
body .tax-invoice-pages:is(.is-editable,.is-final) .tax-invoice-table tbody tr[data-tax-invoice-line][style*="--invoice-row-height"] > td { height: var(--invoice-row-height) !important; min-height: var(--invoice-row-height) !important; }
.tax-invoice-table [data-invoice-grid-heading="language"], .tax-invoice-table [data-invoice-grid-cell="language"] { white-space: nowrap !important; word-break: normal !important; overflow-wrap: normal !important; }
.tax-invoice-table [data-invoice-grid-cell="language"] .invoice-field-text { white-space: nowrap !important; }
.tax-invoice-table td[data-invoice-grid-cell] { overflow-wrap: anywhere; }
.tax-invoice-table td[data-invoice-grid-cell] .invoice-field-surface { display: block; width: 100%; min-width: 0; min-height: 1em; }
.tax-invoice-pages.is-editable td[data-invoice-grid-cell] { cursor: text; }
.invoice-pdf-render-host :is(.invoice-column-resizer,.invoice-row-resizer,.invoice-column-add,.invoice-column-edit) { display: none !important; }
@media print { .invoice-column-resizer,.invoice-row-resizer,.invoice-column-add,.invoice-column-edit { display: none !important; } .invoice-grid-heading::before { display: none; } }
body .tax-invoice-pages:is(.is-editable,.is-final) .tax-invoice-table tbody td.serial {
  padding-left: 1px !important; padding-right: 1px !important; white-space: nowrap; word-break: normal; overflow-wrap: normal;
}
.tax-invoice-table .invoice-line-serial-number { display: inline-block; white-space: nowrap; word-break: normal; overflow-wrap: normal; font-variant-numeric: tabular-nums; }
.invoice-rate-cell { position: relative; }
.invoice-cbc-check { position: absolute; left: 3px; top: 50%; transform: translateY(-50%); font: 800 13px/1 Arial,sans-serif; cursor: help; }
.invoice-cbc-check.is-match { color: #137333; }
.invoice-cbc-check.is-warning { color: #936400; }
.invoice-cbc-check.is-pending { color: #70757a; }
.invoice-pdf-render-host .invoice-cbc-check { display: none !important; }
@media print { .invoice-cbc-check { display: none !important; } }
.invoice-final-shell .invoice-review-toolbar > div:first-child { flex: 0 1 240px; min-width: 160px; }
.invoice-final-shell .invoice-review-toolbar .invoice-view-manage { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-left: 16px; border-left: 1px solid #d9dfe6; }
.invoice-final-shell .invoice-review-toolbar > div:last-child { flex: 1 1 auto; }
body .tax-invoice-pages:is(.is-editable, .is-final) .tax-invoice-page {
  width: 210mm !important;
  min-width: 210mm !important;
  max-width: 210mm !important;
  height: 297mm !important;
  aspect-ratio: auto !important;
  box-sizing: border-box;
}
body .tax-invoice-pages:is(.is-editable, .is-final) .tax-invoice-content h1 { font-size: 22px; }
body .tax-invoice-pages:is(.is-editable, .is-final) .tax-invoice-stat-grid label,
body .tax-invoice-pages:is(.is-editable, .is-final) .tax-invoice-client-grid label { font-size: 10.133px; line-height: 1.15; }
body .tax-invoice-pages:is(.is-editable, .is-final) .tax-invoice-stat-grid label > .tax-invoice-value,
body .tax-invoice-pages:is(.is-editable, .is-final) .tax-invoice-client-grid label > .tax-invoice-value,
body .tax-invoice-pages:is(.is-editable, .is-final) .tax-invoice-client-grid > div:first-child > .tax-invoice-value { font-size: 10.833px; }
body .tax-invoice-pages:is(.is-editable, .is-final) .tax-invoice-client-grid > div:first-child > small { font-size: 9.133px; }
body .tax-invoice-pages:is(.is-editable, .is-final) .tax-invoice-client-grid .client-name { font-size: 12.533px !important; }
body .tax-invoice-pages:is(.is-editable, .is-final) .tax-invoice-table tbody tr,
body .tax-invoice-pages:is(.is-editable, .is-final) .tax-invoice-table tbody td { height: 20px !important; min-height: 20px !important; padding: 2px 4px !important; font-size: 10.333px !important; line-height: 1 !important; }
body .tax-invoice-pages:is(.is-editable, .is-final) .tax-invoice-table thead th { height: 22px !important; padding: 2px 4px !important; font-size: 9.833px !important; line-height: 1 !important; }
body .tax-invoice-pages:is(.is-editable, .is-final) .tax-invoice-table tr.has-big-size,
body .tax-invoice-pages:is(.is-editable, .is-final) .tax-invoice-table tr.has-big-size > td { height: auto !important; padding-top: 3px !important; padding-bottom: 3px !important; }
body .tax-invoice-pages:is(.is-editable, .is-final) .tax-invoice-summary { font-size: 10.333px; line-height: 1.08; }
body .tax-invoice-pages:is(.is-editable, .is-final) .tax-invoice-total-grid .grand { font-size: 11.833px; }
body .tax-invoice-pages:is(.is-editable, .is-final) .tax-invoice-note-block > b { font-size: 10.833px; }
body .tax-invoice-pages:is(.is-editable, .is-final) .revenue-stamp-box { font-size: 8.833px; }
body .tax-invoice-pages:is(.is-editable, .is-final) .invoice-authorized-sign b { font-size: 10.633px; }
body .tax-invoice-pages:is(.is-editable, .is-final) .invoice-authorized-sign .signatory-role { font-size: 10.533px; }
body .tax-invoice-pages:is(.is-editable, .is-final) .tax-invoice-branch-footer { font-size: 10.333px; }
body .tax-invoice-pages:is(.is-editable, .is-final) .tax-invoice-page-number { font-size: 9.833px; }

/* Text determines printed geometry. Editors overlay it without changing row heights. */
.invoice-field-surface { position: relative; min-width: 0; }
.invoice-field-text { white-space: pre-wrap; overflow-wrap: anywhere; }
body .tax-invoice-pages:is(.is-editable, .is-final) .invoice-field-surface > :is(input,textarea) {
  position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0;
  margin: 0; padding: 0; border: 0; border-radius: 0; resize: none;
  font: inherit; line-height: inherit; color: inherit; opacity: 0; box-shadow: none;
}
.invoice-field-surface:focus-within > .invoice-field-text { visibility: hidden; }
body .tax-invoice-pages:is(.is-editable, .is-final) .invoice-field-surface > :is(input,textarea):focus { opacity: 1; background: #fff; outline: 1px solid #1976d2; }
.invoice-field-surface:hover { outline: 1px solid #b9cbe4; }
.other-media-invoice-table .other-invoice-description > .invoice-field-surface { display: block; width: 100%; }
@media screen {
  body .tax-invoice-pages.is-editable .other-invoice-description > .invoice-field-surface { min-height: 30px; cursor: text; }
  body .tax-invoice-pages.is-editable .other-invoice-description .invoice-field-surface > textarea { min-height: 30px; cursor: text; }
  .invoice-pdf-render-host .other-invoice-description > .invoice-field-surface { min-height: 0 !important; }
}
.tax-invoice-pages .invoice-gst-entry { position: relative; display: block; }
.tax-invoice-pages .invoice-gst-entry > .invoice-field-surface { display: block; margin-top: 2px; color: #272a30; font-size: 10.833px; font-weight: 650; }
.tax-invoice-pages .invoice-gst-entry > small { position: absolute; right: 0; bottom: 0; }
@media print { .tax-invoice-pages .invoice-gst-entry > small { display: none; } }
.invoice-pagination-toolbar { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.invoice-pagination-toolbar label { display: flex; align-items: center; gap: 8px; }
.invoice-pagination-toolbar input { width: 70px; }
.invoice-line-order-controls { opacity: 0; pointer-events: none; }
.invoice-row-drag-handle { cursor: grab; }
.invoice-row-drag-handle:active { cursor: grabbing; }
.invoice-row-dragging .invoice-line-order-controls { opacity: 1; pointer-events: auto; }
.tax-invoice-pages.is-editable tr.invoice-drop-before > td { box-shadow: inset 0 2px #1976d2; }
.tax-invoice-pages.is-editable tr.invoice-drop-after > td { box-shadow: inset 0 -2px #1976d2; }
tr:hover > .invoice-line-serial-cell .invoice-line-order-controls,
.invoice-line-order-controls:hover,
.invoice-line-order-controls:focus-within { opacity: 1; pointer-events: auto; }
/* Keep the pointer inside the toolbar while crossing from its row. */
.invoice-line-order-controls::after { content: ''; position: absolute; top: 0; bottom: 0; left: 100%; width: 12px; }
.invoice-field-surface.is-empty-addressee { display: block; height: 0; margin: 0 !important; }
.invoice-field-surface.is-empty-addressee > .invoice-field-text { display: none; }
@media screen {
  body .tax-invoice-pages.is-editable .invoice-field-surface.is-empty-addressee:has(> input[data-invoice-review-field="addressee"]) {
    display: block; height: 20px; min-height: 20px; margin: 2px 0 !important;
  }
  body .tax-invoice-pages.is-editable .invoice-field-surface.is-empty-addressee > input[data-invoice-review-field="addressee"] {
    opacity: 1; min-height: 20px; background: #f3f7fc; outline: 1px solid #c7d7eb;
  }
  .invoice-pdf-render-host .invoice-field-surface.is-empty-addressee:has(> input[data-invoice-review-field="addressee"]) { height: 0 !important; min-height: 0 !important; margin: 0 !important; }
  .invoice-pdf-render-host .invoice-field-surface.is-empty-addressee > input[data-invoice-review-field="addressee"] { display: none !important; }
}
body .tax-invoice-pages:is(.is-editable, .is-final) .invoice-field-surface.is-empty-addressee > input:focus { min-height: 14px; z-index: 5; }
body .tax-invoice-pages:is(.is-editable, .is-final) .tax-invoice-tax-settings { position: absolute; top: -42px; right: 0; border: 1px solid #c7cacf; border-radius: 4px; }
body .tax-invoice-pages:is(.is-editable, .is-final) .invoice-page-break-row,
body .tax-invoice-pages:is(.is-editable, .is-final) .invoice-page-break-row td { height: 0 !important; min-height: 0 !important; padding: 0 !important; }
@media screen {
  body .tax-invoice-pages.is-editable :is(td.size-dimension,td.size-total):focus-within { position: relative; z-index: 30; overflow: visible !important; }
  body .tax-invoice-pages.is-editable :is(td.size-dimension,td.size-total) .invoice-field-surface:focus-within { z-index: 30; overflow: visible !important; }
  body .tax-invoice-pages.is-editable :is(td.size-dimension,td.size-total) .invoice-field-surface > input { appearance: textfield; -moz-appearance: textfield; }
  body .tax-invoice-pages.is-editable :is(td.size-dimension,td.size-total) input::-webkit-inner-spin-button,
  body .tax-invoice-pages.is-editable :is(td.size-dimension,td.size-total) input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
  body .tax-invoice-pages.is-editable :is(td.size-dimension,td.size-total) .invoice-field-surface > input:focus {
    inset: auto; top: 50%; left: 50%; transform: translate(-50%,-50%);
    width: 104px !important; min-width: 104px; max-width: none; height: 36px; min-height: 36px;
    box-sizing: border-box; padding: 7px 10px; border: 1px solid #1976d2; border-radius: 4px;
    font-size: 15px; line-height: 20px; text-align: center; color: #172b40; background: #fff;
    outline: 2px solid #d5e6ff; box-shadow: 0 3px 12px #163b6326;
  }
  body .tax-invoice-pages:is(.is-editable, .is-final) { display: flex; flex-direction: column; align-items: center; gap: 60px; padding: 48px 84px 40px; overflow-x: auto; }
  body .tax-invoice-pages:is(.is-editable, .is-final) .tax-invoice-page { flex: 0 0 auto; margin: 0; }
  body .tax-invoice-pages.is-editable { scrollbar-gutter: auto; }
  .invoice-pdf-render-host .tax-invoice-pages { padding: 0; gap: 0; }
}
@media (max-width: 1000px) { body .tax-invoice-pages:is(.is-editable, .is-final) { align-items: flex-start; } }
@media screen {
  body .tax-invoice-pages.is-editable tr[data-tax-invoice-line]:focus-within { z-index: 50; }
  body .tax-invoice-pages.is-editable :is(td,label):has(.invoice-field-surface):focus-within,
  body .tax-invoice-pages.is-editable .invoice-field-surface:focus-within { position: relative; z-index: 50; overflow: visible !important; }
  body .tax-invoice-pages.is-editable input.tax-invoice-line-edit[type="number"] { appearance: textfield; -moz-appearance: textfield; }
  body .tax-invoice-pages.is-editable input.tax-invoice-line-edit[type="number"]::-webkit-inner-spin-button,
  body .tax-invoice-pages.is-editable input.tax-invoice-line-edit[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
  body .tax-invoice-pages.is-editable .invoice-field-surface > :is(input,textarea):not([readonly]):not(:disabled):focus {
    inset: auto; top: 50%; left: 50%; transform: translate(-50%,-50%);
    width: 240px !important; min-width: 120px; max-width: calc(100vw - 32px); height: 40px; min-height: 40px;
    box-sizing: border-box; padding: 7px 10px; border: 1px solid #1976d2; border-radius: 4px;
    font-size: 15px; line-height: 22px; text-align: left; color: #172b40; background: #fff;
    outline: 2px solid #d5e6ff; box-shadow: 0 3px 12px #163b6326;
  }
  body .tax-invoice-pages.is-editable .invoice-field-surface > input:is([type="number"],[inputmode="numeric"]):not([readonly]):focus { width: 120px !important; text-align: center; }
  body .tax-invoice-pages.is-editable .invoice-field-surface > input[type="date"]:not([readonly]):focus { width: 190px !important; }
  body .tax-invoice-pages.is-editable .invoice-field-surface > textarea:not([readonly]):not(:disabled):focus { width: 320px !important; height: 110px; min-height: 110px; overflow: auto; }
}
body .tax-invoice-pages:is(.is-editable, .is-final) .tax-invoice-table tbody td.invoice-not-published { color: #a12424; font-weight: 750; text-align: center !important; white-space: nowrap; font-size: 10.333px !important; }
.invoice-unpublished-release { display: block; color: #a12424; margin-top: 3px; }
.tax-invoice-pages.is-editable tr[data-tax-invoice-line] { position: relative; }
.invoice-row-insert-anchor { position: absolute; left: 50%; bottom: -11px; transform: translateX(-50%); z-index: 35; opacity: 0; pointer-events: none; }
.invoice-row-unpublish-button { position: absolute; right: -29px; top: 50%; transform: translateY(-50%); }
body .tax-invoice-pages .invoice-row-insert-button, body .tax-invoice-pages .invoice-row-unpublish-button { display: inline-flex; align-items: center; justify-content: center; width: 23px; height: 23px; min-width: 23px; padding: 0; border: 1px solid #a6bddb; border-radius: 5px; background: #fff; color: #1765bf; box-shadow: 0 1px 4px #163b6326; }
body .tax-invoice-pages .invoice-row-unpublish-button { color: #b3261e; border-color: #edb7b3; width: 20px; min-width: 20px; height: 16px; border-radius: 3px; }
.invoice-row-unpublish-button .material-symbols-rounded { font-size: 14px; }
.invoice-row-insert-button .material-symbols-rounded, .invoice-row-unpublish-button .material-symbols-rounded { font-size: 18px; }
tr:hover > td .invoice-row-insert-anchor, tr:focus-within > td .invoice-row-insert-anchor, .invoice-row-insert-anchor:hover { opacity: 1; pointer-events: auto; }
body .invoice-row-action-modal .modal-panel { width: min(600px,calc(100vw - 32px)); max-width: 600px; min-width: 0; height: auto; min-height: 0; max-height: calc(100dvh - 32px); }
.invoice-insert-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 8px 0; }
.invoice-insert-choices button { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 16px; border: 1px solid #b7cce7; background: #eef5ff; color: #174f95; border-radius: 6px; font-weight: 650; }
.invoice-insert-ro-fields { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 12px; }
.invoice-insert-ro-fields > p, .invoice-insert-ro-fields > label:last-child { grid-column: 1 / -1; }
.invoice-unpublish-warning { font-size: 13px; color: #5f6368; line-height: 1.5; }
.invoice-pdf-render-host .invoice-row-insert-anchor, .invoice-pdf-render-host .invoice-row-unpublish-button { display: none !important; }
@media print {
  .invoice-row-insert-anchor, .invoice-row-unpublish-button { display: none !important; }
  .invoice-pagination-toolbar, .tax-invoice-tax-settings, .invoice-line-order-controls, .invoice-page-break-row { display: none !important; }
  .invoice-field-surface > :is(input,textarea) { display: none !important; }
  .invoice-field-surface:focus-within > .invoice-field-text { visibility: visible !important; }
  .invoice-field-surface { outline: 0 !important; }
}
