/* =====================================================
   PDF-MODAL
   Fenêtre de lecture des rapports PDF
   ===================================================== */

/* ══════════════════════════════════════════════════════════
   PDF VIEWER MODAL
══════════════════════════════════════════════════════════ */
.modal-pdf-box {
  max-width: 960px;
  width: 100%;
  max-height: 96vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;       /* header fixed, viewer scrolls */
  border-radius: 20px;
}

/* Sticky header with title + download + close */
.modal-pdf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 20px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-border);
  flex-shrink: 0;
  border-radius: 20px 20px 0 0;
  flex-wrap: wrap;
}
.modal-pdf-header-info {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.modal-pdf-pages {
  font-size: .75rem;
  color: var(--gray-text);
  font-family: var(--font-heading);
  font-weight: 600;
}
.modal-pdf-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.modal-pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--blue);
  color: var(--white);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: .78rem;
  font-weight: 700;
  text-decoration: none;
  transition: background var(--transition-fast), transform var(--transition-fast);
  white-space: nowrap;
}
.modal-pdf-btn:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
}

/* Override modal-close position inside pdf header */
.modal-pdf-header .modal-close {
  position: static;
  float: none;
  margin: 0;
  flex-shrink: 0;
}

/* PDF <object> viewer */
.modal-pdf-viewer {
  flex: 1;
  overflow: hidden;
  background: #525659;  /* standard PDF viewer grey */
  border-radius: 0 0 20px 20px;
}
.pdf-object {
  width: 100%;
  height: 100%;
  min-height: calc(96vh - 70px);
  border: none;
  display: block;
}

/* Fallback (iOS Safari, old browsers) */
.pdf-fallback {
  padding: 32px 28px 40px;
  text-align: center;
  background: var(--white);
  height: 100%;
  overflow-y: auto;
}
.pdf-fallback-icon { font-size: 3rem; margin-bottom: 14px; }
.pdf-fallback-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 8px;
}
.pdf-fallback-sub {
  font-size: .88rem;
  color: var(--gray-text);
  margin-bottom: 20px;
}
.pdf-fallback-summary {
  text-align: left;
  margin-top: 32px;
  padding-top: 28px;
  border-top: 2px solid var(--gray-border);
}

/* Responsive PDF modal */
@media (max-width: 900px) {
  .modal-pdf-box { max-height: 98vh; border-radius: 14px; }
  .pdf-object { min-height: calc(98vh - 80px); }
  .modal-pdf-header { padding: 10px 14px; }
  .modal-pdf-btn { padding: 7px 12px; }
}
@media (max-width: 600px) {
  .modal-pdf-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .modal-pdf-actions { align-self: flex-end; }
  .pdf-object { min-height: 70vh; }
}
