/* ═══════════════════════════════════════
   card.css — Stat Cards & Section Cards
   ═══════════════════════════════════════ */

/* ── Stats Grid ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    width: 100%;
    padding: 16px;
    margin-bottom: 16px;
}

/* ── Stat Card ── */
.rx-stat-card {
    background: white;
    border-radius: 24px;
    padding: 18px 20px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    min-height: 120px;
    width: 100%;
}

    .rx-stat-card:hover {
        transform: translateY(-3px);
        border-color: #1f6392;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    }

.card-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-info {
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.card-value {
    font-size: 34px;
    font-weight: 800;
    color: #1f6392;
    line-height: 1;
}

.card-subtitle {
    margin-top: 8px;
    font-size: 12px;
    color: #64748b;
}

.card-icon {
    color: #6c8eae;
    font-size: 42px;
}

.rx-stat-card:hover .card-icon {
    color: #1f6392;
}

/* ── Section Card (used in Prescription, Smart Assistant) ── */
.section-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

    .section-card .mud-card-content {
        flex: 1;
        overflow: hidden;
        padding: 16px;
        display: flex;
        flex-direction: column;
        min-height: 0;
        gap: 0;
    }

    .section-card .mud-card-header {
        padding: 10px 16px !important;
        border-bottom: 1px solid #e2e8f0;
        flex-shrink: 0;
    }

        .section-card .mud-card-header .mud-typography {
            font-size: 0.9rem !important;
        }

/* ── Responsive ── */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 12px;
        padding: 12px;
        margin-bottom: 12px;
    }

    .rx-stat-card {
        padding: 14px 16px;
        min-height: 100px;
        border-radius: 18px;
    }

    .card-value {
        font-size: 26px;
    }

    .card-icon {
        font-size: 34px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 8px;
        margin-bottom: 8px;
    }

    .rx-stat-card {
        padding: 12px 14px;
        min-height: 90px;
        border-radius: 14px;
    }

    .card-value {
        font-size: 22px;
    }

    .card-icon {
        font-size: 28px;
    }
}

/* ── Report Stat Cards (used by ReportPage) ── */
.stat-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #e8ecf1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    min-width: 0;
}

.stat-card-inner {
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-value {
    font-size: 26px;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.2;
}

.stat-title {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-top: 2px;
}

.stat-subtitle {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

.stat-trend {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 8px;
    white-space: nowrap;
}

    .stat-trend.up {
        color: #16a34a;
        background: #dcfce7;
    }

    .stat-trend.down {
        color: #dc2626;
        background: #fee2e2;
    }

/* آیکن‌های کارت‌های آماری گزارشات سفید */
.stat-icon .mud-icon-root {
    color: #ffffff !important;
}

/* ── Report Stat Cards - Mobile ── */
@media (max-width: 600px) {
    .reports-page .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 10px;
    }

    .stat-card {
        padding: 12px;
        border-radius: 14px;
    }

    .stat-card-inner {
        gap: 10px;
        align-items: flex-start;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        border-radius: 11px;
    }

    .stat-icon .mud-icon-root {
        font-size: 22px;
    }

    .stat-value {
        font-size: 20px;
    }

    .stat-title {
        font-size: 12px;
    }

    .stat-subtitle {
        font-size: 10px;
    }

    /* نشانگر روند زیر محتوا تا کارت بهم نریزد */
    .stat-trend {
        display: none;
    }
}
