/* Basic Layout */
* { box-sizing: border-box; }
body {
  font-family: system-ui, Arial, sans-serif;
  margin: 0;
  background: #f5f7fa;
  color: #1f2d3d;
  line-height: 1.36;
}
header { padding: 1.5rem 2rem 0.5rem; }
header h1 { margin: 0 0 0.25rem; font-size: 1.9rem; }
header .tagline { margin: 0; color: #546e7a; font-size: 0.95rem; }
header .last-updated { 
  margin: 0.5rem 0 0; 
  font-size: 0.8rem; 
  color: #78909c; 
  font-style: italic;
}
header .last-updated span { 
  font-weight: 500; 
  color: #455a64; 
}
footer { text-align: center; padding: 2rem 0 3rem; font-size: 0.75rem; color: #607d8b; }

main.grid {
  display: grid;
  gap: 1.2rem;
  padding: 0 2rem 2rem;
  grid-template-columns: repeat(auto-fit,minmax(260px,1fr));
}

/* Cards */
.card {
  background: #ffffff;
  border: 1px solid #dde3e8;
  border-radius: 8px;
  padding: 1rem 1.1rem 1.2rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
}
.card.wide { grid-column: span 2; }
.card h2 { margin: 0 0 0.75rem; font-size: 1.15rem; font-weight: 600; }

/* Risk Index */
.risk-value { font-size: 3.2rem; font-weight: 600; letter-spacing: -2px; }
.risk-direction { margin-top: 0.4rem; font-size: 0.9rem; font-weight: 500; }
.period { margin-top: 0.35rem; font-size: 0.75rem; color: #607d8b; }
.risk-low { color: #2e7d32; }
.risk-medium { color: #f9a825; }
.risk-high { color: #c62828; }
.dir-better { color: #2e7d32; }
.dir-worse { color: #c62828; }
.dir-stable { color: #455a64; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
th, td { border: 1px solid #e0e6eb; padding: 4px 6px; text-align: center; }
th { background: #f0f3f6; font-weight: 600; }
tbody tr:hover { background: #fafafa; }

/* Severity coloring */
.sev-critical { background:#ffcdd2; }
.sev-high { background:#ffe0b2; }
.sev-medium { background:#fff9c4; }
.sev-low { background:#e0f2f1; }
.sev-unknown { background:#eceff1; }
.sev { font-weight: 600; }

/* Delta coloring */
.delta.worse { color:#c62828; font-weight:600; }
.delta.better { color:#2e7d32; font-weight:600; }
.delta.stable { color:#455a64; font-weight:600; }

/* Error Box */
.error-box {
  background:#ffebee;
  color:#b71c1c;
  border:1px solid #f44336;
  padding:0.75rem 1rem;
  border-radius:6px;
  margin:1rem 2rem;
  font-size:0.9rem;
}

.foot-note { margin-top: .5rem; font-size: .65rem; color:#607d8b; }

/* Issue Board Styles */
.issues-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.issue-item {
  background: #f8f9fa;
  border-left: 4px solid #0969da;
  padding: 1rem;
  border-radius: 4px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.issue-item:hover {
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.issue-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.issue-title {
  color: #0969da;
  text-decoration: none;
  font-weight: 500;
  flex: 1;
}

.issue-title:hover {
  text-decoration: underline;
}

.age {
  color: #6c757d;
  font-size: 0.85rem;
  white-space: nowrap;
}

.issue-labels {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.label {
  padding: 0.28rem 0.6rem;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid rgba(0,0,0,0.12);
  box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset;
}

.no-issues, .loading, .error {
  text-align: center;
  padding: 2rem;
  color: #6c757d;
  font-size: 1.1rem;
}

/* CVE Details Button */
.cve-details-btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: #0969da;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 500;
  transition: background 0.2s;
}

.cve-details-btn:hover {
  background: #0550ae;
}

@media (max-width: 860px) {
  .card.wide { grid-column: span 1; }
  .risk-value { font-size: 2.3rem; }
}
