/* SparkView Dashboard — NVIDIA-inspired dark theme */
:root {
  --bg: #0a0a0a;
  --card-bg: #141414;
  --card-border: #1f1f1f;
  --accent: #76b900;
  --accent-dim: #4a7a00;
  --text: #e0e0e0;
  --text-dim: #888;
  --red: #f44336;
  --orange: #ff9800;
  --yellow: #ffc107;
  --green: #76b900;
  --blue: #2196f3;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, sans-serif;
  --radius: 8px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  min-height: 100vh;
}

/* Header */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: linear-gradient(135deg, #0f0f0f 0%, #1a1a0e 100%);
  border-bottom: 1px solid var(--card-border);
}

.header-left { display: flex; align-items: center; gap: 16px; }
.header-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.logo {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--text);
}

.logo-accent { color: var(--accent); }

.header-info {
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--mono);
}

.conn-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-left: 8px;
}

.conn-dot.connected { background: var(--green); box-shadow: 0 0 6px var(--green); }
.conn-dot.disconnected { background: var(--red); box-shadow: 0 0 6px var(--red); }

/* Grid */
main.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 16px 24px;
  max-width: 1600px;
  margin: 0 auto;
}

@media (max-width: 1100px) { main.grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) { main.grid { grid-template-columns: 1fr; } }

/* Card */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: var(--radius) var(--radius) 0 0;
}

.card-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 12px;
  text-transform: uppercase;
}

/* Metric rows */
.metric-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.label {
  font-size: 12px;
  color: var(--text-dim);
  width: 80px;
  flex-shrink: 0;
}

.bar-track {
  flex: 1;
  height: 8px;
  background: #222;
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease, background 0.5s ease;
  min-width: 1px;
}

.bar-fill.green { background: linear-gradient(90deg, var(--accent-dim), var(--accent)); }
.bar-fill.yellow { background: linear-gradient(90deg, #e6a800, var(--yellow)); }
.bar-fill.orange { background: linear-gradient(90deg, #e65100, var(--orange)); }
.bar-fill.red { background: linear-gradient(90deg, #c62828, var(--red)); }
.bar-fill.blue { background: linear-gradient(90deg, #1565c0, var(--blue)); }
.bar-fill.dim { background: #333; }

.value {
  font-family: var(--mono);
  font-size: 13px;
  min-width: 90px;
  text-align: right;
}

/* Stats row */
.stats-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.stat {
  font-size: 13px;
  font-family: var(--mono);
  color: var(--text);
}

.stat.badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 1px;
}

.badge-green { background: #1b3d00; color: var(--green); }
.badge-yellow { background: #3d3000; color: var(--yellow); }
.badge-orange { background: #3d1f00; color: var(--orange); }
.badge-red { background: #3d0000; color: var(--red); }
.badge-dim { background: #222; color: var(--text-dim); }

/* Process table */
.proc-table {
  margin-top: 8px;
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text-dim);
}

.proc-row {
  display: flex;
  gap: 6px;
  padding: 2px 0;
}

.proc-row.header { color: var(--accent); font-weight: 600; }

.proc-pid { width: 50px; }
.proc-user { width: 70px; }
.proc-mem { width: 60px; text-align: right; }
.proc-cpu { width: 40px; text-align: right; }
.proc-cmd { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Core grid */
.core-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 2px;
  margin: 8px 0;
}

.core-bar {
  height: 4px;
  border-radius: 2px;
  background: #333;
  overflow: hidden;
}

.core-bar-inner {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease, background 0.5s ease;
}

/* Reasons */
.reasons {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--red);
  margin-top: 4px;
}

/* Network */
.net-iface {
  padding: 6px 0;
  border-bottom: 1px solid #1a1a1a;
}

.net-iface:last-child { border-bottom: none; }

.net-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.net-name {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.net-state {
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
}

.net-state.up { background: #1b3d00; color: var(--green); }
.net-state.down { background: #3d0000; color: var(--red); }

.net-speed {
  font-size: 11px;
  color: var(--text-dim);
}

.net-stats {
  display: flex;
  gap: 16px;
  font-size: 12px;
  font-family: var(--mono);
  color: var(--text-dim);
}

/* Power */
.power-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
}

.power-label { color: var(--text-dim); }
.power-value { font-family: var(--mono); color: var(--text); }

/* Disk */
.disk-mount {
  margin-bottom: 10px;
}

.disk-mount:last-child { margin-bottom: 0; }

.disk-label {
  font-size: 12px;
  color: var(--text);
  font-family: var(--mono);
  margin-bottom: 4px;
}

.disk-detail {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

/* Footer */
footer {
  text-align: center;
  padding: 12px 24px;
  font-size: 11px;
  color: var(--text-dim);
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: space-between;
}

.footer-secondary { font-family: var(--mono); }

/* Animations */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.conn-dot.connected { animation: pulse 2s ease-in-out infinite; }

/* Hidden */
.hidden { display: none !important; }