/* ==========================================================================
   PIA | Centro de Atención Plenus
   PDF Invoice (CFDI 4.0) Viewer Styling
   ========================================================================== */

.pdf-viewer-modal {
  position: relative;
  width: 92%;
  max-width: 680px;
  height: 90vh;
  background: #182229;
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 2;
  margin-bottom: 20px;
}

.pdf-topbar {
  padding: 12px 16px;
  background: #202c33;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pdf-file-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: #e9edef;
}

.pdf-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pdf-tool-btn {
  background: var(--wa-accent-teal);
  color: #0b141a;
  border: none;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.pdf-tool-btn:hover {
  opacity: 0.9;
}

.pdf-paper-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: #0f171c;
  display: flex;
  justify-content: center;
}

/* White A4 PDF Paper Sheet Simulation */
.pdf-paper-sheet {
  background: #ffffff;
  color: #1a1a1a;
  width: 100%;
  max-width: 580px;
  min-height: 700px;
  padding: 30px;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  font-size: 11px;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
}

.pdf-doc-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.pdf-logo {
  font-size: 18px;
  font-weight: 900;
  color: #0e2439;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.pdf-rfc {
  font-weight: 700;
  font-size: 10px;
  color: #333;
}

.pdf-address, .pdf-regime {
  font-size: 9.5px;
  color: #666;
  margin-top: 2px;
}

.pdf-invoice-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 12px;
  text-align: right;
  min-width: 200px;
}

.inv-badge {
  font-weight: 800;
  font-size: 10px;
  color: #0e2439;
  margin-bottom: 4px;
}

.inv-folio-text {
  font-size: 11px;
  color: #0e2439;
}

.inv-date-text {
  font-size: 9.5px;
  color: #666;
  margin-top: 2px;
}

.inv-uuid {
  font-size: 8px;
  color: #888;
  font-family: monospace;
  margin-top: 4px;
  word-break: break-all;
}

.pdf-divider {
  height: 1.5px;
  background: #0e2439;
  margin: 16px 0 12px 0;
}

.pdf-receptor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  background: #f8fafc;
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 14px;
}

.r-title {
  font-weight: 800;
  font-size: 9px;
  color: #64748b;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 4px;
}

.r-name {
  font-weight: 800;
  font-size: 12px;
  color: #0e2439;
}

.r-rfc, .r-uso, .r-item {
  font-size: 9.5px;
  color: #334155;
  margin-top: 2px;
}

/* Concepts Table */
.pdf-concepts-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 10px;
}

.pdf-concepts-table th {
  background: #0e2439;
  color: #ffffff;
  padding: 6px 8px;
  font-weight: 700;
  text-align: left;
  font-size: 9px;
}

.pdf-concepts-table td {
  padding: 8px;
  border-bottom: 1px solid #e2e8f0;
  color: #1e293b;
}

.pdf-concepts-table .sub-desc {
  font-size: 8.5px;
  color: #64748b;
}

.text-right {
  text-align: right;
}

/* Totals & SAT Seal */
.pdf-totals-section {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}

.pdf-sat-seal-box {
  display: flex;
  gap: 12px;
  flex: 1;
}

.sat-qr-mock {
  width: 60px;
  height: 60px;
  background: #000;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  text-align: center;
  border-radius: 4px;
}

.sat-text {
  flex: 1;
  font-size: 7.5px;
  color: #64748b;
  line-height: 1.3;
}

.seal-line {
  word-break: break-all;
  margin-bottom: 2px;
}

.pdf-totals-box {
  min-width: 170px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.t-row {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #475569;
}

.t-grand-total {
  font-size: 13px;
  font-weight: 900;
  color: #0e2439;
  border-top: 1.5px solid #0e2439;
  padding-top: 4px;
  margin-top: 4px;
}

.pdf-footer-note {
  margin-top: 14px;
  font-size: 8px;
  color: #94a3b8;
  text-align: center;
  border-top: 1px solid #f1f5f9;
  padding-top: 6px;
}
