/* ==========================================================================
   EVERGREEN MEDICAL CENTER - REPORT VERIFICATION PORTAL STYLES
   Passport Lookup, Digital Certificate, Test Breakdown & Print View
   ========================================================================== */

.report-section {
  padding: 6rem 0;
  background: radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.06) 0%, transparent 60%),
              linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  position: relative;
}

.report-portal-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(16, 102, 56, 0.08);
  padding: 3rem;
  max-width: 960px;
  margin: 0 auto;
  position: relative;
}

/* Report Search Form */
.report-search-box {
  max-width: 680px;
  width: 100%;
  margin: 0 auto 1.5rem;
  text-align: center;
}

.report-search-box h3 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--dark-900);
  margin-bottom: 0.6rem;
  letter-spacing: -0.02em;
}

.report-search-box p {
  font-size: 0.96rem;
  color: var(--gray-500);
  margin-bottom: 1.75rem;
  line-height: 1.55;
}

.report-form {
  width: 100%;
  display: block;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
}
  background: var(--primary-subtle);
  border-color: var(--primary);
}

/* Loading State */
.report-loading {
  display: none;
  text-align: center;
  padding: 3rem 0;
}

.report-loading.active {
  display: block;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.25rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Error / Not Found State */
.report-not-found {
  display: none;
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  padding: 2rem;
  border-radius: var(--radius-md);
  text-align: center;
  margin-top: 1.5rem;
}

.report-not-found.active {
  display: block;
}

.report-not-found h4 {
  color: var(--status-unfit);
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.report-not-found p {
  color: var(--dark-600);
  font-size: 0.9rem;
}

/* ==========================================================================
   DIGITAL MEDICAL CERTIFICATE CARD (THE RESULT)
   ========================================================================== */
.report-result-card {
  display: none;
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 2rem;
  position: relative;
  box-shadow: var(--shadow-md);
  animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.report-result-card.active {
  display: block;
}

/* Certificate Header */
.cert-header {
  background: linear-gradient(135deg, #106638 0%, #064e3b 100%);
  color: var(--white);
  padding: 1.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  border-bottom: 4px solid var(--accent-mint);
}

.cert-header-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.cert-header-logo {
  height: 60px;
  background: var(--white);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.cert-header-text h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.cert-header-text p {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.85);
}

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

.cert-qr-mini {
  width: 64px;
  height: 64px;
  background: var(--white);
  padding: 4px;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.cert-reg-code {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 4px;
  font-family: monospace;
}

/* Fitness Status Banner */
.cert-status-bar {
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.status-fit-bar {
  background: var(--status-fit-bg);
  border-bottom: 2px solid #a7f3d0;
}

.status-unfit-bar {
  background: var(--status-unfit-bg);
  border-bottom: 2px solid #fecaca;
}

.status-pending-bar {
  background: var(--status-pending-bg);
  border-bottom: 2px solid #fde68a;
}

.status-badge-big {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-fit {
  background: var(--status-fit);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.badge-unfit {
  background: var(--status-unfit);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.badge-pending {
  background: var(--status-pending);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.cert-validity-info {
  font-size: 0.85rem;
  color: var(--dark-700);
  font-weight: 600;
}

/* Candidate Profile Details Grid */
.cert-candidate-grid {
  display: grid;
  grid-template-columns: 140px 1fr 1fr;
  gap: 1.75rem;
  padding: 2rem;
  background: #ffffff;
  border-bottom: 1px solid var(--gray-200);
  align-items: center;
}

.candidate-photo-box {
  width: 130px;
  height: 155px;
  border-radius: var(--radius-sm);
  background: var(--gray-100);
  border: 2px solid var(--gray-300);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.candidate-photo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.candidate-meta-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.meta-field {
  display: flex;
  flex-direction: column;
}

.meta-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.meta-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dark-900);
}

.meta-value.passport-highlight {
  font-size: 1.15rem;
  color: var(--primary);
  font-family: monospace;
}

/* Diagnostic Test Tables */
.cert-test-results {
  padding: 2rem;
}

.test-category-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--dark-900);
  margin: 1.5rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.test-category-title:first-child {
  margin-top: 0;
}

.test-category-title svg {
  color: var(--primary);
  width: 18px;
  height: 18px;
}

.test-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.test-table th {
  background: var(--gray-50);
  padding: 0.6rem 0.85rem;
  text-align: left;
  font-weight: 600;
  color: var(--dark-600);
  border-bottom: 1px solid var(--gray-200);
}

.test-table td {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--gray-100);
  color: var(--dark-700);
}

.test-table tr:hover {
  background: #fdfdfd;
}

.result-fit {
  color: var(--status-fit);
  font-weight: 700;
}

.result-unfit {
  color: var(--status-unfit);
  font-weight: 700;
}

/* Signatures & Accreditation Footer */
.cert-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
  padding: 2rem;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  text-align: center;
}

.sig-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sig-seal {
  height: 48px;
  margin-bottom: 0.4rem;
  opacity: 0.85;
}

.sig-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--dark-900);
}

.sig-role {
  font-size: 0.74rem;
  color: var(--gray-500);
}

/* Certificate Actions Bar (Print, Download PDF, Share) */
.cert-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem 2rem;
  background: #ffffff;
  border-top: 1px solid var(--gray-200);
  flex-wrap: wrap;
}

/* Software Integration Callout */
.software-sync-callout {
  margin-top: 3rem;
  background: linear-gradient(135deg, #0a0f1d 0%, #1e293b 100%);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.sync-callout-text h4 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-mint);
  margin-bottom: 0.4rem;
}

.sync-callout-text p {
  font-size: 0.9rem;
  color: var(--gray-300);
  max-width: 580px;
}

/* Print Specific Rules */
@media print {
  body * {
    visibility: hidden;
  }
  .report-result-card, .report-result-card * {
    visibility: visible;
  }
  .report-result-card {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    box-shadow: none;
  }
  .cert-actions, .software-sync-callout, .topbar, .header, .footer, .hero-search-card {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .cert-header {
    flex-direction: column;
    text-align: center;
  }
  .cert-header-right {
    text-align: center;
  }
  .cert-candidate-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .candidate-photo-box {
    margin: 0 auto;
  }
  .cert-signatures {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   STAFF PORTAL MODAL & UPLOAD DASHBOARD STYLES
   ========================================================================== */
.staff-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease-out;
}

.staff-modal-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 440px;
  padding: 2.25rem;
  position: relative;
  text-align: center;
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.staff-modal-card-lg {
  max-width: 820px;
  text-align: left;
  max-height: 90vh;
  overflow-y: auto;
}

.staff-modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.25rem;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.staff-modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.staff-modal-icon {
  width: 64px;
  height: 64px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}

.staff-modal-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--dark-900);
  margin-bottom: 0.35rem;
}

.staff-modal-sub {
  font-size: 0.88rem;
  color: var(--gray-500);
  margin-bottom: 1.5rem;
}

.staff-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-200);
}

.staff-pin-input {
  width: 100%;
  padding: 0.9rem 1.25rem;
  font-size: 1.5rem;
  letter-spacing: 0.3em;
  text-align: center;
  border-radius: 10px;
  border: 2px solid var(--gray-300);
  outline: none;
  font-weight: 700;
  color: var(--dark-900);
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}

.staff-pin-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

.staff-error-msg {
  color: #dc2626;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.btn-block {
  width: 100%;
}

/* PDF Dropzone */
.pdf-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  padding: 2.25rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 1.5rem;
}

.pdf-dropzone:hover, .pdf-dropzone.dragover {
  border-color: var(--primary);
  background: rgba(16, 185, 129, 0.04);
}

.dropzone-icon {
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.browse-link {
  color: var(--primary);
  text-decoration: underline;
  font-weight: 700;
  cursor: pointer;
}

.dropzone-hint {
  font-size: 0.82rem;
  color: #64748b;
  margin-top: 0.35rem;
}

.dropzone-parsing {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: var(--primary-dark);
  font-weight: 600;
}

/* Extracted Data Form */
.upload-preview-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.preview-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark-900);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.upload-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--dark-800);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.form-input {
  width: 100%;
  padding: 0.55rem 0.85rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  font-size: 0.9rem;
  color: #0f172a;
  background: #ffffff;
  outline: none;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.upload-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Stored Records Mini Table */
.records-table-container {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
}

.staff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.staff-table th {
  background: #f1f5f9;
  padding: 0.6rem 0.85rem;
  font-weight: 700;
  color: #334155;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.staff-table td {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}

.staff-table tr:hover td {
  background: #f8fafc;
}

.staff-badge-fit {
  background: #dcfce7;
  color: #166534;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.75rem;
}

.staff-badge-unfit {
  background: #fee2e2;
  color: #991b1b;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.75rem;
}

.staff-btn-view {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 3px 10px;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.75rem;
}

.staff-btn-view:hover {
  background: var(--primary-dark);
}
