/* Trust Tier Visual Taxonomy (WCAG 2.1 AA compliant)
   NEVER rely on color alone — always icon + color + text.
   Per-column-header attribution: tier icon + hover tooltip reveals
   exact source, last updated date, and trust level. */

.tier-icon {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  cursor: help;
  vertical-align: middle;
}

.tier-icon svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.tier-label {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.4;
  white-space: nowrap;
}

/* Tier 1: Government Primary (Shield, Deep Blue) */
.tier-1 {
  color: #1e40af;
}
.tier-1 .tier-label {
  background: #dbeafe;
  border: 1px solid #93c5fd;
  color: #1e3a8a;
}

/* Tier 2: Third-Party Aggregator (Globe, Teal) */
.tier-2 {
  color: #0f766e;
}
.tier-2 .tier-label {
  background: #ccfbf1;
  border: 1px solid #5eead4;
  color: #115e59;
}

/* Tier 3: Live API (Plug, Amber) */
.tier-3 {
  color: #b45309;
}
.tier-3 .tier-label {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
}

/* Tier 4: Computed (Gear, Purple) */
.tier-4 {
  color: #7c3aed;
}
.tier-4 .tier-label {
  background: #ede9fe;
  border: 1px solid #c4b5fd;
  color: #5b21b6;
}

/* Staleness fade — for Tier 3 data older than threshold */
.data-stale-30d {
  opacity: 0.6;
}
.data-stale-60d {
  opacity: 0.4;
}

/* Error/degraded state — cell-level, exceptions only */
.data-degraded {
  position: relative;
  color: var(--text-tertiary, #6b7280);
}
.data-degraded::after {
  content: "⚠️";
  font-size: 10px;
  margin-left: 4px;
}

/* Tooltip rendered by trust-tiers.js on hover */
.source-tooltip {
  position: absolute;
  z-index: 9999;
  max-width: 320px;
  padding: 10px 12px;
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.source-tooltip a {
  color: #93c5fd;
  text-decoration: underline;
}

/* Dark theme accommodation: tier labels in dark backgrounds keep contrast */
@media (prefers-color-scheme: dark) {
  .tier-1 {
    color: #93c5fd;
  }
  .tier-2 {
    color: #5eead4;
  }
  .tier-3 {
    color: #fcd34d;
  }
  .tier-4 {
    color: #c4b5fd;
  }
}
