/* ════════════════════════════════════════════════════════════════════════
   Reports section
   ════════════════════════════════════════════════════════════════════════
   Appended to app.css. Uses existing app variables; falls back to literal
   values when a variable might not be defined.
   ════════════════════════════════════════════════════════════════════════ */

#sec-reports {
    height: 100%;
}

.rpt-layout {
    display: flex;
    gap: 16px;
    height: 100%;
    min-height: 600px;
}

.rpt-sidebar {
    flex: 0 0 280px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    overflow-y: auto;
    max-height: calc(100vh - 160px);
}

.rpt-category {
    margin-bottom: 16px;
}

.rpt-category-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin: 8px 8px 6px;
}

.rpt-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rpt-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #0f172a;
    margin-bottom: 2px;
    transition: background 0.12s ease;
}

.rpt-item:hover {
    background: #f1f5f9;
}

.rpt-item.is-active {
    background: #1c89ff;
    color: #ffffff;
}

.rpt-item.is-placeholder {
    color: #64748b;
    cursor: default;
}

.rpt-item.is-placeholder:hover {
    background: #f8fafc;
}

.rpt-item-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rpt-pill {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    background: #e2e8f0;
    color: #64748b;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
}

.rpt-item.is-active .rpt-pill {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* ─── Main pane ───────────────────────────────────────────────────────── */
.rpt-pane {
    flex: 1;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    overflow-y: auto;
    max-height: calc(100vh - 160px);
}

.rpt-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.rpt-header h2 {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
}

.rpt-desc {
    margin: 0;
    color: #64748b;
    font-size: 13px;
}

.rpt-actions {
    display: flex;
    gap: 8px;
}

.rpt-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.rpt-filters label {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}

.rpt-filters input[type="date"] {
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 13px;
}

/* ─── Chart area ──────────────────────────────────────────────────────── */
.rpt-chart {
    height: 320px;
    margin-bottom: 20px;
    position: relative;
}

.rpt-chart canvas {
    max-height: 320px;
}

/* ─── Table area ──────────────────────────────────────────────────────── */
.rpt-table {
    margin-top: 8px;
}

.rpt-table table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.rpt-table table.data-table th,
.rpt-table table.data-table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid #e2e8f0;
}

.rpt-table table.data-table th {
    background: #f1f5f9;
    color: #0f172a;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.rpt-table table.data-table tr:hover td {
    background: #f8fafc;
}

.rpt-rowcount {
    text-align: right;
    font-size: 12px;
    color: #64748b;
    margin-top: 8px;
}

/* ─── States ──────────────────────────────────────────────────────────── */
.rpt-loading,
.rpt-empty,
.rpt-error,
.rpt-placeholder {
    padding: 32px 16px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

.rpt-error {
    color: #dc2626;
    background: #fee2e2;
    border-radius: 6px;
    margin: 12px 0;
}

.rpt-placeholder h2 {
    color: #0f172a;
    margin: 0 0 8px;
}

.rpt-soon {
    margin-top: 16px;
    color: #d97706;
    font-style: italic;
}

/* ─── Buttons (fallback if app's buttons aren't defined here) ─────────── */
.rpt-actions .btn-primary,
.rpt-filters .btn-primary {
    background: #1c89ff;
    color: #ffffff;
    border: 0;
    padding: 8px 14px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.rpt-actions .btn-primary:hover,
.rpt-filters .btn-primary:hover {
    background: #1873d6;
}

.rpt-actions .btn-secondary {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    padding: 8px 14px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.rpt-actions .btn-secondary:disabled {
    color: #94a3b8;
    cursor: not-allowed;
}

.rpt-actions .btn-secondary:hover:not(:disabled) {
    background: #f1f5f9;
}
