/* ==========================================================================
   ESTILOS GENERALES Y LAYOUT BASE
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    display: flex;
    /* En celular, 100vh mide la pantalla CON la barra de direcciones oculta,
       asi que la pagina queda mas alta que lo visible: se alcanza a desplazar
       y el contenido centrado cae por debajo del pliegue. 100svh mide el area
       realmente visible. El 100vh queda de respaldo para navegadores viejos. */
    min-height: 100vh;
    min-height: 100svh;
    background-color: #2A2312;
    overflow-x: hidden;
    position: relative;
}

/* ==========================================================================
   DESKTOP: SEMICÍRCULO IZQUIERDO Y BRANDING
   ========================================================================== */
.circle-container {
    position: fixed;
    top: -10vh;
    left: -15vw;
    width: 55vw;
    height: 120vh;
    background: linear-gradient(135deg, #c97500, #ffbb5b);
    border-radius: 0 50% 50% 0;
    z-index: 1;
    box-shadow: 10px 0 30px rgba(255, 85, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 10vw; /* Centrado visual dentro de la curva */
}

.brand-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: #ffffff;
    z-index: 2;
    max-width: 320px;
}

.brand-logo {
    width: 140px;
    height: auto;
    object-fit: contain;
    margin-bottom: 1.25rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
    transition: all 0.3s ease;
}

.brand-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    line-height: 1.3;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: opacity 0.3s ease;
}

/* ==========================================================================
   FORMULARIO Y TARJETA DE ACCESO
   ========================================================================== */
.login-wrapper {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
    padding-right: 12%;
}

.login-card {
    background: #ffffff;
    padding: 2.5rem 2.25rem;
    border-radius: 18px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 400px;
}

.login-header {
    margin-bottom: 2rem;
}

.login-header h2 {
    color: #1a1a1a;
    font-size: 1.75rem;
    font-weight: 700;
}

.login-header p {
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 0.35rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
}

.form-group input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 9px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    outline: none;
}

.form-group input:focus {
    border-color: #ff5500;
    box-shadow: 0 0 0 3px rgba(255, 85, 0, 0.15);
}

.btn-submit {
    width: 100%;
    padding: 0.85rem;
    background: linear-gradient(135deg, #ffbb5b, #c97500);
    color: #ffffff;
    border: none;
    border-radius: 9px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    margin-top: 0.5rem;
}

.btn-submit:hover {
    background: #d48b25;
}

.btn-submit:active {
    transform: scale(0.99);
}

/* ==========================================================================
   RESPONSIVO: MÓVIL Y TABLET EN VERTICAL
   La tablet en vertical usa el mismo diseño apilado del celular; en
   horizontal se queda con el diseño de escritorio.
   ========================================================================== */
@media (max-width: 768px), (max-width: 1024px) and (orientation: portrait) {
    body {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 2rem 1rem;
    }

    /* Transformación a Círculo Completo Pequeño centrado sobre la Card */
    .circle-container {
        position: relative;
        top: 0;
        left: 0;
        width: 100px;
        height: 100px;
        border-radius: 50%; /* Círculo perfecto */
        padding-left: 0;
        margin-bottom: -45px; /* Sombra/flotado encajado sobre el card */
        box-shadow: 0 8px 20px rgba(255, 85, 0, 0.3);
        flex-shrink: 0;
    }

    .brand-content {
        max-width: 100%;
        justify-content: center;
    }

    /* Oculta el texto en móviles */
    .brand-title {
        display: none;
    }

    /* Ajusta el logo para encajar perfecto en el círculo de 100px */
    .brand-logo {
        width: 55px;
        height: 55px;
        margin-bottom: 0;
    }

    .login-wrapper {
        justify-content: center;
        padding-right: 0;
        width: 100%;
        max-width: 400px;
    }

    .login-card {
        padding-top: 3.75rem; /* Espacio interno para dar lugar al círculo superpuesto */
    }

    .login-header {
        text-align: center;
    }
}

/* ==========================================================================
   LOGIN EN PANTALLA ANCHA Y VERTICAL (600px - 1024px)
   Cubre la tablet en vertical y tambien al celular que abre la pagina con
   "Sitio de escritorio" activado: ahi el lienzo mide ~980px y la tarjeta de
   400px se veia diminuta, perdida en medio de la pantalla.
   Las proporciones del circulo se conservan (55% visible sobre la tarjeta).
   ========================================================================== */
@media (min-width: 600px) and (max-width: 1024px) and (orientation: portrait) {
    .login-wrapper {
        max-width: 560px;
    }

    .login-card {
        /* La regla base la limita a 400px: hay que subir el tope aqui tambien,
           no basta con ensanchar el contenedor. */
        max-width: 560px;
        padding: 3rem 2.75rem;
        padding-top: 4.75rem;
        border-radius: 22px;
    }

    .login-header {
        margin-bottom: 2.25rem;
    }

    .login-header h2 { font-size: 2.2rem; }
    .login-header p  { font-size: 1.05rem; }

    .form-group        { margin-bottom: 1.6rem; }
    .form-group label  { font-size: 1.05rem; }

    .form-group input {
        padding: 1rem 1.15rem;
        font-size: 1.15rem;
        border-radius: 12px;
    }

    .btn-submit {
        padding: 1.05rem;
        font-size: 1.2rem;
        border-radius: 12px;
    }

    .circle-container {
        width: 140px;
        height: 140px;
        margin-bottom: -63px;
    }

    .brand-logo {
        width: 77px;
        height: 77px;
    }
}

/* ==========================================================================
   LOGIN EN TABLET HORIZONTAL (769px - 1280px, apaisado)
   En estas pantallas el semicirculo de 120vh no alcanza a salirse por arriba
   y por abajo, asi que su curva queda visible dentro del encuadre y la marca
   se ve como una pelota flotando con esquinas oscuras. Aqui se convierte en
   un panel pegado a los bordes izquierdo, superior e inferior, y solo el
   lado derecho conserva la curva.
   ========================================================================== */
@media (min-width: 769px) and (max-width: 1280px) and (orientation: landscape) {
    .circle-container {
        top: 0;
        left: 0;
        width: 44vw;
        height: 100vh;
        border-radius: 0 45% 45% 0 / 0 50% 50% 0;
        padding-left: 0;
        box-shadow: 8px 0 24px rgba(255, 85, 0, 0.22);
    }

    .brand-content {
        max-width: 260px;
    }

    .brand-logo {
        width: 105px;
        margin-bottom: 1rem;
    }

    .brand-title {
        font-size: 1.2rem;
        letter-spacing: 1px;
    }

    .login-wrapper {
        padding-right: 6%;
    }

    .login-card {
        max-width: 370px;
        padding: 2rem 1.75rem;
    }

    .login-header {
        margin-bottom: 1.5rem;
    }
}

/* ==========================================
   LAYOUT GENERAL DEL DASHBOARD
   ========================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Paleta del panel: el fondo naranja del contenido y el gris carbón del menú.
   Los dos naranjas normalmente van juntos como degradado (claro -> oscuro).
   La opción activa del menú usa el naranja oscuro liso, igual que el fondo,
   para verse como una "pestaña" que sale del contenido. */
:root {
    --ga-naranja-claro: #ffbb5b;
    --ga-naranja-oscuro: #c97500;
    --ga-carbon: #34373c;
    --ga-carbon-claro: #464a51;
    --ga-carbon-borde: #575b63;

    /* Un color por casa, el mismo en las etiquetas de búsqueda y en las
       gráficas del dashboard. Se revisaron para que se distingan entre sí
       también con daltonismo; si se agrega una casa, validar el color nuevo
       contra estos cuatro. */
    --casa-BNS01: #1976d2; /* Diplomex: azul */
    --casa-BNS02: #7b1fa2; /* Marcus: morado */
    --casa-BNS03: #08660b; /* La Jaladera: verde */
    --casa-BNS04: #c2185b; /* Ferra Cholulita: rosa */
}

body.dashboard-body {
    display: flex;
    min-height: 100vh;
    min-height: 100svh;
    background-color: var(--ga-naranja-oscuro);
}

/* --- SIDEBAR (PC y Tablets) --- */
/* position:fixed y no sticky: el body tiene overflow-x:hidden, lo que lo
   convierte en contenedor de scroll y hace que sticky no se comporte igual en
   todos los navegadores. Con fixed el menu no se mueve nunca; como sale del
   flujo, .main-content compensa con un margen del mismo ancho.
   Sin padding a la derecha: la pestaña activa llega al borde y se une con el
   fondo naranja del contenido. */
.sidebar {
    width: 240px;
    background-color: var(--ga-carbon);
    padding: 1.5rem 0 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    color: #ffffff;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 900;
}

/* Tarjeta gris independiente: no se une con el naranja del contenido. */
.user-profile {
    text-align: center;
    padding: 1.5rem 1rem 1.25rem;
    margin-right: 0.9rem;
    background-color: var(--ga-carbon-claro);
    border: 1px solid var(--ga-carbon-borde);
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.user-profile .brand-logo {
    width: 84px;
    margin-bottom: 0.75rem;
}

.user-profile h3 {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.user-profile p {
    font-size: 0.85rem;
    opacity: 0.9;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #f1f1f1;
    text-decoration: none;
    padding: 0.75rem 1.1rem;
    margin-right: 0.9rem;
    background-color: var(--ga-carbon-claro);
    border: 1px solid var(--ga-carbon-borde);
    border-radius: 14px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.sidebar-menu li a i {
    font-size: 1.2rem;
}

.sidebar-menu li:not(.active) a:hover {
    background-color: #52565e;
}

.sidebar-menu li a:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: -4px;
}

.sidebar-menu li.active a {
    position: relative;
    margin-right: 0;
    background-color: var(--ga-naranja-oscuro);
    border-color: transparent;
    border-radius: 14px 0 0 14px;
    box-shadow: none;
    color: #ffffff;
    font-weight: 600;
}

/* Esquinas invertidas: dos cuadritos transparentes pegados al borde derecho,
   arriba y abajo de la pestaña. Su sombra naranja rellena solo la parte fuera
   de la curva, así el gris del menú se ve redondeado al tocar el naranja. */
.sidebar-menu li.active a::before,
.sidebar-menu li.active a::after {
    content: '';
    position: absolute;
    right: 0;
    width: 20px;
    height: 20px;
    background: transparent;
    pointer-events: none;
}

.sidebar-menu li.active a::before {
    top: -20px;
    border-bottom-right-radius: 20px;
    box-shadow: 6px 6px 0 6px var(--ga-naranja-oscuro);
}

.sidebar-menu li.active a::after {
    bottom: -20px;
    border-top-right-radius: 20px;
    box-shadow: 6px -6px 0 6px var(--ga-naranja-oscuro);
}

.sidebar-menu li.menu-salir {
    margin-top: 1.5rem;
}

.sidebar-menu li.menu-salir a:hover {
    background-color: #8e2b25;
    border-color: #b3372f;
}

/* Cabecera con el usuario: solo existe en celular / tablet vertical. */
.mobile-header {
    display: none;
}

/* --- CONTENIDO PRINCIPAL --- */
.main-content {
    flex-grow: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-left: 240px;   /* hueco que deja el menu fijo */
}

.page-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--ga-carbon);
}

/* --- TARJETA DE FORMULARIO --- */
.card-form {
    background: #e0e0e0;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid #cccccc;
    padding: 2.5rem;
    width: 100%;
    max-width: 650px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #222222;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid #aaaaaa;
    background-color: #f7f7f7;
    font-size: 1rem;
    outline: none;
}

/* Flecha propia para los desplegables: la del navegador queda pegada al
   borde y no se puede mover. Con appearance:none se quita y se dibuja otra
   como fondo, a la distancia del borde que se quiera. */
select.form-control {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 2.75rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23444444' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 6 8 10.5 12.5 6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 14px;
    text-overflow: ellipsis;
    cursor: pointer;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-container input {
    padding-right: 2.75rem;
}

.search-container i.search-icon {
    position: absolute;
    right: 1rem;
    font-size: 1.2rem;
    color: #555555;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

/* Al escribir (el campo tiene el foco y se abre el teclado) el icono se
   quita para dejarle todo el ancho al texto. */
.search-container:focus-within i.search-icon {
    opacity: 0;
}

.btn-add {
    background-color: #08660b;
    color: #ffffff;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.product-summary-row {
    display: grid;
    grid-template-columns: 1fr 2fr 1.2fr;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
    text-align: left;
}

.summary-item h4 {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #333333;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-qty {
    width: 45px;
    height: 38px;
    text-align: center;
    border-radius: 8px;
    border: 1px solid #aaaaaa;
    background: #ffffff;
    font-size: 1rem;
    font-weight: 600;
}

.btn-remove {
    background-color: #e53935;
    color: #ffffff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
}

.card-footer-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
}

.total-price {
    font-size: 1.3rem;
    font-weight: 600;
}

.btn-save {
    background-color: #08660b;
    color: #ffffff;
    border: none;
    padding: 0.75rem 2.5rem;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
}

/* Ocultar barra móvil en escritorio */
.bottom-nav {
    display: none;
}

/* ==========================================
   DISEÑO RESPONSIVO: MÓVIL Y TABLET EN VERTICAL
   Misma regla que el login: vertical = diseño de celular (menú inferior),
   horizontal = diseño de escritorio (menú lateral).
   ========================================== */
@media (max-width: 768px), (max-width: 1024px) and (orientation: portrait) {
    /* La hoja del login centra el body y le pone padding en móvil; aquí se
       anula para que la cabecera quede arriba aunque la página sea corta. */
    body.dashboard-body {
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 0 0 92px; /* Margen para que el menú inferior no tape contenido */
    }

    /* Ocultar Sidebar lateral en celular */
    .sidebar {
        display: none;
    }

    /* CABECERA CON EL USUARIO (en lugar del recuadro del sidebar) */
    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 0.8rem;
        align-self: center;
        width: calc(100% - 2rem);
        max-width: 650px;
        margin-top: 1rem;
        padding: 0.65rem 0.7rem 0.65rem 1.25rem;
        background: #e0e0e0;
        border: 1px solid #cccccc;
        border-radius: 16px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    }

    .mobile-header-info {
        min-width: 0;
        text-align: right;
    }

    .mobile-header-info h3 {
        font-size: 1.05rem;
        font-weight: 700;
        line-height: 1.2;
        color: #222222;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-header-info p {
        font-size: 0.8rem;
        color: #555555;
    }

    .mobile-header-logo {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        width: 54px;
        height: 54px;
        background: linear-gradient(135deg, var(--ga-naranja-claro), var(--ga-naranja-oscuro));
        border-radius: 14px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    }

    .mobile-header-logo img {
        width: 72%;
        height: auto;
    }

    /* Aqui el menu lateral esta oculto, asi que no hay hueco que compensar. */
    .main-content {
        padding: 1rem;
        margin-left: 0;
    }

    .page-title {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }

    .card-form {
        padding: 1.5rem;
    }

    /* Reorganizar filas internas del producto */
    .product-summary-row {
        grid-template-columns: 1fr;
        gap: 1.2rem;
        background-color: #f0f0f0;
        padding: 1rem;
        border-radius: 12px;
    }

    /* MENÚ INFERIOR TIPO APP (Bottom Navigation) */
    .bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 64px;
        padding: 0 0.5rem;
        background-color: var(--ga-carbon);
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.25);
        z-index: 1000;
    }

    /* flex:1 reparte el ancho disponible en partes iguales. Con width:100%
       cada enlace pedia el ancho completo (6 x 100% = 600%) y el menu
       terminaba desbordando la pantalla. min-width:0 permite que encojan. */
    .bottom-nav a {
        color: #c3c5c9;
        text-decoration: none;
        font-size: 1.6rem;
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 1 1 0;
        min-width: 0;
        height: 100%;
        transition: color 0.2s ease;
    }

    .bottom-nav a:hover {
        color: #ffffff;
    }

    .bottom-nav a.bottom-nav-salir {
        color: #ff9e9e;
    }

    /* La opción activa es un cuadro naranja que sobresale de la barra. */
    .bottom-nav a.active {
        color: #ffffff;
    }

    .bottom-nav a.active i {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 54px;
        height: 54px;
        font-size: 1.8rem;
        background: linear-gradient(135deg, var(--ga-naranja-claro), var(--ga-naranja-oscuro));
        border-radius: 16px;
        box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
        transform: translateY(-14px);
    }

    /* Las tablas del detalle son mas anchas que un celular: se desplazan
       dentro de su propia caja en vez de estirar toda la pagina. */
    .tabla-detalle {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .tabla-detalle td:first-child,
    .tabla-detalle th:first-child {
        white-space: normal;
        min-width: 140px;
    }
}

/* En pantallas muy angostas los iconos se achican para que quepan los 6. */
@media (max-width: 360px) {
    .bottom-nav a {
        font-size: 1.35rem;
    }

    .bottom-nav a.active i {
        width: 46px;
        height: 46px;
        font-size: 1.55rem;
        border-radius: 14px;
    }
}
/* ===== VENTA: buscador de productos y renglones del ticket ===== */

.search-results {
    margin-top: 0.5rem;
    max-height: 280px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #aaaaaa;
    border-radius: 12px;
}

.search-result-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.7rem 1rem;
    background: none;
    border: none;
    border-bottom: 1px solid #eeeeee;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    color: #222222;
    -webkit-tap-highlight-color: transparent;
}

.search-result-item:focus-visible,
.venta-fila:focus-visible {
    outline: 2px solid #08660b;
    outline-offset: -2px;
}

.search-result-item:hover {
    background-color: #f0f7f0;
}

.search-result-item:last-child {
    border-bottom: none;
}

.res-nombre {
    display: block;
    font-weight: 600;
    color: #222222;
}

.res-meta {
    display: block;
    font-size: 0.8rem;
    color: #666666;
    margin-top: 0.15rem;
}

.res-precio {
    display: block;
    font-size: 0.85rem;
    color: #08660b;
    font-weight: 600;
    margin-top: 0.15rem;
}

.sin-resultados {
    padding: 0.9rem 1rem;
    color: #666666;
    margin: 0;
}

.venta-items {
    margin: 1.5rem 0;
}

.venta-vacia {
    text-align: center;
    color: #777777;
    padding: 1.5rem 0;
    margin: 0;
}

/* Botón "+ Nuevo producto" debajo de la lista: pieza fuera de catálogo. */
.venta-otro {
    margin: -0.75rem 0 1.5rem;
}

.btn-agregar-otro {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #ffffff;
    color: #08660b;
    border: 1px dashed #08660b;
    border-radius: 20px;
    padding: 0.5rem 1.1rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.btn-agregar-otro:hover {
    background: #eef3ee;
}

/* Precio final (bruto + %) que se ve mientras se teclea el precio. */
/* Casa y porcentaje del nuevo producto, lado a lado (se apilan si no caben). */
.otro-fila {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.otro-fila .form-group {
    flex: 1 1 140px;
}

.otro-final {
    font-size: 1.1rem;
    margin: 0 0 1rem;
}

.otro-final strong {
    color: #08660b;
}

/* Dos renglones alineados: arriba nombre / tipo de precio / cantidad /
   subtotal (el desplegable y la cantidad a la misma altura) y abajo la casa
   junto al precio unitario. */
.venta-item {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr) auto minmax(0, 0.9fr);
    grid-template-areas:
        "nombre precio   cantidad subtotal"
        "meta   unitario .        .";
    align-items: center;
    column-gap: 1rem;
    row-gap: 0.3rem;
    background: #f7f7f7;
    border: 1px solid #cccccc;
    border-radius: 12px;
    padding: 0.9rem 1rem;
    margin-bottom: 0.75rem;
}

.item-nombre {
    grid-area: nombre;
    font-weight: 600;
    margin: 0;
    color: #222222;
}

.item-meta {
    grid-area: meta;
    align-self: start;
    font-size: 0.8rem;
    color: #666666;
    margin: 0;
}

.item-precio {
    grid-area: precio;
    font-size: 0.85rem;
    font-weight: 600;
    color: #222222;
}

.item-unitario {
    grid-area: unitario;
    align-self: start;
    font-size: 0.8rem;
    color: #555555;
}

.input-cantidad {
    grid-area: cantidad;
    width: 60px;
}

.item-subtotal {
    grid-area: subtotal;
    text-align: right;
    font-weight: 700;
    font-size: 1.05rem;
    color: #08660b;
}

/* Quitar la pieza: una X roja montada en la esquina de la tarjeta, fuera
   de los datos para no confundirla con los controles de cantidad. */
.btn-quitar {
    position: absolute;
    top: -10px;
    right: -10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background-color: #e53935;
    color: #ffffff;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.btn-quitar:hover {
    background-color: #c62828;
}

.btn-quitar:active {
    transform: scale(0.92);
}

.btn-quitar:focus-visible {
    outline: 2px solid #08660b;
    outline-offset: 2px;
}

.aviso {
    padding: 0.8rem 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-weight: 500;
}

.aviso-ok {
    background-color: #e3f4e4;
    color: #08660b;
    border: 1px solid #08660b;
}

.aviso-error {
    background-color: #fdecea;
    color: #b71c1c;
    border: 1px solid #e53935;
}

/* Celular: nombre y casa arriba a todo lo ancho; debajo el desplegable junto
   a la cantidad y, en la línea siguiente, el precio unitario junto al
   subtotal. */
@media (max-width: 640px) {
    .venta-item {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "nombre   nombre"
            "meta     meta"
            "precio   cantidad"
            "unitario subtotal";
        row-gap: 0.35rem;
    }

    .item-nombre {
        padding-right: 0.75rem; /* que no quede debajo de la X */
    }

    .item-precio,
    .input-cantidad {
        margin-top: 0.5rem;
    }

    .input-cantidad {
        justify-self: end;
    }

    .btn-quitar {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
}

/* ===== HISTORIAL DE VENTAS ===== */

.card-historial {
    max-width: 900px;
}

.res-casa {
    display: inline-block;
    background: #08660b;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.1rem 0.45rem;
    border-radius: 6px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* Un color por casa para distinguirlas de un vistazo en la búsqueda. Todos
   dejan el texto blanco legible; una casa nueva sin color se queda en verde. */
.res-casa.casa-BNS01 { background: var(--casa-BNS01); }
.res-casa.casa-BNS02 { background: var(--casa-BNS02); }
.res-casa.casa-BNS03 { background: var(--casa-BNS03); }
.res-casa.casa-BNS04 { background: var(--casa-BNS04); }

.filtros {
    border-bottom: 1px solid #cccccc;
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
}

.filtros-rapidos {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.chip {
    background: #f7f7f7;
    border: 1px solid #aaaaaa;
    border-radius: 20px;
    padding: 0.4rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: inherit;
    color: #333333;
}

.chip:hover {
    background: #eaeaea;
}

/* :hover también, si no el gris del hover le gana y el chip activo se ve
   blanco sobre gris mientras el mouse sigue encima. */
.chip-activo,
.chip-activo:hover {
    background: #08660b;
    border-color: #08660b;
    color: #ffffff;
    font-weight: 600;
}

.filtros-rango {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
}

.campo-fecha label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    color: #333333;
}

.campo-fecha .form-control {
    width: auto;
    padding: 0.5rem 0.75rem;
}

.btn-filtrar {
    padding: 0.55rem 1.5rem;
    border-radius: 12px;
    font-size: 1rem;
}

/* Busqueda por cliente: va arriba de los filtros de fecha. */
.filtros-busqueda {
    margin-bottom: 1rem;
}

.filtros-busqueda .search-container {
    max-width: 420px;
}

/* El boton de limpiar ocupa el lugar de la lupa; cuando aparece (hay texto),
   la lupa se oculta para que no se encimen. */
.buscar-cliente-limpiar {
    position: absolute;
    right: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #e4e4e4;
    color: #333333;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.15s ease;
}

.buscar-cliente-limpiar:hover {
    background: #d2d2d2;
}

.search-container:has(.buscar-cliente-limpiar:not([hidden])) i.search-icon {
    opacity: 0;
}

.resumen-periodo {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: #444444;
}

.resumen-periodo strong {
    color: #08660b;
    font-size: 1.1rem;
}

.lista-ventas {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.venta-fila {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    width: 100%;
    text-align: left;
    background: #f7f7f7;
    border: 1px solid #cccccc;
    border-radius: 12px;
    padding: 0.9rem 1rem;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    color: #222222;
    -webkit-tap-highlight-color: transparent;
}

.venta-fila:hover {
    background: #f0f7f0;
    border-color: #08660b;
}

.venta-fila-cliente {
    font-weight: 600;
    margin: 0;
    color: #222222;
}

.icono-editable {
    color: #08660b;
    margin-left: 0.4rem;
    font-size: 0.9rem;
}

.venta-fila-meta {
    font-size: 0.8rem;
    color: #666666;
    margin: 0.2rem 0 0;
}

.venta-fila-derecha {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
    flex-shrink: 0;
}

.venta-fila-total {
    font-weight: 700;
    font-size: 1.1rem;
    color: #08660b;
}

.etiqueta {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.55rem;
    border-radius: 20px;
    text-transform: capitalize;
}

.etiqueta-pagado   { background: #e3f4e4; color: #08660b; border: 1px solid #08660b; }
.etiqueta-parcial  { background: #fff4e0; color: #a35c00; border: 1px solid #d98b00; }
.etiqueta-pendiente{ background: #fdecea; color: #b71c1c; border: 1px solid #e53935; }

/* ----- Modal de detalle ----- */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1000;
}

/* display:flex le gana al atributo hidden, hay que anularlo a mano. */
.modal[hidden] {
    display: none;
}

.modal-caja {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 680px;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-cerrar {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #555555;
    line-height: 1;
}

.detalle-titulo {
    margin: 0 0 1rem;
    color: #08660b;
}

.detalle-cabecera p {
    margin: 0.3rem 0;
    color: #333333;
}

.tabla-detalle {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
    font-size: 0.9rem;
}

.tabla-detalle th,
.tabla-detalle td {
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid #e0e0e0;
    text-align: left;
    vertical-align: top;
}

.tabla-detalle th {
    background: #f2f2f2;
    font-weight: 600;
}

.tabla-detalle .num {
    text-align: right;
}

.tabla-detalle tfoot td {
    border-bottom: none;
    border-top: 2px solid #08660b;
    font-size: 1rem;
}

.detalle-sub {
    display: block;
    font-size: 0.78rem;
    color: #777777;
    margin-top: 0.15rem;
}

.detalle-credito {
    background: #fffaf0;
    border: 1px solid #d98b00;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.detalle-credito h3 {
    margin: 0 0 0.5rem;
    color: #a35c00;
}

.lista-abonos {
    margin: 0.5rem 0 0;
    padding-left: 1.2rem;
    font-size: 0.9rem;
}

.detalle-acciones {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

@media (max-width: 640px) {
    .venta-fila {
        flex-direction: column;
        align-items: flex-start;
    }

    .venta-fila-derecha {
        align-items: flex-start;
        flex-direction: row;
    }

    .modal-caja {
        padding: 1.5rem 1rem;
    }

    .tabla-detalle {
        font-size: 0.8rem;
    }
}

/* ----- Auditoría de cambios ----- */

.detalle-auditoria {
    background: #f2f6ff;
    border: 1px solid #7a9cc6;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.detalle-auditoria h3 {
    margin: 0 0 0.5rem;
    color: #2c4a70;
}

.lista-auditoria {
    margin: 0;
    padding-left: 1.2rem;
    font-size: 0.88rem;
}

.lista-auditoria li {
    margin-bottom: 0.5rem;
}

.aud-campo {
    font-weight: 600;
    color: #2c4a70;
}

.aud-antes {
    color: #b71c1c;
    text-decoration: line-through;
}

.aud-despues {
    color: #08660b;
    font-weight: 600;
}

.detalle-acciones {
    gap: 0.75rem;
}

/* ----- Devoluciones (el negocio le debe dinero al cliente) ----- */

.etiqueta-devolucion {
    background: #ede7f6;
    color: #4527a0;
    border: 1px solid #5e35b1;
}

.detalle-devolucion {
    background: #f3effa;
    border: 1px solid #5e35b1;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.detalle-devolucion h3 {
    margin: 0 0 0.5rem;
    color: #4527a0;
}

.detalle-devolucion strong {
    color: #4527a0;
}

.aviso-devolucion {
    background-color: #f3effa;
    color: #4527a0;
    border: 1px solid #5e35b1;
}

.resumen-devolucion {
    color: #4527a0;
    font-weight: 600;
}

/* ===== GESTIÓN DE USUARIOS (solo admin) ===== */

.usuario-fila {
    cursor: default;
}

.usuario-fila:hover {
    background: #f7f7f7;
    border-color: #cccccc;
}

.usuario-inactivo {
    opacity: 0.65;
}

.etiqueta-admin {
    background: #fdf0e6;
    color: #b34700;
    border: 1px solid #d9531e;
}

.usuario-etiquetas,
.usuario-acciones {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.usuario-acciones {
    margin-top: 0.4rem;
}

.chip-peligro {
    border-color: #e53935;
    color: #b71c1c;
}

.chip-peligro:hover {
    background: #fdecea;
}

#btn-nuevo {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* ----- Editar precio del catálogo desde el detalle ----- */

.btn-precio {
    font-size: 0.78rem;
    padding: 0.25rem 0.6rem;
    white-space: nowrap;
}

.aviso-info {
    background-color: #eef4fb;
    color: #1c4b7a;
    border: 1px solid #7a9cc6;
    font-weight: 400;
}

/* Algo que conviene atender pero no impide seguir: por ejemplo, un cliente al
   que le faltan datos cuando se va a imprimir su nota. */
.aviso-alerta {
    background-color: #fdf3e2;
    color: #8a5a10;
    border: 1px solid #d9a441;
    font-weight: 400;
}

/* Casilla con su texto en la misma línea (p. ej. "Reiniciar contraseña").
   Se anula el estilo de ".form-group input", pensado para campos de texto; el
   tamaño va en em para que crezca junto con la etiqueta en tablet. */
.form-group .check-linea {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0;
    cursor: pointer;
}

.form-group .check-linea input {
    width: 1.2em;
    height: 1.2em;
    padding: 0;
    margin: 0;
    accent-color: #ff5500;
    cursor: pointer;
}

/* ===== DASHBOARD (estadísticas) ===== */

/* Las gráficas van sobre tarjetas casi blancas; los colores de las series y
   los textos de las gráficas se leen de aquí desde estadisticas.js. */
.main-dashboard {
    --dash-superficie: #fcfcfb;
    --dash-texto: #0b0b0b;
    --dash-texto-2: #52514e;
    --dash-tenue: #898781;
    --dash-reticula: #e1e0d9;
    --dash-eje: #c3c2b7;
    --dash-ventas: #c97500;
    --dash-sube: #d84315;
    --dash-baja: #0097a7;
    --dash-mejor: #006300;
    --dash-peor: #b71c1c;
}

.main-dashboard > * {
    width: 100%;
    max-width: 1280px;
}

.main-dashboard > .page-title {
    width: auto;
}

.card-form.dash-filtros {
    max-width: 1280px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
}

.dash-filtros .filtros-rapidos {
    margin-bottom: 0.9rem;
}

.dash-periodo {
    margin: 0.9rem 0 0;
    font-size: 0.85rem;
    color: #444444;
}

.dash-aviso {
    margin-bottom: 1.25rem;
}

/* Al volver a consultar se deja lo anterior atenuado en lugar de vaciarlo:
   así la página no brinca mientras llegan los datos nuevos. */
.dash-contenido {
    transition: opacity 0.15s ease;
}

.dash-contenido.cargando {
    opacity: 0.55;
    pointer-events: none;
}

/* ----- Indicadores ----- */

/* Seis indicadores: 3 x 2 normalmente y en una sola fila si la pantalla es
   muy ancha (así nunca queda uno solo colgando abajo). */
.kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

@media (min-width: 1700px) {
    .kpis {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

.kpi {
    background: var(--dash-superficie);
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    padding: 1rem 1.25rem;
    min-width: 0;
}

.kpi-etiqueta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--dash-texto-2);
}

.kpi-etiqueta i {
    font-size: 1.05rem;
}

.kpi-valor {
    margin: 0.35rem 0 0.2rem;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--dash-texto);
    overflow-wrap: anywhere;
}

.kpi-detalle {
    margin: 0;
    font-size: 0.8rem;
    color: var(--dash-texto-2);
}

.kpi-delta {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    font-weight: 600;
}

.kpi-delta.mejor { color: var(--dash-mejor); }
.kpi-delta.peor  { color: var(--dash-peor); }
.kpi-delta.igual { color: var(--dash-texto-2); }

.kpi-sube { color: var(--dash-sube); font-weight: 600; }
.kpi-baja { color: var(--dash-baja); font-weight: 600; }

/* ----- Ganancias (seccion nueva del dashboard, solo admin) ----- */
.ganancias-seccion {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--dash-reticula);
    transition: opacity 0.15s ease;
}

.ganancias-seccion.cargando {
    opacity: 0.55;
    pointer-events: none;
}

.ganancias-encabezado {
    margin-bottom: 1.25rem;
}

.ganancias-titulo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    color: var(--dash-texto);
}

.ganancias-titulo i {
    color: var(--dash-mejor);
}

/* Los 4 indicadores de ganancia ocupan todo el ancho en una sola fila. */
.kpis-ganancias {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1100px) {
    .kpis-ganancias {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ----- Tarjetas de gráficas ----- */

.dash-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.dash-card {
    background: var(--dash-superficie);
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    padding: 1.25rem 1.25rem 1rem;
    min-width: 0;
}

.dash-card-ancha {
    grid-column: 1 / -1;
}

.dash-card-cabecera {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.dash-card-titulo {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dash-texto);
}

.dash-card-sub {
    margin: 0.15rem 0 0;
    font-size: 0.8rem;
    color: var(--dash-texto-2);
}

.dash-card-acciones {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chip-mini {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.7rem;
    font-size: 0.8rem;
}

.chip-mini[aria-pressed="true"] {
    background: var(--ga-carbon);
    border-color: var(--ga-carbon);
    color: #ffffff;
}

/* Selector Piezas / Importe */
.segmentado {
    display: inline-flex;
    border: 1px solid #aaaaaa;
    border-radius: 20px;
    overflow: hidden;
    background: #f7f7f7;
}

.segmento {
    border: none;
    background: transparent;
    padding: 0.25rem 0.75rem;
    font-family: inherit;
    font-size: 0.8rem;
    color: #333333;
    cursor: pointer;
}

.segmento + .segmento {
    border-left: 1px solid #aaaaaa;
}

.segmento-activo {
    background: var(--ga-carbon);
    color: #ffffff;
    font-weight: 600;
}

.dash-leyenda {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: var(--dash-texto-2);
}

.dash-leyenda:empty {
    display: none;
}

.leyenda-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.leyenda-muestra {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* La altura incluye los ejes: Chart.js dibuja todo dentro del canvas. */
.dash-grafica {
    position: relative;
    height: 300px;
}

#grafica-productos {
    height: 420px;
}

.dash-grafica[hidden],
.dash-tabla[hidden] {
    display: none;
}

.dash-vacio {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 1rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--dash-texto-2);
    background: var(--dash-superficie);
}

.dash-vacio[hidden] {
    display: none;
}

/* ----- Tablas ----- */

.dash-tabla,
.tabla-scroll {
    overflow-x: auto;
}

.tabla-dash {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    color: var(--dash-texto);
}

.tabla-dash th,
.tabla-dash td {
    padding: 0.55rem 0.5rem;
    border-bottom: 1px solid var(--dash-reticula);
    text-align: left;
    vertical-align: middle;
}

.tabla-dash th {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--dash-texto-2);
    white-space: nowrap;
}

.tabla-dash .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.tabla-dash .col-ancha {
    min-width: 12rem;
}

.tabla-dash tbody tr:last-child td {
    border-bottom: none;
}

.tabla-dash .detalle-sub {
    color: var(--dash-texto-2);
}

.tabla-dash .res-casa {
    margin-left: 0;
}

.tabla-dash .kpi-sube,
.tabla-dash .kpi-baja {
    white-space: nowrap;
}

/* Barrita de proporción dentro de una celda (clientes, vendedores). */
.barra-celda {
    min-width: 90px;
    width: 30%;
}

.barra-pista {
    height: 6px;
    border-radius: 3px;
    background: #efeee9;
    overflow: hidden;
}

.barra-relleno {
    height: 100%;
    border-radius: 3px;
    background: var(--dash-ventas);
}

.tabla-vacia {
    margin: 0;
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.9rem;
    color: var(--dash-texto-2);
}

/* Aclaración al pie de una tabla recortada ("se listan los N más recientes"). */
.tabla-nota {
    margin: 0.6rem 0 0;
    font-size: 0.78rem;
    color: var(--dash-texto-2);
}

@media (max-width: 1100px) {
    .dash-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 768px), (max-width: 1024px) and (orientation: portrait) {
    .card-form.dash-filtros {
        padding: 1rem;
    }

    .kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .kpi {
        padding: 0.85rem 1rem;
    }

    .kpi-valor {
        font-size: 1.35rem;
    }

    .dash-card {
        padding: 1rem 0.85rem 0.85rem;
    }

    .dash-grafica {
        height: 260px;
    }

    #grafica-productos {
        height: 440px;
    }
}

/* En el celular la barrita de proporción sobra (el importe ya está en la
   fila) y los nombres pueden ocupar menos ancho. */
@media (max-width: 640px) {
    .tabla-dash .col-extra {
        display: none;
    }

    .tabla-dash .col-ancha {
        min-width: 9rem;
    }
}

@media (max-width: 360px) {
    .kpis {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ==========================================================================
   TABLET EN VERTICAL (769px - 1024px)
   Conserva el diseño apilado del celular, pero con los componentes bastante
   más grandes: en una pantalla de 10-13" los tamaños de teléfono se ven
   diminutos y obligan a forzar la vista.
   ========================================================================== */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {
    body.dashboard-body {
        padding-bottom: 135px;   /* el menú inferior es más alto aquí */
    }

    .main-content {
        padding: 2.5rem 1.5rem;
    }

    /* --- Cabecera con el usuario --- */
    .mobile-header {
        width: calc(100% - 3rem);
        max-width: 780px;
        margin-top: 1.5rem;
        padding: 1rem 1rem 1rem 1.75rem;
        gap: 1.1rem;
        border-radius: 24px;
    }

    .mobile-header-info h3 { font-size: 1.6rem; }
    .mobile-header-info p  { font-size: 1.15rem; }

    .mobile-header-logo {
        width: 80px;
        height: 80px;
        border-radius: 20px;
    }

    .page-title {
        font-size: 3.2rem;
        margin-bottom: 2rem;
    }

    .card-form {
        max-width: 780px;
        padding: 3rem 2.5rem;
        border-radius: 24px;
    }

    /* --- Formularios --- */
    .form-group {
        margin-bottom: 2.25rem;
    }

    .form-group label {
        font-size: 1.5rem;
        margin-bottom: 0.7rem;
    }

    /* Se nombra el elemento (input/select) porque la hoja del login trae
       ".form-group input", mas especifico que ".form-control": sin esto los
       campos de texto se quedaban chicos y solo crecian los desplegables. */
    .form-control,
    .form-group input.form-control,
    .form-group select.form-control {
        padding: 1.25rem 1.35rem;
        font-size: 1.4rem;
        border-radius: 16px;
    }

    /* La regla de arriba trae padding completo y le ganaba al espacio
       reservado para la flecha y para el icono de búsqueda. */
    select.form-control,
    .form-group select.form-control {
        padding-right: 3.75rem;
        background-position: right 1.35rem center;
        background-size: 20px;
    }

    .search-container input.form-control {
        padding-right: 3.75rem;
    }

    .search-container i.search-icon {
        font-size: 1.8rem;
        right: 1.35rem;
    }

    /* --- Resultados de la búsqueda --- */
    .search-results {
        max-height: 520px;
        border-radius: 16px;
    }

    .search-result-item {
        padding: 1.25rem 1.5rem;
    }

    .res-nombre  { font-size: 1.4rem; }
    .res-meta    { font-size: 1.1rem; margin-top: 0.3rem; }
    .res-precio  { font-size: 1.2rem; margin-top: 0.3rem; }
    .res-casa    { font-size: 0.95rem; padding: 0.2rem 0.7rem; }

    /* --- Piezas agregadas al ticket --- */
    /* Con la letra más grande el nombre del producto se partía en tres
       renglones, así que esa columna se lleva más ancho. */
    .venta-item {
        grid-template-columns: minmax(0, 2.4fr) minmax(0, 1.4fr) auto minmax(0, 0.85fr);
        padding: 1.4rem 1.25rem;
        column-gap: 1rem;
        row-gap: 0.4rem;
        border-radius: 16px;
    }

    .item-nombre     { font-size: 1.35rem; }
    .item-meta       { font-size: 1.1rem; }
    .item-precio     { font-size: 1.1rem; }
    .item-subtotal   { font-size: 1.5rem; }

    .input-qty {
        width: 78px;
        height: 56px;
        font-size: 1.4rem;
    }

    .btn-remove {
        width: 48px;
        height: 48px;
        font-size: 1.7rem;
    }

    .btn-quitar {
        top: -14px;
        right: -14px;
        width: 42px;
        height: 42px;
        font-size: 1.35rem;
        border-width: 3px;
    }

    /* --- Pie del formulario --- */
    .total-price {
        font-size: 2rem;
    }

    .btn-save {
        padding: 1.1rem 3.5rem;
        font-size: 1.5rem;
        border-radius: 26px;
    }

    .venta-vacia {
        font-size: 1.35rem;
        padding: 2.5rem 0;
    }

    .aviso {
        font-size: 1.25rem;
        padding: 1.25rem 1.4rem;
        border-radius: 14px;
    }

    /* --- Historial --- */
    .chip {
        font-size: 1.25rem;
        padding: 0.7rem 1.5rem;
        border-radius: 26px;
    }

    .campo-fecha label       { font-size: 1.2rem; }
    .resumen-periodo         { font-size: 1.3rem; }
    .resumen-periodo strong  { font-size: 1.6rem; }

    .venta-fila {
        padding: 1.4rem 1.5rem;
        border-radius: 16px;
    }

    .venta-fila-cliente { font-size: 1.4rem; }
    .venta-fila-meta    { font-size: 1.1rem; margin-top: 0.35rem; }
    .venta-fila-total   { font-size: 1.6rem; }
    .etiqueta           { font-size: 1rem; padding: 0.3rem 0.85rem; }

    /* --- Detalle de la venta --- */
    .modal-caja {
        max-width: 94vw;
        padding: 3rem 2.5rem;
        border-radius: 24px;
    }

    .modal-cerrar        { font-size: 2rem; }
    .detalle-titulo      { font-size: 2rem; }
    .detalle-cabecera p  { font-size: 1.3rem; margin: 0.45rem 0; }
    .tabla-detalle       { font-size: 1.25rem; }
    .detalle-sub         { font-size: 1.05rem; }
    .detalle-credito h3,
    .detalle-auditoria h3 { font-size: 1.5rem; }
    .lista-abonos,
    .lista-auditoria     { font-size: 1.15rem; }

    .tabla-detalle th,
    .tabla-detalle td {
        padding: 1rem 0.7rem;
    }

    .btn-precio {
        font-size: 1.05rem;
        padding: 0.45rem 1rem;
    }

    /* --- Menú inferior --- */
    .bottom-nav {
        height: 94px;
        border-radius: 28px 28px 0 0;
    }

    .bottom-nav a { font-size: 2.7rem; }

    .bottom-nav a.active i {
        width: 82px;
        height: 82px;
        font-size: 2.9rem;
        border-radius: 22px;
        transform: translateY(-22px);
    }

    /* --- Dashboard --- */
    .card-form.dash-filtros {
        padding: 1.75rem 1.5rem;
        border-radius: 24px;
    }

    .dash-periodo      { font-size: 1.15rem; }
    .kpi               { padding: 1.25rem 1.4rem; border-radius: 20px; }
    .kpi-etiqueta      { font-size: 1.15rem; }
    .kpi-etiqueta i    { font-size: 1.4rem; }
    .kpi-valor         { font-size: 2rem; }
    .kpi-detalle       { font-size: 1.05rem; }

    .dash-card         { padding: 1.5rem 1.25rem 1.25rem; border-radius: 20px; }
    .dash-card-titulo  { font-size: 1.5rem; }
    .dash-card-sub     { font-size: 1.1rem; }
    .dash-leyenda      { font-size: 1.1rem; }
    .leyenda-muestra   { width: 14px; height: 14px; }
    .dash-grafica      { height: 360px; }
    #grafica-productos { height: 520px; }
    .dash-vacio        { font-size: 1.2rem; }
    .tabla-dash        { font-size: 1.15rem; }
    .tabla-dash th     { font-size: 1rem; }
    .tabla-dash th,
    .tabla-dash td     { padding: 0.8rem 0.6rem; }
    .tabla-vacia       { font-size: 1.2rem; }

    .chip-mini,
    .segmento {
        font-size: 1.05rem;
        padding: 0.45rem 1rem;
    }
}

/* ===== INVENTARIO ===== */

.casas-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.casa-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.casa-conteo {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 20px;
    padding: 0.05rem 0.5rem;
    font-size: 0.8em;
    font-weight: 600;
}

.chip-activo .casa-conteo {
    background: rgba(255, 255, 255, 0.25);
}

.inventario-buscador {
    flex: 1;
    min-width: 240px;
}

.producto-fila .venta-fila-derecha {
    align-items: flex-end;
    gap: 0.5rem;
}

/* ----- Imagen del producto (Inventario) ----- */
/* Miniatura al inicio de la fila: clic para agregar o cambiar la imagen. */
.prod-miniatura {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid #dddddd;
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.prod-miniatura img { width: 100%; height: 100%; object-fit: contain; }

/* Con la miniatura a la izquierda, los datos ocupan el espacio de en medio. */
.producto-fila .venta-fila-datos { flex: 1; min-width: 0; }

.prod-miniatura.sin-imagen {
    border-style: dashed;
    background: #f7f7f7;
    color: #999999;
    font-size: 1.3rem;
}

.prod-miniatura:hover { border-color: #08660b; color: #08660b; }

.imagen-producto-nombre { margin: -0.5rem 0 1rem; color: #555555; font-size: 0.9rem; }

.imagen-editor {
    display: grid;
    grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
    gap: 1.2rem;
    align-items: start;
}

.imagen-vista {
    position: relative;
    aspect-ratio: 1 / 1;
    border: 1px solid #dddddd;
    border-radius: 12px;
    background: #ffffff;
    overflow: hidden;
    display: grid;
    place-items: center;
}

.imagen-vista img { width: 100%; height: 100%; object-fit: contain; }
.imagen-vista.sin-imagen { background: #f4f4f4; color: #bbbbbb; font-size: 3.5rem; }

.imagen-sin-guardar {
    position: absolute;
    left: 0.5rem;
    bottom: 0.5rem;
    background: rgba(52, 55, 60, 0.85);
    color: #ffffff;
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
}

.imagen-lado { display: flex; flex-direction: column; gap: 0.7rem; min-width: 0; }
.imagen-meta { margin: 0; font-size: 0.85rem; color: #555555; }
.imagen-ayuda { margin: 0; font-size: 0.8rem; color: #666666; }

.imagen-soltar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 1.2rem 1rem;
    border: 2px dashed #c7c7c7;
    border-radius: 12px;
    background: #fafafa;
    color: #555555;
    text-align: center;
    font-size: 0.9rem;
    cursor: pointer;
}

.imagen-soltar .ph { font-size: 1.8rem; color: #08660b; }
.imagen-soltar strong { color: #08660b; text-decoration: underline; }
.imagen-soltar:hover, .imagen-soltar.arrastrando { border-color: #08660b; background: #f0f7f0; }

.imagen-soltar kbd {
    font-family: inherit;
    font-size: 0.75rem;
    padding: 0 0.3rem;
    border: 1px solid #cccccc;
    border-bottom-width: 2px;
    border-radius: 4px;
    background: #ffffff;
}

.imagen-botones { display: flex; justify-content: flex-end; gap: 0.5rem; flex-wrap: wrap; }
.imagen-botones .btn-save { display: inline-flex; align-items: center; gap: 0.4rem; }

.imagen-progreso { margin: 0.8rem 0 0.4rem; font-weight: 600; }

.imagen-resultados {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 40vh;
    overflow-y: auto;
    font-size: 0.85rem;
}

.imagen-resultados li { padding: 0.3rem 0; border-bottom: 1px solid #eeeeee; overflow-wrap: anywhere; }
.imagen-resultados .imagen-ok .ph { color: #08660b; }
.imagen-resultados .imagen-error { color: #b71c1c; }

@media (max-width: 600px) {
    .imagen-editor { grid-template-columns: 1fr; }
    .imagen-vista { max-width: 280px; width: 100%; justify-self: center; }
}

.precios-producto {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
}

/* Desde cuando rige el precio que se esta viendo. Va debajo del bruto y el
   neto, en gris y chico: es contexto, no un dato que se lea de corrido. */
.precio-fecha {
    font-size: 0.72rem;
    color: #777777;
    white-space: nowrap;
}

/* Flechita de subio / bajo junto al precio anterior. */
.precio-sube { color: #b3261e; }
.precio-baja { color: #1b7f3b; }

.precio-etiqueta {
    font-size: 0.85rem;
    color: #555555;
    white-space: nowrap;
}

.precio-etiqueta strong {
    color: #08660b;
    font-size: 1rem;
}

.btn-editar-precio,
.btn-editar-porcentaje {
    font-size: 0.78rem;
    padding: 0.25rem 0.7rem;
    white-space: nowrap;
}

/* Porcentaje que se muestra junto al neto en la lista del inventario. Normal
   cuando es el de la casa; resaltado cuando el producto trae uno propio. */
.pct-etiqueta {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.05rem 0.4rem;
    border-radius: 10px;
    background: #eeeeee;
    color: #555555;
}

.pct-etiqueta.pct-propio {
    background: #fff3cd;
    color: #7a5b00;
    font-weight: 600;
}

/* Línea "Actualmente: X% → $Y" del editor de porcentaje. */
.pct-actual {
    margin: 0.6rem 0;
    font-size: 1rem;
    color: #333333;
}

/* Casilla "Usar el porcentaje de la casa" del editor de porcentaje. */
.pct-casilla {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.4rem 0 0.2rem;
    font-size: 0.9rem;
    color: #444444;
    cursor: pointer;
}

.pct-casilla input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
}

/* "Editar %" dentro del renglón de un producto en la venta. */
/* Mismo enlace, en la tabla de la venta que se está editando. */
.link-editar-precio-venta {
    border: none;
    background: none;
    padding: 0;
    margin-top: 2px;
    font: inherit;
    font-size: 0.78rem;
    font-weight: normal;
    color: #08660b;
    text-decoration: underline;
    cursor: pointer;
}

.link-editar-precio-venta:hover {
    color: #05490a;
}

.link-editar-pct {
    border: none;
    background: none;
    padding: 0;
    font: inherit;
    font-size: 0.85rem;
    color: #08660b;
    text-decoration: underline;
    cursor: pointer;
}

.link-editar-pct:hover {
    color: #05490a;
}

/* Celda con "Editar precio" + "Editar %" en el detalle de la venta. */
.detalle-acciones-celda {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

/* Editar precio + la "x" de borrar, alineados en el pie de la fila. */
.producto-acciones {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Botón redondo con la "x" al costado del producto. Rojo solo al pasar el mouse
   para que no compita con "Editar precio". */
.btn-borrar-prod {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    padding: 0;
    border: 1px solid #e0a0a0;
    border-radius: 50%;
    background: #ffffff;
    color: #b71c1c;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.btn-borrar-prod:hover,
.btn-borrar-prod:focus-visible {
    background: #b71c1c;
    border-color: #b71c1c;
    color: #ffffff;
    outline: none;
}

/* Botón de confirmar la baja dentro del modal: mismo tamaño que .btn-save
   pero en rojo, porque es una acción destructiva. */
.btn-borrar-confirmar {
    background-color: #b71c1c;
    color: #ffffff;
    border: none;
    padding: 0.75rem 2.5rem;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-borrar-confirmar:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.paginacion {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    color: #444444;
}

.paginacion .chip:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

@media (max-width: 640px) {
    .producto-fila .venta-fila-derecha {
        align-items: flex-start;
        flex-direction: column;
    }

    .precios-producto {
        align-items: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    /* En el telefono el bruto y el neto van en renglon; la fecha se pasa
       completa al siguiente para no apretarlos. */
    .precio-fecha {
        flex-basis: 100%;
        white-space: normal;
    }
}

/* ----- Descarga del historial ----- */

.btn-exportar {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* ==========================================================================
   LEGIBILIDAD DE LISTAS Y TABLAS
   Título dentro de un recuadro con color de marca, y filas alternando blanco
   con un gris muy claro: en listas largas ayuda a no perder el renglón.
   ========================================================================== */

.page-title {
    background: var(--ga-carbon);
    color: #ffffff;
    padding: 0.85rem 2rem;
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    border-bottom: 4px solid var(--ga-naranja-claro);
}

/* ----- Filas alternadas: historial e inventario ----- */

.lista-ventas {
    gap: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #cfcfcf;
    background: #ffffff;
}

.lista-ventas .venta-fila {
    border: none;
    border-bottom: 1px solid #e6e6e6;
    border-radius: 0;
    background: #ffffff;
}

.lista-ventas .venta-fila:nth-child(even) {
    background: #f4f6f4;
}

.lista-ventas .venta-fila:last-child {
    border-bottom: none;
}

.lista-ventas .venta-fila:hover {
    background: #e8f2e8;
}

/* El mensaje de "sin resultados" no debe verse como una fila más. */
.lista-ventas .venta-vacia {
    background: #ffffff;
    margin: 0;
}

/* ----- Tablas del detalle ----- */

.tabla-detalle thead th {
    background: var(--ga-carbon);
    color: #ffffff;
    font-weight: 600;
    border-bottom: none;
}

.tabla-detalle thead th:first-child {
    border-top-left-radius: 10px;
}

.tabla-detalle thead th:last-child {
    border-top-right-radius: 10px;
}

.tabla-detalle tbody tr:nth-child(even) {
    background: #f4f6f4;
}

.tabla-detalle tbody tr:hover {
    background: #e8f2e8;
}

/* ----- Resultados del buscador de piezas ----- */

.search-result-item:nth-child(even) {
    background: #f4f6f4;
}

.search-result-item:hover,
.search-result-item:nth-child(even):hover {
    background: #e8f2e8;
}

/* ----- Piezas del ticket de venta ----- */

.venta-items .venta-item:nth-child(even) {
    background: #f0f2f0;
}

/* ----- Aviso con acción (venta guardada + imprimir nota) ----- */

.aviso-con-accion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.btn-imprimir-nota,
.btn-imprimir {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.btn-imprimir-nota {
    background: #ffffff;
}

/* Producto sin permiso de edición: informativo, sin invitar al clic. */
.fila-no-editable {
    cursor: default;
}

.fila-no-editable:hover {
    background: inherit;
    border-color: #cccccc;
}

/* ----- Selección múltiple de ventas para imprimir ----- */

.venta-elegir {
    display: flex;
    align-items: center;
    padding: 0 0.6rem 0 0.2rem;
    cursor: pointer;
    flex-shrink: 0;
}

.venta-elegir input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #08660b;
}

.barra-seleccion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 0.85rem 1.1rem;
    background: var(--ga-carbon);
    color: #ffffff;
    border-radius: 12px;
    font-weight: 500;
}

.barra-seleccion-acciones {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.barra-seleccion .chip {
    background: transparent;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.5);
}

.barra-seleccion .chip:hover {
    background: rgba(255, 255, 255, 0.12);
}

#btn-imprimir-seleccion {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.4rem;
    font-size: 1rem;
}

/* ==========================================================================
   MENÚ LATERAL EN PANTALLAS BAJAS (laptops)
   El menú mide 617px de alto. En un monitor cabe de sobra, pero una laptop
   con escalado de Windows al 150% deja un área útil de ~616px: se desbordaba
   por un pelo y aparecía un scroll propio dentro del menú.
   Aquí se compacta para que quepa completo y siga viéndose fijo.
   ========================================================================== */
@media (min-width: 769px) and (max-height: 760px) {
    .sidebar {
        padding: 1rem 0 1rem 0.85rem;
        gap: 1rem;
    }

    .sidebar .user-profile {
        padding: 1rem 0.85rem 0.85rem;
        border-radius: 16px;
    }

    .sidebar .brand-logo {
        width: 58px;
        height: 58px;
        margin-bottom: 0.5rem;
    }

    .user-profile h3 { font-size: 1rem; }
    .user-profile p  { font-size: 0.78rem; }

    .sidebar-menu {
        gap: 0.4rem;
    }

    .sidebar-menu li a {
        padding: 0.55rem 1rem;
        font-size: 0.95rem;
        border-radius: 12px;
    }

    /* El separador antes de "Cerrar Sesión" se reduce a la mitad. */
    .sidebar-menu .menu-salir {
        margin-top: 1rem;
    }
}

/* ===== RESUMEN DE PRODUCTOS VENDIDOS ===== */

.prod-totales {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1rem 0;
}

.prod-dato {
    flex: 1;
    min-width: 130px;
    background: #f4f6f4;
    border: 1px solid #d8ded8;
    border-radius: 12px;
    padding: 0.8rem 1rem;
    font-size: 0.85rem;
    color: #555555;
    text-align: center;
}

.prod-dato span {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ga-carbon);
    line-height: 1.2;
    margin-bottom: 0.15rem;
}

.prod-dato-importe span {
    color: #08660b;
}

/* Cada casa encabeza su propia tabla de productos. */
.prod-bloque {
    margin-bottom: 1.75rem;
}

.prod-bloque-titulo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.6rem 0.85rem;
    background: #f2f4f2;
    border: 1px solid #dde2dd;
    border-radius: 10px 10px 0 0;
    border-bottom: none;
}

.prod-bloque-titulo .res-casa {
    margin-left: 0;
    font-size: 0.85rem;
    padding: 0.2rem 0.65rem;
}

.prod-bloque .tabla-detalle {
    margin-top: 0;
}

.prod-bloque .tabla-detalle thead th:first-child {
    border-top-left-radius: 0;
}

.prod-bloque .tabla-detalle thead th:last-child {
    border-top-right-radius: 0;
}

.prod-casa-cifras {
    font-size: 0.88rem;
    color: #444444;
}

.prod-casa-cifras strong {
    color: var(--ga-carbon);
}

@media (max-width: 640px) {
    .prod-dato {
        min-width: 100%;
    }
}

/* ===== INVENTARIO · ALTA DE CASAS Y PRODUCTOS ===== */

/* Las pestañas de casa y el botón de casa nueva comparten renglón. */
.casas-linea {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.casas-linea .casas-tabs {
    margin-bottom: 0;
}

/* Botones de "crear": el borde punteado los distingue de un filtro. */
.chip-nuevo {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-style: dashed;
    font-weight: 600;
    color: var(--ga-carbon, #34373c);
}

.chip-nuevo:hover {
    border-style: solid;
    background: #eef3ee;
}

/* Chip que es un enlace (abre un PDF): mismo aspecto que un botón chip. */
.chip-enlace {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
}

/* El alta lleva tabla de vista previa: necesita más ancho que editar un precio. */
.modal-caja-ancha {
    max-width: 860px;
}

.alta-ejemplo-titulo {
    margin: 0 0 0.4rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #333333;
}

/* La tabla de ejemplo es de referencia: mas chica que una tabla de datos. */
.tabla-ejemplo {
    margin: 0;
    font-size: 0.8rem;
}

.tabla-ejemplo th,
.tabla-ejemplo td {
    padding: 0.4rem 0.6rem;
    white-space: nowrap;
}

.tabla-ejemplo th {
    line-height: 1.25;
}

.tabla-ejemplo th .detalle-sub {
    font-size: 0.7rem;
    font-weight: 400;
    color: #777777;
}

.tabla-ejemplo tbody td {
    color: #555555;
}

.alta-ejemplo-pie {
    margin: 0.5rem 0 1.25rem;
}

/* Dos campos por renglón, uno solo cuando no cabe. */
.alta-dos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0 1rem;
}

#alta-pegado {
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
    white-space: pre;
    overflow-x: auto;
}

.alta-errores {
    background: #fdf3f2;
    border: 1px solid #e9b8b3;
    border-radius: 12px;
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.88rem;
    color: #7b2d24;
}

.alta-errores p {
    margin: 0 0 0.4rem;
}

.alta-errores ul {
    margin: 0;
    padding-left: 1.2rem;
    line-height: 1.55;
    max-height: 11rem;
    overflow-y: auto;
}

#alta-resumen .tabla-detalle {
    margin-top: 0.5rem;
}

/* ===== CÓDIGO INTERNO DEL PRODUCTO ===== */

/* El código interno (BNS04-00001) es lo que identifica una pieza sin lugar a
   dudas: se busca por él y se dicta por teléfono. Va resaltado en todas partes
   —resultados de búsqueda, inventario, detalle de venta e historial— para que
   se encuentre de un vistazo entre el resto del texto gris. */
.codigo-prod {
    font-weight: 700;
    color: var(--ga-carbon);
    background: #eceeec;
    border-radius: 4px;
    padding: 0.05em 0.35em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Sobre la fila azul del resultado activo el gris claro desaparece. */
.search-result-item:hover .codigo-prod,
.search-result-item:focus .codigo-prod {
    background: #ffffff;
}

/* ── Pestañas Usuarios / Clientes ──────────────────────────────────────────
   Parten del control segmentado del Dashboard, pero aquí no son un ajuste
   menor: son el interruptor entre dos secciones distintas de la pantalla, así
   que van más grandes, centradas bajo el título y con su icono. */
.segmentado-seccion {
    display: flex;
    margin: 0 auto 1.25rem;
    width: fit-content;
    max-width: 100%;
    border: 1px solid #b9b9b9;
    border-radius: 26px;
    background: #ffffff;
    padding: 0.25rem;
    gap: 0.25rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.segmentado-seccion .segmento {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 1.6rem;
    border-radius: 22px;
    font-size: 1rem;
    font-weight: 600;
    color: #555555;
    transition: background 0.15s, color 0.15s;
}

/* El separador del control chico aquí estorba: las pastillas ya se distinguen. */
.segmentado-seccion .segmento + .segmento {
    border-left: none;
}

.segmentado-seccion .segmento i {
    font-size: 1.15rem;
}

.segmentado-seccion .segmento:hover {
    background: #eef3ee;
    color: var(--ga-carbon);
}

.segmentado-seccion .segmento-activo,
.segmentado-seccion .segmento-activo:hover {
    background: var(--ga-carbon);
    color: #ffffff;
}

.segmentado-seccion .segmento:focus-visible {
    outline: 2px solid var(--ga-carbon);
    outline-offset: 2px;
}

/* En celular las dos pastillas se reparten el ancho. */
@media (max-width: 480px) {
    .segmentado-seccion {
        width: 100%;
    }

    .segmentado-seccion .segmento {
        flex: 1;
        padding: 0.55rem 0.5rem;
    }
}

/* Enlace "Ver en mapa" que acompaña a la dirección del cliente. */
.enlace-mapa {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.4rem;
    color: var(--ga-naranja-oscuro);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.enlace-mapa:hover {
    text-decoration: underline;
}

/* Botón "Ver lista" junto al campo de cliente en la pantalla de Venta. Convive
   con el buscador de productos: mismo tamaño que el botón de agregar. */
.cliente-lista-btn {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border: 1px solid #aaaaaa;
    border-radius: 10px;
    background: #f7f7f7;
    color: var(--ga-carbon);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.3rem;
}

.cliente-lista-btn:hover {
    background: #ececec;
}

/* El campo de cliente no lleva la lupa absoluta del buscador de productos, así
   que no necesita el hueco a la derecha que deja ".search-container input". */
#cliente {
    padding-right: 1rem;
}

/* Recordatorio del porcentaje con que se calcula el neto de la casa activa,
   arriba del listado de Inventario. */
.casa-neto-info {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.25rem 0 0.75rem;
    padding: 0.5rem 0.85rem;
    background: #f2f5f2;
    border-radius: 10px;
    font-size: 0.9rem;
    color: var(--ga-carbon);
}

.casa-neto-info i {
    color: var(--ga-naranja-oscuro);
}

/* Bloque de saldo a favor en la pantalla de Venta: recuerda cuánto tiene el
   cliente y cuánto se le está descontando. */
.bloque-saldo {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.25rem;
    margin-bottom: 1rem;
    padding: 0.7rem 1rem;
    background: #eef6ee;
    border: 1px solid #cfe4cf;
    border-radius: 10px;
    font-size: 0.95rem;
    color: var(--ga-carbon);
}

.saldo-linea strong { white-space: nowrap; }
.saldo-desc strong  { color: #08660b; }

/* Casilla para decidir si el saldo se descuenta en esta venta. Ocupa el renglon
   completo para que no se pierda entre las cifras. */
.saldo-casilla {
    flex-basis: 100%;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    font-weight: 600;
}

/* Se anula el estilo de ".form-group input", pensado para campos de texto. */
.saldo-casilla input[type="checkbox"] {
    width: auto;
    margin: 0;
    padding: 0;
    accent-color: #08660b;
    cursor: pointer;
}

/* Lo que pasa si se desmarca. */
.saldo-guardado {
    flex-basis: 100%;
    font-size: 0.88rem;
    color: #4a6a4a;
}
.saldo-pagar        { margin-left: auto; }
.saldo-pagar strong { font-size: 1.05rem; }

/* Registrar abono dentro del detalle de una venta a crédito (Historial). */
.abono-form {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px dashed #cccccc;
}

.abono-campos {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.35rem;
}

.abono-campos .form-control { flex: 1 1 120px; }
.abono-campos .btn-save     { flex: 0 0 auto; }

/* Línea que muestra el saldo a favor descontado en una venta. */
.detalle-saldo-aplicado {
    margin-top: 0.75rem;
    padding: 0.6rem 0.9rem;
    background: #eef6ee;
    border: 1px solid #cfe4cf;
    border-radius: 8px;
    color: var(--ga-carbon);
}

.detalle-saldo-aplicado p { margin: 0; }

/* Botón de WhatsApp y separador en el panel "Enviar nota" del Historial. */
.btn-wa {
    background: #25d366;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.btn-wa:hover { background: #1ebe5b; }

.env-sep {
    border: none;
    border-top: 1px dashed #cccccc;
    margin: 1.1rem 0;
}

/* ===== FICHA DEL CLIENTE ===== */

.clientes-buscador {
    flex: 1;
    min-width: 260px;
}

/* Una fila de cliente se abre: conviene que se note. */
.usuario-fila[role="button"] {
    cursor: pointer;
}

.usuario-fila[role="button"]:hover {
    background: #f2f7f2;
}

.usuario-fila[role="button"]:focus-visible {
    outline: 2px solid var(--ga-carbon);
    outline-offset: 2px;
}

/* Etiqueta y dato, alineados en dos columnas. */
.ficha {
    margin: 1rem 0 1.25rem;
    border-top: 1px solid #e0e0e0;
}

.ficha-renglon {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    padding: 0.55rem 0.1rem;
    border-bottom: 1px solid #e0e0e0;
}

.ficha-etiqueta {
    flex: 0 0 8.5rem;
    font-weight: 600;
    color: #555555;
    font-size: 0.9rem;
}

.ficha-valor {
    flex: 1;
    min-width: 12rem;
    word-break: break-word;
}

/* Lo que el cliente no tiene capturado, en gris y en cursiva: se distingue de
   un dato real sin gritar. */
.ficha-falta {
    color: #999999;
    font-style: italic;
}

.ficha-saldo-favor {
    color: #08660b;
    font-weight: 700;
}

@media (max-width: 520px) {
    .ficha-etiqueta { flex-basis: 100%; }
}

/* ===== DATOS FALTANTES AL IMPRIMIR VARIAS NOTAS ===== */

/* Un bloque por cliente incompleto: su nombre, qué le falta y los campos
   justos para completarlo sin salir de la impresión. */
.falta-cliente {
    border: 1px solid #e0e0e0;
    border-left: 4px solid #d9a441;
    border-radius: 10px;
    padding: 0.9rem 1rem 0.35rem;
    margin-bottom: 0.9rem;
    background: #fcfcfb;
}

.falta-nombre {
    margin: 0 0 0.7rem;
    font-weight: 700;
    color: var(--ga-carbon);
}

.falta-nombre .detalle-sub {
    font-weight: 400;
}

/* Casilla para dar de alta en el catálogo al cliente que se tecleó a mano. */
.guardar-cliente {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.5rem;
    cursor: pointer;
    font-size: 0.92rem;
    color: #444444;
}

/* Se anula el estilo de ".form-group input", pensado para campos de texto. */
.guardar-cliente input[type="checkbox"] {
    width: auto;
    margin: 0;
    padding: 0;
    accent-color: #08660b;
    cursor: pointer;
}

.guardar-cliente[hidden] {
    display: none !important;
}

/* Cliente que hay que dar de alta: se distingue del que solo tiene huecos. */
.falta-cliente-nuevo {
    border-left-color: #1976d2;
}

.falta-cliente-nuevo .guardar-cliente {
    margin: 0 0 0.75rem;
    font-weight: 600;
    color: var(--ga-carbon);
}

/* Fecha del último cambio de precio en el renglón del ticket. Va dentro de
   .item-meta, que ya es gris y chica; esto solo evita que se parta. */
.item-precio-fecha {
    white-space: nowrap;
}

/* ===== Claves del SAT de una venta ===== */

.tabla-sat .sat-clave {
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.tabla-sat code {
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 0.92rem;
    letter-spacing: 0.02em;
}

/* Una pieza sin ClaveProdServ capturada: no se puede facturar hasta ponerla. */
.sat-falta {
    font-size: 0.8rem;
    font-style: italic;
    color: #9a6a00;
}

/* Botón de copiar: cabe dentro de la celda sin estirar el renglón. */
.chip-mini {
    padding: 0.1rem 0.35rem;
    font-size: 0.8rem;
    line-height: 1.2;
}

/* ===== Entrega y eliminación de ventas (historial) ===== */

/* Botones de acción a la derecha de cada fila (palomita / eliminar). */
.venta-fila-acciones {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.fila-accion {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    border: 1px solid #cccccc;
    background: #ffffff;
    color: #555555;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.fila-accion:hover {
    background: #f0f7f0;
    border-color: #08660b;
    color: #08660b;
}

.btn-entregar.esta-entregada {
    background: #e3f4e4;
    border-color: #08660b;
    color: #08660b;
}

.fila-accion-peligro:hover {
    background: #fdecea;
    border-color: #e53935;
    color: #b71c1c;
}

/* Palomita verde junto al nombre cuando la venta ya se entregó. */
.icono-entregada {
    color: #08660b;
    margin-left: 0.4rem;
    font-size: 1rem;
}

.venta-entregada {
    border-left: 3px solid #08660b;
}

/* Botón "Entregada el…" dentro del detalle. */
.btn-entrega-detalle.esta-entregada {
    background: #e3f4e4;
    border-color: #08660b;
    color: #08660b;
}

/* ----- Panel de ventas recuperables ----- */
/* `display: flex` le gana al atributo `hidden`, asi que sin esto la caja se
   dibuja vacia (un recuadro amarillo sin nada) cuando no hay nada que
   recuperar. Pasa igual en Historial y en Inventario. */
.recuperables[hidden] {
    display: none;
}

.recuperables {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin: 0 0 1rem;
    padding: 0.9rem 1rem;
    background: #fdf3e2;
    border: 1px solid #d9a441;
    border-radius: 12px;
}

.recuperables-titulo {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    color: #8a5a10;
}

.recuperable-fila {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #ffffff;
    border: 1px solid #e7cfa0;
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
}

.recuperable-datos {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.recuperable-cliente {
    font-weight: 600;
    color: #222222;
}

.recuperable-meta {
    font-size: 0.8rem;
    color: #666666;
}

.recuperable-reloj {
    color: #b71c1c;
    font-variant-numeric: tabular-nums;
}

.btn-recuperar {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .fila-accion {
        width: 2.6rem;
        height: 2.6rem;
        font-size: 1.35rem;
    }

    .recuperable-fila {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-recuperar {
        justify-content: center;
    }
}

/* ===== Pedidos en línea (catálogo público) ===== */
/* Naranja muy claro: lo que llegó del catálogo en línea se distingue de un
   vistazo, tanto el pedido por atender como la venta en que se convirtió. */

.pedidos-linea {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin: 0 0 1rem;
    padding: 0.9rem 1rem;
    background: #fff6ea;
    border: 1px solid #ffbb5b;
    border-radius: 12px;
}

.pedidos-linea[hidden] { display: none; }

.pedidos-linea-titulo {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    color: #8a4f00;
}

.pedidos-linea-ayuda {
    margin: -0.3rem 0 0;
    font-size: 0.8rem;
    color: #7a5a30;
}

.pedido-linea {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: #ffffff;
    border: 1px solid #ffd59a;
    border-left: 4px solid #ffbb5b;
    border-radius: 10px;
    padding: 0.7rem 0.9rem;
}

.pedido-linea-cabeza {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.pedido-linea-datos {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.pedido-linea-cliente { font-weight: 600; color: #222222; }
.pedido-linea-meta { font-size: 0.8rem; color: #666666; }
.pedido-linea-total { font-weight: 700; font-size: 1.1rem; color: #a35c00; white-space: nowrap; }

.pedido-linea-productos summary {
    cursor: pointer;
    font-size: 0.85rem;
    color: #a35c00;
    font-weight: 600;
}

.pedido-linea-productos ul {
    margin: 0.4rem 0 0;
    padding-left: 1.1rem;
    font-size: 0.85rem;
    color: #333333;
}

.pedido-linea-productos li { margin: 0.15rem 0; }
.pedido-cant { font-weight: 700; }
.pedido-precio { color: #666666; white-space: nowrap; }

.pedido-linea-acciones {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-cargar-pedido {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

/* Venta que salió de un pedido en línea, dentro del listado. */
.lista-ventas .venta-fila.venta-en-linea,
.lista-ventas .venta-fila.venta-en-linea:nth-child(even) {
    background: #fff3e2;
    box-shadow: inset 4px 0 0 #ffbb5b;
}

.lista-ventas .venta-fila.venta-en-linea:hover {
    background: #ffe9cc;
}

.etiqueta-en-linea {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #fff0d9;
    color: #8a4f00;
    border: 1px solid #ffbb5b;
    text-transform: none;
}

.detalle-en-linea {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #fff3e2;
    border: 1px solid #ffbb5b;
    border-radius: 8px;
    padding: 0.2rem 0.6rem;
    color: #8a4f00;
}

/* Aviso arriba del ticket de Venta mientras se cobra un pedido en línea. */
.pedido-linea-venta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 0.6rem 0.9rem;
    background: #fff3e2;
    border: 1px solid #ffbb5b;
    border-radius: 10px;
    color: #8a4f00;
}

.pedido-linea-venta[hidden] { display: none; }
.pedido-linea-venta span { flex: 1; min-width: 12rem; }
.pedido-linea-venta .ph { font-size: 1.2rem; }

@media (max-width: 600px) {
    .pedido-linea-acciones { justify-content: stretch; }
    .pedido-linea-acciones > * { flex: 1; justify-content: center; }
}

/* ===== CONFIRMACIÓN DE COMPRA ===== */

/* Tablas con casilla al frente: la columna se mantiene angosta. */
.tabla-compra .compra-check {
    width: 3.5rem;
    text-align: center;
}

.tabla-compra .compra-check input[type="checkbox"] {
    width: auto;
    margin: 0;
    padding: 0;
    accent-color: #08660b;
    cursor: pointer;
    transform: scale(1.2);
}

/* Producto marcado como no disponible: se atenúa para ver de un vistazo lo que
   queda por revisar. */
.compra-fila-falta {
    background: #fdf3e2;
}

.compra-fila-falta td:nth-child(2) {
    text-decoration: line-through;
    text-decoration-color: #b98a2e;
    color: #7a6229;
}

/* Cómo queda cada venta si se aplica: se calcula en pantalla antes de tocar nada. */
.compra-resultado {
    margin: 0.2rem 0 0.4rem;
    font-size: 0.88rem;
    color: #444444;
}

.compra-resultado strong {
    color: var(--ga-carbon);
}

.compra-resultado-vacia {
    color: #b71c1c;
    font-weight: 600;
}

.compra-venta .prod-bloque-titulo {
    align-items: baseline;
}

/* Los botones del flujo quedan a la vista aunque la lista sea larga. */
.detalle-acciones-fija {
    position: sticky;
    bottom: 0;
    background: #ffffff;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    border-top: 1px solid #e0e0e0;
}

/* Campos de cantidad de la confirmación de compra. */
.tabla-compra .compra-check .input-qty,
.tabla-compra .compra-llegaron .input-qty {
    width: 4.2rem;
    margin: 0;
    padding: 0.3rem 0.4rem;
    text-align: center;
}

.tabla-compra .compra-llegaron {
    width: 5.5rem;
}

.tabla-compra .input-qty:disabled {
    background: #f0f0f0;
    color: #aaaaaa;
}

/* Cuadre por producto: cuántas faltaron contra cuántas se llevan repartidas. */
.compra-reparto {
    margin: 0.6rem 0 0;
    padding-left: 1.2rem;
    font-size: 0.88rem;
    line-height: 1.6;
}

.compra-reparto .reparto-ok {
    color: #08660b;
}

.compra-reparto .reparto-pendiente {
    color: #8a5a10;
    font-weight: 600;
}

/* ===== CONTACTOS DEL CATÁLOGO (pestaña de Usuarios, solo admin) ===== */

/* Filtro con su rótulo arriba, como los campos de fecha del historial. */
.campo-filtro label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    color: #333333;
}

.campo-filtro .form-control {
    width: auto;
    padding: 0.5rem 0.75rem;
}

.contactos-nota {
    margin: 0.9rem 0 0.6rem;
    font-size: 0.85rem;
}

/* ===== Publicar un producto en el catálogo en línea ===== */

/* El interruptor dentro del formulario de editar producto. La casilla y su
   texto van en el mismo renglón; la explicación, debajo y en gris. */
.ed-publicar-linea {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 600;
}

.ed-publicar-linea input {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: #08660b;
    cursor: pointer;
}

.ed-publicar .detalle-sub {
    display: block;
    margin-top: 0.25rem;
}

/* El chip del renglón cambia de ancho al pasar de "Publicar" a "En catálogo", y
   los botones de al lado brincaban. Con un ancho mínimo se quedan quietos. */
.btn-catalogo {
    min-width: 6.5rem;
    text-align: center;
}
