:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --border: #dbe3ee;
  --border-strong: #c5d0df;
  --text: #172033;
  --text-muted: #667085;
  --text-soft: #8994a5;
  --brand: #175cd3;
  --brand-hover: #144ea8;
  --brand-soft: #eff6ff;
  --success: #067647;
  --success-soft: #ecfdf3;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --warning: #b54708;
  --warning-soft: #fffaeb;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, 0.08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --control-h: 46px;
  --focus: 0 0 0 3px rgba(23, 92, 211, 0.18);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  touch-action: manipulation;
}

button,
select {
  cursor: pointer;
}

input,
select,
textarea {
  width: 100%;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

input,
select {
  min-height: var(--control-h);
  padding: 0 12px;
}

textarea {
  min-height: 96px;
  padding: 11px 12px;
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #98a6ba;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
  border-color: var(--brand);
  box-shadow: var(--focus);
  outline: none;
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.12);
}

.skip-link {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 9999;
  transform: translateY(-150%);
  padding: 10px 14px;
  color: #fff;
  background: #111827;
  border-radius: 8px;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.topbar__inner {
  max-width: 1460px;
  min-height: 70px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand__mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #0f172a;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand__copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand__copy strong {
  font-size: 14px;
  line-height: 1.25;
}

.brand__copy span {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
}

.sync-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
  white-space: nowrap;
}

.sync-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #12b76a;
  box-shadow: 0 0 0 3px #ecfdf3;
}

.app-shell {
  width: min(1460px, calc(100% - 48px));
  margin: 0 auto;
  padding: 32px 0 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: start;
}

.workspace {
  min-width: 0;
}

.page-heading {
  min-height: 94px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 2px 2px 22px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--brand);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.page-heading h1,
.section-heading h2,
.summary-card h2,
.dialog h2 {
  margin: 0;
  color: var(--text);
}

.page-heading h1 {
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.page-subtitle {
  max-width: 720px;
  margin: 7px 0 0;
  color: var(--text-muted);
}

.document-chip,
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid #c7d7fe;
  border-radius: 999px;
  color: #1849a9;
  background: #eff4ff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.panel,
.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.panel {
  margin-bottom: 20px;
  padding: 24px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 22px;
}

.section-heading h2 {
  font-size: 18px;
  line-height: 1.3;
}

.section-heading p {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.section-heading--items {
  align-items: center;
}

.section-heading__action {
  margin-left: auto;
}

.step-badge {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid #bfdbfe;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 800;
}

.field-grid {
  display: grid;
  gap: 16px;
}

.field-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
  min-width: 0;
}

.field label,
.field__label {
  display: block;
  margin-bottom: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 650;
}

.optional {
  color: var(--text-soft);
  font-weight: 500;
}

.field-hint {
  min-height: 18px;
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.readonly-field {
  min-height: var(--control-h);
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #344054;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.readonly-field span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.button,
.icon-button {
  border: 0;
  outline: none;
  user-select: none;
}

.button {
  min-height: 44px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease, transform 80ms ease;
}

.button:active {
  transform: translateY(1px);
}

.button--primary {
  color: #fff;
  background: var(--brand);
  border: 1px solid var(--brand);
}

.button--primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

.button--secondary {
  color: #344054;
  background: #fff;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.button--secondary:hover {
  color: #101828;
  background: #f9fafb;
  border-color: #98a2b3;
}

.button--ghost {
  color: var(--brand);
  background: transparent;
  border: 1px dashed #b8c5d6;
}

.button--ghost:hover {
  background: var(--brand-soft);
  border-color: #84adff;
}

.button--danger {
  color: var(--danger);
  background: #fff;
  border: 1px solid #fecdca;
}

.button--danger:hover {
  background: var(--danger-soft);
}

.button--full {
  width: 100%;
}

.button[disabled],
.icon-button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.icon-button {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: #475467;
  background: transparent;
  border-radius: 9px;
  font-size: 24px;
  line-height: 1;
}

.icon-button:hover {
  color: #101828;
  background: #f2f4f7;
}

.customer-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.customer-picker__action {
  margin-top: 27px;
  white-space: nowrap;
}

.customer-empty,
.customer-summary {
  margin-top: 16px;
  border-radius: var(--radius-md);
}

.customer-empty {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--text-muted);
  background: var(--surface-muted);
  border: 1px dashed var(--border-strong);
}

.customer-empty strong {
  color: #475467;
  font-size: 13px;
}

.customer-empty span {
  font-size: 12px;
}

.customer-summary {
  padding: 17px 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  background: #f8fbff;
  border: 1px solid #d6e4ff;
}

.customer-summary__title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.customer-summary h3 {
  margin: 0;
  color: #1d2939;
  font-size: 15px;
}

.customer-summary p {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.customer-summary__meta {
  min-width: 170px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
}

.customer-summary__meta span {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.customer-summary__meta strong {
  margin-top: 3px;
  color: #344054;
  font-size: 13px;
}

.customer-order-row {
  margin-top: 18px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.items-table {
  width: 100%;
  min-width: 850px;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
}

.items-table th {
  height: 42px;
  padding: 0 10px;
  color: #667085;
  background: #f9fafb;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 750;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.items-table td {
  padding: 8px;
  border-bottom: 1px solid #edf1f5;
  vertical-align: middle;
}

.items-table tbody tr:last-child td {
  border-bottom: 0;
}

.items-table input,
.items-table select {
  min-height: 42px;
  border-color: transparent;
  background: #fff;
}

.items-table input:hover,
.items-table select:hover {
  border-color: var(--border);
}

.items-table input:focus,
.items-table select:focus {
  border-color: var(--brand);
}

.items-table .cell-description {
  min-width: 210px;
}

.items-table .cell-size {
  width: 94px;
}

.items-table .cell-hsn {
  width: 100px;
}

.items-table .cell-qty {
  width: 98px;
}

.items-table .cell-rate {
  width: 112px;
}

.items-table .cell-unit {
  width: 92px;
}

.items-table .cell-amount {
  width: 116px;
}

.items-table .cell-action {
  width: 54px;
}

.amount-cell {
  color: #1d2939;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  text-align: right;
  white-space: nowrap;
}

.row-remove {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  color: #667085;
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 20px;
}

.row-remove:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.mobile-items {
  display: none;
}

.add-item-mobile {
  margin-top: 14px;
}

.summary-column {
  min-width: 0;
}

.summary-card {
  position: sticky;
  top: 94px;
  padding: 22px;
}

.summary-card__heading {
  margin-bottom: 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.summary-card h2 {
  font-size: 18px;
  line-height: 1.3;
}

.money-input {
  position: relative;
}

.money-input > span {
  position: absolute;
  left: 12px;
  top: 50%;
  z-index: 1;
  transform: translateY(-50%);
  color: #667085;
  font-weight: 700;
}

.money-input input {
  padding-left: 29px;
}

.summary-lines {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.summary-line {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--text-muted);
  font-size: 13px;
}

.summary-line strong {
  color: #344054;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.summary-line small {
  color: var(--text-soft);
  font-size: 11px;
}

.summary-line--total {
  min-height: 52px;
  margin-top: 8px;
  padding-top: 10px;
  color: #101828;
  border-top: 1px solid var(--border-strong);
  font-size: 16px;
  font-weight: 800;
}

.summary-line--total strong {
  color: #101828;
  font-size: 20px;
}

.summary-actions {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.summary-note {
  margin: 14px 0 0;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.5;
}

.dialog {
  width: min(620px, calc(100% - 28px));
  max-height: calc(100vh - 36px);
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: var(--radius-lg);
}

.dialog::backdrop {
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(3px);
}

.dialog__surface {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22);
}

.dialog__header,
.dialog__footer {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dialog__header {
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
}

.dialog__header h2 {
  font-size: 20px;
}

.dialog__header p:not(.eyebrow) {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.dialog__body {
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  padding: 22px;
}

.dialog__body > .field + .field,
.dialog__body > .field-grid {
  margin-top: 16px;
}

.dialog__footer {
  justify-content: flex-end;
  padding: 16px 22px;
  background: #f9fafb;
  border-top: 1px solid var(--border);
}

.inline-alert {
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
}

.inline-alert--error {
  color: #912018;
  background: var(--danger-soft);
  border: 1px solid #fecdca;
}

.preview-dialog {
  width: min(1180px, calc(100% - 28px));
  max-width: none;
  max-height: calc(100vh - 24px);
}

.preview-dialog__surface {
  overflow: hidden;
  background: #eef2f6;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.26);
}

.preview-toolbar {
  min-height: 68px;
  padding: 11px 16px 11px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.preview-toolbar > div:first-child {
  display: flex;
  flex-direction: column;
}

.preview-toolbar strong {
  color: #1d2939;
  font-size: 14px;
}

.preview-toolbar span {
  color: var(--text-muted);
  font-size: 12px;
}

.preview-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-canvas {
  max-height: calc(100vh - 110px);
  overflow: auto;
  padding: 28px;
}

.invoice-document {
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto;
  padding: 10mm;
  color: #111;
  background: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  line-height: 1.35;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.14);
}

.invoice-title {
  text-align: center;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.invoice-company {
  margin-top: 5px;
  text-align: center;
  font-size: 23px;
  font-weight: 800;
}

.invoice-company-address {
  margin-top: 3px;
  text-align: center;
  font-size: 11px;
}

.invoice-grid-2 {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.invoice-box {
  overflow: hidden;
  border: 1px solid #111;
}

.invoice-kv {
  width: 100%;
  border-collapse: collapse;
}

.invoice-kv td {
  padding: 5px 6px;
  border-bottom: 1px solid #111;
  vertical-align: top;
}

.invoice-kv tr:last-child td {
  border-bottom: 0;
}

.invoice-kv td + td {
  border-left: 1px solid #111;
}

.invoice-kv__label {
  width: 40%;
  font-weight: 700;
  background: #f7f7f7;
}

.invoice-items {
  width: 100%;
  margin-top: 8px;
  border-collapse: collapse;
}

.invoice-items th,
.invoice-items td {
  padding: 5px 5px;
  border: 1px solid #111;
  text-align: center;
}

.invoice-items th {
  font-weight: 700;
  background: #f6f6f6;
}

.invoice-items .text-left {
  text-align: left;
}

.invoice-totals {
  margin-top: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 285px;
  gap: 7px;
}

.invoice-empty-box {
  min-height: 112px;
  border: 1px solid #111;
}

.invoice-total-box {
  padding: 7px 8px;
  border: 1px solid #111;
}

.invoice-total-line {
  min-height: 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.invoice-total-line--final {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid #111;
  font-weight: 800;
}

.invoice-note-box {
  margin-top: 8px;
  padding: 7px 8px;
  border: 1px solid #111;
}

.invoice-signature {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.invoice-signature__box {
  width: 235px;
  min-height: 90px;
  padding: 8px;
  text-align: center;
  border: 1px solid #111;
}

.invoice-signature__box strong {
  display: block;
}

.invoice-signature__label {
  margin-top: 45px;
}

.invoice-footer {
  margin-top: 18px;
  padding-top: 12px;
  color: #777;
  border-top: 1px solid #ddd;
  text-align: center;
  font-style: italic;
}

.print-root { display: none; }

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 3000;
  width: min(380px, calc(100% - 40px));
  pointer-events: none;
}

.toast {
  margin-top: 8px;
  padding: 12px 14px;
  color: #fff;
  background: #344054;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  font-size: 13px;
  pointer-events: auto;
}

.toast--success {
  background: #067647;
}

.toast--error {
  background: #b42318;
}

.toast--warning {
  background: #b54708;
}

.mobile-item-card {
  padding: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.mobile-item-card + .mobile-item-card {
  margin-top: 12px;
}

.mobile-item-card__header {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mobile-item-card__header strong {
  font-size: 14px;
}

.mobile-item-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mobile-item-grid .field--full {
  grid-column: 1 / -1;
}

.mobile-item-amount {
  min-height: 44px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.mobile-item-amount strong {
  color: #1d2939;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .summary-card {
    position: static;
  }

  .summary-column {
    order: 2;
  }
}

@media (max-width: 760px) {
  .topbar__inner {
    min-height: 64px;
    padding: 0 16px;
  }

  .brand__copy strong {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sync-status span:last-child {
    display: none;
  }

  .app-shell {
    width: min(100% - 24px, 1000px);
    padding: 22px 0 36px;
    gap: 18px;
  }

  .page-heading {
    min-height: 0;
    padding-bottom: 16px;
  }

  .page-subtitle {
    font-size: 13px;
  }

  .document-chip {
    display: none;
  }

  .panel {
    padding: 18px;
    border-radius: 14px;
  }

  .field-grid--2,
  .field-grid--3,
  .customer-picker {
    grid-template-columns: 1fr;
  }

  .customer-picker__action {
    margin-top: 0;
    width: 100%;
  }

  .customer-summary {
    grid-template-columns: 1fr;
  }

  .customer-summary__meta {
    align-items: flex-start;
  }

  .table-wrap {
    display: none;
  }

  .mobile-items {
    display: block;
  }

  .section-heading--items {
    align-items: flex-start;
  }

  .section-heading__action {
    display: none;
  }

  .add-item-mobile {
    width: 100%;
  }

  .summary-card {
    padding: 18px;
  }

  .dialog {
    width: calc(100% - 16px);
    max-height: calc(100vh - 16px);
  }

  .dialog__body {
    max-height: calc(100vh - 190px);
  }

  .dialog__footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .dialog__footer .button {
    width: 100%;
  }

  .preview-dialog {
    width: 100%;
    max-height: 100vh;
  }

  .preview-dialog__surface {
    border-radius: 0;
  }

  .preview-toolbar {
    position: sticky;
    top: 0;
    z-index: 3;
  }

  .preview-toolbar > div:first-child span {
    display: none;
  }

  .preview-canvas {
    padding: 16px 8px;
    max-height: calc(100vh - 68px);
  }

  .invoice-document {
    transform-origin: top left;
  }
}

@media (max-width: 480px) {
  .mobile-item-grid {
    grid-template-columns: 1fr;
  }

  .mobile-item-grid .field--full {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 8mm;
  }

  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  body > * {
    display: none !important;
  }

  #printRoot {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  #printRoot .invoice-document {
    width: 100% !important;
    min-height: 281mm !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: visible !important;
    box-shadow: none !important;
    transform: none !important;
    color: #000 !important;
    background: #fff !important;
    font-size: 10.5px !important;
    line-height: 1.32 !important;
  }

  #printRoot .invoice-title {
    font-size: 18px !important;
  }

  #printRoot .invoice-company {
    font-size: 21px !important;
  }

  #printRoot .invoice-grid-2,
  #printRoot .invoice-totals,
  #printRoot .invoice-note-box,
  #printRoot .invoice-signature {
    break-inside: avoid;
  }

  #printRoot .invoice-items thead {
    display: table-header-group;
  }

  #printRoot .invoice-items tr {
    break-inside: avoid;
  }

  #printRoot .invoice-signature {
    margin-top: auto !important;
    padding-top: 8mm !important;
  }

  #printRoot .invoice-footer {
    margin-top: 7mm !important;
    padding-top: 4mm !important;
  }
}
