/* Extraído de index.html (bloque de estilo #5) */
                    /* Custom beautiful CSS styles for Reports panel */
                    .reports-dashboard {
                        display: grid;
                        grid-template-columns: 290px 1fr;
                        gap: 20px;
                        margin-top: 15px;
                    }

                    @media (max-width: 1024px) {
                        .reports-dashboard {
                            grid-template-columns: 1fr;
                        }
                    }

                    .reports-sidebar {
                        display: flex;
                        flex-direction: column;
                        gap: 15px;
                    }

                    .reports-content {
                        display: flex;
                        flex-direction: column;
                        gap: 20px;
                    }

                    .reports-kpi-grid {
                        display: grid;
                        grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
                        gap: 15px;
                    }

                    .reports-card {
                        background: #ffffff;
                        border-radius: 16px;
                        padding: 20px;
                        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
                        border: 1px solid #e2e8f0;
                        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
                    }

                    .reports-card:hover {
                        transform: translateY(-2px);
                        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
                    }

                    .kpi-card {
                        position: relative;
                        overflow: hidden;
                    }

                    .kpi-card::before {
                        content: '';
                        position: absolute;
                        top: 0;
                        left: 0;
                        width: 4px;
                        height: 100%;
                    }

                    .kpi-ventas::before {
                        background: #10b981;
                    }

                    .kpi-facturado::before {
                        background: #0ea5e9;
                    }

                    .kpi-gastos::before {
                        background: #ef4444;
                    }

                    .kpi-utilidad::before {
                        background: #3b82f6;
                    }

                    .kpi-ticket::before {
                        background: #f59e0b;
                    }

                    .kpi-title {
                        font-size: 0.82rem;
                        font-weight: 700;
                        color: #64748b;
                        text-transform: uppercase;
                        letter-spacing: 0.5px;
                        margin-bottom: 8px;
                        display: flex;
                        align-items: center;
                        gap: 6px;
                    }

                    .kpi-value {
                        font-size: 1.75rem;
                        font-weight: 800;
                        color: #0f172a;
                        margin-bottom: 4px;
                        letter-spacing: -0.5px;
                    }

                    .kpi-subtext {
                        font-size: 0.78rem;
                        color: #64748b;
                        font-weight: 500;
                    }

                    .reports-chart-grid {
                        display: grid;
                        /* minmax(0, …): sin esto una columna se estira con su contenido y la tarjeta se sale. */
                        grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
                        gap: 20px;
                    }

                    @media (max-width: 900px) {
                        .reports-chart-grid {
                            grid-template-columns: 1fr;
                        }
                    }

                    .reports-rankings-grid {
                        display: grid;
                        grid-template-columns: 1fr 1fr;
                        gap: 20px;
                    }

                    @media (max-width: 768px) {
                        .reports-rankings-grid {
                            grid-template-columns: 1fr;
                        }
                    }

                    /* Modern Period Buttons */
                    .period-btn-group {
                        display: grid;
                        grid-template-columns: repeat(2, 1fr);
                        gap: 8px;
                    }

                    .reports-btn {
                        background: #f8fafc;
                        color: #475569;
                        border: 1px solid #e2e8f0;
                        padding: 10px 12px;
                        border-radius: 10px;
                        font-size: 0.85rem;
                        font-weight: 600;
                        cursor: pointer;
                        transition: all 0.2s ease;
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        gap: 6px;
                    }

                    .reports-btn:hover {
                        background: #f1f5f9;
                        border-color: #cbd5e1;
                        color: #1e293b;
                    }

                    .reports-btn.active {
                        background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
                        color: white;
                        border-color: transparent;
                        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
                    }

                    .reports-title-bar {
                        display: flex;
                        justify-content: space-between;
                        align-items: center;
                        margin-bottom: 20px;
                        background: linear-gradient(135deg, #0066cc 0%, #004499 100%);
                        padding: 22px;
                        border-radius: 20px;
                        color: white;
                        box-shadow: 0 10px 25px -5px rgba(0, 102, 204, 0.15);
                    }

                    .reports-title-info h2 {
                        margin: 0;
                        font-size: 1.5rem;
                        font-weight: 800;
                        letter-spacing: -0.5px;
                        display: flex;
                        align-items: center;
                        gap: 10px;
                    }

                    .reports-title-info p {
                        margin: 5px 0 0 0;
                        color: #94a3b8;
                        font-size: 0.88rem;
                    }

                    /* Modern Lists for rankings */
                    .ranking-item {
                        display: flex;
                        align-items: center;
                        justify-content: space-between;
                        padding: 12px 16px;
                        border-radius: 12px;
                        background: #f8fafc;
                        border: 1px solid #f1f5f9;
                        transition: all 0.2s ease;
                    }

                    .ranking-item:hover {
                        background: #f1f5f9;
                        border-color: #e2e8f0;
                    }

                    .ranking-badge {
                        width: 28px;
                        height: 28px;
                        border-radius: 50%;
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        font-weight: 700;
                        font-size: 0.85rem;
                    }

                    .badge-1 {
                        background: #fef3c7;
                        color: #d97706;
                    }

                    .badge-2 {
                        background: #e2e8f0;
                        color: #475569;
                    }

                    .badge-3 {
                        background: #ffedd5;
                        color: #ea580c;
                    }

                    .badge-other {
                        background: #f1f5f9;
                        color: #64748b;
                    }

                    /* Quick Info Banner */
                    .info-banner {
                        background: #f0f9ff;
                        border: 1px solid #e0f2fe;
                        color: #0369a1;
                        padding: 14px 18px;
                        border-radius: 14px;
                        font-size: 0.85rem;
                        display: flex;
                        align-items: flex-start;
                        gap: 12px;
                        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
                    }

                    /* Print stylesheet */
                    @media print {
                        body * {
                            visibility: hidden;
                        }

                        #view-reportes,
                        #view-reportes * {
                            visibility: visible;
                        }

                        #view-reportes {
                            position: absolute;
                            left: 0;
                            top: 0;
                            width: 100% !important;
                            margin: 0 !important;
                            padding: 0 !important;
                        }

                        .reports-sidebar,
                        .info-banner,
                        .reports-title-bar,
                        button,
                        select,
                        input {
                            display: none !important;
                        }

                        .reports-dashboard {
                            grid-template-columns: 1fr !important;
                        }
                    }

/* Reportes: superficie neutra y legible también con Liquid Glass activo. */
#view-reportes {
    background: #f6f7fb;
    border-radius: 22px;
    padding: 18px;
    color: #172033;
}

#view-reportes .reports-title-bar,
body.liquid-glass-preview.liquid-glass-preview #view-reportes .reports-title-bar {
    background: #ffffff !important;
    color: #172033 !important;
    border: 1px solid #e5e7eb !important;
    border-left: 5px solid #6d5dfc !important;
    box-shadow: 0 12px 30px -24px rgba(15, 23, 42, .45) !important;
}

#view-reportes .reports-title-info h2,
body.liquid-glass-preview.liquid-glass-preview #view-reportes .reports-title-info h2 {
    color: #172033 !important;
}

#view-reportes .reports-title-info h2 .material-symbols-outlined {
    color: #6d5dfc !important;
}

#view-reportes .reports-title-info p,
body.liquid-glass-preview.liquid-glass-preview #view-reportes .reports-title-info p {
    color: #667085 !important;
}

#view-reportes .reports-content,
#view-reportes .reports-sidebar,
#view-reportes .reports-card {
    min-width: 0;
}

#view-reportes .reports-card,
body.liquid-glass-preview.liquid-glass-preview #view-reportes .reports-card {
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: 0 12px 32px -26px rgba(15, 23, 42, .5) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

#view-reportes .reports-card:hover,
body.liquid-glass-preview.liquid-glass-preview #view-reportes .reports-card:hover {
    transform: none !important;
    box-shadow: 0 15px 36px -26px rgba(15, 23, 42, .55) !important;
}

#view-reportes .kpi-title,
#view-reportes .kpi-subtext {
    color: #667085 !important;
}

#view-reportes .kpi-value {
    color: #172033 !important;
}

#view-reportes .report-origin-card,
body.liquid-glass-preview.liquid-glass-preview #view-reportes .report-origin-card {
    margin-bottom: 4px;
    border: 1px solid #e7e5f4 !important;
    border-top: 4px solid #7867e8 !important;
    border-radius: 18px !important;
    overflow: hidden;
}

#view-reportes .report-origin-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

#view-reportes .report-origin-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

/* Botón secundario: el morado sólido competía con el título del informe. */
#view-reportes .report-origin-print {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid #e4e0f5;
    border-radius: 10px;
    background: #ffffff;
    color: #5b4bc4 !important;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
#view-reportes .report-origin-print .material-symbols-outlined { font-size: 1.05rem; color: inherit !important; }
#view-reportes .report-origin-print:hover { background: #f6f4ff; border-color: #cfc7f3; }
#view-reportes .report-origin-print:focus-visible { outline: 2px solid #8064e8; outline-offset: 2px; }

/* Métodos de pago: la lista baja debajo de la rueda cuando la tarjeta es angosta. */
#view-reportes .report-payments-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    flex: 1;
    min-width: 0;
}
#view-reportes .report-payments-chart {
    flex: 0 0 140px;
    width: 140px;
    height: 140px;
    position: relative;
    margin: 0 auto;
}
#view-reportes .report-payments-chart canvas { width: 100% !important; height: 100% !important; }
#view-reportes .report-payments-list {
    flex: 1 1 210px;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
#view-reportes .report-payment-row:last-child { border-bottom: 0 !important; }

#view-reportes .report-origin-metric {
    padding: 13px 14px;
    border-radius: 13px;
    border: 1px solid #e8eaf0;
    background: #fafbfc;
}

#view-reportes .report-origin-metric span {
    display: block;
    color: #667085 !important;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .045em;
    text-transform: uppercase;
}

#view-reportes .report-origin-metric strong {
    display: block;
    margin-top: 5px;
    color: #172033 !important;
    font-size: 1.45rem;
    line-height: 1;
}

#view-reportes .report-origin-metric.tone-blue { border-top: 3px solid #4f7cff; }
#view-reportes .report-origin-metric.tone-green { border-top: 3px solid #20a67a; }
#view-reportes .report-origin-metric.tone-purple { border-top: 3px solid #8064e8; }
#view-reportes .report-origin-metric.tone-amber { border-top: 3px solid #e7a43b; }
#view-reportes .report-origin-metric.tone-teal { border-top: 3px solid #0e9f9a; }
#view-reportes .report-origin-metric.tone-slate { border-top: 3px solid #475467; }
#view-reportes .report-origin-metric small {
    display: block;
    margin-top: 6px;
    color: #667085 !important;
    font-size: .68rem;
    font-weight: 600;
}
#view-reportes .report-origin-metric.tone-slate strong { font-size: 1.15rem; overflow-wrap: anywhere; }

#view-reportes .report-origin-tips {
    margin-bottom: 14px;
    padding: 12px 15px;
    border: 1px solid #e4e0f5;
    border-radius: 14px;
    background: #faf9ff;
}
#view-reportes .report-origin-tips h4 {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 8px;
    color: #3d3267 !important;
    font-size: .8rem;
}
#view-reportes .report-origin-tips h4 .material-symbols-outlined { font-size: 1.05rem; color: #6653d3 !important; }
#view-reportes .report-origin-tips ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
#view-reportes .report-origin-tips li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: #344054 !important;
    font-size: .76rem;
    line-height: 1.45;
}
#view-reportes .report-origin-tips li .material-symbols-outlined { flex: 0 0 auto; font-size: 1rem; margin-top: 1px; }
#view-reportes .report-origin-tips li.is-alerta .material-symbols-outlined { color: #c4320a !important; }
#view-reportes .report-origin-tips li.is-bien .material-symbols-outlined { color: #067647 !important; }
#view-reportes .report-origin-tips li.is-idea .material-symbols-outlined { color: #b54708 !important; }

#view-reportes .report-origin-column { display: grid; gap: 14px; min-width: 0; }
#view-reportes .report-origin-group { padding: 4px 0 6px; border-bottom: 1px solid #eceef2; }
#view-reportes .report-origin-group:last-child { border-bottom: 0; }
#view-reportes .report-origin-group .report-origin-channel { border-bottom: 0; padding: 5px 0 5px 14px; }
#view-reportes .report-origin-group.is-missing .report-origin-channel { padding-left: 0; }
#view-reportes .report-origin-group-head {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 0 2px;
}
#view-reportes .report-origin-group-head i { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
#view-reportes .report-origin-group-head b { color: #172033 !important; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; }
#view-reportes .report-origin-group-head span { margin-left: auto; color: #475467 !important; font-size: .72rem; font-weight: 800; }
#view-reportes .report-origin-channel > span em {
    display: block;
    margin-top: 2px;
    color: #067647 !important;
    font-size: .66rem;
    font-style: normal;
    font-weight: 700;
}

#view-reportes .report-origin-mentions { display: flex; flex-wrap: wrap; gap: 6px; }
#view-reportes .report-origin-mentions span {
    max-width: 100%;
    padding: 4px 9px;
    border: 1px solid #e8eaf0;
    border-radius: 999px;
    background: #ffffff;
    color: #475467 !important;
    font-size: .7rem;
    overflow-wrap: anywhere;
}
#view-reportes .report-origin-mentions b { color: #3d3267 !important; font-weight: 800; margin-right: 3px; }
#view-reportes .report-origin-mentions i { color: #6653d3 !important; font-style: normal; font-weight: 800; }

#view-reportes .report-origin-layout {
    display: grid;
    grid-template-columns: minmax(250px, .72fr) minmax(0, 1.28fr);
    gap: 14px;
    align-items: start;
}

#view-reportes .report-origin-panel {
    min-width: 0;
    padding: 15px;
    border: 1px solid #e8eaf0;
    border-radius: 14px;
    background: #fcfcfd;
}

#view-reportes .report-origin-panel h4 {
    margin: 0 0 10px;
    color: #344054 !important;
    font-size: .8rem;
}

#view-reportes .report-origin-channel {
    display: grid;
    grid-template-columns: minmax(95px, 1fr) minmax(70px, 1.45fr) auto;
    align-items: center;
    gap: 9px;
    padding: 8px 0;
    border-bottom: 1px solid #eceef2;
}

#view-reportes .report-origin-channel:last-child { border-bottom: 0; }
#view-reportes .report-origin-channel > span { color: #344054 !important; font-size: .76rem; font-weight: 700; }
#view-reportes .report-origin-channel > strong { color: #475467 !important; font-size: .73rem; text-align: right; white-space: nowrap; }
#view-reportes .report-origin-track { height: 7px; overflow: hidden; border-radius: 99px; background: #eaecf0; }
#view-reportes .report-origin-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #7867e8, #5986f7); }

#view-reportes .report-referral-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
    gap: 9px;
}

#view-reportes .report-referral-item {
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid #e8eaf0;
    border-radius: 12px;
    background: #ffffff;
}

#view-reportes .report-referral-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 9px;
}

#view-reportes .report-referral-head strong {
    min-width: 0;
    color: #3d3267 !important;
    font-size: .78rem;
    overflow-wrap: anywhere;
}

#view-reportes .report-referral-head span {
    flex: 0 0 auto;
    padding: 3px 7px;
    border-radius: 999px;
    background: #f0edff;
    color: #6653d3 !important;
    font-size: .65rem;
    font-weight: 800;
}

#view-reportes .report-referral-item p {
    margin: 7px 0;
    color: #667085 !important;
    font-size: .72rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

#view-reportes .report-referral-item small {
    display: inline-flex;
    padding: 3px 7px;
    border-radius: 999px;
    font-size: .63rem;
    font-weight: 800;
}

#view-reportes .report-referral-item small.is-linked { background: #ecfdf3; color: #067647 !important; }
#view-reportes .report-referral-item small.is-written { background: #fff7e8; color: #b54708 !important; }
#view-reportes .report-origin-empty { padding: 12px; border-radius: 10px; background: #f8fafc; color: #667085 !important; font-size: .78rem; }

@media (max-width: 1180px) {
    #view-reportes .report-origin-layout { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    #view-reportes { padding: 10px; border-radius: 14px; }
    #view-reportes .report-origin-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #view-reportes .report-origin-print { width: 100%; justify-content: center; }
    #view-reportes .report-origin-channel { grid-template-columns: minmax(90px, 1fr) minmax(55px, 1fr) auto; gap: 6px; }
}
