/* ==========================================================================
   front_md.css — CLEAN + CONSISTENT (FINAL)
   - UI always visible/normal
   - Report shell always rendered (NEVER display:none)
   - Export mode: body.px-exporting
     * hides UI but keeps report shell capturable
     * shows ONLY: #rptCover + #mod_europe_overview
   - Dev preview: body.px-dev (optional) shows shell on-screen
   ========================================================================== */

:root{
  --px-purple:#7B38C2;
  --px-ink:#0f1220;
  --px-ink-2:#171a2b;
  --px-border:#e9e9ef;
  --px-muted:#6b7280;
  --px-bg:#fafbfe;

  --radius:18px;
  --shadow:0 8px 28px rgba(15,18,32,.08);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  background:var(--px-bg);
  color:#212121;
  font-family:Poppins,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,"Helvetica Neue",Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

/* =========================
   UI WRAPPER + HEADER
   ========================= */
.wrap{
  max-width:1400px;
  margin:18px auto 48px;
  padding:0 18px;
}

header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-bottom:8px;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:260px;
}
.brand img{ height:52px; width:auto; display:block; }

.actions{ display:flex; gap:8px; align-items:center; }

.badge{
  background: rgba(123,56,194,.14);
  color:#2b2f42;
  border:1px solid rgba(123,56,194,.25);
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  user-select:none;
}

/* Trial-mode chip — shown only to logged-out users.
   Amber/warm tint so it reads as a status flag, not a neutral badge.
   Lives in the .actions cluster, just before the hamburger. */
.trial-chip{
  display:inline-flex;
  align-items:center;
  gap:5px;
  background: #fff7e6;
  color: #8a5a00;
  border: 1px solid #f0c36a;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  user-select: none;
  cursor: default;
  line-height: 1;
}
.trial-chip::before{
  content: "";
  display:inline-block;
  width:6px;
  height:6px;
  border-radius:50%;
  background:#d97706;
  flex: 0 0 auto;
}
.trial-chip[hidden]{ display:none; }

.topline{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin:6px 0 8px;
}
.title{ font-weight:800; font-size:18px; color:#2b2f42; }
.subtitle{ color:#636a7a; font-weight:500; font-size:13px; }

.divider{
  height:3px;
  border-radius:3px;
  background: linear-gradient(90deg,var(--px-purple),#b08be4 70%,#d6c7f2);
  opacity:.85;
}

.stats{
  margin:14px 0;
  background: var(--px-ink);
  color:#fff;
  border-radius:14px;
  padding:10px 14px;
  box-shadow:var(--shadow);
  display:flex;
  gap:14px;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
}
.stat{ display:flex; align-items:center; gap:10px; min-width:220px; }
.stat b{ font-size:18px; }

.muted{ color:var(--px-muted); font-size:12.5px; }

.stats .badge {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}

/* =========================
   3-COLUMN UI GRID
   ========================= */
.grid{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap:18px;
  align-items:stretch;
  margin-top:10px;
}

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

.panel{
  background:#fff;
  border:1px solid var(--px-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:14px 14px 12px;

  height: calc(100vh - 240px);
  min-height: 520px;

  display:flex;
  flex-direction:column;

  overflow:hidden;
  min-height:0;
}

/* Right panel sits in the grid as a normal column */
.right-panel{ min-height:0; }

/* Step header */
.step{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:10px;
  flex: 0 0 auto;
}
.num{
  width:28px;height:28px;
  border-radius:8px;
  background:var(--px-purple);
  color:#fff;
  display:grid;
  place-items:center;
  font-weight:800;
  font-size:13px;
}
.panel h3{
  margin:0;
  font-size:14.5px;
  color:var(--px-ink-2);
}

/* =========================
   LEFT: SEARCH
   ========================= */
.search{ position:relative; margin-bottom:8px; }
.search input{
  width:100%;
  height:44px;
  border:1.5px solid var(--px-border);
  border-radius:12px;
  padding:0 44px 0 14px;
  font-size:15px;
  outline:none;
  background:#fff;
}
.search input:focus{
  border-color:var(--px-purple);
  box-shadow:0 0 0 4px rgba(123,56,194,.12);
}
.icon-btn{
  position:absolute;
  right:10px;
  top:50%;
  transform:translateY(-50%);
  border:none;
  background:transparent;
  cursor:pointer;
  font-size:16px;
  opacity:.85;
}

.results{
  border:1px solid var(--px-border);
  border-radius:12px;
  overflow:auto;
  flex:1 1 auto;
  padding:6px;
  background:#fff;
}

.result-item{
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:9px 10px;
  border-radius:12px;
  border:1px solid transparent;
  cursor:pointer;
}
.result-item:hover{
  border-color: rgba(123,56,194,.25);
  background: rgba(123,56,194,.05);
}
.result-code{
  font-weight:900;
  color:var(--px-purple);
  font-size:12px;
  min-width:70px;
}
.result-label{
  font-weight:800;
  font-size:13px;
  color:#2b2f42;
  line-height:1.15;
}
.result-meta{
  font-size:12px;
  color:#6b7280;
  margin-top:3px;
  line-height:1.2;
}

/* --- Subcode expansion panel (4-digit drill-down) --- */
.result-item.expanded{
  border-color:rgba(123,56,194,.3);
  background:rgba(123,56,194,.04);
  flex-wrap:wrap;
}
.subcode-panel{
  width:100%;
  margin-top:6px;
  border-top:1px solid var(--px-border);
  padding-top:6px;
}
.subcode-loading{
  font-size:12px;
  color:var(--px-muted);
  padding:8px 4px;
}
.subcode-select-all{
  display:flex;
  align-items:center;
  gap:6px;
  padding:7px 8px;
  margin-bottom:2px;
  border-radius:8px;
  font-size:12px;
  font-weight:600;
  color:var(--px-purple);
  cursor:pointer;
  transition:background .15s;
}
.subcode-select-all:hover{
  background:rgba(123,56,194,.1);
}
.subcode-select-all-icon{
  font-size:9px;
}
.subcode-item{
  display:grid;
  grid-template-columns:48px 1fr auto;
  align-items:center;
  gap:6px;
  padding:6px 8px;
  border-radius:8px;
  cursor:pointer;
  transition:background .15s;
}
.subcode-item:hover{
  background:rgba(123,56,194,.08);
}
.subcode-code{
  font-weight:700;
  font-size:11px;
  color:var(--px-purple);
}
.subcode-label{
  font-size:12px;
  font-weight:500;
  color:#2b2f42;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.subcode-cases{
  font-size:11px;
  font-weight:700;
  color:#fff;
  background:var(--px-purple);
  border-radius:10px;
  padding:2px 8px;
  min-width:40px;
  text-align:center;
}

/* Direct 4-digit search results */
.result-item-4 .result-code{
  background:rgba(123,56,194,.1);
  border-radius:6px;
  padding:2px 6px;
}

/* Multi-select: selected subcode row */
.subcode-item.subcode-selected{
  background:rgba(123,56,194,.12);
  border-left:3px solid var(--px-purple);
  padding-left:5px;
}

/* Instruction hint */
.subcode-hint{
  font-size:11px;
  color:var(--px-muted);
  padding:2px 8px 6px;
  font-style:italic;
}

/* Confirm bar (sticky at bottom of panel) */
.subcode-confirm-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:8px 8px 4px;
  margin-top:6px;
  border-top:1px solid var(--px-border);
}
.subcode-confirm-count{
  font-size:12px;
  font-weight:600;
  color:var(--px-purple);
}
.subcode-confirm-btn{
  background:var(--px-purple);
  color:#fff;
  border:none;
  border-radius:8px;
  padding:6px 16px;
  font-size:12px;
  font-weight:600;
  font-family:inherit;
  cursor:pointer;
  transition:background .15s;
}
.subcode-confirm-btn:hover{
  background:#6a2eab;
}

/* =========================
   MIDDLE: COUNTRY BARS + PLACEHOLDER
   ========================= */
.chart-wrap{
  border:1px solid var(--px-border);
  border-radius:14px;
  padding:10px;
  flex:1 1 auto;
  display:flex;
  flex-direction:column;
  min-height:0;
}

.chart-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
}
.chart-title{ font-weight:800; color:#2b2f42; font-size:13.5px; }
.chart-sub{ font-size:12px; color:#6b7280; margin-top:2px; }

.placeholder{
  flex:1 1 auto;
  min-height:0;
  display:flex;
  align-items:center;
  justify-content:center;
}

/* Placeholder card */
.ph-card{
  width:100%;
  border:1px dashed rgba(123,56,194,.35);
  border-radius:14px;
  padding:14px;
  background: linear-gradient(180deg, rgba(123,56,194,.06), #fff 70%);
}
.ph-title{
  font-weight:950;
  color:#2b2f42;
  font-size:13.5px;
  margin-bottom:10px;
}
.ph-kpis{ display:grid; gap:8px; }
.ph-kpi{
  border:1px solid rgba(15,18,32,.06);
  background:#fff;
  border-radius:12px;
  padding:10px;
}
.ph-kpi-label{ font-size:12px; color:#6b7280; font-weight:700; }
.ph-kpi-val{ font-size:12.5px; color:#2b2f42; font-weight:900; margin-top:2px; }
.ph-note{ margin-top:10px; color:#6b7280; font-size:12.5px; }

.chart-canvas{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  padding:6px;
  border-radius:12px;
  background:#fafbfe;
  border:1px solid #f0f1f7;
}

.chart-canvas[hidden],
.placeholder[hidden]{ display:none !important; }

/* Bar rows */
.bar-row{
  cursor:pointer;
  border-radius:12px;
  transition: background .15s ease, box-shadow .15s ease, transform .06s ease;
  outline:none;
}
.bar-row:hover{
  background: rgba(123,56,194,.06);
  box-shadow: 0 6px 16px rgba(15,18,32,.06);
}
.bar-row:active{ transform: translateY(1px); }
.bar-row.selected{
  background: rgba(123,56,194,.10);
  box-shadow: 0 10px 22px rgba(123,56,194,.12);
}
.bar-label{
  font-size:12.5px;
  font-weight:800;
  color:#2b2f42;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.bar-track{
  height:11px;
  border-radius:999px;
  background:#e9e9ef;
  overflow:hidden;
}
.bar-fill{
  height:100%;
  background: var(--px-purple);
  border-radius:999px;
}
.bar-value{
  font-size:12px;
  color:#2b2f42;
  font-weight:800;
  text-align:right;
}

.selection-line{
  margin-top:10px;
  font-size:12.5px;
  color:#6b7280;
}

/* =========================
   RIGHT: QUICK PICKS + MODULES + DELIVERABLES
   ========================= */

.quick-picks{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
  margin-bottom:12px;
}
@media (max-width:900px){
  .quick-picks{ grid-template-columns: 1fr; }
}

.qp-btn{
  position:relative;
  padding:8px 44px 8px 10px;
  border-radius:14px;
  border:1px solid var(--px-border);
  background:#fff;
  cursor:pointer;
  font-weight:900;
  color:#2b2f42;
}
.qp-btn:hover{
  border-color: rgba(123,56,194,.45);
  background: rgba(123,56,194,.09);
  box-shadow: 0 8px 18px rgba(15,18,32,.06);
}
.qp-btn.active{
  background: linear-gradient(180deg, rgba(123,56,194,.18), rgba(123,56,194,.06) 70%);
  border-color: rgba(123,56,194,.65);
  box-shadow: 0 10px 22px rgba(123,56,194,.14);
}
.qp-btn.active::after{
  content:"✓";
  position:absolute;
  right:14px;
  top:50%;
  transform:translateY(-50%);
  width:22px;height:22px;
  border-radius:999px;
  display:grid;
  place-items:center;
  background:var(--px-purple);
  color:#fff;
  font-weight:950;
  font-size:12px;
}

.right-split-2{
  flex: 1 1 auto;
  min-height:0;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
  align-items:stretch;
}
@media (max-width:1200px){
  .right-split-2{ grid-template-columns: 1fr; }
}

.right-box{
  background: rgba(255,255,255,0.65);
  border: 1px solid var(--px-border);
  border-radius:14px;
  padding:12px;
  min-width:0;
  min-height:0;
  display:flex;
  flex-direction:column;
  transition: opacity 0.3s ease;
}

/* Disabled state for modules/deliverables panels */
.right-box.panel-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.subhead{
  margin:0 0 8px;
  font-size:11px;
  font-weight:950;
  letter-spacing:.2px;
  color:#636a7a;
  text-transform:uppercase;
}

.moduleList{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  padding-right:6px;
  display:grid;
  gap:10px;
}
.moduleList::-webkit-scrollbar{ width:10px; }
.moduleList::-webkit-scrollbar-thumb{
  background: rgba(15,18,32,0.12);
  border-radius:999px;
}

.mod-card{
  display:flex;
  gap:10px;
  align-items:flex-start;
  border:1px solid var(--px-border);
  border-radius:14px;
  padding:10px;
  background:#fff;
  cursor:pointer;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.mod-card:hover{
  border-color: rgba(123,56,194,.25);
  box-shadow: 0 8px 18px rgba(15,18,32,.05);
}
.mod-card input{
  margin-top:2px;
  width:16px;height:16px;
  accent-color: var(--px-purple);
}
.mod-card.mod-card-disabled {
  opacity: 0.4;
  pointer-events: none;
}
.mod-body{ min-width:0; }
.mod-title{
  font-size:13px;
  font-weight:950;
  color:#2b2f42;
  line-height:1.15;
}
.mod-meta{
  margin-top:4px;
  font-size:12.5px;
  font-weight:650;
  color:#3b4153;
  line-height:1.25;
}

.deliverables-box{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  border:1px solid var(--px-border);
  border-radius:12px;
  background:#fafbfe;
  padding:10px;
  display:grid;
  gap:8px;
}

.deliverables-summary{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:8px 4px;
  font-size:12px;
  color:#636a7a;
}

.del-row{
  display:grid;
  grid-template-columns: 10px 1fr;
  gap:8px;
  align-items:start;
  font-size:12.5px;
  font-weight:850;
  color:#2b2f42;
}
.dot{
  width:8px;height:8px;
  border-radius:999px;
  background: var(--px-purple);
  opacity:.9;
  margin-top:4px;
}

.del-meta{ font-size:12px; color:#3b4153; }
.tiny-links{ font-size:12px; color:#6b7280; }
.tiny-links a{ color: var(--px-purple); text-decoration:none; font-weight:950; }

.btn{
  height:44px;
  border:none;
  border-radius:12px;
  font-weight:950;
  width:100%;
  margin-top:12px;
  cursor:not-allowed;
  color:#9aa0aa;
  background:#eef0f6;
}
.btn.primary{ background: var(--px-purple); color:#fff; opacity:.55; }
.btn.primary.enabled{ opacity:1; cursor:pointer; }
.ready-note{ margin-top:6px; font-size:12px; color:#6b7280; }

.btn.secondary {
  background: #fff;
  color: #7B38C2;
  border: 2px solid #7B38C2;
  margin-top: 8px;
}
.btn.secondary:not(:disabled):hover {
  background: #f5f3ff;
}
.btn.secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Responsive */
@media (max-width:1200px){
  .grid{ grid-template-columns: 1fr 1fr; }
  .right-panel{ grid-column: 1 / -1; }
  .panel{ height:unset; min-height:560px; }
}
@media (max-width:900px){
  .grid{ grid-template-columns: 1fr; }
  .panel{ height:unset; min-height:520px; }
  .stat{ min-width:160px; }
}

/* ======================================================================
   PDF SHELL (ALWAYS RENDERED)
   - Never display:none
   - Off-screen + invisible by default
   - Export makes it visible/capturable
   ====================================================================== */
.report-shell{
  position: fixed;
  left: -100000px; /* off-screen */
  top: 0;
  width: 794px;    /* A4 @ 96dpi */
  background:#fff;

  opacity: 0;          /* invisible */
  pointer-events: none;
  z-index: -1;

  margin:0;
  padding:0;
}

/* Hide UI during export WITHOUT hiding .wrap (shell is inside .wrap) */
body.px-exporting .wrap > :not(.report-shell){
  display:none !important;
}

/* During export: bring shell on-screen + make it capturable */
body.px-exporting .report-shell{
  left: 0 !important;
  top: 0 !important;
  opacity: 1 !important;      /* MUST be >0 for html2canvas to capture reliably */
  pointer-events: none !important;
  z-index: 9999 !important;
}

/* Dev preview: show the shell on-screen for debugging */
body.px-dev .report-shell{
  left: 18px;
  top: 18px;
  opacity: 1;
  pointer-events: auto;
  z-index: 9999;
  box-shadow: var(--shadow);
}

/* Report content visibility rules
   Default: hide everything inside shell
   Export/Dev: show ONLY cover + europe overview
*/
.report-shell #rptCover,
.report-shell #mod_europe_overview,
.report-shell .report-module{
  display:none;
}

body.px-exporting .report-shell #rptCover,
body.px-dev .report-shell #rptCover{
  display:block;
}

body.px-exporting .report-shell #mod_europe_overview,
body.px-dev .report-shell #mod_europe_overview{
  display:block;
}

/* Show Clinical Scope module during export */
body.px-exporting .report-shell #mod_clinical_scope,
body.px-dev .report-shell #mod_clinical_scope{
  display:block;
}
/* Show Treated Patient Reality module during export */
body.px-exporting .report-shell #mod_treated_reality,
body.px-dev .report-shell #mod_treated_reality{
  display:block;
}
/* Show Hospital Concentration & Tiering module during export */
body.px-exporting .report-shell #tiering_cover,
body.px-dev .report-shell #tiering_cover{
  display:block;
}

body.px-exporting .report-shell #mod_hospital_tiering,
body.px-dev .report-shell #mod_hospital_tiering{
  display:block;
}

/* Show Regional Inequality & Access module during export */
body.px-exporting .report-shell #regional_cover,
body.px-dev .report-shell #regional_cover{
  display:block;
}

body.px-exporting .report-shell #mod_regional_inequality,
body.px-dev .report-shell #mod_regional_inequality{
  display:block;
}

/* Show Influence & Readiness module during export */
body.px-exporting .report-shell #influence_cover,
body.px-dev .report-shell #influence_cover{
  display:block;
}

body.px-exporting .report-shell #mod_influence_readiness,
body.px-dev .report-shell #mod_influence_readiness{
  display:block;
}


/* ======================================================================
   PDF PAGE BASE (A4 @ 96dpi)
   ====================================================================== */
.pdf-page{
  width: 794px;
  height: 1123px;
  margin: 0;
  padding: 16px 16px 12px;

  background:#fff;
  border:1px solid var(--px-border);
  border-radius:14px;
  box-shadow: var(--shadow);

  position: relative;
  overflow: hidden;

  break-after: page;
  page-break-after: always;
}
.pdf-page:last-child{
  break-after: auto;
  page-break-after: auto;
}

.report_section_title{
  font-weight:950;
  font-size:18px;
  color:#2b2f42;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(123,56,194,.25);
  background: linear-gradient(90deg, rgba(123,56,194,.18), rgba(123,56,194,.06));
  margin-bottom:12px;
}

/* Helpers used by templates */
.two-col{ display:grid; grid-template-columns: 1fr 1fr; gap:12px; align-items:start; }
.card{ border:1px solid var(--px-border); border-radius:14px; background:#fff; padding:12px; min-width:0; }
.card-title{ font-weight:950; font-size:13.5px; color:#2b2f42; margin-bottom:8px; }
.narrative{ font-size:12.5px; font-weight:650; color:#3b4153; line-height:1.35; }

.table-wrap{ border:1px solid var(--px-border); border-radius:12px; overflow:hidden; background:#fff; }
.table{ width:100%; border-collapse:collapse; font-size:12.2px; }
.table thead th{ text-align:left; padding:9px 10px; background:#fafbfe; border-bottom:1px solid #f0f1f7; font-weight:950; color:#2b2f42; }
.table tbody td{ padding:8px 10px; border-bottom:1px solid #f0f1f7; color:#3b4153; font-weight:650; }
.table tbody tr:last-child td{ border-bottom:none; }

.footer{
  position:absolute;
  left:16px; right:16px; bottom:10px;
  display:flex;
  justify-content:space-between;
  font-size:11px;
  color:#6b7280;
}
.footer .left, .footer .right{ font-weight:750; }

/* Treemap container */
.ov-treemap{
  width:100%;
  height:420px;
  border:1px solid #f0f1f7;
  border-radius:12px;
  background:#fafbfe;
  overflow:hidden;
}
.ov-treemap .apexcharts-canvas,
.ov-treemap svg{
  width:100% !important;
  height:100% !important;
  display:block;
}

/* Fix badge color in stats bar */
.stats .badge {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}

/* ===================================================================
   ADD TO END OF front_md.css - PDF Export Styling Fixes
   =================================================================== */

/* Fix badge color in stats bar (for UI) */
.stats .badge {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}

/* PDF Export Mode - Clean styling for capture */
body.px-exporting .pdf-page {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
}

/* Ensure cards in PDF pages have clean borders */
body.px-exporting .pdf-page .card {
  border: 1px solid #e0e0e0 !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}

/* Clean up any nested borders in PDF */
body.px-exporting .pdf-page .table-wrap {
  border: 1px solid #e0e0e0 !important;
  border-radius: 6px !important;
}

/* Ensure back page logo is visible */
body.px-exporting .back-logo {
  display: block !important;
  max-width: 200px !important;
}

/* ===================================================================
   COVER PAGE - CENTERED WITH ADJUSTMENTS
   - Content moved down to center vertically
   - Disease name reduced to 36px
   - Map inset 20px from right edge
   =================================================================== */

/* Cover Page Container */
.cover-page {
  background: linear-gradient(135deg, #7B38C2 0%, #4a2270 50%, #2d1650 100%);
  padding: 0 !important;
  overflow: hidden;
  position: relative;
}

/* Cover Inner Container */
.cover-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 50px 100px 40px 60px;
}

/* Main Content Area - CENTERED VERTICALLY */
.cover-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 50px;
  flex: 1;
  padding-top: 180px;
}

/* Left Text Block */
.cover-text-block {
  flex: 1;
  max-width: 420px;
}

/* European Market Overview Badge */
.cover-kicker {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 30px;
  padding: 14px 32px;
  font-size: 18px;
  font-weight: 900;
  color: #ffffff !important;
  margin-bottom: 40px;
  letter-spacing: 0.3px;
  white-space: normal;
  width: 320px;
  text-align: center;
}

/* DISEASE NAME - REDUCED TO 30PX */
.cover-title,
#cover-title {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  font-size: 30px !important;
  font-weight: 900 !important;
  line-height: 1.25 !important;
  color: #ffffff !important;
  margin: 0 0 14px 0 !important;
  padding: 0 !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2) !important;
}

/* Subtitle */
.cover-subtitle,
#cover-subtitle {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  font-size: 18px !important;
  font-weight: 600 !important;
  color: rgba(255, 255, 255, 0.95) !important;
  margin: 0 0 18px 0 !important;
  line-height: 1.3 !important;
}

/* ICD-10 Chips Container */
.cover-chips {
  margin-bottom: 40px;
  display: flex;
  gap: 12px;
}

/* ICD-10 Chip */
.chip,
#cover-chip-code3 {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  background: rgba(255, 255, 255, 0.25) !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  border-radius: 20px !important;
  padding: 8px 20px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  letter-spacing: 0.5px !important;
}

/* Tagline */
.cover-tagline {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  font-weight: 500;
}

/* Map Block - INSET 20PX FROM RIGHT EDGE */
.cover-map-block {
  flex-shrink: 0;
  width: 320px;
  height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border-radius: 20px;
  padding: 0;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
  margin-top: 0;
  margin-right: 0;
  overflow: hidden;
}

/* Map Image */
.cover-country-map {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Hide map if it doesn't load */
.cover-country-map[src=""],
.cover-country-map:not([src]) {
  display: none;
}

/* Cover Footer */
.cover-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 600;
}

.cover-footer-left,
.cover-footer-right {
  font-weight: 700;
}

/* Export mode - ensure everything is white */
body.px-exporting .cover-page * {
  color: #ffffff !important;
}

body.px-exporting .cover-title,
body.px-exporting #cover-title {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

body.px-exporting .cover-subtitle,
body.px-exporting #cover-subtitle {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

body.px-exporting .chip,
body.px-exporting #cover-chip-code3 {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
}
/* ===================================================================
   PAGE 2 - KPI TILES STYLING
   Add to END of front_md.css
   =================================================================== */

/* KPI Grid - 2x2 layout */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

/* Individual KPI tile */
.kpi {
  background: #f8f9fc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px 18px;
  min-height: 95px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* KPI label (small uppercase text) */
.kpi-label {
  font-size: 10px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  line-height: 1.2;
}

/* KPI value (large bold text) */
.kpi-val {
  font-size: 18px;
  font-weight: 900;
  color: #2b2f42;
  line-height: 1.2;
}

/* Specific styling for the two bottom KPIs (numbers) */
.kpi:nth-child(3) .kpi-val,
.kpi:nth-child(4) .kpi-val {
  font-size: 22px;
}

/* Chart subtitle styling */
.chart-subtitle {
  font-size: 12px;
  margin-bottom: 12px;
  color: #6b7280;
  font-weight: 600;
}

/* Micro text for footnotes */
.micro {
  font-size: 11px;
  line-height: 1.5;
  font-weight: 600;
  margin-top: 12px;
}

.muted {
  color: #6b7280;
}

/* Europe intensity treemap header */
.ov-map-head {
  margin-bottom: 12px;
}

/* Ensure proper spacing in two-column layout */
.pdf-page .two-col {
  gap: 14px;
  align-items: stretch;
}

.pdf-page .two-col > .card {
  display: flex;
  flex-direction: column;
}

/* ===================================================================
   PAGE 3 - CALLOUT BOXES (Commercial Read / Medical Read)
   Add to END of front_md.css
   =================================================================== */

/* Callouts container - horizontal layout */
.callouts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 12px;
}

/* Individual callout box */
.callout {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px 18px;
  min-height: 100px;
}

/* Callout title */
.callout-title {
  font-size: 13px;
  font-weight: 900;
  color: #2b2f42;
  margin-bottom: 10px;
  text-transform: capitalize;
}

/* Callout body text */
.callout-body {
  font-size: 12px;
  line-height: 1.6;
  color: #3b4153;
  font-weight: 600;
}

/* Optional: Add subtle background to distinguish from cards */
.callout {
  background: #fafbfc;
}

/* ===================================================================
   PAGE 4 - ICD-10 SUBCODE TABLES
   Add to END of front_md.css
   Tables showing subcode breakdowns under the bar chart
   =================================================================== */

/* Table wrapper - clean border and background */
.ov-code-table-wrap {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
  margin-top: 10px;
  margin-bottom: 6px;
}

/* Table base styles */
.ov-code-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

/* Table header */
.ov-code-table thead th {
  text-align: left;
  padding: 10px 12px;
  background: #f8f9fc;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 900;
  color: #2b2f42;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Table body cells */
.ov-code-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f1f7;
  color: #3b4153;
  font-weight: 600;
  line-height: 1.4;
}

/* Remove border from last row */
.ov-code-table tbody tr:last-child td {
  border-bottom: none;
}

/* ICD code column (first column) - make it bold */
.ov-code-table .ov-code {
  font-weight: 900;
  color: #2b2f42;
  font-size: 12px;
  width: 90px;
}

/* Description column - allow wrapping */
.ov-code-table .ov-desc {
  line-height: 1.5;
  font-size: 11.5px;
}

/* Alternating row colors (optional - subtle) */
.ov-code-table tbody tr:nth-child(even) {
  background: #fafbfc;
}

/* Hover effect (optional) */
.ov-code-table tbody tr:hover {
  background: #f8f9fc;
}

/* ---- 2-column compact code table (Page 4 PDF overflow fix) ---- */
.ov-code-table-2col {
  font-size: 10.5px;
}
.ov-code-table-2col thead th {
  padding: 6px 8px;
  font-size: 9.5px;
}
.ov-code-table-2col tbody td {
  padding: 4px 8px;
  font-size: 10.5px;
}
.ov-code-table-2col .ov-code {
  width: 52px;
  font-size: 10.5px;
}
.ov-code-table-2col .ov-desc {
  font-size: 10px;
  line-height: 1.35;
}
/* Vertical divider between the two halves */
.ov-code-table-2col thead th:nth-child(3),
.ov-code-table-2col tbody td:nth-child(3) {
  border-left: 1px solid #e5e7eb;
}

/* Generic table styles (for backward compatibility) */
.table-wrap {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
  margin-top: 14px;
  margin-bottom: 14px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.table thead th {
  text-align: left;
  padding: 10px 12px;
  background: #f8f9fc;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 900;
  color: #2b2f42;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f1f7;
  color: #3b4153;
  font-weight: 600;
  line-height: 1.4;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody td:first-child {
  font-weight: 900;
  color: #2b2f42;
  font-size: 12px;
}

.table tbody tr:nth-child(even) {
  background: #fafbfc;
}

.table tbody tr:hover {
  background: #f8f9fc;
}

/* ===================================================================
   PAGE 4 - TREATMENT DONUT LEGEND STYLING
   Add to END of front_md.css
   Custom legend for the treatment patterns donut chart
   =================================================================== */

/* Legend container */
.eu4-treat-legend {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Individual legend row */
.eu4-treat-legend-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.4;
}

/* Colored square/swatch */
.eu4-treat-swatch {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  margin-top: 2px;
  display: block;
}

/* Legend text container */
.eu4-treat-legend-text {
  flex: 1;
  min-width: 0;
}

/* Treatment name and percentage */
.eu4-treat-legend-name {
  font-size: 11.5px;
  font-weight: 600;
  color: #3b4153;
  line-height: 1.4;
  word-wrap: break-word;
}

/* Percentage in legend */
.eu4-treat-legend-meta {
  font-weight: 900;
  color: #6b7280;
  font-size: 11.5px;
}

/* Comments section */
.eu4-treat-comments {
  margin-top: 10px;
}

.eu4-treat-comments .micro {
  font-size: 11px;
  line-height: 1.5;
  font-weight: 600;
}

.eu4-treat-comments b {
  font-weight: 900;
}

/* Sources section */
.eu4-treat-sources {
  margin-top: 10px;
}

.eu4-treat-sources .micro {
  font-size: 11px;
  line-height: 1.5;
}

.eu4-treat-sources b {
  font-weight: 900;
}

.eu4-treat-sources a {
  color: #2563eb;
  text-decoration: none;
}

.eu4-treat-sources a:hover {
  text-decoration: underline;
}

/* ===================================================================
   BACK PAGE - COMPLETE REDESIGN
   Add to END of front_md.css
   Matches the required layout with centered logo, bullet points, 
   card layout, and proper spacing
   =================================================================== */

/* Back page container */
/* =======================================
   BACK PAGE - SIMPLE CENTERED DESIGN
   ======================================= */

.back-page {
  background: #ffffff;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: "Poppins", Arial, sans-serif;
}

.back-inner {
  text-align: center;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.back-logo-block {
  margin-bottom: 2rem;
}

.back-logo {
  height: 48px;
  width: auto;
  display: inline-block;
}

.back-contact-block {
  font-size: 14px;
  line-height: 1.8;
  color: #333;
}

.back-company {
  font-weight: 600;
  font-size: 16px;
  margin: 0 0 1rem 0;
  color: #000;
}

.back-contact-line {
  margin: 0.3rem 0;
  font-weight: 400;
  color: #555;
}

.back-contact-line a {
  color: #7B38C2;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.back-contact-line a:hover {
  color: #5e2b93;
  text-decoration: underline;
}

/* Ensure proper spacing for copyright line */
.back-contact-line:last-child {
  margin-top: 0.5rem;
  color: #666;
  font-size: 13px;
}

/* Ensure no page breaks in PDF */
.back-page {
  page-break-inside: avoid;
}



/* =============================================================================
   CLINICAL SCOPE & CODING MODULE STYLES
   ============================================================================= */

/* Hierarchy visualization */
.hierarchy-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: #f8f9fc;
  border-radius: 8px;
}

.hierarchy-item {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 16px;
  transition: all 0.2s ease;
}

.hierarchy-item-selected {
  background: #3b1a6e;
  border: 2px solid #7B38C2;
}

.hierarchy-item-selected .hierarchy-level,
.hierarchy-item-selected .hierarchy-value,
.hierarchy-item-selected .hierarchy-range {
  color: #ffffff !important;
}

.hierarchy-level {
  font-size: 10px;
  font-weight: 700;
  color: #7B38C2;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.hierarchy-value {
  font-size: 13px;
  font-weight: 800;
  color: #2b2f42;
  line-height: 1.3;
}

.hierarchy-range {
  font-size: 11px;
  margin-top: 4px;
}

.hierarchy-arrow {
  text-align: center;
  font-size: 18px;
  color: #7B38C2;
  font-weight: 700;
}

/* Divider line */
.divider-line {
  height: 1px;
  background: #e5e7eb;
  margin: 16px 0;
}

/* KPI variations */
.kpi-wide {
  grid-column: span 2;
}

.kpi-val-large {
  font-size: 32px !important;
  color: #7B38C2 !important;
}

.kpi-val-small {
  font-size: 13px !important;
}

/* Data tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.data-table th,
.data-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.data-table th {
  background: #f8f9fc;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.5px;
}

.data-table td {
  color: #2b2f42;
  font-weight: 600;
}

.data-table tr:hover {
  background: #faf9fc;
}

.data-table .highlight-row {
  background: #f3f0f9 !important;
}

.data-table .highlight-row td {
  color: #7B38C2;
  font-weight: 700;
}

/* Table container with scroll */
.table-container {
  max-height: 280px;
  overflow-y: auto;
}

/* ---- Compact data-table for PDF pages with many rows ---- */
.data-table-compact th,
.data-table-compact td {
  padding: 4px 8px;
  font-size: 10px;
  line-height: 1.3;
}
.data-table-compact th {
  font-size: 9px;
}

/* Remove scroll constraints inside PDF pages so tables are never clipped */
.pdf-page .table-container,
.pdf-page .table-scroll {
  max-height: none;
  overflow-y: visible;
  overflow: visible;
}

.table-scroll {
  max-height: 320px;
}

/* Guidance list */
.guidance-list {
  margin: 0;
  padding: 0 0 0 20px;
  list-style: disc;
}

.guidance-list li {
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #4b5563;
  line-height: 1.5;
}

.guidance-list li strong {
  color: #2b2f42;
}

/* Guidance box */
.guidance-box {
  background: #f8f9fc;
  border-radius: 8px;
  padding: 16px;
}

/* Bullet list — used in KOL summary and tiering insights */
.bullet-list {
  margin: 0;
  padding: 0 0 0 20px;
  list-style: disc;
}
.bullet-list li {
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #4b5563;
  line-height: 1.45;
}
.bullet-list li strong {
  color: #2b2f42;
}

/* Tiering page 2: compact tables to fit regions + cities + insights on one page */
#tiering_p2 .hospital-detail-table td { padding: 5px 8px; }
#tiering_p2 .hospital-detail-table th { padding: 6px 8px; }
#tiering_p2 .city-concentration-table td { padding: 5px 8px; }
#tiering_p2 .city-concentration-table th { padding: 6px 8px; }

/* Regional pages 3 & 4: compact tables, tighter card padding to prevent overflow */
#regional_p2 .card { padding: 8px 10px; margin-bottom: 20px; }
#regional_p2 .tier-summary-table td { padding: 4px 8px; }
#regional_p2 .tier-summary-table th { padding: 5px 8px; }
#regional_p2 .bullet-list li { margin-bottom: 1px; line-height: 1.3; padding-bottom: 0; border: none; }
#regional_p2 .narrative { line-height: 1.3; }
#regional_p2 .two-col-equal { gap: 8px; }
#regional_p3 .card { padding: 8px 10px; margin-bottom: 20px; }
#regional_p3 .bullet-list li { margin-bottom: 1px; line-height: 1.3; padding-bottom: 0; border: none; }
#regional_p3 .narrative { line-height: 1.3; }
#regional_p3 .two-col-equal { gap: 8px; }

/* Module cover page variation - matching European Overview gradient */
.cover-page-module {
  background: linear-gradient(180deg, #7B38C2 0%, #4a2270 50%, #2d1650 100%);
}

/* Chart tall variant */
.chart-tall {
  min-height: 320px;
}


/* Chart medium variant */
.chart-medium {
  min-height: 170px;
}
/* Make tier blocks 3 columns on Treated Patient Reality Page 3 */
#treated_p3 .kpi-grid {
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

#treated_p3 .kpi {
  min-width: 0;
}
/* ========================================
   HOSPITAL CONCENTRATION & TIERING STYLES
   ======================================== */

/* Provider section layout */
.prov-section {
  padding: 0;
}

/* Stat cards grid */
.prov-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.prov-stat-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.prov-stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #6b7280;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.prov-stat-value {
  font-size: 28px;
  font-weight: 900;
  color: #6B46C1;
  line-height: 1;
}

.prov-stat-subtitle {
  font-size: 9px;
  font-weight: 500;
  color: #9ca3af;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Main layout with Pareto and tier summary */
.prov-main-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

/* Panel styling */
.prov-panel {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
}

.prov-panel-title {
  font-size: 14px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid #6B46C1;
  letter-spacing: normal;
}

.prov-panel-text {
  font-size: 12px;
  line-height: 1.5;
  color: #4b5563;
  margin: 8px 0 0 0;
}

/* Pareto chart container */
.prov-pareto-chart {
  min-height: 280px;
}

/* Tier summary table */
.tier-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.tier-summary-table th {
  background: #f9fafb;
  padding: 8px 10px;
  text-align: left;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  color: #6b7280;
  border-bottom: 2px solid #e5e7eb;
}

.tier-summary-table td {
  padding: 10px;
  border-bottom: 1px solid #f3f4f6;
}

.tier-summary-table tr:last-child td {
  border-bottom: none;
}

.tier-row.tier-1 {
  background: #f2e5ff;
}

.tier-row.tier-2 {
  background: #e5f2ff;
}

.tier-row.tier-3 {
  background: #e8fff1;
}

/* Detail page layout */
.prov-section-detail {
  padding: 0;
}

.prov-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.prov-top10-panel {
  grid-column: 1 / -1;
}

/* Hospital detail table */
.hospital-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.hospital-detail-table th {
  background: #f9fafb;
  padding: 8px;
  text-align: left;
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  color: #6b7280;
  border-bottom: 2px solid #e5e7eb;
}

.hospital-detail-table td {
  padding: 8px;
  border-bottom: 1px solid #f3f4f6;
}

.hospital-detail-table tr:hover {
  background: #f9fafb;
}

.hospital-detail-table .rank-col {
  width: 40px;
  text-align: center;
  font-weight: 700;
  color: #6B46C1;
}

.hospital-detail-table .hospital-name {
  font-weight: 600;
  color: #1f2937;
}

.hospital-detail-table .num-col {
  text-align: right;
  font-weight: 600;
}

.hospital-detail-table .pct-col {
  text-align: right;
  color: #6b7280;
}

/* Tier badges */
.tier-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.tier-badge-i {
  background: #8e44ad;
  color: #ffffff;
}

.tier-badge-ii {
  background: #2980b9;
  color: #ffffff;
}

.tier-badge-iii {
  background: #27ae60;
  color: #ffffff;
}

.tier-i {
  background: #f2e5ff !important;
}

.tier-ii {
  background: #e5f2ff !important;
}

.tier-iii {
  background: #e8fff1 !important;
}

/* City concentration table */
.city-concentration-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.city-concentration-table th {
  background: #f9fafb;
  padding: 8px;
  text-align: left;
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  color: #6b7280;
  border-bottom: 2px solid #e5e7eb;
}

.city-concentration-table td {
  padding: 8px;
  border-bottom: 1px solid #f3f4f6;
}

.city-concentration-table .city-name {
  font-weight: 600;
  color: #1f2937;
}

/* Export button */
.btn-primary {
  background: #6B46C1;
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: #5a3a9f;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(107, 70, 193, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Two column uneven layout */
.two-col-uneven {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}


/* ========================================
   PDF EXPORT FIX: Gradient Rendering
   ======================================== */

/* Fix for html2canvas gradient rendering issue */
body.px-exporting .cover-page-module {
  background: #6B46C1 !important;
  background-image: none !important;
}

/* Additional fix: target all cover pages during export */
body.px-exporting .cover-page {
  background: #6B46C1 !important;
  background-image: none !important;
}

/* Nuclear option: remove all gradients during export */
body.px-exporting * {
  background-image: none !important;
}

/* Alternative: Use simpler gradient that html2canvas can handle */
/* body.px-exporting .cover-page-module {
  background: linear-gradient(to bottom, #7B38C2, #4a2270) !important;
} */

/* Match Hospital Tiering cover map spacing to other module covers */
body.px-exporting #tiering_cover .cover-main {
  padding-right: 60px !important;
}
.hierarchy-cases {
  font-size: 11px;
  font-weight: 700;
  margin-top: 6px;
  color: #6b7280;
}

.hierarchy-item-selected .hierarchy-cases {
  color: #ffffff !important;
}

/* ==========================================================================
   Generation Progress Overlay
   ========================================================================== */

.gen-progress-overlay{
  position:fixed;
  inset:0;
  z-index:100000;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(15,18,32,.55);
  backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px);
  animation:genFadeIn .25s ease-out;
}
@keyframes genFadeIn{ from{opacity:0} to{opacity:1} }

.gen-progress-card{
  width:380px;
  background:#ffffff;
  border-radius:20px;
  padding:36px 32px 30px;
  text-align:center;
  box-shadow:0 24px 64px rgba(123,56,194,.18), 0 4px 16px rgba(0,0,0,.10);
  animation:genSlideUp .3s ease-out;
}
@keyframes genSlideUp{
  from{opacity:0;transform:translateY(18px)}
  to  {opacity:1;transform:translateY(0)}
}

/* Spinning icon */
.gen-progress-icon{
  margin-bottom:18px;
}
.gen-progress-spinner{
  transform-origin:50% 50%;
  animation:genSpin 1s linear infinite;
}
@keyframes genSpin{ to{transform:rotate(360deg)} }

/* Title */
.gen-progress-title{
  font-family:Poppins,sans-serif;
  font-size:17px;
  font-weight:700;
  color:var(--px-ink);
  margin-bottom:6px;
}

/* Current step label */
.gen-progress-step{
  font-family:Poppins,sans-serif;
  font-size:13px;
  color:var(--px-muted);
  margin-bottom:18px;
  min-height:20px;
  transition:opacity .15s;
}

/* Progress bar track */
.gen-progress-track{
  width:100%;
  height:8px;
  background:#eee;
  border-radius:6px;
  overflow:hidden;
}
.gen-progress-fill{
  height:100%;
  min-height:8px;
  display:block;
  background-color:#7B38C2 !important;
  border-radius:6px;
  transition:width .35s cubic-bezier(.4,0,.2,1);
  width:0%;
}

/* Percentage + meta */
.gen-progress-meta{
  display:flex;
  justify-content:space-between;
  margin-top:10px;
  font-family:Poppins,sans-serif;
  font-size:12px;
  color:var(--px-muted);
}
#genProgressPct{
  font-weight:600;
  color:var(--px-purple);
}
/* =========================
   DELIVERABLE CARDS (replaces the 6-checkbox module list)
   Two stacked cards, each with its own embedded Generate button.
   ========================= */
.deliverableList{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.deliv-card{
  background:#fff;
  border:1.5px solid var(--px-border);
  border-radius:14px;
  padding:14px 14px 12px;
  display:flex;
  flex-direction:column;
  gap:10px;
  transition:border-color .25s ease, box-shadow .25s ease;
}
.deliv-card:hover{
  border-color: rgba(123,56,194,.35);
  box-shadow: 0 4px 14px rgba(123,56,194,.06);
}
/* When the card's requirements are met, the whole card firms up subtly */
.deliv-card.is-ready{
  border-color: rgba(123,56,194,.45);
}

.deliv-head{
  display:flex;
  flex-direction:column;
  gap:4px;
}
.deliv-title{
  font-family:Poppins,sans-serif;
  font-size:15px;
  font-weight:700;
  color:#1a1a1f;
  letter-spacing:-0.01em;
  display:flex;
  align-items:center;
  gap:8px;
}
.deliv-meta{
  font-size:12.5px;
  line-height:1.45;
  color:var(--px-muted);
}

/* Checkmark next to card title — hidden by default, reveals when ready */
.deliv-check{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:20px;
  height:20px;
  border-radius:50%;
  background: rgba(123,56,194,.12);
  color: var(--px-purple);
  font-size:12px;
  font-weight:700;
  line-height:1;
  opacity:0;
  transform:scale(.6);
  transition: opacity .25s ease, transform .25s ease;
}
.deliv-card.is-ready .deliv-check{
  opacity:1;
  transform:scale(1);
  background: var(--px-purple);
  color:#fff;
}

.deliv-body{
  display:flex;
  flex-direction:column;
  gap:4px;
}

/* Compact summary — shown when vertical space is tight (default) */
.deliv-sections-summary{
  font-size:12.5px;
  line-height:1.4;
  color:#3a3a42;
  padding:2px 0;
}
/* Default (tight space): show summary, hide the list + "Includes" label */
.deliv-sections-label,
.deliv-sections{
  display:none;
}

/* When the viewport is tall enough for the outer .panel
   (height = 100vh - 240px) to accommodate the full list without
   clipping, swap summary for list. 820px is the threshold where
   the fully-expanded Country Report card fits within the panel. */
@media (min-height: 820px){
  .deliv-sections-summary{ display:none; }
  .deliv-sections-label{ display:block; }
  .deliv-sections{ display:block; }
}

.deliv-sections-label{
  font-size:11px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:0.04em;
  color:var(--px-muted);
  margin-top:0;
}
.deliv-sections{
  margin:0;
  padding:0 0 0 16px;
  font-size:12px;
  line-height:1.4;
  color:#3a3a42;
}
.deliv-sections li{
  margin:0;
  list-style:disc;
}
/* Excel line sits in the list but is distinguished visually */
.deliv-sections li.deliv-sections-excel{
  margin-top:3px;
  color: var(--px-purple);
  font-weight:600;
  list-style:none;
  position:relative;
}
.deliv-sections li.deliv-sections-excel::before{
  content:"+";
  position:absolute;
  left:-12px;
  font-weight:700;
}

/* =========================
   DELIVERABLE BUTTON — two visual states:
   1. Not ready (default)   — pale lilac background, dark text (reads as an instruction)
   2. Ready (.is-ready)     — solid purple background, white text, glow (reads as an action)
   Button label itself carries the instruction; no surrounding hint text needed.
   Must override the .btn.primary defaults (which are purple bg / white text / opacity .55).
   ========================= */
.deliv-btn{
  width:100%;
  margin-top:4px;
  height:48px;
  padding: 0 14px;
  font-size: 13.5px;
  line-height: 1.2;
  text-align:center;
  transition: background .25s ease, color .25s ease, box-shadow .25s ease,
              opacity .25s ease, transform .15s ease, border-color .25s ease;
}
/* INACTIVE — override .btn.primary to look like a soft hint, not a dimmed action button */
.deliv-btn:disabled,
.deliv-btn.is-empty:disabled{
  background: #f3eef9;                  /* very pale lilac */
  color: #1a1a1f !important;            /* black text — reads as instruction (overrides .btn.primary) */
  opacity: 1;                           /* kill the inherited .55 from .btn.primary */
  cursor: default;
  box-shadow: none;
  border: 1px dashed rgba(123,56,194,.28);
}
/* READY — full action button */
.deliv-btn.is-ready{
  background: var(--px-purple);
  color: #fff;
  opacity: 1;
  cursor: pointer;
  border: 1px solid var(--px-purple);
  box-shadow: 0 4px 14px rgba(123,56,194,.28);
}
.deliv-btn.is-ready:hover{
  box-shadow: 0 6px 18px rgba(123,56,194,.36);
  transform: translateY(-1px);
}
.deliv-btn.is-ready:active{
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(123,56,194,.28);
}

/* Safety net: force-hide any legacy readyNote text that may ship in stale HTML */
#readyNote{ display:none !important; }

/* =========================
   TRIAL GATE MODAL
   Shown when a non-logged-in user clicks Generate.
   ========================= */
.trial-gate-overlay{
  position:fixed;
  inset:0;
  background:rgba(15, 10, 30, 0.55);
  backdrop-filter:blur(3px);
  -webkit-backdrop-filter:blur(3px);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:10000;
  opacity:0;
  visibility:hidden;
  transition:opacity .25s, visibility 0s linear .25s;
}
.trial-gate-overlay.is-open{
  opacity:1;
  visibility:visible;
  transition:opacity .25s, visibility 0s linear 0s;
}

.trial-gate-modal{
  position:relative;
  background:#fff;
  border-radius:18px;
  padding:32px 32px 24px;
  max-width:460px;
  width:calc(100% - 32px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  transform:translateY(12px);
  transition:transform .25s;
  font-family:Poppins,sans-serif;
}
.trial-gate-overlay.is-open .trial-gate-modal{
  transform:translateY(0);
}

.trial-gate-close{
  position:absolute;
  top:10px;
  right:14px;
  width:32px;
  height:32px;
  border:none;
  background:transparent;
  font-size:24px;
  line-height:1;
  color:var(--px-muted);
  cursor:pointer;
  border-radius:50%;
  transition:background .15s, color .15s;
}
.trial-gate-close:hover{
  background:#f3f1f8;
  color:#1a1a1f;
}

.trial-gate-title{
  font-size:22px;
  font-weight:800;
  color:#1a1a1f;
  margin:0 0 10px;
  letter-spacing:-0.02em;
}
.trial-gate-sub{
  font-size:14px;
  line-height:1.55;
  color:#3a3a42;
  margin:0 0 20px;
}

.trial-gate-actions{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-bottom:14px;
}

.btn-trial-gate{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:44px;
  padding:0 20px;
  border-radius:10px;
  font-family:Poppins,sans-serif;
  font-size:14px;
  font-weight:600;
  text-decoration:none;
  cursor:pointer;
  transition:all .2s;
  border:1.5px solid transparent;
  letter-spacing:-0.01em;
}
.btn-trial-gate-primary{
  background:var(--px-purple);
  color:#fff;
  border-color:var(--px-purple);
}
.btn-trial-gate-primary:hover{
  background:#6a2eb0;
  border-color:#6a2eb0;
  box-shadow: 0 4px 18px rgba(123,56,194,0.3);
  transform:translateY(-1px);
}
.btn-trial-gate-secondary{
  background:#fff;
  color:#1a1a1f;
  border-color:var(--px-border);
}
.btn-trial-gate-secondary:hover{
  border-color: rgba(123,56,194,.4);
  background: rgba(123,56,194,.05);
  color:var(--px-purple);
}

.trial-gate-note{
  font-size:11.5px;
  color:var(--px-muted);
  text-align:center;
  margin:0;
  line-height:1.5;
}