body {
  margin: 0;
  font-family: 'IBM Plex Sans', 'Segoe UI', Tahoma, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(31, 111, 235, 0.08), transparent 26%),
    linear-gradient(180deg, #f8fbff 0%, #f3f8fd 42%, #ffffff 100%);
  color: #10233f;
}

.portal-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 20px 56px;
}

.portal-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 28px;
  padding: 28px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(220, 229, 240, 0.88);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 54px rgba(16, 35, 63, 0.08);
}

.portal-hero-copy {
  max-width: 640px;
}

.portal-brand {
  color: #1f6feb;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 12px;
}

.portal-header h1 {
  margin: 8px 0 10px;
  font-family: 'Manrope', 'Segoe UI', sans-serif;
  font-size: 42px;
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.portal-header p,
.muted {
  color: #5a6f8a;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.portal-card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(220, 229, 240, 0.92);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 18px 40px rgba(16, 35, 63, 0.06);
  backdrop-filter: blur(16px);
}

.portal-card-kicker {
  color: #1f6feb;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 10px;
}

.portal-card h2 {
  margin: 0 0 8px;
  font-family: 'Manrope', 'Segoe UI', sans-serif;
  font-size: 26px;
  letter-spacing: -0.03em;
}

.portal-card.full {
  grid-column: 1 / -1;
}

.portal-form {
  display: grid;
  gap: 14px;
}

.portal-form label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #28415f;
}

.portal-form input {
  border: 1px solid #dce5f0;
  border-radius: 14px;
  padding: 13px 14px;
  font-size: 14px;
  background: rgba(251, 253, 255, 0.96);
  color: #10233f;
}

.portal-form input:focus {
  outline: none;
  border-color: #1f6feb;
  box-shadow: 0 0 0 4px rgba(31, 111, 235, 0.12);
}

.portal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
}

.btn.primary {
  background: linear-gradient(135deg, #1f6feb 0%, #3d8cff 100%);
  color: white;
  box-shadow: 0 16px 32px rgba(31, 111, 235, 0.2);
}

.btn.subtle {
  background: rgba(255, 255, 255, 0.88);
  color: #10233f;
  border-color: #dce5f0;
}

.portal-list {
  display: grid;
  gap: 12px;
}

.portal-item {
  border: 1px solid rgba(220, 229, 240, 0.92);
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.portal-item h3 {
  margin: 0 0 6px;
  font-family: 'Manrope', 'Segoe UI', sans-serif;
  font-size: 18px;
}

.meta {
  color: #4b627d;
  font-size: 14px;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: #edf4ff;
  color: #1f6feb;
}

.empty {
  color: #5a6f8a;
  font-style: italic;
}

@media (max-width: 800px) {
  .portal-grid {
    grid-template-columns: 1fr;
  }

  .portal-header {
    flex-direction: column;
    padding: 22px;
  }

  .portal-header h1 {
    font-size: 34px;
  }
}

/* ── Session expiry warning banner ──────────────────────────────────────── */
.session-exp-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 20px;
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  color: #78350f;
  font-size: 14px;
  font-weight: 500;
}

.session-exp-banner span {
  flex: 1;
  min-width: 200px;
}

.session-dismiss-btn {
  padding: 6px 10px !important;
  min-width: 0;
}

/* ── Section header row (title + print button in one line) ──────────────── */
.portal-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.portal-section-header h2 {
  margin: 0;
}

/* ── Show-more pagination row ───────────────────────────────────────────── */
.portal-more-row {
  display: flex;
  justify-content: center;
  padding-top: 8px;
}

.portal-more-btn {
  font-size: 13px;
  padding: 8px 20px;
}

/* ── Bill / Admission card layouts ─────────────────────────────────────── */
.portal-bill-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.portal-bill-footer {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(220, 229, 240, 0.7);
}

/* ── Report card layout ─────────────────────────────────────────────────── */
.portal-report-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.portal-report-summary {
  font-size: 14px;
  color: #3d5a73;
  padding: 10px 12px;
  background: #f8fbff;
  border-radius: 10px;
  border: 1px solid #dce5f0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Print: show only the Verified Reports section ──────────────────────── */
/* The print button temporarily expands all items before calling              */
/* window.print(), so pagination does not truncate the printout.              */
@media print {
  /* Hide chrome */
  .portal-header,
  .session-exp-banner,
  #portalLogoutBtn { display: none !important; }

  /* Hide the welcome card (direct child of #portalApp, above the grid) */
  #portalApp > .portal-card { display: none !important; }

  /* Hide appointments and prescriptions; keep only the reports section */
  .portal-grid > :not(#reportsSection) { display: none !important; }

  /* Strip card decoration from the report section itself */
  #reportsSection { border: none; box-shadow: none; padding: 0; }

  /* Hide the print button and show-more row inside the section */
  .portal-section-header .btn,
  .portal-more-row { display: none !important; }

  body { background: white !important; }
}