/* ============================================================
   CLARITY DIAGNOSTIC DASHBOARD STYLES
   css/clarity-dashboard.css
   
   Standalone stylesheet — plugs into existing site.
   All classes prefixed with "cd-" to avoid conflicts.
   ============================================================ */

/* ── Container ─────────────────────────────────────────── */
.clarity-dashboard {
  margin-top: 2rem;
  background: #fff;
  border-radius: 20px;
  border: 1px solid #E0E0EC;
  box-shadow: 0 20px 60px rgba(0,0,0,0.10);
  overflow: hidden;
  font-family: 'Inter', sans-serif;
}

/* ── Shared Section Wrapper ─────────────────────────────── */
.cd-section {
  padding: 1.75rem 2rem;
  border-bottom: 1px solid #F0F0F5;
}
.cd-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #9090A0;
  margin-bottom: 1.25rem;
}

/* ── Header: Donut + Stage ──────────────────────────────── */
.cd-header {
  background: linear-gradient(135deg, #1E1E2E 0%, #2D2D45 100%);
  padding: 2rem 2rem 1.75rem;
}
.cd-score-hero {
  display: flex;
  align-items: center;
  gap: 2rem;
}

/* Donut ring */
.cd-score-ring {
  position: relative;
  width: 110px;
  height: 110px;
  flex-shrink: 0;
}
.cd-donut {
  width: 110px;
  height: 110px;
  transform: rotate(-90deg);
}
.cd-donut-fill {
  transition: stroke-dasharray 1.2s ease;
}
.cd-score-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.cd-score-num {
  font-size: 2rem;
  font-weight: 900;
  color: #E8641A;
  line-height: 1;
}
.cd-score-denom {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  font-weight: 600;
}

.cd-score-meta { flex: 1; }
.cd-score-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.45);
  margin-bottom: 0.35rem;
}
.cd-greeting {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.85);
  margin-bottom: 0.75rem;
}
.cd-greeting strong { color: #E8641A; }

.cd-stage-badge {
  display: inline-block;
  padding: 0.45rem 1.1rem;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  border: 1.5px solid;
}

/* ── Pillar Cards ───────────────────────────────────────── */
.cd-pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.cd-pillar-card {
  background: #F8F8FB;
  border: 1.5px solid #E8E8F0;
  border-radius: 14px;
  padding: 1.25rem 1rem;
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.cd-pillar-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.09);
}
.cd-pillar-card--bottleneck {
  background: #fff5f5;
  border-color: #e74c3c;
  border-width: 2px;
}
.cd-bottleneck-flag {
  position: absolute;
  top: -1px;
  right: 12px;
  background: #e74c3c;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.22rem 0.65rem;
  border-radius: 0 0 8px 8px;
  white-space: nowrap;
}
.cd-pillar-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #8080A0;
  margin-bottom: 0.5rem;
}
.cd-pillar-score {
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 0.6rem;
}
.cd-pillar-bar {
  height: 6px;
  background: #E8E8F0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.cd-pillar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1s ease;
}
.cd-pillar-raw {
  font-size: 0.72rem;
  color: #A0A0B8;
  font-weight: 500;
}

/* ── Index Cards ────────────────────────────────────────── */
.cd-indexes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.cd-index-card {
  text-align: center;
  padding: 1rem;
  background: #F8F8FB;
  border: 1px solid #E8E8F0;
  border-radius: 12px;
}
.cd-index-val {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 0.5rem;
}
.cd-index-bar {
  height: 5px;
  background: #E8E8F0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.6rem;
}
.cd-index-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1.1s ease 0.2s;
}
.cd-index-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8080A0;
}

/* ── Split Panel ─────────────────────────────────────────── */
.cd-split {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  border-top: 1px solid #F0F0F5;
}

/* Map Panel */
.cd-map-panel {
  background: #FAFAFA;
  border-right: 1px solid #F0F0F5;
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.cd-map-panel .cd-section-title { align-self: flex-start; }
.cd-triangle-wrap {
  width: 100%;
  max-width: 280px;
}
.trifecta-svg {
  width: 100%;
  height: auto;
  display: block;
}
.cd-map-note {
  font-size: 0.75rem;
  color: #9090A8;
  line-height: 1.5;
  text-align: center;
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
}
.cd-imbalance-tag {
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Insights Panel */
.cd-insights-panel {
  padding: 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.cd-insight-block {
  padding: 1.1rem 1.25rem;
  border-radius: 12px;
  border-left: 3px solid #E0E0EC;
}
.cd-insight-block--stage     { background: #F8F8FB; border-left-color: #E8641A; }
.cd-insight-block--bottleneck{ background: #fff5f5; border-left-color: #e74c3c; }
.cd-insight-block--balance   { background: #f0f7ff; border-left-color: #3A7BD5; }
.cd-insight-block--move      { background: #f0fff8; border-left-color: #27ae60; }

.cd-insight-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #8080A0;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.cd-insight-icon { font-size: 0.9rem; }
.cd-insight-stage {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: #1E1E2E;
}
.cd-bottleneck-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #c0392b;
  margin-bottom: 0.4rem;
  font-style: italic;
}
.cd-insight-block p {
  font-size: 0.85rem;
  color: #5A5A6A;
  line-height: 1.65;
  margin: 0;
}

/* ── CTA Row ─────────────────────────────────────────────── */
.cd-cta-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.75rem 2rem;
  border-top: 1px solid #F0F0F5;
  background: #FAFAFA;
  flex-wrap: wrap;
}
.cd-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .cd-split {
    grid-template-columns: 1fr;
  }
  .cd-map-panel {
    border-right: none;
    border-bottom: 1px solid #F0F0F5;
  }
}

@media (max-width: 640px) {
  .cd-header { padding: 1.5rem; }
  .cd-score-hero { gap: 1.25rem; }
  .cd-score-ring { width: 90px; height: 90px; }
  .cd-donut { width: 90px; height: 90px; }
  .cd-score-num { font-size: 1.6rem; }

  .cd-section { padding: 1.5rem; }
  .cd-pillars  { grid-template-columns: 1fr; }
  .cd-indexes  { grid-template-columns: 1fr; }

  .cd-insights-panel { padding: 1.5rem; }
  .cd-cta-row {
    flex-direction: column;
    align-items: stretch;
    padding: 1.5rem;
  }
  .cd-cta-row .btn { width: 100%; justify-content: center; }
}
