/* ══════════════════════════════════════════════════════════════
   FHIR Dashboard — Design System
   Target: ABDM-compliant medical data toolkit UI
   ══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Design Tokens ── */
:root {
  --bg-primary:   #edf2f7;
  --bg-secondary: #e2e8f0;
  --bg-card:      #ffffff;
  --bg-card-hover:#f8fafc;
  --bg-input:     #ffffff;
  --border:       #cbd5e1;
  --border-focus: #0284c7;

  --text-primary:   #0a0f1d;
  --text-secondary: #334155;
  --text-muted:     #475569;

  --accent:       #0284c7;
  --accent-hover: #0369a1;
  --accent-glow:  rgba(2, 132, 199, 0.15);
  --success:      #059669;
  --success-bg:   #ecfdf5;
  --warning:      #b45309;
  --warning-bg:   #fffbeb;
  --error:        #dc2626;
  --error-bg:     #fef2f2;
  --info:         #0284c7;
  --info-bg:      #eff6ff;

  --radius:       12px;
  --radius-sm:    8px;
  --radius-xs:    6px;
  --shadow:       0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 4px 12px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg:    0 10px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);

  --font-sans:    'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  /* Resource type colors */
  --clr-composition:      #4f46e5;
  --clr-patient:          #059669;
  --clr-practitioner:     #7c3aed;
  --clr-organization:     #b45309;
  --clr-encounter:        #0284c7;
  --clr-observation:      #dc2626;
  --clr-diagnosticreport: #be185d;
}

/* ── Global Reset ── */
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
[hidden] { display: none !important; }
html { font-size:16px; scroll-behavior:smooth; }
body {
  font-family:var(--font-sans);
  background:var(--bg-primary);
  color:var(--text-primary);
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
}
a { color:var(--accent); text-decoration:none; }
a:hover { text-decoration:underline; }

/* ── Page layout ── */
.page {
  max-width: calc(100% - 80px);
  width: calc(100% - 80px);
  margin: 0 auto;
  padding: 24px 0 60px;
}

@media (max-width: 768px) {
  .page {
    max-width: calc(100% - 32px);
    width: calc(100% - 32px);
    padding: 16px 0 40px;
  }
}

/* ── Hero / Executive App Bar ── */
.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 26px;
  gap: 16px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 45%, #2563eb 100%);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 20px -2px rgba(2, 132, 199, 0.28);
  margin-bottom: 24px;
}
.hero h1 {
  font-size: 1.55rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  background: none;
  -webkit-text-fill-color: initial;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}
.eyebrow {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.22);
  padding: 3px 12px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 4px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.subtitle {
  color: #f0f9ff;
  font-size: .88rem;
  max-width: 650px;
  margin-top: 2px;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.hero-right {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}
.logout-btn.header-logout-btn {
  background: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.95) !important;
  color: #0284c7 !important;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.logout-btn.header-logout-btn:hover {
  background: #fef2f2 !important;
  border-color: #fecaca !important;
  color: #dc2626 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15);
}

.db-stats {
  display:flex; gap:16px; font-size:.8rem; color:#f0f9ff;
}
.db-stats span { display:flex; align-items:center; gap:4px; }
.db-stats .count { color:#ffffff; font-weight:700; font-size:.9rem; }

/* ── Status badge ── */
.status-badge {
  font-size:.78rem; font-weight:600; padding:4px 14px; border-radius:20px;
  display:inline-flex; align-items:center; gap:6px;
}
.status-badge::before { content:''; width:8px; height:8px; border-radius:50%; }
.status-badge.online { background:var(--success-bg); color:var(--success); }
.status-badge.online::before { background:var(--success); box-shadow:0 0 8px var(--success); }
.status-badge.offline { background:var(--error-bg); color:var(--error); }
.status-badge.offline::before { background:var(--error); }

/* ── Flow bar ── */
.flow {
  display:flex; align-items:center; gap:0; padding:16px 24px;
  background:var(--bg-card); border-radius:var(--radius); margin-bottom:12px;
  overflow-x:auto; border:1px solid var(--border);
}
.flow span {
  flex:1; text-align:center; font-size:.78rem; font-weight:500; color:var(--text-secondary);
  padding:6px 12px; white-space:nowrap; position:relative;
}
.flow span:not(:last-child)::after {
  content:'→'; position:absolute; right:-6px; color:var(--text-muted); font-weight:400;
}

/* ── Disclaimer ── */
.disclaimer {
  font-size: .8rem; color: #92400e; background: #fffbeb;
  padding: 10px 18px; border-radius: var(--radius-sm); margin-bottom: 20px; text-align: center;
  border: 1px solid #fde68a; font-weight: 600;
}

/* ═════════ Tab Navigation (Underline-Only for Selected Tab) ═════════ */
.tab-nav {
  display: flex;
  gap: 8px;
  padding: 0 4px;
  background: transparent;
  border-radius: 0;
  margin-bottom: 24px;
  border: none;
  border-bottom: 1.5px solid var(--border);
}
.tab-btn {
  position: relative;
  flex: 0 0 auto;
  padding: 12px 22px 14px;
  background: transparent !important;
  border: none;
  border-radius: 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
  font-family: var(--font-sans);
  box-shadow: none !important;
}
.tab-btn:hover {
  color: var(--text-primary);
  background: transparent !important;
}
.tab-btn.active {
  background: transparent !important;
  color: #0284c7 !important;
  font-weight: 700;
  box-shadow: none !important;
}
.tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -1.5px;
  left: 0;
  right: 0;
  height: 3px;
  background: #0284c7;
  border-radius: 3px 3px 0 0;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}
.tab-panel { display:none; }
.tab-panel.active { display:block; animation:fadeIn .3s ease; }
@keyframes fadeIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }

/* ── Grid layout ── */
.grid { display:grid; grid-template-columns:1fr 1fr; gap:20px; margin-bottom:20px; }
@media (max-width:768px) { .grid { grid-template-columns:1fr; } }

/* ── Card ── */
.card {
  background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius);
  padding:24px; margin-bottom:20px; transition:all .2s ease;
  box-shadow: var(--shadow);
}
.card:hover { border-color:#cbd5e1; box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06); }
.card h2 { font-size:1.1rem; font-weight:700; margin-bottom:12px; }
.card h3 { font-size:.9rem; font-weight:600; margin:16px 0 8px; color:var(--text-secondary); }
.section-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; }
.section-header h2 { margin-bottom:0; }

/* ── Buttons ── */
.primary {
  display:inline-flex; align-items:center; justify-content:center;
  padding:10px 24px; background:linear-gradient(135deg, #0284c7 0%, #0369a1 100%); color:#ffffff; border:none;
  border-radius:var(--radius-sm); font-weight:600; font-size:.88rem; cursor:pointer;
  transition:all .2s ease; font-family:var(--font-sans);
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}
.primary:hover { background:linear-gradient(135deg, #0369a1 0%, #075985 100%); box-shadow:0 4px 14px rgba(2, 132, 199, 0.35); transform: translateY(-1px); }
.primary:disabled { opacity:.5; cursor:not-allowed; transform:none; box-shadow:none; }
.secondary {
  display:inline-flex; align-items:center; justify-content:center;
  padding:8px 20px; background:#ffffff; color:#334155; border:1px solid #cbd5e1;
  border-radius:var(--radius-sm); font-weight:600; font-size:.85rem; cursor:pointer;
  transition:all .2s ease; font-family:var(--font-sans);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.secondary:hover { background:#f8fafc; border-color:#94a3b8; color:#0f172a; }
.secondary:disabled { opacity:.4; cursor:not-allowed; }
.small { padding:5px 14px; font-size:.78rem; }

/* ── Upload card ── */
.upload-section { margin-bottom: 20px; }
.upload-card { text-align:center; padding:32px; }
.upload-card.drag-over { border-color:var(--accent); background:var(--accent-glow); }
.upload-btn-group { display:flex; gap:16px; justify-content:center; align-items:center; margin-top:16px; flex-wrap:wrap; }

/* ── Browse File Button ── */
.browse-file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  background: #ffffff;
  color: var(--text-primary);
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-sans);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
.browse-file-btn:hover {
  background: #f8fafc;
  border-color: #0284c7;
  color: #0284c7;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.15);
  transform: translateY(-1px);
}

/* ── Prominent Hero Convert to FHIR Button ── */
#convertButton,
.convert-fhir-btn-hero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 32px;
  font-size: 0.98rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: var(--font-sans);
  letter-spacing: 0.02em;
  border: none;
}

/* When Enabled / Ready to convert */
#convertButton:not(:disabled),
.convert-fhir-btn-hero:not(:disabled) {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff !important;
  box-shadow: 0 4px 22px rgba(16, 185, 129, 0.5), 0 0 0 1px rgba(16, 185, 129, 0.6);
  transform: translateY(-1px);
  animation: convertReadyGlow 2.4s infinite ease-in-out;
}

#convertButton:not(:disabled):hover,
.convert-fhir-btn-hero:not(:disabled):hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 6px 30px rgba(16, 185, 129, 0.65), 0 0 0 1.5px #34d399;
  transform: translateY(-2px);
}

#convertButton:not(:disabled):active,
.convert-fhir-btn-hero:not(:disabled):active {
  transform: translateY(0);
  box-shadow: 0 2px 12px rgba(16, 185, 129, 0.4);
}

/* When Disabled (Waiting for file) */
#convertButton:disabled,
.convert-fhir-btn-hero:disabled {
  background: #f1f5f9;
  color: #64748b;
  border: 1.5px dashed #cbd5e1;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.9;
}

@keyframes convertReadyGlow {
  0%, 100% {
    box-shadow: 0 4px 22px rgba(16, 185, 129, 0.5), 0 0 0 1px rgba(16, 185, 129, 0.6);
  }
  50% {
    box-shadow: 0 6px 30px rgba(16, 185, 129, 0.75), 0 0 0 2.5px rgba(52, 211, 153, 0.85);
  }
}
.file-info { margin:14px 0 0; font-size:.85rem; color:var(--text-secondary); }

/* ── Processing Timeline (Time Display Only) ── */
.processing-timeline-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08);
  animation: fadeIn 0.3s ease-out;
}

.processing-timer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.processing-time-spinner {
  width: 48px;
  height: 48px;
  border: 3.5px solid rgba(2, 132, 199, 0.15);
  border-top-color: #0284c7;
  border-right-color: #059669;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.processing-time-display {
  font-size: 3.2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #0284c7;
  letter-spacing: 0.05em;
  line-height: 1;
}

.processing-timeline-track {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.processing-timeline-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0284c7 0%, #0d9488 50%, #059669 100%);
  border-radius: 3px;
  transition: width 0.25s ease-out;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.3);
}

/* ── Horizontal Stepper Card with Connected Line ── */
.stepper-card { padding: 24px 28px; margin-bottom: 24px; }
.stepper-header { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:16px; flex-wrap:wrap; gap:10px; }
.stepper-header h2 { margin-bottom:4px; font-size:1.15rem; }
.duration-badge { font-family:var(--font-mono); font-size:.78rem; padding:4px 12px; background:var(--bg-input); border:1px solid var(--border); border-radius:20px; color:var(--text-secondary); margin:0; }

.stepper-corner-header { display:flex; justify-content:flex-end; align-items:center; margin-bottom:2px; }
.pipeline-corner-timer {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  color: #0284c7;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.stepper-wrap { position:relative; width:100%; padding:15px 0 10px; }
.stepper-track-bg {
  position:absolute; top:34px; left:9%; right:9%; height:4px;
  background:#e2e8f0; border-radius:4px; z-index:1;
}
.stepper-track-fill {
  position:absolute; top:34px; left:9%; width:0%; max-width:82%; height:4px;
  background:linear-gradient(90deg, #0284c7, #0d9488, #059669);
  border-radius:4px; z-index:2; transition:width .6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:0 0 10px rgba(2,132,199,0.4);
}

.stepper-steps { display:flex; justify-content:space-between; position:relative; z-index:3; }
.step-item {
  display:flex; flex-direction:column; align-items:center; text-align:center;
  width:18%; position:relative;
}
.step-circle {
  width:42px; height:42px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  font-weight:700; font-size:.88rem; background:#ffffff; border:2px solid var(--border);
  color:var(--text-muted); transition:all .35s ease; margin-bottom:10px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
.step-item.active .step-circle {
  background:linear-gradient(135deg, #0284c7, #0369a1); border-color:#0284c7; color:#fff;
  transform:scale(1.12); box-shadow:0 0 16px rgba(2,132,199,0.5);
  animation:stepper-pulse 1.8s infinite;
}
.step-item.done .step-circle {
  background:linear-gradient(135deg, #059669, #10b981); border-color:#059669; color:#fff;
  transform:scale(1.0); box-shadow:0 0 10px rgba(5,150,105,0.3);
}
@keyframes stepper-pulse {
  0% { box-shadow:0 0 0 0 rgba(2,132,199,0.6); }
  70% { box-shadow:0 0 0 10px rgba(2,132,199,0); }
  100% { box-shadow:0 0 0 0 rgba(2,132,199,0); }
}

.step-text { display:flex; flex-direction:column; align-items:center; gap:2px; }
.step-title { font-size:.84rem; font-weight:600; color:var(--text-secondary); transition:color .3s; }
.step-item.active .step-title { color:#0284c7; font-weight:700; }
.step-item.done .step-title { color:var(--success); font-weight:600; }
.step-desc { font-size:.72rem; color:var(--text-muted); transition:color .3s; }
.step-item.active .step-desc { color:#0284c7; font-weight:500; }

/* ── Live Processing Logs in Stepper Card ── */
.pipeline-log-box {
  margin-top: 22px;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
}
.pipeline-log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid #334155;
}
.pipeline-log-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #f8fafc;
}
.pipeline-log-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(56, 189, 248, 0.3);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: spin-log 0.85s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
@keyframes spin-log {
  to { transform: rotate(360deg); }
}
.pipeline-log-elapsed {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: #94a3b8;
  background: #1e293b;
  padding: 2px 10px;
  border-radius: 12px;
  border: 1px solid #334155;
}
.pipeline-log-list {
  font-family: var(--font-mono);
  font-size: 0.80rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 6px;
}
.pipeline-log-list::-webkit-scrollbar {
  width: 5px;
}
.pipeline-log-list::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}
.pipeline-log-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #cbd5e1;
  line-height: 1.45;
  animation: log-slide-in 0.25s ease forwards;
}
.pipeline-log-item.active {
  color: #38bdf8;
  font-weight: 600;
}
.pipeline-log-item.success {
  color: #34d399;
  font-weight: 600;
}
.pipeline-log-item.error {
  color: #f87171;
  font-weight: 600;
}
.pipeline-log-ts {
  color: var(--text-muted);
  font-size: 0.74rem;
  min-width: 52px;
  flex-shrink: 0;
  user-select: none;
}
.pipeline-log-msg {
  flex: 1;
}
@keyframes log-slide-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Muted text ── */
.muted { color:var(--text-muted); font-size:.82rem; }

/* ── Error box ── */
.error { background:var(--error-bg); border:1px solid var(--error); border-radius:var(--radius-sm); padding:12px 16px; color:var(--error); font-size:.88rem; margin-bottom:20px; }

/* ═══ Validation Section ═══ */
.validation-section {
  background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius);
  padding:24px; margin-bottom:20px;
}
.validation-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; flex-wrap:wrap; gap:12px; }
.validation-header h2 { margin-bottom:0; }
.compliance-score {
  font-size:1.8rem; font-weight:800; padding:8px 24px; border-radius:var(--radius-sm);
  display:inline-flex; align-items:center; gap:8px;
}
.compliance-score.high { background:var(--success-bg); color:var(--success); }
.compliance-score.medium { background:var(--warning-bg); color:var(--warning); }
.compliance-score.low { background:var(--error-bg); color:var(--error); }

.validation-issues { display:flex; flex-direction:column; gap:6px; margin-bottom:16px; }
.issue {
  padding:8px 14px; border-radius:var(--radius-xs); font-size:.82rem;
  display:flex; align-items:flex-start; gap:8px;
}
.issue .badge {
  font-size:.65rem; font-weight:700; text-transform:uppercase; padding:2px 8px;
  border-radius:10px; white-space:nowrap; flex-shrink:0;
}
.issue.error { background:var(--error-bg); }
.issue.error .badge { background:var(--error); color:#fff; }
.issue.warning { background:var(--warning-bg); }
.issue.warning .badge { background:var(--warning); color:#000; }
.issue.info { background:var(--info-bg); }
.issue.info .badge { background:var(--info); color:#000; }

.fmm-report {
  display:flex; flex-wrap:wrap; gap:8px;
}
.fmm-chip {
  padding:5px 14px; border-radius:20px; font-size:.78rem; font-weight:600;
  border:1px solid var(--border); background:var(--bg-secondary); display:flex; align-items:center; gap:6px;
}
.fmm-chip .fmm-level {
  font-weight:800; font-size:.72rem; padding:2px 8px; border-radius:10px;
  background:var(--accent); color:#fff;
}
.fmm-chip .fmm-level.normative { background:var(--success); }

/* ═══ FHIR Visualization ═══ */
.fhir-viz-section { margin-bottom:20px; }
.fhir-viz-header { margin-bottom:16px; }
.fhir-viz-header h2 { margin-bottom:4px; }

.bundle-overview {
  background:linear-gradient(135deg,#1e3a5f 0%,#0d2137 100%);
  padding:20px 28px; border-radius:var(--radius); margin-bottom:20px;
  display:grid; grid-template-columns:repeat(3,1fr); gap:16px;
  border:1px solid rgba(59,130,246,0.2);
}
.bundle-overview .ov-item label { font-size:.7rem; text-transform:uppercase; letter-spacing:.08em; color:var(--text-muted); }
.bundle-overview .ov-item .ov-value { font-size:1rem; font-weight:700; color:var(--accent); word-break:break-all; }

.fhir-resource-grid {
  display:grid; grid-template-columns:repeat(auto-fill,minmax(340px,1fr)); gap:16px;
}

.fhir-card {
  background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius);
  overflow:hidden; transition:transform .2s,box-shadow .2s;
}
.fhir-card:hover { transform:translateY(-2px); box-shadow:var(--shadow-lg); }
.fhir-card-header {
  display:flex; align-items:center; gap:10px; padding:12px 16px;
  border-bottom:1px solid var(--border);
}
.fhir-card-header .resource-badge {
  font-size:.68rem; font-weight:700; text-transform:uppercase; padding:3px 10px;
  border-radius:10px; color:#fff; letter-spacing:.04em;
}
.fhir-card-header .resource-id { font-size:.72rem; color:var(--text-muted); font-family:var(--font-mono); overflow:hidden; text-overflow:ellipsis; }

.badge-Composition      { background:var(--clr-composition); }
.badge-Patient          { background:var(--clr-patient); }
.badge-Practitioner     { background:var(--clr-practitioner); }
.badge-Organization     { background:var(--clr-organization); }
.badge-Encounter        { background:var(--clr-encounter); }
.badge-Observation      { background:var(--clr-observation); }
.badge-DiagnosticReport { background:var(--clr-diagnosticreport); }

.fhir-card-body { padding:14px 16px; }
.fhir-card-body .field { display:flex; gap:8px; padding:4px 0; border-bottom:1px solid rgba(255,255,255,0.04); font-size:.82rem; }
.fhir-card-body .field:last-child { border-bottom:none; }
.fhir-card-body .field-label { color:var(--text-muted); min-width:80px; font-weight:500; flex-shrink:0; }
.fhir-card-body .field-value { color:var(--text-primary); word-break:break-word; }
.fhir-card-body .field-value.highlight { font-size:1.4rem; font-weight:800; }
.fhir-card-body .field-value .unit { font-size:.75rem; color:var(--text-muted); margin-left:4px; }
.fhir-card-body .ref-range { font-size:.78rem; padding:3px 10px; border-radius:var(--radius-xs); background:var(--bg-input); color:var(--text-secondary); display:inline-block; }
.fhir-card-footer {
  padding:10px 16px; border-top:1px solid var(--border); font-size:.72rem;
}
.fhir-card-footer a { color:var(--accent); word-break:break-all; }

/* ── Summary list / profiles ── */
.summary-list table { width:100%; border-collapse:collapse; }
.summary-list td { padding:5px 0; font-size:.85rem; border-bottom:1px solid rgba(255,255,255,0.05); }
.summary-list td:last-child { text-align:right; font-weight:700; color:var(--accent); }
.profiles { list-style:none; }
.profiles li { font-size:.78rem; padding:2px 0; color:var(--text-secondary); }
.profiles li::before { content:'• '; color:var(--accent); }

/* ── Patient card (extracted data) ── */
.patient { display:flex; gap:16px; flex-wrap:wrap; margin-bottom:16px; padding:12px; background:var(--bg-input); border-radius:var(--radius-sm); }
.patient div { display:flex; flex-direction:column; gap:2px; }
.patient strong { font-size:.72rem; color:var(--text-muted); text-transform:uppercase; letter-spacing:.05em; }
.patient span { font-size:.9rem; font-weight:600; }

/* ── Data tables ── */
.table-wrap { overflow-x:auto; }
table { width:100%; border-collapse:collapse; font-size:.82rem; }
th { text-align:left; padding:8px 10px; border-bottom:2px solid var(--border); color:var(--text-muted); font-weight:600; font-size:.75rem; text-transform:uppercase; letter-spacing:.05em; }
td { padding:8px 10px; border-bottom:1px solid rgba(255,255,255,0.05); vertical-align:top; }
tr:hover td { background:rgba(59,130,246,0.04); }

.loinc-tag { font-size:.72rem; color:var(--warning); font-style:italic; }

/* ── Raw JSON ── */
.raw-card { margin-bottom:0; }
.raw-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.raw-header h2 { margin-bottom:0; }
pre { background:var(--bg-input); border:1px solid var(--border); border-radius:var(--radius-sm); padding:16px; overflow-x:auto; max-height:400px; }
code { font-family:var(--font-mono); font-size:.78rem; line-height:1.5; }

/* ── Archive & Folder Inspection ── */
.batch-archive-summary {
  margin: 14px 0 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}
.archive-card {
  background: var(--bg-card);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.archive-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.archive-icon {
  font-size: 1.6rem;
  line-height: 1;
}
.archive-header strong {
  font-size: 0.95rem;
  color: var(--text-primary);
  display: block;
}
.archive-badge-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  margin-top: 4px;
}
.archive-tree {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 160px;
  overflow-y: auto;
}
.archive-doc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  background: #f8fafc;
  border: 1px solid var(--border);
  transition: all 0.15s ease;
}
.archive-doc-item:hover {
  background: #eff6ff;
  border-color: #0284c7;
  color: #0284c7;
}
.badge-subtle {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}
.folder-prefix {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.78rem;
}
.batch-filepath {
  display: flex;
  align-items: center;
  gap: 4px;
  word-break: break-all;
}


/* ═══ Patient Records ═══ */
.patients-grid {
  display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:16px;
}

/* ═══ Dual Section Split Layout (In-Progress vs Completed) ═══ */
.patients-list-wrapper {
  width: 100%;
}

.patient-sections-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  width: 100%;
  align-items: stretch;
}

@media (max-width: 1100px) {
  .patient-sections-split {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.patient-section-col {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  min-height: 320px;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.patient-section-col.in-progress-col {
  border-top: 4px solid #0284c7;
  background: #ffffff;
}

.patient-section-col.completed-col {
  border-top: 4px solid #059669;
  background: #ffffff;
}

.patient-section-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.patient-section-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.patient-section-title-wrap h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.patient-section-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.patient-section-indicator.in-progress-dot {
  background: #0284c7;
  box-shadow: 0 0 6px rgba(2, 132, 199, 0.4);
}

.patient-section-indicator.completed-dot {
  background: #059669;
  box-shadow: 0 0 6px rgba(5, 150, 105, 0.4);
}

.patient-section-count-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  letter-spacing: 0.02em;
}

.patient-section-count-badge.in-progress-badge {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.patient-section-count-badge.completed-badge {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.patient-section-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 6px 0 0 0;
  line-height: 1.4;
}

.patient-cards-subgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  flex: 1;
}

.patient-cards-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  flex: 1;
}

.patient-row-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-left: 4px solid #059669;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.patient-row-card:hover {
  border-color: #059669;
  background: #f0fdf4;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.12);
}

.patient-row-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.patient-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.patient-row-name {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
}

.patient-row-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.patient-section-empty {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  box-sizing: border-box;
  padding: 36px 20px;
  text-align: center;
  border: 1.5px dashed #cbd5e1;
  border-radius: var(--radius-xs);
  background: #ffffff;
  color: var(--text-muted);
  font-size: 0.85rem;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.patient-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-left: 4px solid #0284c7;
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all .2s ease;
  position: relative;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}
.patient-card:hover {
  border-color: #0284c7;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(2, 132, 199, 0.12);
}
.patient-card .pc-header { display:flex; justify-content:space-between; align-items:flex-start; gap:8px; margin-bottom:4px; }
.patient-card .pc-name { font-size:1.02rem; font-weight:700; color:var(--text-primary); margin-bottom:0; flex:1; }
.pc-delete-btn {
  background:transparent; border:1px solid transparent; color:var(--text-muted);
  padding:4px 6px; border-radius:var(--radius-xs); cursor:pointer; transition:all .2s; line-height:1; display:flex; align-items:center;
}
.pc-delete-btn:hover {
  background:#fef2f2; border-color:#fecaca; color:#dc2626;
}
.danger-btn {
  border-color:#fca5a5 !important; color:#dc2626 !important; background:#ffffff !important;
}
.danger-btn:hover {
  background:#fef2f2 !important; border-color:#dc2626 !important; color:#b91c1c !important;
}
.patient-card .pc-meta { font-size:.78rem; color:var(--text-muted); }
.patient-card .pc-badges { display:flex; gap:6px; margin-top:10px; }
.patient-card .pc-badge {
  font-size:.7rem; padding:3px 10px; border-radius:10px; font-weight:600;
  background:#eff6ff; color:#0284c7; border: 1px solid #bfdbfe;
}

/* ═══ Bundles table ═══ */
.bundles-table-wrap table { width:100%; }
.bundles-table-wrap td { cursor:pointer; }
.bundles-table-wrap tr:hover td { background:var(--accent-glow); }

/* ── Utilities ── */
.hidden { display:none !important; }

/* ═══ Clinical Diagnostic Report (HL7 FHIR R4) ═══ */
.patient-report-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 24px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}
.report-frame {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.report-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid var(--border);
  padding-bottom: 18px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}
.report-branding {
  display: flex;
  align-items: center;
  gap: 14px;
}
.report-icon-box {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.25);
}
.report-title-box h3 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin: 0 0 4px;
  color: var(--text-primary);
  text-transform: uppercase;
}
.report-title-box p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.report-status-box {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.report-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  background: var(--success-bg);
  border: 1px solid var(--success);
  color: var(--success);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 20px;
}
.report-status-pill::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}
.report-meta-tag {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
}

.report-patient-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin-bottom: 20px;
}
.report-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.report-cell-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.report-cell-value {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
}
.report-cell-value.highlight {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}
.report-cell-value.mono {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
}

.report-profile-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: var(--radius-xs);
  padding: 10px 16px;
  margin-bottom: 20px;
  font-size: 0.78rem;
  flex-wrap: wrap;
  gap: 8px;
}
.report-profile-strip span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}
.report-profile-strip strong {
  color: var(--text-primary);
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 0.84rem;
}
.report-table th {
  background: #f8fafc;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.report-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.report-table tr:hover td {
  background: #f8fafc;
}
.test-name-cell {
  font-weight: 600;
  color: var(--text-primary);
}
.loinc-badge {
  display: inline-block;
  padding: 2px 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #1d4ed8;
  text-decoration: none;
  cursor: default !important;
  pointer-events: none !important;
  user-select: text;
}
.loinc-badge:hover {
  background: #eff6ff;
  color: #1d4ed8;
}
.value-cell {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}
.unit-cell {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}
.range-cell {
  color: var(--text-secondary);
  font-size: 0.82rem;
}
.flag-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.flag-badge.normal {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.flag-badge.high {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.flag-badge.low {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.report-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 18px;
  margin-top: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.report-actions {
  display: flex;
  gap: 10px;
}

.conclusion-box {
  background: #f0f9ff;
  border-left: 4px solid var(--accent);
  padding: 14px 18px;
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  margin-bottom: 20px;
}
.conclusion-box h4 {
  margin: 0 0 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #0369a1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.conclusion-box p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width:6px; height:6px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:var(--border); border-radius:3px; }
::-webkit-scrollbar-thumb:hover { background:var(--accent); }

/* ── Enhanced Clinical Report Styles ── */
.report-dossier-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 860px) {
  .report-dossier-wrap {
    grid-template-columns: 1fr;
  }
}
.report-dossier-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.report-dossier-card.full-width {
  grid-column: 1 / -1;
}
.dossier-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  color: var(--accent);
}
.dossier-card-header h4 {
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--text-primary);
}
.report-print-title {
  display: none !important;
}
.dossier-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dossier-row.main-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dossier-subgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}
@media (max-width: 540px) {
  .dossier-subgrid {
    grid-template-columns: 1fr;
  }
}
.dossier-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dossier-item.span-2 {
  grid-column: 1 / -1;
}
.dossier-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.dossier-val {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}
.dossier-val.highlight {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}
.dossier-val.mono {
  font-family: var(--font-mono);
  font-size: 0.82rem;
}
.dossier-val.small {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.id-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  margin-left: 6px;
  vertical-align: middle;
}
.id-tag.green {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.id-tag.blue {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
.id-tag.purple {
  background: #f5f3ff;
  color: #7c3aed;
  border: 1px solid #ddd6fe;
}
.age-pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #334155;
  margin-left: 4px;
}
.blood-group-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  margin-left: 6px;
}
.address-facility-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}
@media (max-width: 768px) {
  .address-facility-grid {
    grid-template-columns: 1fr;
  }
}
.address-text {
  margin: 3px 0 8px;
  font-size: 0.86rem;
  color: var(--text-primary);
  line-height: 1.45;
}
.address-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.addr-tag {
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.72rem;
  color: var(--text-secondary);
}
.addr-tag strong {
  color: var(--text-primary);
}
.physician-row {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.physician-row strong {
  color: var(--text-primary);
  font-size: 0.92rem;
}
.physician-row span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ── Categorized Clinical Diagnoses & Treatment Plan Grid ── */
.report-clinical-section {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin-bottom: 22px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.clinical-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

/* ── Dropdown / Collapsible Report Sections ── */
.report-clinical-section.report-collapsible-section {
  padding: 0 !important;
  margin-bottom: 14px !important;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.report-clinical-section.report-collapsible-section:hover {
  border-color: #93c5fd;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.08);
}

.report-clinical-section.report-collapsible-section .clinical-section-header.report-collapsible-header {
  margin-bottom: 0 !important;
  border-bottom: none !important;
  padding: 14px 20px !important;
  cursor: pointer;
  user-select: none;
  background: transparent;
  transition: background 0.18s ease;
}

.report-clinical-section.report-collapsible-section .clinical-section-header.report-collapsible-header:hover {
  background: #f8fafc;
}

.report-clinical-section.report-collapsible-section .clinical-section-header.report-collapsible-header:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.report-collapsible-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

.report-collapsible-header:hover .report-collapsible-chevron {
  background: #eff6ff;
  color: #0284c7;
  border-color: #bfdbfe;
}

.report-collapsible-section.open .report-collapsible-chevron {
  transform: rotate(180deg);
  background: #e0f2fe;
  color: #0369a1;
}

.report-collapsible-section.open .clinical-section-header.report-collapsible-header {
  border-bottom: 1px solid var(--border) !important;
}

.report-collapsible-body {
  display: none;
  padding: 18px 20px;
}

.report-collapsible-section.open .report-collapsible-body {
  display: block;
  animation: sectionDropdownSlide 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes sectionDropdownSlide {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-toggle-all-btn:hover {
  background: rgba(99, 102, 241, 0.15) !important;
  border-color: rgba(99, 102, 241, 0.4) !important;
  color: #c7d2fe !important;
}
.clinical-section-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
}
.clinical-section-title-wrap h4 {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.clinical-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.clinical-cat-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.clinical-cat-card.diagnoses {
  border-left: 3.5px solid #dc2626;
  background: #fff5f5;
}
.clinical-cat-card.medications {
  border-left: 3.5px solid #0284c7;
  background: #f0f9ff;
}
.clinical-cat-card.findings {
  border-left: 3.5px solid #d97706;
  background: #fffbeb;
}
.clinical-cat-card.followup {
  border-left: 3.5px solid #059669;
  background: #f0fdf4;
}
.clinical-cat-header {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}
.clinical-cat-card.diagnoses .clinical-cat-header { color: #991b1b; }
.clinical-cat-card.medications .clinical-cat-header { color: #0369a1; }
.clinical-cat-card.findings .clinical-cat-header { color: #92400e; }
.clinical-cat-card.followup .clinical-cat-header { color: #166534; }

.clinical-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.clinical-list li {
  font-size: 0.82rem;
  color: #1e293b;
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.clinical-list li::before {
  content: "•";
  color: var(--text-muted);
  font-weight: bold;
}
.diag-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 0.76rem;
  font-weight: 600;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  margin: 2px 4px 2px 0;
}
.med-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 0.76rem;
  font-weight: 600;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  margin: 2px 4px 2px 0;
}
.diag-conclusion {
  margin: 12px 0 0;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--border);
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── Observation Filter Toolbar & Search ── */
.obs-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}
.obs-search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 380px;
}
.obs-search-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.obs-search-input {
  width: 100%;
  padding: 6px 10px 6px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.15s;
}
.obs-search-input:focus {
  border-color: var(--accent);
}
.obs-filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.obs-filter-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.obs-filter-btn:hover {
  background: #f1f5f9;
  color: var(--text-primary);
}
.obs-filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.obs-count-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 2px 8px;
}

/* ── Observation Flags ── */
.flag-badge.critical {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #f87171;
  font-weight: 700;
}
.flag-badge.abnormal {
  background: #faf5ff;
  color: #6b21a8;
  border: 1px solid #c084fc;
}
.flag-badge.reactive {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fdba74;
}

/* ── Archive Documents Provenance Manifest Grid ── */
.report-manifest-section {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin-bottom: 22px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.manifest-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 14px;
}
.manifest-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.manifest-header h4 {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.manifest-badge {
  font-size: 0.7rem;
  font-weight: 600;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  padding: 2px 10px;
  border-radius: 12px;
}
.manifest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 10px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}
.manifest-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.15s ease;
}
.manifest-card:hover {
  background: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.1);
}
.manifest-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.manifest-card-name-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
}
.manifest-icon {
  flex-shrink: 0;
  color: var(--text-muted);
}
.manifest-card-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-all;
  line-height: 1.3;
}
.manifest-type-pill {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}
.manifest-type-pill.dtype-id {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
.manifest-type-pill.dtype-lab {
  background: #faf5ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
}
.manifest-type-pill.dtype-discharge {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
.manifest-type-pill.dtype-photo {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}
.manifest-type-pill.dtype-prescription {
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}
.manifest-type-pill.dtype-bill {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}
.manifest-card-summary {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.manifest-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-muted);
  padding-top: 4px;
  border-top: 1px solid var(--border);
}
.manifest-status-tag {
  color: var(--success);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* ── Physician & Superintendent Official Sign-off Stamp Block ── */
.report-signoff-block {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  padding: 16px 18px;
  margin-top: 20px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
@media (max-width: 720px) {
  .report-signoff-block {
    grid-template-columns: 1fr;
  }
}
.signoff-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.signoff-col .signoff-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}
.signoff-col .signoff-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}
.signoff-col .signoff-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.signoff-stamp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 3px 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px dashed rgba(16, 185, 129, 0.35);
  border-radius: 4px;
  color: var(--success);
  font-size: 0.7rem;
  font-weight: 600;
}

/* ── Rich Patient List View Cards in Tab ── */
.pc-badge.verified {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.pc-badge.abha {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}
.pc-badge.loc {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.pc-badge.diag {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

/* ═══ Print Stylesheet for High-End Hospital Medical Report ═══ */
@media print {
  :root {
    --bg-primary: #ffffff !important;
    --bg-secondary: #ffffff !important;
    --bg-card: #ffffff !important;
    --bg-input: #f8fafc !important;
    --border: #cbd5e1 !important;
    --text-primary: #0f172a !important;
    --text-secondary: #334155 !important;
    --text-muted: #64748b !important;
  }

  @page {
    size: A4 portrait;
    margin: 8mm 10mm;
  }

  html, body {
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 9.5pt !important;
    line-height: 1.35 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Hide all non-printable application shell, navigation, modals, and list cards */
  .portal-switcher, .hero, .tab-nav, .upload-section, .stepper-card,
  #tab-upload, .tab-panel:not(.active),
  #patientsListCard, #tab-patients > section.card:first-child,
  #validationSection, #summaryGrid, .raw-card, #tab-batch, #tab-explorer,
  #patientsList, .section-header, .report-footer, .report-actions,
  #reportBundleSelect, .report-bundle-selector-wrap, #toggleReportJsonBtn, #copyReportJsonBtn, #reportRawJsonWrap,
  .obs-toolbar, .pc-delete-btn, #downloadReportJsonBtn, #deleteCurrentReportBtn,
  body:not(.printing-po):not(.printing-receipt) .modal-backdrop, .pipeline-log-box,
  .report-section-controls, .report-collapsible-chevron,
  .portal-session-bar, #portalSessionBar,
  .report-workflow-banner,
  .report-sticky-nav,
  .report-facility-tagline, .report-branding .report-title-box p,
  .report-status-pill,
  .report-source-archive-tag,
  .address-pills,
  .report-claims-count-badge, #sectionBilling .clinical-section-header .manifest-badge,
  .bill-payment-mode-pill,
  .report-applicable-benefits-wrap,
  .obs-analyte-count-badge, #sectionObservations .clinical-section-header .manifest-badge,
  #obsFilterCount, .obs-count-badge,
  .report-screen-title {
    display: none !important;
  }

  .page {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #tab-patients {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }

  .patient-report-card,
  #patientDetail {
    display: block !important;
    background: #ffffff !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    width: 100% !important;
  }

  .report-frame {
    background: #ffffff !important;
    border: 1.5px solid #0f172a !important;
    border-radius: 4px !important;
    box-shadow: none !important;
    padding: 16px 20px !important;
    color: #0f172a !important;
    margin: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    page-break-after: auto;
  }

  .report-top-bar {
    border-bottom: 2px solid #0f172a !important;
    padding-bottom: 12px !important;
    margin-bottom: 14px !important;
    color: #0f172a !important;
  }

  .report-branding .report-icon-box {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #2563eb !important;
  }

  .report-branding .report-title-box h3 {
    color: #0f172a !important;
    font-size: 15pt !important;
    font-weight: 800 !important;
  }

  .report-print-title {
    display: inline !important;
  }

  .dossier-demographics-title,
  .dossier-address-title {
    text-transform: none !important;
    font-size: 9pt !important;
    font-weight: 700 !important;
    letter-spacing: normal !important;
  }

  .report-meta-tag {
    color: #334155 !important;
    font-size: 8pt !important;
  }

  .report-dossier-wrap {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    margin-bottom: 14px !important;
    page-break-inside: avoid;
  }

  .report-dossier-card {
    background: #ffffff !important;
    border: 1px solid #94a3b8 !important;
    color: #0f172a !important;
    box-shadow: none !important;
    padding: 10px 14px !important;
    page-break-inside: avoid;
  }

  .dossier-card-header {
    border-bottom: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    padding-bottom: 6px !important;
    margin-bottom: 8px !important;
  }

  .dossier-card-header h4 {
    color: #0f172a !important;
    font-size: 9pt !important;
  }

  .dossier-label {
    color: #64748b !important;
    font-size: 7.5pt !important;
  }

  .dossier-val {
    color: #0f172a !important;
    font-size: 9pt !important;
  }

  .dossier-val.highlight {
    color: #0f172a !important;
    font-size: 11.5pt !important;
    font-weight: 800 !important;
  }

  .id-tag.green, .id-tag.blue, .id-tag.purple {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border: 1px solid #94a3b8 !important;
  }

  .blood-group-badge {
    background: #fef2f2 !important;
    color: #b91c1c !important;
    border: 1px solid #f87171 !important;
  }

  .addr-tag {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
  }

  .address-text {
    color: #0f172a !important;
  }

  .physician-row strong {
    color: #0f172a !important;
  }

  .report-profile-strip {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    margin-bottom: 14px !important;
    padding: 6px 12px !important;
    font-size: 8pt !important;
    page-break-inside: avoid;
  }

  .report-clinical-section {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    margin-bottom: 14px !important;
    padding: 12px 16px !important;
    page-break-inside: avoid;
  }

  .report-clinical-section.report-collapsible-section {
    padding: 12px 16px !important;
  }
  .report-collapsible-body {
    display: block !important;
    padding: 10px 0 0 0 !important;
    animation: none !important;
  }
  .clinical-section-header.report-collapsible-header {
    cursor: default !important;
    pointer-events: none !important;
    border-bottom: 1px solid #cbd5e1 !important;
    padding: 0 0 8px 0 !important;
    margin-bottom: 10px !important;
  }

  .report-clinical-section div[style*="background"] {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
  }

  .report-clinical-section span,
  .report-clinical-section p,
  .report-clinical-section td,
  .report-clinical-section th,
  .report-clinical-section strong {
    color: #0f172a !important;
  }

  .clinical-section-header {
    border-bottom: 1px solid #cbd5e1 !important;
    padding-bottom: 8px !important;
    margin-bottom: 10px !important;
  }

  .clinical-section-title-wrap h4 {
    color: #0f172a !important;
    font-size: 9.5pt !important;
  }

  .clinical-cat-card {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
  }

  .clinical-list li {
    color: #0f172a !important;
  }

  .diag-pill {
    background: #fef2f2 !important;
    color: #991b1b !important;
    border: 1px solid #fca5a5 !important;
  }

  .med-pill {
    background: #eff6ff !important;
    color: #1e40af !important;
    border: 1px solid #bfdbfe !important;
  }

  .report-table {
    border: 1px solid #cbd5e1 !important;
    width: 100% !important;
    page-break-inside: auto;
  }

  .report-table th {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-bottom: 2px solid #94a3b8 !important;
    font-size: 8.5pt !important;
    padding: 6px 8px !important;
  }

  .report-table td {
    border-bottom: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
    font-size: 8pt !important;
    padding: 5px 8px !important;
  }

  .report-table tr {
    page-break-inside: avoid;
  }

  .test-name-cell div {
    color: #0f172a !important;
    font-weight: 700 !important;
  }

  .value-cell {
    color: #0f172a !important;
    font-weight: 800 !important;
  }

  .loinc-badge {
    background: #f8fafc !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
  }

  .flag-badge.normal {
    background: #ecfdf5 !important;
    color: #065f46 !important;
    border: 1px solid #10b981 !important;
  }

  .flag-badge.high, .flag-badge.critical {
    background: #fef2f2 !important;
    color: #991b1b !important;
    border: 1px solid #ef4444 !important;
  }

  .flag-badge.low {
    background: #ecfeff !important;
    color: #155e75 !important;
    border: 1px solid #06b6d4 !important;
  }

  .report-manifest-section {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    page-break-inside: avoid;
  }

  .manifest-grid {
    max-height: none !important;
    overflow: visible !important;
  }

  .manifest-card {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
  }

  .manifest-card-name {
    color: #0f172a !important;
  }

  .manifest-card-summary {
    color: #475569 !important;
  }

  .report-signoff-block {
    background: #ffffff !important;
    border: 1px solid #94a3b8 !important;
    color: #0f172a !important;
    page-break-inside: avoid;
    padding: 12px 16px !important;
    margin-top: 14px !important;
  }

  .signoff-col .signoff-name {
    color: #0f172a !important;
  }

  .signoff-col .signoff-sub {
    color: #475569 !important;
  }

  .signoff-stamp {
    background: #ecfdf5 !important;
    color: #065f46 !important;
    border: 1px dashed #10b981 !important;
  }

  /* ═══ One-Page Insurance Print Report Strict Layout ═══ */
  .insurance-onepage-report {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1.5px solid #0f172a !important;
    border-radius: 0 !important;
    padding: 6px 10px !important;
    margin: 0 !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    max-height: 278mm !important;
    overflow: hidden !important;
    page-break-inside: avoid !important;
    page-break-after: avoid !important;
    page-break-before: avoid !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    gap: 4px !important;
  }

  .insurance-onepage-report * {
    box-sizing: border-box !important;
  }

  .iop-bundle-selector {
    display: none !important;
  }

  .iop-header {
    border-bottom: 1.5px solid #0f172a !important;
    padding-bottom: 3px !important;
    margin-bottom: 3px !important;
    gap: 8px !important;
  }
  .iop-logo-box {
    width: 28px !important;
    height: 28px !important;
    background: #f1f5f9 !important;
    border: 1px solid #94a3b8 !important;
    color: #0f172a !important;
  }
  .iop-org-name {
    color: #0f172a !important;
    font-size: 10.5pt !important;
    font-weight: 800 !important;
    line-height: 1.1 !important;
  }
  .iop-sub-line {
    color: #475569 !important;
    font-size: 6pt !important;
    letter-spacing: 0.04em !important;
  }
  .iop-claim-status-pill.approved {
    background: #ecfdf5 !important;
    color: #065f46 !important;
    border: 1px solid #10b981 !important;
    font-size: 6pt !important;
    padding: 1px 6px !important;
  }
  .iop-meta-grid {
    font-size: 6pt !important;
    color: #334155 !important;
    gap: 8px !important;
  }
  .iop-meta-grid span strong {
    color: #0f172a !important;
  }

  .iop-grid-row {
    gap: 4px !important;
    margin-bottom: 3px !important;
  }
  .iop-panel {
    background: #ffffff !important;
    border: 1px solid #94a3b8 !important;
    border-radius: 2px !important;
    padding: 3px 6px !important;
    gap: 3px !important;
  }
  .iop-panel-hdr {
    border-bottom: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    font-size: 7pt !important;
    font-weight: 700 !important;
    padding-bottom: 2px !important;
  }
  .iop-detail-row {
    font-size: 6.8pt !important;
    gap: 4px !important;
  }
  .iop-detail-row.main {
    padding-bottom: 2px !important;
  }
  .iop-label {
    color: #64748b !important;
    font-size: 6pt !important;
  }
  .iop-val {
    color: #0f172a !important;
    font-size: 7pt !important;
  }
  .iop-val.highlight {
    font-size: 8.5pt !important;
    color: #0f172a !important;
  }
  .iop-val.highlight-sub {
    color: #0f172a !important;
  }
  .iop-val.diag-val {
    color: #b91c1c !important;
  }
  .iop-val.proc-val {
    color: #b45309 !important;
  }
  .iop-sub-grid {
    gap: 2px 8px !important;
    padding-top: 2px !important;
  }
  .iop-mini-tag {
    background: #ecfdf5 !important;
    border: 1px solid #10b981 !important;
    color: #065f46 !important;
    font-size: 5pt !important;
  }

  .iop-financial-ribbon {
    gap: 3px !important;
  }
  .iop-fin-box {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    padding: 2px 5px !important;
  }
  .iop-fin-box.highlight-primary {
    background: #eff6ff !important;
    border: 1px solid #3b82f6 !important;
  }
  .iop-fin-box.highlight-primary .iop-fin-amt {
    color: #1d4ed8 !important;
  }
  .iop-fin-box.highlight-success {
    background: #f0fdf4 !important;
    border: 1px solid #16a34a !important;
  }
  .iop-fin-box.highlight-success .iop-fin-amt {
    color: #15803d !important;
  }
  .iop-fin-box.highlight-info {
    background: #f5f3ff !important;
    border: 1px solid #6366f1 !important;
  }
  .iop-fin-box.highlight-info .iop-fin-amt {
    color: #4338ca !important;
  }
  .iop-fin-lbl {
    color: #475569 !important;
    font-size: 5.5pt !important;
  }
  .iop-fin-amt {
    color: #0f172a !important;
    font-size: 8.5pt !important;
  }
  .iop-fin-sub {
    color: #64748b !important;
    font-size: 5pt !important;
  }

  .iop-fin-breakdown-wrap {
    margin-top: 3px !important;
  }
  .iop-fin-table {
    font-size: 6pt !important;
  }
  .iop-fin-table td {
    padding: 1.5px 4px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
  }
  .iop-fin-table .iop-line-lbl {
    color: #334155 !important;
  }
  .iop-fin-table .iop-line-amt {
    color: #0f172a !important;
  }
  .iop-fin-summary-row {
    font-size: 6.5pt !important;
    color: #334155 !important;
    padding: 1px 0 !important;
  }

  .iop-narrative {
    font-size: 6.5pt !important;
    line-height: 1.3 !important;
    color: #1e293b !important;
    background: #f8fafc !important;
    border-left: 2.5px solid #2563eb !important;
    padding: 3px 6px !important;
    margin-bottom: 3px !important;
  }
  .iop-pillars-grid {
    gap: 3px !important;
  }
  .iop-pillar-card {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    padding: 2px 4px !important;
  }
  .iop-pillar-title {
    color: #1e40af !important;
    font-size: 6pt !important;
  }
  .iop-pillar-text {
    color: #475569 !important;
    font-size: 5.5pt !important;
    line-height: 1.25 !important;
  }

  .iop-signoff-block {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    padding: 3px 6px !important;
    gap: 6px !important;
    margin-top: 3px !important;
  }
  .iop-sign-label {
    color: #64748b !important;
    font-size: 5pt !important;
  }
  .iop-sign-name {
    color: #0f172a !important;
    font-size: 7pt !important;
  }
  .iop-sign-sub {
    color: #475569 !important;
    font-size: 5.5pt !important;
  }
  .iop-sign-stamp {
    background: #ecfdf5 !important;
    border: 1px dashed #10b981 !important;
    color: #065f46 !important;
    font-size: 5pt !important;
    padding: 1px 4px !important;
  }
}


/* ═══ Portal Switcher ═══ */
.portal-switcher {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 24px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}
.portal-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border: none;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  background: transparent;
  color: var(--text-muted);
}
.portal-btn:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
}
.portal-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.35);
}
.portal-btn svg {
  flex-shrink: 0;
}


/* ── Insurance Claim Summary Components ── */

.claim-key-fields,
.claim-doc-sections {
  margin-bottom: 20px;
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.claim-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 14px;
}
.claim-section-title svg {
  color: var(--accent);
  flex-shrink: 0;
}

.claim-narrative {
  font-size: 0.84rem;
  line-height: 1.65;
  color: var(--text-secondary);
  background: rgba(59, 130, 246, 0.06);
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  margin: 0 0 14px;
}

.claim-flags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.claim-flag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 20px;
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.claim-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px 16px;
}

.claim-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.claim-field-highlight {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-xs);
  padding: 6px 10px;
}
.claim-field-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.claim-field-value {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-primary);
}
.claim-field-highlight .claim-field-value {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent);
}

/* ── Document Section Accordion ── */

.claim-doc-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  margin-bottom: 6px;
  overflow: hidden;
  transition: all 0.2s ease;
}
.claim-doc-section:last-child {
  margin-bottom: 0;
}
.claim-doc-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  background: var(--bg-input);
  transition: background 0.15s ease;
}
.claim-doc-section-header:hover {
  background: var(--bg-card-hover);
}
.claim-doc-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}
.claim-doc-section-title .chevron-icon {
  transition: transform 0.2s ease;
  color: var(--text-muted);
}
.claim-doc-section.expanded .claim-doc-section-title .chevron-icon {
  transform: rotate(180deg);
}
.claim-doc-section-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent);
  border: 1px solid rgba(59, 130, 246, 0.2);
}
.claim-doc-section-body {
  max-height: 0;
  overflow: hidden;
  padding: 0 14px;
  transition: max-height 0.25s ease, padding 0.25s ease;
}
.claim-doc-section.expanded .claim-doc-section-body {
  max-height: 500px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}
.claim-doc-section-body p {
  margin: 0 0 8px;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-secondary);
}
.claim-section-points {
  margin: 6px 0 0;
  padding-left: 18px;
  list-style-type: disc;
}
.claim-section-points li {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 3px;
}

/* ── Financial Summary Card ── */

.financial-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.financial-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  transition: border-color 0.15s ease;
}
.financial-item:hover {
  border-color: var(--accent);
}
.financial-item-primary {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.3);
}
.financial-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.financial-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
}
.financial-item-primary .financial-value {
  color: var(--success);
  font-size: 1.05rem;
}
.financial-source {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Claim Financial Highlight Bar ── */

.claim-financial-highlight-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.claim-metric-badge {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  min-width: 140px;
  transition: all 0.15s ease;
}

.claim-metric-badge:hover {
  border-color: var(--accent);
}

.claim-metric-badge.primary {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.3);
}

.claim-metric-badge.primary .metric-val {
  color: var(--accent);
  font-size: 1.1rem;
}

.claim-metric-badge.success {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
}

.claim-metric-badge.success .metric-val {
  color: var(--success);
}

.claim-metric-badge.info {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.3);
}

.claim-metric-badge.info .metric-val {
  color: #818cf8;
}

.claim-metric-badge .metric-lbl {
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.claim-metric-badge .metric-val {
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

/* ══════════════════════════════════════════════════════════════════
   Insurance One-Page Executive Report Screen Styles
   ══════════════════════════════════════════════════════════════════ */

.insurance-onepage-report {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  box-sizing: border-box;
}

.iop-bundle-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  padding: 6px 12px;
  background: var(--bg-input);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  font-size: 0.8rem;
}

.iop-bundle-selector select {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 0.8rem;
}

/* ── Top Header ── */
.iop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
  gap: 16px;
}

.iop-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.iop-logo-box {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(16, 185, 129, 0.2));
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.iop-title-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.iop-org-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.iop-sub-line {
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.iop-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.iop-claim-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.iop-claim-status-pill.approved {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.iop-meta-grid {
  display: flex;
  gap: 14px;
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.iop-meta-grid span strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
}

/* ── Grid Layouts ── */
.iop-grid-row {
  display: grid;
  gap: 12px;
}

.iop-two-col {
  grid-template-columns: 1fr 1fr;
}

.iop-panel {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.iop-panel-hdr {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #0284c7;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.iop-panel-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.iop-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 0.8rem;
}

.iop-detail-row.main {
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--border);
}

.iop-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.iop-val {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
}

.iop-val.highlight {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
}

.iop-val.highlight-sub {
  color: #0284c7;
  font-weight: 700;
}

.iop-val.diag-val {
  color: #dc2626;
  font-weight: 700;
}

.iop-val.proc-val {
  color: #d97706;
  font-weight: 700;
}

.iop-sub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  padding-top: 4px;
}

.iop-sub-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.iop-mini-tag {
  display: inline-block;
  font-size: 0.62rem;
  padding: 1px 6px;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  border-radius: 4px;
  margin-left: 3px;
  font-weight: 600;
}

/* ── Financial Section ── */
.iop-financial-ribbon {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.iop-fin-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all 0.2s ease;
}

.iop-fin-box.highlight-primary {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.iop-fin-box.highlight-primary .iop-fin-amt {
  color: #0284c7;
}

.iop-fin-box.highlight-success {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.iop-fin-box.highlight-success .iop-fin-amt {
  color: #059669;
}

.iop-fin-box.highlight-info {
  background: #f5f3ff;
  border-color: #ddd6fe;
}

.iop-fin-box.highlight-info .iop-fin-amt {
  color: #7c3aed;
}

.iop-fin-lbl {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.iop-fin-amt {
  font-size: 1.05rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.iop-fin-sub {
  font-size: 0.62rem;
  color: var(--text-muted);
}

/* ── Financial Breakdown Table ── */
.iop-fin-breakdown-wrap {
  margin-top: 6px;
}

.iop-fin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.iop-fin-table td {
  padding: 4px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.iop-fin-table .iop-line-lbl {
  color: var(--text-secondary);
}

.iop-fin-table .iop-line-amt {
  text-align: right;
  font-weight: 700;
  color: var(--text-primary);
}

.iop-fin-grid-fallback {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
  margin-top: 4px;
}

.iop-fin-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-secondary);
  padding: 3px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}

.iop-fin-summary-row.highlight {
  border-bottom: 1px solid rgba(16, 185, 129, 0.3);
}

/* ── Executive Summary & Pillars ── */
.iop-narrative {
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0 0 6px;
  background: #f8fafc;
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  border-left: 3px solid var(--accent);
}

.iop-pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.iop-pillar-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.iop-pillar-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #0284c7;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.iop-pillar-text {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── Sign-off Stamps ── */
.iop-signoff-block {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

.iop-signoff-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.iop-sign-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.iop-sign-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
}

.iop-sign-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.iop-sign-stamp {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px dashed rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-size: 0.68rem;
  font-weight: 600;
  width: fit-content;
}

/* ═══════════════════════════════════════════════════════════════
   Insurance Plan Details & Benefits View (Pixel-Matched to Design)
   ═══════════════════════════════════════════════════════════════ */
.insurance-plan-container {
  width: 100%;
  margin-top: 18px;
  margin-bottom: 24px;
}

/* ── Validation Passed Top Banner ── */
.ip-validation-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #eef9f2;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 12px 22px;
  margin-bottom: 22px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.ip-banner-left {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.ip-banner-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ip-banner-title {
  font-weight: 700;
  font-size: 15px;
  color: #065f46;
}

.ip-banner-detail {
  font-size: 13.5px;
  color: #475569;
}

.ip-banner-detail .val-valid {
  color: #059669;
  font-weight: 700;
}

.ip-saved-badge {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 14px;
  font-weight: 600;
  font-size: 12.5px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  display: inline-block;
}

/* ── Insurance Plan Details Card ── */
.ip-details-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px 28px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  margin-bottom: 24px;
}

.ip-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.ip-icon-box {
  width: 36px;
  height: 36px;
  background: #eff6ff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ip-card-header h3 {
  font-size: 19px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.ip-details-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.ip-details-grid .ip-metric-box:nth-child(1),
.ip-details-grid .ip-metric-box:nth-child(2),
.ip-details-grid .ip-metric-box:nth-child(3),
.ip-details-grid .ip-metric-box:nth-child(4) {
  grid-column: span 3;
}

.ip-details-grid .ip-metric-box:nth-child(5),
.ip-details-grid .ip-metric-box:nth-child(6),
.ip-details-grid .ip-metric-box:nth-child(7) {
  grid-column: span 4;
}

@media (max-width: 900px) {
  .ip-details-grid .ip-metric-box:nth-child(n) {
    grid-column: span 6;
  }
}

@media (max-width: 600px) {
  .ip-details-grid .ip-metric-box:nth-child(n) {
    grid-column: span 12;
  }
}

.ip-metric-box {
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ip-metric-label {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.ip-metric-val {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
  word-break: break-word;
}

.ip-metric-val.mono {
  font-family: var(--font-mono, monospace);
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
}

.ip-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  border-radius: 9999px;
  padding: 2px 10px;
  font-size: 12.5px;
  font-weight: 600;
  width: fit-content;
}

.ip-dot {
  font-size: 15px;
  line-height: 1;
  color: #10b981;
}

/* ── Benefits Section ── */
.ip-benefits-section {
  margin-top: 24px;
}

.ip-benefits-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.ip-benefits-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ip-benefits-header h3 {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary, #ffffff);
  margin: 0;
}

.ip-benefits-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

@media (max-width: 850px) {
  .ip-benefits-grid {
    grid-template-columns: 1fr;
  }
}

.ip-benefit-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
}

.ip-badges-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.ip-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  letter-spacing: 0.2px;
}

.ip-badge-cat {
  background: #e6f9f0;
  color: #047857;
  border: 1px solid #bbf7d0;
}

.ip-badge-type {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  text-transform: uppercase;
}

.ip-badge-val {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.ip-badge-cap {
  background: #ffe4e6;
  color: #9f1239;
  border: 1px solid #fecdd3;
}

.ip-cond-title {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.ip-cond-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ip-cond-list li {
  position: relative;
  padding-left: 18px;
  font-size: 13.5px;
  color: #334155;
  line-height: 1.45;
}

.ip-cond-list li::before {
  content: "•";
  position: absolute;
  left: 2px;
  top: -1px;
  color: #10b981;
  font-size: 16px;
  line-height: 1.2;
}

/* FHIR Format (Raw JSON) Dropdown Styles */
details.raw-json-details summary::-webkit-details-marker,
details.raw-json-details summary::marker {
  display: none;
  content: "";
}

details.raw-json-details summary {
  outline: none;
}

details.raw-json-details .raw-toggle-arrow {
  display: inline-flex;
  transition: transform 0.25s ease;
  color: var(--accent-primary);
}

details.raw-json-details[open] .raw-toggle-arrow {
  transform: rotate(180deg);
}

/* ── Applicable Policy Coverage Heads Dropdown ── */
details.applicable-benefits-dropdown summary {
  outline: none;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
details.applicable-benefits-dropdown summary::-webkit-details-marker,
details.applicable-benefits-dropdown summary::marker {
  display: none;
}
details.applicable-benefits-dropdown .dropdown-arrow {
  display: inline-flex;
  transition: transform 0.25s ease;
  color: #60a5fa;
}
details.applicable-benefits-dropdown[open] .dropdown-arrow {
  transform: rotate(180deg);
}
details.applicable-benefits-dropdown summary:hover {
  opacity: 0.92;
}


/* ══════════════════════════════════════════════════════════════
   DUAL PORTAL AUTHENTICATION & SESSION STYLING
   ══════════════════════════════════════════════════════════════ */

.login-view {
  min-height: 85vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
  animation: fadeIn 0.4s ease-out;
  background: radial-gradient(circle at 50% 15%, #e2e8f0 0%, #edf2f7 60%, #e2e8f0 100%);
}

.login-header {
  text-align: center;
  max-width: 780px;
  margin-bottom: 36px;
}

.login-badge-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}

.auth-flag-badge {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #ffedd5;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 9999px;
  letter-spacing: 0.02em;
}

.auth-fhir-badge {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #dbeafe;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 9999px;
  letter-spacing: 0.02em;
}

.login-header h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 10px 0;
  letter-spacing: -0.02em;
}

.login-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0;
}

.login-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 28px;
  width: 100%;
  max-width: 920px;
  margin-bottom: 32px;
}

.login-portal-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  display: flex;
  flex-direction: column;
}

.login-portal-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
}

.login-portal-card.hospital-card:hover {
  border-color: #059669;
  box-shadow: 0 14px 40px rgba(5, 150, 105, 0.12);
}

.login-portal-card.insurance-card:hover {
  border-color: #0284c7;
  box-shadow: 0 14px 40px rgba(2, 132, 199, 0.12);
}

.portal-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.portal-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portal-icon-wrapper.hospital-accent {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #059669;
}

.portal-icon-wrapper.insurance-accent {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #0284c7;
}

.portal-type-tag {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 6px;
}

.portal-type-tag.hospital-tag {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.portal-type-tag.insurance-tag {
  background: #eff6ff;
  color: #0284c7;
  border: 1px solid #bfdbfe;
}

.login-portal-card h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 10px 0;
  color: var(--text-primary);
}

.portal-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 20px 0;
  flex-grow: 1;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.login-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-form label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
}

.login-form input {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 14px;
  color: #0f172a;
  font-size: 0.92rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-form input:focus {
  outline: none;
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input-wrap input {
  width: 100%;
  padding-right: 44px;
}

.password-toggle-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  color: #64748b;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
  z-index: 2;
}

.password-toggle-btn:hover {
  color: #0284c7 !important;
  background: rgba(2, 132, 199, 0.08) !important;
}

.password-toggle-btn:focus-visible {
  outline: none;
  color: #0284c7 !important;
  background: rgba(2, 132, 199, 0.12) !important;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.25);
}

.password-toggle-btn:active {
  color: #0369a1 !important;
  background: rgba(2, 132, 199, 0.18) !important;
}

.login-submit-btn {
  padding: 12px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.hospital-btn-glow {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  border: 1px solid #059669;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.25);
}

.hospital-btn-glow:hover {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.35);
}

.insurance-btn-glow {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: 1px solid #0284c7;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.25);
}

.insurance-btn-glow:hover {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.35);
}

.login-single-card-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 440px;
  margin: 0 auto 32px;
}

.login-portal-card.unified-login-card {
  width: 100%;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-top: 4px solid #0284c7;
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 20px 25px -5px rgba(15, 23, 42, 0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.login-portal-card.unified-login-card:hover {
  border-color: #0284c7;
  box-shadow: 0 18px 35px -5px rgba(15, 23, 42, 0.12), 0 10px 15px -5px rgba(15, 23, 42, 0.06);
}

.portal-icon-wrapper.unified-accent {
  background: linear-gradient(135deg, #eff6ff 0%, #ecfdf5 100%);
  border: 1.5px solid #bfdbfe;
  color: #0284c7;
}

.portal-type-tag.unified-tag {
  background: #eff6ff;
  color: #0284c7;
  border: 1px solid #bfdbfe;
}

.unified-btn-glow {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: 1px solid #0284c7;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.25);
}

.unified-btn-glow:hover {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.35);
}

.login-quick-demo-row {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.login-quick-demo-row .demo-quick-btn {
  flex: 1;
}

.demo-quick-btn {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.demo-quick-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.portal-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.portal-features span {
  font-size: 0.74rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.login-error-msg {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  font-size: 0.8rem;
  padding: 8px 12px;
  border-radius: 6px;
}

.login-footer-info {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════════════════════
   PORTAL SESSION BAR
   ══════════════════════════════════════════════════════════════ */

.portal-session-bar {
  display: none !important;
}

.header-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  color: #475569;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.header-logout-btn:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.15);
  transform: translateY(-1px);
}

.session-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.active-portal-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
}

.portal-indicator-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseDot 2s infinite ease-in-out;
}

body.portal-insurance .portal-indicator-dot {
  background: #6366f1;
  box-shadow: 0 0 8px #6366f1;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.2); }
}

.session-divider {
  color: var(--text-muted);
  opacity: 0.4;
  font-size: 0.9rem;
}

.active-user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.user-role-pill {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.session-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

/* ══════════════════════════════════════════════════════════════
   MODAL: POLICY UPLOAD & ADJUDICATION
   ══════════════════════════════════════════════════════════════ */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 580px;
  box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.2), 0 0 1px rgba(15, 23, 42, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(2, 132, 199, 0.1);
  border: 1px solid rgba(2, 132, 199, 0.25);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-sub {
  margin: 2px 0 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color 0.2s;
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: 70vh;
  overflow-y: auto;
  background: #ffffff;
}

.modal-context-box {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
}

.ctx-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ctx-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.ctx-val {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.ctx-val.highlight {
  font-size: 1.05rem;
  font-weight: 800;
  color: #059669;
}

.policy-drop-zone {
  border: 2px dashed rgba(2, 132, 199, 0.35);
  background: rgba(2, 132, 199, 0.03);
  border-radius: 12px;
  padding: 24px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}

.policy-drop-zone:hover,
.policy-drop-zone.dragover {
  border-color: #0284c7;
  background: rgba(2, 132, 199, 0.08);
  color: var(--text-primary);
}

.drop-primary-txt {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 4px 0 0 0;
}

.drop-sub-txt {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
}

.selected-file-pill {
  margin-top: 10px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sample-policies-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sample-block-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sample-policy-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 160px;
  overflow-y: auto;
}

.sample-policy-item-btn {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  font-size: 0.8rem;
  color: var(--text-primary);
}

.sample-policy-item-btn:hover {
  background: #f1f5f9;
  border-color: #0284c7;
}

.sample-policy-item-btn.recommended {
  border-color: rgba(5, 150, 105, 0.45);
  background: rgba(5, 150, 105, 0.06);
}

.sample-policy-item-btn.recommended:hover {
  border-color: #059669;
  background: rgba(5, 150, 105, 0.12);
}

.sample-policy-item-btn.selected {
  background: rgba(2, 132, 199, 0.1);
  border-color: #0284c7;
  box-shadow: 0 0 0 1px #0284c7;
  color: #0369a1;
}

.sp-item-name {
  font-weight: 600;
  display: block;
}

.sp-item-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.adjudication-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 32px 20px;
  margin: 12px 0;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
  animation: fadeInAdj 0.25s ease-out;
}

@keyframes fadeInAdj {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.adjudication-spinner-wrap {
  position: relative;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.adjudication-loading-spinner {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 3.5px solid rgba(2, 132, 199, 0.18);
  border-top-color: #0284c7;
  border-right-color: #059669;
  border-bottom-color: rgba(2, 132, 199, 0.18);
  border-left-color: rgba(2, 132, 199, 0.18);
  animation: spinPolicyCircle 0.85s cubic-bezier(0.5, 0.15, 0.5, 0.85) infinite;
  box-shadow: 0 0 20px rgba(2, 132, 199, 0.15);
}

@keyframes spinPolicyCircle {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.progress-bar-container {
  width: 100%;
  max-width: 320px;
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.progress-bar-container .progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0284c7, #059669, #38bdf8);
  background-size: 200% 100%;
  animation: adjProgressShimmer 1.8s ease-in-out infinite;
}

@keyframes adjProgressShimmer {
  0% { transform: translateX(-100%); width: 50%; }
  50% { transform: translateX(50%); width: 75%; }
  100% { transform: translateX(200%); width: 50%; }
}

.adj-status-text {
  font-size: 0.92rem;
  color: var(--text-primary);
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.01em;
  animation: pulseText 1.8s ease-in-out infinite;
}

.adjudication-sub-text {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin: 0;
  max-width: 400px;
  line-height: 1.4;
}

.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: btnSpinnerRotate 0.75s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
  flex-shrink: 0;
}

@keyframes btnSpinnerRotate {
  to { transform: rotate(360deg); }
}

.btn-loading {
  pointer-events: none !important;
  opacity: 0.85 !important;
  cursor: wait !important;
}

@keyframes pulseText {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: #f8fafc;
}

.modal-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  font-size: 0.82rem;
  padding: 10px 14px;
  border-radius: 8px;
}

/* ═════════ Insurance Portal: Hide Tab Navigation & Upload Panel ═════════ */
body.portal-insurance .tab-nav,
body.portal-insurance #tabNav,
body.portal-insurance #tab-upload {
  display: none !important;
}

body.portal-insurance #tab-patients {
  display: block !important;
}

body.portal-insurance .hospital-only-btn {
  display: none !important;
}

/* ═════════ Insurance Portal Top Header (Medium Royal Blue) ═════════ */
body.portal-insurance .hero {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 45%, #4f46e5 100%);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 20px -2px rgba(37, 99, 235, 0.28);
}

body.portal-insurance .logout-btn.header-logout-btn {
  color: #2563eb !important;
}

body.portal-insurance .logout-btn.header-logout-btn:hover {
  background: #fef2f2 !important;
  border-color: #fecaca !important;
  color: #dc2626 !important;
}

/* ═════════ Hospital Add Patient Record Button ═════════ */
.add-patient-record-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #ffffff;
  border: 1px solid rgba(59, 130, 246, 0.4);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
  transition: all 0.2s ease;
}

.add-patient-record-btn:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

/* ═════════ Workflow Stage Badges & Action Strips ═════════ */
.wf-stage-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.wf-stage-created {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.wf-stage-sent {
  background: #fefce8;
  color: #b45309;
  border: 1px solid #fde68a;
}

.wf-stage-review {
  background: #ecfeff;
  color: #0e7490;
  border: 1px solid #a5f3fc;
}

.wf-stage-ok {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.wf-stage-po {
  background: #faf5ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
}

/* Workflow Timeline Stepper Inside Patient Report */
.report-workflow-banner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 18px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

.report-wf-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.report-wf-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.report-wf-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.report-wf-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--border);
  font-size: 0.76rem;
  color: var(--text-muted);
}

.report-wf-step.active {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
  font-weight: 700;
}

.report-wf-step.completed {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}

.report-wf-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid var(--border);
  font-size: 0.7rem;
  font-weight: 800;
}

.report-wf-step.active .report-wf-step-num {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.report-wf-step.completed .report-wf-step-num {
  background: #059669;
  color: #ffffff;
  border-color: #059669;
}

/* ═════════ Official Payment Order (PO) Modal & Voucher ═════════ */
#paymentOrderModal .po-modal-card {
  max-width: 900px;
  width: 96%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.15);
  overflow: hidden;
}

#paymentOrderModal .modal-header {
  flex-shrink: 0;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
}

#paymentOrderModal .po-modal-body {
  flex: 1 1 auto;
  min-height: 0; /* CRITICAL: Enables proper flexbox scrolling without clipping */
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 24px 28px 24px;
  background: #f8fafc;
  scrollbar-width: thin;
}

#paymentOrderModal .po-modal-body::-webkit-scrollbar {
  width: 8px;
}
#paymentOrderModal .po-modal-body::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}
#paymentOrderModal .po-modal-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
#paymentOrderModal .po-modal-body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

#paymentOrderModal .modal-footer {
  flex-shrink: 0;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  background: #f8fafc;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.po-voucher {
  background: #ffffff;
  color: #0f172a;
  border-radius: 12px;
  border: 1.5px solid #cbd5e1;
  padding: 22px 26px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.25);
  font-family: var(--font-sans);
  position: relative;
  overflow: visible;
  margin-bottom: 6px;
}

.po-voucher-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-25deg);
  font-size: 4.2rem;
  font-weight: 900;
  color: rgba(16, 185, 129, 0.045);
  letter-spacing: 0.15em;
  user-select: none;
  pointer-events: none;
  white-space: nowrap;
}

.po-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1.5px solid #e2e8f0;
  margin-bottom: 14px;
  gap: 16px;
}

.po-logo-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.po-logo-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #10b981;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.po-authority-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}

.po-authority-sub {
  margin: 2px 0 0 0;
  font-size: 0.74rem;
  color: #64748b;
  font-weight: 600;
}

.po-meta-card {
  text-align: right;
  flex-shrink: 0;
}

.po-number-tag {
  font-family: var(--font-mono);
  font-size: 0.96rem;
  font-weight: 800;
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 4px;
}

.po-date-tag {
  font-size: 0.75rem;
  color: #64748b;
  margin: 0;
}

.po-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

@media (max-width: 768px) {
  .po-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 520px) {
  .po-grid {
    grid-template-columns: 1fr;
  }
}

.po-grid-cell {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
}

.po-grid-lbl {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.po-grid-val {
  font-size: 0.84rem;
  font-weight: 700;
  color: #0f172a;
  word-break: break-word;
}

.po-grid-val.mono {
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.po-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.po-table th {
  background: #f1f5f9;
  color: #475569;
  padding: 8px 12px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  text-align: left;
}

.po-table td {
  padding: 9px 12px;
  font-size: 0.82rem;
  border-top: 1px solid #e2e8f0;
  color: #1e293b;
}

.po-table tr.total-row {
  background: #ecfdf5;
  font-weight: 800;
}

.po-table tr.total-row td {
  border-top: 2px solid #10b981;
  color: #065f46;
  font-size: 0.98rem;
  padding: 11px 12px;
}

.po-sign-strip {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-top: 14px;
  border-top: 2px dashed #cbd5e1;
  margin-top: 12px;
}

.po-sign-box {
  text-align: center;
  min-width: 150px;
}

.po-sign-line {
  height: 1px;
  background: #94a3b8;
  margin-bottom: 6px;
}

.po-sign-role {
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
}

.po-sign-name {
  font-size: 0.8rem;
  color: #0f172a;
  font-weight: 600;
}

/* ═════════ Interactive Workflow Pipeline Guide ═════════ */
.workflow-guide-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-top: 3.5px solid #0284c7;
  border-radius: 16px;
  padding: 22px 26px;
  margin-bottom: 22px;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.06);
  transition: border-color 0.3s ease;
}

.wf-guide-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.wf-guide-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0284c7;
  box-shadow: 0 0 6px rgba(2, 132, 199, 0.6);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.wf-guide-title-box h2 {
  margin: 0 0 4px 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.wf-guide-sub {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  max-width: 680px;
}

.wf-explainer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  background: #ffffff;
  color: var(--text-primary);
  border: 1.5px solid #cbd5e1;
}

.wf-explainer-toggle:hover {
  background: #f1f5f9;
  border-color: #0284c7;
  color: #0284c7;
}

/* Dynamic Role Guidance Banner */
.portal-role-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 12px;
  margin-bottom: 18px;
  transition: all 0.3s;
}

.portal-role-banner.hospital-mode {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.portal-role-banner.insurance-mode {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.banner-icon-col {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.portal-role-banner.hospital-mode .banner-icon-col {
  background: rgba(2, 132, 199, 0.12);
  color: #0284c7;
  border: 1px solid rgba(2, 132, 199, 0.3);
}

.portal-role-banner.insurance-mode .banner-icon-col {
  background: rgba(5, 150, 105, 0.12);
  color: #059669;
  border: 1px solid rgba(5, 150, 105, 0.3);
}

.banner-text-col strong {
  display: block;
  font-size: 0.88rem;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.banner-text-col p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* 4-Stage Exchange Track */
.wf-pipeline-track {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  position: relative;
}

@media (max-width: 900px) {
  .wf-pipeline-track {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 520px) {
  .wf-pipeline-track {
    grid-template-columns: 1fr;
  }
}

.wf-pipeline-stage {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  position: relative;
}

.wf-pipeline-stage:hover {
  transform: translateY(-2px);
  border-color: #0284c7;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.12);
  background: #ffffff;
}

.wf-pipeline-stage.active-filter {
  border-color: #0284c7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.25);
  background: #ffffff;
}

.wf-stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wf-stage-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 800;
  color: #64748b;
}

.wf-stage-role {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 12px;
}

.wf-stage-role.hospital-pill {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.wf-stage-role.insurance-pill {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.wf-stage-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 2px;
}

.wf-stage-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.4;
  flex: 1;
}

.wf-stage-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.wf-count-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: #e2e8f0;
  color: var(--text-secondary);
}

.wf-stage-arrow {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: bold;
}

/* Process Explainer Drawer */
.wf-explainer-drawer {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  animation: fadeIn 0.3s ease;
}

.explainer-headline h4 {
  margin: 0 0 2px 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.explainer-headline p {
  margin: 0 0 14px 0;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.explainer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 840px) {
  .explainer-grid {
    grid-template-columns: 1fr;
  }
}

.explainer-col {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}

.explainer-icon {
  font-size: 1.4rem;
  margin-bottom: 6px;
}

.explainer-col h5 {
  margin: 0 0 8px 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.explainer-col ul {
  margin: 0;
  padding-left: 18px;
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.explainer-col li {
  margin-bottom: 6px;
}

/* ═════════ Real-Time Patient Filter & Search Toolbar ═════════ */
.patient-search-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 240px;
  min-width: 220px;
}

.search-input-wrap svg {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input-wrap input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.82rem;
  transition: all 0.2s;
}

.search-input-wrap input:focus {
  outline: none;
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.clear-search-btn {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
}

.clear-search-btn:hover {
  color: var(--text-primary);
}

.filter-chips-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-chip {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-chip:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: var(--text-primary);
}

.filter-chip.active {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}

.sort-selector-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.sort-selector-wrap select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 5px 8px;
  font-size: 0.78rem;
  cursor: pointer;
}

/* ═════════ 4-Step Patient Card Progress Pipeline ═════════ */
.patient-card-pipeline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0 12px 0;
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid var(--border);
  position: relative;
}

.pc-step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  position: relative;
  z-index: 1;
  flex: 1;
  text-align: center;
}

.pc-step-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 800;
  background: #e2e8f0;
  color: #64748b;
  border: 1px solid #cbd5e1;
  transition: all 0.3s;
}

.pc-step-item.completed .pc-step-dot {
  background: #059669;
  color: #ffffff;
  border-color: #059669;
}

.pc-step-item.active .pc-step-dot {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.4);
  animation: pulseDot 2s infinite;
}

.pc-step-name {
  font-size: 0.64rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.pc-step-item.active .pc-step-name {
  color: #0284c7;
  font-weight: 700;
}

.pc-step-item.completed .pc-step-name {
  color: #059669;
  font-weight: 600;
}

.pc-pipeline-connector {
  position: absolute;
  top: 17px;
  left: 16px;
  right: 16px;
  height: 2px;
  background: #e2e8f0;
  z-index: 0;
}

/* ═════════ Sticky Report Quick Navigation Bar ═════════ */
.report-sticky-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0 12px 0;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}

.report-sticky-nav::-webkit-scrollbar {
  display: none;
}

.report-nav-pill {
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 5px 12px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.report-nav-pill:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.report-nav-pill.active {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
  font-weight: 700;
}

/* ── Section Focus Glow Animation (When navigating to Insurance Coverage) ── */
@keyframes sectionPulseGlow {
  0% {
    box-shadow: 0 0 0 rgba(16, 185, 129, 0);
    border-color: rgba(16, 185, 129, 0.35);
  }
  30% {
    box-shadow: 0 0 28px rgba(16, 185, 129, 0.45);
    border-color: #10b981;
  }
  100% {
    box-shadow: 0 0 0 rgba(16, 185, 129, 0);
    border-color: rgba(16, 185, 129, 0.35);
  }
}
.section-focus-glow {
  animation: sectionPulseGlow 2.4s ease-in-out;
}

/* ═══════════════════════════════════════════════════════════════
   High-Fidelity PDF & Print Stylesheet for Payment Order (PO)
   ═══════════════════════════════════════════════════════════════ */
@media print {
  /* ═══════════════════════════════════════════════════════════ */
  /* 1. PAYMENT ORDER (PO) PRINT STYLES                         */
  /* ═══════════════════════════════════════════════════════════ */
  body.printing-po {
    background: #ffffff !important;
    color: #0f172a !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.printing-po .page {
    display: block !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    box-shadow: none !important;
    border: none !important;
  }

  /* Hide all non-PO parts of the page */
  body.printing-po #loginView,
  body.printing-po #appMain,
  body.printing-po #policyUploadModal,
  body.printing-po #razorpayPaymentModal,
  body.printing-po #paymentProofModal,
  body.printing-po #appConfirmModal,
  body.printing-po #appToastContainer {
    display: none !important;
  }

  body.printing-po #paymentOrderModal {
    display: block !important;
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
    border: none !important;
    z-index: auto !important;
    overflow: visible !important;
  }

  body.printing-po #paymentOrderModal .modal-card {
    display: block !important;
    max-width: 100% !important;
    width: 100% !important;
    box-shadow: none !important;
    border: none !important;
    background: #ffffff !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    overflow: visible !important;
  }

  body.printing-po #paymentOrderModal .modal-header,
  body.printing-po #paymentOrderModal .modal-footer,
  body.printing-po #paymentOrderModal .modal-close-btn {
    display: none !important;
  }

  body.printing-po #paymentOrderModalBody {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  body.printing-po .po-voucher {
    border: 2px solid #0f172a !important;
    border-radius: 8px !important;
    padding: 24px 28px !important;
    background: #ffffff !important;
    color: #0f172a !important;
    width: 100% !important;
    box-sizing: border-box !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  body.printing-po .po-voucher-watermark {
    color: rgba(16, 185, 129, 0.08) !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.printing-po .po-header {
    border-bottom: 2px solid #cbd5e1 !important;
  }

  body.printing-po .po-logo-icon {
    background: #047857 !important;
    color: #ffffff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.printing-po .po-number-tag {
    background: #f0fdf4 !important;
    border: 1px solid #86efac !important;
    color: #047857 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.printing-po .po-grid-cell {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.printing-po .po-grid-lbl {
    color: #475569 !important;
  }

  body.printing-po .po-grid-val {
    color: #0f172a !important;
  }

  body.printing-po .po-table {
    border: 1px solid #cbd5e1 !important;
  }

  body.printing-po .po-table th {
    background: #f1f5f9 !important;
    color: #1e293b !important;
    border-bottom: 2px solid #cbd5e1 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.printing-po .po-table td {
    border-top: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
  }

  body.printing-po .po-table tr.total-row {
    background: #ecfdf5 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.printing-po .po-table tr.total-row td {
    border-top: 2px solid #059669 !important;
    color: #047857 !important;
    font-size: 1.15rem !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.printing-po .po-sign-strip {
    border-top: 2px dashed #94a3b8 !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  /* ═══════════════════════════════════════════════════════════ */
  /* 2. PAYMENT PROOF & SETTLEMENT RECEIPT PRINT STYLES          */
  /* ═══════════════════════════════════════════════════════════ */
  body.printing-receipt {
    background: #ffffff !important;
    color: #0f172a !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.printing-receipt .page {
    display: block !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    box-shadow: none !important;
    border: none !important;
  }

  /* Hide all other sections, dashboards, reports, and other modals */
  body.printing-receipt #loginView,
  body.printing-receipt #appMain,
  body.printing-receipt #policyUploadModal,
  body.printing-receipt #paymentOrderModal,
  body.printing-receipt #razorpayPaymentModal,
  body.printing-receipt #appConfirmModal,
  body.printing-receipt #appToastContainer {
    display: none !important;
  }

  /* Display ONLY the payment proof modal as normal document flow */
  body.printing-receipt #paymentProofModal {
    display: block !important;
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
    border: none !important;
    z-index: auto !important;
    overflow: visible !important;
  }

  body.printing-receipt #paymentProofModal .modal-card {
    display: block !important;
    max-width: 100% !important;
    width: 100% !important;
    box-shadow: none !important;
    border: none !important;
    background: #ffffff !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    overflow: visible !important;
  }

  body.printing-receipt #paymentProofModal .modal-header,
  body.printing-receipt #paymentProofModal .modal-footer,
  body.printing-receipt #paymentProofModal .modal-close-btn {
    display: none !important;
  }

  body.printing-receipt #paymentProofModalBody {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  body.printing-receipt .proof-receipt-box {
    display: block !important;
    border: 2px solid #0f172a !important;
    border-radius: 8px !important;
    padding: 24px 28px !important;
    background: #ffffff !important;
    color: #0f172a !important;
    width: 100% !important;
    box-sizing: border-box !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  body.printing-receipt .proof-banner-amount {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 16px !important;
    margin-bottom: 16px !important;
    text-align: center !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.printing-receipt .proof-status-chip {
    background: #ecfdf5 !important;
    border: 1px solid #10b981 !important;
    color: #047857 !important;
    font-weight: 700 !important;
    font-size: 0.76rem !important;
    display: inline-flex !important;
    padding: 4px 12px !important;
    border-radius: 20px !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.printing-receipt .proof-amount-text {
    color: #047857 !important;
    font-size: 2.2rem !important;
    font-weight: 800 !important;
    font-family: var(--font-mono) !important;
    margin: 8px 0 2px 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.printing-receipt .proof-sub-text {
    color: #475569 !important;
    font-size: 0.8rem !important;
  }

  body.printing-receipt .proof-details-grid {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0 !important;
    margin-bottom: 16px !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.printing-receipt .proof-grid-item {
    border-right: 1px solid #e2e8f0 !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 10px 14px !important;
  }

  body.printing-receipt .proof-grid-label {
    color: #475569 !important;
    font-size: 0.72rem !important;
    text-transform: uppercase !important;
    font-weight: 600 !important;
    display: block !important;
  }

  body.printing-receipt .proof-grid-val {
    color: #0f172a !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    font-family: var(--font-mono) !important;
  }

  body.printing-receipt .proof-grid-val.verified-text {
    color: #047857 !important;
  }

  body.printing-receipt .transfer-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
    margin-bottom: 16px !important;
  }

  body.printing-receipt .transfer-account-card {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 12px 16px !important;
    color: #0f172a !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.printing-receipt .transfer-card-header {
    border-bottom: 1px solid #e2e8f0 !important;
    padding-bottom: 6px !important;
    margin-bottom: 8px !important;
    display: flex !important;
    justify-content: space-between !important;
    color: #0f172a !important;
    font-weight: 700 !important;
  }

  body.printing-receipt .transfer-card-row {
    display: flex !important;
    justify-content: space-between !important;
    font-size: 0.8rem !important;
    margin-bottom: 4px !important;
  }

  body.printing-receipt .transfer-card-label {
    color: #475569 !important;
  }

  body.printing-receipt .transfer-card-val {
    color: #0f172a !important;
    font-weight: 600 !important;
    font-family: var(--font-mono) !important;
  }

  body.printing-receipt .proof-stamp-box {
    border-top: 1px dashed #94a3b8 !important;
    padding-top: 14px !important;
    margin-top: 14px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    color: #475569 !important;
    font-size: 0.76rem !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  body.printing-receipt .proof-stamp-badge {
    background: #ecfdf5 !important;
    border: 1px solid #059669 !important;
    color: #047857 !important;
    font-weight: 700 !important;
    padding: 4px 10px !important;
    border-radius: 6px !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}


/* ── Matched Policy Benefits & Coverage Review ── */
.matched-benefit-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid #10b981;
  border-radius: var(--radius-xs);
  padding: 10px 14px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.matched-benefit-card:hover {
  transform: translateY(-1px);
  border-color: rgba(16, 185, 129, 0.45);
}
.matched-benefit-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #34d399;
}
.matched-benefit-category {
  font-size: 0.74rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ── In-Project Toast Notifications (Top Center) ── */
.app-toast-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 90%;
  max-width: 520px;
  pointer-events: none;
}
.app-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  font-size: 0.88rem;
  color: var(--text-primary);
  animation: toastSlideDown 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: transform 0.25s ease, opacity 0.25s ease;
  width: 100%;
  box-sizing: border-box;
}
.app-toast.toast-leaving {
  opacity: 0;
  transform: translateY(-20px) scale(0.96);
}
@keyframes toastSlideDown {
  from {
    opacity: 0;
    transform: translateY(-24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.app-toast.toast-success {
  border-left: 4px solid #10b981;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, var(--bg-card) 100%);
}
.app-toast.toast-error {
  border-left: 4px solid #ef4444;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, var(--bg-card) 100%);
}
.app-toast.toast-warning {
  border-left: 4px solid #f59e0b;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, var(--bg-card) 100%);
}
.app-toast.toast-info {
  border-left: 4px solid #3b82f6;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, var(--bg-card) 100%);
}
.app-toast .toast-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
}
.app-toast .toast-content {
  flex: 1;
}
.app-toast .toast-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
}
.app-toast .toast-close:hover {
  color: var(--text-primary);
}

/* ── Custom In-Project Confirmation Dialog Styling ── */
#appConfirmModal .modal-card {
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.65), 0 0 1px 1px rgba(255, 255, 255, 0.1);
  animation: modalScaleIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes modalScaleIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.app-confirm-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.85rem;
}
.app-confirm-detail-row:last-child {
  border-bottom: none;
}
.app-confirm-detail-label {
  color: var(--text-secondary);
  font-weight: 500;
}
.app-confirm-detail-val {
  color: var(--text-primary);
  font-weight: 600;
  text-align: right;
}
.app-confirm-detail-val.highlight-amt {
  color: #10b981;
  font-weight: 700;
}
.app-confirm-detail-val.highlight-bill {
  color: #60a5fa;
  font-weight: 700;
}
.confirm-btn-danger {
  background: #dc2626 !important;
  border-color: #ef4444 !important;
  color: #ffffff !important;
}
.confirm-btn-danger:hover {
  background: #b91c1c !important;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.45) !important;
}
.confirm-btn-success {
  background: #10b981 !important;
  border-color: #059669 !important;
  color: #ffffff !important;
}
.confirm-btn-success:hover {
  background: #059669 !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.45) !important;
}

/* ═══════════════════════════════════════════════════════════ */
/* Razorpay Gateway & Transaction Proof Styles                */
/* ═══════════════════════════════════════════════════════════ */

.razorpay-modal-card {
  max-width: 780px;
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.15);
}

.rzp-pay-btn {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
  border-color: #0284c7 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.25) !important;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px !important;
}
.rzp-pay-btn:hover {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%) !important;
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.35) !important;
}

.rzp-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 20px;
  color: #0284c7;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.transfer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 18px 0;
}
@media (max-width: 680px) {
  .transfer-grid { grid-template-columns: 1fr; }
}

.transfer-account-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  position: relative;
  transition: border-color 0.2s;
}
.transfer-account-card.payer {
  border-left: 4px solid #0284c7;
}
.transfer-account-card.payee {
  border-left: 4px solid #059669;
}

.transfer-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.transfer-card-type {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.transfer-account-card.payer .transfer-card-type { color: #0284c7; }
.transfer-account-card.payee .transfer-card-type { color: #059669; }

.transfer-card-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  margin-bottom: 6px;
}
.transfer-card-label {
  color: var(--text-secondary);
}
.transfer-card-val {
  color: var(--text-primary);
  font-weight: 600;
  font-family: var(--font-mono);
}

.proof-modal-card {
  max-width: 820px;
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.15);
}

.proof-receipt-box {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 24px 28px;
  position: relative;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.proof-banner-amount {
  text-align: center;
  padding: 20px;
  background: linear-gradient(18deg, #ecfdf5 0%, #f0fdf4 100%);
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  margin-bottom: 20px;
}
.proof-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 20px;
  color: #059669;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}
.proof-amount-text {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 0;
  font-family: var(--font-mono);
}
.proof-sub-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.proof-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 20px;
}
@media (max-width: 600px) {
  .proof-details-grid { grid-template-columns: 1fr; }
}

.proof-grid-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.proof-grid-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  font-weight: 600;
}
.proof-grid-val {
  font-size: 0.86rem;
  color: var(--text-primary);
  font-weight: 600;
  font-family: var(--font-mono);
}
.proof-grid-val.verified-text {
  color: #059669;
}

.proof-stamp-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px dashed #cbd5e1;
  margin-top: 16px;
  font-size: 0.76rem;
  color: var(--text-muted);
}
.proof-stamp-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid #a7f3d0;
  border-radius: 6px;
  background: #ecfdf5;
  color: #047857;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════ */
/* UPI Apps Style Processing & Success Animations             */
/* ═══════════════════════════════════════════════════════════ */

.upi-processing-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  animation: upiFadeIn 0.3s ease-out;
}

.upi-spinner-box {
  position: relative;
  width: 76px;
  height: 76px;
  margin-bottom: 22px;
}

.upi-spinner-ring {
  width: 100%;
  height: 100%;
  border: 4px solid rgba(2, 132, 199, 0.2);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: upiSpin 1s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
}

.upi-spinner-inner {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 48px;
  height: 48px;
  border: 3.5px solid rgba(16, 185, 129, 0.2);
  border-bottom-color: #10b981;
  border-radius: 50%;
  animation: upiSpin 0.75s linear infinite reverse;
}

@keyframes upiSpin {
  to { transform: rotate(360deg); }
}

.upi-processing-amount {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-mono);
  margin-bottom: 6px;
}

.upi-processing-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0284c7;
  margin-bottom: 8px;
}

.upi-processing-sub {
  font-size: 0.82rem;
  color: var(--text-secondary);
  max-width: 380px;
  line-height: 1.5;
  margin-bottom: 18px;
}

.upi-steps-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 20px;
  font-size: 0.78rem;
  color: #1d4ed8;
  font-weight: 600;
}

/* Success View */
.upi-success-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 26px 16px;
  animation: upiFadeIn 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes upiFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.upi-success-icon-box {
  width: 86px;
  height: 86px;
  position: relative;
  margin-bottom: 16px;
}

.upi-checkmark {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  display: block;
  stroke-width: 3.5;
  stroke: #059669;
  stroke-miterlimit: 10;
  box-shadow: 0 0 24px rgba(5, 150, 105, 0.25);
}

.upi-checkmark-circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 3.5;
  stroke-miterlimit: 10;
  stroke: #059669;
  fill: #f0fdf4;
  animation: upiCircleStroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.upi-checkmark-check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  stroke-width: 4.5;
  stroke: #059669;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: upiCheckStroke 0.45s cubic-bezier(0.65, 0, 0.45, 1) 0.45s forwards;
}

@keyframes upiCircleStroke {
  100% { stroke-dashoffset: 0; }
}

@keyframes upiCheckStroke {
  100% { stroke-dashoffset: 0; }
}

.upi-success-amount {
  font-size: 2.3rem;
  font-weight: 800;
  color: #059669;
  font-family: var(--font-mono);
  margin-bottom: 4px;
}

.upi-success-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #047857;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 4px;
}

.upi-success-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.upi-receipt-summary-box {
  width: 100%;
  max-width: 520px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  text-align: left;
  margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.upi-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}
.upi-summary-row:last-child {
  border-bottom: none;
}
.upi-summary-lbl {
  color: var(--text-muted);
}
.upi-summary-val {
  color: var(--text-primary);
  font-weight: 600;
  font-family: var(--font-mono);
}

.upi-countdown-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 20px;
  font-size: 0.76rem;
  color: #15803d;
  font-weight: 600;
  margin-bottom: 14px;
}
