/* =====================================================================
   Sistema de Gestión Comercial · style.css
   ---------------------------------------------------------------------
   Base: Bootstrap 5.3 + Bootstrap Icons (se cargan desde el layout).
   Acá solo va la identidad del sistema, tomada de las capturas:
     - barra superior y tarjetas de inicio: #0b6792
     - botones, tablas, insignias: estilos estándar de Bootstrap
   Un solo diseño responsive: en pantallas chicas las tablas se
   transforman en tarjetas y el menú pasa a ser hamburguesa.
   ===================================================================== */

:root {
    --sgc-marca: #0b6792;
    --sgc-marca-oscura: #084f70;
    --sgc-encabezado-tabla: #212529;
    --sgc-borde: #dee2e6;
    --sgc-apagado: #6c757d;
    --sgc-venta: #0d6efd;
    --sgc-costo: #dc3545;
    --sgc-ganancia: #198754;
    --sgc-radio: 0.6rem;
    --sgc-sombra: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ---------- Estructura general ---------- */
html { height: 100%; }

body {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    color: #212529;
}

main.contenido {
    flex: 1 0 auto;
    width: 100%;
    padding-bottom: 2.5rem;
}

.pie-sgc {
    flex-shrink: 0;
    border-top: 1px solid var(--sgc-borde);
    padding: 1rem 0;
    color: var(--sgc-apagado);
    font-size: 0.95rem;
}

/* ---------- Barra superior ---------- */
.barra-sgc {
    background: var(--sgc-marca);
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}

.barra-sgc .navbar-brand {
    font-weight: 700;
    font-size: 1.2rem;
    margin-right: 1.25rem;
}

.barra-sgc .nav-link {
    color: rgba(255, 255, 255, 0.92);
    padding: 0.45rem 0.6rem;
}

.barra-sgc .nav-link:hover,
.barra-sgc .nav-link:focus-visible {
    color: #fff;
}

.barra-sgc .nav-link.active {
    color: #fff;
    font-weight: 600;
    box-shadow: inset 0 -3px 0 rgba(255, 255, 255, 0.85);
}

.barra-sgc .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.4);
}

.barra-sgc .dropdown-item {
    padding: 0.5rem 1rem;
}

/* Menú desplegado en pantallas chicas: filas separadas por una línea fina */
@media (max-width: 1199.98px) {
    .barra-sgc .navbar-collapse {
        margin-top: 0.5rem;
    }
    .barra-sgc .navbar-collapse .nav-link {
        padding: 0.7rem 0.5rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    }
    .barra-sgc .nav-link.active {
        box-shadow: none;
        background: rgba(255, 255, 255, 0.12);
    }
}

/* ---------- Encabezado de cada pantalla ---------- */
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin: 1.5rem 0 1rem;
}

.page-title {
    margin: 0;
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.2;
}

@media (max-width: 767.98px) {
    .page-title { font-size: 1.6rem; }
}

/* Barra de búsqueda / filtros */
.filtro {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.filtro .form-control,
.filtro .form-select {
    flex: 1 1 220px;
    max-width: 380px;
}

/* ---------- Tarjetas ---------- */
.tarjeta {
    background: #fff;
    border: 1px solid var(--sgc-borde);
    border-radius: var(--sgc-radio);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--sgc-sombra);
}

.form-angosto { max-width: 520px; }
.form-ancho { max-width: 860px; }

.tarjeta-tabla { padding: 0.75rem 1rem; }

/* ---------- Pantalla de inicio (mosaico de módulos) ---------- */
.frase-inicio {
    text-align: center;
    margin: 1.75rem auto 0;
    max-width: 34rem;
    font-size: 1.25rem;
    line-height: 1.4;
    color: #555;
}

.tarjetas-inicio {
    --separacion: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--separacion);
    max-width: 1000px;
    margin: 2rem auto 1rem;
}

.tarjeta-inicio {
    flex: 0 0 calc((100% - 3 * var(--separacion)) / 4);
    min-height: 170px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 1.1rem;
    background: var(--sgc-marca);
    color: #fff;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    transition: background-color 0.15s ease;
}

.tarjeta-inicio .bi { font-size: 2.75rem; line-height: 1; }

.tarjeta-inicio:hover { background: var(--sgc-marca-oscura); color: #fff; }

.tarjeta-inicio:focus-visible {
    outline: 3px solid #ffc107;
    outline-offset: 3px;
}

/* Celular: dos columnas; la última tarjeta suelta queda centrada (flex) */
@media (max-width: 767.98px) {
    .tarjetas-inicio { --separacion: 0.75rem; margin-top: 1.25rem; }
    .tarjeta-inicio {
        flex-basis: calc((100% - var(--separacion)) / 2);
        min-height: 125px;
        gap: 0.7rem;
        font-size: 1rem;
    }
    .tarjeta-inicio .bi { font-size: 2.2rem; }
    .frase-inicio { margin-top: 1.5rem; font-size: 1.15rem; }
}

/* ---------- Tablas ---------- */
.tabla-sgc {
    margin-bottom: 0;
    vertical-align: middle;
}

.tabla-sgc > thead > tr > th {
    background: var(--sgc-encabezado-tabla);
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
    border-bottom: 0;
}

.tabla-sgc > tbody > tr:hover > * {
    --bs-table-bg-state: #f8f9fa;
}

.tabla-sgc .acciones {
    white-space: nowrap;
    display: table-cell;
}

.tabla-sgc .acciones .btn { margin: 0.1rem 0.15rem 0.1rem 0; }

.fila-vacia td {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--sgc-apagado);
}

/* Celular: cada fila de la tabla se convierte en una tarjeta.
   Requiere data-label="Nombre de la columna" en cada <td>. */
@media (max-width: 767.98px) {
    .tarjeta-tabla {
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .table.tabla-cards,
    .table.tabla-cards > tbody {
        display: block;
        background: transparent;
    }

    .table.tabla-cards > thead { display: none; }

    .table.tabla-cards > tbody > tr {
        display: block;
        background: #fff;
        border: 1px solid var(--sgc-borde);
        border-radius: var(--sgc-radio);
        box-shadow: var(--sgc-sombra);
        padding: 0.7rem 0.9rem;
        margin-bottom: 0.75rem;
    }

    .table.tabla-cards > tbody > tr > td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
        padding: 0.3rem 0;
        border: 0;
        text-align: right;
        background: transparent;
        box-shadow: none;
    }

    .table.tabla-cards > tbody > tr > td::before {
        content: attr(data-label);
        flex-shrink: 0;
        font-weight: 600;
        color: var(--sgc-apagado);
        text-align: left;
    }

    .table.tabla-cards > tbody > tr > td.acciones {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 0.4rem;
        padding-top: 0.6rem;
        margin-top: 0.3rem;
        border-top: 1px solid var(--sgc-borde);
    }

    .table.tabla-cards > tbody > tr > td.acciones::before { content: none; }
    .table.tabla-cards > tbody > tr > td.acciones .btn { margin: 0; }

    .table.tabla-cards .fila-vacia {
        text-align: center;
        padding: 1.5rem 1rem;
    }
    .table.tabla-cards .fila-vacia td { display: block; text-align: center; }
    .table.tabla-cards .fila-vacia td::before { content: none; }
}

/* ---------- Valores monetarios y resúmenes ---------- */
.valor-venta { color: var(--sgc-venta); }
.valor-costo { color: var(--sgc-costo); }
.valor-ganancia { color: var(--sgc-ganancia); font-weight: 600; }

.resumen {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem;
    text-align: center;
}

.resumen-titulo { font-weight: 600; margin-bottom: 0.25rem; }
.resumen-valor { font-size: 1.8rem; font-weight: 600; line-height: 1.2; }

/* Ficha de datos (pantallas "Ver") */
.ficha {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem 1.5rem;
    margin-bottom: 1rem;
}

.ficha dt { font-size: 0.85rem; font-weight: 600; color: var(--sgc-apagado); }
.ficha dd { margin: 0; font-size: 1.1rem; }

/* ---------- Estados vacíos y errores ---------- */
.estado-vacio {
    text-align: center;
    max-width: 30rem;
    margin: 4rem auto;
}

.estado-vacio .bi { font-size: 3rem; color: var(--sgc-apagado); }
.estado-vacio .page-title { margin: 0.75rem 0; font-size: 1.6rem; }
.estado-vacio p { color: var(--sgc-apagado); }

/* ---------- Acceso (login / configuración inicial) ---------- */
.pagina-acceso {
    background: var(--sgc-marca);
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
}

.acceso { width: 100%; max-width: 420px; }

.acceso-marca {
    color: #fff;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.acceso-tarjeta {
    background: #fff;
    border-radius: 1rem;
    padding: 1.75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.acceso-titulo { font-size: 1.35rem; font-weight: 600; margin-bottom: 1.25rem; }

/* ---------- Botón flotante "Inicio" (celular) ---------- */
.fab-inicio {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1030;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--sgc-marca);
    color: #fff;
    font-size: 1.6rem;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.fab-inicio:hover { background: var(--sgc-marca-oscura); color: #fff; }
.fab-inicio:focus-visible { outline: 3px solid #ffc107; outline-offset: 3px; }

@media (max-width: 767.98px) {
    .fab-inicio { display: flex; }
    main.contenido { padding-bottom: 5rem; } /* que el botón no tape contenido */
}

/* ---------- Comprobantes (pedido, remito): se ven como hoja y se imprimen ---------- */
.comprobante {
    max-width: 640px;
    margin: 1.5rem auto;
    padding: 2rem;
    background: #fff;
    border: 2px solid #555;
}

.comprobante h1 { text-align: center; font-size: 2.2rem; font-weight: 600; margin: 0; }
.comprobante .comprobante-numero { text-align: center; font-size: 1.5rem; font-weight: 600; }
.comprobante .comprobante-pie { font-style: italic; color: var(--sgc-apagado); font-size: 0.9rem; }

@media (max-width: 575.98px) {
    .comprobante { padding: 1rem; }
    .comprobante h1 { font-size: 1.6rem; }
}

@media print {
    .barra-sgc,
    .pie-sgc,
    .fab-inicio,
    .no-imprimir,
    .contenido .container > .alert { display: none !important; }

    body { background: #fff; }
    main.contenido { padding: 0; }
    .comprobante { border: 2px solid #000; margin: 0 auto; max-width: none; }
}

/* ---------- Auditoría (tabla densa, para usar en las pantallas siguientes) ---------- */
.tabla-auditoria { font-size: 0.85rem; }
.tabla-auditoria td, .tabla-auditoria th { padding: 0.3rem 0.5rem; }

/* ---------- Accesibilidad ---------- */
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; scroll-behavior: auto !important; }
}


/* =====================================================================
   Etapa 2: clientes, productos, pedidos, remitos, reportes, auditoría
   ===================================================================== */

/* ---------- Datos en modo lectura (ficha de cliente, pedido) ---------- */
.dato-lectura-titulo { font-weight: 600; margin-bottom: 0.25rem; }

.dato-lectura,
.campo-lectura {
    background: #f8f9fa;
    border: 1px solid var(--sgc-borde);
    border-radius: 0.4rem;
    padding: 0.45rem 0.75rem;
    min-height: 2.4rem;
}

.dato-lectura-alto,
.campo-lectura-alto { min-height: 4.5rem; }

.posicion-relativa { position: relative; }

.fila-inactiva td { color: var(--sgc-apagado); }
.fila-anulada td { color: var(--sgc-apagado); background: #f8f9fa; }

/* ---------- Sugerencias de dirección ---------- */
.sugerencias {
    position: absolute;
    left: calc(var(--bs-gutter-x, 1.5rem) * 0.5);
    right: calc(var(--bs-gutter-x, 1.5rem) * 0.5);
    z-index: 1040;
    margin: 0.15rem 0 0;
    padding: 0.25rem 0;
    list-style: none;
    background: #fff;
    border: 1px solid var(--sgc-borde);
    border-radius: 0.5rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    max-height: 18rem;
    overflow-y: auto;
}

.sugerencias li {
    padding: 0.65rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f3f5;
}

.sugerencias li:last-child { border-bottom: 0; }
.sugerencias li:hover,
.sugerencias li.activa { background: #e7f1f7; }

/* ---------- Precios calculados (formulario de producto) ---------- */
.precios-calculados {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    text-align: center;
    background: #f8f9fa;
    border: 1px solid var(--sgc-borde);
    border-radius: var(--sgc-radio);
    padding: 1rem;
}

/* ---------- Pedido: cabecera, acciones y totales ---------- */
.estado-pedido {
    background: #cff4fc;
    border: 1px solid #9eeaf9;
    color: #055160;
    border-radius: 0.4rem;
    padding: 0.7rem 1.1rem;
}

.barra-acciones {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.barra-acciones form { margin: 0; }

.resumen-valor-chico { font-size: 1.5rem; }

.tabla-detalle { margin-bottom: 0; vertical-align: middle; }
.tabla-detalle > thead > tr > th { border-bottom: 2px solid var(--sgc-borde); white-space: nowrap; }

@media (max-width: 767.98px) {
    /* En el celular los botones principales del pedido ocupan todo el ancho */
    .barra-acciones { flex-direction: column; }
    .barra-acciones .btn,
    .barra-acciones form .btn { width: 100%; }
    .page-head .estado-pedido { order: 3; width: 100%; }
}

/* ---------- Elegir cliente / agregar productos ---------- */
.lista-elegir { display: flex; flex-direction: column; gap: 0.6rem; }

.item-elegir {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #fff;
    border: 1px solid var(--sgc-borde);
    border-radius: var(--sgc-radio);
    box-shadow: var(--sgc-sombra);
    padding: 0.75rem 1rem;
    margin: 0;
}

.item-elegir-datos { min-width: 0; }
.precio-sugerido { font-weight: 600; color: var(--sgc-venta); }

.form-linea {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    flex-shrink: 0;
}

.form-linea input[type="number"] { width: 5.5rem; }
.form-linea .input-group { width: 7.5rem; }

@media (max-width: 767.98px) {
    .item-producto { flex-direction: column; align-items: stretch; }
    .form-linea { flex-wrap: wrap; }
    .form-linea input[type="number"] { flex: 1 1 5rem; width: auto; }
    .form-linea .input-group { flex: 1 1 6rem; width: auto; }
    .form-linea .btn { flex: 1 1 100%; }
    .item-elegir:not(.item-producto) .btn { min-width: 6rem; }
}

/* ---------- Fechas de filtro (reportes, auditoría) ---------- */
.filtro-fechas {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: flex-start;
}

.filtro-fechas .form-control { min-width: 11rem; }

.botones-reportes {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

@media (max-width: 767.98px) {
    .botones-reportes { flex-direction: column; }
    .filtro-fechas > div { flex: 1 1 100%; }
    .filtro-fechas .form-control { width: 100%; }
}

.panel-pendientes { border-color: #ffc107; }

.paginador {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

/* ---------- Comprobantes: ampliación para pedido y remito ---------- */
.comprobante hr { margin: 1rem 0; }
.comprobante-total { font-size: 2.1rem; font-weight: 700; line-height: 1.2; }

.tabla-comprobante > thead > tr > th { border-bottom: 1px solid #212529; }

.barra-comprobante {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 0 auto 1.5rem;
}

.barra-comprobante-arriba { margin-top: 1.25rem; margin-bottom: 0.5rem; }

/* ---------- Remito: original y duplicado ----------
   Si tiene hasta 10 productos, las dos copias entran en UNA hoja A4 (media hoja cada una).
   Con más productos, cada copia va en su propia hoja. */
.remito-hoja {
    max-width: 210mm;
    margin: 1rem auto 1.5rem;
    background: #fff;
    border: 1px solid var(--sgc-borde);
    box-shadow: var(--sgc-sombra);
    padding: 6mm;
}

.remito-copia {
    border: 1.5px solid #333;
    padding: 4mm 5mm;
    background: #fff;
    font-size: 0.82rem;
    line-height: 1.3;
}

.remito-hoja .remito-copia ~ .remito-copia { margin-top: 5mm; }

.remito-media .remito-copia:first-child { border-bottom-style: dashed; }

.rc-etiqueta-corte {
    text-align: center;
    font-size: 0.65rem;
    color: var(--sgc-apagado);
    margin: 1.5mm 0;
}

.rc-cabecera {
    display: grid;
    grid-template-columns: 30mm 1fr 30mm;
    align-items: center;
    gap: 3mm;
    padding-bottom: 2mm;
    border-bottom: 1px solid #999;
    margin-bottom: 2mm;
}

.rc-x {
    border: 1px solid #333;
    text-align: center;
    padding: 0.5mm 1mm;
}

.rc-x-letra { font-size: 1.5rem; font-weight: 800; line-height: 1; }
.rc-x-texto { font-size: 0.42rem; line-height: 1.15; color: #2a3a6a; }

.rc-titulo { text-align: center; }
.rc-remito { font-size: 1.35rem; font-weight: 700; line-height: 1.1; }
.rc-numero { font-size: 1.05rem; font-weight: 700; }
.rc-sub { font-size: 0.62rem; color: var(--sgc-apagado); }

.rc-copia { text-align: right; font-size: 0.68rem; line-height: 1.25; }
.rc-copia strong { font-size: 0.78rem; letter-spacing: 0.03em; }

.rc-datos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5mm 4mm;
    margin-bottom: 2mm;
}

.rc-datos .rc-ancho { grid-column: 1 / -1; }

.rc-tabla { width: 100%; border-collapse: collapse; margin-bottom: 1.5mm; }
.rc-tabla th { border-bottom: 1px solid #333; font-weight: 700; padding: 0.4mm 1mm; text-align: left; }
.rc-tabla td { border-bottom: 1px solid #ddd; padding: 0.4mm 1mm; }
.rc-tabla .der { text-align: right; white-space: nowrap; }
.rc-tabla .cant { width: 11mm; text-align: center; }

.rc-pie {
    display: grid;
    grid-template-columns: 1fr 48mm;
    gap: 4mm;
    align-items: end;
    margin-top: 2mm;
}

.rc-firma-titulo { font-size: 0.68rem; font-weight: 600; margin-bottom: 7mm; }

.rc-firma-lineas {
    display: grid;
    grid-template-columns: 2fr 2fr 1.2fr 1.2fr;
    gap: 3mm;
}

.rc-firma-lineas > div { border-top: 1px solid #333; padding-top: 0.3mm; font-size: 0.62rem; color: var(--sgc-apagado); }

.rc-total { text-align: right; }
.rc-total-etiqueta { font-size: 0.65rem; font-weight: 700; }
.rc-total-valor { font-size: 1.25rem; font-weight: 800; color: var(--sgc-ganancia); line-height: 1.15; }

@media (max-width: 575.98px) {
    .remito-hoja { padding: 2mm; }
    .rc-cabecera { grid-template-columns: 22mm 1fr; }
    .rc-copia { grid-column: 1 / -1; text-align: center; }
    .rc-pie { grid-template-columns: 1fr; }
    .rc-total { text-align: left; }
}

@media print {
    @page { size: A4 portrait; margin: 8mm; }

    .remito-hoja {
        max-width: none;
        margin: 0;
        padding: 0;
        border: 0;
        box-shadow: none;
    }

    .remito-copia { font-size: 9.5pt; break-inside: avoid; page-break-inside: avoid; }

    /* Dos copias en una hoja: cada una ocupa media hoja */
    .remito-media .remito-copia { min-height: 136mm; box-sizing: border-box; }
    .remito-hoja .remito-copia ~ .remito-copia { margin-top: 4mm; }

    /* Muchos productos: una copia por hoja */
    .remito-completo .remito-copia { break-after: page; page-break-after: always; }
    .remito-completo .remito-copia:last-child { break-after: auto; page-break-after: auto; }

    .barra-comprobante { display: none !important; }
}

/* ---------- Liquidaciones ---------- */
.saldo-proveedor {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 2rem;
}

.saldo-pendiente { background: #fff8e1; border-color: #ffe08a; }
.saldo-cero { background: #f1faf4; border-color: #b7e4c7; }

.chips-pedidos { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chips-pedidos .badge { font-size: 0.9rem; font-weight: 500; text-decoration: none; color: var(--sgc-marca); }

/* ---------- Backups ---------- */
.estado-backup-ok { background: #f1faf4; border-color: #b7e4c7; }
.estado-backup-alerta { background: #fff8e1; border-color: #ffe08a; }

.comando-cron {
    background: #212529;
    color: #f8f9fa;
    border-radius: 0.4rem;
    padding: 0.75rem 1rem;
    overflow-x: auto;
    margin-bottom: 0.5rem;
}
.comando-cron code { color: inherit; white-space: pre; }

/* ---------- Pedido: total final manual y ajuste en comprobantes ---------- */
.form-total-final {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-start;
}
.form-total-final > form:first-child { flex: 1 1 22rem; max-width: 30rem; }

.rc-ajuste { font-size: 0.65rem; color: var(--sgc-apagado); margin-bottom: 0.5mm; }

@media (max-width: 767.98px) {
    .form-total-final > form,
    .form-total-final .btn { width: 100%; }
    .form-total-final > form:first-child { max-width: none; }
}

/* ---------- Reportes: filtros de período ---------- */
.chips-periodo { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.9rem; }
.filtros-detalle { display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; margin-bottom: 0.9rem; }
.filtros-detalle .filtro-fechas { align-items: flex-end; }
.periodo-activo {
    background: #e7f1f7;
    border-radius: 0.4rem;
    padding: 0.5rem 0.8rem;
    color: #084f70;
}
@media (max-width: 767.98px) {
    .chips-periodo .btn { flex: 1 1 calc(50% - 0.5rem); }
    .filtros-detalle { flex-direction: column; }
}

/* ---------- Cobranzas, devoluciones y gastos ---------- */
.campo-cantidad { max-width: 6rem; }
@media (max-width: 767.98px) { .campo-cantidad { max-width: none; width: 7rem; } }

/* ---------- Modo pruebas ---------- */
.banner-pruebas {
    background: #dc3545;
    color: #fff;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
}

/* ---------- Reportes: criterio, simulador de precios, botones del comprobante en celular ---------- */
.selector-criterio { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.5rem; }
.tabla-sim:not(.con-sim) .col-sim { display: none !important; }
.simulador { max-width: 260px; }
.simulador .form-control { min-width: 5rem; }

@media (max-width: 767.98px) {
    .solo-pc { display: none !important; }
    .selector-criterio .btn { flex: 1 1 100%; }
    .barra-comprobante { flex-wrap: wrap; padding: 0 0.75rem; }
    .barra-comprobante .btn { flex: 1 1 calc(50% - 0.5rem); }
    .barra-comprobante [data-compartir-imagen] { flex-basis: 100%; padding: 0.7rem; font-size: 1.05rem; }
}

/* ---------- Rutas ---------- */
.cronograma { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.9rem; }
.dia-ruta {
    background: #fff;
    border: 1px solid var(--sgc-borde);
    border-radius: var(--sgc-radio);
    box-shadow: var(--sgc-sombra);
    padding: 0.9rem 1rem;
}
.dia-hoy { border-color: var(--sgc-venta); box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.2); }
.dia-ruta-titulo { font-weight: 700; margin-bottom: 0.5rem; }
.item-ruta {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0.7rem;
    margin-bottom: 0.4rem;
    border-radius: 0.5rem;
    background: #e7f1f7;
    color: #084f70;
    text-decoration: none;
}
.item-ruta:hover { background: #d4e8f3; color: #084f70; }
.item-ruta span { font-size: 0.8rem; color: var(--sgc-apagado); }

/* Simulador de precios (Productos): compacto, sin partirse en dos renglones */
.filtro .simulador { flex: 0 0 auto; flex-wrap: nowrap; width: 15rem; max-width: 100%; }
.filtro .simulador .form-control { flex: 1 1 auto; min-width: 0; max-width: none; }
@media (max-width: 767.98px) {
    .filtro .simulador { flex: 1 1 100%; width: auto; }
}
