/* ============================================================
   bento.css — Bento grid de funciones (.modules-v2)
   ============================================================ */

/* ==========================================
   CORRECCIÓN FINAL: BENTO GRID RESPONSIVO
   ========================================== */

/* PANTALLAS MEDIANAS Y TABLETAS (Máximo 2 columnas) */
@media (max-width: 1024px) {
    .bento-grid-v2 {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        /* Estricto: 2 columnas */
        grid-template-rows: auto !important;
        gap: 16px !important;
    }

    /* Reseteamos los rangos del diseño de escritorio */
    .cv-ventas,
    .cv-inventario,
    .cv-equipo,
    .cv-finanzas,
    .cv-clientes,
    .cv-reportes {
        grid-column: auto !important;
        grid-row: auto !important;
    }

    /* Las tarjetas de Ventas y Reportes ocupan el ancho completo (las 2 columnas) */
    .cv-ventas,
    .cv-reportes {
        grid-column: span 2 !important;
    }

    .card-v2 {
        min-height: 220px !important;
        height: auto !important;
        padding: 24px !important;
    }
}

/* TELÉFONOS MÓVILES (Fuerza 1 sola columna y adapta textos) */
@media (max-width: 768px) {
    .modules-v2 {
        padding: 50px 0 !important;
    }

    .modules-v2 .section-title {
        font-size: 26px !important;
        line-height: 1.2;
    }

    .modules-v2 .section-subtitle {
        font-size: 14px !important;
        margin-bottom: 30px !important;
    }

    /* Convertimos la rejilla a Flexbox vertical para asegurar 1 sola columna real */
    .bento-grid-v2 {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
        padding: 0 16px !important;
    }

    /* Forzamos que cada tarjeta ocupe el 100% de la anchura */
    .card-v2 {
        width: 100% !important;
        height: auto !important;
        min-height: auto !important;
        padding: 24px !important;
        border-radius: 20px !important;
    }

    /* Textos proporcionales para lectura cómoda */
    .card-v2 h3 {
        font-size: 18px !important;
        margin-bottom: 6px !important;
        font-weight: 800;
        color: inherit !important;
    }

    .card-v2 p {
        font-size: 13px !important;
        line-height: 1.45 !important;
        color: inherit !important;
    }

    /* Ajuste específico de la tarjeta de Ventas */
    .cv-ventas {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 20px !important;
        background: #0F172A !important;
    }

    .cv-ventas .text-content-wide {
        max-width: 100% !important;
    }

    .cv-ventas .widget-receipt {
        position: relative !important;
        right: 0 !important;
        bottom: 0 !important;
        margin-top: 10px !important;
        transform: rotate(3deg) !important;
        width: 120px !important;
        padding: 12px !important;
        align-self: flex-end;
        /* Alinea el ticket a la derecha */
    }

    /* Ajuste específico de la tarjeta de Reportes */
    .cv-reportes {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 20px !important;
    }

    .cv-reportes .text-content-wide {
        max-width: 100% !important;
    }

    .cv-reportes .widget-h-bars {
        margin-left: 0 !important;
        width: 100% !important;
        margin-top: 10px !important;
    }

    /* Limpieza de márgenes de widgets para el flujo vertical */
    .widget-stock,
    .widget-team,
    .widget-vip {
        margin-bottom: 16px !important;
    }

    .widget-chart-up {
        margin-bottom: 16px !important;
        display: inline-block !important;
    }
}



/* --- BENTO GRID V2 --- */
.modules-v2 {
    padding: 100px 0;
    background: #F8FAFC;
    text-align: center;
}

.modules-v2 .section-title {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -2px;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.modules-v2 .section-subtitle {
    color: var(--text-gray);
    font-size: 16px;
    margin-bottom: 60px;
    max-width: 550px;
    margin: 0 auto 60px auto;
}

.bento-grid-v2 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: 280px 280px;
    gap: 24px;
    max-width: 1240px;
    margin: 0 auto;
}

.card-v2 {
    border-radius: 32px;
    padding: 35px;
    text-align: left;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.card-v2:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}

.cv-ventas {
    grid-column: 1 / 3;
    grid-row: 1 / 2;
    background: #0F172A;
    color: #FFFFFF;
    flex-direction: row;
    align-items: center;
}

.cv-inventario {
    grid-column: 3 / 4;
    grid-row: 1 / 2;
    background: #FFEDD5;
}

.cv-equipo {
    grid-column: 4 / 5;
    grid-row: 1 / 2;
    background: #FFFFFF;
}

.cv-finanzas {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
    background: #D1FAE5;
}

.cv-clientes {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
    background: #FFFFFF;
}

.cv-reportes {
    grid-column: 3 / 5;
    grid-row: 2 / 3;
    background: linear-gradient(135deg, #4338CA 0%, #3B82F6 100%);
    color: #FFFFFF;
    flex-direction: row;
    align-items: center;
}

.card-v2 h3 {
    font-size: 21px;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.cv-equipo h3,
.cv-clientes h3 {
    color: #1E293B;
    font-size: 21px;
}

.cv-inventario h3 {
    color: #9A3412;
    font-size: 21px;
}

.cv-finanzas h3 {
    color: #065F46;
    font-size: 21px;
}

.card-v2 p {
    font-size: 14px;
    line-height: 1.5;
    opacity: 0.8;
}

.cv-ventas p,
.cv-reportes p {
    opacity: 0.7;
}

.cv-inventario p {
    color: #9A3412;
}

.cv-finanzas p {
    color: #065F46;
}

.cv-equipo p,
.cv-clientes p {
    color: #64748B;
}

.link-v2 {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    margin-top: auto;
    transition: gap 0.2s ease;
}

.card-v2:hover .link-v2 {
    gap: 10px;
}

.cv-ventas .link-v2,
.cv-reportes .link-v2 {
    color: #FFFFFF;
}

.cv-inventario .link-v2 {
    color: #EA580C;
}

.cv-finanzas .link-v2 {
    color: #059669;
}

.cv-equipo .link-v2,
.cv-clientes .link-v2 {
    color: #3B82F6;
}

.text-content-wide {
    max-width: 260px;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

/* WIDGETS BENTO */
.widget-receipt {
    background: #FFFFFF;
    width: 160px;
    border-radius: 12px;
    padding: 16px;
    color: #0F172A;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    transform: rotate(4deg);
    position: absolute;
    right: 40px;
    transition: transform 0.4s ease;
}

.cv-ventas:hover .widget-receipt {
    transform: rotate(0deg) translateY(-5px);
}

.wr-total {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 12px;
    border-bottom: 2px dashed #E2E8F0;
    padding-bottom: 8px;
}

.wr-line {
    height: 6px;
    background: #F1F5F9;
    border-radius: 4px;
    margin-bottom: 8px;
    width: 100%;
}

.wr-line.short {
    width: 60%;
}

.widget-stock {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 12px 16px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(234, 88, 12, 0.1);
    margin-bottom: 20px;
}

.ws-icon {
    width: 36px;
    height: 36px;
    background: #FFF7ED;
    color: #EA580C;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.ws-text span {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #EA580C;
}

.ws-text strong {
    display: block;
    font-size: 14px;
    color: #9A3412;
}

.widget-team {
    display: flex;
    margin-bottom: 24px;
    padding-left: 10px;
}

.team-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid #FFFFFF;
    margin-left: -12px;
    background-size: cover;
    background-position: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.widget-chart-up {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 16px;
    width: fit-content;
    margin-bottom: 24px;
    box-shadow: 0 4px 15px rgba(5, 150, 105, 0.1);
}

.wcu-badge {
    background: #D1FAE5;
    color: #059669;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    display: inline-block;
    margin-bottom: 8px;
}

.widget-vip {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: #EFF6FF;
    color: #3B82F6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 24px;
}

.widget-h-bars {
    flex: 1;
    margin-left: 40px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wh-bar-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
}

.wh-label {
    font-size: 12px;
    font-weight: 600;
    width: 40px;
}

.wh-track {
    flex: 1;
    height: 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    overflow: hidden;
}

.wh-fill {
    height: 100%;
    background: #FFFFFF;
    border-radius: 5px;
}

