.cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #6f42c1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.card span {
    display: block;
    color: #666;
    margin-bottom: 8px;
}

.card strong {
    font-size: 30px;
    font-weight: 700;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 0;
    margin-bottom: 24px;
}

.panel {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 24px;
}

.panel h2 {
    margin-bottom: 16px;
}

.chart-box {
    position: relative;
    width: 100%;
    height: 340px;
}

.chart-box.large {
    height: 340px;
}

.dashboard-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.report-button {
    height: 38px;
    padding: 0 16px;
    border: none;
    border-radius: 8px;
    background: #f9b115;
    color: #111;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.report-button:hover {
    background: #e0a000;
}

.report-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ==========================================
   REPORT MODAL
========================================== */

.report-modal.hidden {
    display: none;
}

.report-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
}

.report-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.65);
}

.report-modal-panel {
    position: relative;
    width: min(760px, calc(100vw - 48px));
    max-height: calc(100vh - 64px);
    margin: 32px auto;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.report-modal-content {
    padding: 20px 24px;
    overflow-y: auto;
    font-size: 14px;
    color: #111;
}

.report-modal-content h2 {
    text-align: left;
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.report-modal-content h3 {
    font-size: 15px;
    font-weight: 800;
    margin: 12px 0 6px;
}

.report-modal-content h4 {
    font-size: 15px;
    font-weight: 800;
    margin: 22px 0 8px;
}

.report-modal-content p {
    margin-bottom: 14px;
    line-height: 1.5;
}

.report-end {
    text-align: center;
    font-weight: 800;
    margin-top: 20px;
    margin-bottom: 8px;
}

/* ==========================================
   REPORT ACTION BAR
========================================== */

.report-modal-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 14px;
    background: #eaf2fb;
    border-top: 1px solid #dbe5f1;
}

.report-modal-actions label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.report-modal-actions select {
    height: 38px;
    padding: 0 10px;
    border: 1px solid #d7dce3;
    border-radius: 6px;
    background: white;
}

.report-action-button {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 18px;
}

.word-button {
    background: #1f6feb;
}

.whatsapp-button {
    background: #25d366;
}

.close-button {
    background: #ff3b5c;
}

/* ==========================================
   REPORT LOADING
========================================== */

.report-loading {
    padding: 20px 10px;
}

.report-loading h2 {
    text-align: center;
    margin-bottom: 16px;
}

.report-loading-message {
    text-align: center;
    margin-bottom: 24px;
}

.report-loading-steps {
    max-width: 420px;
    margin: 0 auto;
}

.report-loading-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    color: #666;
    font-weight: 600;
}

.report-loading-step span {
    width: 24px;
    display: inline-block;
    text-align: center;
}

.report-loading-step.active {
    color: #1f6feb;
}

.report-loading-step.done {
    color: #15803d;
}

.report-loading-note {
    text-align: center;
    color: #666;
    font-size: 13px;
    margin-top: 24px;
}

.report-source-badge {
    display: flex;
    align-items: center;
    height: 38px;
    margin: 0;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.report-source-badge.cache {
    background: #ecfdf5;
    color: #047857;
}

.report-source-badge.ai {
    background: #eff6ff;
    color: #1d4ed8;
}

/* ==========================================
   MOBILE
========================================== */

@media (max-width: 900px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .dashboard-toolbar {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 20px;
    }

    .date-filter,
    .dashboard-toolbar form,
    .dashboard-toolbar select,
    .dashboard-toolbar input,
    .dashboard-toolbar button {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .report-button {
        width: 100%;
        height: 44px;
    }

    .cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .card {
        width: 100%;
        min-width: 0;
    }

    .grid,
    .grid-3 {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .panel {
        width: 100%;
        min-width: 0;
        overflow: hidden;
    }

    .chart-box,
    .chart-box.large {
        height: 300px;
        overflow: hidden;
    }

    .chart-box canvas {
        max-width: 100% !important;
    }

    .report-modal-panel {
        width: calc(100vw - 20px);
        margin: 10px auto;
    }

    .report-modal-actions {
        flex-wrap: wrap;
    }
}
