﻿.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 2000;
}

.modal {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: start center;
    padding: 8vh 0 0 0;
    z-index: 2010;
    pointer-events: none;
}

    .modal > .modal-dialog {
        pointer-events: auto;
        width: 98vw;
        max-width: 1600px;
        max-height: 70vh;
        background: #fff;
        border-radius: 14px;
        box-shadow: 0 20px 60px rgba(0,0,0,.35);
        display: flex;
        flex-direction: column;
        overflow: hidden; /* para que header/body respeten bordes */
    }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}

.modal-body {
    padding: 1rem;
}

/* ====== Tablas ====== */
.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.td-cuenta {
    white-space: nowrap;
}
/* evita doble línea */

/* ====== Botón Cuenta (elegante tipo pill/link) ====== */
.btn-cuenta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 200px; /* más ancho para que NO parta */
    padding: .35rem .75rem;
    border-radius: 999px;
    border: 1px solid #dfe7ef;
    background: #f6f9fc;
    color: #0b5ed7;
    font-weight: 600;
    letter-spacing: .2px;
    white-space: nowrap; /* clave */
    text-decoration: none;
    cursor: pointer;
    transition: transform .12s ease, background-color .12s ease, border-color .12s ease;
}

    .btn-cuenta:hover {
        background: #eef5ff;
        border-color: #cfe2ff;
        transform: translateY(-1px);
    }

    .btn-cuenta:active {
        transform: translateY(0);
    }

/* Si quieres que la columna Cuenta no “encoga” en pantallas pequeñas */
.tabla-gastos th:first-child,
.tabla-gastos td:first-child {
    min-width: 220px;
}

/* Header del modal */
.thead-detalle th {
    background: #f4f6f9;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    font-size: 0.9rem;
}

/* Fila total */
.tfoot-detalle td {
    background: linear-gradient(to right, #f8f9fa, #eef5ff);
    border-top: 2px solid #dee2e6;
    font-size: 0.95rem;
}

    /* Efecto visual financiero */
    .tfoot-detalle td.num {
        color: #212529;
    }

    .tfoot-detalle td.text-primary {
        color: #0d6efd !important;
    }

.kpi-bar {
    display: flex;
    flex-wrap: nowrap; /* 🔥 evita que bajen a otra línea */
    gap: 8px;
    overflow-x: auto; /* si no cabe, permite scroll horizontal */
    padding-bottom: 5px;
}

.kpi {
    flex: 0 0 150px; /* ancho fijo más pequeño */
    min-height: 75px; /* un poco más alto */
    padding: 10px 12px;
    border-radius: 10px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

    .kpi span {
        font-size: 0.70rem;
        color: #6c757d;
    }

    .kpi b {
        font-size: 1rem;
    }

.kpi-badge {
    min-width: 160px;
    align-items: center;
    justify-content: center;
}

    .kpi-badge.good {
        background: #198754;
        color: #fff;
        border-color: #198754;
    }

    .kpi-badge.bad {
        background: #dc3545;
        color: #fff;
        border-color: #dc3545;
    }

        .kpi-badge.good span, .kpi-badge.bad span {
            color: #fff;
        }

.tabla-vendedores th {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
}

.hdr-green {
    background: #90ee90 !important;
    color: #fff;
    font-weight: 700;
}

.hdr-orange {
    background: #ffb366 !important;
    color: #fff;
    font-weight: 700;
}

.hdr-purple {
    background: #483d8b !important;
    color: #fff;
    font-weight: 700;
}

.hdr-brown {
    background: #8b4513 !important;
    color: #fff;
    font-weight: 700;
}

.hdr-orange2 {
    background: #ffa500 !important;
    color: #fff;
    font-weight: 700;
}

.hdr-cadet {
    background: cadetblue !important;
    color: #fff;
    font-weight: 700;
}

.fila-valida td:nth-child(2) {
    background: #ffe4c4;
}
/* Bisque solo en nombre */

.kpi-green {
    background: #198754 !important;
    color: #fff;
    font-weight: 700;
}

.kpi-orange {
    background: #fd7e14 !important;
    color: #fff;
    font-weight: 700;
}

.kpi-red {
    background: #dc3545 !important;
    color: #fff;
    font-weight: 700;
}

.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.td-cuenta {
    white-space: nowrap;
}