/* ===== dashboard.css — v3 =====
   Layout compacto, barras claras, tendencia como tabla.
   ============================================================= */

/* -----------------------------------------------------------------------
   Grid principal 12 col
----------------------------------------------------------------------- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 18px;
    align-items: start;
}
.dashboard-card.span-3  { grid-column: span 3; }
.dashboard-card.span-4  { grid-column: span 4; }
.dashboard-card.span-5  { grid-column: span 5; }
.dashboard-card.span-6  { grid-column: span 6; }
.dashboard-card.span-7  { grid-column: span 7; }
.dashboard-card.span-8  { grid-column: span 8; }
.dashboard-card.span-12 { grid-column: span 12; }

/* Separador de bloque narrativo */
.dash-bloque-sep {
    grid-column: span 12;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 4px 0 2px;
    border-top: 1px solid rgba(111,154,202,.14);
    margin-top: 4px;
}
.dash-bloque-sep .eyebrow { margin: 0; opacity: .6; }
.dash-bloque-sep p { margin: 0; font-size: 12px; color: var(--text-muted); }

/* Sub-columna que apila dos cards */
.dashboard-col {
    display: flex;
    flex-direction: column;
    gap: 18px;
    grid-column: span 5;
}
.dashboard-col .ui-card { flex: 1; }

/* dashboard-kpis-row2 migrado a ui-kpi-grid kpi-grid-3 */

/* dash-tiempos migrado a ui-kpi — ver fila 2 */

/* -----------------------------------------------------------------------
   Lista de filas genérica
----------------------------------------------------------------------- */
.dashboard-list { display: grid; gap: 10px; }

/* -----------------------------------------------------------------------
   SISTEMA DE BARRAS UNIFICADO
   .dbar-track  → fondo gris, contenedor
   .dbar-fill   → barra coloreada, width via --w
   .dbar-tag    → etiqueta pequeña Ab / Ce / Urg
   .dbar-num    → número al final
----------------------------------------------------------------------- */
.dbar-track {
    position: relative;
    height: 9px;
    border-radius: 99px;
    background: rgba(255,255,255,.09);
    overflow: hidden;
    flex: 1;
}
.dbar-track--full { width: 100%; }

.dbar-fill {
    position: absolute;
    inset: 0 auto 0 0;
    height: 100%;
    border-radius: 99px;
    width: var(--w, 0%);
    transition: width .55s cubic-bezier(.4,0,.2,1);
    min-width: 5px;
}

/* Paleta de colores */
.dbar-fill--ab,
.dbar-fill--tipo  { background: var(--cielo,#5BAAE0); }   /* azul cielo — Tipo relación / distrito abiertos */
.dbar-fill--ce    { background: var(--verde,#1A8A6A); }   /* verde — Apoyo previo / distrito cerrados */
.dbar-fill--urg   { background: var(--rojo,#C04040); }    /* rojo — urgencia */
.dbar-fill--cat   { background: var(--azul,#1A6FBF); }   /* azul — reservado */
.dbar-fill--sol   { background: var(--cielo,#5BAAE0); }
.dbar-fill--susp  { background: #6B7A8D; }

/* Colores por sección temática */
.dbar-fill--edad    { background: #D97706; }   /* amber   — Rango de edad */
.dbar-fill--motivo  { background: #7C3AED; }   /* purple  — Motivos frecuentes */
.dbar-fill--geo     { background: #0D9488; }   /* teal    — Alcance geográfico */
.dbar-fill--colab   { background: #2979E8; }   /* blue    — Colaboradores activos */
.dbar-fill--funcion { background: #E8178A; }   /* pink    — Red: por función */
.dbar-fill--horario { background: #F97316; }   /* orange  — Red: por horario */
.dbar-fill--cierre  { background: #059669; }   /* emerald — Motivos de cierre */

/* Perfil del solicitante — un color por tipo de relación */
.dbar-fill--tipo-activo        { background: #2979E8; }   /* azul   — Pastor activo */
.dbar-fill--tipo-retiro        { background: #0D9488; }   /* teal   — Pastor en retiro */
.dbar-fill--tipo-enfermedad    { background: #D97706; }   /* amber  — Pastor en enfermedad */
.dbar-fill--tipo-disciplinario { background: #C04040; }   /* rojo   — Proceso disciplinario */
.dbar-fill--tipo-soltero       { background: #7C3AED; }   /* purple — Pastor soltero */
.dbar-fill--tipo-esposa        { background: #E8178A; }   /* pink   — Esposa de pastor */
.dbar-fill--tipo-viuda         { background: #F97316; }   /* orange — Viuda de pastor */
.dbar-fill--tipo-hijo          { background: #059669; }   /* emerald— Hijo/a de pastor */
.dbar-fill--tipo-otro          { background: #6B7A8D; }   /* gris   — Otro */

/* Apoyo previo — colores semánticos */
.dbar-fill--apoyo-si  { background: #059669; }   /* verde  — Sí ha recibido apoyo */
.dbar-fill--apoyo-no  { background: #2979E8; }   /* azul   — No ha recibido apoyo */
.dbar-fill--apoyo-nd  { background: #6B7A8D; }   /* gris   — Prefiere no responder */

/* Tags Ab / Ce / Urg */
.dbar-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    width: auto;
    height: 20px;
    padding: 0 6px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 900;
    flex-shrink: 0;
    letter-spacing: .02em;
    white-space: nowrap;
}
.dbar-tag--ab   { background: rgba(26, 111, 191,.18);  color: var(--cielo,#5BAAE0); }
.dbar-tag--ce   { background: rgba(26, 138, 106,.18);  color: var(--verde,#1A8A6A); }
.dbar-tag--susp { background: rgba(107, 122, 141,.22); color: #94a3b8; }
.dbar-tag--urg  { background: rgba(192, 64, 64,.18);   color: var(--rojo,#C04040);  }

.dbar-num {
    display: block;
    font-size: 12px;
    font-weight: 900;
    color: var(--text);
    min-width: 20px;
    text-align: right;
    flex-shrink: 0;
}

/* -----------------------------------------------------------------------
   DISTRITOS — lista compacta con separador
----------------------------------------------------------------------- */
.dist-list {
    display: flex;
    flex-direction: column;
    padding: 0;
}

/* 2-column grid for larger district lists */
.dist-list--grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 24px;
}
.dist-list--grid .dist-row {
    border-bottom: 1px solid var(--stroke);
}
@media (max-width: 960px) {
    .dist-list--grid { grid-template-columns: 1fr; }
}

.dist-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 10px 0;
    border-bottom: 1px solid var(--stroke);
}
.dist-row:last-child { border-bottom: none; }
.dist-row:hover { background: rgba(255,255,255,.02); }

.dist-row__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}
.dist-row__name {
    font-size: 12px;
    font-weight: 800;
    color: var(--text);
}
.dist-row__total {
    font-size: 15px;
    font-weight: 950;
    color: var(--text);
    letter-spacing: -.03em;
    flex-shrink: 0;
}
.dist-row__bars {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.dbar-row {
    display: grid;
    grid-template-columns: 100px 1fr 24px;
    align-items: center;
    gap: 6px;
}

/* -----------------------------------------------------------------------
   TIPO DE USUARIO
----------------------------------------------------------------------- */
.dash-row--tipo {
    display: grid;
    grid-template-columns: 100px 1fr 32px;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,.025);
    transition: background var(--transition), border-color var(--transition);
}
.dash-row--tipo:hover {
    background: rgba(255,255,255,.04);
    border-color: var(--stroke-strong);
}
.dash-row--tipo.dash-row--compact {
    grid-template-columns: 64px 1fr 28px;
    gap: 8px;
    padding: 10px 12px;
}
.dash-row__info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.dash-row__info strong {
    display: block;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
}
.dash-row__total {
    display: block;
    font-size: 15px;
    font-weight: 900;
    color: var(--text);
    text-align: right;
}

/* Dot de color por perfil */
.tipo-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 3px;
    flex-shrink: 0;
}
.tipo--pastor { background: var(--azul,#1A6FBF); }
.tipo--esposa { background: #7C3AED; }
.tipo--hijo   { background: var(--verde,#1A8A6A); }
.tipo--hija   { background: #C2500F; }

/* Barras de tipo con color por perfil */
.dbar-fill--tipo.tipo--pastor { background: var(--azul,#1A6FBF); }
.dbar-fill--tipo.tipo--esposa { background: #7C3AED; }
.dbar-fill--tipo.tipo--hijo   { background: var(--verde,#1A8A6A); }
.dbar-fill--tipo.tipo--hija   { background: #C2500F; }

/* -----------------------------------------------------------------------
   CATEGORÍAS
----------------------------------------------------------------------- */
.dash-row--cat {
    display: grid;
    grid-template-columns: 22px 1fr 1fr 32px;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,.025);
    transition: background var(--transition), border-color var(--transition);
}
.dash-row--cat:hover {
    background: rgba(255,255,255,.04);
    border-color: var(--stroke-strong);
}
.dash-row__rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 5px;
    background: rgba(255,255,255,.07);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 900;
}

/* -----------------------------------------------------------------------
   ABIERTOS vs CERRADOS
----------------------------------------------------------------------- */
.status-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.status-split__item {
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
    padding: 18px 12px;
    text-align: center;
    background: rgba(255,255,255,.025);
    position: relative;
    overflow: hidden;
}
.status-split__item::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    border-radius: 14px 0 0 14px;
}
.status-split__item--abierto::before { background: var(--cielo,#5BAAE0); }
.status-split__item--cerrado::before { background: var(--verde,#1A8A6A); }
.status-split__item strong {
    display: block;
    font-size: 2.2rem;
    font-weight: 950;
    letter-spacing: -.04em;
    line-height: 1;
    color: var(--text);
}
.status-split__item span {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .08em;
}

/* -----------------------------------------------------------------------
   TRÁFICO — barra horizontal segmentada por perfil
----------------------------------------------------------------------- */
.trafico-list { display: grid; gap: 12px; }

.trafico-row {
    display: grid;
    grid-template-columns: 64px 1fr 36px;
    align-items: center;
    gap: 10px;
}
.trafico-mes {
    font-size: 12px;
    font-weight: 800;
    color: var(--text);
}
.trafico-segmented {
    display: flex;
    height: 28px;
    border-radius: 8px;
    overflow: hidden;
    gap: 2px;
}
.tseg {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: var(--w, 0%);
    min-width: 0;
    transition: width .5s cubic-bezier(.4,0,.2,1);
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}
.tseg span {
    font-size: 10px;
    font-weight: 900;
    color: rgba(255,255,255,.92);
    white-space: nowrap;
    padding: 0 4px;
}
.tseg--pastor { background: var(--azul,#1A6FBF); }
.tseg--esposa { background: #7C3AED; }
.tseg--hijo   { background: var(--verde,#1A8A6A); }
.tseg--hija   { background: #C2500F; }

.trafico-total-num {
    font-size: 13px;
    font-weight: 900;
    color: var(--text);
    text-align: right;
}

/* Leyenda en la cabecera */
.trafico-leyenda {
    display: flex;
    align-items: center;
    gap: 6px 14px;
    flex-wrap: wrap;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
}
.ley-dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}
.ley-pastor { background: var(--azul,#1A6FBF); }
.ley-esposa { background: #7C3AED; }
.ley-hijo   { background: var(--verde,#1A8A6A); }
.ley-hija   { background: #C2500F; }

/* -----------------------------------------------------------------------
   TENDENCIA MENSUAL — ui-div-table (5 columnas)
   grid: Mes | Solicitudes | Cerrados | Urgentes | Tasa
----------------------------------------------------------------------- */
.tend-div-table {
    min-width: 0;
}
.tend-div-table .ui-div-row {
    grid-template-columns: 90px 1fr 1fr 1fr 90px;
}
/* Alinear cols 2-5 a la derecha */
.tend-div-table .ui-div-thead .ui-div-cell:not(:first-child),
.tend-div-table .ui-div-tbody .ui-div-cell:not(:first-child),
.tend-div-table .ui-div-row--foot .ui-div-cell:not(:first-child) {
    text-align: right;
    justify-content: flex-end;
}

/* Colores de valor por columna */
.tend-num--sol { color: var(--cielo,#5BAAE0); font-weight: 800; }
.tend-num--ce  { color: var(--verde,#1A8A6A); font-weight: 800; }
.tend-num--urg { color: var(--rojo,#C04040);  font-weight: 800; }

/* tend-tasa migrado a badge badge-sm del theme */

/* -----------------------------------------------------------------------
   LIGHT MODE
----------------------------------------------------------------------- */
body.light .dash-row--dist,
body.light .dash-row--tipo,
body.light .dash-row--cat {
    background: rgba(255,255,255,.80);
    border-color: var(--stroke);
}
body.light .dash-row--dist:hover,
body.light .dash-row--tipo:hover,
body.light .dash-row--cat:hover {
    background: rgba(255,255,255,.96);
}
body.light .dbar-track { background: rgba(0,0,0,.09); }
body.light .status-split__item { background: rgba(255,255,255,.80); }

body.light .tseg span { color: rgba(255,255,255,.95); }

/* -----------------------------------------------------------------------
   KPI grid 5 columnas (fila principal)
----------------------------------------------------------------------- */
.kpi-grid-5 {
    grid-template-columns: repeat(5, minmax(0,1fr)) !important;
}
@media (max-width: 1100px) { .kpi-grid-5 { grid-template-columns: repeat(3, minmax(0,1fr)) !important; } }
@media (max-width: 640px)  { .kpi-grid-5 { grid-template-columns: repeat(2, minmax(0,1fr)) !important; } }

/* -----------------------------------------------------------------------
   Hero actualizado
----------------------------------------------------------------------- */
.dash-updated {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

/* -----------------------------------------------------------------------
   TIPO DE APOYO — colores propios
----------------------------------------------------------------------- */
.dbar-fill--apoyo-consejeria  { background: var(--azul,#1A6FBF); }
.dbar-fill--apoyo-terapeutico { background: #7C3AED; }
.dbar-fill--apoyo-orientacion { background: var(--verde,#1A8A6A); }

/* -----------------------------------------------------------------------
   ALCANCE GEOGRÁFICO / RED — filas con rank
----------------------------------------------------------------------- */
.dash-row--geo {
    display: grid;
    grid-template-columns: 22px 1fr 1fr 32px;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,.025);
    transition: background var(--transition), border-color var(--transition);
}
.dash-row--geo:hover {
    background: rgba(255,255,255,.04);
    border-color: var(--stroke-strong);
}

body.light .dash-row--geo { background: rgba(255,255,255,.80); border-color: var(--stroke); }
body.light .dash-row--geo:hover { background: rgba(255,255,255,.96); }

/* -----------------------------------------------------------------------
   RESPONSIVE
----------------------------------------------------------------------- */
@media (max-width: 1100px) {
}
@media (max-width: 960px) {
    .dashboard-card.span-4,
    .dashboard-card.span-5,
    .dashboard-card.span-6,
    .dashboard-card.span-7,
    .dashboard-card.span-8,
    .dashboard-card.span-12,
    .dashboard-col { grid-column: span 12; }
}
@media (max-width: 700px) {
    .dash-row--cat {
        grid-template-columns: 22px 1fr 32px;
    }
    .dash-row--cat .dbar-track--full { display: none; }
    .kpi-grid-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .kpi-grid-5 {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .kpi-grid-5 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* -----------------------------------------------------------------------
   Shell y cabecera del módulo
----------------------------------------------------------------------- */


/* -----------------------------------------------------------------------
   KPI grid de 3 columnas (fila de citas)
----------------------------------------------------------------------- */
.kpi-grid-1 {
    grid-template-columns: 1fr !important;
}
.kpi-grid-3 {
    grid-template-columns: repeat(3, minmax(0,1fr)) !important;
}
.kpi-grid-4 {
    grid-template-columns: repeat(4, minmax(0,1fr)) !important;
}
.kpi-grid-5 {
    grid-template-columns: repeat(5, minmax(0,1fr)) !important;
}

/* KPI suspendidos — color neutro gris para indicar estatus pausado */
.ui-kpi.is-muted {
    border-color: rgba(120,130,150,.30);
    background: linear-gradient(135deg,
        rgba(80,90,110,.22) 0%,
        rgba(60,70,90,.14) 100%);
}
.ui-kpi.is-muted .ui-kpi-value { color: #94a3b8; }

/* -----------------------------------------------------------------------
   CASOS POR PRIORIDAD
----------------------------------------------------------------------- */
.dash-row--prio {
    display: grid;
    grid-template-columns: 1fr 1fr 32px;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,.025);
    transition: background var(--transition), border-color var(--transition);
}
.dash-row--prio:hover {
    background: rgba(255,255,255,.04);
    border-color: var(--stroke-strong);
}
.dash-row--prio .dash-row__info {
    display: flex;
    align-items: center;
    gap: 8px;
}
.dash-row--prio .dash-row__info strong {
    font-size: 13px;
    font-weight: 800;
    color: var(--text);
}

/* Badge nivel numérico */
.prio-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 950;
    flex-shrink: 0;
}
.prioridad--5 { background: rgba(192,64,64,.28);  color: #ff6b6b; border: 1px solid rgba(192,64,64,.40); }
.prioridad--4 { background: rgba(200,104,48,.24); color: #ff9f5a; border: 1px solid rgba(200,104,48,.36); }
.prioridad--3 { background: rgba(200,144,16,.22); color: #f5c542; border: 1px solid rgba(200,144,16,.34); }
.prioridad--2 { background: rgba(26,111,191,.22); color: var(--cielo,#5BAAE0); border: 1px solid rgba(26,111,191,.34); }
.prioridad--1 { background: rgba(255,255,255,.08); color: var(--text-muted); border: 1px solid rgba(255,255,255,.12); }

/* Barras de prioridad con gradiente de color según nivel */
.dbar-fill--prio-5,
.dbar-fill--prio-alta   { background: #C04040; }
.dbar-fill--prio-4      { background: #C86830; }
.dbar-fill--prio-3,
.dbar-fill--prio-media  { background: #C89010; }
.dbar-fill--prio-2      { background: var(--cielo,#5BAAE0); }
.dbar-fill--prio-1,
.dbar-fill--prio-normal { background: rgba(170,185,210,.70); }

/* Light mode prioridad */
body.light .dash-row--prio { background: rgba(255,255,255,.80); }
body.light .dash-row--prio:hover { background: rgba(255,255,255,.96); }
body.light .prioridad--1 { background: rgba(0,0,0,.06); color: #64748b; border-color: rgba(0,0,0,.12); }
body.light .dbar-fill--prio-1 { background: rgba(0,0,0,.15); }



/* Alerta de diagnóstico — estados de cita no contemplados */
.kpi-alerta-debug {
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    background: rgba(200,104,48,.15);
    border: 1px solid rgba(200,104,48,.35);
    color: #e88a3a;
    font-size: 12px;
    font-weight: 600;
}
.kpi-alerta-debug strong {
    font-weight: 900;
    color: #ffb36b;
}

/* -----------------------------------------------------------------------
   KPI grid 7 columnas (fila principal MCP)
----------------------------------------------------------------------- */
.kpi-grid-7 {
    grid-template-columns: repeat(7, minmax(0,1fr)) !important;
}
@media (max-width: 1300px) { .kpi-grid-7 { grid-template-columns: repeat(4, minmax(0,1fr)) !important; } }
@media (max-width: 700px)  { .kpi-grid-7 { grid-template-columns: repeat(2, minmax(0,1fr)) !important; } }

/* -----------------------------------------------------------------------
   Pipeline de atención MCP
----------------------------------------------------------------------- */
.dashboard-pipeline { margin-bottom: 0; }

.pipeline-grid {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.pipeline-step {
    flex: 1;
    min-width: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
}

/* Flecha conectora */
.pipeline-step:not(:last-child)::after {
    content: "›";
    position: absolute;
    right: -14px;
    top: 28px;
    font-size: 20px;
    font-weight: 900;
    color: var(--stroke-strong);
    z-index: 2;
    line-height: 1;
}

/* Tarjeta base */
.pipeline-step-inner {
    --pipe-c: #1f8fe5;
    width: 100%;
    border-radius: 16px;
    padding: 20px 12px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 5px;
    border: 1px solid color-mix(in srgb, var(--pipe-c) 36%, rgba(148,163,184,.14));
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background:
        radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--pipe-c) 26%, transparent), transparent 70%),
        linear-gradient(160deg, color-mix(in srgb, var(--pipe-c) 14%, rgba(10,14,22,.96)), rgba(8,11,18,.88));
    box-shadow: 0 8px 24px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.05);
    transition: transform .15s ease, box-shadow .15s ease;
}
.pipeline-step-inner:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(0,0,0,.26), inset 0 1px 0 rgba(255,255,255,.07);
}

/* Barra superior coloreada */
.pipeline-step-inner::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    border-radius: 16px 16px 0 0;
    background: var(--pipe-c);
    opacity: .9;
}

/* Colores individuales */
.pipe-blue   { --pipe-c: #2979e8; }
.pipe-teal   { --pipe-c: #06b6d4; }
.pipe-orange { --pipe-c: #f97316; }
.pipe-purple { --pipe-c: #a855f7; }
.pipe-green  { --pipe-c: #84cc16; }

.pipeline-num {
    font-size: 34px;
    font-weight: 950;
    line-height: 1;
    color: color-mix(in srgb, var(--pipe-c) 80%, #fff);
    letter-spacing: -.05em;
    margin-top: 6px;
}
.pipeline-label {
    font-size: 10px;
    font-weight: 800;
    color: var(--text);
    opacity: .9;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-top: 3px;
}
.pipeline-pct {
    font-size: 11px;
    color: color-mix(in srgb, var(--pipe-c) 70%, var(--text-muted));
    font-weight: 700;
}
.pipeline-note {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    max-width: 130px;
    line-height: 1.3;
}

/* Light mode */
body.light .pipeline-step-inner {
    background:
        radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--pipe-c) 18%, transparent), transparent 65%),
        linear-gradient(160deg, color-mix(in srgb, var(--pipe-c) 12%, #fff), color-mix(in srgb, var(--pipe-c) 4%, #f4f8ff));
    border-color: color-mix(in srgb, var(--pipe-c) 36%, rgba(148,163,184,.20));
    box-shadow: 0 6px 18px rgba(10,14,22,.08), inset 0 1px 0 rgba(255,255,255,.90);
}
body.light .pipeline-num { color: color-mix(in srgb, var(--pipe-c) 85%, #172033); }
body.light .pipeline-pct { color: color-mix(in srgb, var(--pipe-c) 65%, #2a3a50); }

@media (max-width: 800px) {
    .pipeline-step:not(:last-child)::after { display: none; }
    .pipeline-grid { flex-wrap: wrap; gap: 8px; }
    .pipeline-step { min-width: calc(50% - 8px); }
}

/* -----------------------------------------------------------------------
   Origen directas vs derivaciones
----------------------------------------------------------------------- */
.origen-grid {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 16px;
    padding: 8px 0;
}
.origen-vs {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-muted);
}
.origen-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}
.origen-circle {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}
.origen-circle--directo   { background: rgba(26,111,191,.25); border: 2px solid #1A6FBF; }
.origen-circle--derivacion { background: rgba(13,148,136,.25); border: 2px solid #0d9488; }
.origen-num  { font-size: 26px; font-weight: 800; line-height: 1; color: var(--text); }
.origen-pct  { font-size: 12px; color: var(--text-muted); font-weight: 700; }
.origen-item strong { color: var(--text); font-size: 14px; }
.origen-barra {
    display: flex;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255,255,255,.06);
}
.origen-barra-fill { height: 100%; }
.origen-barra--directo    { background: #1A6FBF; }
.origen-barra--derivacion { background: #0d9488; }
