#view-reports {
    padding: 26px 30px 50px;
    background: #f4f7f9;
    min-height: 100%;
}

.rewa-report-builder { max-width: 1460px; margin: 0 auto; }
.rewa-report-intro {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 0 0 24px;
    border-bottom: 1px solid #ccd9e0;
}
.rewa-report-intro h2 { margin: 4px 0 6px; color: #102b3c; font-size: 30px; line-height: 1.1; }
.rewa-report-intro p { margin: 0; max-width: 740px; color: #5d7282; font-size: 15px; }
.rewa-report-intro-stat { min-width: 260px; padding-left: 18px; border-left: 4px solid #0b8f88; }
.rewa-report-intro-stat span, .rewa-report-intro-stat small { display: block; color: #667a89; }
.rewa-report-intro-stat span { text-transform: uppercase; font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.rewa-report-intro-stat strong { display: block; color: #102b3c; font-size: 18px; margin: 3px 0; }
.rewa-report-intro-stat small { font-size: 12px; }

.rewa-report-layout { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 26px; align-items: start; margin-top: 26px; }
.rewa-report-config { min-width: 0; background: #fff; border: 1px solid #d4e0e6; box-shadow: 0 14px 34px rgba(12, 40, 56, .06); }
.rewa-report-section { padding: 26px 28px 30px; border-bottom: 1px solid #dce5ea; }
.rewa-report-section:last-child { border-bottom: 0; }
.rewa-report-step { display: flex; gap: 13px; align-items: flex-start; margin-bottom: 20px; }
.rewa-report-step > span { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; color: #fff; background: #0b2b3c; font-weight: 800; font-size: 14px; border-radius: 5px; }
.rewa-report-step h3 { margin: 0 0 3px; color: #102b3c; font-size: 19px; }
.rewa-report-step p { margin: 0; color: #667a89; font-size: 13px; }

.rewa-report-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.rewa-report-presets label { position: relative; min-width: 0; }
.rewa-report-presets input { position: absolute; opacity: 0; pointer-events: none; }
.rewa-report-presets label > span, .rewa-report-presets label > strong, .rewa-report-presets label > small { display: block; }
.rewa-report-presets label { padding: 15px; min-height: 122px; border: 1px solid #cfdce3; background: #fbfcfd; cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease; }
.rewa-report-presets label:hover { border-color: #6fa9ad; transform: translateY(-2px); box-shadow: 0 8px 18px rgba(12, 40, 56, .08); }
.rewa-report-presets label:has(input:checked) { border-color: #0b8f88; background: #e8f6f4; box-shadow: inset 0 0 0 1px #0b8f88; }
.rewa-report-presets .dashicons { width: 30px; height: 30px; margin-bottom: 12px; color: #0b7180; font-size: 25px; }
.rewa-report-presets strong { color: #102b3c; font-size: 14px; }
.rewa-report-presets small { color: #677c8b; margin-top: 4px; line-height: 1.35; font-size: 11px; }

.rewa-report-scope-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.rewa-report-scope-fields > .rewa-scope-single { grid-column: 1 / -1; }
.rewa-report-scope-fields [hidden], .rewa-report-filter-grid [hidden] { display: none !important; }
.rewa-report-scope-fields .csm-field small { color: #6b7f8e; font-size: 11px; }
.rewa-report-picker { overflow: hidden; border: 1px solid #cfdce3; background: #fff; }
.rewa-report-picker-search { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 11px; border-bottom: 1px solid #dce5ea; background: #f7fafb; }
.rewa-report-picker-search .dashicons { flex: 0 0 18px; width: 18px; height: 18px; color: #587383; font-size: 18px; }
.rewa-report-picker-search input { width: 100%; min-height: 42px; padding: 0; border: 0 !important; outline: 0; background: transparent !important; box-shadow: none !important; color: #173447; font-size: 13px; }
.rewa-report-choice-list { max-height: 220px; overflow: auto; scrollbar-gutter: stable; }
.rewa-report-choice-list > label { display: flex; align-items: flex-start; gap: 10px; min-height: 50px; padding: 10px 12px; border-top: 1px solid #e3eaee; cursor: pointer; transition: background .16s ease; }
.rewa-report-choice-list > label:first-child { border-top: 0; }
.rewa-report-choice-list > label:hover { background: #f0f7f7; }
.rewa-report-choice-list > label:has(input:checked) { background: #e3f5f2; }
.rewa-report-choice-list input { flex: 0 0 auto; width: 17px; height: 17px; margin: 2px 0 0; accent-color: #0b8f88; }
.rewa-report-choice-list span, .rewa-report-choice-list strong, .rewa-report-choice-list small { display: block; min-width: 0; }
.rewa-report-choice-list strong { color: #173447; font-size: 12px; line-height: 1.35; }
.rewa-report-choice-list small { margin-top: 2px; color: #687d8b; font-size: 10px; line-height: 1.35; }
.rewa-report-choice-heading { position: sticky; top: 0; z-index: 1; padding: 7px 12px; border-top: 1px solid #d7e2e7; background: #e8eef2; color: #526b7a; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.rewa-report-filter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: end; margin-top: 18px; }
.rewa-report-filter-grid .rewa-report-wide { grid-column: 1 / -1; }
.rewa-report-filter-grid textarea { resize: vertical; min-height: 82px; }
.rewa-evidence-controls { transition: opacity .16s ease; }
.rewa-evidence-controls.is-disabled { opacity: .58; }
.rewa-report-switch { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 12px; border: 1px solid #d2dee5; background: #f8fafb; cursor: pointer; }
.rewa-report-switch input { position: absolute; opacity: 0; }
.rewa-report-switch > span { width: 34px; height: 20px; border-radius: 10px; background: #9baab4; position: relative; transition: background .18s ease; }
.rewa-report-switch > span::after { content: ''; position: absolute; width: 14px; height: 14px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: transform .18s ease; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.rewa-report-switch input:checked + span { background: #0b8f88; }
.rewa-report-switch input:checked + span::after { transform: translateX(14px); }
.rewa-report-switch strong { color: #173447; font-size: 12px; }

.rewa-report-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid #d6e1e7; }
.rewa-report-options label { display: flex; gap: 11px; align-items: flex-start; padding: 14px; min-width: 0; border-right: 1px solid #dce5ea; border-bottom: 1px solid #dce5ea; background: #fff; cursor: pointer; }
.rewa-report-options label:nth-child(even) { border-right: 0; }
.rewa-report-options label:nth-last-child(-n+2) { border-bottom: 0; }
.rewa-report-options input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: #0b8f88; flex: 0 0 auto; }
.rewa-report-options span, .rewa-report-options strong, .rewa-report-options small { display: block; }
.rewa-report-options strong { color: #163246; font-size: 13px; }
.rewa-report-options small { color: #687d8b; font-size: 11px; margin-top: 2px; }
.rewa-report-metrics { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; padding: 16px 0 0; }
.rewa-report-metrics > span { width: 100%; color: #617685; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.rewa-report-metrics label { display: inline-flex; align-items: center; gap: 7px; color: #173447; font-size: 12px; cursor: pointer; }
.rewa-report-metrics input { accent-color: #0b8f88; }
.rewa-report-metrics i { width: 8px; height: 8px; border-radius: 50%; }
.rewa-report-metrics .is-rust { background: #b45309; }
.rewa-report-metrics .is-coating { background: #2563a8; }
.rewa-report-metrics .is-damage { background: #b4232d; }

.rewa-report-preview-panel { position: sticky; top: 20px; overflow: hidden; background: #fff; border: 1px solid #cddae1; box-shadow: 0 16px 38px rgba(12, 40, 56, .1); }
.rewa-report-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px; border-bottom: 1px solid #dbe4e9; }
.rewa-report-preview-head h3 { margin: 3px 0 0; color: #102b3c; font-size: 18px; }
.rewa-report-state { padding: 5px 8px; color: #657986; background: #edf2f5; border-radius: 4px; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.rewa-report-state.is-loading { color: #85610c; background: #fff3d2; }
.rewa-report-state.is-ready { color: #07655f; background: #ddf4ef; }
.rewa-report-preview { max-height: calc(100vh - 292px); min-height: 390px; overflow: auto; background: #edf3f6; padding: 14px; scrollbar-gutter: stable; }
.rewa-report-empty, .rewa-report-loading { min-height: 350px; display: grid; place-items: center; align-content: center; text-align: center; color: #687c8a; padding: 30px; }
.rewa-report-empty .dashicons { width: 50px; height: 50px; color: #6d8796; font-size: 44px; margin-bottom: 12px; }
.rewa-report-empty strong, .rewa-report-loading strong { color: #183447; font-size: 15px; }
.rewa-report-empty p, .rewa-report-loading p { max-width: 250px; margin: 6px 0 0; font-size: 12px; line-height: 1.45; }
.rewa-report-empty.is-error .dashicons { color: #b4232d; }
.rewa-report-loading i { width: 34px; height: 34px; border: 3px solid #c7d7df; border-top-color: #0b8f88; border-radius: 50%; animation: rewa-report-spin .8s linear infinite; margin-bottom: 16px; }
@keyframes rewa-report-spin { to { transform: rotate(360deg); } }
.rewa-preview-document { background: #fff; border: 1px solid #d2dee5; box-shadow: 0 6px 16px rgba(12, 40, 56, .08); }
.rewa-preview-document > header { padding: 18px; background: #0b2b3c; color: #fff; }
.rewa-preview-document > header span { color: #9bc9d3; font-size: 9px; text-transform: uppercase; letter-spacing: .07em; }
.rewa-preview-document > header h4 { margin: 5px 0 0; font-size: 18px; line-height: 1.25; color: #fff; }
.rewa-preview-kpis { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid #dce5e9; }
.rewa-preview-kpis div { padding: 12px 8px; text-align: center; border-right: 1px solid #dce5e9; }
.rewa-preview-kpis div:last-child { border-right: 0; }
.rewa-preview-kpis strong, .rewa-preview-kpis span { display: block; }
.rewa-preview-kpis strong { color: #102b3c; font-size: 17px; }
.rewa-preview-kpis span { color: #6a7f8d; font-size: 9px; }
.rewa-preview-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px; }
.rewa-preview-metric { padding: 10px; background: #f4f7f9; border-top: 3px solid #6f8492; }
.rewa-preview-metric.is-rust { border-color: #b45309; }
.rewa-preview-metric.is-coating { border-color: #2563a8; }
.rewa-preview-metric.is-damage { border-color: #b4232d; }
.rewa-preview-metric span, .rewa-preview-metric strong { display: block; }
.rewa-preview-metric span { color: #6d808c; font-size: 8px; text-transform: uppercase; }
.rewa-preview-metric strong { color: #112d3f; font-size: 15px; margin-top: 3px; }
.rewa-preview-alert { display: flex; gap: 8px; margin: 0 12px 12px; padding: 9px; color: #73520a; background: #fff4d8; }
.rewa-preview-alert p { margin: 0; font-size: 10px; }
.rewa-preview-alert .dashicons { font-size: 17px; }
.rewa-preview-findings, .rewa-preview-scope { padding: 13px 14px; border-top: 1px solid #dce5e9; }
.rewa-preview-findings h5, .rewa-preview-scope h5 { margin: 0 0 9px; color: #667b89; font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.rewa-preview-findings > div, .rewa-preview-scope > div { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-top: 1px solid #e5ecef; }
.rewa-preview-findings > div:first-of-type, .rewa-preview-scope > div:first-of-type { border-top: 0; }
.rewa-preview-findings i { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: #b3c0c7; }
.rewa-preview-findings i.is-high { background: #b4232d; }
.rewa-preview-findings i.is-medium, .rewa-preview-findings i.is-watch { background: #c38310; }
.rewa-preview-findings span, .rewa-preview-findings strong, .rewa-preview-findings small, .rewa-preview-scope span, .rewa-preview-scope strong, .rewa-preview-scope small { display: block; min-width: 0; }
.rewa-preview-findings strong, .rewa-preview-scope strong { color: #183447; font-size: 10px; }
.rewa-preview-findings small, .rewa-preview-scope small { color: #6a7e8b; font-size: 9px; margin-top: 2px; }
.rewa-preview-scope > div { justify-content: space-between; align-items: flex-start; }
.rewa-preview-scope em { color: #527080; white-space: nowrap; font-size: 9px; font-style: normal; }
.rewa-preview-scope p { color: #6a7e8b; font-size: 9px; }
.rewa-preview-document footer { display: flex; justify-content: space-between; gap: 8px; padding: 12px 14px; color: #cce1e7; background: #12384a; font-size: 9px; }
.rewa-preview-document footer strong { color: #71d1ca; }
.rewa-report-actions { display: grid; grid-template-columns: 1fr 1.25fr; gap: 9px; padding: 14px; border-top: 1px solid #d5e0e6; }
.rewa-report-actions .csm-btn { justify-content: center; min-width: 0; }
.rewa-report-actions .csm-btn.is-busy .dashicons { animation: rewa-report-spin .8s linear infinite; }
.rewa-report-safety { display: flex; align-items: center; gap: 7px; padding: 0 15px 14px; margin: 0; color: #6c7f8b; font-size: 10px; }
.rewa-report-safety .dashicons { color: #0b8f88; font-size: 16px; }

@media (max-width: 1180px) {
    .rewa-report-layout { grid-template-columns: minmax(0, 1fr) 340px; }
    .rewa-report-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 920px) {
    #view-reports { padding: 20px 18px 40px; }
    .rewa-report-intro { align-items: flex-start; flex-direction: column; }
    .rewa-report-layout { grid-template-columns: 1fr; }
    .rewa-report-preview-panel { position: static; }
    .rewa-report-preview { max-height: none; }
}

@media (max-width: 620px) {
    #view-reports { padding: 16px 12px 32px; }
    .rewa-report-section { padding: 20px 16px 24px; }
    .rewa-report-presets, .rewa-report-scope-fields, .rewa-report-filter-grid, .rewa-report-options { grid-template-columns: 1fr; }
    .rewa-report-options label { border-right: 0; border-bottom: 1px solid #dce5ea !important; }
    .rewa-report-options label:last-child { border-bottom: 0 !important; }
    .rewa-report-filter-grid .rewa-report-wide { grid-column: auto; }
    .rewa-report-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .rewa-report-presets label, .rewa-report-switch > span::after { transition: none; }
    .rewa-report-loading i, .rewa-report-actions .csm-btn.is-busy .dashicons { animation-duration: 1.8s; }
}
