/* =====================================================================
   TrueRanker · Report V2 — Unified design system
   Tokens espejo de public/css/shurhaia/shurhaia.css
   Documento standalone para impresión/PDF (no carga shurhaia.css)
   ===================================================================== */

:root {
    --rpt-font: 'Poppins', sans-serif;

    /* Marca / acento */
    --rpt-primary: #007BFF;          /* --blue-50 */
    --rpt-primary-strong: #0062CC;   /* --blue-40 */
    --rpt-accent: #ed922f;           /* --orange (gráficos) */

    /* Semántico */
    --rpt-green: #50B142;            /* --green */
    --rpt-red: #DA3737;              /* --red */

    /* Texto */
    --rpt-text: #4D4D4D;             /* --gray */
    --rpt-text-soft: #767676;        /* --gray-50 */
    --rpt-text-mute: #A1AAB3;        /* --gray-60 */

    /* Superficies y bordes */
    --rpt-bg: #FFFFFF;
    --rpt-surface: #F8F8F8;          /* --white-dark */
    --rpt-border: #DDDDDD;           /* --gray-90 */
    --rpt-border-soft: #EFEFEF;      /* --gray-95 */

    /* Tintes suaves para badges */
    --rpt-green-bg: #EAF6E8;
    --rpt-red-bg: #FBEAEA;
    --rpt-primary-bg: #E7F2FE;       /* --blue-95 */
    --rpt-neutral-bg: #F1F2F4;

    /* Forma y ritmo */
    --rpt-radius: 8px;
    --rpt-shadow: 0 1px 3px rgba(0, 0, 0, .06);
    --rpt-gap: 12px;
}

/* ---------------------------------------------------------------------
   Base
   --------------------------------------------------------------------- */
* {
    font-family: var(--rpt-font);
    box-sizing: border-box;
}

body {
    margin: 0 auto;
    width: 900px !important;
    color: var(--rpt-text);
    background: var(--rpt-bg);
}

a {
    color: var(--rpt-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.green { color: var(--rpt-green); }
.red { color: var(--rpt-red); }
.gray { color: var(--rpt-text-soft); }

.header-md {
    font-size: 24px;
    font-weight: 600;
    color: var(--rpt-text);
}

/* ---------------------------------------------------------------------
   Section scaffolding & loaders
   --------------------------------------------------------------------- */
.report-section-block {
    margin-bottom: 40px;
    min-height: 80px;
}

.report-section-loader {
    text-align: center;
    padding: 40px 20px;
    color: var(--rpt-text-soft);
    font-size: 14px;
}

.report-section-loader img {
    width: 32px;
    height: 32px;
    margin-bottom: 10px;
}

.report-section-empty {
    text-align: center;
    padding: 30px;
    color: var(--rpt-text-mute);
    font-style: italic;
}

.rpt-section {
    padding: 20px;
}

.rpt-section-title {
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    color: var(--rpt-text);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.rpt-section-title img {
    width: 18px;
    height: 18px;
}

.rpt-section-subtitle {
    text-align: center;
    font-size: 13px;
    color: var(--rpt-text-soft);
    margin-bottom: 20px;
}

.rpt-subtitle {
    font-size: 14px;
    font-weight: 700;
    color: var(--rpt-text);
    margin: 24px 0 12px;
}

/* ---------------------------------------------------------------------
   Cover
   --------------------------------------------------------------------- */
.rpt-doc {
    width: 100%;
    border-collapse: collapse;
}
.rpt-doc > thead > tr > td,
.rpt-doc > tbody > tr > td,
.rpt-doc > tfoot > tr > td {
    padding: 0;
    border: 0;
    vertical-align: top;
}

.rpt-running-header {
    padding: 15px 20px;
    text-align: left;
}
.rpt-running-header img {
    display: block;
}

/* En pantalla el pie va oculto (se muestra solo al imprimir) */
.rpt-doc__foot { display: none; }

.rpt-cover {
    text-align: center;
    color: var(--rpt-text);
    max-width: 640px;
    margin: 60px auto;
    padding: 48px 32px;
    background: linear-gradient(180deg, var(--rpt-primary-bg) 0%, var(--rpt-bg) 70%);
    border: 1px solid var(--rpt-border-soft);
    border-radius: 16px;
}

.rpt-cover-eyebrow {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--rpt-primary);
    margin-bottom: 14px;
}

.rpt-cover-title {
    font-size: 34px;
    font-weight: 700;
    color: var(--rpt-text);
    margin-bottom: 28px;
    line-height: 1.2;
}

.rpt-cover-project {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.rpt-cover-project img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: contain;
}

.rpt-cover-project span {
    font-size: 28px;
    font-weight: 600;
    color: var(--rpt-text);
}

.rpt-cover-daterange {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 18px;
    margin-bottom: 16px;
    background: var(--rpt-primary-bg);
    border: 1px solid rgba(0, 123, 255, 0.18);
    border-radius: 999px;
}

.rpt-cover-daterange svg {
    width: 17px;
    height: 17px;
    color: var(--rpt-primary);
    flex-shrink: 0;
}

.rpt-cover-daterange span {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--rpt-primary-strong);
}

.rpt-cover-generated {
    font-size: 13px;
    color: var(--rpt-text-mute);
    margin-top: 4px;
    margin-bottom: 30px;
}

.rpt-cover-keywords {
    font-size: 18px;
    font-weight: 700;
    color: var(--rpt-text);
    margin-top: 10px;
}

.rpt-cover-keywords .label {
    font-weight: 400;
}

.rpt-btn {
    background-color: var(--rpt-primary);
    color: #fff;
    padding: 14px 28px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    margin-top: 35px;
    font-size: 16px;
    font-weight: 700;
}

.rpt-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* ---------------------------------------------------------------------
   Section header (numbered)
   --------------------------------------------------------------------- */
.rpt-section-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 20px 16px;
    margin: 64px 0 28px;
    border-bottom: 2px solid var(--rpt-border-soft);
}

.rpt-section-num {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--rpt-primary);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rpt-section-head__text {
    text-align: left;
}

.rpt-section-head__title {
    display: block;
    font-size: 22px;
    font-weight: 600;
    color: var(--rpt-text);
    line-height: 1.2;
}

.rpt-section-head__context {
    display: block;
    font-size: 12px;
    color: var(--rpt-text-soft);
    margin-top: 2px;
}

.rpt-section-head__desc {
    display: block;
    font-size: 13px;
    color: var(--rpt-text-soft);
    margin-top: 4px;
    line-height: 1.4;
    max-width: 640px;
}

/* ---------------------------------------------------------------------
   Table of contents / index
   --------------------------------------------------------------------- */
.rpt-index {
    max-width: 600px;
    margin: 0 auto 50px;
    padding: 20px;
}

.rpt-index-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--rpt-text);
    text-align: center;
    margin-bottom: 20px;
}

.rpt-index-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 4px;
    border-bottom: 1px solid var(--rpt-border-soft);
    color: var(--rpt-text);
    text-decoration: none;
}

.rpt-index-item:hover {
    text-decoration: none;
}

.rpt-index-item__num {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--rpt-primary-bg);
    color: var(--rpt-primary-strong);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.rpt-index-item__label {
    display: block;
    font-size: 16px;
    font-weight: 500;
    color: var(--rpt-text);
}

.rpt-index-item__text {
    flex: 1;
    min-width: 0;
}

.rpt-index-item__desc {
    display: block;
    font-size: 12px;
    color: var(--rpt-text-soft);
    margin-top: 2px;
    line-height: 1.35;
}

/* ---------------------------------------------------------------------
   Executive summary
   --------------------------------------------------------------------- */
.rpt-exec-summary {
    max-width: 860px;
    margin: 0 auto 56px;
    padding: 28px;
    border: 1px solid var(--rpt-border-soft);
    border-radius: var(--rpt-radius);
    background: var(--rpt-surface);
}

.rpt-exec-summary__title {
    font-size: 24px;
    font-weight: 600;
    color: var(--rpt-text);
    text-align: center;
    margin-bottom: 28px;
}

.rpt-exec-summary__subtitle {
    font-size: 12px;
    font-weight: 700;
    color: var(--rpt-text-mute);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--rpt-border-soft);
}

.rpt-exec-summary__kpis {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
}

.rpt-exec-summary__group {
    flex: 1 1 100%;
    background: var(--rpt-bg);
    border: 1px solid var(--rpt-border-soft);
    border-radius: var(--rpt-radius);
    padding: 16px;
}

.rpt-exec-summary__group-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--rpt-primary-strong);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 12px;
}

.rpt-exec-summary__group-kpis {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.rpt-exec-summary__insights {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rpt-exec-summary__insight {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: var(--rpt-surface);
    border-radius: var(--rpt-radius);
    border-left: 3px solid var(--rpt-primary);
    font-size: 13px;
    color: var(--rpt-text);
    line-height: 1.4;
}

.rpt-exec-summary__insight.is-up {
    border-left-color: var(--rpt-green);
}

.rpt-exec-summary__insight.is-down {
    border-left-color: var(--rpt-red);
}

.rpt-exec-summary__insight.is-neutral {
    border-left-color: var(--rpt-text-mute);
}

/* ---------------------------------------------------------------------
   Cards / panels
   --------------------------------------------------------------------- */
.rpt-card {
    background: var(--rpt-bg);
    border: 1px solid var(--rpt-border-soft);
    border-radius: var(--rpt-radius);
    padding: 16px;
}

.rpt-card--soft {
    background: #fcfcfc;
    border-color: var(--rpt-border-soft);
    padding: 20px;
}

.rpt-card-label {
    font-size: 12px;
    color: var(--rpt-text-soft);
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 8px;
}

.rpt-card-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--rpt-border-soft);
    font-size: 16px;
    font-weight: 600;
    color: var(--rpt-text);
    text-align: left;
}

.rpt-card-body {
    padding: 20px;
}

/* ---------------------------------------------------------------------
   KPI
   --------------------------------------------------------------------- */
.rpt-kpi-wrapper {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.rpt-kpi {
    flex: 1;
    min-width: 120px;
    background: var(--rpt-bg);
    border: 1px solid var(--rpt-border-soft);
    border-radius: var(--rpt-radius);
    padding: 15px;
    text-align: center;
}

.rpt-kpi__label {
    font-size: 11px;
    color: var(--rpt-text-soft);
    text-transform: uppercase;
    margin-bottom: 5px;
    font-weight: 700;
}

.rpt-kpi__value {
    font-size: 20px;
    font-weight: 700;
    color: var(--rpt-text);
    line-height: 1.1;
}

.rpt-kpi__value--lg {
    font-size: 28px;
}

.rpt-kpi__value--xl {
    font-size: 42px;
    color: var(--rpt-primary);
    letter-spacing: -1px;
    line-height: 1;
}

.rpt-kpi__value--primary { color: var(--rpt-primary); }
.rpt-kpi__value--accent { color: var(--rpt-accent); }

.rpt-kpi__sub {
    font-size: 12px;
    margin-top: 4px;
    font-weight: 700;
}

/* ---------------------------------------------------------------------
   Delta badge (▲ / ▼)
   --------------------------------------------------------------------- */
.rpt-delta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 6px;
    vertical-align: middle;
}

.rpt-delta.is-up { background: var(--rpt-green-bg); color: var(--rpt-green); }
.rpt-delta.is-down { background: var(--rpt-red-bg); color: var(--rpt-red); }
.rpt-delta.is-flat { background: var(--rpt-neutral-bg); color: var(--rpt-text-soft); }

/* ---------------------------------------------------------------------
   Progress / distribution bars
   --------------------------------------------------------------------- */
.rpt-bar-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    gap: 10px;
}

.rpt-bar-name {
    width: 70px;
    font-size: 12px;
    font-weight: 700;
}

.rpt-bar {
    flex: 1;
    height: 10px;
    background: var(--rpt-border-soft);
    border-radius: 5px;
    overflow: hidden;
}

.rpt-bar--thin {
    height: 6px;
    border-radius: 3px;
}

.rpt-bar__fill {
    height: 100%;
    background: var(--rpt-primary);
    border-radius: 5px;
}

.rpt-bar__fill--accent {
    background: var(--rpt-accent);
}

.rpt-bar-val {
    width: 30px;
    text-align: right;
    font-size: 12px;
    font-weight: 700;
}

/* ---------------------------------------------------------------------
   Tables
   --------------------------------------------------------------------- */
.rpt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    line-height: 1.5;
}

.rpt-table th,
.rpt-table td {
    border: 1px solid var(--rpt-border-soft);
    padding: 10px 9px;
    vertical-align: middle;
}

.rpt-table th {
    background: var(--rpt-surface);
    font-weight: 700;
    text-align: center;
    color: var(--rpt-text);
}

.rpt-table tbody tr:nth-child(even) {
    background: #fbfbfc;
}

.rpt-table .text-left { text-align: left; }
.rpt-table .text-center { text-align: center; }
.rpt-table .nowrap { white-space: nowrap; }
.rpt-table .break { word-break: break-word; }

.rpt-empty { color: var(--rpt-text-mute); }

/* ---------------------------------------------------------------------
   Badges (status / labels)
   --------------------------------------------------------------------- */
.rpt-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.rpt-badge--success { background: var(--rpt-green-bg); color: var(--rpt-green); }
.rpt-badge--danger { background: var(--rpt-red-bg); color: var(--rpt-red); }
.rpt-badge--warning { background: #FFF4E5; color: #C2410C; }
.rpt-badge--info { background: var(--rpt-primary-bg); color: var(--rpt-primary-strong); }
.rpt-badge--neutral { background: var(--rpt-neutral-bg); color: var(--rpt-text-soft); }

/* ---------------------------------------------------------------------
   Notices
   --------------------------------------------------------------------- */
.rpt-notice {
    border-radius: var(--rpt-radius);
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 13px;
}

.rpt-notice--warning {
    background: #FFF9E6;
    border-left: 4px solid var(--rpt-accent);
    color: #856404;
}

/* ---------------------------------------------------------------------
   Charts
   --------------------------------------------------------------------- */
.rpt-chart {
    width: 100%;
    height: 320px;
    margin-bottom: 8px;
}

/* Bloque de gráfico: título + descripción + gráfico con aire alrededor */
.rpt-chart-block {
    margin: 0 0 56px;
    padding: 0 8px;
}

.rpt-chart-block:last-child {
    margin-bottom: 24px;
}

.rpt-chart-title {
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    color: var(--rpt-text);
    margin: 40px 0 10px;
}

.rpt-chart-block .rpt-chart-title {
    margin-top: 0;
}

.rpt-chart-desc {
    text-align: center;
    font-size: 13px;
    color: var(--rpt-text-soft);
    line-height: 1.5;
    max-width: 640px;
    margin: 0 auto 24px;
}

/* Descripción corta bajo el título de una tabla o bloque */
.rpt-block-desc {
    font-size: 12px;
    color: var(--rpt-text-soft);
    line-height: 1.5;
    margin: -6px 0 14px;
    max-width: 760px;
}

.rpt-block-desc--center {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

/* Nota informativa discreta (p. ej. "20+ significa...") */
.rpt-note {
    font-size: 11px;
    color: var(--rpt-text-mute);
    font-style: italic;
    margin: 10px 0 0;
}

.rpt-chart-wrap {
    border: 1px solid var(--rpt-border-soft);
    border-radius: var(--rpt-radius);
    background: var(--rpt-bg);
    padding: 16px;
    margin-bottom: 32px;
}

/* ---------------------------------------------------------------------
   Backlinks section (specifics)
   --------------------------------------------------------------------- */
.bl-tracked-stats { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 20px; font-size: 12px; color: var(--rpt-text-soft); }
.bl-tracked-stat { background: var(--rpt-surface); border: 1px solid var(--rpt-border-soft); border-radius: 999px; padding: 4px 12px; }
.bl-link { color: var(--rpt-primary); text-decoration: none; word-break: break-all; }
.bl-domain { display: block; font-size: 10px; color: var(--rpt-text-soft); margin-top: 2px; }
.bl-issue-detail { display: block; margin-top: 4px; font-size: 10px; font-weight: 600; color: var(--rpt-red); line-height: 1.3; }
.bl-competitor-name { display: flex; align-items: center; gap: 8px; text-align: left; }
.bl-competitor-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; color: var(--rpt-text); }
.bl-competitor-badge img { width: 14px; height: 14px; border-radius: 2px; }
.bl-rank-change { display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 6px; }
.bl-rank-change-up { background: var(--rpt-green-bg); color: var(--rpt-green); }
.bl-rank-change-down { background: var(--rpt-red-bg); color: var(--rpt-red); }
.rpt-badge--rel-follow { background: var(--rpt-green-bg); color: var(--rpt-green); }
.rpt-badge--rel-nofollow { background: #FFF3E0; color: #E65100; }
.rpt-badge--rel-sponsored { background: #F3E5F5; color: #6A1B9A; }

/* ---------------------------------------------------------------------
   Score tiers (SEO audits, etc.)
   --------------------------------------------------------------------- */
.rpt-score-good { color: var(--rpt-green); font-weight: 700; }
.rpt-score-ok { color: var(--rpt-primary); font-weight: 700; }
.rpt-score-warn { color: var(--rpt-accent); font-weight: 700; }
.rpt-score-bad { color: var(--rpt-red); font-weight: 700; }

.rpt-view-link { color: var(--rpt-primary); font-weight: 600; white-space: nowrap; }

/* ---------------------------------------------------------------------
   AI Visibility section (specifics)
   --------------------------------------------------------------------- */
.aiv-top-row { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.aiv-panel { flex: 1; min-width: 220px; background: var(--rpt-bg); border: 1px solid var(--rpt-border-soft); border-radius: var(--rpt-radius); padding: 16px; }
.aiv-panel-label { font-size: 12px; color: var(--rpt-text-soft); text-transform: uppercase; font-weight: 700; margin-bottom: 8px; }
.aiv-score-value { font-size: 48px; font-weight: 800; line-height: 1; color: var(--rpt-text); }
.aiv-score-delta { font-size: 14px; font-weight: 700; margin-left: 8px; }
.aiv-delta.green, .aiv-score-delta.green { color: var(--rpt-green); }
.aiv-delta.red, .aiv-score-delta.red { color: var(--rpt-red); }
.aiv-delta.gray, .aiv-score-delta.gray { color: var(--rpt-text-soft); }
.aiv-breakdown-row { display: flex; align-items: center; margin-bottom: 8px; gap: 10px; }
.aiv-breakdown-label { flex: 1; font-size: 12px; color: var(--rpt-text-soft); }
.aiv-breakdown-bar { height: 6px; background: var(--rpt-border-soft); border-radius: 3px; margin-top: 4px; overflow: hidden; }
.aiv-breakdown-bar > div { height: 100%; background: var(--rpt-primary); border-radius: 3px; }
.aiv-breakdown-value { width: 36px; text-align: right; font-size: 12px; font-weight: 600; color: var(--rpt-text-soft); }
.aiv-metric-split { display: flex; align-items: stretch; }
.aiv-metric-col { flex: 1; text-align: center; }
.aiv-metric-col + .aiv-metric-col { border-left: 1px solid var(--rpt-border-soft); }
.aiv-metric-value { font-size: 28px; font-weight: 800; color: var(--rpt-text); }
.aiv-metric-sub { font-size: 16px; color: var(--rpt-text-mute); font-weight: 600; }
.aiv-llm-count { font-size: 36px; font-weight: 800; line-height: 1; }
.aiv-llm-total { font-size: 18px; font-weight: 700; color: var(--rpt-text-mute); }
.aiv-llm-bar { display: flex; gap: 4px; margin: 12px 0; }
.aiv-llm-bar-seg { flex: 1; height: 8px; border-radius: 4px; background: var(--rpt-border-soft); }
.aiv-llm-bar-seg.covered { background: var(--rpt-primary); }
.aiv-llm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.aiv-llm-item { font-size: 12px; color: var(--rpt-text-soft); }
.aiv-llm-item strong { color: var(--rpt-text); }
.aiv-comp-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--rpt-border-soft); font-size: 13px; }
.aiv-comp-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.aiv-comp-name { flex: 1; font-weight: 600; }
.aiv-comp-sov { width: 50px; text-align: right; font-weight: 700; }
.aiv-comp-mentions { width: 60px; text-align: right; color: var(--rpt-text-soft); font-size: 12px; }
.aiv-collecting { background: #fff9e6; border: 1px solid #ffeeba; border-radius: var(--rpt-radius); padding: 16px; margin-bottom: 20px; color: #856404; font-size: 13px; text-align: center; }
.aiv-prompt-cell { max-width: 280px; word-break: break-word; }
.aiv-llm-status { display: inline-flex; gap: 4px; align-items: center; justify-content: center; }
.aiv-status-icon { width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; }
.aiv-status-icon.on { background: var(--rpt-green-bg); color: var(--rpt-green); }
.aiv-status-icon.off { background: var(--rpt-neutral-bg); color: var(--rpt-text-mute); }
.aiv-status-icon.pending { background: #fff3e0; color: #ef6c00; }
.aiv-sentiment-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.aiv-sentiment-dot.positive { background: var(--rpt-green); }
.aiv-sentiment-dot.neutral { background: var(--rpt-accent); }
.aiv-sentiment-dot.negative { background: var(--rpt-red); }
.aiv-milestone-group { margin-bottom: 16px; }
.aiv-milestone-date { font-size: 13px; font-weight: 700; color: var(--rpt-text-soft); margin-bottom: 8px; }
.aiv-milestone-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--rpt-border-soft); font-size: 13px; }
.aiv-milestone-badge { padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 700; text-transform: uppercase; flex-shrink: 0; }
.aiv-milestone-badge.severity-positive, .aiv-milestone-badge.severity-gain { background: var(--rpt-green-bg); color: var(--rpt-green); }
.aiv-milestone-badge.severity-negative, .aiv-milestone-badge.severity-loss { background: var(--rpt-red-bg); color: var(--rpt-red); }
.aiv-milestone-badge.severity-neutral, .aiv-milestone-badge.severity-info { background: var(--rpt-primary-bg); color: var(--rpt-primary-strong); }
.aiv-milestone-message { flex: 1; }
.aiv-milestone-delta { color: var(--rpt-text-soft); white-space: nowrap; }

.aiv-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 18px;
    padding: 10px 14px;
    margin: 0 0 12px;
    background: var(--rpt-neutral-bg);
    border: 1px solid var(--rpt-border-soft);
    border-radius: var(--rpt-radius);
    font-size: 12px;
    color: var(--rpt-text-soft);
}
.aiv-legend__title { font-weight: 700; color: var(--rpt-text); }
.aiv-legend__item { display: inline-flex; align-items: center; gap: 6px; }

.aiv-location { display: inline-flex; align-items: center; gap: 6px; }
.aiv-location .flag {
    width: 15px;
    height: 15px;
    border: 1px solid #dcdcdc;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

/* ---------------------------------------------------------------------
   Print / PDF
   --------------------------------------------------------------------- */
@media print {
    @page { margin: 12mm 10mm 12mm; }

    .page-break { page-break-inside: avoid; }
    .report-section-loader { display: none !important; }
    #downloadBtn { display: none !important; }

    /* Cabecera (logo) y pie de marca repetidos en cada página impresa.
       Se usan thead/tfoot de tabla porque el navegador los repite en cada
       página RESERVANDO el espacio, a diferencia de position:fixed, que
       se solapa con el contenido. */
    .rpt-doc__head { display: table-header-group; }
    .rpt-doc__foot { display: table-footer-group; }

    .rpt-running-header {
        padding: 4px 14px 8px;
        background: #fff;
        border-bottom: 1px solid var(--rpt-border-soft);
    }
    .rpt-running-header .rpt-logo-img {
        max-height: 30px;
        width: auto;
    }

    .rpt-running-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 14px 2px;
        font-size: 10px;
        color: var(--rpt-text-mute);
        border-top: 1px solid var(--rpt-border-soft);
        background: #fff;
    }
    .rpt-running-footer__brand { font-weight: 700; color: var(--rpt-text-soft); text-decoration: none; }
    a.rpt-running-footer__brand { color: var(--rpt-primary); }

    /* Repetir cabecera de tabla en cada página y no cortar filas */
    .rpt-table thead { display: table-header-group; }
    .rpt-table tr { page-break-inside: avoid; }

    /* Cada bloque de gráfico intenta quedar entero en una página */
    .rpt-chart-block { page-break-inside: avoid; }

    /* Cada sección empieza en página nueva (la primera no, va tras el resumen) */
    .report-section-block { page-break-before: always; }
    .report-section-block:first-of-type { page-break-before: avoid; }

    /* La cabecera nunca se separa de su contenido ni queda huérfana al pie */
    .rpt-section-head { page-break-after: avoid; page-break-inside: avoid; }

    /* Evitar títulos/subtítulos huérfanos al pie de página */
    .rpt-section-title,
    .rpt-section-subtitle,
    .rpt-subtitle,
    .rpt-chart-title { page-break-after: avoid; }
}

html {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}
