.page {
  min-height: 100vh;
  padding: 20px 16px 40px;
  background:
    radial-gradient(ellipse 70% 55% at 8% 0%, rgba(56, 189, 248, 0.22), transparent 55%),
    radial-gradient(ellipse 55% 45% at 92% 8%, rgba(167, 139, 250, 0.18), transparent 50%),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(52, 211, 153, 0.12), transparent 55%),
    linear-gradient(165deg, #e8f1ff 0%, #eef2ff 42%, #f3f7fb 100%);
}

.toolbar {
  width: 100%;
  max-width: 820px;
  margin: 12px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbarHint {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary, #64748b);
  flex: 1;
  min-width: 180px;
}

.toolbarActions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.toolbarError {
  flex-basis: 100%;
  margin: 0;
  font-size: 12px;
  color: #b91c1c;
}

.approveBtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: var(--field-height, 38px);
  padding: 0 14px;
  border-radius: var(--radius-sm, 12px);
  border: 1px solid rgba(4, 120, 87, 0.35);
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.approveBtn:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.2);
}

.approveBtn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.printBtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: var(--field-height, 38px);
  padding: 0 14px;
  border-radius: var(--radius-sm, 12px);
  border: none;
  background: var(--primary, #0a1628);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.printBtn:hover {
  background: var(--primary-dark, #050b14);
}

.sheet {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 20px 22px 22px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.07);
}

.header {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.headerTop {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.approvedBadge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
  font-size: 12px;
  font-weight: 650;
}

.title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary, #0f172a);
}

.meta {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary, #64748b);
}

.topText {
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary, #475569);
}

.topText p {
  margin: 0 0 0.4em;
}

.topText p:last-child {
  margin-bottom: 0;
}

.section {
  margin-top: 14px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.sectionTitle {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
}

.items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  break-inside: avoid;
  page-break-inside: avoid;
}

.itemMain {
  min-width: 0;
  flex: 1;
}

.itemTitle {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
}

.itemDesc {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--text-secondary, #64748b);
  line-height: 1.4;
}

.itemMeta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
}

.itemPrice {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
  white-space: nowrap;
}

.priceWas {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted, #94a3b8);
  text-decoration: line-through;
}

.totals {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
  font-size: 12px;
  color: var(--text-secondary, #64748b);
  break-inside: avoid;
  page-break-inside: avoid;
}

.totals > div {
  display: flex;
  gap: 20px;
  min-width: 200px;
  justify-content: space-between;
}

.totalRow {
  font-size: 14px;
  color: var(--text-primary, #0f172a);
}

.keyPoints {
  margin: 0;
  padding-left: 16px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary, #475569);
}

.accounts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.account {
  padding: 8px 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  break-inside: avoid;
  page-break-inside: avoid;
}

.accountBank {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
}

.accountDetails {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-secondary, #475569);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  display: flex;
  justify-content: center;
  break-inside: avoid;
  page-break-inside: avoid;
}

.footerLink {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}

.footerLink:hover .footerName {
  color: var(--primary, #0a1628);
}

.footerLogo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.footerLabel {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted, #94a3b8);
  white-space: nowrap;
}

.footerName {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary, #475569);
  white-space: nowrap;
}

.muted {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary, #64748b);
}

.error {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #b91c1c;
}

@media (max-width: 640px) {
  .sheet {
    padding: 16px 14px 18px;
  }

  .item {
    flex-direction: column;
  }

  .itemPrice {
    align-items: flex-start;
  }

  .accountDetails {
    white-space: normal;
  }
}

/* —— Print / Save as PDF —— */
@media print {
  @page {
    size: A4;
    margin: 12mm 11mm;
  }

  :global(html),
  :global(body) {
    background: #fff !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .page {
    min-height: 0;
    padding: 0;
    background: #fff !important;
  }

  .toolbar {
    display: none !important;
  }

  .sheet {
    max-width: none;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: #fff !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .header {
    border-bottom-color: #cbd5e1;
  }

  .item,
  .account {
    background: #fff !important;
    border-color: #cbd5e1;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .itemPrice,
  .totals,
  .totalRow {
    color: #0f172a;
  }

  .footer {
    margin-top: 16px;
  }

  .footerLink {
    color: inherit;
  }

  .accountDetails {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }

  :global(a) {
    color: inherit;
    text-decoration: none;
  }
}
