/* Reports tab — navigation shell (subnav, search, workspace header) and the
 * shared report-infrastructure classes (filter bar, summary cards, run
 * meta, table wrap) used by all twelve report views. Part of the frontend
 * modularization plan (docs/planning/frontend-modularization-and-csp-
 * hardening-plan.md), Stage 4a. Extracted as one block even though four
 * reports (Alarm / Exception Summary, Data Quality, Location Utilization,
 * Capacity / Scale Trends) aren't migrated until Stage 4b -- these are pure
 * visual rules with no JS-module boundary, so they apply correctly to
 * still-legacy report markup too. Does NOT include .fleet-device-type-
 * filter-* (shared with the Fleet tab's own device-type filter modal) or
 * .reports-subnav-btn[data-feature] (grouped with other tabs'/features'
 * feature-gate button variants) -- those stay in styles.css. */

.reports-layout {
    margin-top: 0.35rem;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 1rem;
    min-height: 0;
    flex: 1;
}

.reports-nav-pane {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-bg);
    padding: 0.6rem;
    overflow-y: auto;
    max-height: none;
    min-height: 0;
}

.reports-nav-search-wrap {
    margin-bottom: 0.6rem;
}

.reports-nav-search {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.45rem 0.6rem;
    font-size: 0.86rem;
    background: var(--card-bg);
    color: var(--text-primary);
}

.reports-nav-search:focus {
    outline: none;
    border-color: var(--primary-color);
}

.reports-nav-section {
    margin-top: 0.55rem;
}

.reports-nav-section-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin: 0.2rem 0.3rem 0.35rem 0.3rem;
    font-weight: 700;
}

.reports-subnav-btn {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0.45rem 0.55rem;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
}

.reports-subnav-btn:hover {
    background: var(--code-bg);
    color: var(--text-primary);
}

.reports-subnav-btn.active {
    border-color: rgba(0, 78, 154, 0.25);
    background: rgba(0, 78, 154, 0.08);
    color: var(--primary-color);
}

.reports-workspace {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.reports-workspace-header {
    margin-bottom: 0.2rem;
}

.reports-workspace-header h3 {
    margin: 0;
    font-size: 1.02rem;
    color: var(--text-primary);
}

.reports-workspace-header p {
    margin: 0.18rem 0 0.35rem;
    color: var(--text-secondary);
    font-size: 0.86rem;
}

.reports-subview {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.reports-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

/* .btn-ghost's default border (--border-color) is too pale to read as a
   deliberate border next to the filter bar's solid-filled Export CSV/PDF
   buttons, making Clear look unintentionally flimsy by comparison. Match
   the border to the button's own text color for the same visual weight,
   without changing its ghost (transparent/gray) color scheme. */
.reports-clear-btn {
    border-color: var(--text-secondary);
}

.reports-clear-btn:hover {
    border-color: var(--text-primary);
}

.reports-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.6rem;
    margin-top: 0.9rem;
}

.reports-summary-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.55rem 0.7rem;
    background: var(--code-bg);
}

.reports-summary-label {
    color: var(--text-secondary);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.reports-summary-value {
    color: var(--text-primary);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
    margin-top: 0.2rem;
}

.reports-run-meta {
    color: var(--text-secondary);
    font-size: 0.82rem;
    margin-top: 0.65rem;
}

/* Compound selector (not just .reports-table-wrap) so this beats styles.css's
   .metrics-table-container { max-height: 500px } on specificity -- both classes are always
   applied together on these elements, but styles.css loads after this file, and equal-
   specificity single-class rules would otherwise let its 500px cap silently win the cascade,
   stopping the results table well short of the workspace column's full height. */
.metrics-table-container.reports-table-wrap {
    margin-top: 0.65rem;
    flex: 1;
    min-height: 0;
    max-height: none;
}

.reports-history-search {
    width: 320px;
}

/* Stacking (previously @max-width:980px, which caught tablet portrait too) now lives
   in phone.css at the real phone breakpoint -- tablet keeps the standard side-by-side
   nav-pane + content layout. */

/* Stage 4a hidden-convention support / new utility classes */

.reports-text-sm {
    font-size: 0.82rem;
}

.reports-text-sm-muted {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* Stage 4b hidden-convention support / new utility classes */

.reports-summary-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.reports-summary-grid-5 {
    grid-template-columns: repeat(5, 1fr);
}

.reports-text-right {
    text-align: right;
}

.reports-nowrap {
    white-space: nowrap;
}

.reports-text-danger {
    color: var(--danger-color);
}

.reports-cell-danger {
    color: var(--danger-color);
    font-weight: 600;
}

.reports-cell-warning {
    color: var(--warning-color);
    font-weight: 600;
}

.reports-cell-success {
    color: var(--success-color);
}

.reports-inline-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
}

.reports-kv-line {
    margin: 0.4rem 0 0.6rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.reports-kv-line.reports-kv-line-loose {
    margin: 0.5rem 0 0.75rem;
}

.reports-kv-line strong {
    color: var(--text-primary);
}

.reports-kv-line-value {
    margin-left: 0.4rem;
}

/* Software Update Campaign detail modal (Stage 7c) — was a static inline
   style="margin-top:12px" alongside the [hidden]-toggled display. */
.software-update-campaign-detail-wrap {
    margin-top: 12px;
}

/* Software Update Campaigns (Stage 7c) — remaining static inline styles
   found by a close-out review, moved here. The campaign panel's own
   display toggle is driven by app.js's applyRoleUi() (role/entitlement
   gating shared with other Reports controls), not this module, but its
   static margin belongs with the rest of this feature's CSS. */
#reports-compliance-campaigns-panel {
    margin-top: 18px;
}

.reports-compliance-campaigns-run-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.modal-box.modal-box-wide.modal-box-campaign {
    max-width: min(912px, 96vw);
}

#software-update-campaign-review-wrap {
    max-height: 336px;
    overflow: auto;
}

#software-update-campaign-detail-summary {
    text-align: left;
}

.software-update-campaign-serial-code {
    font-size: 0.82rem;
}

.software-update-campaign-schedule-cell {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.software-update-campaign-empty-row {
    text-align: center;
    color: var(--text-secondary);
}

.reports-stub-empty {
    margin-top: 0.75rem;
}
