:root {
  --primary: #3b82f6;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --background: #0f172a;
  --surface: #1e293b;
  --surface-light: #334155;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --border: #334155;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.3;
  padding: 10px;
  font-size: 0.85rem;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
}

header {
  text-align: center;
  margin-bottom: 15px;
}

header h1 {
  font-size: 1.5rem;
  margin-bottom: 5px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Loading */
.loading {
  text-align: center;
  padding: 30px 10px;
}

.spinner {
  border: 3px solid var(--surface-light);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 0 auto 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Error Message */
.error-message {
  background: var(--danger);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 10px;
  font-size: 0.8rem;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--border);
  padding-bottom: 6px;
}

.tab {
  padding: 6px 12px;
  background: var(--surface);
  border: none;
  border-radius: 6px 6px 0 0;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s;
}

.tab:hover {
  background: var(--surface-light);
  color: var(--text);
}

.tab.active {
  background: var(--primary);
  color: white;
}

/* Status Card */
.status-card {
  background: var(--surface);
  border-radius: 8px;
  padding: 10px 15px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: pulse 2s infinite;
}

.status-indicator.up .status-dot {
  background: var(--success);
}

.status-indicator.down .status-dot {
  background: var(--danger);
}

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

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

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.stat-card {
  background: var(--surface);
  border-radius: 8px;
  padding: 10px 12px;
  text-align: center;
}

.stat-card h3 {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 500;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

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

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.chart-card {
  background: var(--surface);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
}

.chart-card h3 {
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.chart-card canvas {
  max-height: 250px;
}

/* Table */
.table-card {
  background: var(--surface);
  border-radius: 8px;
  padding: 10px 12px;
}

.table-card h3 {
  margin-bottom: 8px;
  font-size: 0.85rem;
}

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

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

thead {
  background: var(--surface-light);
}

th {
  padding: 6px 8px;
  text-align: left;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
}

td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
}

tbody tr:hover {
  background: var(--surface-light);
}

.loading-row {
  text-align: center;
  color: var(--text-muted);
  padding: 20px !important;
  font-size: 0.75rem;
}

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 600;
}

.status-badge.success {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.status-badge.failed {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.duration {
  font-family: "Courier New", monospace;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.75rem;
}

.message-id {
  font-family: "Courier New", monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
  header h1 {
    font-size: 1.2rem;
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .status-card {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}


