/* Milestone 11 report history and detail surfaces */
.report-page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
    padding-bottom: 13px;
    border-bottom: 1px solid var(--dq-line);
}
.report-page-heading h1 {
    margin: 2px 0 3px;
    font-size: 26px;
    letter-spacing: -.025em;
}
.report-page-heading .muted { max-width: 790px; font-size: 11px; line-height: 1.5; }
.report-schedule-chip,
.delivery-badge,
.report-completion-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
}
.report-schedule-chip { border: 1px solid var(--dq-line); background: #fff; color: var(--dq-muted); }
.delivery-badge { background: #eef0f2; color: #66717a; }
.delivery-sent { background: #def3ed; color: #196a5f; }
.delivery-failed { background: #f7dede; color: #9b3f3f; }
.delivery-pending { background: #fff1d7; color: #8c6415; }
.delivery-no_recipients { background: #eceff2; color: #69727a; }

.report-history-card,
.report-analysis-card,
.report-client-card,
.report-latest-card,
.report-focus-card {
    border: 1px solid var(--dq-line);
    border-radius: 9px;
    background: #fff;
    box-shadow: var(--dq-shadow);
}
.report-history-card { padding: 0; overflow: hidden; }
.report-history-card .report-card-heading,
.report-focus-card > .report-card-heading {
    padding: 12px 13px;
    border-bottom: 1px solid var(--dq-line);
    background: #fafbfc;
}
.report-history-card .dashboard-table-wrap { border: 0; border-radius: 0; box-shadow: none; }
.report-card-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 14px;
}
.report-card-heading h2 { margin: 2px 0 0; font-size: 15px; }
.report-card-heading .widget-caption { font-size: 10px; }
.report-actions-cell { white-space: nowrap; }
.report-heading-actions { display: flex; align-items: center; gap: 7px; }
.report-primary-action {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 6px;
    background: var(--dq-blue);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    text-decoration: none;
}
.report-primary-action:hover { background: var(--dq-night); color: #fff; }

/* Report history starts with an actual current-state summary instead of generic
   feature labels. */
.report-latest-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 210px;
    gap: 18px;
    align-items: center;
    margin-bottom: 10px;
    padding: 16px 18px;
    border-top: 3px solid var(--dq-green);
}
.report-latest-copy h2 { margin: 3px 0 6px; font-size: 20px; }
.report-latest-copy > p:last-of-type { max-width: 850px; margin: 0; color: #49575f; font-size: 11px; line-height: 1.55; }
.report-latest-actions { display: flex; gap: 7px; margin-top: 12px; }
.report-latest-status {
    display: grid;
    justify-items: end;
    gap: 5px;
    padding-left: 18px;
    border-left: 1px solid var(--dq-line);
}
.report-latest-status strong { color: var(--dq-night); font-size: 31px; line-height: 1; }
.report-latest-status small { color: var(--dq-muted); font-size: 10px; text-align: right; }

.report-command-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
    margin-bottom: 12px;
}
.report-command-summary article {
    min-height: 94px;
    display: grid;
    align-content: center;
    gap: 3px;
    padding: 11px 12px;
    border: 1px solid var(--dq-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--dq-shadow);
}
.report-command-summary span,
.report-summary-card > span { color: var(--dq-muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.report-command-summary strong { font-size: 22px; }
.report-command-summary small { color: var(--dq-muted); font-size: 10px; line-height: 1.35; }
.report-empty-hero { margin-bottom: 12px; padding: 20px; border: 1px dashed var(--dq-line); border-radius: 9px; background: #fff; }
.report-empty-hero strong,
.report-empty-hero span { display: block; }
.report-empty-hero span { margin-top: 3px; color: var(--dq-muted); font-size: 11px; }
.report-history-table th { font-size: 9px; }
.report-history-table td { font-size: 11px; }
.report-history-table td small { display: block; margin-top: 2px; color: var(--dq-green-dark); font-size: 9px; font-weight: 800; }
.report-history-table tr.is-latest-report td { background: #f8fcfb; }

.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}
.report-summary-grid-primary { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.report-summary-card {
    display: grid;
    gap: 3px;
    min-height: 92px;
    padding: 12px;
    border: 1px solid var(--dq-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--dq-shadow);
}
.report-summary-card.is-primary { border-top: 3px solid var(--dq-green); }
.report-summary-card strong { font-size: 20px; }
.report-summary-card small { color: var(--dq-muted); font-size: 10px; line-height: 1.35; }

.report-overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
    gap: 10px;
    margin-bottom: 10px;
}
.report-analysis-card {
    margin-bottom: 10px;
    padding: 13px 14px;
}
.report-overview-grid .report-analysis-card { margin-bottom: 0; }
.report-analysis-card > p:last-of-type { margin: 5px 0 0; color: #39444b; font-size: 11px; line-height: 1.55; }
.report-status-bar {
    height: 18px;
    display: flex;
    overflow: hidden;
    margin-top: 12px;
    border-radius: 5px;
    background: #eef0f2;
}
.report-status-bar-large { height: 28px; margin-top: 14px; }
.report-status-completed { background: var(--dq-status-done); }
.report-status-progress { background: var(--dq-status-working); }
.report-status-not-started { background: var(--dq-status-waiting); }
.report-status-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 10px; }
.report-status-legend > div {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    gap: 7px;
    align-items: center;
    padding: 7px 8px;
    border: 1px solid #e8edef;
    border-radius: 6px;
}
.report-status-legend i { width: 10px; height: 10px; border-radius: 3px; }
.report-status-legend i.is-completed { background: var(--dq-status-done); }
.report-status-legend i.is-progress { background: var(--dq-status-working); }
.report-status-legend i.is-not-started { background: var(--dq-status-waiting); }
.report-status-legend span { color: #4d5961; font-size: 10px; font-weight: 750; }
.report-status-legend strong { font-size: 12px; }
.report-status-legend small { grid-column: 2 / -1; color: var(--dq-muted); font-size: 9px; }

.report-week-movement { display: grid; align-content: start; }
.report-movement-row {
    display: grid;
    grid-template-columns: 72px minmax(80px, 1fr) 36px 92px;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
}
.report-movement-row > span { color: #4e5a62; font-size: 10px; font-weight: 800; }
.report-movement-row > div { height: 11px; overflow: hidden; border-radius: 999px; background: #e9eef0; }
.report-movement-row > div > i { display: block; height: 100%; border-radius: inherit; background: var(--dq-green); }
.report-movement-row strong { text-align: right; font-size: 12px; }
.report-movement-row small { color: var(--dq-muted); font-size: 9px; }
.report-comparable-note { margin: 12px 0 0 !important; padding-top: 9px; border-top: 1px solid var(--dq-line); color: var(--dq-muted) !important; font-size: 9px !important; }

.report-automated-analysis { border-left: 4px solid var(--dq-blue); }
.report-error {
    margin-top: 10px;
    padding: 9px 10px;
    border: 1px solid #efcaca;
    border-radius: 6px;
    background: #fff5f5;
    color: #8e4040;
    font-size: 10px;
}

.report-focus-card { overflow: hidden; margin-bottom: 16px; }
.report-focus-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0; }
.report-focus-list > div { min-width: 0; padding: 11px 12px; border-right: 1px solid var(--dq-line); border-bottom: 1px solid var(--dq-line); }
.report-focus-list strong,
.report-focus-list span,
.report-focus-list small { display: block; }
.report-focus-list strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.report-focus-list span { margin-top: 4px; color: var(--dq-blue); font-size: 15px; font-weight: 850; }
.report-focus-list small { margin-top: 3px; color: var(--dq-muted); font-size: 9px; line-height: 1.4; }

.report-detail-section { margin-top: 6px; }
.report-detail-section > .m11-section-heading { margin-bottom: 10px; }
.report-detail-section > .m11-section-heading .muted { max-width: 620px; font-size: 10px; text-align: right; }
.report-clients-stack { display: grid; gap: 10px; }
.report-client-card { padding: 13px 14px; }
.report-completion-chip { background: #e5f4f1; color: var(--dq-green-dark); }
.report-metrics-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    margin-top: 11px;
    border: 1px solid var(--dq-line);
    border-radius: 6px;
    overflow: hidden;
}
.report-metrics-grid > div {
    min-height: 78px;
    display: grid;
    align-content: center;
    gap: 2px;
    padding: 9px 10px;
    border-right: 1px solid var(--dq-line);
    background: #fff;
}
.report-metrics-grid > div:last-child { border-right: 0; }
.report-metrics-grid span { color: var(--dq-muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.report-metrics-grid strong { font-size: 18px; }
.report-metrics-grid small { color: var(--dq-muted); font-size: 9px; line-height: 1.35; }
.report-back-link { margin: 13px 0 0; }
.report-back-link a { color: var(--dq-blue); font-size: 10px; font-weight: 750; text-decoration: none; }

@media (max-width: 1250px) {
    .report-summary-grid-primary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
    .report-command-summary,
    .report-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report-overview-grid { grid-template-columns: 1fr; }
    .report-metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report-metrics-grid > div { border-bottom: 1px solid var(--dq-line); }
}
@media (max-width: 760px) {
    .report-latest-card { grid-template-columns: 1fr; }
    .report-latest-status { justify-items: start; padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--dq-line); }
    .report-latest-status small { text-align: left; }
    .report-detail-section > .m11-section-heading .muted { text-align: left; }
}
@media (max-width: 680px) {
    .report-page-heading { align-items: flex-start; flex-direction: column; }
    .report-command-summary,
    .report-summary-grid,
    .report-summary-grid-primary { grid-template-columns: 1fr; }
    .report-status-legend { grid-template-columns: 1fr; }
    .report-metrics-grid { grid-template-columns: 1fr; }
    .report-metrics-grid > div { border-right: 0; }
    .report-movement-row { grid-template-columns: 64px minmax(70px, 1fr) 32px; }
    .report-movement-row small { grid-column: 2 / -1; }
}
