:root {
    --report-bg: var(--mc-bg, #f8fafc);
    --report-card: var(--mc-surface, #ffffff);
    --report-text: var(--mc-text-primary, #0f172a);
    --report-muted: var(--mc-text-secondary, #475569);
    --report-border: var(--mc-border, #e2e8f0);
    --report-accent: var(--mc-primary, #0F766E);
    --report-accent-dark: var(--mc-primary-dark, #0f766e);
    --report-good: #16a34a;
    --report-warn: #d97706;
}

.report-page {
    background: var(--report-bg);
    min-height: 100vh;
}

.report-wrap {
    max-width: 1020px;
    margin: 0 auto;
    padding: 24px 20px 96px;
}

.report-header {
    background: var(--mc-primary-dark, #0f766e);
    color: #ffffff;
    border-radius: var(--mc-radius-md, 10px);
    padding: 22px 24px;
    box-shadow: var(--mc-shadow-sm, 0 1px 3px rgba(0,0,0,0.06));
}

.report-title {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.25;
    font-weight: 700;
    /* Global h1 color is dark navy; the title sits on the dark teal hero */
    color: inherit;
}

.report-subtitle {
    margin: 8px 0 0;
    opacity: 0.9;
    line-height: 1.55;
    font-size: 0.88rem;
}

.report-meta {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 600;
}

.report-meta-chip {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--mc-radius-full, 9999px);
    padding: 4px 10px;
}

.report-toolbar {
    margin-top: 14px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.report-export-btn {
    border: none;
    border-radius: var(--mc-radius-sm, 6px);
    padding: 9px 14px;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--mc-primary-dark, #0f766e);
    background: #ffffff;
    cursor: pointer;
    transition: background 0.15s ease;
}

.report-export-btn:hover {
    background: var(--mc-primary-light, #f0fdfa);
}

.report-export-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.report-export-note {
    margin: 0;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.8rem;
    align-self: center;
}

.report-fallback {
    margin-top: 18px;
    border: 1px solid rgba(217, 119, 6, 0.35);
    background: rgba(245, 158, 11, 0.1);
    color: #92400e;
    border-radius: 12px;
    padding: 12px 14px;
    font-weight: 600;
    display: none;
}

.report-grid {
    margin-top: 20px;
    display: grid;
    gap: 16px;
}

.report-section {
    background: var(--report-card);
    border: 1px solid var(--report-border);
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    padding: 18px;
}

.report-collapsible {
    padding: 0;
    overflow: hidden;
}

.report-collapsible > summary {
    list-style: none;
    cursor: pointer;
    padding: 18px;
    margin: 0;
}

.report-collapsible > summary::-webkit-details-marker {
    display: none;
}

.report-collapsible > summary::after {
    content: "\f078";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-left: auto;
    color: #64748b;
    transition: transform 0.2s ease;
}

.report-collapsible[open] > summary::after {
    transform: rotate(180deg);
}

.report-collapsible > div {
    padding: 0 18px 18px;
}

.report-section-heading {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 12px;
    font-size: 1.03rem;
    color: var(--report-text);
}

.report-section-heading i {
    color: var(--report-accent);
}

.report-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.report-kpi {
    border: 1px solid var(--report-border);
    border-radius: 12px;
    padding: 10px;
    background: #f8fbff;
}

.report-kpi-label {
    color: var(--report-muted);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.report-kpi-value {
    margin-top: 5px;
    color: var(--report-text);
    font-size: 1.1rem;
    font-weight: 800;
}

.report-body-text {
    color: #374151;
    margin: 0;
    line-height: 1.6;
    font-size: 0.93rem;
}

.report-body-text + .report-body-text {
    margin-top: 10px;
}

.report-inline-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.report-risk-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    border: 1px solid transparent;
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.report-risk-pill::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.report-risk-pill--good {
    color: #166534;
    border-color: rgba(22, 163, 74, 0.35);
    background: rgba(22, 163, 74, 0.12);
}

.report-risk-pill--warn {
    color: #92400e;
    border-color: rgba(217, 119, 6, 0.35);
    background: rgba(245, 158, 11, 0.14);
}

.report-risk-pill--bad {
    color: #991b1b;
    border-color: rgba(220, 38, 38, 0.36);
    background: rgba(239, 68, 68, 0.12);
}

.report-bullets {
    margin: 12px 0 0;
    padding-left: 18px;
    color: #374151;
}

.report-bullets li {
    margin: 6px 0;
    line-height: 1.5;
}

.report-empty {
    color: var(--report-muted);
    font-style: italic;
}

.report-footer {
    margin-top: 22px;
    text-align: center;
    color: #334155;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

@media (max-width: 960px) {
    .report-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .report-wrap {
        padding: 16px 12px 88px;
    }

    .report-header {
        border-radius: 16px;
        padding: 18px;
    }

    .report-title {
        font-size: 1.45rem;
    }

    .report-kpis {
        grid-template-columns: 1fr;
    }

    .report-collapsible > summary,
    .report-collapsible > div {
        padding-left: 14px;
        padding-right: 14px;
    }

    .report-inline-flags {
        gap: 6px;
    }
}

@media print {
    body {
        background: #ffffff !important;
    }

    .sidebar-nav,
    .bottom-nav,
    .mobile-top-bar,
    .mobile-sidebar-toggle,
    .mobile-sidebar-backdrop,
    .dash-top-bar,
    .report-toolbar {
        display: none !important;
    }

    .main-content,
    .report-wrap {
        margin: 0 !important;
        max-width: 100% !important;
        padding: 0 !important;
    }

    .report-header {
        box-shadow: none !important;
        border: 1px solid #d1d5db;
        color: #111827 !important;
        background: #ffffff !important;
    }

    .report-subtitle,
    .report-export-note {
        color: #374151 !important;
    }

    .report-section {
        box-shadow: none !important;
        page-break-inside: avoid;
    }

    .report-collapsible {
        border: 1px solid #d1d5db;
    }

    .report-collapsible > summary::after {
        display: none;
    }

    .report-risk-pill {
        border-color: #9ca3af !important;
        background: #f8fafc !important;
        color: #111827 !important;
    }
}

