/* ── Code Doctor Reports Styles ─────────────────────────────────────────────── */

/* CD Status Summary in CD Reports tab */
.cd-status-summary { margin-bottom: 1rem; }
.cd-status-summary .security-card { max-width: 100%; }

/* Metrics Cards */
.cdr-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.cdr-header h2 { margin: 0; font-size: 1.25rem; }
.cdr-actions { display: flex; gap: 0.5rem; }

.cdr-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.75rem; margin-bottom: 1.25rem; }
.cdr-metric-card { background: var(--card-bg, #1a1d23); border: 1px solid var(--border, #2a2d35); border-radius: 10px; padding: 1rem; text-align: center; }
.cdr-metric-value { font-size: 1.75rem; font-weight: 700; color: var(--text, #e0e0e0); }
.cdr-metric-label { font-size: 0.75rem; color: var(--text-secondary, #8a8f98); margin-top: 0.25rem; text-transform: uppercase; letter-spacing: 0.05em; }
.cdr-metric-danger .cdr-metric-value { color: var(--danger, #ff4d6a); }
.cdr-metric-success .cdr-metric-value { color: var(--success, #00d68f); }

/* Subtabs */
.cdr-subtabs { display: flex; gap: 0; border-bottom: 1px solid var(--border, #2a2d35); margin-bottom: 1rem; }
.cdr-subtab { background: none; border: none; color: var(--text-secondary, #8a8f98); padding: 0.5rem 1rem; cursor: pointer; font-size: 0.875rem; border-bottom: 2px solid transparent; transition: all 0.15s; }
.cdr-subtab:hover { color: var(--text, #e0e0e0); }
.cdr-subtab.active { color: var(--accent, #7c5cfc); border-bottom-color: var(--accent, #7c5cfc); }

/* Filters */
.cdr-filters { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.cdr-search-input { flex: 1; min-width: 180px; padding: 0.4rem 0.75rem; background: var(--input-bg, #12141a); border: 1px solid var(--border, #2a2d35); border-radius: 6px; color: var(--text, #e0e0e0); font-size: 0.85rem; }
.cdr-search-input::placeholder { color: var(--text-secondary, #8a8f98); }
.cdr-select { padding: 0.4rem 0.75rem; background: var(--input-bg, #12141a); border: 1px solid var(--border, #2a2d35); border-radius: 6px; color: var(--text, #e0e0e0); font-size: 0.85rem; }

/* Table */
.cdr-table-wrap { overflow-x: auto; }
.cdr-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.cdr-table th { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border, #2a2d35); color: var(--text-secondary, #8a8f98); font-weight: 600; text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.05em; }
.cdr-table td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border-light, #1f222a); }
.cdr-table tbody tr:hover { background: rgba(124, 92, 252, 0.04); }
.cdr-table-sm { font-size: 0.8rem; }
.cdr-table-sm th, .cdr-table-sm td { padding: 0.35rem 0.5rem; }
.cdr-file-cell { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cdr-text-danger { color: var(--danger, #ff4d6a); font-weight: 600; }
.cdr-empty { text-align: center; padding: 2rem; color: var(--text-secondary, #8a8f98); }

/* Status Badge */
.cdr-status { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 10px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.cdr-status-new { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.cdr-status-reviewed { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.cdr-status-fixed { background: rgba(0, 214, 143, 0.15); color: #00d68f; }
.cdr-status-ignored { background: rgba(107, 114, 128, 0.15); color: #9ca3af; }
.cdr-status-completed { background: rgba(0, 214, 143, 0.15); color: #00d68f; }
.cdr-status-failed { background: rgba(255, 77, 106, 0.15); color: #ff4d6a; }
.cdr-status-running { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.cdr-status-pending { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.cdr-status-approved { background: rgba(0, 214, 143, 0.15); color: #00d68f; }
.cdr-status-rejected { background: rgba(255, 77, 106, 0.15); color: #ff4d6a; }
.cdr-status-auto_approved { background: rgba(124, 92, 252, 0.15); color: #a78bfa; }

/* Pagination */
.cdr-pagination { display: flex; justify-content: center; align-items: center; gap: 0.75rem; margin-top: 0.75rem; }
.cdr-page-btn { background: var(--card-bg, #1a1d23); border: 1px solid var(--border, #2a2d35); color: var(--text, #e0e0e0); padding: 0.35rem 0.75rem; border-radius: 6px; cursor: pointer; font-size: 0.8rem; }
.cdr-page-btn:hover { border-color: var(--accent, #7c5cfc); }
.cdr-page-info { font-size: 0.8rem; color: var(--text-secondary, #8a8f98); }

/* Bar Chart */
.cdr-bar-chart { display: flex; align-items: flex-end; gap: 3px; height: 180px; padding: 0.5rem 0; }
.cdr-bar-group { display: flex; flex-direction: column; align-items: center; flex: 1; min-width: 12px; height: 100%; justify-content: flex-end; }
.cdr-bar { width: 100%; max-width: 24px; background: rgba(124, 92, 252, 0.4); border-radius: 3px 3px 0 0; position: relative; min-height: 2px; transition: height 0.3s; }
.cdr-bar-critical { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(255, 77, 106, 0.7); border-radius: 0 0 0 0; }
.cdr-bar-label { font-size: 0.6rem; color: var(--text-secondary, #8a8f98); margin-top: 4px; white-space: nowrap; }
.cdr-bar-legend { display: flex; gap: 1rem; justify-content: center; margin-top: 0.5rem; font-size: 0.75rem; }
.cdr-legend-issues { color: rgba(124, 92, 252, 0.8); }
.cdr-legend-critical { color: rgba(255, 77, 106, 0.8); }

/* Fix Reports */
.cdr-fix-actions { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 1rem; }
.cdr-checkbox-label { font-size: 0.85rem; color: var(--text-secondary, #8a8f98); display: flex; align-items: center; gap: 0.3rem; }
.cdr-fix-card { background: var(--card-bg, #1a1d23); border: 1px solid var(--border, #2a2d35); border-radius: 8px; padding: 0.75rem 1rem; margin-bottom: 0.5rem; }
.cdr-fix-success { border-left: 3px solid var(--success, #00d68f); }
.cdr-fix-fail { border-left: 3px solid var(--danger, #ff4d6a); }
.cdr-fix-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.35rem; }
.cdr-fix-stats { font-size: 0.8rem; color: var(--text-secondary, #8a8f98); margin-bottom: 0.5rem; }

/* Modal */
.cdr-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.cdr-modal.hidden { display: none; }
.cdr-modal-inner { background: var(--card-bg, #1a1d23); border: 1px solid var(--border, #2a2d35); border-radius: 12px; width: 90%; max-width: 700px; max-height: 85vh; overflow-y: auto; }
.cdr-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border, #2a2d35); }
.cdr-modal-header h3 { margin: 0; font-size: 1rem; }
.cdr-modal-close { background: none; border: none; color: var(--text-secondary, #8a8f98); font-size: 1.5rem; cursor: pointer; }
.cdr-modal-body { padding: 1.25rem; }

/* Detail */
.cdr-detail-meta p { margin: 0.25rem 0; font-size: 0.85rem; }
.cdr-detail-status-actions { display: flex; align-items: center; gap: 0.5rem; margin: 0.75rem 0; }
.cdr-detail-summary pre { background: var(--input-bg, #12141a); padding: 0.75rem; border-radius: 6px; font-size: 0.8rem; white-space: pre-wrap; }

/* Issue Cards */
.cdr-issues-list { display: flex; flex-direction: column; gap: 0.5rem; }
.cdr-issue-card { padding: 0.75rem; border-radius: 8px; background: var(--input-bg, #12141a); border-left: 3px solid var(--border, #2a2d35); }
.cdr-issue-critical { border-left-color: var(--danger, #ff4d6a); }
.cdr-issue-high { border-left-color: #f59e0b; }
.cdr-issue-medium { border-left-color: #fbbf24; }
.cdr-issue-low { border-left-color: var(--success, #00d68f); }
.cdr-issue-header { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.25rem; }
.cdr-issue-severity { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; padding: 0.1rem 0.4rem; border-radius: 4px; background: rgba(255,255,255,0.06); }
.cdr-issue-title { font-weight: 600; font-size: 0.85rem; }
.cdr-issue-fixed { color: var(--success, #00d68f); font-size: 0.75rem; }
.cdr-issue-file { font-size: 0.75rem; color: var(--text-secondary, #8a8f98); margin: 0.25rem 0 0; }
.cdr-issue-card details { margin-top: 0.5rem; }
.cdr-issue-card details summary { cursor: pointer; font-size: 0.8rem; color: var(--accent, #7c5cfc); }
.cdr-issue-card details pre { font-size: 0.75rem; margin-top: 0.35rem; background: rgba(0,0,0,0.2); padding: 0.5rem; border-radius: 4px; white-space: pre-wrap; }
