/* ==========================================================================
   DataPartner — 3D Thermal Receipt Printer Modal Styles
   ========================================================================== */

.receipt-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 20, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  overflow-y: auto;
  opacity: 0;
  animation: receiptFadeIn 0.3s ease-out forwards;
}

@keyframes receiptFadeIn {
  to { opacity: 1; }
}

.receipt-modal-container {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  margin: auto;
}

/* Machine Stage */
.receipt-machine-stage {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* Top 3D Metallic Hood */
.receipt-hood-top {
  width: 360px;
  max-width: 95%;
  height: 42px;
  border-radius: 14px 14px 3px 3px;
  background: linear-gradient(180deg, 
    #ffffff 0%, 
    #fbf4e8 15%, 
    #e9cf9f 45%, 
    #d19e54 75%, 
    #b37f35 100%
  );
  box-shadow: 
    0 -2px 6px rgba(255, 255, 255, 0.8),
    0 10px 20px rgba(179, 127, 53, 0.28),
    inset 0 2px 2px rgba(255, 255, 255, 0.9),
    inset 0 -2px 4px rgba(105, 68, 16, 0.45);
  position: relative;
  overflow: hidden;
  z-index: 25;
}

.receipt-hood-highlight {
  position: absolute;
  top: 3px;
  left: 8%;
  width: 84%;
  height: 5px;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.95) 50%, rgba(255,255,255,0) 100%);
  border-radius: 999px;
  filter: blur(1px);
}

/* Dark Slit Opening */
.receipt-machine-slit {
  width: 330px;
  max-width: 88%;
  height: 12px;
  margin-top: -6px;
  background: #0f0a03;
  border-radius: 2px;
  box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.95);
  position: relative;
  z-index: 5;
  border: 1px solid #3d280e;
}

/* Cutter Blade Flash Line */
.receipt-cutter-flash {
  position: absolute;
  top: 38px;
  left: 50%;
  transform: translateX(-50%);
  width: 330px;
  max-width: 88%;
  height: 3px;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, #ffffff 50%, rgba(255,255,255,0) 100%);
  box-shadow: 0 0 14px #ffffff, 0 0 24px var(--neon-cyan);
  z-index: 35;
  opacity: 0;
  pointer-events: none;
}

.receipt-cutter-flash.active {
  animation: receiptFlashAnim 0.45s ease-out forwards;
}

@keyframes receiptFlashAnim {
  0% { opacity: 0; transform: translateX(-50%) scaleX(0.1); }
  50% { opacity: 1; transform: translateX(-50%) scaleX(1); }
  100% { opacity: 0; transform: translateX(-50%) scaleX(1); }
}

/* Bottom Metallic Lip */
.receipt-hood-bottom {
  width: 360px;
  max-width: 95%;
  height: 14px;
  margin-top: -4px;
  border-radius: 0 0 14px 14px;
  background: linear-gradient(180deg, #9e6d2b 0%, #d8b478 40%, #fff7ea 100%);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 10;
  border: 1px solid #b37f35;
}

/* Paper Viewport */
.receipt-paper-viewport {
  position: relative;
  width: 340px;
  max-width: 90%;
  margin-top: -8px;
  z-index: 8;
  perspective: 1200px;
  perspective-origin: 50% 0%;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.42)) drop-shadow(0 8px 14px rgba(0, 0, 0, 0.28));
  overflow: hidden;
  padding-top: 4px;
}

/* Animated Thermal Paper */
.receipt-paper-card {
  width: 100%;
  background: linear-gradient(180deg, #fdfdfc 0%, #fafaf8 40%, #f7f6f0 100%);
  color: #1a1a1a;
  padding: 1.5rem 1.25rem 1.35rem 1.25rem;
  box-sizing: border-box;
  transform-origin: top center;
  transform-style: preserve-3d;
  animation: receiptRollout3D 1.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: transform, opacity;
  user-select: text;
  position: relative;
  border-left: 1px solid #e8e5dc;
  border-right: 1px solid #e8e5dc;

  /* Authentic POS Thermal Cutter Serrated Teeth Clip-Path */
  clip-path: polygon(
    0% 0%, 100% 0%,
    100% calc(100% - 10px),
    98.33% 100%, 96.67% calc(100% - 10px),
    95.00% 100%, 93.33% calc(100% - 10px),
    91.67% 100%, 90.00% calc(100% - 10px),
    88.33% 100%, 86.67% calc(100% - 10px),
    85.00% 100%, 83.33% calc(100% - 10px),
    81.67% 100%, 80.00% calc(100% - 10px),
    78.33% 100%, 76.67% calc(100% - 10px),
    75.00% 100%, 73.33% calc(100% - 10px),
    71.67% 100%, 70.00% calc(100% - 10px),
    68.33% 100%, 66.67% calc(100% - 10px),
    65.00% 100%, 63.33% calc(100% - 10px),
    61.67% 100%, 60.00% calc(100% - 10px),
    58.33% 100%, 56.67% calc(100% - 10px),
    55.00% 100%, 53.33% calc(100% - 10px),
    51.67% 100%, 50.00% calc(100% - 10px),
    48.33% 100%, 46.67% calc(100% - 10px),
    45.00% 100%, 43.33% calc(100% - 10px),
    41.67% 100%, 40.00% calc(100% - 10px),
    38.33% 100%, 36.67% calc(100% - 10px),
    35.00% 100%, 33.33% calc(100% - 10px),
    31.67% 100%, 30.00% calc(100% - 10px),
    28.33% 100%, 26.67% calc(100% - 10px),
    25.00% 100%, 23.33% calc(100% - 10px),
    21.67% 100%, 20.00% calc(100% - 10px),
    18.33% 100%, 16.67% calc(100% - 10px),
    15.00% 100%, 13.33% calc(100% - 10px),
    11.67% 100%, 10.00% calc(100% - 10px),
    8.33% 100%, 6.67% calc(100% - 10px),
    5.00% 100%, 3.33% calc(100% - 10px),
    1.67% 100%, 0% calc(100% - 10px)
  );
}

@keyframes receiptRollout3D {
  0% {
    transform: translateY(-98%) rotateX(-30deg) translateZ(-20px);
    opacity: 0.2;
  }
  25% {
    transform: translateY(-60%) rotateX(-15deg) translateZ(10px);
    opacity: 0.9;
  }
  65% {
    transform: translateY(-10%) rotateX(-4deg) translateZ(4px);
    opacity: 1;
  }
  85% {
    transform: translateY(2%) rotateX(2deg) translateZ(0px);
    opacity: 1;
  }
  100% {
    transform: translateY(0%) rotateX(0deg) translateZ(0px);
    opacity: 1;
  }
}

/* Receipt Paper Content */
.receipt-brand-header {
  text-align: center;
  margin-bottom: 0.65rem;
}

.receipt-brand-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  margin-bottom: 6px !important;
}

.receipt-brand-logo {
  width: 38px !important;
  height: 38px !important;
  object-fit: contain !important;
  flex-shrink: 0 !important;
  display: block !important;
  margin: 0 !important;
}

.receipt-brand-text-col {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: center !important;
  text-align: left !important;
}

.receipt-brand-name {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-size: 1.18rem !important;
  font-weight: 900 !important;
  letter-spacing: 0.6px !important;
  color: #0f172a !important;
  margin: 0 !important;
  line-height: 1.1 !important;
  text-transform: uppercase !important;
}

.receipt-brand-highlight {
  color: #0284c7 !important;
}

.receipt-brand-sub {
  font-size: 0.62rem !important;
  font-weight: 800 !important;
  color: #64748b !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  margin-top: 2px !important;
}

.receipt-distributor-banner {
  margin-top: 8px;
  padding: 8px 10px;
  background: #fef7ec;
  border: 1.5px solid #d4a359;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 800;
  color: #784b12 !important;
  text-align: center;
  line-height: 1.3;
}

.receipt-distributor-banner strong {
  color: #0f172a !important;
  font-weight: 900 !important;
}

.receipt-divider {
  border-bottom: 1px dashed #d6d1c4;
  margin: 0.75rem 0;
}

.receipt-meta-grid {
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.receipt-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.receipt-meta-label {
  color: #777777;
  font-weight: 600;
}

.receipt-meta-val {
  color: #1a1a1a;
  font-weight: 800;
  text-align: right;
}

.receipt-amount-block {
  text-align: center;
  padding: 0.5rem 0;
}

.receipt-amount-tag {
  font-size: 0.65rem;
  font-weight: 700;
  color: #888888;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.receipt-amount-number {
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
  font-weight: 900;
  color: #111111;
  margin: 2px 0 6px 0;
}

.receipt-approved-stamp {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.5px;
}

/* Order: Mode First, UTR Below */
.receipt-details-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.75rem;
}

.receipt-detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.receipt-detail-label {
  font-size: 0.65rem;
  color: #888888;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.receipt-detail-mode-badge {
  display: inline-block;
  align-self: flex-start;
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 800;
  font-size: 0.75rem;
}

.receipt-detail-mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: #0f172a;
  background: #f1f5f9;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  align-self: flex-start;
  word-break: break-all;
}

.receipt-detail-text {
  font-size: 0.78rem;
  font-weight: 700;
  color: #1a1a1a;
}

.receipt-footer-section {
  text-align: center;
  padding-top: 0.25rem;
  padding-bottom: 0.4rem;
}

.receipt-footer-text {
  font-size: 0.62rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}

.receipt-qr-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 10px auto;
  background: #ffffff;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1.5px solid #cbd5e1;
  width: fit-content;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.receipt-qr-img {
  width: 140px;
  height: 140px;
  object-fit: contain;
  display: block;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.receipt-qr-caption {
  font-size: 0.65rem;
  font-weight: 800;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 5px;
}

.receipt-barcode-wrapper {
  margin-top: 6px;
  text-align: center;
}

.receipt-barcode-svg-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.receipt-barcode-svg {
  max-width: 170px;
  height: 22px;
  display: block;
  margin: 0 auto;
}

.receipt-barcode-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  font-weight: 800;
  color: #1e293b;
  margin-top: 2px;
  letter-spacing: 0.8px;
}

.receipt-verified-text {
  font-size: 0.55rem;
  color: #64748b;
  font-weight: 600;
  margin-top: 2px;
}

/* ==========================================================================
   Invoice Specific Thermal Paper Elements
   ========================================================================== */

.invoice-parties-box {
  display: flex;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
  gap: 8px;
  margin: 6px 0;
  text-align: left;
}

.invoice-party-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.invoice-party-divider {
  width: 1px;
  background: #e2e8f0;
  margin: 0 2px;
  align-self: stretch;
}

.invoice-party-tag {
  font-size: 0.58rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.invoice-party-name {
  font-size: 0.78rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.invoice-party-line {
  font-size: 0.68rem;
  color: #334155;
  line-height: 1.35;
  word-break: break-word;
}

.invoice-table-wrapper {
  margin: 8px 0;
  width: 100%;
  overflow-x: auto;
}

.invoice-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
}

.invoice-items-table th {
  background: #f1f5f9;
  color: #475569;
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 5px 6px;
  border-top: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
}

.invoice-items-table td {
  padding: 6px 5px;
  border-bottom: 1px dashed #e2e8f0;
  color: #1e293b;
  vertical-align: middle;
}

.invoice-hsn-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  background: #f1f5f9;
  padding: 1px 5px;
  border-radius: 3px;
  color: #0284c7;
  font-weight: 700;
  border: 1px solid #e2e8f0;
  display: inline-block;
}

/* Actions Bar below machine */
.receipt-actions-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
  width: 100%;
}

.receipt-btn-share {
  background: #0284c7;
  color: #ffffff;
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
  transition: all 0.2s ease;
}

.receipt-btn-share:hover {
  background: #0369a1;
  transform: translateY(-1px);
}

.receipt-btn-print {
  background: #059669;
  color: #ffffff;
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
  transition: all 0.2s ease;
}

.receipt-btn-print:hover {
  background: #047857;
  transform: translateY(-1px);
}

.receipt-btn-close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-size: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.receipt-btn-close:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.05);
}

/* ==========================================================================
   View Mode Tabs (Standard A4 vs Thermal Receipt)
   ========================================================================== */
.invoice-modal-wrapper {
  width: 100%;
  max-width: 860px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  margin: auto;
  transition: max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.invoice-modal-wrapper.thermal-mode {
  max-width: 440px;
}

.invoice-view-tabs {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.88);
  padding: 5px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  margin-bottom: 1rem;
  gap: 6px;
  z-index: 50;
}

.invoice-tab-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.invoice-tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.invoice-tab-btn.active {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.4);
}

/* ==========================================================================
   Standard A4 Tax Invoice Paper Styles
   ========================================================================== */
.tax-invoice-a4-sheet {
  width: 100%;
  background: #ffffff;
  color: #0f172a;
  border-radius: 12px;
  padding: 30px 36px;
  box-sizing: border-box;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  text-align: left;
  border: 1px solid #cbd5e1;
  position: relative;
}

.a4-inv-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 16px;
  margin-bottom: 16px;
  gap: 20px;
}

.a4-inv-brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.a4-inv-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.a4-inv-title-col h2 {
  font-size: 1.35rem;
  font-weight: 900;
  color: #0f172a;
  margin: 0;
  letter-spacing: 0.5px;
}

.a4-inv-title-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  background: #0284c7;
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-top: 3px;
}

.a4-inv-meta-col {
  text-align: right;
}

.a4-inv-type-badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: #0369a1;
  background: #e0f2fe;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid #bae6fd;
  display: inline-block;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.a4-inv-meta-item {
  font-size: 0.8rem;
  color: #334155;
  margin: 2px 0;
}

.a4-inv-meta-item strong {
  color: #0f172a;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
}

/* Parties 2-Column Box */
.a4-parties-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

.a4-party-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
}

.a4-party-heading {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #0284c7;
  letter-spacing: 0.6px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 4px;
  margin-bottom: 8px;
}

.a4-party-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
}

.a4-party-line {
  font-size: 0.78rem;
  color: #334155;
  line-height: 1.4;
  margin: 2px 0;
}

.a4-party-line strong {
  color: #0f172a;
}

/* Goods & Services Table */
.a4-table-container {
  margin-bottom: 18px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  overflow: hidden;
}

.a4-goods-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.a4-goods-table th {
  background: #f1f5f9;
  color: #334155;
  font-weight: 800;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 8px 10px;
  border-bottom: 2px solid #cbd5e1;
  border-right: 1px solid #e2e8f0;
}

.a4-goods-table th:last-child {
  border-right: none;
}

.a4-goods-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  color: #1e293b;
  vertical-align: middle;
}

.a4-goods-table td:last-child {
  border-right: none;
}

.a4-goods-table tr:last-child td {
  border-bottom: none;
}

.a4-goods-table tr.total-row td {
  background: #f8fafc;
  font-weight: 800;
  border-top: 2px solid #cbd5e1;
  border-bottom: none;
  color: #0f172a;
}

/* HSN Summary Table */
.a4-hsn-summary-box {
  margin-bottom: 18px;
}

.a4-section-subheading {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #475569;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.a4-hsn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
}

.a4-hsn-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  padding: 6px 8px;
  border-bottom: 1px solid #cbd5e1;
  border-right: 1px solid #e2e8f0;
}

.a4-hsn-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #f1f5f9;
  border-right: 1px solid #e2e8f0;
  color: #334155;
}

/* Words Box */
.a4-words-box {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.8rem;
  color: #0369a1;
  margin-bottom: 18px;
}

.a4-words-box strong {
  color: #0c4a6e;
  font-weight: 800;
}

/* Bottom Grid (Bank + Terms on Left, Summary + Signatory on Right) */
.a4-bottom-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
  border-top: 1px solid #e2e8f0;
  padding-top: 16px;
}

.a4-bottom-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.a4-bank-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
}

.a4-bank-title {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #059669;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.a4-bank-line {
  font-size: 0.75rem;
  color: #334155;
  margin: 2px 0;
}

.a4-bank-line strong {
  color: #0f172a;
  font-family: 'JetBrains Mono', monospace;
}

.a4-terms-card {
  font-size: 0.7rem;
  color: #64748b;
  line-height: 1.4;
  border-left: 2px solid #cbd5e1;
  padding-left: 10px;
}

.a4-terms-title {
  font-weight: 800;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}

.a4-terms-list {
  margin: 0;
  padding-left: 14px;
}

.a4-bottom-right {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.a4-summary-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
}

.a4-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #334155;
  padding: 3px 0;
}

.a4-summary-row.grand-total {
  border-top: 2px solid #0f172a;
  margin-top: 6px;
  padding-top: 6px;
  font-size: 1rem;
  font-weight: 900;
  color: #0f172a;
}

.a4-signatory-box {
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  background: #ffffff;
}

.a4-signatory-for {
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.a4-signatory-stamp {
  display: inline-block;
  border: 1px solid #0284c7;
  color: #0284c7;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.a4-signatory-caption {
  font-size: 0.68rem;
  font-weight: 700;
  color: #0f172a;
}

.a4-footer-verif {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

.a4-verif-qr {
  width: 80px;
  height: 80px;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.a4-verif-text {
  font-size: 0.65rem;
  color: #94a3b8;
  text-align: right;
}

/* ==========================================================================
   Print Media Query for Both A4 and Thermal
   ========================================================================== */
@media print {
  @page {
    margin: 0;
    size: auto;
  }

  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #000000 !important;
    height: auto !important;
    min-height: 0 !important;
    width: 100% !important;
    overflow: visible !important;
  }

  /* Hide background dashboard and app shell */
  body > *:not(#app-receipt-modal-overlay) {
    display: none !important;
    height: 0 !important;
    overflow: hidden !important;
  }

  .nav-bar, .bg-effects, .main-content, #app, .toast-container, .nav-overlay, #offline-banner {
    display: none !important;
  }

  #app-receipt-modal-overlay {
    position: static !important;
    inset: auto !important;
    display: block !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 auto !important;
    overflow: visible !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
  }

  .invoice-view-tabs,
  .receipt-hood-top,
  .receipt-machine-slit,
  .receipt-hood-bottom,
  .receipt-actions-bar,
  .receipt-cutter-flash {
    display: none !important;
  }

  .invoice-modal-wrapper {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
  }

  /* --- THERMAL POS MODE PRINT --- */
  .invoice-modal-wrapper.thermal-mode .tax-invoice-a4-sheet {
    display: none !important;
  }

  .invoice-modal-wrapper.thermal-mode .receipt-machine-stage {
    display: block !important;
    width: 100% !important;
    margin: 0 auto !important;
  }

  .invoice-modal-wrapper.thermal-mode .receipt-paper-viewport {
    filter: none !important;
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 80mm !important;
  }

  .invoice-modal-wrapper.thermal-mode .receipt-paper-card {
    animation: none !important;
    border: none !important;
    clip-path: none !important;
    box-shadow: none !important;
    width: 100% !important;
    max-width: 80mm !important;
    margin: 0 auto !important;
    padding: 2mm 3mm !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    background: #ffffff !important;
    color: #000000 !important;
  }

  .invoice-modal-wrapper.thermal-mode .receipt-qr-wrapper {
    margin: 3mm auto !important;
    padding: 2mm !important;
    background: #ffffff !important;
    border: 1px solid #000000 !important;
  }

  .invoice-modal-wrapper.thermal-mode .receipt-qr-img {
    width: 38mm !important;
    height: 38mm !important;
    image-rendering: pixelated !important;
  }

  /* --- STANDARD A4 MODE PRINT --- */
  .invoice-modal-wrapper:not(.thermal-mode) .receipt-machine-stage {
    display: none !important;
  }

  .invoice-modal-wrapper:not(.thermal-mode) .tax-invoice-a4-sheet {
    display: block !important;
    box-shadow: none !important;
    border: 1px solid #475569 !important;
    border-radius: 0 !important;
    padding: 8mm 10mm !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    background: #ffffff !important;
    color: #000000 !important;
  }

  .invoice-modal-wrapper:not(.thermal-mode) .a4-verif-qr {
    width: 22mm !important;
    height: 22mm !important;
    image-rendering: pixelated !important;
  }
}

