/* ─────────────────────────────────────────────────────────────────────
 * CardioCalc Pro — styles for Pre-Visit Brief + Lab Gap section + A&P UI
 *
 * Scoped to .cc-* class names + the #cardioCalcPreVisitBrief container.
 * No bleed into existing PreventCVD inline styles. Print-friendly.
 *
 * Author: Dr. Fardows Salim, MD | M Health Fairview
 * ───────────────────────────────────────────────────────────────────── */

#cardioCalcPreVisitBrief {
  display: none; /* shown by renderer when launchMode === 'previsit' */
  margin: 0 0 14px 0;
  padding: 0;
  font-family: 'Source Sans 3', system-ui, -apple-system, sans-serif;
  color: #1F2937;
}

.cc-brief-card {
  background: #FFFBEB;
  border: 2px solid #F59E0B;
  border-radius: 8px;
  padding: 16px 20px;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.15);
}

.cc-brief-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid #FCD34D;
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.cc-brief-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #92400E;
  text-transform: uppercase;
}

.cc-brief-date {
  font-size: 11px;
  color: #78716C;
  margin-top: 2px;
}

.cc-brief-actions {
  display: flex;
  gap: 8px;
}

.cc-btn-print, .cc-btn-toggle {
  border: 1px solid #D97706;
  background: #FEF3C7;
  color: #92400E;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.4px;
  transition: background 0.12s;
}
.cc-btn-print:hover, .cc-btn-toggle:hover {
  background: #FCD34D;
}

.cc-section {
  margin: 14px 0;
  padding: 10px 12px;
  background: #FFFFFF;
  border: 1px solid #FDE68A;
  border-radius: 5px;
  font-size: 13px;
  line-height: 1.5;
}

.cc-section > div {
  margin: 3px 0;
}

.cc-sec-hdr {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #92400E;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.cc-row {
  display: block;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #FDE68A;
}

.cc-label {
  display: inline-block;
  min-width: 130px;
  font-weight: 600;
  color: #44403C;
}

.cc-meta {
  font-size: 11px;
  color: #78716C;
}

.cc-muted {
  color: #9CA3AF;
  font-style: italic;
}

.cc-warn {
  color: #B91C1C;
  font-weight: 600;
}
.cc-ok {
  color: #047857;
  font-weight: 600;
}

.cc-pill {
  display: inline-block;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 3px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  vertical-align: middle;
  margin-left: 4px;
}
.cc-pill-ok   { background: #D1FAE5; color: #065F46; border: 1px solid #6EE7B7; }
.cc-pill-warn { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; }

.cc-route {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 12px;
  color: #1E40AF;
}

.cc-agenda {
  background: #F3F4F6;
  border-left: 3px solid #92400E;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.6;
  font-style: italic;
}

/* ── Lab Gap items in brief and standalone Lab Gap section ── */
.cc-gap {
  margin: 4px 0;
  padding: 4px 0;
}
.cc-gap-name {
  font-weight: 600;
  margin-right: 4px;
}
.cc-prio {
  display: inline-block;
  padding: 1px 6px;
  font-size: 9.5px;
  font-weight: 700;
  border-radius: 3px;
  letter-spacing: 0.5px;
  vertical-align: middle;
  margin-right: 6px;
  font-family: 'IBM Plex Mono', monospace;
}
.cc-pri-priority { background: #DC2626; color: #FFFFFF; }
.cc-pri-routine  { background: #D97706; color: #FFFFFF; }
.cc-pri-optional { background: #6B7280; color: #FFFFFF; }

/* ── Lab Gap full section (Phase 5) ── */
.cc-labgap-section {
  margin: 16px 0;
  padding: 14px 16px;
  background: #FFFFFF;
  border: 1.5px solid #E5E7EB;
  border-radius: 6px;
}
.cc-labgap-section h3 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #1F2937;
  margin: 0 0 10px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid #E5E7EB;
  text-transform: uppercase;
}
.cc-labgap-card {
  background: #FAFAFA;
  border: 1px solid #E5E7EB;
  border-left: 4px solid #D97706;
  border-radius: 4px;
  padding: 10px 14px;
  margin: 8px 0;
  font-size: 12px;
  line-height: 1.5;
}
.cc-labgap-card.cc-pri-priority { border-left-color: #DC2626; }
.cc-labgap-card.cc-pri-optional { border-left-color: #6B7280; }
.cc-labgap-card.cc-marked-ordered {
  background: #F3F4F6;
  border-left-color: #9CA3AF;
  opacity: 0.55;
}
.cc-labgap-name {
  font-weight: 700;
  font-size: 13px;
  color: #1F2937;
}
.cc-labgap-status {
  font-weight: 600;
  margin: 4px 0 2px 0;
}
.cc-labgap-status.cc-never { color: #DC2626; }
.cc-labgap-status.cc-overdue { color: #B45309; }
.cc-labgap-reason {
  color: #44403C;
  margin: 4px 0;
}
.cc-labgap-guideline {
  color: #78716C;
  font-size: 11px;
  font-style: italic;
}
.cc-labgap-actions {
  margin-top: 6px;
  display: flex;
  gap: 6px;
}
.cc-labgap-actions button {
  border: 1px solid #D1D5DB;
  background: #FFFFFF;
  color: #1F2937;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 3px;
  cursor: pointer;
}
.cc-labgap-actions button:hover { background: #F3F4F6; }

/* ── A&P + MyChart panels (Phase 6) ── */
.cc-ap-section {
  margin: 16px 0;
  padding: 14px 16px;
  background: #F9FAFB;
  border: 1.5px solid #E5E7EB;
  border-radius: 6px;
}
.cc-ap-section h3 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #1F2937;
  margin: 0 0 10px 0;
  text-transform: uppercase;
}
.cc-ap-output {
  white-space: pre-wrap;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  line-height: 1.55;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 4px;
  padding: 12px 14px;
  margin: 8px 0;
  color: #1F2937;
  max-height: 600px;
  overflow-y: auto;
}
.cc-ap-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}
.cc-ap-buttons button {
  border: 1px solid #1E40AF;
  background: #1E40AF;
  color: #FFFFFF;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.4px;
  transition: background 0.12s;
}
.cc-ap-buttons button:hover { background: #1E3A8A; }
.cc-ap-buttons button.cc-secondary {
  background: #FFFFFF;
  color: #1E40AF;
}
.cc-ap-buttons button.cc-secondary:hover { background: #DBEAFE; }

/* ── Print rules — brief + A&P print cleanly, hide app chrome ── */
@media print {
  body * { visibility: hidden; }
  #cardioCalcPreVisitBrief, #cardioCalcPreVisitBrief * { visibility: visible; }
  .cc-ap-section, .cc-ap-section * { visibility: visible; }
  #cardioCalcPreVisitBrief {
    position: absolute; top: 0; left: 0; right: 0;
    margin: 0; padding: 12px;
  }
  .cc-brief-card { box-shadow: none; border-color: #000; }
  .cc-brief-actions { display: none; }
  .cc-section { page-break-inside: avoid; }
}
