/* Reportes imprimibles / PDF — SGC Calidad */
.report-doc {
  font-family: "Segoe UI", Georgia, serif;
  color: #1a1a1a;
  line-height: 1.45;
}

.report-banner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 20px 24px;
  margin: -40px -40px 24px -40px;
  background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 50%, #388e3c 100%);
  color: #fff;
  border-radius: 10px 10px 0 0;
}

.report-banner .brand img {
  max-height: 52px;
  filter: brightness(0) invert(1);
}

.report-banner h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.report-banner .subtitle {
  margin: 4px 0 0;
  font-size: 0.8rem;
  opacity: 0.92;
  font-weight: 500;
}

.report-banner .folio-box {
  text-align: right;
  font-size: 0.82rem;
  background: rgba(0, 0, 0, 0.15);
  padding: 10px 14px;
  border-radius: 8px;
  min-width: 180px;
}

.report-banner .folio-box p {
  margin: 2px 0;
}

.report-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px 16px;
  margin-bottom: 22px;
  padding: 16px;
  background: #f8faf8;
  border: 1px solid #e0e8e0;
  border-radius: 8px;
  font-size: 0.82rem;
}

.report-meta-grid .meta-item strong {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #455a64;
  margin-bottom: 2px;
}

.report-section-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1b5e20;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 2px solid #c8e6c9;
  padding-bottom: 6px;
  margin: 20px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 20px;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin-bottom: 0;
  min-width: 640px;
}

.report-table thead {
  background: #1b5e20;
  color: #fff;
}

.report-table th {
  padding: 10px 8px;
  text-align: center;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.report-table td {
  padding: 8px;
  text-align: center;
  border: 1px solid #dee2e6;
}

.report-table tbody tr:nth-child(even) {
  background: #f5f9f5;
}

.report-table tfoot tr {
  background: #e8f5e9;
  font-weight: 700;
  color: #1b5e20;
}

.report-obs-box {
  margin-top: 16px;
  padding: 14px 16px;
  background: #fffde7;
  border-left: 4px solid #f9a825;
  border-radius: 0 8px 8px 0;
  font-size: 0.85rem;
}

.report-obs-box strong {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: #5d4037;
  margin-bottom: 6px;
}

.report-signatures {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px dashed #bbb;
}

.report-signatures .sig-block img {
  width: 200px;
  height: 90px;
  object-fit: contain;
  border-bottom: 2px solid #333;
  margin-bottom: 8px;
}

.report-signatures .sig-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #455a64;
}

.report-print-footer {
  margin-top: 28px;
  padding-top: 10px;
  border-top: 1px solid #e0e0e0;
  font-size: 0.65rem;
  color: #757575;
  display: flex;
  justify-content: space-between;
}

.modal-report .modal-content {
  animation: sgc-modal-in 0.35s ease-out;
}

@keyframes sgc-modal-in {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.btn-print-report {
  background: linear-gradient(135deg, #1b5e20, #2e7d32) !important;
  color: #fff !important;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-print-report:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(27, 94, 32, 0.3);
}

.modal-report-actions {
  margin-top: 24px;
  text-align: right;
}

@media (max-width: 768px) {
  .modal-report .modal-content {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 12px 14px calc(88px + env(safe-area-inset-bottom, 0px));
    border-radius: 0;
    /* Evita atrapar scroll en iOS (antes min-height:100vh). */
    min-height: 0;
    box-sizing: border-box;
  }

  .modal-report-actions {
    position: sticky;
    bottom: 0;
    z-index: 6;
    margin: 16px -14px 0;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.97);
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -6px 16px rgba(0, 0, 0, 0.08);
    text-align: stretch;
  }

  .modal-report-actions .btn-print-report {
    width: 100%;
    justify-content: center;
  }

  .report-banner {
    flex-direction: column;
    margin: -12px -14px 16px;
    padding: 16px;
    border-radius: 0;
    gap: 12px;
  }

  .report-banner .folio-box {
    text-align: left;
    width: 100%;
    box-sizing: border-box;
  }

  .report-meta-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px;
    font-size: 0.78rem;
  }

  .report-table.report-table--responsive {
    min-width: 0;
  }

  .report-table.report-table--responsive thead {
    display: none;
  }

  .report-table.report-table--responsive tbody tr {
    display: block;
    margin-bottom: 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
  }

  .report-table.report-table--responsive tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    text-align: right;
    padding: 10px 12px;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    word-break: break-word;
  }

  .report-table.report-table--responsive tbody td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 0.68rem;
    text-transform: uppercase;
    color: #455a64;
    text-align: left;
    flex: 0 0 42%;
  }

  .report-table.report-table--responsive tbody td:last-child {
    border-bottom: none;
  }

  .report-table.report-table--responsive tfoot tr {
    display: block;
    margin-bottom: 12px;
    border: 1px solid #a5d6a7;
    border-radius: 8px;
    overflow: hidden;
    background: #e8f5e9;
  }

  .report-table.report-table--responsive tfoot td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    text-align: right;
    padding: 10px 12px;
    border: none;
    border-bottom: 1px solid #c8e6c9;
    word-break: break-word;
  }

  .report-table.report-table--responsive tfoot td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 0.68rem;
    text-transform: uppercase;
    color: #455a64;
    text-align: left;
    flex: 0 0 42%;
  }

  .report-table.report-table--responsive tfoot td:last-child {
    border-bottom: none;
  }

  .report-table.report-table--responsive tr.report-summary-row {
    background: #e8f5e9;
    border-color: #a5d6a7;
  }

  .report-signatures {
    flex-direction: column;
    align-items: center;
  }

  .report-signatures .sig-block {
    width: 100%;
    text-align: center;
  }

  .report-print-footer {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }
}

@media print {
  .no-print {
    display: none !important;
  }

  body {
    background: #fff !important;
  }

  .modal {
    position: static !important;
    background: #fff !important;
    display: block !important;
    overflow: visible !important;
  }

  .modal-report .modal-content {
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
  }

  .report-banner {
    margin: 0 0 16px 0 !important;
    border-radius: 0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .report-table thead {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .report-table.report-table--responsive thead {
    display: table-header-group !important;
  }

  .report-table.report-table--responsive tbody tr {
    display: table-row !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
  }

  .report-table.report-table--responsive tbody td {
    display: table-cell !important;
    text-align: center !important;
    border: 1px solid #dee2e6 !important;
    padding: 8px !important;
  }

  .report-table.report-table--responsive tbody td::before {
    content: none !important;
  }

  @page {
    margin: 12mm 10mm;
    size: A4 portrait;
  }
}
