/* Percentile rank badges (NIGHT_28)
   ---------------------------------
   Rank 0 .. 1 from PERCENT_RANK() ASC over filing_pattern_score.
   Lower rank = lower score = worse filing pattern (= red).          */

.data-table__percentile {
  white-space: nowrap;
  text-align: center;
  min-width: 90px;
}

.percentile-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  padding: 4px 12px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 16px;
  font-family: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  line-height: 1.1;
  border: 1px solid transparent;
  letter-spacing: -0.01em;
}

.percentile-badge small {
  font-size: 11px;
  opacity: 0.75;
  font-weight: 600;
}

.percentile-badge--compact { padding: 3px 10px; font-size: 14px; }
.percentile-badge--compact small { font-size: 10px; }

.percentile-badge--lg {
  padding: 8px 20px;
  font-size: 24px;
  border-width: 1.5px;
}
.percentile-badge--lg small { font-size: 14px; }

/* 4-band color map (matches plan spec) */
.percentile-badge--bottom-quartile {
  background: rgba(239, 68, 68, 0.13);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.28);
}
.percentile-badge--below-median {
  background: rgba(249, 115, 22, 0.13);
  color: #f97316;
  border-color: rgba(249, 115, 22, 0.28);
}
.percentile-badge--above-median {
  background: rgba(234, 179, 8, 0.13);
  color: #eab308;
  border-color: rgba(234, 179, 8, 0.28);
}
.percentile-badge--top-quartile {
  background: rgba(34, 197, 94, 0.13);
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.28);
}
.percentile-badge--none {
  background: rgba(120, 120, 120, 0.08);
  color: #888;
  border-color: rgba(120, 120, 120, 0.18);
}

/* Industry-comparison label under the vs-Industry badge */
.percentile-industry-label {
  display: block;
  font-size: 10px;
  color: var(--text-tertiary, #737373);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
  text-align: center;
  font-weight: 500;
}

/* Employer detail — large percentile stack */
.employer-percentiles {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 36px;
  align-items: flex-start;
  margin-top: 8px;
}
.employer-percentile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.employer-percentile .percentile-badge {
  align-self: flex-start;
}
.percentile-label {
  font-size: 13px;
  color: var(--text-secondary, #a3a3a3);
  font-weight: 600;
}
.percentile-subtitle {
  font-size: 11px;
  color: var(--text-tertiary, #737373);
  font-weight: 400;
  line-height: 1.35;
  max-width: 360px;
}

/* Sparkline cell (P1.T5 companion) */
.data-table__sparkline {
  min-width: 150px;
  white-space: nowrap;
  text-align: left;
}
.sparkline {
  vertical-align: middle;
  display: inline-block;
}
.sparkline-trend {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: -0.02em;
}
