/* ==============================================================
   REDISEÑO PREMIUM v2 — HEADER PC + SIDEBAR (compactado)
   ==============================================================
   v2: header forzado a UNA SOLA LINEA, ningún wrap, scroll si overflow.
   ============================================================== */

/* ==============================================================
   1. HEADER PC — Compacto, profesional, una sola línea siempre
   ============================================================== */
@media (min-width: 901px) {

    /* Container del header */
    .app-top {
        padding: 10px 16px !important;
        gap: 8px !important;
        background: linear-gradient(180deg,
            rgba(20, 23, 30, 0.99) 0%,
            rgba(14, 16, 22, 0.96) 100%) !important;
        border-bottom: 1px solid rgba(200, 16, 46, 0.18) !important;
        box-shadow:
            0 1px 0 rgba(255, 255, 255, 0.04) inset,
            0 4px 12px rgba(0, 0, 0, 0.18) !important;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        min-height: 56px;
        flex-wrap: nowrap !important;     /* CRITICO: nunca rompe */
        white-space: nowrap !important;
        overflow-x: auto;
        overflow-y: hidden;
    }
    .app-top::-webkit-scrollbar { height: 0 !important; }

    /* Cada elemento del header NO se rompe en lineas */
    .app-top > * {
        flex-shrink: 0;
        white-space: nowrap;
    }

    /* Buscador global — ocupa lo que sobra pero compactable */
    .app-top > .buscador-global,
    .app-top > input[type="search"],
    .app-top > .buscador-global-wrap {
        max-width: 280px;
        min-width: 180px;
        flex-shrink: 1 !important;
    }

    /* === Grupos contextuales — chips ULTRA compactos premium === */
    .app-top .top-group {
        display: inline-flex !important;
        align-items: center !important;
        gap: 6px !important;
        padding: 4px 9px 4px 7px !important;
        background: rgba(255, 255, 255, 0.025) !important;
        border: 1px solid rgba(255, 255, 255, 0.06) !important;
        border-radius: 7px !important;
        font-size: 12px !important;
        line-height: 1 !important;
        height: 28px;
        transition: all 0.15s ease;
        flex-shrink: 0;
    }
    .app-top .top-group:hover {
        background: rgba(255, 255, 255, 0.05) !important;
        border-color: rgba(255, 255, 255, 0.10) !important;
    }

    /* Pill (LEGAJO/PERMISO/TURNO) — etiqueta tipográfica */
    .app-top .top-group .pill {
        padding: 2px 5px !important;
        font-size: 9px !important;
        letter-spacing: 1px !important;
        font-weight: 700 !important;
        background: rgba(200, 16, 46, 0.10) !important;
        color: rgba(255, 200, 200, 0.75) !important;
        border: 1px solid rgba(200, 16, 46, 0.18) !important;
        border-radius: 3px !important;
        line-height: 1 !important;
    }
    .app-top .top-group .pill-muted {
        background: rgba(255, 255, 255, 0.04) !important;
        color: rgba(255, 255, 255, 0.50) !important;
        border-color: rgba(255, 255, 255, 0.08) !important;
    }
    .app-top .top-group .top-val {
        color: var(--fg, #f5f6f8) !important;
        font-weight: 700 !important;
        font-size: 12px !important;
        letter-spacing: 0.2px;
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
    }

    /* Spacer */
    .app-top .top-spacer { flex: 1 1 auto !important; min-width: 4px; }

    /* === Selector sucursal admin — chips compactos sin wrap === */
    .app-top .suc-selector {
        display: inline-flex !important;
        align-items: center !important;
        gap: 3px !important;
        padding: 3px 8px 3px 10px !important;
        background: linear-gradient(135deg,
            rgba(245, 166, 35, 0.06),
            rgba(245, 166, 35, 0.02)) !important;
        border: 1px solid rgba(245, 166, 35, 0.22) !important;
        border-radius: 8px !important;
        height: 30px;
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
        flex-shrink: 0;
    }
    .app-top .suc-selector .ss-label {
        color: rgba(245, 166, 35, 0.95) !important;
        font-size: 9px !important;
        font-weight: 800 !important;
        letter-spacing: 1px !important;
        margin-right: 3px;
        flex-shrink: 0;
    }
    .app-top .suc-selector .ss-chip {
        display: inline-flex !important;
        align-items: center !important;
        padding: 3px 7px !important;
        background: rgba(255, 255, 255, 0.04) !important;
        border: 1px solid rgba(255, 255, 255, 0.06) !important;
        border-radius: 5px !important;
        color: rgba(255, 255, 255, 0.70) !important;
        font-size: 10.5px !important;
        font-weight: 700 !important;
        letter-spacing: 0.3px;
        cursor: pointer;
        transition: all 0.12s ease;
        line-height: 1.2;
        flex-shrink: 0;
    }
    .app-top .suc-selector .ss-chip:hover {
        background: rgba(245, 166, 35, 0.12) !important;
        border-color: rgba(245, 166, 35, 0.35) !important;
        color: #fff !important;
    }
    .app-top .suc-selector .ss-chip.on {
        background: linear-gradient(135deg, #f5a623, #d97e10) !important;
        border-color: #d97e10 !important;
        color: #1a1208 !important;
        font-weight: 800 !important;
        box-shadow: 0 2px 6px rgba(245, 166, 35, 0.30);
    }
    .app-top .suc-selector .ss-chip.sub {
        background: rgba(255, 255, 255, 0.02) !important;
        border-color: rgba(255, 255, 255, 0.05) !important;
        color: rgba(255, 255, 255, 0.45) !important;
        font-size: 10px !important;
    }
    .app-top .suc-selector .ss-chip.sub:hover {
        color: rgba(255, 255, 255, 0.80) !important;
    }

    /* === Cluster de acciones a la derecha === */
    .app-top .top-extras {
        display: inline-flex !important;
        align-items: center !important;
        gap: 5px !important;
        padding: 0 0 0 8px;
        position: relative;
        flex-wrap: nowrap !important;
        flex-shrink: 0;
    }
    .app-top .top-extras::before {
        content: '';
        position: absolute;
        left: 0;
        top: 6px;
        bottom: 6px;
        width: 1px;
        background: linear-gradient(180deg,
            transparent,
            rgba(255, 255, 255, 0.10) 30%,
            rgba(255, 255, 255, 0.10) 70%,
            transparent);
    }

    /* === Theme toggle — compacto === */
    .app-top .theme-toggle {
        display: inline-flex !important;
        align-items: center !important;
        gap: 4px !important;
        height: 30px !important;
        padding: 0 9px !important;
        background: rgba(245, 166, 35, 0.06) !important;
        border: 1px solid rgba(245, 166, 35, 0.20) !important;
        border-radius: 7px !important;
        color: rgba(245, 200, 100, 0.90) !important;
        font-size: 11px !important;
        font-weight: 600 !important;
        cursor: pointer;
        transition: all 0.15s ease;
        white-space: nowrap !important;
        flex-shrink: 0;
    }
    .app-top .theme-toggle:hover {
        background: rgba(245, 166, 35, 0.14) !important;
        border-color: rgba(245, 166, 35, 0.40) !important;
        color: #fde68a !important;
    }

    /* === Escanear — compacto === */
    .app-top .btn-escanear-top {
        display: inline-flex !important;
        align-items: center !important;
        gap: 4px !important;
        height: 30px !important;
        padding: 0 9px !important;
        background: rgba(245, 166, 35, 0.10) !important;
        border: 1px solid rgba(245, 166, 35, 0.30) !important;
        border-radius: 7px !important;
        color: #fbbf24 !important;
        font-size: 11px !important;
        font-weight: 700 !important;
        cursor: pointer;
        transition: all 0.15s ease;
        white-space: nowrap !important;
        letter-spacing: 0.2px;
        flex-shrink: 0;
    }
    .app-top .btn-escanear-top:hover {
        background: rgba(245, 166, 35, 0.20) !important;
        border-color: rgba(245, 166, 35, 0.55) !important;
        transform: translateY(-1px);
    }

    /* === Comunicados (📬) — icon button compacto === */
    .app-top .btn-novedades {
        position: relative;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 30px !important;
        height: 30px !important;
        background: rgba(52, 152, 219, 0.08) !important;
        border: 1px solid rgba(52, 152, 219, 0.25) !important;
        border-radius: 7px !important;
        font-size: 14px !important;
        color: #85c1e9 !important;
        text-decoration: none !important;
        flex-shrink: 0;
    }
    .app-top .btn-novedades:hover {
        background: rgba(52, 152, 219, 0.18) !important;
        transform: translateY(-1px);
    }
    .app-top .btn-novedades.tiene {
        background: rgba(52, 152, 219, 0.22) !important;
        border-color: rgba(52, 152, 219, 0.55) !important;
    }
    .app-top .btn-novedades .nov-badge {
        position: absolute;
        top: -4px;
        right: -4px;
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        background: linear-gradient(135deg, #ef4444, #b91c1c);
        color: #fff;
        font-size: 9.5px;
        font-weight: 800;
        border-radius: 9px;
        border: 2px solid #14161a;
        line-height: 14px;
    }

    /* === Pedido — compacto === */
    .app-top .top-extras > a[href="/pedidos/nuevo"] {
        display: inline-flex !important;
        align-items: center !important;
        gap: 4px !important;
        height: 30px !important;
        padding: 0 9px !important;
        background: rgba(99, 102, 241, 0.08) !important;
        border: 1px solid rgba(99, 102, 241, 0.22) !important;
        border-radius: 7px !important;
        color: rgba(165, 180, 252, 0.95) !important;
        font-size: 11px !important;
        font-weight: 600 !important;
        text-decoration: none !important;
        white-space: nowrap !important;
        transition: all 0.15s ease;
        flex-shrink: 0;
    }
    .app-top .top-extras > a[href="/pedidos/nuevo"]:hover {
        background: rgba(99, 102, 241, 0.16) !important;
        border-color: rgba(99, 102, 241, 0.45) !important;
    }

    /* === LLAMÉ POLICIA — destacado, ultra compacto, NO se parte === */
    .app-top .btn-policia-top {
        display: inline-flex !important;
        align-items: center !important;
        gap: 4px !important;
        height: 30px !important;
        padding: 0 10px !important;
        background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
        color: #fff !important;
        border: 1px solid rgba(255, 100, 100, 0.40) !important;
        border-radius: 7px !important;
        font-size: 11px !important;
        font-weight: 800 !important;
        letter-spacing: 0.4px !important;
        margin-right: 0 !important;
        cursor: pointer;
        white-space: nowrap !important;
        flex-shrink: 0;
        max-width: none;
        box-shadow:
            0 0 0 0 rgba(220, 38, 38, 0.0),
            0 2px 8px rgba(220, 38, 38, 0.30) !important;
        transition: all 0.15s ease;
    }
    .app-top .btn-policia-top:hover {
        background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
        box-shadow:
            0 0 0 4px rgba(220, 38, 38, 0.22),
            0 4px 14px rgba(220, 38, 38, 0.55) !important;
        transform: translateY(-1px);
    }

    /* === SALIR === */
    .app-top .top-logout {
        display: inline-flex !important;
        align-items: center !important;
        height: 30px !important;
        padding: 0 11px !important;
        margin-left: 5px !important;
        background: rgba(255, 255, 255, 0.02) !important;
        border: 1px solid rgba(255, 255, 255, 0.07) !important;
        border-radius: 7px !important;
        color: rgba(255, 255, 255, 0.55) !important;
        font-size: 10.5px !important;
        font-weight: 700 !important;
        letter-spacing: 1.2px !important;
        text-decoration: none !important;
        transition: all 0.15s ease;
        white-space: nowrap !important;
        flex-shrink: 0;
    }
    .app-top .top-logout:hover {
        background: rgba(220, 38, 38, 0.08) !important;
        border-color: rgba(220, 38, 38, 0.30) !important;
        color: #fff !important;
    }

    /* === Fecha (top-group con SOLO un top-val adentro) — chip MUY compacto === */
    .app-top > .top-group:has(> .top-val:only-child) {
        background: transparent !important;
        border: none !important;
        padding: 0 6px !important;
    }
    .app-top > .top-group:has(> .top-val:only-child) .top-val {
        color: rgba(255, 255, 255, 0.55) !important;
        font-size: 11px !important;
        font-weight: 600 !important;
        font-variant-numeric: tabular-nums;
        line-height: 1.2;
        text-align: right;
        white-space: nowrap;
    }

    /* === MEDIA queries para pantallas medias: ocultar texto en botones secundarios === */
    @media (max-width: 1480px) {
        /* Esconder texto del Claro -> queda solo ☀ */
        .app-top .theme-toggle {
            font-size: 14px !important;
            padding: 0 9px !important;
            min-width: 30px;
        }
        .app-top .theme-toggle #mb-theme-toggle-label {
            display: none !important;
        }
        .app-top .theme-toggle::before {
            content: '☀';
            font-size: 13px;
        }
        body[data-theme="light"] .app-top .theme-toggle::before {
            content: '🌙';
        }
    }

    @media (max-width: 1380px) {
        /* Compactar mas — esconder texto Pedido */
        .app-top .top-extras > a[href="/pedidos/nuevo"] {
            font-size: 13px !important;
            padding: 0 9px !important;
            min-width: 30px;
            justify-content: center;
        }
        .app-top .top-extras > a[href="/pedidos/nuevo"] {
            text-indent: -9999px;
            position: relative;
        }
        .app-top .top-extras > a[href="/pedidos/nuevo"]::before {
            content: '📨';
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            text-indent: 0;
            font-size: 14px;
        }
    }

    @media (max-width: 1280px) {
        /* Compactar al maximo */
        .app-top {
            padding: 10px 12px !important;
            gap: 6px !important;
        }
        .app-top .top-group {
            padding: 3px 7px 3px 5px !important;
            gap: 5px !important;
        }
        .app-top .top-group .top-val { font-size: 11px !important; }
        .app-top .top-group .pill {
            font-size: 8.5px !important;
            padding: 2px 4px !important;
            letter-spacing: 0.5px !important;
        }
        .app-top .btn-escanear-top {
            font-size: 10.5px !important;
            padding: 0 8px !important;
        }
        .app-top .btn-policia-top {
            font-size: 10.5px !important;
            padding: 0 9px !important;
            letter-spacing: 0.2px !important;
        }
        .app-top .top-logout {
            padding: 0 9px !important;
            font-size: 10px !important;
            letter-spacing: 1px !important;
        }
        .app-top > .top-group:has(> .top-val:only-child) .top-val {
            font-size: 10px !important;
        }
    }

    /* En pantallas muy chicas (1100px) ocultar texto Escanear */
    @media (max-width: 1100px) {
        .app-top .btn-escanear-top {
            min-width: 30px;
            justify-content: center;
            font-size: 14px !important;
            padding: 0 9px !important;
            text-indent: -9999px;
            position: relative;
        }
        .app-top .btn-escanear-top::before {
            content: '📷';
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            text-indent: 0;
        }
    }

}  /* fin @media min-width: 901px */


/* ==============================================================
   2. SIDEBAR — Look premium v3 (mobile + desktop)
   ============================================================== */

/* USER HEAD — Layout en grid: avatar + info + campanita
   Optimizado para sidebar de 240px con padding 14px */
.nav-user {
    display: grid !important;
    grid-template-columns: 40px 1fr 32px !important;
    grid-template-rows: auto;
    grid-column-gap: 10px !important;
    align-items: center !important;
    padding: 12px 10px 12px 10px !important;
    background: linear-gradient(180deg,
        rgba(200, 16, 46, 0.05) 0%,
        rgba(200, 16, 46, 0.01) 50%,
        transparent 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 4px;
    position: relative;
    overflow: hidden;
    min-height: 60px;
}
/* Brillo decorativo arriba */
.nav-user::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(200, 16, 46, 0.50),
        rgba(245, 166, 35, 0.30),
        transparent);
}
/* Brillo decorativo abajo */
.nav-user::after {
    content: '';
    position: absolute;
    left: 14px; right: 14px; bottom: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(200, 16, 46, 0.45),
        transparent);
}

/* Avatar premium 40px - más chico y sutil */
.nav-user .nu-avatar {
    grid-column: 1;
    width: 40px !important;
    height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background:
        radial-gradient(circle at 30% 30%,
            rgba(255, 255, 255, 0.18),
            transparent 50%),
        linear-gradient(135deg, #e11d48 0%, #c8102e 35%, #8a0a1f 100%) !important;
    color: #fff !important;
    font-weight: 800 !important;
    font-size: 14px !important;
    letter-spacing: 0.3px !important;
    border-radius: 11px !important;
    border: 1.5px solid rgba(255, 255, 255, 0.10) !important;
    box-shadow:
        0 2px 8px rgba(200, 16, 46, 0.35),
        0 1px 3px rgba(0, 0, 0, 0.30),
        inset 0 1px 0 rgba(255, 255, 255, 0.20) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.40);
    position: relative;
    overflow: hidden;
}
/* Indicador online verde con animacion sutil */
.nav-user .nu-avatar::after {
    content: '';
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #4ade80, #16a34a);
    border: 2.5px solid var(--bg-0, #0b0d10);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.65);
    animation: nuOnlinePulse 2.5s ease-in-out infinite;
}
@keyframes nuOnlinePulse {
    0%, 100% { box-shadow: 0 0 8px rgba(34, 197, 94, 0.55); }
    50%      { box-shadow: 0 0 14px rgba(34, 197, 94, 0.85); }
}

/* Info del usuario — usa todo el ancho disponible */
.nav-user .nu-info {
    grid-column: 2;
    min-width: 0 !important;       /* CRITICO: permite que el ellipsis funcione en grid */
    display: flex !important;
    flex-direction: column !important;
    gap: 1px !important;
    overflow: hidden;
}
.nav-user .nu-info .nu-nombre {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: var(--fg, #f5f6f8) !important;
    line-height: 1.2 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    letter-spacing: 0.1px;
    max-width: 100% !important;
}
.nav-user .nu-info .nu-rol {
    font-size: 9px !important;
    color: rgba(245, 166, 35, 0.95) !important;
    font-weight: 800 !important;
    letter-spacing: 1.5px !important;
    text-transform: uppercase !important;
    line-height: 1.3 !important;
    margin-top: 1px;
    text-shadow: 0 0 8px rgba(245, 166, 35, 0.20);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nav-user .nu-info .nu-suc {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    font-size: 9.5px !important;
    color: rgba(255, 255, 255, 0.50) !important;
    font-weight: 600 !important;
    margin-top: 2px;
    overflow: hidden;
    white-space: nowrap;
    max-width: 100%;
}
.nav-user .nu-info .nu-suc .dot {
    display: inline-block;
    width: 3px;
    height: 3px;
    background: rgba(255, 255, 255, 0.30);
    border-radius: 50%;
    flex-shrink: 0;
}
.nav-user .nu-info .nu-suc span {
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.nav-user .nu-info .nu-suc span:first-child {
    flex-shrink: 0;
}

/* Campanita: en su propio slot, no compite con el texto */
.nav-user .cc-wrap {
    grid-column: 3;
    margin-left: 0 !important;
    flex-shrink: 0 !important;
    align-self: center;
}
.nav-user .cc-bell {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    background: rgba(245, 166, 35, 0.10) !important;
    border: 1px solid rgba(245, 166, 35, 0.28) !important;
    border-radius: 10px !important;
    padding: 0 !important;
    font-size: 15px !important;
}
.nav-user .cc-bell-badge {
    top: -5px !important;
    right: -5px !important;
    min-width: 19px !important;
    height: 19px !important;
    line-height: 15px !important;
    font-size: 10px !important;
    border: 2px solid var(--bg-0, #0b0d10) !important;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.50) !important;
}

/* Buscador del sidebar */
.nav-search-wrap {
    margin: 10px 12px 8px 12px !important;
    background: rgba(255, 255, 255, 0.025) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 10px !important;
    padding: 6px 10px !important;
    transition: all 0.15s ease;
}
.nav-search-wrap:focus-within {
    background: rgba(200, 16, 46, 0.05) !important;
    border-color: rgba(200, 16, 46, 0.45) !important;
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.10) !important;
}
.nav-search-inp {
    font-size: 13px !important;
    color: var(--fg, #f5f6f8) !important;
}
.nav-search-inp::placeholder {
    color: rgba(255, 255, 255, 0.32) !important;
}

/* Sugerencias / pinned — más sutil y compacto */
.nav-pinned-wrap,
.nav-sug-wrap {
    margin: 4px 10px 6px 10px !important;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 9px;
    padding: 6px;
}
.nav-pinned-head,
.nav-sug-head {
    padding: 4px 8px 6px 8px !important;
    font-size: 9.5px !important;
    font-weight: 800 !important;
    letter-spacing: 1.5px !important;
    color: rgba(245, 166, 35, 0.75) !important;
    text-transform: uppercase;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

/* Headers ÁREAS / LO TUYO */
.nav-sec-fixed-head {
    padding: 14px 14px 6px 14px !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    letter-spacing: 2.2px !important;
    color: rgba(255, 255, 255, 0.32) !important;
    text-transform: uppercase;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

/* Links del nav */
.nav-link {
    padding: 10px 14px !important;
    font-size: 12.5px !important;
    letter-spacing: 0.5px !important;
    font-weight: 600 !important;
    color: rgba(255, 255, 255, 0.65) !important;
    border-radius: 9px !important;
    margin: 2px 0 !important;
    transition: all 0.15s ease !important;
    display: flex !important;
    align-items: center !important;
    gap: 11px !important;
}
.nav-link:hover {
    background: rgba(255, 255, 255, 0.04) !important;
    color: var(--fg, #f5f6f8) !important;
    transform: translateX(2px);
}
.nav-link.active {
    background: linear-gradient(90deg,
        rgba(200, 16, 46, 0.18) 0%,
        rgba(200, 16, 46, 0.06) 70%,
        transparent 100%) !important;
    color: #fff !important;
    border-left: 3px solid #c8102e !important;
    padding-left: 11px !important;
    font-weight: 700 !important;
}
.nav-link .nl-ico {
    font-size: 16px !important;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

/* INICIO destacado */
.nav-link.nav-home {
    background: rgba(200, 16, 46, 0.10) !important;
    border: 1px solid rgba(200, 16, 46, 0.25) !important;
    color: rgba(255, 200, 200, 0.95) !important;
    font-weight: 700 !important;
}
.nav-link.nav-home:hover {
    background: rgba(200, 16, 46, 0.18) !important;
    border-color: rgba(200, 16, 46, 0.50) !important;
}
.nav-link.nav-home.active {
    background: linear-gradient(135deg, #e11d48, #c8102e 50%, #8a0a1f) !important;
    border-color: #c8102e !important;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(200, 16, 46, 0.45);
}

/* NUEVA VENTA — verde brand */
.nav-link.nav-hot {
    background: linear-gradient(135deg, #16a34a, #15803d 60%, #166534) !important;
    color: #fff !important;
    border: 1px solid rgba(34, 197, 94, 0.40) !important;
    font-weight: 800 !important;
    box-shadow: 0 3px 10px rgba(34, 197, 94, 0.30);
}
.nav-link.nav-hot:hover {
    background: linear-gradient(135deg, #22c55e, #16a34a) !important;
    box-shadow: 0 6px 18px rgba(34, 197, 94, 0.50);
    transform: translateY(-1px);
}

/* HUBS con iconos en cards */
.nav-link.nav-hub {
    position: relative;
    padding-left: 10px !important;
}
.nav-link.nav-hub .nl-ico {
    width: 30px !important;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 7px;
    font-size: 16px !important;
    line-height: 1;
}
.nav-link.nav-hub:hover .nl-ico {
    background: rgba(200, 16, 46, 0.18);
    transform: scale(1.05);
}
.nav-link.nav-hub.active .nl-ico {
    background: rgba(255, 255, 255, 0.15);
}

/* Badges en links */
.nav-link .nl-badge,
.nav-link-row .nl-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    margin-left: auto;
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    border-radius: 10px;
    border: 1.5px solid var(--bg-0, #0b0d10);
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.40);
    font-variant-numeric: tabular-nums;
}


/* ==============================================================
   3. BOTON NOVEDADES DEL SISTEMA (changelog)
   ============================================================== */
.btn-novedades-sis {
    position: relative;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 30px !important;
    height: 30px !important;
    background: rgba(168, 85, 247, 0.10) !important;
    border: 1px solid rgba(168, 85, 247, 0.28) !important;
    border-radius: 7px !important;
    font-size: 14px !important;
    color: #c084fc !important;
    text-decoration: none !important;
    flex-shrink: 0;
    transition: all 0.15s ease;
}
.btn-novedades-sis:hover {
    background: rgba(168, 85, 247, 0.20) !important;
    border-color: rgba(168, 85, 247, 0.55) !important;
    transform: translateY(-1px);
}
.btn-novedades-sis .nov-badge-sis {
    position: absolute;
    top: -5px; right: -5px;
    min-width: 18px; height: 18px;
    padding: 0 5px;
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    color: #fff;
    font-size: 9.5px;
    font-weight: 800;
    border-radius: 9px;
    border: 2px solid #14161a;
    line-height: 14px;
    box-shadow: 0 2px 6px rgba(168, 85, 247, 0.50);
    text-align: center;
}


/* ==============================================================
   4. CHAT INTERNO — Look WhatsApp más fiel
   ============================================================== */

/* Fondo del chat con patrón sutil estilo WhatsApp */
.cw-msgs {
    background:
        radial-gradient(circle at 20% 30%, rgba(34, 197, 94, 0.04) 0%, transparent 30%),
        radial-gradient(circle at 80% 70%, rgba(34, 197, 94, 0.03) 0%, transparent 30%),
        linear-gradient(180deg, #0a0e12 0%, #0f1419 100%) !important;
    background-attachment: local;
}

/* Mensaje saliente (mio) — color verde WhatsApp */
.cw-msg-out .cw-bubble,
.cw-msg-mine .cw-bubble {
    background: linear-gradient(135deg, #075e54 0%, #128c7e 50%, #25d366 100%) !important;
    color: #fff !important;
    border-top-right-radius: 4px !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15) !important;
    position: relative;
}
.cw-msg-out .cw-bubble::after,
.cw-msg-mine .cw-bubble::after {
    /* Cola de la burbuja saliente */
    content: '';
    position: absolute;
    right: -6px;
    top: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 8px 8px;
    border-color: transparent transparent transparent #25d366;
}

/* Mensaje entrante (otro) — gris oscuro con cola */
.cw-msg-in .cw-bubble,
.cw-msg-other .cw-bubble {
    background: linear-gradient(135deg, #1f2c33, #1a242a) !important;
    color: #e9edef !important;
    border-top-left-radius: 4px !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.20) !important;
    position: relative;
}
.cw-msg-in .cw-bubble::before,
.cw-msg-other .cw-bubble::before {
    /* Cola de la burbuja entrante */
    content: '';
    position: absolute;
    left: -6px;
    top: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 8px 8px 0;
    border-color: transparent #1f2c33 transparent transparent;
}

/* Hora y check marks WhatsApp-style */
.cw-meta {
    font-size: 10px !important;
    opacity: 0.65;
    margin-left: 6px;
    font-variant-numeric: tabular-nums;
}
.cw-msg-out .cw-meta,
.cw-msg-mine .cw-meta {
    color: rgba(255, 255, 255, 0.85);
}
.cw-msg-out .cw-meta::after,
.cw-msg-mine .cw-meta::after {
    content: ' ✓✓';
    color: #4fc3f7;
    font-weight: 800;
    margin-left: 2px;
}

/* Avatar con borde sutil */
.cw-row .cw-avatar,
.cw-head .cw-head-avatar {
    background: linear-gradient(135deg, #075e54, #128c7e) !important;
    border: 2px solid rgba(255, 255, 255, 0.05);
}

/* Fila de empleado seleccionada */
.cw-row.is-sel {
    background: rgba(7, 94, 84, 0.18) !important;
    border-left-color: #25d366 !important;
}

/* Header del chat con dot online */
.cw-head .cw-head-avatar {
    position: relative;
}
.cw-head .cw-head-avatar::after {
    content: '';
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 12px; height: 12px;
    background: #25d366;
    border: 2px solid var(--mn-bg-1, #14171d);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(37, 211, 102, 0.55);
}

/* Input area abajo: redondeado tipo whatsapp */
.cw-form input,
.cw-form textarea {
    background: var(--mn-bg-2, #1c2028) !important;
    border-radius: 22px !important;
    padding: 10px 16px !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    transition: all 0.15s !important;
}
.cw-form input:focus,
.cw-form textarea:focus {
    border-color: rgba(37, 211, 102, 0.40) !important;
    background: rgba(37, 211, 102, 0.04) !important;
}

/* Boton enviar circular verde */
.cw-form button[type="submit"],
.cw-form .cw-send-btn,
button.cw-send {
    background: linear-gradient(135deg, #075e54, #25d366) !important;
    border-radius: 50% !important;
    width: 42px !important;
    height: 42px !important;
    padding: 0 !important;
    color: #fff !important;
    box-shadow: 0 3px 10px rgba(37, 211, 102, 0.30);
    transition: all 0.15s;
}
button.cw-send:hover {
    transform: scale(1.06);
    box-shadow: 0 5px 16px rgba(37, 211, 102, 0.50);
}


/* ==============================================================
   5. SIDEBAR COMPACTO (toggle en mobile/desktop)
   ============================================================== */
@media (min-width: 901px) {
    /* Modo compacto: sidebar 64px, solo iconos */
    body.side-compact .app-side {
        width: 64px !important;
        min-width: 64px !important;
        max-width: 64px !important;
    }
    body.side-compact .brand-name { display: none; }
    body.side-compact .nav-user .nu-info,
    body.side-compact .nav-user .cc-wrap { display: none; }
    body.side-compact .nav-user {
        grid-template-columns: 1fr !important;
        justify-content: center !important;
        padding: 12px 8px !important;
    }
    body.side-compact .nav-user .nu-avatar {
        margin: 0 auto;
    }
    body.side-compact .nav-search-wrap,
    body.side-compact .nav-pinned-wrap,
    body.side-compact .nav-sug-wrap,
    body.side-compact .nav-sec-fixed-head,
    body.side-compact .nav-pinned-head,
    body.side-compact .nav-sug-head { display: none !important; }
    body.side-compact .nav-link {
        padding: 12px 0 !important;
        justify-content: center !important;
        gap: 0 !important;
    }
    body.side-compact .nav-link .nl-txt,
    body.side-compact .nav-link .nl-badge,
    body.side-compact .nav-link-row .nl-badge { display: none !important; }
    body.side-compact .nav-link.nav-hub { padding-left: 0 !important; }
    body.side-compact .nav-link.nav-home,
    body.side-compact .nav-link.nav-hot {
        margin: 4px 8px !important;
    }
    body.side-compact .nav-pin-btn { display: none !important; }
    /* Tooltip al hover sobre los iconos en modo compacto */
    body.side-compact .nav-link {
        position: relative;
    }
    body.side-compact .nav-link::after {
        content: attr(data-tooltip);
        position: absolute;
        left: 100%;
        top: 50%;
        transform: translateY(-50%) translateX(8px);
        background: rgba(20, 23, 30, 0.95);
        color: #f5f6f8;
        padding: 6px 10px;
        border-radius: 6px;
        font-size: 12px;
        font-weight: 600;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: all 0.18s ease;
        z-index: 100;
        border: 1px solid rgba(200, 16, 46, 0.30);
        box-shadow: 0 4px 14px rgba(0,0,0,0.40);
    }
    body.side-compact .nav-link:hover::after {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

/* Botón del toggle (sutil, abajo a la izquierda del sidebar) */
.side-compact-toggle {
    position: fixed;
    bottom: 14px;
    left: 14px;
    width: 32px;
    height: 32px;
    background: rgba(20, 23, 30, 0.85);
    color: rgba(245, 166, 35, 0.85);
    border: 1px solid rgba(245, 166, 35, 0.30);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    z-index: 100;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    backdrop-filter: blur(6px);
}
.side-compact-toggle:hover {
    background: rgba(245, 166, 35, 0.18);
    color: #fbbf24;
    transform: scale(1.08);
}
@media (max-width: 900px) {
    .side-compact-toggle { display: none !important; }
}
body.side-compact .side-compact-toggle { left: 78px; }


/* ==============================================================
   6. PRINT STYLESHEET GLOBAL — TANDA 9
   ============================================================== */
@media print {
    /* Ocultar elementos de UI que no son contenido */
    body .app-side,
    body .app-top,
    body .ap-btn-flotante,
    body .chd-shell,
    body .manolin-egg,
    body .manolin-shell,
    body .mb-bottom-nav,
    body .mb-fab-scan,
    body .side-compact-toggle,
    body .mn-tip-atajos,
    body #mn-side-compact-btn {
        display: none !important;
    }
    /* Layout principal sin margen */
    body .app-main,
    body .layout-main {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    body .app-shell {
        display: block !important;
    }
    /* Fondo blanco, texto negro para imprimir tinta */
    body {
        background: #fff !important;
        color: #000 !important;
    }
    /* Cards sin sombras (que gastan tinta) */
    body * {
        box-shadow: none !important;
        text-shadow: none !important;
    }
    /* Botones no se imprimen */
    body button,
    body .no-print,
    body .btn {
        display: none !important;
    }
    /* Pero sí los headings y el contenido */
    body h1, body h2, body h3, body p, body table, body ul, body ol, body div.man-content {
        display: block !important;
        color: #000 !important;
    }
    body .man-content {
        background: #fff !important;
    }
    /* Tablas con bordes claros */
    body table { border-collapse: collapse !important; }
    body table td, body table th {
        border: 1px solid #999 !important;
        color: #000 !important;
    }
    /* No cortar elementos importantes entre páginas */
    h1, h2, h3 { page-break-after: avoid; }
    table, .man-tip, .man-warn { page-break-inside: avoid; }
}


/* ==============================================================
   7. VERSION CHIP — TANDA 9
   ============================================================== */
.mn-version-chip {
    position: fixed;
    bottom: 14px;
    right: 14px;
    background: rgba(20, 23, 30, 0.55);
    color: rgba(255, 255, 255, 0.40);
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    z-index: 99;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.18s ease;
    pointer-events: auto;
    font-variant-numeric: tabular-nums;
}
.mn-version-chip:hover {
    background: rgba(20, 23, 30, 0.85);
    color: rgba(245, 166, 35, 0.95);
    border-color: rgba(245, 166, 35, 0.30);
}
@media (max-width: 900px) {
    .mn-version-chip { display: none !important; }
}
/* En POS fullscreen también ocultar */
body.pos-fullscreen .mn-version-chip,
body.ep-fullscreen .mn-version-chip { display: none !important; }
