:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --neutral: #64748b;
  --bg-body: #0f172a;
  --bg-sidebar: #1e293b;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --bg-input: #0f172a;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --border: #334155;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.3);
}

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

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 220px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 10;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-sub {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.nav-links {
  list-style: none;
  padding: 16px 0;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.nav-link:hover {
  color: var(--text-main);
  background: rgba(99, 102, 241, 0.1);
}

.nav-link.active {
  color: var(--primary-light);
  background: rgba(99, 102, 241, 0.15);
  border-left-color: var(--primary);
}

.nav-link i { width: 20px; text-align: center; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.sidebar-footer .version {
  font-size: 11px;
  color: var(--text-dim);
}

/* Content */
.content {
  margin-left: 220px;
  flex: 1;
  padding: 32px;
  min-height: 100vh;
}

/* Page header */
.page-header {
  margin-bottom: 32px;
}

.page-header h2 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 4px;
}

.page-header p {
  color: var(--text-muted);
  font-size: 14px;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-body { padding: 20px; }

/* Grid layouts */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.grid-2-1 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

/* Stat cards */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

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

.stat-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

.stat-value.success { color: var(--success); }
.stat-value.danger { color: var(--danger); }
.stat-value.warning { color: var(--warning); }
.stat-value.primary { color: var(--primary-light); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-neutral { background: rgba(100, 116, 139, 0.15); color: #94a3b8; }
.badge-dev { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; }
.badge-daily { background: rgba(14, 165, 233, 0.15); color: #38bdf8; }
.badge-release { background: rgba(16, 185, 129, 0.15); color: #34d399; }

/* Tables */
.table-container { overflow-x: auto; }

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

th {
  text-align: left;
  padding: 12px 16px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.5);
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

tr:last-child td { border-bottom: none; }

tr:hover td { background: var(--bg-card-hover); }

tr.clickable { cursor: pointer; }

/* Fonts */
.font-mono { font-family: 'JetBrains Mono', monospace; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.font-medium { font-weight: 500; }

/* Platform icons */
.platform-icons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.platform-icon {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.platform-icon.passed { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.platform-icon.failed { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.platform-icon.skipped { background: rgba(100, 116, 139, 0.1); color: #475569; }

/* Filters bar */
.filters {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  align-items: center;
}

.filter-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.pagination button {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  transition: all 0.2s;
}

.pagination button:hover { border-color: var(--primary); }
.pagination button:disabled { opacity: 0.3; cursor: not-allowed; }
.pagination button.active { background: var(--primary); border-color: var(--primary); }

/* Chart containers */
.chart-container {
  position: relative;
  height: 280px;
  padding: 16px;
}

.chart-container-sm {
  position: relative;
  height: 200px;
  padding: 16px;
}

/* Loading */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.loading-overlay.hidden { display: none; }

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state p {
  font-size: 14px;
}

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  margin-bottom: 20px;
  transition: color 0.2s;
}

.back-link:hover { color: var(--primary-light); }

/* Health bar */
.health-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 12px;
}

.health-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
}

/* Responsive */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .content { margin-left: 0; }
  .grid-4, .grid-3, .grid-2, .grid-2-1 { grid-template-columns: 1fr; }
}
