/* ── REPORTS HUB — module tab bar ──────────────────────────────────── */

.module-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 2px solid #d1dce8;
    padding-bottom: 0;
    flex-wrap: wrap;
}

.module-tab {
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 500;
    color: #4a5568;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    font-family: inherit;
    transition: color .15s, border-color .15s;
    white-space: nowrap;
}

.module-tab:hover {
    color: #1F4E79;
}

.module-tab.active {
    color: #1F4E79;
    font-weight: 600;
    border-bottom-color: #1F4E79;
}

/* ── REPORTS LIST — panel header ───────────────────────────────────── */

.rpt-page-title {
    font-size: 20px;
    font-weight: 600;
    color: #1F4E79;
    margin-bottom: 4px;
}

.rpt-page-sub {
    font-size: 13px;
    color: #4a5568;
    margin-bottom: 24px;
}

.rpt-list {
    background: #ffffff;
    border: 1px solid #d1dce8;
    border-radius: 9px;
    overflow: hidden;
}

/* ── REPORTS LIST — individual row ────────────────────────────────── */

.rpt-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid #f0f4f8;
    transition: background .12s;
}

.rpt-row:last-child {
    border-bottom: none;
}

.rpt-row:hover {
    background: #f7fafc;
}

.rpt-row:hover .rpt-run {
    background: #BDD7EE;
}

.rpt-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 15px;
    flex-shrink: 0;
}

.rpt-info {
    flex: 1;
    min-width: 0;
}

.rpt-name {
    font-size: 13px;
    font-weight: 600;
    color: #1F4E79;
}

.rpt-desc {
    font-size: 11.5px;
    color: #4a5568;
    margin-top: 2px;
}

.rpt-run {
    padding: 5px 16px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    background: #DEEAF1;
    color: #1F4E79;
    border: 1px solid #BDD7EE;
    flex-shrink: 0;
    transition: background .12s;
    font-family: inherit;
}

.rpt-run:hover {
    background: #BDD7EE;
}

/* ── REPORT OUTPUT — back link + header ────────────────────────────── */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: #2E75B6;
    cursor: pointer;
    margin-bottom: 16px;
    font-weight: 500;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
}

.back-link:hover { text-decoration: underline; color: #2E75B6; }

/* ── REPORT OUTPUT — section panels ────────────────────────────────── */

.gs-section {
    background: #ffffff;
    border: 1px solid #d1dce8;
    border-radius: 9px;
    margin-bottom: 16px;
    overflow: hidden;
}

.gs-section-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 18px;
    background: #DEEAF1;
    border-bottom: 1px solid #d1dce8;
}

.gs-section-icon { font-size: 15px; color: #1F4E79; }
.gs-section-title { font-size: 12.5px; font-weight: 700; color: #1F4E79; flex: 1; }

/* ── REPORT OUTPUT — filter bar ────────────────────────────────────── */

.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 18px;
    flex-wrap: wrap;
}

.filter-bar label {
    font-size: 11.5px;
    font-weight: 500;
    color: #4a5568;
    white-space: nowrap;
    margin-bottom: 0;
}

.filter-bar select,
.filter-bar input[type="date"] {
    border: 1px solid #d1dce8;
    border-radius: 5px;
    padding: 6px 10px;
    font-size: 12.5px;
    font-family: inherit;
    color: #1a1a2e;
    background: #ffffff;
    outline: none;
}

.filter-bar select:focus,
.filter-bar input[type="date"]:focus {
    border-color: #2E75B6;
    box-shadow: 0 0 0 3px rgba(46, 117, 182, .1);
}

/* ── REPORT OUTPUT — metric row ────────────────────────────────────── */

.metric-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

@media (max-width: 900px) {
    .metric-row { grid-template-columns: repeat(2, 1fr); }
}

.rpt-metric-card {
    background: #ffffff;
    border: 1px solid #d1dce8;
    border-radius: 9px;
    padding: 16px 18px;
    border-top: 3px solid #2E75B6;
}

.metric-val {
    font-size: 20px;
    font-weight: 600;
    color: #1F4E79;
    font-family: 'DM Mono', 'Courier New', monospace;
    line-height: 1;
}

.metric-val.positive { color: #1a7a4a; }
.metric-val.negative { color: #dc2626; }

.metric-sub {
    font-size: 11.5px;
    color: #4a5568;
    margin-top: 5px;
}

/* ── REPORT OUTPUT — table section ─────────────────────────────────── */

.report-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: #DEEAF1;
    border-bottom: 1px solid #d1dce8;
    flex-wrap: wrap;
    gap: 10px;
}

.report-header-meta {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.report-meta-item { font-size: 12px; color: #4a5568; }
.report-meta-item strong { color: #1F4E79; font-weight: 600; }
.report-actions { display: flex; gap: 8px; }

.tbl-wrap { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

.data-table thead tr { background: #1F4E79; }

.data-table thead th {
    padding: 10px 14px;
    text-align: left;
    font-size: 11.5px;
    font-weight: 600;
    color: white;
    letter-spacing: .4px;
    white-space: nowrap;
}

.data-table thead th.r { text-align: right; }

.data-table tbody tr {
    border-bottom: 1px solid #f0f4f8;
    transition: background .12s;
}

.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: #f7fafc; }

.data-table td {
    padding: 10px 14px;
    font-size: 12.5px;
    color: #1a1a2e;
    vertical-align: middle;
}

.data-table td.muted { color: #4a5568; font-size: 12px; }
.data-table td.r { text-align: right; font-family: 'DM Mono', 'Courier New', monospace; }

.data-table tfoot tr { background: #DEEAF1; }

.data-table tfoot td {
    padding: 10px 14px;
    font-size: 12.5px;
    font-weight: 600;
    color: #1F4E79;
    border-top: 2px solid #BDD7EE;
}

.data-table tfoot td.r { text-align: right; }

/* ── REPORT OUTPUT — save/export bar ───────────────────────────────── */

.save-bar {
    display: flex;
    gap: 12px;
    margin-top: 22px;
    align-items: center;
    padding-top: 18px;
    border-top: 1px solid #d1dce8;
}

.save-bar-note {
    margin-left: auto;
    font-size: 11.5px;
    color: #4a5568;
}

.save-bar-note code {
    font-family: 'DM Mono', 'Courier New', monospace;
    font-size: 11.5px;
}

/* ── GHOST BUTTON (prototype .btn-ghost) ────────────────────────────── */

.btn-ghost {
    background: none;
    color: #4a5568;
    border: 1px solid #d1dce8;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
}

.btn-ghost:hover { background: #f7fafc; color: #1F4E79; }

/* ── PILL BADGES ────────────────────────────────────────────────────── */

.pill {
    display: inline-block;
    font-size: 10.5px;
    font-family: 'DM Mono', 'Courier New', monospace;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    white-space: nowrap;
}

.pill-green  { background: #e6f7ee; color: #1a7a4a; border: 1px solid #6ee7b7; }
.pill-amber  { background: #fff8e1; color: #b45309; border: 1px solid #fcd34d; }
.pill-red    { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }

/* ── REPORT OUTPUT — metric cards ──────────────────────────────────── */

.metrics-grid .metric-card {
    border-top: 3px solid var(--bs-primary);
}

.metric-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--cbs-text-light, #a0aec0);
    margin-bottom: 6px;
}

.metric-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--cbs-navy, #1F4E79);
    font-family: 'Courier New', monospace;
    line-height: 1;
    margin-bottom: 5px;
}

.metric-subtitle {
    font-size: 11.5px;
    color: var(--cbs-text-mid, #4a5568);
}

.metric-card.positive .metric-value {
    color: var(--cbs-green, #1a7a4a);
}

.metric-card.negative .metric-value {
    color: #dc2626;
}

/* ── STATUS PILLS ───────────────────────────────────────────────────── */

.badge-green {
    background: #e6f7ee;
    color: var(--cbs-green, #1a7a4a);
    border: 1px solid #6ee7b7;
}

.badge-amber {
    background: #fff8e1;
    color: #b45309;
    border: 1px solid #fcd34d;
}

.badge-red {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}
