/* ============================================================
   CEDigital Report Renderer — Oliver Logan Design System
   Tokens:
     --navy:   #1c1c52   (header bg, persona cards, brief headers)
     --navy2:  #14143d   (darker navy)
     --yellow: #eeff41   (accent, logo, active nav underline)
     --white:  #ffffff   (card bg, nav bg)
     --ink:    #1a1a2e   (primary text)
     --ink2:   #3d3d5c   (secondary text)
     --muted:  #7b7b9a   (labels, meta)
     --faint:  #ededf5   (page bg, stat pill bg)
     --green:  #059669
     --red:    #dc2626
     --border: #e0e0ef
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@700;800&family=Inter:wght@400;600&display=swap');

/* ── Reset / Root ─────────────────────────────────────────── */
:root {
    --navy:   #1c1c52;
    --navy2:  #14143d;
    --yellow: #eeff41;
    --white:  #ffffff;
    --ink:    #1a1a2e;
    --ink2:   #3d3d5c;
    --muted:  #7b7b9a;
    --faint:  #ededf5;
    --green:  #059669;
    --red:    #dc2626;
    --border: #e0e0ef;
}

/* ── Wrapper ──────────────────────────────────────────────── */
.report-wrap {
    max-width: 980px;
    margin: 0 auto;
    background: var(--faint);
    color: var(--ink);
    font-family: Inter, sans-serif;
    padding-bottom: 80px;
}

.report-body {
    padding: 0 22px;
}

/* ── Header (dark navy) ───────────────────────────────────── */
.report-header {
    position: sticky;
    top: 0;
    background: var(--navy);
    padding: 12px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    z-index: 100;
}

.report-header-brand {
    display: flex;
    flex-direction: row;
    gap: 14px;
    align-items: center;
}

.report-header-logo {
    width: 40px;
    height: 40px;
    background: var(--yellow);
    color: var(--navy);
    font-family: Poppins, sans-serif;
    font-size: 15px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
}

.report-header-eyebrow {
    font-family: Poppins, sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: var(--yellow);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.report-header-title {
    font-family: Poppins, sans-serif;
    font-size: 18px;
    font-weight: 800;
    color: var(--white);
    line-height: 1.2;
}

.report-header-meta {
    font-size: 11px;
    color: rgba(255,255,255,0.55);
    margin-top: 2px;
}

.report-header-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.hdr-badge {
    padding: 5px 10px;
    border-radius: 6px;
    font-family: Poppins, sans-serif;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.hdr-badge-green {
    background: rgba(5,150,105,.18);
    color: #34d399;
}

.hdr-badge-red {
    background: rgba(220,38,38,.2);
    color: #fca5a5;
}

.hdr-badge-yellow {
    background: rgba(238,255,65,.12);
    color: var(--yellow);
    border: 1px solid rgba(238,255,65,.25);
}

/* ── Nav (white bar, underline active) ───────────────────── */
.report-nav-bar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 0 22px;
    display: flex;
    gap: 0;
    overflow-x: auto;
    position: sticky;
    top: 65px;
    z-index: 99;
}

.report-tab {
    padding: 14px 18px;
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-family: Poppins, sans-serif;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.15s;
    white-space: nowrap;
    margin-bottom: -1px;
}

.report-tab:hover {
    color: var(--ink);
}

.report-tab.active {
    color: var(--ink);
    border-bottom-color: var(--yellow);
}

/* ── Sections ─────────────────────────────────────────────── */
.report-section {
    display: none;
    padding-top: 28px;
}

.report-section.active {
    display: block;
    animation: fu 0.3s ease;
}

@keyframes fu {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.report-section-title {
    font-family: Poppins, sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: var(--ink);
    margin: 0 0 6px;
}

.report-section-sub {
    font-size: 13px;
    color: var(--muted);
    margin: 0 0 20px;
}

/* ── White Card (base) ───────────────────────────────────── */
.rcard {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 14px;
}

/* ── Stat Pills Row ──────────────────────────────────────── */
.stat-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.stat-pill {
    background: var(--faint);
    border-radius: 8px;
    padding: 8px 12px;
    min-width: 110px;
    flex: 1;
}

.stat-pill-label {
    font-family: Poppins, sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 3px;
}

.stat-pill-value {
    font-family: Poppins, sans-serif;
    font-size: 17px;
    font-weight: 800;
    color: var(--ink);
    display: block;
}

/* ── KPI headline ─────────────────────────────────────────── */
.kpi-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-family: Poppins, sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.kpi-headline {
    font-family: Poppins, sans-serif;
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 8px;
    line-height: 1.25;
}

.kpi-detail {
    font-size: 13px;
    color: var(--ink2);
    margin: 0 0 24px;
    line-height: 1.6;
}

/* ── Pillar grid (What's Winning / Not / Next) ───────────── */
.pillars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.pillar-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
}

.pillar-title {
    font-family: Poppins, sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 10px;
}

.pillar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pillar-list li {
    font-size: 13px;
    color: var(--ink2);
    padding: 5px 0;
    border-bottom: 1px solid var(--border);
    line-height: 1.5;
}

.pillar-list li:last-child { border-bottom: none; }

.pillar-list li::before {
    content: "→ ";
    font-weight: 700;
}

/* ── Metric grid (4-col, used in performer / not-working / brief) */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 14px 0;
}

.metric-item {
    background: var(--faint);
    border-radius: 8px;
    padding: 10px 12px;
}

.metric-label {
    font-family: Poppins, sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 4px;
}

.metric-value {
    font-family: Poppins, sans-serif;
    font-size: 15px;
    font-weight: 800;
    color: var(--ink);
    display: block;
}

/* ── Performer cards ─────────────────────────────────────── */
.performer-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 14px;
}

.performer-rank-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 4px;
}

.performer-rank-badge {
    font-family: Poppins, sans-serif;
    font-size: 18px;
    font-weight: 800;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.performer-name {
    font-family: Poppins, sans-serif;
    font-size: 15px;
    font-weight: 800;
    color: var(--ink);
    line-height: 1.3;
    flex: 1;
}

.performer-raw-name {
    font-size: 11px;
    color: var(--muted);
    margin-top: 3px;
    word-break: break-all;
}

.performer-narrative {
    font-size: 13px;
    line-height: 1.7;
    color: var(--ink2);
    margin: 12px 0;
}

.hook-rec-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.hook-rec-label {
    font-family: Poppins, sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.hook-rec-text {
    font-size: 13px;
    color: var(--ink2);
    line-height: 1.5;
}

/* ── Status badges ───────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-family: Poppins, sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.badge-scale  { background: rgba(5,150,105,.12);  color: #059669; }
.badge-watch  { background: rgba(217,119,6,.12);   color: #b45309; }
.badge-pause  { background: rgba(220,38,38,.12);   color: #dc2626; }
.badge-monitor{ background: var(--faint);           color: var(--muted); }

/* ── What's Not Working cards ────────────────────────────── */
.nw-card {
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 16px;
    border: 1px solid #fca5a5;
}

.nw-header {
    background: #2d1010;
    padding: 16px 22px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.nw-eyebrow {
    font-family: Poppins, sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: rgba(252,165,165,.7);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.nw-title {
    font-family: Poppins, sans-serif;
    font-size: 16px;
    font-weight: 800;
    color: #fca5a5;
    line-height: 1.3;
}

.nw-sub {
    font-size: 11px;
    color: rgba(252,165,165,.5);
    margin-top: 3px;
}

.nw-tag {
    background: var(--red);
    color: var(--white);
    font-family: Poppins, sans-serif;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.nw-body {
    background: var(--white);
    padding: 18px 22px;
}

.nw-metric-item {
    background: #fff5f5;
}

.nw-metric-item .metric-value {
    color: var(--red);
}

.why-box {
    background: #fff5f5;
    border-left: 3px solid var(--red);
    border-radius: 0 8px 8px 0;
    padding: 12px 14px;
    font-size: 13px;
    color: var(--ink2);
    line-height: 1.6;
    margin: 14px 0;
}

.why-box strong {
    color: var(--red);
    font-weight: 700;
}

.lesson-box {
    background: var(--navy);
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 12px;
}

.lesson-label {
    font-family: Poppins, sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: var(--yellow);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.lesson-text {
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    line-height: 1.6;
    margin: 0;
}

/* ── Persona cards (dark navy) ───────────────────────────── */
.persona-card {
    background: var(--navy);
    border-radius: 14px;
    padding: 22px;
    position: relative;
    overflow: hidden;
}

.persona-card::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(238,255,65,.08) 0%, transparent 70%);
    pointer-events: none;
}

.persona-id {
    font-family: Poppins, sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: rgba(255,255,255,.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.persona-name {
    font-family: Poppins, sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: var(--yellow);
    line-height: 1.2;
}

.persona-age {
    font-size: 12px;
    color: rgba(255,255,255,.5);
    margin-top: 3px;
}

.persona-pill {
    background: rgba(238,255,65,.1);
    border: 1px solid rgba(238,255,65,.25);
    color: var(--yellow);
    font-family: Poppins, sans-serif;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    flex-shrink: 0;
}

.persona-signal {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 8px;
    padding: 12px 14px;
    margin: 14px 0;
}

.persona-signal-label {
    font-family: Poppins, sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: rgba(255,255,255,.4);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 5px;
}

.persona-signal-text {
    font-size: 13px;
    color: rgba(255,255,255,.8);
    line-height: 1.6;
    margin: 0;
}

.persona-section-label {
    font-family: Poppins, sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: rgba(255,255,255,.35);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 12px 0 6px;
}

.persona-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.persona-list li {
    font-size: 13px;
    color: rgba(255,255,255,.75);
    padding: 4px 0;
    line-height: 1.5;
}

.persona-list li::before {
    content: "✓ ";
    color: #34d399;
}

/* ── Creative Brief cards ────────────────────────────────── */
.brief-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 16px;
}

.brief-header {
    background: var(--navy);
    padding: 16px 22px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.brief-header::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 140px; height: 140px;
    background: radial-gradient(circle, rgba(238,255,65,.1) 0%, transparent 70%);
    pointer-events: none;
}

.brief-eyebrow {
    font-family: Poppins, sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: rgba(255,255,255,.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.brief-title {
    font-family: Poppins, sans-serif;
    font-size: 17px;
    font-weight: 800;
    color: var(--white);
}

.brief-priority {
    background: var(--yellow);
    color: var(--navy);
    font-family: Poppins, sans-serif;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.brief-body {
    padding: 18px 22px;
}

.brief-hook {
    background: var(--navy);
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 14px;
    font-style: italic;
    color: var(--yellow);
    line-height: 1.6;
    margin: 14px 0;
}

.brief-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

.brief-section-label {
    font-family: Poppins, sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 0 0 8px;
}

.brief-body-text {
    font-size: 13px;
    color: var(--ink2);
    line-height: 1.6;
    margin: 0 0 14px;
}

.brief-list {
    list-style: none;
    padding: 0;
    margin: 0 0 14px;
}

.brief-list li {
    font-size: 13px;
    color: var(--ink2);
    padding: 3px 0;
}

.brief-list li::before { content: "• "; color: var(--navy); font-weight: 700; }
.brief-list.donts li::before { content: "✕ "; color: var(--red); }

.brief-headlines {
    list-style: none;
    padding: 0;
    margin: 0;
}

.brief-headlines li {
    font-size: 13px;
    padding: 7px 10px;
    background: var(--faint);
    border-radius: 6px;
    margin-bottom: 6px;
    font-style: italic;
    color: var(--ink2);
}

.brief-data-anchor {
    background: rgba(28,28,82,.06);
    border-left: 3px solid var(--navy);
    border-radius: 0 8px 8px 0;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--ink2);
    line-height: 1.6;
    margin-top: 16px;
}

/* ── Copy Angles ─────────────────────────────────────────── */
.angle-row {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 12px;
}

.angle-bar {
    width: 4px;
    min-height: 60px;
    border-radius: 2px;
    flex-shrink: 0;
    align-self: stretch;
}

.angle-name {
    font-family: Poppins, sans-serif;
    font-size: 15px;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 3px;
}

.angle-signal {
    font-family: Poppins, sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 8px;
}

.angle-desc {
    font-size: 13px;
    color: var(--ink2);
    line-height: 1.6;
    margin: 0 0 10px;
}

.angle-examples {
    list-style: none;
    padding: 0;
    margin: 0;
}

.angle-examples li {
    font-size: 12px;
    padding: 5px 8px;
    background: var(--faint);
    border-radius: 4px;
    margin-bottom: 5px;
    font-style: italic;
    color: var(--ink2);
}

/* ── Preview panel wrapper ───────────────────────────────── */
.report-preview-panel {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--faint);
    z-index: 1000;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.report-preview-panel[hidden] { display: none; }

.report-preview-header {
    position: sticky;
    top: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 14px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.report-preview-title {
    font-family: Poppins, sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
}

.report-preview-container { flex: 1; }

/* ── Preview panel buttons ───────────────────────────────── */
.report-preview-header .btn-primary {
    background: var(--navy);
    color: var(--yellow);
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-family: Poppins, sans-serif;
    font-weight: 700;
    cursor: pointer;
    font-size: 13px;
}

.report-preview-header .btn-secondary {
    background: transparent;
    color: var(--ink2);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 6px;
    font-family: Inter, sans-serif;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
}

/* ── Action pills (What's Not Working) ──────────────────── */
.action-pills-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 14px 0;
}

.action-pill {
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--ink2);
}

.action-pill-label {
    font-family: Poppins, sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: block;
    margin-bottom: 3px;
}

.action-pill-stop {
    background: #fff1f2;
    border-left: 3px solid #f43f5e;
}

.action-pill-stop .action-pill-label {
    color: #e11d48;
}

.action-pill-instead {
    background: #f0fdf4;
    border-left: 3px solid #22c55e;
}

.action-pill-instead .action-pill-label {
    color: #16a34a;
}

/* ── Copy Insights table ─────────────────────────────────── */
.copy-table-wrap {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 16px;
}

.copy-table {
    width: 100%;
    border-collapse: collapse;
}

.copy-table thead tr {
    background: var(--navy);
}

.copy-table th {
    font-family: Poppins, sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: rgba(255,255,255,.55);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 12px 16px;
    text-align: left;
}

.copy-th-rank  { width: 40px; text-align: center; }
.copy-th-ctr   { width: 80px; text-align: right; }
.copy-th-count { width: 60px; text-align: right; }

.copy-row {
    border-bottom: 1px solid var(--border);
}

.copy-row:last-child { border-bottom: none; }

.copy-row:nth-child(even) td { background: var(--faint); }

.copy-rank {
    font-family: Poppins, sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    text-align: center;
    padding: 13px 16px;
}

.copy-headline {
    font-size: 13px;
    color: var(--ink2);
    padding: 13px 16px;
    font-style: italic;
    line-height: 1.5;
}

.copy-ctr {
    font-family: Poppins, sans-serif;
    font-size: 14px;
    font-weight: 800;
    color: var(--navy);
    text-align: right;
    padding: 13px 16px;
    white-space: nowrap;
}

.copy-count {
    font-size: 12px;
    color: var(--muted);
    text-align: right;
    padding: 13px 16px;
    white-space: nowrap;
}

/* ── Personas grid ───────────────────────────────────────── */
.personas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 700px) {
    .report-body { padding: 0 12px; }
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .brief-sections { grid-template-columns: 1fr; }
    .report-nav-bar { padding: 0 12px; }
    .report-header { padding: 12px 14px; }
    .report-header-badges { display: none; }
    .hook-rec-grid { grid-template-columns: 1fr; }
}
