/* Toolxora Business Toolkit - Invoice Generator v5 */
:root {
  --txbt-primary: #2563eb;
  --txbt-secondary: #7c3aed;
  --txbt-dark: #0f172a;
  --txbt-text: #475569;
  --txbt-muted: #64748b;
  --txbt-bg: #f8fafc;
  --txbt-card: #ffffff;
  --txbt-border: #e5e7eb;
  --txbt-danger: #ef4444;
  --txbt-shadow: 0 20px 60px rgba(15, 23, 42, .08);
}

.txbt-invoice-tool,
.txbt-invoice-tool * {
  box-sizing: border-box;
}

.txbt-invoice-tool {
  font-family: Inter, Arial, sans-serif;
  color: var(--txbt-dark);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border-radius: 28px;
}

.txbt-invoice-tool.txbt-dark {
  --txbt-dark: #f8fafc;
  --txbt-text: #cbd5e1;
  --txbt-muted: #94a3b8;
  --txbt-bg: #020617;
  --txbt-card: #0f172a;
  --txbt-border: #1e293b;
  background: #020617;
}

.txbt-top-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 28px;
  background: var(--txbt-card);
  border: 1px solid var(--txbt-border);
  border-radius: 26px;
  box-shadow: var(--txbt-shadow);
  margin-bottom: 22px;
}

.txbt-kicker {
  display: inline-flex;
  color: var(--txbt-primary);
  font-size: 13px;
  font-weight: 900;
  background: rgba(37, 99, 235, .10);
  padding: 8px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.txbt-top-actions h2 {
  margin: 0 0 8px;
  font-size: clamp(26px, 4vw, 40px);
  letter-spacing: -.045em;
}

.txbt-top-actions p {
  color: var(--txbt-muted);
  margin: 0;
}

.txbt-top-buttons,
.txbt-control-bar {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.txbt-control-bar {
  background: var(--txbt-card);
  border: 1px solid var(--txbt-border);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--txbt-shadow);
  margin-bottom: 22px;
}

.txbt-primary-btn,
.txbt-secondary-btn,
.txbt-light-btn,
.txbt-danger-btn,
.txbt-icon-btn {
  border: 0;
  border-radius: 14px;
  padding: 13px 18px;
  font-weight: 900;
  cursor: pointer;
  transition: .2s ease;
  white-space: nowrap;
}

.txbt-primary-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--txbt-primary), var(--txbt-secondary));
  box-shadow: 0 16px 34px rgba(37, 99, 235, .24);
}

.txbt-primary-btn:hover,
.txbt-secondary-btn:hover,
.txbt-light-btn:hover,
.txbt-icon-btn:hover {
  transform: translateY(-2px);
}

.txbt-secondary-btn {
  background: var(--txbt-dark);
  color: var(--txbt-card);
}

.txbt-light-btn,
.txbt-icon-btn {
  background: var(--txbt-bg);
  color: var(--txbt-dark);
  border: 1px solid var(--txbt-border);
}

.txbt-danger-btn {
  background: #fee2e2;
  color: #dc2626;
}

.txbt-full,
.txbt-bottom-print {
  width: 100%;
  justify-content: center;
  margin-bottom: 18px;
}

.txbt-bottom-print {
  margin-top: 22px;
  margin-bottom: 0;
  font-size: 16px;
  padding: 16px 20px;
}

.txbt-grid {
  display: grid;
  grid-template-columns: .95fr 1.05fr;
  gap: 24px;
  align-items: start;
}

.txbt-panel,
.txbt-preview-panel {
  background: var(--txbt-card);
  border: 1px solid var(--txbt-border);
  border-radius: 26px;
  box-shadow: var(--txbt-shadow);
  padding: 24px;
}

.txbt-preview-panel {
  position: sticky;
  top: 96px;
}

.txbt-section-title {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.txbt-section-title span {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--txbt-primary), var(--txbt-secondary));
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.txbt-section-title h3 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -.025em;
}

.txbt-section-title p {
  margin: 4px 0 0;
  color: var(--txbt-muted);
}

.txbt-small-title {
  margin-top: 28px;
}

.txbt-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.txbt-field {
  min-width: 160px;
}

.txbt-field label {
  display: block;
  font-weight: 900;
  font-size: 13px;
  margin-bottom: 8px;
  color: var(--txbt-dark);
}

.txbt-field input,
.txbt-field select,
.txbt-field textarea {
  width: 100%;
  border: 1px solid var(--txbt-border);
  background: var(--txbt-bg);
  color: var(--txbt-dark);
  border-radius: 14px;
  padding: 13px 15px;
  font-size: 14px;
  outline: none;
  transition: .18s ease;
}

.txbt-field textarea {
  min-height: 92px;
  resize: vertical;
  font-family: inherit;
}

.txbt-field input:focus,
.txbt-field select:focus,
.txbt-field textarea:focus {
  border-color: var(--txbt-primary);
  background: var(--txbt-card);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

.txbt-template-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.txbt-template-card {
  border: 2px solid var(--txbt-border);
  background: var(--txbt-card);
  color: var(--txbt-dark);
  border-radius: 18px;
  padding: 12px;
  cursor: pointer;
  text-align: left;
  transition: .2s ease;
}

.txbt-template-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--txbt-shadow);
}

.txbt-template-card.active {
  border-color: var(--txbt-primary);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

.txbt-template-card strong,
.txbt-template-card small {
  display: block;
}

.txbt-template-card strong {
  margin-top: 10px;
  font-size: 14px;
}

.txbt-template-card small {
  color: var(--txbt-muted);
  margin-top: 3px;
}

.txbt-template-thumb {
  display: block;
  height: 58px;
  border-radius: 12px;
  background: #f1f5f9;
  border: 1px solid var(--txbt-border);
  position: relative;
  overflow: hidden;
}

.txbt-template-thumb:before,
.txbt-template-thumb:after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  height: 7px;
  border-radius: 999px;
  background: #cbd5e1;
}

.txbt-template-thumb:before { top: 13px; }
.txbt-template-thumb:after { top: 28px; width: 60%; }

.txbt-template-thumb.modern { background: linear-gradient(135deg,#eff6ff,#f8fafc); border-top: 5px solid #2563eb; }
.txbt-template-thumb.corporate { background: #eff6ff; border-left: 7px solid #1e3a8a; }
.txbt-template-thumb.minimal { background: #fff; border: 1px solid #111827; }
.txbt-template-thumb.elegant { background: linear-gradient(135deg,#faf5ff,#fff7ed); border-top: 5px solid #7c3aed; }

.txbt-upload {
  display: block;
  border: 2px dashed #93c5fd;
  background: rgba(37,99,235,.08);
  color: var(--txbt-primary);
  text-align: center;
  padding: 22px;
  border-radius: 18px;
  cursor: pointer;
  margin-bottom: 18px;
}

.txbt-upload input {
  display: none;
}

.txbt-upload strong,
.txbt-upload span {
  display: block;
}

.txbt-upload span {
  margin-top: 5px;
  font-size: 13px;
}

.txbt-items {
  border: 1px solid var(--txbt-border);
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 14px;
}

.txbt-item-row {
  display: grid;
  grid-template-columns: 1.6fr .55fr .75fr 44px;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--txbt-border);
}

.txbt-item-row:last-child {
  border-bottom: 0;
}

.txbt-item-head {
  background: var(--txbt-dark);
  color: var(--txbt-card);
  font-weight: 900;
  font-size: 13px;
}

.txbt-item-row input {
  width: 100%;
  border: 1px solid var(--txbt-border);
  border-radius: 12px;
  padding: 11px 12px;
  background: var(--txbt-card);
  color: var(--txbt-dark);
}

.txbtRemoveItem {
  border: 0;
  background: var(--txbt-danger);
  color: #fff;
  border-radius: 10px;
  font-size: 18px;
  cursor: pointer;
}

.txbt-preview-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.txbt-preview-actions span {
  background: rgba(37,99,235,.10);
  color: var(--txbt-primary);
  padding: 7px 11px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 12px;
}

/* Base Invoice */
.txbt-invoice-paper {
  background: #fff;
  color: #111827;
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  padding: 36px;
  min-height: 760px;
  overflow: hidden;
  position: relative;
}

.txbt-preview-logo {
  display: none;
  max-width: 150px;
  max-height: 72px;
  object-fit: contain;
  margin-bottom: 14px;
}

.txbt-invoice-top {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: 24px;
  margin-bottom: 26px;
}

.txbt-invoice-top h2,
.txbt-invoice-meta h1 {
  margin: 0;
}

.txbt-invoice-top h2 {
  font-size: 26px;
  letter-spacing: -.03em;
}

.txbt-invoice-top p,
.txbt-invoice-meta p {
  color: #64748b;
  margin: 7px 0 0;
}

.txbt-invoice-meta {
  text-align: right;
  min-width: 190px;
}

.txbt-invoice-meta h1 {
  font-size: 38px;
  letter-spacing: 2px;
}

.txbt-status {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 12px;
  text-transform: uppercase;
}

.txbt-status.unpaid { background:#fee2e2;color:#dc2626; }
.txbt-status.paid { background:#dcfce7;color:#16a34a; }
.txbt-status.pending { background:#fef3c7;color:#d97706; }

.txbt-client-box {
  padding: 18px;
  margin-bottom: 24px;
}

.txbt-client-box span {
  color: #64748b;
  font-weight: 900;
  font-size: 12px;
  text-transform: uppercase;
}

.txbt-client-box h3 {
  margin: 7px 0 5px;
  font-size: 22px;
}

.txbt-client-box p {
  margin: 5px 0;
  color: #475569;
}

.txbt-preview-table {
  width: 100%;
  border-collapse: collapse;
}

.txbt-preview-table th {
  color: #fff;
  padding: 13px;
  text-align: left;
  font-size: 13px;
}

.txbt-preview-table td {
  padding: 14px 13px;
  border-bottom: 1px solid #e5e7eb;
  color: #374151;
}

.txbt-invoice-bottom {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 26px;
  margin-top: 28px;
}

.txbt-invoice-bottom h4 {
  margin: 0 0 8px;
  font-size: 15px;
}

.txbt-invoice-bottom p {
  color: #475569;
  line-height: 1.6;
}

.txbt-payment-box,
.txbt-qr-box {
  display: none;
  margin-top: 22px;
  padding: 16px;
  border-radius: 16px;
}

.txbt-payment-box p {
  margin: 6px 0;
}

.txbt-qr-box {
  text-align: center;
}

.txbt-qr-box img {
  width: 130px;
  height: 130px;
  object-fit: contain;
}

.txbt-qr-box p {
  word-break: break-all;
  font-size: 12px;
}

.txbt-total-box {
  border-radius: 18px;
  padding: 20px;
}

.txbt-total-box p,
.txbt-total-box h3 {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 13px;
}

.txbt-total-box h3 {
  padding-top: 15px;
  margin-top: 4px;
  font-size: 22px;
}

.txbt-powered {
  margin-top: 26px;
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
}

/* Modern Template */
.txbt-template-modern .txbt-invoice-top {
  border-bottom: 3px solid #111827;
}

.txbt-template-modern .txbt-client-box {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
}

.txbt-template-modern .txbt-preview-table th {
  background: #111827;
}

.txbt-template-modern .txbt-total-box,
.txbt-template-modern .txbt-payment-box,
.txbt-template-modern .txbt-qr-box {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
}

.txbt-template-modern .txbt-total-box h3 {
  border-top: 1px solid #d1d5db;
}

/* Corporate Template */
.txbt-template-corporate {
  border-radius: 0;
  padding: 0;
  border: 0;
}

.txbt-template-corporate .txbt-template-mark {
  height: 18px;
  background: #1e3a8a;
}

.txbt-template-corporate .txbt-invoice-top {
  background: #eff6ff;
  padding: 34px 36px;
  margin: 0;
  border-bottom: 0;
}

.txbt-template-corporate .txbt-invoice-meta {
  background: #1e3a8a;
  color: #fff;
  padding: 22px;
  border-radius: 16px;
}

.txbt-template-corporate .txbt-invoice-meta h1,
.txbt-template-corporate .txbt-invoice-meta p {
  color: #fff;
}

.txbt-template-corporate .txbt-client-box {
  margin: 26px 36px;
  background: #fff;
  border-left: 5px solid #1e3a8a;
  border-radius: 0;
  box-shadow: 0 8px 28px rgba(30,58,138,.08);
}

.txbt-template-corporate .txbt-preview-table {
  width: calc(100% - 72px);
  margin: 0 36px;
}

.txbt-template-corporate .txbt-preview-table th {
  background: #1e3a8a;
}

.txbt-template-corporate .txbt-invoice-bottom {
  margin: 28px 36px 0;
}

.txbt-template-corporate .txbt-total-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
}

.txbt-template-corporate .txbt-total-box h3 {
  border-top: 2px solid #1e3a8a;
}

/* Minimal Template */
.txbt-template-minimal {
  border-radius: 0;
  border: 1px solid #111827;
  padding: 42px;
}

.txbt-template-minimal .txbt-invoice-top {
  border-bottom: 1px solid #111827;
}

.txbt-template-minimal .txbt-invoice-meta h1 {
  font-size: 30px;
  letter-spacing: 0;
}

.txbt-template-minimal .txbt-client-box {
  padding: 0 0 20px;
  border-bottom: 1px solid #e5e7eb;
}

.txbt-template-minimal .txbt-preview-table th {
  background: transparent;
  color: #111827;
  border-bottom: 1px solid #111827;
  padding-left: 0;
}

.txbt-template-minimal .txbt-preview-table td {
  padding-left: 0;
}

.txbt-template-minimal .txbt-total-box {
  background: transparent;
  border: 0;
  padding: 0;
}

.txbt-template-minimal .txbt-total-box h3 {
  border-top: 1px solid #111827;
}

/* Elegant Template */
.txbt-template-elegant {
  background: linear-gradient(180deg, #ffffff, #faf7ff);
  border: 1px solid #ddd6fe;
}

.txbt-template-elegant .txbt-invoice-top {
  border-bottom: 3px solid #7c3aed;
}

.txbt-template-elegant .txbt-invoice-meta h1 {
  color: #7c3aed;
}

.txbt-template-elegant .txbt-client-box {
  background: #faf5ff;
  border: 1px solid #ddd6fe;
  border-radius: 22px;
}

.txbt-template-elegant .txbt-preview-table th {
  background: linear-gradient(135deg, #7c3aed, #9333ea);
}

.txbt-template-elegant .txbt-total-box,
.txbt-template-elegant .txbt-payment-box,
.txbt-template-elegant .txbt-qr-box {
  background: #faf5ff;
  border: 1px solid #ddd6fe;
}

.txbt-template-elegant .txbt-total-box h3 {
  border-top: 1px solid #c4b5fd;
  color: #6d28d9;
}

@media (max-width: 1100px) {
  .txbt-grid {
    grid-template-columns: 1fr;
  }
  .txbt-preview-panel {
    position: relative;
    top: 0;
  }
}

@media (max-width: 820px) {
  .txbt-template-cards {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .txbt-top-actions,
  .txbt-control-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .txbt-top-buttons {
    flex-direction: column;
  }

  .txbt-form-grid,
  .txbt-invoice-bottom {
    grid-template-columns: 1fr;
  }

  .txbt-item-row {
    grid-template-columns: 1fr;
  }

  .txbt-item-head {
    display: none;
  }

  .txbt-invoice-paper,
  .txbt-template-minimal {
    padding: 22px;
  }

  .txbt-template-corporate {
    padding: 0;
  }

  .txbt-template-corporate .txbt-invoice-top,
  .txbt-template-corporate .txbt-client-box,
  .txbt-template-corporate .txbt-invoice-bottom {
    margin-left: 18px;
    margin-right: 18px;
  }

  .txbt-template-corporate .txbt-invoice-top {
    padding: 24px 18px;
    margin: 0;
  }

  .txbt-template-corporate .txbt-preview-table {
    width: calc(100% - 36px);
    margin: 0 18px;
  }

  .txbt-invoice-top {
    flex-direction: column;
  }

  .txbt-invoice-meta {
    text-align: left;
  }
}

@media (max-width: 520px) {
  .txbt-template-cards {
    grid-template-columns: 1fr;
  }
}


/* v5 Same-DOM Print Engine */
.txbt-print-area {
  display: none;
}

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

  html,
  body {
    background: #ffffff !important;
  }

  body * {
    visibility: hidden !important;
  }

  #txbtPrintArea,
  #txbtPrintArea * {
    visibility: visible !important;
  }

  #txbtPrintArea {
    display: block !important;
    position: absolute !important;
    inset: 0 auto auto 0 !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #ffffff !important;
    z-index: 999999 !important;
  }

  #txbtPrintArea .txbt-invoice-paper {
    width: 100% !important;
    max-width: 100% !important;
    min-height: auto !important;
    margin: 0 !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  #txbtPrintArea .txbt-invoice-paper,
  #txbtPrintArea .txbt-invoice-paper * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  #txbtPrintArea .txbt-template-modern {
    padding: 18px !important;
    border: 0 !important;
    border-radius: 0 !important;
  }

  #txbtPrintArea .txbt-template-corporate {
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
  }

  #txbtPrintArea .txbt-template-corporate .txbt-template-mark {
    background: #1e3a8a !important;
    height: 16px !important;
  }

  #txbtPrintArea .txbt-template-corporate .txbt-invoice-top {
    background: #eff6ff !important;
    padding: 28px 30px !important;
  }

  #txbtPrintArea .txbt-template-corporate .txbt-invoice-meta {
    background: #1e3a8a !important;
    color: #ffffff !important;
  }

  #txbtPrintArea .txbt-template-corporate .txbt-invoice-meta h1,
  #txbtPrintArea .txbt-template-corporate .txbt-invoice-meta p,
  #txbtPrintArea .txbt-template-corporate .txbt-invoice-meta strong,
  #txbtPrintArea .txbt-template-corporate .txbt-invoice-meta span {
    color: #ffffff !important;
  }

  #txbtPrintArea .txbt-template-corporate .txbt-preview-table th {
    background: #1e3a8a !important;
    color: #ffffff !important;
  }

  #txbtPrintArea .txbt-template-corporate .txbt-client-box {
    box-shadow: none !important;
  }

  #txbtPrintArea .txbt-template-elegant {
    background: linear-gradient(180deg, #ffffff, #faf7ff) !important;
  }

  #txbtPrintArea .txbt-template-elegant .txbt-preview-table th {
    background: #7c3aed !important;
    color: #ffffff !important;
  }

  #txbtPrintArea .txbt-template-elegant .txbt-invoice-meta h1,
  #txbtPrintArea .txbt-template-elegant .txbt-total-box h3 {
    color: #7c3aed !important;
  }

  #txbtPrintArea .txbt-template-minimal {
    padding: 20px !important;
    border: 1px solid #111827 !important;
    border-radius: 0 !important;
  }

  #txbtPrintArea .txbt-invoice-top,
  #txbtPrintArea .txbt-invoice-bottom,
  #txbtPrintArea .txbt-total-box,
  #txbtPrintArea .txbt-payment-box,
  #txbtPrintArea .txbt-qr-box,
  #txbtPrintArea .txbt-powered {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  #txbtPrintArea .txbt-preview-table {
    page-break-inside: auto !important;
  }

  #txbtPrintArea .txbt-preview-table tr {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  #txbtPrintArea .txbt-powered {
    margin-top: 16px !important;
  }
}


/* Quote Generator v6.1 fixed styles */
.txbt-status.draft { background:#e0f2fe;color:#0369a1; }
.txbt-status.sent { background:#fef3c7;color:#d97706; }
.txbt-status.accepted { background:#dcfce7;color:#16a34a; }

@media print {
  #txbtqPrintArea,
  #txbtqPrintArea * {
    visibility: visible !important;
  }

  #txbtqPrintArea {
    display: block !important;
    position: absolute !important;
    inset: 0 auto auto 0 !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #ffffff !important;
    z-index: 999999 !important;
  }

  #txbtqPrintArea .txbt-invoice-paper {
    width: 100% !important;
    max-width: 100% !important;
    min-height: auto !important;
    margin: 0 !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  #txbtqPrintArea .txbt-invoice-paper,
  #txbtqPrintArea .txbt-invoice-paper * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  #txbtqPrintArea .txbt-template-corporate .txbt-template-mark { background:#1e3a8a !important; height:16px !important; }
  #txbtqPrintArea .txbt-template-corporate .txbt-invoice-top { background:#eff6ff !important; padding:28px 30px !important; }
  #txbtqPrintArea .txbt-template-corporate .txbt-invoice-meta { background:#1e3a8a !important; color:#fff !important; }
  #txbtqPrintArea .txbt-template-corporate .txbt-invoice-meta h1,
  #txbtqPrintArea .txbt-template-corporate .txbt-invoice-meta p,
  #txbtqPrintArea .txbt-template-corporate .txbt-invoice-meta strong,
  #txbtqPrintArea .txbt-template-corporate .txbt-invoice-meta span { color:#fff !important; }
  #txbtqPrintArea .txbt-template-corporate .txbt-preview-table th { background:#1e3a8a !important; color:#fff !important; }
  #txbtqPrintArea .txbt-template-elegant .txbt-preview-table th { background:#7c3aed !important; color:#fff !important; }
}

/* v10 popup print engine disables in-page print containers */
@media print{.txbt-print-area,.txdoc-print-area{display:none!important}}

/* v11 print popup safety */
@media print{.txbt-print-area{display:none!important}}

/* v12 no-popup iframe print */
.txbt-print-frame-v12{position:fixed!important;width:0!important;height:0!important;border:0!important;opacity:0!important;pointer-events:none!important}
@media print{.txbt-print-frame-v12,.txbt-print-area,.txdoc-print-area{display:none!important}}

/* v13 single-run iframe print */
.txbt-print-frame-v13{position:fixed!important;width:0!important;height:0!important;border:0!important;opacity:0!important;pointer-events:none!important}
@media print{.txbt-print-frame-v13,.txbt-print-frame-v12,.txbt-print-area,.txdoc-print-area{display:none!important}}

/* Toolxora Business Toolkit v14 - theme controlled */
.txdoc-hero,.txbt-hero,.txdoc-tool-hero,.txbt-tool-hero,.txdoc-header-card,.txbt-header-card,.txdoc-top-hero,.txbt-top-hero,.txdoc-generator-hero,.txbt-generator-hero,.txdoc-top,.txbt-top{display:none!important}
.txdoc-dark-toggle,.txbt-dark-toggle,.txdoc-theme-toggle,.txbt-theme-toggle,.txdoc-mode-toggle,.txbt-mode-toggle{display:none!important}
.txdoc-tool,.txbt-invoice-generator{padding-top:0!important;overflow:visible!important}
.txdoc-preview-panel,.txbt-preview-panel,.txdoc-preview-wrap,.txbt-preview-wrap,.txdoc-live-preview,.txbt-live-preview,[data-preview-panel]{position:sticky!important;top:110px!important;align-self:flex-start!important;height:fit-content!important;z-index:3}
.txdoc-grid,.txbt-grid,.txdoc-layout,.txbt-layout,.txdoc-app-grid,.txbt-app-grid{align-items:flex-start!important;overflow:visible!important}
.txdoc-panel,.txbt-panel{overflow:visible!important}
@media(max-width:1024px){.txdoc-preview-panel,.txbt-preview-panel,.txdoc-preview-wrap,.txbt-preview-wrap,.txdoc-live-preview,.txbt-live-preview,[data-preview-panel]{position:relative!important;top:auto!important}}
body.tx-dark-mode .txdoc-tool,html.tx-dark-mode .txdoc-tool,body.tx-dark-mode .txbt-invoice-generator,html.tx-dark-mode .txbt-invoice-generator{background:#020617!important;color:#e5e7eb!important}
body.tx-dark-mode .txdoc-panel,body.tx-dark-mode .txdoc-control,body.tx-dark-mode .txdoc-preview-panel,body.tx-dark-mode .txdoc-preview-wrap,body.tx-dark-mode .txbt-panel,body.tx-dark-mode .txbt-control,body.tx-dark-mode .txbt-preview-panel,body.tx-dark-mode .txbt-preview-wrap,body.tx-dark-mode .txbt-card,html.tx-dark-mode .txdoc-panel,html.tx-dark-mode .txdoc-control,html.tx-dark-mode .txdoc-preview-panel,html.tx-dark-mode .txdoc-preview-wrap,html.tx-dark-mode .txbt-panel,html.tx-dark-mode .txbt-control,html.tx-dark-mode .txbt-preview-panel,html.tx-dark-mode .txbt-preview-wrap,html.tx-dark-mode .txbt-card{background:#0f172a!important;color:#e5e7eb!important;border-color:#1e293b!important}
body.tx-dark-mode .txdoc-field input,body.tx-dark-mode .txdoc-field select,body.tx-dark-mode .txdoc-field textarea,body.tx-dark-mode .txbt-field input,body.tx-dark-mode .txbt-field select,body.tx-dark-mode .txbt-field textarea,html.tx-dark-mode .txdoc-field input,html.tx-dark-mode .txdoc-field select,html.tx-dark-mode .txdoc-field textarea,html.tx-dark-mode .txbt-field input,html.tx-dark-mode .txbt-field select,html.tx-dark-mode .txbt-field textarea{background:#111827!important;color:#e5e7eb!important;border-color:#334155!important}
body.tx-dark-mode .txdoc-template-card,body.tx-dark-mode .txbt-template-card,body.tx-dark-mode .txdoc-item-row,body.tx-dark-mode .txbt-item-row,html.tx-dark-mode .txdoc-template-card,html.tx-dark-mode .txbt-template-card,html.tx-dark-mode .txdoc-item-row,html.tx-dark-mode .txbt-item-row{background:#111827!important;color:#e5e7eb!important;border-color:#334155!important}
body.tx-dark-mode .txdoc-paper,body.tx-dark-mode .txdoc-paper *,body.tx-dark-mode .txbt-invoice-paper,body.tx-dark-mode .txbt-invoice-paper *,html.tx-dark-mode .txdoc-paper,html.tx-dark-mode .txdoc-paper *,html.tx-dark-mode .txbt-invoice-paper,html.tx-dark-mode .txbt-invoice-paper *{color-scheme:light!important}
body.tx-dark-mode .txdoc-paper,body.tx-dark-mode .txbt-invoice-paper,html.tx-dark-mode .txdoc-paper,html.tx-dark-mode .txbt-invoice-paper{background:#fff!important;color:#111827!important}

/* Toolxora Business Toolkit v15 - remove remaining internal hero/header cards */
.txbt-invoice-generator > .txbt-card:first-child,
.txbt-invoice-generator > .txbt-header:first-child,
.txbt-invoice-generator > .txbt-intro:first-child,
.txbt-invoice-generator > .txbt-hero:first-child,
.txbt-invoice-generator > .txbt-tool-header:first-child,
.txbt-invoice-generator > .txbt-generator-header:first-child,
.txbt-invoice-generator .txbt-top,
.txbt-invoice-generator .txbt-hero,
.txbt-invoice-generator .txbt-header,
.txbt-invoice-generator .txbt-intro,
.txbt-invoice-generator .txbt-tool-header,
.txbt-invoice-generator .txbt-generator-header {
  display: none !important;
}
.txbt-badge,
.txbt-tool-badge,
.txbt-kicker,
.txbt-invoice-generator .txbt-badge,
.txbt-invoice-generator .txbt-tool-badge,
.txbt-invoice-generator .txbt-kicker {
  display: none !important;
}
@supports selector(:has(*)) {
  .txbt-invoice-generator > section:first-child:has(.txbt-badge),
  .txbt-invoice-generator > div:first-child:has(.txbt-badge),
  .txbt-invoice-generator > section:first-child:has(.txbt-title),
  .txbt-invoice-generator > div:first-child:has(.txbt-title),
  .txbt-invoice-generator .txbt-card:has(.txbt-badge),
  .txbt-invoice-generator .txbt-card:has(.txbt-kicker),
  .txbt-invoice-generator .txbt-card:has(.txbt-tool-badge),
  .txbt-invoice-generator .txbt-card:has(.txbt-title) {
    display: none !important;
  }
}

/* v16 backup: remove internal generator headers */
.txbt-invoice-generator .txbt-top,
.txbt-invoice-generator .txbt-hero,
.txbt-invoice-generator .txbt-header,
.txbt-invoice-generator .txbt-intro,
.txbt-invoice-generator .txbt-tool-header,
.txbt-invoice-generator .txbt-generator-header,
.txdoc-tool .txdoc-top,
.txdoc-tool .txdoc-hero,
.txdoc-tool .txdoc-header,
.txdoc-tool .txdoc-intro {
  display: none !important;
}
@supports selector(:has(*)) {
  .txbt-invoice-generator div:has(> .txbt-badge):has(button),
  .txbt-invoice-generator section:has(> .txbt-badge):has(button),
  .txbt-invoice-generator div:has(> .txbt-kicker):has(button),
  .txbt-invoice-generator section:has(> .txbt-kicker):has(button) {
    display: none !important;
  }
}

/* Toolxora Business Toolkit v17 actual layout/sticky fix */
.txbt-invoice-tool,
.txdoc-tool {
  overflow: visible !important;
}

.txbt-grid,
.txdoc-grid {
  align-items: flex-start !important;
  overflow: visible !important;
}

.txbt-panel,
.txdoc-panel {
  overflow: visible !important;
}

.txbt-preview-panel,
.txdoc-preview-panel {
  position: sticky !important;
  top: 96px !important;
  align-self: flex-start !important;
  height: fit-content !important;
  z-index: 5 !important;
}

@media(max-width:1100px){
  .txbt-preview-panel,
  .txdoc-preview-panel {
    position: relative !important;
    top: auto !important;
  }
}

/* theme-controlled dark mode, actual roots */
body.tx-dark-mode .txbt-invoice-tool,
html.tx-dark-mode .txbt-invoice-tool,
html[data-theme="dark"] .txbt-invoice-tool,
body.tx-dark-mode .txdoc-tool,
html.tx-dark-mode .txdoc-tool,
html[data-theme="dark"] .txdoc-tool {
  background: #020617 !important;
  color: #e5e7eb !important;
}

body.tx-dark-mode .txbt-panel,
body.tx-dark-mode .txbt-control-bar,
body.tx-dark-mode .txbt-preview-panel,
body.tx-dark-mode .txdoc-panel,
body.tx-dark-mode .txdoc-control,
body.tx-dark-mode .txdoc-preview-panel,
html[data-theme="dark"] .txbt-panel,
html[data-theme="dark"] .txbt-control-bar,
html[data-theme="dark"] .txbt-preview-panel,
html[data-theme="dark"] .txdoc-panel,
html[data-theme="dark"] .txdoc-control,
html[data-theme="dark"] .txdoc-preview-panel {
  background: #0f172a !important;
  color: #e5e7eb !important;
  border-color: #1e293b !important;
}

body.tx-dark-mode .txbt-field input,
body.tx-dark-mode .txbt-field select,
body.tx-dark-mode .txbt-field textarea,
body.tx-dark-mode .txdoc-field input,
body.tx-dark-mode .txdoc-field select,
body.tx-dark-mode .txdoc-field textarea,
html[data-theme="dark"] .txbt-field input,
html[data-theme="dark"] .txbt-field select,
html[data-theme="dark"] .txbt-field textarea,
html[data-theme="dark"] .txdoc-field input,
html[data-theme="dark"] .txdoc-field select,
html[data-theme="dark"] .txdoc-field textarea {
  background: #111827 !important;
  color: #e5e7eb !important;
  border-color: #334155 !important;
}

/* PDF paper white */
body.tx-dark-mode .txbt-invoice-paper,
body.tx-dark-mode .txbt-invoice-paper *,
body.tx-dark-mode .txdoc-paper,
body.tx-dark-mode .txdoc-paper *,
html[data-theme="dark"] .txbt-invoice-paper,
html[data-theme="dark"] .txbt-invoice-paper *,
html[data-theme="dark"] .txdoc-paper,
html[data-theme="dark"] .txdoc-paper * {
  color-scheme: light !important;
}
body.tx-dark-mode .txbt-invoice-paper,
body.tx-dark-mode .txdoc-paper,
html[data-theme="dark"] .txbt-invoice-paper,
html[data-theme="dark"] .txdoc-paper {
  background: #fff !important;
  color: #111827 !important;
}

/* Toolxora Business Toolkit v18 - real invoice restore + sticky fix */
.txbt-template-cards{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:14px!important;align-items:stretch!important;overflow:visible!important}
.txbt-template-card{display:block!important;visibility:visible!important;opacity:1!important}
.txbt-template-card[data-template="modern"]{display:block!important}
.txbt-invoice-tool,.txdoc-tool{overflow:visible!important}
.txbt-grid,.txdoc-grid{align-items:flex-start!important;overflow:visible!important;display:grid!important}
.txbt-panel,.txdoc-panel{overflow:visible!important;min-width:0!important}
.txbt-preview-panel,.txdoc-preview-panel{position:sticky!important;top:96px!important;align-self:flex-start!important;max-height:none!important;overflow:visible!important;height:auto!important;z-index:60!important}
@media(max-width:1100px){.txbt-grid,.txdoc-grid{grid-template-columns:1fr!important}.txbt-preview-panel,.txdoc-preview-panel{position:relative!important;top:auto!important;max-height:none!important;overflow:visible!important}}
@media(max-width:820px){.txbt-template-cards{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:520px){.txbt-template-cards{grid-template-columns:1fr!important}}
body.tx-dark-mode .txbt-invoice-tool,html.tx-dark-mode .txbt-invoice-tool,html[data-theme="dark"] .txbt-invoice-tool,body.tx-dark-mode .txdoc-tool,html.tx-dark-mode .txdoc-tool,html[data-theme="dark"] .txdoc-tool{background:#020617!important;color:#e5e7eb!important}
body.tx-dark-mode .txbt-panel,body.tx-dark-mode .txbt-control-bar,body.tx-dark-mode .txbt-preview-panel,body.tx-dark-mode .txbt-card,body.tx-dark-mode .txbt-template-card,body.tx-dark-mode .txbt-item-row,body.tx-dark-mode .txdoc-panel,body.tx-dark-mode .txdoc-control,body.tx-dark-mode .txdoc-preview-panel,body.tx-dark-mode .txdoc-template-card,html[data-theme="dark"] .txbt-panel,html[data-theme="dark"] .txbt-control-bar,html[data-theme="dark"] .txbt-preview-panel,html[data-theme="dark"] .txbt-card,html[data-theme="dark"] .txbt-template-card,html[data-theme="dark"] .txbt-item-row,html[data-theme="dark"] .txdoc-panel,html[data-theme="dark"] .txdoc-control,html[data-theme="dark"] .txdoc-preview-panel,html[data-theme="dark"] .txdoc-template-card{background:#0f172a!important;color:#e5e7eb!important;border-color:#1e293b!important}
body.tx-dark-mode .txbt-field input,body.tx-dark-mode .txbt-field select,body.tx-dark-mode .txbt-field textarea,body.tx-dark-mode .txdoc-field input,body.tx-dark-mode .txdoc-field select,body.tx-dark-mode .txdoc-field textarea,html[data-theme="dark"] .txbt-field input,html[data-theme="dark"] .txbt-field select,html[data-theme="dark"] .txbt-field textarea,html[data-theme="dark"] .txdoc-field input,html[data-theme="dark"] .txdoc-field select,html[data-theme="dark"] .txdoc-field textarea{background:#111827!important;color:#e5e7eb!important;border-color:#334155!important}
body.tx-dark-mode .txbt-invoice-paper,body.tx-dark-mode .txbt-invoice-paper *,body.tx-dark-mode .txdoc-paper,body.tx-dark-mode .txdoc-paper *,html[data-theme="dark"] .txbt-invoice-paper,html[data-theme="dark"] .txbt-invoice-paper *,html[data-theme="dark"] .txdoc-paper,html[data-theme="dark"] .txdoc-paper *{color-scheme:light!important}
body.tx-dark-mode .txbt-invoice-paper,body.tx-dark-mode .txdoc-paper,html[data-theme="dark"] .txbt-invoice-paper,html[data-theme="dark"] .txdoc-paper{background:#fff!important;color:#111827!important}

/* =========================================================
   Toolxora Business Toolkit v19 FINAL: no internal preview scrollbar + sticky
   ========================================================= */
.txbt-invoice-tool,.txdoc-tool,.txbt-grid,.txdoc-grid,.txbt-panel,.txdoc-panel{overflow:visible!important}.txbt-grid,.txdoc-grid{align-items:flex-start!important}.txbt-preview-panel,.txdoc-preview-panel{position:sticky!important;top:96px!important;align-self:flex-start!important;height:auto!important;max-height:none!important;overflow:visible!important;z-index:60!important}.txbt-preview-panel .txbt-invoice-paper,.txdoc-preview-panel .txdoc-paper{max-height:none!important;overflow:visible!important}@media(max-width:1100px){.txbt-grid,.txdoc-grid{grid-template-columns:1fr!important}.txbt-preview-panel,.txdoc-preview-panel{position:relative!important;top:auto!important;max-height:none!important;overflow:visible!important}}
/* Follow theme dark mode */
body.tx-dark-mode .txbt-invoice-tool,html[data-theme="dark"] .txbt-invoice-tool,body.tx-dark-mode .txdoc-tool,html[data-theme="dark"] .txdoc-tool{background:#020617!important;color:#e5e7eb!important}body.tx-dark-mode .txbt-panel,body.tx-dark-mode .txbt-control-bar,body.tx-dark-mode .txbt-preview-panel,body.tx-dark-mode .txbt-card,body.tx-dark-mode .txbt-template-card,body.tx-dark-mode .txbt-item-row,body.tx-dark-mode .txdoc-panel,body.tx-dark-mode .txdoc-control,body.tx-dark-mode .txdoc-preview-panel,body.tx-dark-mode .txdoc-template-card,html[data-theme="dark"] .txbt-panel,html[data-theme="dark"] .txbt-control-bar,html[data-theme="dark"] .txbt-preview-panel,html[data-theme="dark"] .txbt-card,html[data-theme="dark"] .txbt-template-card,html[data-theme="dark"] .txbt-item-row,html[data-theme="dark"] .txdoc-panel,html[data-theme="dark"] .txdoc-control,html[data-theme="dark"] .txdoc-preview-panel,html[data-theme="dark"] .txdoc-template-card{background:#0f172a!important;color:#e5e7eb!important;border-color:#1e293b!important}body.tx-dark-mode .txbt-field input,body.tx-dark-mode .txbt-field select,body.tx-dark-mode .txbt-field textarea,body.tx-dark-mode .txdoc-field input,body.tx-dark-mode .txdoc-field select,body.tx-dark-mode .txdoc-field textarea,html[data-theme="dark"] .txbt-field input,html[data-theme="dark"] .txbt-field select,html[data-theme="dark"] .txbt-field textarea,html[data-theme="dark"] .txdoc-field input,html[data-theme="dark"] .txdoc-field select,html[data-theme="dark"] .txdoc-field textarea{background:#111827!important;color:#e5e7eb!important;border-color:#334155!important}body.tx-dark-mode .txbt-invoice-paper,body.tx-dark-mode .txbt-invoice-paper *,body.tx-dark-mode .txdoc-paper,body.tx-dark-mode .txdoc-paper *,html[data-theme="dark"] .txbt-invoice-paper,html[data-theme="dark"] .txbt-invoice-paper *,html[data-theme="dark"] .txdoc-paper,html[data-theme="dark"] .txdoc-paper *{color-scheme:light!important}body.tx-dark-mode .txbt-invoice-paper,body.tx-dark-mode .txdoc-paper,html[data-theme="dark"] .txbt-invoice-paper,html[data-theme="dark"] .txdoc-paper{background:#fff!important;color:#111827!important}

/* =========================================================
   Toolxora Business Toolkit v20 FINAL: sticky preview, no internal scrollbar
   ========================================================= */
.txbt-invoice-tool,.txdoc-tool{overflow:visible!important}
.txbt-grid,.txdoc-grid{align-items:flex-start!important;overflow:visible!important}
.txbt-panel,.txdoc-panel{overflow:visible!important;min-width:0!important}
.txbt-preview-panel,.txdoc-preview-panel{
  position:-webkit-sticky!important;
  position:sticky!important;
  top:96px!important;
  align-self:flex-start!important;
  height:auto!important;
  max-height:none!important;
  overflow:visible!important;
  z-index:80!important;
}
.txbt-preview-panel::-webkit-scrollbar,.txdoc-preview-panel::-webkit-scrollbar{display:none}
.txbt-preview-panel,.txdoc-preview-panel{scrollbar-width:none}
.txbt-preview-panel .txbt-invoice-paper,.txdoc-preview-panel .txdoc-paper{max-height:none!important;overflow:visible!important}
@media(max-width:1100px){
  .txbt-grid,.txdoc-grid{grid-template-columns:1fr!important}
  .txbt-preview-panel,.txdoc-preview-panel{position:relative!important;top:auto!important;max-height:none!important;overflow:visible!important}
}
/* Theme dark mode follows body/html */
body.tx-dark-mode .txbt-invoice-tool,body.tx-dark-mode .txdoc-tool,html[data-theme="dark"] .txbt-invoice-tool,html[data-theme="dark"] .txdoc-tool{background:#020617!important;color:#e5e7eb!important}
body.tx-dark-mode .txbt-panel,body.tx-dark-mode .txbt-control-bar,body.tx-dark-mode .txbt-preview-panel,body.tx-dark-mode .txbt-card,body.tx-dark-mode .txbt-template-card,body.tx-dark-mode .txbt-item-row,body.tx-dark-mode .txdoc-panel,body.tx-dark-mode .txdoc-control,body.tx-dark-mode .txdoc-preview-panel,body.tx-dark-mode .txdoc-template-card,body.tx-dark-mode .txdoc-item-row,
html[data-theme="dark"] .txbt-panel,html[data-theme="dark"] .txbt-control-bar,html[data-theme="dark"] .txbt-preview-panel,html[data-theme="dark"] .txbt-card,html[data-theme="dark"] .txbt-template-card,html[data-theme="dark"] .txbt-item-row,html[data-theme="dark"] .txdoc-panel,html[data-theme="dark"] .txdoc-control,html[data-theme="dark"] .txdoc-preview-panel,html[data-theme="dark"] .txdoc-template-card,html[data-theme="dark"] .txdoc-item-row{background:#0f172a!important;color:#e5e7eb!important;border-color:#1e293b!important}
body.tx-dark-mode .txbt-field input,body.tx-dark-mode .txbt-field select,body.tx-dark-mode .txbt-field textarea,body.tx-dark-mode .txdoc-field input,body.tx-dark-mode .txdoc-field select,body.tx-dark-mode .txdoc-field textarea,
html[data-theme="dark"] .txbt-field input,html[data-theme="dark"] .txbt-field select,html[data-theme="dark"] .txbt-field textarea,html[data-theme="dark"] .txdoc-field input,html[data-theme="dark"] .txdoc-field select,html[data-theme="dark"] .txdoc-field textarea{background:#111827!important;color:#e5e7eb!important;border-color:#334155!important}
body.tx-dark-mode .txbt-invoice-paper,body.tx-dark-mode .txbt-invoice-paper *,body.tx-dark-mode .txdoc-paper,body.tx-dark-mode .txdoc-paper *,html[data-theme="dark"] .txbt-invoice-paper,html[data-theme="dark"] .txbt-invoice-paper *,html[data-theme="dark"] .txdoc-paper,html[data-theme="dark"] .txdoc-paper *{color-scheme:light!important}
body.tx-dark-mode .txbt-invoice-paper,body.tx-dark-mode .txdoc-paper,html[data-theme="dark"] .txbt-invoice-paper,html[data-theme="dark"] .txdoc-paper{background:#fff!important;color:#111827!important}

/* v21 final override specific previous preview scrollbar rule */
.txbt-invoice-tool .txbt-preview-panel,
.txdoc-tool .txdoc-preview-panel{
  position:-webkit-sticky!important;
  position:sticky!important;
  top:96px!important;
  align-self:flex-start!important;
  height:auto!important;
  max-height:none!important;
  overflow-x:visible!important;
  overflow-y:visible!important;
  overflow:visible!important;
  z-index:100!important;
}
@media(max-width:1100px){
  .txbt-invoice-tool .txbt-preview-panel,
  .txdoc-tool .txdoc-preview-panel{
    position:relative!important;
    top:auto!important;
  }
}

/* v21 verified sticky override: overflow-x hidden on body breaks position:sticky */
html,body{
  overflow-x:clip!important;
  overflow-y:visible!important;
}
@supports not (overflow-x:clip){
  html{overflow-x:hidden!important;overflow-y:visible!important}
  body{overflow-x:visible!important;overflow-y:visible!important}
}


/* =========================================================
   Toolxora Business Toolkit v21
   PDF/Live Preview paper must stay exactly light in dark mode
   ========================================================= */

body.tx-dark-mode .txbt-preview-panel,
html.tx-dark-mode .txbt-preview-panel,
html[data-theme="dark"] .txbt-preview-panel,
body.tx-dark-mode .txdoc-preview-panel,
html.tx-dark-mode .txdoc-preview-panel,
html[data-theme="dark"] .txdoc-preview-panel {
  color-scheme: light !important;
}

/* Paper container stays white */
body.tx-dark-mode .txbt-invoice-paper,
html.tx-dark-mode .txbt-invoice-paper,
html[data-theme="dark"] .txbt-invoice-paper,
body.tx-dark-mode .txdoc-paper,
html.tx-dark-mode .txdoc-paper,
html[data-theme="dark"] .txdoc-paper {
  background: #ffffff !important;
  color: #111827 !important;
  color-scheme: light !important;
}

/* Neutralize global dark text rules inside paper */
body.tx-dark-mode .txbt-invoice-paper h1,
body.tx-dark-mode .txbt-invoice-paper h2,
body.tx-dark-mode .txbt-invoice-paper h3,
body.tx-dark-mode .txbt-invoice-paper h4,
body.tx-dark-mode .txbt-invoice-paper h5,
body.tx-dark-mode .txbt-invoice-paper h6,
body.tx-dark-mode .txbt-invoice-paper p,
body.tx-dark-mode .txbt-invoice-paper div,
body.tx-dark-mode .txbt-invoice-paper span,
body.tx-dark-mode .txbt-invoice-paper td,
body.tx-dark-mode .txbt-invoice-paper th,
body.tx-dark-mode .txbt-invoice-paper strong,
body.tx-dark-mode .txbt-invoice-paper b,
body.tx-dark-mode .txbt-invoice-paper small,
html[data-theme="dark"] .txbt-invoice-paper h1,
html[data-theme="dark"] .txbt-invoice-paper h2,
html[data-theme="dark"] .txbt-invoice-paper h3,
html[data-theme="dark"] .txbt-invoice-paper h4,
html[data-theme="dark"] .txbt-invoice-paper h5,
html[data-theme="dark"] .txbt-invoice-paper h6,
html[data-theme="dark"] .txbt-invoice-paper p,
html[data-theme="dark"] .txbt-invoice-paper div,
html[data-theme="dark"] .txbt-invoice-paper span,
html[data-theme="dark"] .txbt-invoice-paper td,
html[data-theme="dark"] .txbt-invoice-paper th,
html[data-theme="dark"] .txbt-invoice-paper strong,
html[data-theme="dark"] .txbt-invoice-paper b,
html[data-theme="dark"] .txbt-invoice-paper small,
body.tx-dark-mode .txdoc-paper h1,
body.tx-dark-mode .txdoc-paper h2,
body.tx-dark-mode .txdoc-paper h3,
body.tx-dark-mode .txdoc-paper h4,
body.tx-dark-mode .txdoc-paper h5,
body.tx-dark-mode .txdoc-paper h6,
body.tx-dark-mode .txdoc-paper p,
body.tx-dark-mode .txdoc-paper div,
body.tx-dark-mode .txdoc-paper span,
body.tx-dark-mode .txdoc-paper td,
body.tx-dark-mode .txdoc-paper th,
body.tx-dark-mode .txdoc-paper strong,
body.tx-dark-mode .txdoc-paper b,
body.tx-dark-mode .txdoc-paper small,
html[data-theme="dark"] .txdoc-paper h1,
html[data-theme="dark"] .txdoc-paper h2,
html[data-theme="dark"] .txdoc-paper h3,
html[data-theme="dark"] .txdoc-paper h4,
html[data-theme="dark"] .txdoc-paper h5,
html[data-theme="dark"] .txdoc-paper h6,
html[data-theme="dark"] .txdoc-paper p,
html[data-theme="dark"] .txdoc-paper div,
html[data-theme="dark"] .txdoc-paper span,
html[data-theme="dark"] .txdoc-paper td,
html[data-theme="dark"] .txdoc-paper th,
html[data-theme="dark"] .txdoc-paper strong,
html[data-theme="dark"] .txdoc-paper b,
html[data-theme="dark"] .txdoc-paper small {
  color: #111827 !important;
}

/* Secondary/muted text in paper should remain readable like light mode */
body.tx-dark-mode .txbt-invoice-paper .muted,
body.tx-dark-mode .txbt-invoice-paper .txbt-muted,
body.tx-dark-mode .txbt-invoice-paper .txbt-paper-muted,
body.tx-dark-mode .txbt-invoice-paper .txbt-invoice-muted,
body.tx-dark-mode .txbt-invoice-paper [class*="muted"],
body.tx-dark-mode .txdoc-paper .muted,
body.tx-dark-mode .txdoc-paper .txdoc-muted,
body.tx-dark-mode .txdoc-paper [class*="muted"],
html[data-theme="dark"] .txbt-invoice-paper .muted,
html[data-theme="dark"] .txbt-invoice-paper .txbt-muted,
html[data-theme="dark"] .txbt-invoice-paper .txbt-paper-muted,
html[data-theme="dark"] .txbt-invoice-paper .txbt-invoice-muted,
html[data-theme="dark"] .txbt-invoice-paper [class*="muted"],
html[data-theme="dark"] .txdoc-paper .muted,
html[data-theme="dark"] .txdoc-paper .txdoc-muted,
html[data-theme="dark"] .txdoc-paper [class*="muted"] {
  color: #64748b !important;
}

/* Preserve invoice/quote/receipt title and accent colors */
body.tx-dark-mode .txbt-invoice-paper .txbt-paper-title,
body.tx-dark-mode .txbt-invoice-paper .txbt-invoice-title,
body.tx-dark-mode .txbt-invoice-paper [class*="title"],
html[data-theme="dark"] .txbt-invoice-paper .txbt-paper-title,
html[data-theme="dark"] .txbt-invoice-paper .txbt-invoice-title,
html[data-theme="dark"] .txbt-invoice-paper [class*="title"] {
  color: inherit !important;
}

/* Common accent classes/inline accent sections must not be forced black */
body.tx-dark-mode .txbt-invoice-paper [style*="color"],
body.tx-dark-mode .txdoc-paper [style*="color"],
html[data-theme="dark"] .txbt-invoice-paper [style*="color"],
html[data-theme="dark"] .txdoc-paper [style*="color"] {
  color: revert-layer;
}

/* Tables/lines remain light-mode colors */
body.tx-dark-mode .txbt-invoice-paper table,
body.tx-dark-mode .txbt-invoice-paper tr,
body.tx-dark-mode .txbt-invoice-paper td,
body.tx-dark-mode .txbt-invoice-paper th,
body.tx-dark-mode .txdoc-paper table,
body.tx-dark-mode .txdoc-paper tr,
body.tx-dark-mode .txdoc-paper td,
body.tx-dark-mode .txdoc-paper th,
html[data-theme="dark"] .txbt-invoice-paper table,
html[data-theme="dark"] .txbt-invoice-paper tr,
html[data-theme="dark"] .txbt-invoice-paper td,
html[data-theme="dark"] .txbt-invoice-paper th,
html[data-theme="dark"] .txdoc-paper table,
html[data-theme="dark"] .txdoc-paper tr,
html[data-theme="dark"] .txdoc-paper td,
html[data-theme="dark"] .txdoc-paper th {
  border-color: #e5e7eb !important;
}
