﻿/* BI - Biografia (Global CSS) */
.bio-page {
    background: #f5f6f8;
    padding: 12px;
    border-radius: 10px;
}

.filtros {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding: 12px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
}

    .filtros > div {
        min-width: 200px;
    }

.acciones {
    align-self: end;
}

.mensaje {
    margin-top: 10px;
}

.kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.kpi {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 12px 14px;
}

.kpi-title {
    font-size: 12px;
    color: #666;
}

.kpi-value {
    font-size: 22px;
    font-weight: 700;
}

.progress-box {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 12px;
}

.progress-title {
    font-size: 14px;
    margin-bottom: 8px;
}

.progress {
    height: 10px;
    background: #f0f2f5;
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: #2563eb;
    border-radius: 999px;
    transition: width .2s ease;
}

.progress-caption {
    margin-top: 6px;
    font-size: 12px;
    color: #666;
}

.tabs {
    display: flex;
    gap: 18px;
    border-bottom: 1px solid #e5e7eb;
    margin-top: 6px;
}

.tab {
    background: transparent;
    border: none;
    padding: 10px 2px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
}

    .tab.active {
        color: #2563eb;
        border-bottom: 3px solid #2563eb;
        margin-bottom: -1px;
    }

.tab-content {
    background: #fff;
    border: 1px solid #eee;
    border-top: none;
    border-radius: 0 0 10px 10px;
    padding: 10px;
}

.placeholder {
    padding: 20px;
    color: #6b7280;
}

/* tablas */
.num {
    text-align: right;
    font-family: Consolas, monospace;
    white-space: nowrap;
}

.tabla-vendedores {
    table-layout: fixed;
    width: 100%;
    font-size: 0.82rem;
}

    .tabla-vendedores th,
    .tabla-vendedores td {
        padding: 4px 6px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.tabla-categorias {
    table-layout: fixed;
    width: 100%;
    font-size: .82rem;
}

    .tabla-categorias th, .tabla-categorias td {
        padding: 4px 6px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .tabla-categorias thead th {
        position: sticky;
        top: 0;
        z-index: 2;
        background: #fff;
    }

.fila-padre {
    background: #f6f7f9;
}

.fila-madre {
    background: #fff;
}

.btn-exp {
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 8px;
}

.kpi-green {
    background: #198754;
    color: #fff;
    font-weight: 700;
}

.kpi-orange {
    background: #fd7e14;
    color: #fff;
    font-weight: 700;
}

.kpi-red {
    background: #dc3545;
    color: #fff;
    font-weight: 700;
}

.num {
    text-align: right;
}

.cat-cards {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    padding: 6px 2px 10px;
}

.cat-card {
    flex: 0 0 220px;
    min-height: 78px;
    border: 1px solid #e8eaef;
    border-radius: 12px;
    background: #fff;
    padding: 10px 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,.06);
}

    .cat-card .t {
        font-size: .72rem;
        color: #6c757d;
        margin-bottom: 4px;
    }

    .cat-card .v {
        font-size: .85rem;
        font-weight: 700;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .cat-card .n {
        margin-top: 4px;
        font-size: .95rem;
        font-weight: 800;
    }

    .cat-card.bad {
        background: #fff5f5;
        border-color: #ffd6d6;
    }

.tabla-clientes {
    table-layout: fixed;
    width: 100%;
    font-size: .82rem;
}

    .tabla-clientes th, .tabla-clientes td {
        padding: 4px 6px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .tabla-clientes thead th {
        position: sticky;
        top: 0;
        z-index: 2;
        background: #fff;
    }

.num {
    text-align: right;
}

.fila-tipo {
    background: #f6f7f9;
}

.fila-nit {
    background: #fff;
}

.fila-prod {
    background: #fff;
    color: #444;
}

.btn-exp {
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 8px;
}

/* cards */
.cli-cards {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    padding: 6px 2px 10px;
}

.cli-card {
    flex: 0 0 260px;
    min-height: 86px;
    border: 1px solid #e8eaef;
    border-radius: 12px;
    background: #fff;
    padding: 10px 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,.06);
}

    .cli-card .t {
        font-size: .72rem;
        color: #6c757d;
        margin-bottom: 4px;
    }

    .cli-card .v {
        font-size: .85rem;
        font-weight: 700;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .cli-card .n {
        margin-top: 4px;
        font-size: .95rem;
        font-weight: 800;
    }

    .cli-card .s {
        margin-top: 2px;
        font-size: .74rem;
        color: #6c757d;
    }

    .cli-card.bad {
        background: #fff5f5;
        border-color: #ffd6d6;
    }

/* Tabla */
.tabla-remediales th {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

.tabla-remediales .num {
    text-align: right;
    white-space: nowrap;
}

.btn-exp {
    padding: 2px 6px;
    line-height: 1;
}

/* Filas */
.fila-grupo {
    background: #f7f7fb;
}

.fila-empresa {
    background: #eef5ff;
}

.fila-sucursal {
    background: #f6fff2;
}

.fila-detalle td {
    background: #fff;
}

/* KPI colors reutilizando tus clases */
.kpi-green {
    background: #d1fae5;
    color: #065f46;
    font-weight: 700;
}

.kpi-orange {
    background: #ffedd5;
    color: #9a3412;
    font-weight: 700;
}

.kpi-red {
    background: #fee2e2;
    color: #991b1b;
    font-weight: 700;
}

/* KPI bar 1 sola línea (cuadros más altos, menos anchos) */
.kpi-bar-1line {
    display: flex;
    flex-wrap: nowrap;
    gap: .5rem;
    overflow: auto;
    padding-bottom: .25rem;
}

    .kpi-bar-1line .kpi {
        min-width: 170px;
        padding: .6rem .7rem;
        border-radius: 12px;
        background: #fff;
        box-shadow: 0 10px 25px rgba(0,0,0,.06);
    }

        .kpi-bar-1line .kpi span {
            display: block;
            font-size: .78rem;
            color: #6b7280;
        }

        .kpi-bar-1line .kpi b {
            display: block;
            font-size: 1.05rem;
        }

/* Badges */
.kpi-badge.good {
    border-left: 4px solid #10b981;
}

.kpi-badge.bad {
    border-left: 4px solid #ef4444;
}