﻿:root {
  --bg-main: #090d16;
  --bg-card: #131b2e;
  --bg-card-hover: #1c263f;
  --border-color: #23304e;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --accent-cyan: #38bdf8;
  --accent-blue: #3b82f6;
  --accent-purple: #a855f7;
  --status-online: #22c55e;
  --status-offline: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.15);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  padding-bottom: 40px;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: rgba(19, 27, 46, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand h1 span {
  color: var(--accent-cyan);
  font-weight: 400;
  font-size: 0.95rem;
}

.pulse-dot-header {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--status-online);
  box-shadow: 0 0 10px var(--status-online);
  animation: pulse-ring 2s infinite ease-in-out;
}

.system-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.container {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

h2 {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.hosts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
}

.card.card-active {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.2);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.card-id {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: monospace;
}

.badge-status {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-online {
  background: rgba(34, 197, 94, 0.15);
  color: var(--status-online);
  border: 1px solid var(--status-online);
}

.status-offline {
  background: var(--danger-bg);
  color: var(--status-offline);
  border: 1px solid var(--status-offline);
}

.card-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.metric-item {
  display: flex;
  flex-direction: column;
}

.metric-k {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.metric-v {
  font-size: 0.95rem;
  font-weight: 700;
}

.hidden {
  display: none !important;
}

.node-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  padding: 16px 20px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.node-header h2 {
  font-size: 1.25rem;
  color: var(--text-main);
  margin-bottom: 4px;
}

.badge-id {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--accent-cyan);
}

.stats-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 14px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.stat-val {
  font-size: 1.25rem;
  font-weight: 700;
}

.panel-chart, .panel-processes {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 18px;
  margin-top: 16px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.panel-title h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

.legend-note {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.legend-cpu { color: var(--accent-cyan); }
.legend-mem { color: var(--accent-purple); }

.chart-wrapper {
  width: 100%;
  min-height: 220px;
}

.badge-tag {
  font-family: monospace;
  font-size: 0.75rem;
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent-cyan);
  padding: 2px 6px;
  border-radius: 4px;
}

.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table th {
  text-align: left;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.75rem;
  font-weight: 600;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.cell-mono {
  font-family: monospace;
  color: var(--accent-cyan);
}

.cell-cwd {
  font-family: monospace;
  color: #e2e8f0;
  max-width: 320px;
  word-break: break-all;
}

.cell-empty {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-style: italic;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}