/* ==========================================================================
   گزارش‌گیری — هماهنگ با متغیرهای تم برنامه (--theme-*) تا با همهٔ تم‌ها کار کند
   ========================================================================== */

/* ---------- سربرگ صفحه ---------- */
.report-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    margin-bottom: 18px;
    background: linear-gradient(135deg, var(--theme-primary-soft, #e8f1f8) 0%, var(--theme-surface, #fff) 70%);
    border: 1px solid var(--theme-border, #e2e8f0);
    border-radius: 16px;
    box-shadow: var(--theme-shadow, 0 10px 28px rgba(31, 49, 74, .08));
}

.report-hero-icon {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--theme-primary, #1b5e86);
    color: #fff;
    font-size: 1.5rem;
}

.report-hero-text { flex: 1 1 auto; min-width: 0; }

.report-hero-text h1 {
    margin: 0 0 4px;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--theme-text, #263238);
}

.report-hero-text p {
    margin: 0;
    font-size: .8rem;
    line-height: 1.9;
    color: var(--theme-muted, #718096);
}

@media (max-width: 640px) {
    .report-hero { flex-wrap: wrap; }
    .report-hero-back { width: 100%; }
}

/* ---------- کارت‌های خلاصه (KPI) ---------- */
.report-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.report-kpi {
    --tone: var(--theme-primary, #1b5e86);
    --tone-soft: var(--theme-primary-soft, #e8f1f8);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    background: var(--theme-surface, #fff);
    border: 1px solid var(--theme-border, #e2e8f0);
    border-radius: 14px;
}

.report-kpi::after {
    content: "";
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    width: 4px;
    background: var(--tone);
}

.report-kpi-icon {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--tone-soft);
    color: var(--tone);
    font-size: 1.2rem;
}

.report-kpi-body { flex: 1 1 auto; min-width: 0; }

.report-kpi-label {
    font-size: .76rem;
    color: var(--theme-muted, #718096);
}

.report-kpi-value {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.35;
    color: var(--theme-text, #263238);
    font-variant-numeric: tabular-nums;
}

.report-kpi-sub {
    margin-top: 2px;
    font-size: .72rem;
    line-height: 1.7;
    color: var(--theme-muted, #718096);
}

.report-meter {
    height: 6px;
    margin-top: 8px;
    border-radius: 999px;
    background: var(--theme-border, #e2e8f0);
    overflow: hidden;
}

.report-meter > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--tone);
}

.tone-success { --tone: #2f855a; --tone-soft: #e6f4ec; }
.tone-warning { --tone: #b7791f; --tone-soft: #fdf3dc; }
.tone-danger  { --tone: var(--theme-danger, #c0392b); --tone-soft: var(--theme-danger-soft, #fdecea); }

/* ---------- زبانه‌ها ---------- */
.report-tabs {
    display: inline-flex;
    gap: 4px;
    max-width: 100%;
    margin-bottom: 14px;
    padding: 4px;
    overflow-x: auto;
    background: var(--theme-surface-soft, #f8fafc);
    border: 1px solid var(--theme-border, #e2e8f0);
    border-radius: 12px;
}

.report-tab {
    border: 0;
    background: transparent;
    padding: 8px 16px;
    border-radius: 9px;
    font-size: .82rem;
    font-weight: 600;
    white-space: nowrap;
    color: var(--theme-muted, #718096);
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.report-tab:hover { color: var(--theme-text, #263238); }

.report-tab.active {
    background: var(--theme-primary, #1b5e86);
    color: #fff;
    box-shadow: 0 4px 10px rgba(31, 49, 74, .18);
}

.report-tab:focus-visible {
    outline: 2px solid var(--theme-primary, #1b5e86);
    outline-offset: 2px;
}

/* ---------- پنل نتیجه و جدول ---------- */
.report-panel {
    border-radius: 14px;
    border-color: var(--theme-border, #e2e8f0);
}

.report-panel .index-table th { white-space: nowrap; }
.report-panel .index-table td { font-variant-numeric: tabular-nums; }

.report-note {
    margin: 10px 0 0;
    font-size: .74rem;
    color: var(--theme-muted, #718096);
}

.report-empty {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 4px;
    color: var(--theme-muted, #718096);
}

.report-empty i { font-size: 1.4rem; }

/* ---------- کارت‌های صفحهٔ اصلی گزارش‌ها ---------- */
.report-hub-card {
    position: relative;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.report-hub-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--theme-shadow, 0 10px 28px rgba(31, 49, 74, .08));
    border-color: var(--theme-primary, #1b5e86);
}

.report-hub-card ul {
    flex: 1;
    margin: 0 0 14px;
    padding-inline-start: 18px;
    font-size: .74rem;
    line-height: 2;
    color: var(--theme-muted, #718096);
}

/* ---------- گزارش‌ساز ---------- */
.rb-step {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.rb-step-num {
    width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: var(--theme-primary, #1b5e86);
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
}

.rb-condition {
    margin-inline: 0;
    padding: 10px 8px;
    background: var(--theme-surface-soft, #f8fafc);
    border: 1px solid var(--theme-border, #e2e8f0);
    border-radius: 12px;
}

.rb-summary {
    padding: 12px 14px;
    font-size: .8rem;
    line-height: 2;
    background: var(--theme-primary-soft, #e8f1f8);
    border: 1px dashed var(--theme-primary, #1b5e86);
    border-radius: 12px;
    color: var(--theme-text, #263238);
}
