﻿/* ══════════════════════════════════════════════════════════════════
   INICIO (Default.aspx) — tablero de la agencia · Principal2026.Master
   Prefijo de página: df-   ·   Usa los tokens globales --g-* (claro y oscuro)
   Escritorio: todo entra en la pantalla, sin scroll (cada tarjeta se ajusta al alto disponible).
   Con resultados de búsqueda, los resultados ocupan el lugar de los indicadores.
   ══════════════════════════════════════════════════════════════════ */

.df {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ───────────── Cabecera del tablero ───────────── */
.df-cab {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 20px;
}

.df-saludo h1 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.3px;
    line-height: 1.2;
}

.df-saludo p {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--g-texto-2);
}

    .df-saludo p .fa { color: var(--g-texto-3); }

.df-cab-der {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* Control segmentado Entregas | Envíos */
.df-segmento {
    display: inline-flex;
    padding: 4px;
    gap: 4px;
    border-radius: 12px;
    background: var(--g-superficie);
    border: 1px solid var(--g-borde);
    box-shadow: var(--g-sombra-1);
}

    .df-segmento[hidden] { display: none; }

    .df-segmento button {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        height: 32px;
        padding: 0 14px;
        border: 0;
        border-radius: 9px;
        background: transparent;
        color: var(--g-texto-2);
        font-size: 13px;
        font-weight: 700;
        cursor: pointer;
        transition: background .15s, color .15s;
    }

        .df-segmento button:hover { color: var(--g-texto); background: var(--g-superficie-hover); }
        .df-segmento button[aria-selected="true"] { background: var(--g-gris-bg); color: #fff; }
        .df-segmento button:focus-visible { outline: none; box-shadow: var(--g-foco); }

.df-cab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid var(--g-borde);
    background: var(--g-superficie);
    color: var(--g-texto-2);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: var(--g-sombra-1);
}

    .df-cab-btn:hover { color: var(--g-texto); border-color: var(--g-borde-fuerte); }
    .df-actualizar .fa { color: var(--g-texto-3); }
    .df-actualizar:hover .fa { color: var(--g-rojo); }

.df-volver { display: none; }
.df-cotizar { border-color: var(--g-rojo-borde); color: var(--g-rojo); }
    .df-cotizar:hover { color: var(--g-rojo); background: var(--g-rojo-suave); border-color: var(--g-rojo); }

/* ───────────── Rejilla ───────────── */
.df-grid {
    flex: 1 1 0;
    min-height: 560px;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr) minmax(300px, .8fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas:
        "buscar    buscar   noticias"
        "kpis      kpis     noticias"
        "actividad ranking  noticias";
}

.df-area-buscar { grid-area: buscar; min-width: 0; }
.df-kpis { grid-area: kpis; }
.df-actividad { grid-area: actividad; }
.df-ranking { grid-area: ranking; }
.df-noticias { grid-area: noticias; }

/* Con resultados de búsqueda: los resultados toman el lugar de los indicadores */
.df-grid:has(.bc-results) {
    grid-template-rows: minmax(0, 1fr);
    grid-template-areas: "buscar buscar noticias";
}

    .df-grid:has(.bc-results) .df-kpis,
    .df-grid:has(.bc-results) .df-actividad,
    .df-grid:has(.bc-results) .df-ranking { display: none; }

.df:has(.bc-results) .df-volver { display: inline-flex; }
.df:has(.bc-results) .df-segmento { display: none; }

/* ───────────── Buscador dentro del tablero ───────────── */
.df-area-buscar .bc-wrap {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

    .df-area-buscar .bc-wrap .bc-card { margin: 0; }
    /* El formulario de búsqueda nunca se encoge: con muchos resultados, lo que se achica es la tabla */
    .df-area-buscar .bc-wrap > * { flex: 0 0 auto; }
    .df-area-buscar .bc-alert { margin: 0; }
    .df-area-buscar .bc-card-header { padding: 12px 20px; }
    .df-area-buscar .bc-card-body { padding: 14px 20px 16px; }
    .df-area-buscar .bc-caption { margin-bottom: 6px; }
    .df-area-buscar .bc-status { margin-top: 12px; padding-top: 10px; }

    /* Resultados: ocupan el alto disponible y hacen scroll por dentro, con la cabecera fija */
    .df-area-buscar .bc-results {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .df-area-buscar .bc-results .bc-table-wrap {
        flex: 1 1 auto;
        min-height: 0;
        overflow: auto;
    }

    .df-area-buscar .bc-results .bc-table th {
        position: sticky;
        top: 0;
        z-index: 1;
    }

/* ───────────── Tarjetas ───────────── */
.df-card {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--g-superficie);
    border: 1px solid var(--g-borde);
    border-radius: var(--g-radio-l);
    box-shadow: var(--g-sombra-1);
    overflow: hidden;
}

.df-card-cab {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 18px 10px;
}

    .df-card-cab h2 {
        display: flex;
        align-items: center;
        gap: 10px;
        min-width: 0;
        font-size: 14px;
        font-weight: 800;
        color: var(--g-texto);
    }

        .df-card-cab h2 span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .df-card-cab h2 .df-nuevas { overflow: visible; }

        .df-card-cab h2 .fa {
            width: 30px;
            height: 30px;
            flex: 0 0 30px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 9px;
            background: var(--g-rojo-suave);
            color: var(--g-rojo);
            font-size: 13px;
        }

.df-card-cuerpo {
    flex: 1 1 auto;
    min-height: 0;
    padding: 4px 18px 16px;
}

.df-contador {
    font-size: 12px;
    font-weight: 700;
    color: var(--g-texto-3);
    font-variant-numeric: tabular-nums;
}

.df-vacio {
    height: 100%;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    text-align: center;
    color: var(--g-texto-3);
    font-size: 13px;
}

    .df-vacio .fa { font-size: 26px; color: var(--g-borde-fuerte); }
    .df-vacio a { color: var(--g-rojo); font-weight: 700; }

/* ───────────── Indicadores ───────────── */
.df-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.df-kpi {
    position: relative;
    min-width: 0;
    padding: 14px 16px 14px 18px;
    background: var(--g-superficie);
    border: 1px solid var(--g-borde);
    border-radius: var(--g-radio-l);
    box-shadow: var(--g-sombra-1);
    overflow: hidden;
}

.df-kpi-cab {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.df-kpi-tit {
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--g-texto-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.df-kpi-ico {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 14px;
    background: var(--g-superficie-2);
    color: var(--g-texto-2);
}

.df-kpi-ico.df-ico-rojo { background: var(--g-rojo-suave); color: var(--g-rojo); }
.df-kpi-ico.df-ico-verde { background: var(--g-verde-suave); color: var(--g-verde); }
.df-kpi-ico.df-ico-azul { background: var(--g-azul-suave); color: var(--g-azul); }
.df-kpi-ico.df-ico-ambar { background: var(--g-ambar-suave); color: var(--g-ambar); }

.df-kpi-valor {
    margin-top: 4px;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -.8px;
    line-height: 1.15;
    color: var(--g-texto);
    font-variant-numeric: tabular-nums;
}

    .df-kpi-valor small {
        margin-left: 4px;
        font-size: 13px;
        font-weight: 700;
        letter-spacing: 0;
        color: var(--g-texto-3);
    }

.df-kpi-pie {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 8px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--g-texto-3);
    min-height: 22px;
}

.df-delta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    background: var(--g-superficie-2);
    color: var(--g-texto-2);
}

    .df-delta.df-sube { background: var(--g-verde-suave); color: var(--g-verde); }
    .df-delta.df-baja { background: var(--g-rojo-suave); color: var(--g-rojo); }

/* Destacado del mes */
.df-kpi-destacado .df-kpi-persona {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    min-width: 0;
}

.df-kpi-destacado .df-kpi-nombre {
    min-width: 0;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.25;
    color: var(--g-texto);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.df-kpi-destacado .df-kpi-cant {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--g-texto-2);
}

/* ───────────── Avatares y medallas ───────────── */
.df-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--g-superficie-2);
    border: 1px solid var(--g-borde);
    color: var(--g-texto-2);
    font-size: 12px;
    font-weight: 800;
}

.df-avatar.df-oro { background: #f6c945; border-color: #e0ab1a; color: #5b4300; }
.df-avatar.df-plata { background: #d7dde1; border-color: #b6c0c6; color: #3d464b; }
.df-avatar.df-bronce { background: #e2a777; border-color: #c4834f; color: #4d2a10; }

/* ───────────── Gráfico de actividad ───────────── */
.df-leyenda {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--g-texto-2);
    white-space: nowrap;
}

    .df-leyenda span { display: inline-flex; align-items: center; gap: 6px; }
    .df-leyenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }

.df-ley-actual { background: var(--g-rojo-bg); }
.df-ley-anterior { background: var(--g-borde-fuerte); }

.df-grafico {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) 22px;
    min-height: 150px;
}

.df-grafico.df-grafico-vacio { display: block; }

.df-detalle {
    display: block;
    width: 100%;
    margin-top: 4px;
    font-family: var(--g-mono);
    font-size: 11.5px;
    color: var(--g-texto-2);
    word-break: break-word;
}

.df-eje-y {
    position: relative;
    grid-row: 1;
    grid-column: 1;
}

    .df-eje-y span {
        position: absolute;
        right: 8px;
        transform: translateY(50%);
        font-size: 11px;
        font-weight: 600;
        color: var(--g-texto-3);
        font-variant-numeric: tabular-nums;
    }

.df-barras {
    position: relative;
    grid-row: 1;
    grid-column: 2;
    display: flex;
    align-items: stretch;
    gap: 3px;
    border-bottom: 1px solid var(--g-borde-fuerte);
}

.df-linea-guia {
    position: absolute;
    left: 0;
    right: 0;
    height: 0;
    border-top: 1px dashed var(--g-borde);
    pointer-events: none;
}

.df-dia {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    border-radius: 6px 6px 0 0;
    cursor: default;
}

    .df-dia:hover, .df-dia:focus-visible { background: var(--g-superficie-hover); outline: none; }

.df-barra-ant,
.df-barra {
    position: absolute;
    bottom: 0;
    border-radius: 4px 4px 0 0;
}

.df-barra-ant {
    left: 8%;
    right: 8%;
    background: var(--g-borde);
}

html.dark .df-barra-ant { background: #2f383d; }

.df-barra {
    left: 22%;
    right: 22%;
    min-height: 2px;
    background: var(--g-rojo-bg);
    opacity: .82;
    transition: height .45s cubic-bezier(.2, .8, .2, 1), opacity .15s;
}

.df-dia:hover .df-barra { opacity: 1; }
.df-dia.df-hoy .df-barra { opacity: 1; box-shadow: 0 0 0 2px var(--g-superficie), 0 0 0 4px var(--g-rojo-bg); }
.df-dia.df-cero .df-barra { background: var(--g-borde-fuerte); }
.df-dia.df-futuro .df-barra { display: none; }

.df-eje-x {
    grid-row: 2;
    grid-column: 2;
    display: flex;
    gap: 3px;
}

    .df-eje-x span {
        flex: 1 1 0;
        min-width: 0;
        padding-top: 5px;
        text-align: center;
        font-size: 10.5px;
        font-weight: 600;
        color: var(--g-texto-3);
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
    }

        .df-eje-x span.df-hoy { color: var(--g-rojo); font-weight: 800; }

/* Tooltip del gráfico */
.df-tip {
    position: fixed;
    z-index: 50;
    padding: 8px 11px;
    border-radius: 10px;
    background: #1d2326;
    color: #fff;
    font-size: 12px;
    line-height: 1.45;
    box-shadow: var(--g-sombra-2);
    pointer-events: none;
    white-space: nowrap;
    transform: translate(-50%, calc(-100% - 10px));
}

    .df-tip b { font-size: 13px; }
    .df-tip span { color: #b9c2c7; }

html.dark .df-tip { background: #f2f4f5; color: #1d2326; }
html.dark .df-tip span { color: #5c666c; }

/* ───────────── Ranking ───────────── */
.df-rank-lista {
    overflow-y: auto;
    padding-top: 0;
}

.df-rank {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 10px;
    margin: 0 -10px;
    border-radius: 12px;
}

    .df-rank + .df-rank { margin-top: 2px; }

.df-rank-pos {
    width: 18px;
    flex: 0 0 18px;
    text-align: center;
    font-size: 12px;
    font-weight: 800;
    color: var(--g-texto-3);
    font-variant-numeric: tabular-nums;
}

.df-rank-info { flex: 1 1 auto; min-width: 0; }

.df-rank-nombre {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--g-texto);
}

    .df-rank-nombre span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.df-tu {
    flex: 0 0 auto;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--g-rojo-bg);
    color: #fff;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .3px;
}

.df-rank-barra {
    height: 6px;
    margin-top: 6px;
    border-radius: 6px;
    background: var(--g-superficie-2);
    overflow: hidden;
}

    .df-rank-barra i {
        display: block;
        height: 100%;
        border-radius: 6px;
        background: var(--g-gris);
        transition: width .5s cubic-bezier(.2, .8, .2, 1);
    }

.df-rank:first-child .df-rank-barra i { background: var(--g-rojo-bg); }

.df-rank-cant {
    flex: 0 0 auto;
    min-width: 44px;
    text-align: right;
}

    .df-rank-cant b {
        display: block;
        font-size: 15px;
        font-weight: 800;
        line-height: 1.1;
        color: var(--g-texto);
        font-variant-numeric: tabular-nums;
    }

    .df-rank-cant small {
        font-size: 11px;
        font-weight: 600;
        color: var(--g-texto-3);
        white-space: nowrap;
    }

.df-rank.df-yo { background: var(--g-rojo-suave); }

.df-rank-sep {
    height: 1px;
    margin: 8px 0;
    background: var(--g-borde);
}

/* ───────────── Noticias (carrusel) ───────────── */
.df-car-cuerpo {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 0;
}

.df-car {
    position: relative;
    flex: 1 1 auto;
    min-height: 240px;
    border-radius: var(--g-radio);
    background: #0d1012;
    overflow: hidden;
    outline: none;
}

    .df-car:focus-visible { box-shadow: var(--g-foco); }

.df-slide {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity .45s ease, visibility .45s;
}

    .df-slide.df-activa { opacity: 1; visibility: visible; }

    .df-slide img,
    .df-slide video {
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
        background: #0d1012;
    }

    .df-slide figcaption {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 40px 16px 14px;
        background: linear-gradient(to top, rgba(0, 0, 0, .78), rgba(0, 0, 0, 0));
        color: #fff;
        font-size: 14px;
        font-weight: 700;
        line-height: 1.35;
    }

        .df-slide figcaption:empty { display: none; }

.df-car-btn {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: #1d2326;
    font-size: 14px;
    cursor: pointer;
    transform: translateY(-50%);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
    opacity: .78;
    transition: opacity .2s, transform .15s;
}

    .df-car-btn:hover { transform: translateY(-50%) scale(1.06); }
    .df-car-btn:focus-visible { opacity: 1; outline: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, .6); }

.df-car:hover .df-car-btn { opacity: 1; }
.df-car-btn:active { transform: translateY(-50%) scale(.96); }
.df-car-ant { left: 10px; }
.df-car-sig { right: 10px; }

.df-car-acc {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: flex;
    gap: 6px;
}

    .df-car-acc button {
        width: 34px;
        height: 34px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 0;
        border-radius: 10px;
        background: rgba(0, 0, 0, .5);
        color: #fff;
        font-size: 13px;
        cursor: pointer;
        backdrop-filter: blur(4px);
    }

        .df-car-acc button:hover { background: rgba(0, 0, 0, .72); }
        .df-car-acc button:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, .6); }

.df-car-prog {
    position: absolute;
    left: 10px;
    right: 10px;
    top: 10px;
    z-index: 2;
    display: flex;
    gap: 4px;
    padding-right: 48px;
}

    .df-car-prog span {
        flex: 1 1 0;
        height: 3px;
        border-radius: 3px;
        background: rgba(255, 255, 255, .3);
        overflow: hidden;
    }

    .df-car-prog i { display: block; height: 100%; width: 0; background: #fff; }

.df-car-puntos {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
}

    .df-car-puntos button {
        width: 8px;
        height: 8px;
        padding: 0;
        border: 0;
        border-radius: 8px;
        background: var(--g-borde-fuerte);
        cursor: pointer;
        transition: width .2s, background .2s;
    }

        .df-car-puntos button[aria-current="true"] { width: 22px; background: var(--g-rojo-bg); }
        .df-car-puntos button:focus-visible { outline: none; box-shadow: var(--g-foco); }

/* ───────────── Noticias nuevas ───────────── */
.df-nuevas {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    padding: 0 9px 0 8px;
    border-radius: 999px;
    background: var(--g-rojo-bg);
    color: #fff;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .2px;
    white-space: nowrap;
}

    .df-nuevas[hidden] { display: none; }
    .df-nuevas b { font-weight: 800; }

    .df-nuevas i,
    .df-nuevo-badge i {
        position: relative;
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: #fff;
    }

        .df-nuevas i::after,
        .df-nuevo-badge i::after {
            content: "";
            position: absolute;
            inset: 0;
            border-radius: 50%;
            background: #fff;
            animation: df-pulso 1.6s ease-out infinite;
        }

@keyframes df-pulso {
    0% { transform: scale(1); opacity: .8; }
    100% { transform: scale(2.8); opacity: 0; }
}

.df-nuevo-badge {
    position: absolute;
    top: 24px;
    left: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 26px;
    padding: 0 11px 0 9px;
    border-radius: 999px;
    background: var(--g-rojo-bg);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .6px;
    text-transform: uppercase;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}

.df-car-puntos button.df-punto-nuevo:not([aria-current="true"]) {
    background: var(--g-rojo-bg);
    box-shadow: 0 0 0 3px var(--g-rojo-suave);
}

@media (prefers-reduced-motion: reduce) {
    .df-nuevas i::after, .df-nuevo-badge i::after { animation: none; }
}

/* ───────────── Pantallas bajas (1366×768, 1280×720…): todo más compacto para que entre sin scroll ───────────── */
@media (min-width: 1280px) and (max-height: 900px) {
    .df, .df-grid, .df-kpis { gap: 12px; }
    .df-grid { min-height: 430px; }
    .df-saludo h1 { font-size: 19px; }
    .df-saludo p { margin-top: 0; font-size: 12.5px; }
    .df-cab-btn { height: 36px; }
    .df-segmento button { height: 28px; }

    .df-area-buscar .bc-wrap { gap: 12px; }
    .df-area-buscar .bc-card-header { padding: 9px 18px; }
    .df-area-buscar .bc-title-icon { width: 30px; height: 30px; }
    .df-area-buscar .bc-card-body { padding: 12px 18px; }
    .df-area-buscar .bc-caption { display: none; }
    .df-area-buscar .bc-status { margin-top: 8px; padding-top: 8px; }

    .df-kpi { padding: 11px 14px 11px 16px; }
    .df-kpi-ico { width: 28px; height: 28px; flex-basis: 28px; font-size: 13px; }
    .df-kpi-valor { margin-top: 2px; font-size: 25px; }
    .df-kpi-pie { margin-top: 4px; }
    .df-kpi-destacado .df-kpi-persona { margin-top: 4px; }
    .df-kpi-destacado .df-avatar { width: 30px; height: 30px; flex-basis: 30px; }

    .df-card-cab { padding: 10px 16px 6px; }
    .df-card-cab h2 .fa { width: 26px; height: 26px; flex-basis: 26px; font-size: 12px; }
    .df-card-cuerpo { padding: 2px 16px 12px; }
    .df-rank { padding: 6px 10px; }
    .df-rank .df-avatar { width: 30px; height: 30px; flex-basis: 30px; }
    .df-car { min-height: 200px; }
}

@media (min-width: 1280px) and (max-height: 720px) {
    .df-kpi-pie { display: none; }
    .df-kpi-destacado .df-kpi-pie { display: none; }
    .df-kpis > .df-kpi:only-child .df-kpi-pie { display: flex; }
    .df-grid { min-height: 380px; }
}

/* ───────────── Responsive ───────────── */
@media (max-width: 1279.98px) {
    .g-main-completa { height: auto; min-height: 100%; }
    .df-grid {
        flex: 0 0 auto;
        min-height: 0;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-rows: auto;
        grid-template-areas:
            "buscar    buscar"
            "kpis      kpis"
            "actividad ranking"
            "noticias  noticias";
    }

    .df-grid:has(.bc-results) {
        grid-template-areas:
            "buscar   buscar"
            "noticias noticias";
    }

    .df-actividad, .df-ranking { min-height: 300px; }
    .df-noticias { height: 460px; }
    .df-area-buscar .bc-results { max-height: 70vh; }
}

@media (max-width: 1023.98px) {
    .df-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 719.98px) {
    .df-grid {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "buscar" "kpis" "actividad" "ranking" "noticias";
    }

    .df-grid:has(.bc-results) { grid-template-areas: "buscar" "noticias"; }
    .df-saludo h1 { font-size: 19px; }
    .df-cab-der { width: 100%; }
    .df-segmento { flex: 1 1 auto; }
    .df-segmento button { flex: 1 1 0; justify-content: center; }
    .df-actualizar span { display: none; }
    .df-kpi-valor { font-size: 26px; }
    .df-kpi-tit { white-space: normal; line-height: 1.25; }
    .df-kpi { padding: 12px 12px 12px 14px; }
    .df-leyenda { display: none; }
    .df-noticias { height: 420px; }
}

@media (prefers-reduced-motion: reduce) {
    .df-barra, .df-rank-barra i, .df-slide { transition: none; }
}
