/* Compliance Remediation Tracker Styles */

/* Light theme (default) */
:root,
[data-theme="light"] {
  --color-high: #dc3545;
  --color-medium: #fd7e14;
  --color-low: #0d6efd;
  --color-manual: #6c757d;
  --color-pass: #198754;
  --color-fail: #dc3545;
  --color-bg: #f8f9fa;
  --color-card: #ffffff;
  --color-text: #212529;
  --color-text-muted: #6c757d;
  --color-border: #dee2e6;
  --color-link: #0d6efd;
  --color-header-bg: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  --color-code-bg: #e9ecef;
  --color-hover: #f0f4ff;
  --color-shadow: rgba(0,0,0,0.1);
}

/* Dark theme */
[data-theme="dark"] {
  --color-high: #f87171;
  --color-medium: #fb923c;
  --color-low: #60a5fa;
  --color-manual: #9ca3af;
  --color-pass: #4ade80;
  --color-fail: #f87171;
  --color-bg: #0f172a;
  --color-card: #1e293b;
  --color-text: #e2e8f0;
  --color-text-muted: #94a3b8;
  --color-border: #334155;
  --color-link: #60a5fa;
  --color-header-bg: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --color-code-bg: #334155;
  --color-hover: #334155;
  --color-shadow: rgba(0,0,0,0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: white;
  padding: 1rem 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
  text-decoration: none;
}

.nav-links a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  margin-left: 2rem;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: white;
}

/* Main content */
main {
  padding: 2rem 0;
  min-height: calc(100vh - 200px);
}

h1 {
  margin-bottom: 1.5rem;
  color: var(--color-text);
}

h2 {
  margin: 2rem 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Summary cards */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.card {
  background: var(--color-card);
  padding: 1.5rem;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  border-left: 4px solid var(--color-border);
}

.card.total { border-left-color: #6c757d; }
.card.passing { border-left-color: var(--color-pass); }
.card.failing { border-left-color: var(--color-fail); }
.card.manual { border-left-color: var(--color-manual); }

.card h3 {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.card .number {
  font-size: 2rem;
  font-weight: bold;
}

.card.passing .number { color: var(--color-pass); }
.card.failing .number { color: var(--color-fail); }

/* Coverage bar */
.coverage-bar {
  background: var(--color-code-bg);
  border-radius: 20px;
  height: 30px;
  position: relative;
  margin: 1rem 0 2rem;
  overflow: hidden;
}

.coverage-bar .progress {
  background: linear-gradient(90deg, var(--color-pass), #20c997);
  height: 100%;
  border-radius: 20px;
  transition: width 0.5s ease;
}

.coverage-bar .coverage-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: bold;
  color: var(--color-text);
}

/* Severity badges */
.severity-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
}

.severity-badge.high {
  background: var(--color-high);
  color: white;
}

.severity-badge.medium {
  background: var(--color-medium);
  color: white;
}

.severity-badge.low {
  background: var(--color-low);
  color: white;
}

.severity-badge.manual {
  background: var(--color-manual);
  color: white;
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
}

.status-badge.fail {
  background: #fce4e4;
  color: var(--color-fail);
}

.status-badge.pass {
  background: #d4edda;
  color: var(--color-pass);
}

.status-badge.manual {
  background: #e9ecef;
  color: var(--color-manual);
}

/* Tracking status */
.tracking-status {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
}

.tracking-status.in_progress {
  background: #cce5ff;
  color: #004085;
}

.tracking-status.pending {
  background: #fff3cd;
  color: #856404;
}

.tracking-status.on_hold {
  background: #e9ecef;
  color: #6c757d;
}

.tracking-status.done {
  background: #d4edda;
  color: #155724;
}

/* Tables */
.remediation-table,
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-card);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  margin-bottom: 2rem;
}

.remediation-table th,
.remediation-table td,
table th,
table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.remediation-table th,
table th {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: white;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.remediation-table tr:hover,
table tr:hover {
  background: var(--color-hover);
}

/* Zebra striping */
table tbody tr:nth-child(even),
table tr:nth-child(even):not(:first-child) {
  background: var(--color-bg);
}

table tbody tr:nth-child(even):hover,
table tr:nth-child(even):not(:first-child):hover {
  background: var(--color-hover);
}

.remediation-table code,
table code {
  background: var(--color-code-bg);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

/* Group ID styling - first column */
table td:first-child a {
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-weight: 600;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Severity column styling */
table td:nth-child(3) {
  font-weight: 600;
  font-size: 0.8rem;
}

/* Status cell colors */
table td:nth-child(5) {
  font-weight: 500;
  white-space: nowrap;
}

/* Jira and PR link styling */
table td a[href*="issues.redhat.com"],
table td a[href*="/pull/"] {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  background: var(--color-code-bg);
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.2s;
}

table td a[href*="issues.redhat.com"]:hover,
table td a[href*="/pull/"]:hover {
  background: var(--color-hover);
  text-decoration: none;
}

/* Compare link in table */
table td a[href*="/compare/"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  border-radius: 4px;
  font-size: 0.9rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

table td a[href*="/compare/"]:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
  text-decoration: none;
}

/* Status Table - enhanced styling with high specificity */
table.status-table {
  width: 100% !important;
  border-collapse: collapse !important;
  background: var(--color-card) !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
  margin: 1.5rem 0 !important;
  table-layout: fixed;
}

table.status-table thead th {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%) !important;
  color: white !important;
  padding: 1rem !important;
  font-weight: 600 !important;
  font-size: 0.75rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  border-bottom: none !important;
}

table.status-table tbody tr {
  transition: background 0.15s;
}

table.status-table tbody tr:nth-child(even) {
  background: var(--color-bg);
}

table.status-table tbody tr:hover {
  background: var(--color-hover) !important;
}

table.status-table td {
  padding: 0.75rem 1rem !important;
  border-bottom: 1px solid var(--color-border) !important;
  vertical-align: middle !important;
}

/* Group ID link - high specificity */
a.group-id {
  display: inline-block !important;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace !important;
  font-weight: 700 !important;
  font-size: 0.9rem !important;
  color: #667eea !important;
  text-decoration: none !important;
  padding: 0.25rem 0.5rem !important;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%) !important;
  border-radius: 4px !important;
  transition: all 0.2s !important;
  -webkit-text-fill-color: #667eea !important;
  -webkit-background-clip: padding-box !important;
}

a.group-id:hover {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%) !important;
  text-decoration: none !important;
  transform: translateY(-1px);
}

/* Status legend container */
.status-legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1rem 0 2rem 0;
  padding: 1rem;
  background: var(--color-code-bg);
  border-radius: 8px;
}

/* Severity pills - high specificity */
span.severity-pill {
  display: inline-block !important;
  padding: 0.25rem 0.6rem !important;
  border-radius: 12px !important;
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.3px !important;
}

span.severity-pill.high {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
  color: white !important;
}

span.severity-pill.medium {
  background: linear-gradient(135deg, #fd7e14 0%, #e8590c 100%) !important;
  color: white !important;
}

span.severity-pill.low {
  background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%) !important;
  color: white !important;
}

/* Status pills - high specificity */
span.status-pill {
  display: inline-block !important;
  padding: 0.3rem 0.6rem !important;
  border-radius: 12px !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  white-space: nowrap !important;
}

span.status-pill.in-progress {
  background: #cce5ff !important;
  color: #004085 !important;
}

span.status-pill.pending {
  background: #fff3cd !important;
  color: #856404 !important;
}

span.status-pill.on-hold {
  background: #e9ecef !important;
  color: #495057 !important;
}

span.status-pill.complete {
  background: #d4edda !important;
  color: #155724 !important;
}

/* Jira and PR badges - high specificity */
a.jira-badge, a.pr-badge {
  display: inline-block !important;
  padding: 0.25rem 0.5rem !important;
  background: var(--color-code-bg) !important;
  border: 1px solid var(--color-border) !important;
  border-radius: 4px !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  color: var(--color-text) !important;
  text-decoration: none !important;
  transition: all 0.2s !important;
}

a.jira-badge:hover, a.pr-badge:hover {
  background: var(--color-hover) !important;
  border-color: var(--color-link) !important;
  text-decoration: none !important;
}

/* Compare button in table - high specificity */
a.compare-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
  border-radius: 6px !important;
  font-size: 1rem !important;
  text-decoration: none !important;
  transition: all 0.2s !important;
  box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2) !important;
}

.compare-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
  text-decoration: none;
}

/* Status legend */
.status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0 2rem;
  padding: 1rem;
  background: var(--color-code-bg);
  border-radius: 8px;
}

.description {
  color: var(--color-text-muted);
  display: block;
  margin-top: 0.25rem;
}

/* Links */
a {
  color: var(--color-link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.jira-link, .pr-link {
  font-weight: 500;
}

.no-tracking {
  color: #adb5bd;
}

/* Version list */
.version-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.version-card {
  background: var(--color-card);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: transform 0.2s, box-shadow 0.2s;
}

.version-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.version-card h3 {
  margin-bottom: 1rem;
}

.version-card .stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.version-card .stat {
  flex: 1;
  text-align: center;
  padding: 0.5rem;
  background: var(--color-code-bg);
  border-radius: 4px;
}

.version-card .stat-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.version-card .stat-value {
  font-size: 1.25rem;
  font-weight: bold;
}

.version-card .stat-value.pass { color: var(--color-pass); }
.version-card .stat-value.fail { color: var(--color-fail); }

.version-card .status-breakdown {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin: 0.75rem 0;
  font-size: 0.9rem;
}

.version-card .status-breakdown span {
  cursor: help;
}

/* Scan info */
.scan-info {
  background: var(--color-code-bg);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.scan-info p {
  margin: 0.25rem 0;
}

/* Footer */
footer {
  background: #1a1a2e;
  color: rgba(255,255,255,0.7);
  padding: 1.5rem 0;
  text-align: center;
}

footer a {
  color: rgba(255,255,255,0.9);
}

/* No data message */
.no-data {
  text-align: center;
  padding: 3rem;
  background: var(--color-card);
  border-radius: 8px;
  margin: 2rem 0;
}

.no-data code {
  background: var(--color-code-bg);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  display: inline-block;
  margin-top: 1rem;
}

/* Quick Links */
.quick-links {
  display: flex;
  gap: 1rem;
  margin: 1.5rem 0;
}

.quick-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.quick-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  text-decoration: none;
  color: white;
}

button.quick-link {
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.quick-link-icon {
  font-size: 1.1rem;
}

/* Modern Tabs */
.tabs-container {
  margin-top: 2rem;
}

.tab-nav {
  display: inline-flex;
  background: var(--color-code-bg);
  border-radius: 12px;
  padding: 6px;
  gap: 4px;
  margin-bottom: 1.5rem;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-muted);
  transition: all 0.2s ease;
  font-family: inherit;
}

.tab-btn:hover {
  color: var(--color-text);
  background: var(--color-card);
}

.tab-btn.active {
  background: var(--color-card);
  color: var(--color-text);
  box-shadow: 0 2px 8px var(--color-shadow);
}

.tab-btn[data-tab="failing"].active {
  color: var(--color-fail);
}

.tab-btn[data-tab="passing"].active {
  color: var(--color-pass);
}

.tab-icon {
  font-size: 1rem;
}

.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
}

.tab-btn:not(.active) .tab-count {
  background: var(--color-border);
  color: var(--color-text-muted);
}

.tab-btn.active .fail-count {
  background: var(--color-fail);
  color: white;
}

.tab-btn.active .pass-count {
  background: var(--color-pass);
  color: white;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.2s ease;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.passing-table tr:hover {
  background: var(--color-hover);
}

/* Expandable check details */
.check-details {
  cursor: pointer;
}

.check-details summary {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.check-details summary::-webkit-details-marker {
  display: none;
}

.check-details summary code {
  background: var(--color-code-bg);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

.check-details .expand-hint {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  font-style: italic;
}

.check-details .remediation-summary {
  font-size: 0.85rem;
  color: var(--color-pass);
  background: var(--color-code-bg);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
  display: inline-block;
  margin-top: 0.25rem;
}

.check-details[open] .expand-hint {
  display: none;
}

.check-details[open] summary {
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.remediation-content {
  background: #1e1e2e;
  padding: 1rem;
  border-radius: 8px;
  margin-top: 0.5rem;
  border: 1px solid #313244;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
  max-height: 400px;
  overflow-y: auto;
  overflow-x: auto;
}

.remediation-description {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  font-size: 0.85rem;
  line-height: 1.8;
  color: #cdd6f4;
  white-space: normal;
  word-wrap: break-word;
  margin: 0;
}

/* Format paragraphs within remediation content */
.remediation-description br {
  display: block;
  content: "";
  margin-top: 0.75em;
}

/* Scrollbar styling for remediation content */
.remediation-content::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.remediation-content::-webkit-scrollbar-track {
  background: #313244;
  border-radius: 4px;
}

.remediation-content::-webkit-scrollbar-thumb {
  background: #585b70;
  border-radius: 4px;
}

.remediation-content::-webkit-scrollbar-thumb:hover {
  background: #6c7086;
}

.remediation-description code,
.remediation-content pre {
  background: #313244;
  padding: 0.75rem;
  border-radius: 4px;
  display: block;
  overflow-x: auto;
  font-size: 0.8rem;
  margin: 0.5rem 0;
  color: #a6e3a1;
}

/* Group Pages */
.group-page {
  max-width: 900px;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  color: var(--color-text-muted);
}

.breadcrumb a:hover {
  color: var(--color-link);
}

.group-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--color-border);
}

.group-header h1 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.group-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.group-meta .jira-link,
.group-meta .pr-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.75rem;
  background: var(--color-code-bg);
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.group-meta .jira-link:hover,
.group-meta .pr-link:hover {
  background: var(--color-hover);
  text-decoration: none;
}

.group-meta .compare-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

.group-meta .compare-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(40, 167, 69, 0.4);
  text-decoration: none;
  color: white;
}

.group-meta .last-updated {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.75rem;
  background: var(--color-code-bg);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.group-content {
  line-height: 1.7;
}

.group-content h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.group-content h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.group-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background: var(--color-card);
  border-radius: 8px;
  overflow: hidden;
}

.group-content th,
.group-content td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.group-content th {
  background: var(--color-code-bg);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.group-content pre {
  background: #1a1a2e;
  color: #e9ecef;
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
}

.group-content code {
  background: var(--color-code-bg);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

.group-content pre code {
  background: transparent;
  padding: 0;
}

.source-files {
  background: var(--color-code-bg);
  padding: 1rem;
  border-radius: 8px;
  margin: 1rem 0;
}

.source-files h4 {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.source-files ul {
  margin: 0;
  padding-left: 1.25rem;
}

.source-files li {
  font-family: monospace;
  font-size: 0.85rem;
  margin: 0.25rem 0;
}

.group-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.group-nav a {
  padding: 0.5rem 1rem;
  background: var(--color-code-bg);
  border-radius: 6px;
  font-weight: 500;
  transition: background 0.2s;
}

.group-nav a:hover {
  background: var(--color-hover);
  text-decoration: none;
}

.group-nav .nav-all {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.group-nav .nav-all:hover {
  opacity: 0.9;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Responsive */
@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-links a {
    margin-left: 1rem;
    margin-right: 1rem;
  }

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

  .remediation-table {
    display: block;
    overflow-x: auto;
  }

  .group-nav {
    flex-direction: column;
    gap: 0.75rem;
  }

  .group-header h1 {
    font-size: 1.5rem;
  }

  .floating-legend {
    bottom: 10px;
    right: 10px;
  }
}

/* Floating Legend */
.floating-legend {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

.legend-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  transition: transform 0.2s, box-shadow 0.2s;
}

.legend-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.legend-content {
  display: none;
  position: absolute;
  bottom: 50px;
  right: 0;
  background: var(--color-card);
  border-radius: 8px;
  box-shadow: 0 4px 20px var(--color-shadow);
  padding: 1rem;
  min-width: 180px;
  border: 1px solid var(--color-border);
}

.floating-legend.expanded .legend-content {
  display: block;
  animation: fadeIn 0.2s ease;
}

.legend-header {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--color-text);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.legend-section {
  margin-bottom: 0.75rem;
}

.legend-section:last-child {
  margin-bottom: 0;
}

.legend-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  padding: 0.15rem 0;
}

.severity-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.severity-dot.high { background: var(--color-high); }
.severity-dot.medium { background: var(--color-medium); }
.severity-dot.low { background: var(--color-low); }
.severity-dot.manual { background: var(--color-manual); }

/* Filter Bar */
.filter-bar {
  background: var(--color-card);
  padding: 1rem;
  border-radius: 8px;
  margin: 1.5rem 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.filter-search {
  margin-bottom: 0.75rem;
}

.filter-search input {
  width: 100%;
  padding: 0.6rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-search input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-btn {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--color-border);
  background: var(--color-card);
  color: var(--color-text);
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.filter-btn:hover {
  background: var(--color-hover);
  border-color: var(--color-link);
}

.filter-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: transparent;
}

.filter-counts {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Copy Box */
.copy-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-code-bg);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  margin: 0.5rem 0;
  border: 1px solid var(--color-border);
}

.copy-box code {
  flex: 1;
  background: transparent;
  padding: 0;
  font-size: 0.85rem;
  word-break: break-all;
}

.copy-btn {
  padding: 0.25rem 0.5rem;
  border: none;
  background: var(--color-card);
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
  border: 1px solid var(--color-border);
}

.copy-btn:hover {
  background: var(--color-hover);
}

.copy-btn.copied {
  background: var(--color-code-bg);
  border-color: var(--color-pass);
  color: var(--color-pass);
}

/* ===== FOOTER BUTTONS ===== */
.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-actions {
  display: flex;
  gap: 0.75rem;
}

.footer-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--color-code-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  color: var(--color-text);
  font-size: 0.85rem;
  transition: all 0.2s;
}

.footer-btn:hover {
  background: var(--color-hover);
  border-color: var(--color-link);
}

.footer-btn .btn-label {
  font-size: 0.8rem;
}

/* Theme icon visibility */
.theme-icon-light,
.theme-icon-dark {
  line-height: 1;
}

[data-theme="light"] .theme-icon-dark,
[data-theme="dark"] .theme-icon-light {
  display: none;
}

[data-theme="light"] .theme-icon-light,
[data-theme="dark"] .theme-icon-dark {
  display: inline;
}

/* Dark mode overrides */
[data-theme="dark"] header {
  background: var(--color-header-bg);
  border-bottom: 1px solid var(--color-border);
}

[data-theme="dark"] a {
  color: var(--color-link);
}

[data-theme="dark"] code {
  background: var(--color-code-bg);
  color: var(--color-text);
}

[data-theme="dark"] table th {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

[data-theme="dark"] table tr:hover,
[data-theme="dark"] .status-table tbody tr:hover {
  background: var(--color-hover) !important;
}

[data-theme="dark"] .filter-btn {
  background: var(--color-card);
  border-color: var(--color-border);
  color: var(--color-text);
}

[data-theme="dark"] .filter-btn:hover,
[data-theme="dark"] .filter-btn.active {
  background: var(--color-link);
  color: white;
}

[data-theme="dark"] #table-search {
  background: var(--color-card);
  border-color: var(--color-border);
  color: var(--color-text);
}

[data-theme="dark"] .version-card {
  background: var(--color-card);
  border-color: var(--color-border);
}

[data-theme="dark"] .quick-link {
  background: var(--color-card);
  border-color: var(--color-border);
  color: var(--color-text);
}

[data-theme="dark"] footer {
  background: var(--color-card);
  border-top: 1px solid var(--color-border);
}

/* ===== KEYBOARD SHORTCUTS ===== */
.keyboard-help-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.keyboard-help-modal.active {
  display: flex;
}

.keyboard-help-content {
  background: var(--color-card);
  border-radius: 12px;
  box-shadow: 0 20px 40px var(--color-shadow);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  border: 1px solid var(--color-border);
}

.keyboard-help-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.keyboard-help-header h3 {
  margin: 0;
  color: var(--color-text);
}

.keyboard-help-header .close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: all 0.2s;
}

.keyboard-help-header .close-btn:hover {
  background: var(--color-hover);
  color: var(--color-text);
}

.keyboard-help-body {
  padding: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.shortcut-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.shortcut-title {
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
  padding-bottom: 0.25rem;
  border-bottom: 2px solid var(--color-link);
}

.shortcut {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

kbd {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  background: var(--color-code-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  font-size: 0.8rem;
  color: var(--color-text);
  box-shadow: 0 1px 2px var(--color-shadow);
  min-width: 1.5rem;
  text-align: center;
}

/* Keyboard row selection */
.keyboard-selected {
  outline: 2px solid var(--color-link) !important;
  outline-offset: -2px;
  background: var(--color-hover) !important;
}

/* ===== PRIORITY SCORING ===== */
.priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.priority-badge.critical {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: white;
}

.priority-badge.high {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
  color: white;
}

.priority-badge.medium {
  background: linear-gradient(135deg, #ca8a04 0%, #a16207 100%);
  color: white;
}

.priority-badge.low {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: white;
}

.priority-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
}

.priority-score.p1 { background: #dc2626; }
.priority-score.p2 { background: #ea580c; }
.priority-score.p3 { background: #ca8a04; }
.priority-score.p4 { background: #2563eb; }
.priority-score.p5 { background: #6b7280; }

/* ===== ADDITIONAL DARK MODE OVERRIDES ===== */

/* Status badges dark mode - ensure text stays readable */
[data-theme="dark"] .status-badge.fail {
  background: rgba(248, 113, 113, 0.2);
  color: #f87171;
}

[data-theme="dark"] .status-badge.pass {
  background: rgba(74, 222, 128, 0.2);
  color: #4ade80;
}

[data-theme="dark"] .status-badge.manual {
  background: rgba(156, 163, 175, 0.2);
  color: #9ca3af;
}

/* Tracking status dark mode */
[data-theme="dark"] .tracking-status.in_progress {
  background: rgba(96, 165, 250, 0.2);
  color: #60a5fa;
}

[data-theme="dark"] .tracking-status.pending {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
}

[data-theme="dark"] .tracking-status.on_hold {
  background: rgba(156, 163, 175, 0.2);
  color: #9ca3af;
}

[data-theme="dark"] .tracking-status.done {
  background: rgba(74, 222, 128, 0.2);
  color: #4ade80;
}

/* Status pills dark mode */
[data-theme="dark"] span.status-pill.in-progress {
  background: rgba(96, 165, 250, 0.2) !important;
  color: #60a5fa !important;
}

[data-theme="dark"] span.status-pill.pending {
  background: rgba(251, 191, 36, 0.2) !important;
  color: #fbbf24 !important;
}

[data-theme="dark"] span.status-pill.on-hold {
  background: rgba(156, 163, 175, 0.2) !important;
  color: #9ca3af !important;
}

[data-theme="dark"] span.status-pill.complete {
  background: rgba(74, 222, 128, 0.2) !important;
  color: #4ade80 !important;
}

/* Legend items dark mode */
[data-theme="dark"] .legend-item {
  color: var(--color-text);
}

/* Card border for dark mode */
[data-theme="dark"] .card {
  border: 1px solid var(--color-border);
}

[data-theme="dark"] .card.total {
  border-left-color: #9ca3af;
}

/* Group-id link dark mode */
[data-theme="dark"] a.group-id {
  color: #a5b4fc !important;
  -webkit-text-fill-color: #a5b4fc !important;
  background: rgba(165, 180, 252, 0.1) !important;
}

[data-theme="dark"] a.group-id:hover {
  background: rgba(165, 180, 252, 0.2) !important;
}

/* Table first column gradient text dark mode fix */
[data-theme="dark"] table td:first-child a {
  background: linear-gradient(135deg, #a5b4fc 0%, #c4b5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* Quick link gradient preserved in dark mode */
[data-theme="dark"] .quick-link {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: transparent;
}

/* No tracking text dark mode */
[data-theme="dark"] .no-tracking {
  color: var(--color-text-muted);
}

/* Source files dark mode */
[data-theme="dark"] .source-files li {
  color: var(--color-text);
}
