/* =====================================================================
   NEXUS · §4.3 Scorecard AI Intelligence Layer
   ===================================================================== */

body.nx-ai { background: linear-gradient(180deg, var(--nx-ink-950), var(--nx-ink-900)); color: #FFF; min-height: 100vh; margin: 0; }
.ai-shell { max-width: 1440px; margin: 0 auto; padding: 20px; }

.ai-hero {
  padding: 22px 28px;
  border-radius: 14px;
  background:
    radial-gradient(60% 100% at 100% 0%, rgba(167, 139, 250, 0.22), transparent 60%),
    linear-gradient(135deg, #1a0f2e, var(--nx-ink-900));
  border: 1px solid rgba(167, 139, 250, 0.35);
  margin-bottom: 16px;
}
.ai-hero .kicker { font-family: var(--font-mono); font-size: 11px; color: #C4B5FD; letter-spacing: 0.14em; font-weight: var(--fw-black); }
.ai-hero h1 { font-size: 28px; font-weight: var(--fw-black); letter-spacing: -0.02em; margin: 4px 0 4px; }
.ai-hero .lead { color: rgba(255,255,255,0.75); font-size: 14px; max-width: 780px; }

/* KPIs */
.ai-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 16px; }
@media (max-width: 900px) { .ai-kpis { grid-template-columns: repeat(2, 1fr); } }
.ai-kpi {
  padding: 14px 16px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  border-top: 3px solid #A78BFA;
}
.ai-kpi.ok    { border-top-color: #10B981; }
.ai-kpi.warn  { border-top-color: var(--nx-amber-500); }
.ai-kpi .lbl { font-family: var(--font-mono); font-size: 10px; color: rgba(255,255,255,0.55); letter-spacing: 0.12em; font-weight: var(--fw-black); text-transform: uppercase; }
.ai-kpi .val { font-family: var(--font-mono); font-size: 22px; font-weight: var(--fw-black); margin-top: 4px; }
.ai-kpi .d { font-family: var(--font-mono); font-size: 10px; color: rgba(255,255,255,0.55); margin-top: 3px; }

/* Grid */
.ai-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1000px) { .ai-grid { grid-template-columns: 1fr; } }
.ai-col { display: flex; flex-direction: column; gap: 16px; }
.ai-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 18px 20px;
}
.ai-card h3 {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em;
  color: rgba(255,255,255,0.6); font-weight: var(--fw-black);
  text-transform: uppercase; margin: 0 0 4px;
  display: flex; align-items: center; gap: 8px;
}
.ai-card h3 .badge {
  padding: 2px 6px; background: rgba(167, 139, 250, 0.16);
  color: #C4B5FD; border-radius: 4px; font-size: 9px; letter-spacing: 0.1em;
}
.ai-card .sub { font-size: 12px; color: rgba(255,255,255,0.5); margin-bottom: 12px; }

/* Cluster card */
.cluster {
  padding: 14px 16px;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  border-left: 3px solid #A78BFA;
  margin-bottom: 10px;
}
.cluster .head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.cluster .title { font-size: 14px; font-weight: var(--fw-black); color: #FFF; }
.cluster .conf {
  font-family: var(--font-mono); font-size: 11px; color: #C4B5FD; font-weight: var(--fw-black);
  padding: 2px 8px; background: rgba(167, 139, 250, 0.12); border-radius: 4px;
}
.cluster .body { font-size: 12px; color: rgba(255,255,255,0.75); line-height: 1.5; margin-bottom: 8px; }
.cluster .sources {
  display: flex; gap: 6px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 10px;
}
.cluster .src {
  padding: 2px 6px; background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7); border-radius: 3px;
  font-weight: var(--fw-bold); letter-spacing: 0.06em;
}

/* Dedup panel */
.dup-list { display: flex; flex-direction: column; gap: 8px; }
.dup-row {
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  border-left: 3px solid var(--nx-teal-500);
}
.dup-row .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.dup-row .primary { font-size: 13px; color: #FFF; font-weight: var(--fw-bold); }
.dup-row .action {
  padding: 2px 8px; font-family: var(--font-mono); font-size: 9px;
  background: rgba(16, 185, 129, 0.14); color: #6EE7B7;
  border-radius: 3px; letter-spacing: 0.06em; font-weight: var(--fw-black);
}
.dup-row .sub { font-family: var(--font-mono); font-size: 10px; color: rgba(255,255,255,0.5); }
.dup-row .merged {
  display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px;
  font-family: var(--font-mono); font-size: 10px;
}
.dup-row .merged .tag {
  padding: 2px 5px; background: rgba(6, 182, 212, 0.14);
  color: var(--nx-teal-300); border-radius: 3px;
}

/* Voice transcription */
.voice-list { display: flex; flex-direction: column; gap: 10px; }
.voice-row {
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  border-left: 3px solid var(--nx-amber-500);
}
.voice-row .head { display: flex; justify-content: space-between; margin-bottom: 6px; }
.voice-row .who { font-family: var(--font-mono); font-size: 11px; color: var(--nx-amber-400); font-weight: var(--fw-black); letter-spacing: 0.06em; }
.voice-row .dur { font-family: var(--font-mono); font-size: 10px; color: rgba(255,255,255,0.5); }
.voice-row .transcript {
  font-size: 12px; color: rgba(255,255,255,0.85);
  padding: 8px 10px;
  background: rgba(0,0,0,0.3);
  border-radius: 6px;
  font-style: italic;
  line-height: 1.5;
}
.voice-row .meta {
  display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.06em;
}
.voice-row .meta .tag {
  padding: 2px 5px; background: rgba(167, 139, 250, 0.16);
  color: #C4B5FD; border-radius: 3px; font-weight: var(--fw-black);
}

/* Delta card */
.delta {
  padding: 14px 16px;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  margin-bottom: 10px;
}
.delta .head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.delta .arrow {
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(167, 139, 250, 0.16); color: #C4B5FD;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: var(--fw-black); font-size: 12px;
}
.delta.up   .arrow { background: rgba(239, 68, 68, 0.18); color: #FCA5A5; }
.delta.down .arrow { background: rgba(16, 185, 129, 0.16); color: #6EE7B7; }
.delta .title { font-size: 13px; color: #FFF; font-weight: var(--fw-bold); }
.delta .body { font-size: 12px; color: rgba(255,255,255,0.7); line-height: 1.5; margin-top: 4px; }
.delta .pct { font-family: var(--font-mono); font-size: 11px; color: rgba(255,255,255,0.55); margin-left: auto; }
.delta.up .pct   { color: #FCA5A5; }
.delta.down .pct { color: #6EE7B7; }
