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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background: #1a1a2e;
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid #2a2a4a;
}

.sidebar-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.nav-links {
  list-style: none;
  padding: 10px 0;
}

.nav-links a {
  display: block;
  padding: 12px 20px;
  color: #a0a0c0;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  background: #2a2a4a;
  color: #fff;
}

/* Content */
.content {
  margin-left: 240px;
  padding: 24px;
  flex: 1;
  width: calc(100% - 240px);
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

h1 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 20px;
}

.page-header h1 {
  margin-bottom: 0;
}

/* Summary Cards */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.card {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card h3 {
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card .value {
  font-size: 32px;
  font-weight: 700;
}

.card.loading {
  text-align: center;
  color: #999;
  grid-column: 1 / -1;
}

/* Severity Colors */
.severity-critical { color: #dc2626; }
.severity-high { color: #ea580c; }
.severity-medium { color: #d97706; }
.severity-low { color: #16a34a; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-critical { background: #fef2f2; color: #dc2626; }
.badge-high { background: #fff7ed; color: #ea580c; }
.badge-medium { background: #fffbeb; color: #d97706; }
.badge-low { background: #f0fdf4; color: #16a34a; }

.badge-open { background: #fef2f2; color: #dc2626; }
.badge-upcoming { background: #fffbeb; color: #d97706; }
.badge-closed { background: #f0fdf4; color: #16a34a; }

/* Tables */
.table-container {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

th {
  background: #f9fafb;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
}

tbody tr {
  cursor: pointer;
  transition: background 0.15s;
}

tbody tr:hover {
  background: #f9fafb;
}

/* Filters */
.filters {
  margin-bottom: 16px;
  display: flex;
  gap: 12px;
}

.filters select {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
}

/* Buttons */
.btn {
  padding: 8px 16px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s;
}

.btn:hover {
  background: #f3f4f6;
}

.btn-primary {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.pagination {
  margin-top: 16px;
  text-align: center;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
  font-size: 18px;
}

.btn-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #6b7280;
}

.modal-body {
  padding: 24px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 16px;
}

.detail-label {
  font-weight: 600;
  color: #6b7280;
  font-size: 13px;
}

.detail-value {
  font-size: 14px;
  word-break: break-all;
}

pre.json-block {
  background: #f9fafb;
  border-radius: 6px;
  padding: 12px;
  font-size: 12px;
  overflow-x: auto;
  margin-top: 16px;
  max-height: 300px;
  overflow-y: auto;
}
