
/* Fuentes */
@font-face {
    font-family: 'Franklin Gothic Demi Cond';
    src: url('../fonts/FRADMCN.TTF') format('truetype');
    font-weight: normal;
    font-style: normal;
}

html, body {
  height: 100%;
}

body {
    font-family: 'Franklin Gothic Demi Cond', sans-serif;
    font-size: 15px;
}

/* Color de los campos */
.input-purple {
    color: rgb(61, 0, 61);
    border: 2px solid purple;
    border-radius: 8px;
    box-shadow: 0 0 5px rgba(128, 0, 128, 0.5);
}

.input-purple:focus {
    outline: none;
    border-color: #800080;
    box-shadow: 0 0 8px rgba(128, 0, 128, 0.8);
}
  
.input-black {
    color: black;
    border: 2px solid black;
    border-radius: 8px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.input-black:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}

/* Tamaño de fuente */
.small-input {
    font-size: 0.75rem;
    height: 30px;
}
.small-label{
    font-size: 0.75rem;
}
.small-text {
    font-size: 0.75rem;
    color: rgb(61, 0, 61);;
}
.small-input_w {
    width: 40px !important;
    min-width: 0 !important;
    max-width: none !important;
    flex: 0 0 auto !important;
}
.small-input_w_1 {
    width: 60px !important;
    min-width: 0 !important;
    max-width: none !important;
    flex: 0 0 auto !important;
}
.size_head {
    font-size: smaller;
}
.size_body {
    font-size: smaller;
}

/* Formato a tabla del formulario de productos */
.table input {
    min-width: 80px;
}
.table th, .table td {
    vertical-align: middle;
}

.table-head-sm th {
    font-size: 14px;
    padding: 3px 6px;
    height: 24px;
    line-height: 1.1;
    vertical-align: middle;
    background-color: #000000;
}

/* Tabla para hacer scroll en la tabla de clientes */
    /* Para que la cabecera quede fija */
    .table-scroll thead th {
        position: sticky;
        top: 0;
        z-index: 2;
        background: #343a40;  /* Color del header */
        color: white;
    }

/* Estilos para la interfaz de informacion de pedido */

/* ------ ESTILO GENERAL ------ */
    .card-modern {
        border: none !important;
        border-radius: 14px;
        box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    }

    .label-title {
        font-size: 12px;
        font-weight: 600;
        color: #6c757d;
    }

    .input-clean {
        background: #f8f9fa !important;
        border: 1px solid #dee2e6 !important;
        height: 38px;
        border-radius: 6px;
    }

    .input-clean:focus {
        background: white !important;
        border-color: #0d6efd !important;
        box-shadow: 0 0 6px rgba(13,110,253,0.2);
    }

    /* ------ BUSCADOR ------ */
    #buscador {
        height: 40px;
        border-radius: 50px;
        padding-left: 18px;
        font-size: 15px;
    }

    #resultados {
        max-height: 210px;
        overflow-y: auto;
        border-radius: 10px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    }

    #resultados button {
        border: none;
        padding: 10px 14px;
        font-size: 14px;
        border-bottom: 1px solid #f0f0f0;
    }

    #resultados button:hover {
        background: #f8f9fa;
    }

    /* ------ TABLA ------ */
    .table-products th {
        background: #0d6efd !important;
        color: white !important;
        font-size: 13px;
        vertical-align: middle;
    }

    .table-products td {
        font-size: 13px;
        vertical-align: middle;
    }

    .table-products input {
        text-align: center;
        font-size: 13px;
    }

    /* ------ TOTAL ------ */
    .total-box {
        background: #fff0f0;
        border: 2px solid #dc3545;
        padding: 15px 20px;
        border-radius: 12px;
        font-size: 26px;
        font-weight: 700;
        color: #dc3545;
    }

    /* Barra de busqueda de captura de propuesta organizacion de datos */
    #resultados .list-group-item {
        cursor: pointer;
    }

    #resultados .list-group-item:hover {
        background-color: #f8f9fa;
    }

    mark {
        background-color: #fff3cd;
        padding: 0 2px;
    }

    /* ===== MODAL COMENTARIO ===== */

    .comentario-textarea {
        resize: none;
        border-radius: 10px;
        font-size: 0.9rem;
    }

    .comentario-textarea:focus {
        box-shadow: 0 0 0 .2rem rgba(13,110,253,.25);
        border-color: #0d6efd;
    }


    /* ===== MODAL HISTORICO ===== */

    .modal-historico {
        border-radius: 14px;
        box-shadow: 0 20px 40px rgba(0,0,0,.25);
    }

    .historico-table thead th {
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: .05em;
        color: #6c757d;
        border-bottom: 2px solid #dee2e6;
    }

    .historico-table tbody tr {
        transition: background .2s ease;
    }

    .historico-table tbody tr:hover {
        background-color: #f8f9fa;
    }

    .historico-table td {
        font-size: 0.85rem;
    }

    .historico-table td:last-child {
        font-weight: 600;
        color: #198754;
    }

    /* Precio */
    .historico-table td.precio {
        color: #0d6efd;
        font-weight: 500;
    }

    /* Responsive */
    @media (max-width: 768px) {
        .modal-historico .modal-body {
            padding: .75rem;
        }
    }

/* status del pedido */

    .status-badge {
        padding: 4px 10px;
        border-radius: 12px;
        font-size: 0.75rem;
        font-weight: 600;
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

    .status-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        display: inline-block;
    }

    .status-pendiente {
        background-color: #e0e0e0;
        color: #212121;
    }

    .status-pendiente .status-dot {
        background-color: #212121;
    }

    .status-enviado {
        background-color: #e3f2fd;
        color: #0d6efd;
    }
    .status-enviado .status-dot {
        background-color: #0d6efd;
    }

    .status-recibido {
        background-color: #fff3cd;
        color: #fd7e14;
    }
    .status-recibido .status-dot {
        background-color: #fd7e14;
    }

    .status-venta {
        background-color: #e6f4ea;
        color: #198754;
    }
    .status-venta .status-dot {
        background-color: #198754;
    }

    .status-cancelado {
        background-color: #fdecea;
        color: #dc3545;
    }
    .status-cancelado .status-dot {
        background-color: #dc3545;
    }

/* diseño de la barra de navegacion */

    .navbar {
        position: relative;
        z-index: 1050;
    }

    .navbar .dropdown-menu {
        z-index: 1060;
    }

/* NAV LINKS */
.navbar .nav-link {
    font-weight: 500;
    transition: all 0.2s ease;
}

.navbar .nav-link:hover {
    color: #e0e7ff !important;
}

/* DROPDOWN */
.dropdown-menu {
    border-radius: 12px;
    border: none;
}

.dropdown-item {
    border-radius: 8px;
    padding: 8px 14px;
}

.dropdown-item:hover {
    background-color: #f1f5f9;
}

/* AVATAR USUARIO */
.avatar-circle {
    width: 32px;
    height: 32px;
    background: #2563eb;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}
/* BOTONES DE BARRA DE BUSQUEDA DE NUEVO PEDIDO */

/* ITEM */
.product-item {
    padding: 10px 12px;
    border-bottom: 1px solid #e9ecef;
}

/* TEXTO */
.product-info strong {
    font-size: 0.95rem;
}

.product-info small {
    font-size: 0.8rem;
}

/* CONTENEDOR DERECHO */
.product-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* PRECIO VERDE */
.product-price-green {
    min-width: 90px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: #0f5132;
    background-color: #d1e7dd;
    border: 1px solid #badbcc;
    padding: 4px 8px;
    border-radius: 6px;
}

/* BOTÓN AZUL */
.btn-add-blue {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    border: none;
    background-color: #0d6efd;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

/* ICONO */
.btn-add-blue i {
    font-size: 16px;
}

/* HOVER */
.btn-add-blue:hover {
    background-color: #0b5ed7;
    transform: scale(1.05);
}

/* CLICK */
.btn-add-blue:active {
    transform: scale(0.95);
}

/* AQUI SERA AGREGADO LO RESPONSIVO */

@media (max-width: 1024px) and (min-width: 768px) {

    .table-scroll {
        max-height: 750px;
        overflow-y: auto;
        overflow-x: auto;
    }

    .table-responsive-custom {
        min-width: 1000px;   /* ESTO ES LO QUE FUERZA EL SCROLL */
    }
}


/* =========================================
   TABLET VERTICAL (PEDIDOS)
========================================= */
@media (max-width: 1024px) and (orientation: portrait) {

    
    /* =============================
       MODAL HISTÓRICO MÁS ANCHO
    ============================= */
    .modal-historico-wide {
        max-width: 98vw !important;
        width: 98vw !important;
        margin: 0 auto;
    }

    .modal-historico-wide .modal-content {
        border-radius: 10px;
    }

    /* =============================
       SCROLL HISTÓRICO
    ============================= */
    .historico-scroll {
        max-height: 35vh;
        overflow-y: auto;
    }

    .historico-table thead th {
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 10;
    }

    /* SCROLL DE TABLA */
    .table-scroll {
        max-height: 950px;
        overflow-y: auto;
        overflow-x: auto;
    }

    .table-responsive-custom {
        min-width: 1100px;
    }

    /* TEXTO GENERAL TABLA */
    .table-responsive-custom th,
    .table-responsive-custom td {
        white-space: nowrap;
        font-size: 0.9rem;
    }

    /* ===== CELDAS SIN ESPACIO ===== */
    .table-products th,
    .table-products td {
        padding: 1px 2px !important;
        vertical-align: middle;
    }

    .producto-nombre {
        font-size: 0.8rem;
    }

    /* ===== INPUTS COMPACTOS ===== */
    .table-products .form-control,
    .table-products .form-control-sm {
        margin: 0 !important;
        height: 24px !important;
        padding: 2px 3px !important;
        font-size: 0.8rem;
        line-height: 1;
    }

    /* ===== ANCHOS DE COLUMNAS ===== */

    /* PRECIO */
    .table-products .precio {
        width: 65px !important;
        min-width: 65px;
        max-width: 65px;
        text-align: right;
    }

    /* CANT / BON */
    .table-products .cantidad,
    .table-products .bon {
        width: 40px !important;
        min-width: 40px;
        max-width: 40px;
        text-align: center;
    }

    /* DESCUENTOS */
    .table-products .d1,
    .table-products .d2 {
        width: 40px !important;
        min-width: 40px;
        max-width: 40px;
        text-align: center;
    }

    /* SUBTOTAL / IMPORTE */
    .table-products .subtotal-input,
    .table-products .importe-input {
        width: 65px !important;
        min-width: 65px;
        max-width: 65px;
        text-align: right;
    }

    /* ===== PRODUCTO ===== */
    .producto-nombre {
        font-size: 0.7rem;
        line-height: 1.1;
        margin-bottom: 2px;
    }

    /* ===== BOTONES ACCIONES ===== */
    .producto-acciones button {
        padding: 2px 4px;
        font-size: 0.7rem;
    }
}


/* ESTE QUERY SE USARA DE FORMA HORIZONTAL LA TABLETA */

@media (max-width: 1024px) and (orientation: landscape) {

    .table-scroll {
        max-height: 120px;
        overflow-y: auto;
        overflow-x: auto;
    }

    .table-responsive-custom {
        min-width: 900px;
    }
}

/* TABLA DE PRODUCTOS PARA CAPTURAD DE PROPUESTA */

/* CONTENEDOR GENERAL */
.productos-wrapper {
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    background: #fff;
}

/* HEADER FIJO */
.productos-header {
    background: #e0e0e0;
    padding: 8px;
    font-size: 14px;
    border-bottom: 1px solid #cfcfcf;
}

/* SCROLL INTERNO */
.productos-body {
    max-height: 320px;      /* ← aquí ganas espacio */
    overflow-y: auto;
}

/* TABLA COMPACTA */
.table-products th {
    position: sticky;
    top: 0;
    background: #0d6efd;
    color: white;
    font-size: 12px;
    padding: 6px;
    z-index: 2;
}

.table-products td {
    padding: 2px;
    vertical-align: middle;
    font-size: 12px;
}

/* INPUTS PEQUEÑOS */
.table-products input {
    padding: 2px 2px;
    font-size: 12px;
    height: 26px;
}

/* BOTONES PEQUEÑOS */
.table-products .btn {
    padding: 2px 6px;
    font-size: 12px;
}

.total-box {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 10px;
    margin-top: 20px;
    font-weight: bold;
}


/* =========================================
   MODAL PRODUCTOS (usa reglas del histórico)
========================================= */

.modal-productos .modal-content {
    max-height: 90vh;
}

.modal-productos .modal-body {
    overflow-y: auto;
}

input:disabled {
    background-color: #f1f1f1;
    cursor: not-allowed;
}


/* 
 =====================================
 SELECION DE UBICACION PARA MAPA DE VISITAS
 =====================================
*/

#tablaVisitas tr:hover{

    background-color: #f1f1f1;
    cursor: pointer;

}

/* 
 =====================================
    INTERFAZ DE SELECCION DE UBICACION PARA MAPA DE VISITAS
 =====================================
*/

.active-status-bar {
    position: sticky;
    top: 0;
    z-index: 900;
    background: rgba(248, 250, 252, 0.96);
    border-bottom: 1px solid #e5e7eb;
    padding: 6px 16px;
}

.active-status-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.active-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 4px 8px 4px 10px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 0.86rem;
    line-height: 1.1;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.chip-pedido {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #7c2d12;
}

.chip-visita {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e3a8a;
}

.chip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
}

.chip-text {
    white-space: nowrap;
}

.chip-action {
    border: 0;
    border-radius: 5px;
    padding: 4px 8px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    line-height: 1;
}

.chip-action-primary {
    background: #2563eb;
    color: #fff;
}

.chip-action-primary:hover {
    background: #1d4ed8;
    color: #fff;
}

.chip-action-danger {
    background: #dc2626;
    color: #fff;
}

.chip-action-danger:hover {
    background: #b91c1c;
    color: #fff;
}

@media (max-width: 576px) {
    .active-status-bar {
        padding: 6px 8px;
    }

    .active-status-wrap {
        justify-content: stretch;
    }

    .active-chip {
        width: 100%;
        justify-content: space-between;
    }

    .chip-text {
        white-space: normal;
    }
}


/* ESTILOS PARA LA INTERFAZ DE CONSULTA DE VISITAS EN EL MAPA */

.visitas-page {
        height: calc(100vh - 80px);
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .visitas-title {
        font-size: 18px;
        font-weight: 700;
        margin: 0;
    }

    .visitas-filtros {
        background: #fff;
        border: 1px solid #dee2e6;
        border-radius: 6px;
        padding: 8px;
    }

    .visitas-filtros label {
        font-size: 11px;
        font-weight: 600;
        margin-bottom: 2px;
    }

    .visitas-filtros .form-control,
    .visitas-filtros .form-select,
    .visitas-filtros .btn {
        height: 30px;
        font-size: 12px;
        padding-top: 3px;
        padding-bottom: 3px;
    }

    .visitas-layout {
        flex: 1;
        min-height: 0;
        display: grid;
        grid-template-columns: minmax(0, 1.4fr) minmax(420px, 0.8fr);
        gap: 8px;
    }

    #map {
        height: 100%;
        min-height: 500px;
        border: 1px solid #dee2e6;
        border-radius: 6px;
        overflow: hidden;
    }

    .visitas-tabla {
        height: 100%;
        min-height: 500px;
        overflow-y: auto;
        border: 1px solid #dee2e6;
        border-radius: 6px;
        background: #fff;
    }

    .visitas-tabla th {
        font-size: 11px;
        padding: 4px 6px;
        position: sticky;
        top: 0;
        z-index: 2;
        vertical-align: middle;
        background-color: #212529 !important;
        color: #fff !important;
    }

    .visitas-tabla td {
        font-size: 11px;
        padding: 4px 6px;
        vertical-align: middle;
    }

    @media (max-width: 992px) {
        .visitas-page {
            height: auto;
        }

        .visitas-layout {
            grid-template-columns: 1fr;
        }

        #map,
        .visitas-tabla {
            height: 480px;
            min-height: 480px;
        }
    }


    /* ESTILOS PARA LA INTERFAZ DE PROMOCIONES */

    .promocion-scroll {
    max-height: 55vh;
    overflow-y: auto;
}

.promocion-table thead th {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
}

.promocion-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
}

.promocion-table tbody tr:hover {
    background: #f8fafc;
}

.vigencia-promo {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    font-size: 0.85rem;
    color: #374151;
}

.promocion-table td {
    vertical-align: middle;
}


/* ESTILOS PARA LAS FILAS CON PROMOCIONES */
.fila-promocion {
    cursor: pointer;
}

.fila-promocion > td {
    background-color: #d1fae5 !important;
}

.fila-promocion:hover > td {
    background-color: #bbf7d0 !important;
}

