/* analytics-dashboard.css — Dashboard-specific styles for Atlas Analytics */
/* Does NOT include shared.css or header.css rules */

:root {
  --bg: #f9fafb;
  --bg-card: #ffffff;
  --bg-card-hover: #f3f4f6;
  --bg-inset: #f3f4f6;
  --border: #e5e7eb;
  --text: #374151;
  --text-dim: #6b7280;
  --text-bright: #111827;
  --accent: #C41230;
  --accent-dim: rgba(196, 18, 48, 0.1);
  --green: #10b981;
  --green-dim: rgba(16, 185, 129, 0.1);
  --blue: #3b82f6;
  --blue-dim: rgba(59, 130, 246, 0.1);
  --orange: #f59e0b;
  --orange-dim: rgba(245, 158, 11, 0.1);
  --purple: #8b5cf6;
  --purple-dim: rgba(139, 92, 246, 0.1);
  --pink: #ec4899;
  --pink-dim: rgba(236, 72, 153, 0.1);
  --cyan: #06b6d4;
  --cyan-dim: rgba(6, 182, 212, 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Page layout ─────────────────────────────────────────── */
.main {
  max-width: 960px;
  margin: 0 auto;
  padding: 80px 24px 32px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-bright);
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ── Controls ─────────────────────────────────────────────── */
.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.pill-group {
  display: flex;
  gap: 4px;
  background: var(--bg-inset);
  border-radius: 8px;
  padding: 3px;
}

.pill-group button {
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-dim);
  background: transparent;
  transition: all 0.15s;
}

.pill-group button.active {
  background: var(--bg-card);
  color: var(--text-bright);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.date-range-display {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-dim);
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  cursor: pointer;
}

/* ── Stat cards ───────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  min-height: 88px;
}

.stat-card .label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.stat-card .value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1;
}

.stat-card .sub {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

.trend-up { color: var(--green); }
.trend-down { color: var(--accent); }

/* ── Main Tabs ─────────────────────────────────────────────────────── */
.main-tabs { display:flex; gap:0; margin-bottom:20px; border-bottom:2px solid var(--border); }
.main-tab { padding:12px 24px; border:none; background:none; font-size:14px; font-weight:600; color:var(--text-dim); cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-2px; transition:all 0.15s; }
.main-tab:hover { color:var(--text); }
.main-tab.active { color:var(--accent); border-bottom-color:var(--accent); }
.tab-content { display:none; }
.tab-content.active { display:block; }

/* ── Sections ─────────────────────────────────────────────── */
.section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 16px;
  overflow: hidden;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
}

.section-header:hover { background: var(--bg-card-hover); }

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-bright);
}

.section-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-summary {
  font-size: 12px;
  color: var(--text-dim);
}

.chevron {
  font-size: 12px;
  color: var(--text-dim);
  transition: transform 0.2s;
}

.section.open .chevron { transform: rotate(180deg); }

.section-body {
  padding: 0 20px 20px;
}

.section:not(.open) .section-body { display: none; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
}

.badge-accent { background: var(--accent-dim); color: var(--accent); }
.badge-green  { background: var(--green-dim);  color: var(--green);  }
.badge-blue   { background: var(--blue-dim);   color: var(--blue);   }
.badge-orange { background: var(--orange-dim); color: var(--orange); }
.badge-purple { background: var(--purple-dim); color: var(--purple); }
.badge-cyan   { background: var(--cyan-dim);   color: var(--cyan);   }

/* ── Bar chart ────────────────────────────────────────────── */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bar-label {
  font-size: 12px;
  color: var(--text);
  width: 160px;
  flex-shrink: 0;
  text-align: right;
}

.bar-track {
  flex: 1;
  height: 22px;
  background: var(--bg-inset);
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
  min-width: 2px;
}

.bar-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-bright);
  width: 50px;
  flex-shrink: 0;
}

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

.data-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--bg-inset);
  color: var(--text);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── Feature rows ─────────────────────────────────────────── */
.feature-row { border-bottom: 1px solid var(--bg-inset); }
.feature-row:last-child { border-bottom: none; }

.feature-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  cursor: pointer;
  user-select: none;
}

.feature-header:hover { opacity: 0.8; }

.feature-name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.feature-name .name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-bright);
}

.feature-stats {
  display: flex;
  align-items: center;
  gap: 16px;
}

.feature-stat {
  font-size: 12px;
  color: var(--text-dim);
}

.feature-stat strong {
  color: var(--text-bright);
  font-weight: 600;
}

.feature-detail {
  padding: 0 0 16px 0;
  display: none;
}

.feature-row.open .feature-detail { display: block; }
.feature-row.open .feat-chevron { transform: rotate(180deg); }

.feat-chevron {
  font-size: 10px;
  color: var(--text-dim);
  transition: transform 0.2s;
}

.mini-bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

/* ── User detail ──────────────────────────────────────────── */
.user-row {
  cursor: pointer;
}

.user-row:hover { background: var(--bg-inset); }

.user-detail {
  padding: 0 12px 16px;
  display: none;
}

.data-table .user-row.open + .user-detail-row .user-detail { display: block; }

.ud-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.ud-section {
  background: var(--bg-inset);
  border-radius: 6px;
  padding: 10px 12px;
}

.ud-section .ud-label {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.ud-section .ud-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-bright);
}

/* ── Prompt items ─────────────────────────────────────────── */
.prompt-item {
  padding: 10px 12px;
  border-bottom: 1px solid var(--bg-inset);
  cursor: pointer;
  border-radius: 4px;
}

.prompt-item:hover { background: var(--bg-inset); }
.prompt-item:last-child { border-bottom: none; }

.prompt-text {
  font-size: 13px;
  color: var(--text-bright);
  margin-bottom: 4px;
}

.prompt-meta {
  font-size: 11px;
  color: var(--text-dim);
}

/* ── Layout helpers ───────────────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.two-col > div:first-child {
  padding-right: 24px;
  border-right: 1px solid var(--border);
}

.content-roi-card {
  background: var(--bg-inset);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
}

.content-roi-card .roi-type {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-bright);
  margin-bottom: 4px;
}

.content-roi-card .roi-stats {
  font-size: 12px;
  color: var(--text-dim);
}

.content-roi-card .roi-stats strong {
  color: var(--text-bright);
  font-weight: 600;
}

.col-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.view-all-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}

.view-all-link:hover { text-decoration: underline; }

/* ── Alert rows ───────────────────────────────────────────── */
.alert-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 6px;
}

.alert-row.red    { background: var(--accent-dim); }
.alert-row.orange { background: var(--orange-dim); }
.alert-row.green  { background: var(--green-dim);  }

.alert-label { font-size: 13px; }
.alert-value { font-size: 14px; font-weight: 700; }

/* ── Depth bars ───────────────────────────────────────────── */
.depth-bar-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.depth-label {
  font-size: 12px;
  color: var(--text-dim);
  width: 90px;
}

.depth-track {
  flex: 1;
  height: 18px;
  background: var(--bg-inset);
  border-radius: 4px;
  overflow: hidden;
}

.depth-fill {
  height: 100%;
  border-radius: 4px;
}

.depth-pct {
  font-size: 12px;
  color: var(--text-dim);
  width: 36px;
  text-align: right;
}

/* ── Insight box ──────────────────────────────────────────── */
.insight-box {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--blue-dim);
  border-radius: 6px;
  font-size: 12px;
  color: var(--blue);
}

/* ── Metric grid ──────────────────────────────────────────── */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.metric-box {
  background: var(--bg-inset);
  border-radius: 6px;
  padding: 10px 12px;
}

.metric-box .m-label {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.metric-box .m-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-bright);
}

.metric-box .m-sub {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ── Surface bar ──────────────────────────────────────────── */
.surface-bar {
  display: flex;
  height: 20px;
  border-radius: 4px;
  overflow: hidden;
  font-size: 11px;
  color: white;
  font-weight: 500;
}

.surface-bar > div {
  display: flex;
  align-items: center;
  padding-left: 8px;
}

/* ── Impact section ───────────────────────────────────────── */
.impact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.impact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  position: relative;
}

.impact-card .impact-icon {
  font-size: 20px;
  margin-bottom: 8px;
}

.impact-card .impact-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1;
}

.impact-card .impact-label {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

.impact-card .impact-detail {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 8px;
  line-height: 1.4;
}

.impact-card .est-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10px;
  color: var(--text-dim);
  background: var(--bg-inset);
  padding: 2px 6px;
  border-radius: 4px;
  cursor: help;
}

.impact-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.impact-breakdown-card {
  background: var(--bg-inset);
  border-radius: 8px;
  padding: 14px;
}

.impact-breakdown-card .ib-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.output-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
}

.output-row .o-name { font-size: 12px; color: var(--text); }
.output-row .o-value { font-size: 12px; font-weight: 600; color: var(--text-bright); }

/* ── Sparkline ────────────────────────────────────────────── */
.sparkline {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 32px;
  margin-top: 8px;
}

.sparkline .bar {
  width: 100%;
  background: var(--green);
  border-radius: 2px 2px 0 0;
  min-height: 2px;
}

/* ── Extension section ────────────────────────────────────── */
.ext-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.ext-stat {
  background: var(--bg-inset);
  border-radius: 6px;
  padding: 12px;
}

.ext-stat .m-label { font-size: 11px; color: var(--text-dim); margin-bottom: 4px; }
.ext-stat .m-value { font-size: 20px; font-weight: 700; color: var(--text-bright); }
.ext-stat .m-sub   { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* ── Loading / error states ───────────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 0;
  font-size: 13px;
  color: var(--text-dim);
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.error-state {
  padding: 24px 0;
  font-size: 13px;
  color: var(--accent);
}

/* ── Phase 2: Annotations ──────────────────────────────────────────── */

/* ── Phase 2: Annotations ──────────────────────────────────────────── */
.annotation-btn { font-size: 12px; color: var(--accent); background: none; border: 1px solid var(--accent); border-radius: 6px; padding: 4px 10px; cursor: pointer; }
.annotation-btn:hover { background: var(--accent-dim); }
.annotation-modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.annotation-form { background: var(--bg-card); border-radius: 12px; padding: 24px; width: 400px; max-width: 90vw; box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
.annotation-form h3 { font-size: 16px; font-weight: 600; color: var(--text-bright); margin-bottom: 16px; }
.annotation-form label { display: block; font-size: 12px; font-weight: 500; color: var(--text-dim); margin-bottom: 4px; margin-top: 12px; }
.annotation-form input, .annotation-form select { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: var(--bg); color: var(--text); }
.annotation-form .form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.annotation-form .btn-cancel { padding: 6px 14px; border: 1px solid var(--border); border-radius: 6px; background: transparent; color: var(--text-dim); cursor: pointer; font-size: 12px; }
.annotation-form .btn-save { padding: 6px 14px; border: none; border-radius: 6px; background: var(--accent); color: white; cursor: pointer; font-size: 12px; }
.annotation-list { margin-top: 8px; }
.annotation-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 11px; }
.annotation-item .ann-date { color: var(--text-dim); min-width: 70px; }
.annotation-item .ann-label { color: var(--text); flex: 1; }
.annotation-item .ann-delete { color: var(--text-dim); cursor: pointer; background: none; border: none; font-size: 11px; }
.annotation-item .ann-delete:hover { color: var(--accent); }
.annotation-badge { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 10px; font-weight: 500; }
.annotation-badge.feature_launch { background: var(--accent-dim); color: var(--accent); }
.annotation-badge.onboarding { background: var(--blue-dim); color: var(--blue); }
.annotation-badge.training { background: var(--green-dim); color: var(--green); }
.annotation-badge.other { background: var(--bg-inset); color: var(--text-dim); }

/* ── Phase 2: Feedback viewer ──────────────────────────────────────── */
.feedback-list { max-height: 300px; overflow-y: auto; }
.feedback-item { padding: 10px 0; border-bottom: 1px solid var(--bg-inset); }
.feedback-item:last-child { border-bottom: none; }
.feedback-question { font-size: 12px; color: var(--text-bright); margin-bottom: 4px; }
.feedback-response { font-size: 11px; color: var(--text-dim); max-height: 60px; overflow: hidden; }
.feedback-meta { font-size: 10px; color: var(--text-dim); margin-top: 4px; }

/* ── Phase 2: Depth comparison cards ───────────────────────────────── */
.surface-compare { display: flex; gap: 16px; margin-top: 12px; }
.surface-compare-card { flex: 1; background: var(--bg-inset); border-radius: 6px; padding: 10px 12px; }
.surface-compare-card .sc-label { font-size: 11px; color: var(--text-dim); margin-bottom: 4px; }
.surface-compare-card .sc-value { font-size: 18px; font-weight: 700; color: var(--text-bright); }
.surface-compare-card .sc-sub { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* ── Phase 2: Workflow items ───────────────────────────────────────── */
.workflow-item { padding: 10px 12px; background: var(--bg-inset); border-radius: 6px; margin-bottom: 6px; }
.workflow-sequence { font-size: 13px; color: var(--text-bright); font-weight: 500; }
.workflow-meta { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* ── Product Cards ─────────────────────────────────────────────────── */
.product-card { background:var(--bg-card); border:1px solid var(--border); border-radius:10px; margin-bottom:12px; overflow:hidden; }
.product-header { display:flex; align-items:center; justify-content:space-between; padding:16px 20px; cursor:pointer; }
.product-header:hover { background:var(--bg-inset); }
.product-name { display:flex; align-items:center; gap:10px; }
.product-icon { font-size:20px; }
.product-label { font-size:15px; font-weight:600; color:var(--text-bright); }
.product-badge { padding:3px 10px; border-radius:12px; font-size:12px; font-weight:600; color:white; }
.product-meta { display:flex; align-items:center; gap:16px; font-size:12px; color:var(--text-dim); }
.product-bar { height:4px; background:var(--bg-inset); margin:0 20px; border-radius:2px; }
.product-bar-fill { height:100%; border-radius:2px; }
.product-detail { padding:0 20px 16px; display:none; }
.product-card.open .product-detail { display:block; }
.product-card.open .product-chevron { transform:rotate(180deg); }
.product-chevron { font-size:12px; color:var(--text-dim); transition:transform 0.2s; }

/* ── Feature Grid (Product detail) ─────────────────────────────────── */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.feature-box { background: var(--bg-inset); border-radius: 8px; padding: 12px; }
.feature-box .fb-label { font-size: 11px; color: var(--text-dim); margin-bottom: 2px; }
.feature-box .fb-value { font-size: 20px; font-weight: 700; color: var(--text-bright); }
.feature-box .fb-sub { font-size: 10px; color: var(--text-dim); margin-top: 2px; }

/* ── Product Health Mini Cards (Overview) ──────────────────────────── */
.health-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:16px; }
.health-card { background:var(--bg-card); border:1px solid var(--border); border-radius:8px; padding:12px; cursor:pointer; transition:border-color 0.15s; }
.health-card:hover { border-color:var(--accent); }
.health-card .hc-header { display:flex; align-items:center; gap:6px; margin-bottom:6px; }
.health-card .hc-icon { font-size:16px; }
.health-card .hc-name { font-size:12px; font-weight:600; color:var(--text-bright); }
.health-card .hc-total { font-size:18px; font-weight:700; color:var(--text-bright); }
.health-card .hc-meta { font-size:11px; color:var(--text-dim); margin-top:2px; }

/* ── Cross-Product Insights ────────────────────────────────────────── */
.insight-row { display:flex; align-items:flex-start; gap:12px; padding:10px 0; border-bottom:1px solid var(--bg-inset); }
.insight-row:last-child { border-bottom:none; }
.insight-icon { font-size:18px; width:32px; text-align:center; }
.insight-text { font-size:13px; color:var(--text); flex:1; }
.insight-metric { font-size:14px; font-weight:700; color:var(--text-bright); white-space:nowrap; }

/* ── Adoption Matrix ───────────────────────────────────────────────── */
.adoption-summary { display:flex; gap:12px; margin-bottom:12px; }
.adoption-summary-card { flex:1; background:var(--bg-inset); border-radius:8px; padding:12px; text-align:center; }
.adoption-summary-card .as-value { font-size:24px; font-weight:700; color:var(--text-bright); }
.adoption-summary-card .as-label { font-size:11px; color:var(--text-dim); margin-top:2px; }
.adoption-matrix { width:100%; border-collapse:collapse; font-size:12px; }
.adoption-matrix th { text-align:left; font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:0.5px; color:var(--text-dim); padding:8px; border-bottom:1px solid var(--border); }
.adoption-matrix td { padding:8px; border-bottom:1px solid var(--bg-inset); }
.adoption-dot { display:inline-block; width:12px; height:12px; border-radius:50%; }
.adoption-dot.active { background:var(--green); }
.adoption-dot.inactive { background:var(--bg-inset); border:1px solid var(--border); }

/* ── Chat Quality ──────────────────────────────────────────────────── */
.quality-score { display:flex; align-items:center; gap:16px; margin-bottom:16px; }
.quality-score .qs-number { font-size:48px; font-weight:700; line-height:1; }
.quality-score .qs-label { font-size:13px; color:var(--text-dim); }
.quality-breakdown { display:grid; grid-template-columns:1fr 1fr; gap:12px; }

/* ── What Changed ──────────────────────────────────────────────────── */
.change-item { display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid var(--bg-inset); cursor:pointer; }
.change-item:last-child { border-bottom:none; }
.change-item:hover { opacity:0.8; }
.change-arrow { font-size:14px; width:24px; text-align:center; }
.change-text { font-size:13px; color:var(--text); flex:1; }
.change-delta { font-size:13px; font-weight:600; white-space:nowrap; }

/* ── Conversation thread (expandable) ──────────────────────────────── */
.convo-thread { margin-top:8px; padding:10px 14px; background:var(--bg-inset); border-radius:8px; font-size:12px; }
.convo-thread .convo-msg { padding:6px 0; border-bottom:1px solid var(--border); }
.convo-thread .convo-msg:last-child { border-bottom:none; }
.convo-thread .convo-role { font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:0.5px; color:var(--text-dim); margin-bottom:2px; }
.convo-thread .convo-text { font-size:13px; color:var(--text); line-height:1.6; max-height:none; overflow:visible; }
.convo-thread .convo-text strong { color:var(--text-bright); }
.convo-thread .convo-text em { font-style:italic; }
.convo-thread .convo-text hr { border:none; border-top:1px solid var(--border); margin:8px 0; }
.show-convo-link { font-size:11px; color:var(--accent); text-decoration:none; cursor:pointer; margin-top:4px; display:inline-block; }
.show-convo-link:hover { text-decoration:underline; }

/* ── Usage product filter ──────────────────────────────────────────── */
.usage-product-filter { padding:4px 10px; border:1px solid var(--border); border-radius:6px; background:transparent; font-size:12px; color:var(--text-dim); cursor:pointer; }
.usage-product-filter:hover { background:var(--bg-inset); }
.usage-product-filter.active { background:var(--accent-dim); color:var(--accent); border-color:var(--accent); }
.usage-team-filter { padding:4px 10px; border:1px solid var(--border); border-radius:6px; background:transparent; font-size:12px; color:var(--text-dim); cursor:pointer; }
.usage-team-filter:hover { background:var(--bg-inset); }
.usage-team-filter.active { background:var(--accent-dim); color:var(--accent); border-color:var(--accent); }

/* ── Theme badge colors ────────────────────────────────────────────── */
.theme-badge { display:inline-block; padding:2px 8px; border-radius:8px; font-size:10px; font-weight:500; }
