<style>
    :root {
        --bg-custom: {{ request.user.perfilusuario.color_fondo|default:"#0b0b0b" }};
    }

    /* =========================
       FONDO GENERAL
    ========================== */
    body {
        background-color: var(--bg-custom) !important;
        background-image: none !important;
    }

    body, html {
        background: url("{% static 'core/PymeStockFondo.png' %}") no-repeat center center fixed !important;
        background-size: cover !important;
    }

    /* =========================
       NAVBAR
    ========================== */
    .navbar {
        background-color: #1a1a1a !important;
        padding: 12px 20px;
        border-bottom: 1px solid #333 !important;
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .navbar-brand,
    .nav-link {
        color: #ffffff !important;
    }

    .nav-link-custom {
        color: #aaa;
        text-decoration: none;
        font-size: 1.2rem;
        transition: 0.3s;
        position: relative;
    }

    .nav-link-custom:hover {
        color: var(--primary);
    }

    .badge-notify {
        position: absolute;
        top: -5px;
        right: -10px;
        font-size: 0.65rem;
        padding: 2px 5px;
        border: 2px solid #121212;
    }

    /* =========================
       EFECTO GLASS
    ========================== */
    .navbar,
    .card,
    .modal-content {
        background-color: rgba(255, 255, 255, 0.05) !important;
        backdrop-filter: blur(8px);
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    /* =========================
       COLOR PICKER
    ========================== */
    .color-picker-wrapper {
        position: relative;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 10px;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .color-picker-wrapper:hover {
        background: rgba(255, 255, 255, 0.2);
        border-color: #007bff;
        transform: scale(1.05);
    }

    .color-picker-wrapper i {
        font-size: 1.2rem;
        color: #fff;
        z-index: 1;
    }

    #color-picker {
        position: absolute;
        inset: 0;
        opacity: 0;
        cursor: pointer;
    }

    /* =========================
       GRID / CARDS
    ========================== */
    .grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
        margin-bottom: 30px;
    }

    .stat-card {
        background: var(--card-bg);
        padding: 20px;
        border-radius: 20px;
        border: 1px solid #333;
        text-align: center;
        transition: 0.3s;
    }

    .stat-card:hover {
        border-color: var(--primary);
        box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
    }

    .stat-danger {
        border-left: 4px solid #ff5252;
    }

    .stat-danger p {
        color: #ff5252;
    }

    .chart-container {
        background: var(--card-bg);
        border-radius: 25px;
        padding: 20px;
        margin-bottom: 30px;
        display: flex;
        flex-direction: column;
        align-items: center;
        overflow: hidden;
    }

    /* =========================
       DROPDOWN (LIMPIO Y FUNCIONAL)
    ========================== */
    .dropdown {
        position: relative;
        z-index: 2001 !important;
    }

    .dropdown-menu {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        min-width: 160px;
        padding: 0.5rem 0;
        background-color: #2b2b2b;
        border: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: 0.25rem;
    }

    .dropdown-menu.show {
        display: block !important;
        position: fixed !important;
        top: 60px !important;
        right: 10px !important;
        left: auto !important;
        z-index: 2000 !important;
    }

    .dropdown-item {
        display: block;
        width: 100%;
        padding: 0.5rem 1rem;
        color: white;
        text-decoration: none;
        background-color: transparent;
        border: 0;
    }

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

    .dropdown-divider {
        margin: 0.5rem 0;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
    }

    /* =========================
       TICKET
    ========================== */
    #contenedor-ticket,
    .card-ticket-venta {
        z-index: 1 !important;
    }

    #contenedor-logica-escaneo {
        position: sticky;
        top: 10px;
        z-index: 1020;
        margin-bottom: 20px;
    }

    /* =========================
       ESCÁNER
    ========================== */
    #reader-venta {
        width: 100% !important;
        max-height: 300px;
        overflow: hidden;
        border: 2px solid #0dcaf0;
        border-radius: 15px;
        position: relative;
    }

    #reader-venta::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 5%;
        right: 5%;
        height: 2px;
        background-color: #ff0000;
        box-shadow: 0 0 12px #ff0000, 0 0 4px #fff;
        z-index: 100;
        animation: laser-anim 1.5s infinite;
    }

    #reader-venta.laser-success::after {
        background-color: #00ff00 !important;
        box-shadow: 0 0 20px #00ff00, 0 0 6px #fff !important;
        height: 4px;
    }

    .shake-effect {
        animation: shake 0.5s;
    }

    @keyframes shake {
        0%,100% { transform: translateX(0); }
        25% { transform: translateX(-5px); }
        75% { transform: translateX(5px); }
    }

    /* =========================
       GLASS CARD FORMS
    ========================== */
    .glass-card {
        background: rgba(255, 255, 255, 0.03) !important;
        backdrop-filter: blur(15px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 20px;
    }

    .glass-card input[type="password"],
    .glass-card input[type="email"],
    .glass-card input[type="text"] {
        width: 100%;
        padding: 12px;
        margin: 8px 0;
        background: rgba(255, 255, 255, 0.07);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        color: white;
        outline: none;
    }

    .dropdown-menu-dark {
        z-index: 2000 !important;
    }
    /* Tarjetas del Dashboard tipo consola */
    .card {
        background: rgba(255, 255, 255, 0.03) !important;
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        border-radius: 15px !important;
        transition: transform 0.3s ease;
    }
    
    .card:hover {
        transform: translateY(-5px);
        border-color: var(--bs-info) !important;
    }
    
    /* Botones principales con más "onda" */
    .btn-success {
        background: linear-gradient(135deg, #198754 0%, #146c43 100%);
        border: none;
        box-shadow: 0 4px 15px rgba(25, 135, 84, 0.3);
    }
    
    .btn-primary {
        background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
            border: none;
        box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
    }

    /* El reloj con look digital */
    #reloj {
        letter-spacing: 2px;
        text-shadow: 0 0 8px rgba(13, 202, 240, 0.5);
    }
    /* Para que los textos se vean en el fondo oscuro */
    main, .container {
        color: #ffffff;
    }
    
    /* Las tarjetas que antes tenían bordes */
    .dashboard-card {
        background: #111;
        border: 1px solid #333;
        border-radius: 12px;
        padding: 20px;
        margin-bottom: 20px;
    }
    
    /* La dona de Chart.js centrada */
    .chart-container {
        position: relative;
        margin: auto;
        height: 300px;
        width: 300px;
    }
    /* Contenedor principal del Dashboard */
.dashboard-container {
    max-width: 900px;
    margin: 0 auto;
    color: #ffffff;
}

    /* Tarjetas de estadísticas (Artículos, Valor Total, etc.) */
    .stat-card {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 15px;
        padding: 20px;
        text-align: center;
        transition: all 0.3s ease;
    }
    
    .stat-card:hover {
        border-color: #00d4ff;
        background: rgba(255, 255, 255, 0.08);
    }
    
    .stat-card h3 {
        color: #adb5bd !important; /* Gris claro de Bootstrap */
        font-size: 0.85rem;
        text-transform: uppercase;
        letter-spacing: 1px;
        margin-bottom: 10px;
    }
    
    .stat-card p {
        color: #00d4ff !important;
        font-size: 1.8rem;
        font-weight: 700;
        margin: 0;
    }
    
    /* Contenedor de la Dona (Chart.js) */
    .chart-box {
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 20px;
        padding: 30px;
        display: flex;
        justify-content: center;
        align-items: center;
        min-height: 350px;
    }
    
    /* Botones de acción (Ladrillos) */
    .btn-grid-action {
        background: #1e1e1e;
        border: 1px solid #333;
        color: #fff !important;
        padding: 20px 10px;
        border-radius: 12px;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        transition: 0.2s;
    }
    
    .btn-grid-action:hover {
        background: #252525;
        border-color: #00d4ff;
        color: #00d4ff !important;
        transform: translateY(-3px);
    }
    .dashboard-limiter {
        max-width: 1950px; /* Ajustalo a tu gusto */
        margin: 0 auto;
    }
    /* Forzar que TODO el dashboard tenga texto claro */
    .dashboard-container, .dashboard-container h3, .dashboard-container p, .dashboard-container span {
            color: #ffffff !important;
    }
    
    /* Los 6 links de abajo: Estilo "Botón Flotante" */
    .btn-grid-action {
        background: rgba(255, 255, 255, 0.08); /* Fondo sutil */
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 12px;
        padding: 15px 10px;
        text-align: center;
        text-decoration: none !important;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        transition: all 0.3s ease;
        height: 100%; /* Para que todos midan lo mismo */
    }
    
    .btn-grid-action:hover {
        background: rgba(0, 212, 255, 0.2);
        border-color: #00d4ff;
        transform: translateY(-3px);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    }
    
    .btn-grid-action span:first-child {
        font-size: 1.5rem; /* El emoji más grande */
    }
    
    .btn-grid-action span:last-child {
        color: #ffffff !important;
        font-size: 0.85rem;
        font-weight: 500;
    }

    .owner-card img {
        max-height: 350px !important; /* Subimos de 200 a 350 */
        width: 100%;
        object-fit: contain;
        background: rgba(0,0,0,0.2);
        padding: 10px;
    }

</style>
