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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

.navbar {
  background: #0066cc;
  color: white;
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  color: white;
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 700;
}

.nav-links a {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  margin-left: 1.5rem;
}
.nav-links a:hover { color: white; text-decoration: underline; }

.container {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

h1 { margin-bottom: 1rem; }
h2 { margin: 1.5rem 0 0.75rem; }
h3 { margin: 1rem 0 0.5rem; }

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: #e2e8f0;
  color: #333;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.9rem;
  margin-right: 0.25rem;
}
.btn:hover { background: #cbd5e1; }
.btn-primary { background: #0066cc; color: white; }
.btn-primary:hover { background: #0052a3; }
.btn-danger { background: #dc2626; color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-small { padding: 0.25rem 0.6rem; font-size: 0.8rem; }

.card {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1rem 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.login-card {
  max-width: 400px;
  margin: 4rem auto;
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.25rem; font-weight: 500; }
.form-group input, .inline-form input {
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 0.95rem;
}
.form-group input { width: 100%; }

.inline-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

.stats-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.stat-card {
  background: white;
  border-radius: 8px;
  padding: 1.25rem;
  min-width: 160px;
  flex: 1;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.stat-card .stat-value { font-size: 1.5rem; font-weight: 700; }
.stat-card .stat-label { font-size: 0.85rem; color: #666; margin-top: 0.25rem; }
.stat-card small { display: block; color: #999; font-size: 0.75rem; margin-top: 0.25rem; word-break: break-all; }

.status-healthy { border-left: 4px solid #16a34a; }
.status-degraded { border-left: 4px solid #f59e0b; }
.status-down { border-left: 4px solid #dc2626; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin: 1rem 0;
}
.data-table th, .data-table td {
  padding: 0.6rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}
.data-table th { background: #f8fafc; font-weight: 600; font-size: 0.85rem; text-transform: uppercase; color: #666; }

.status-row-failure { background: #fef2f2; }
.status-row-partial { background: #fffbeb; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-partial { background: #fef3c7; color: #92400e; }
.badge-failure { background: #fee2e2; color: #991b1b; }

.chart-container {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin: 1rem 0;
}

.filter-bar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.filter-bar label { font-size: 0.9rem; }
.filter-bar input[type="date"] {
  padding: 0.4rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
}

.latest-card {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin: 1rem 0;
}
.latest-card .stat { text-align: center; flex: 1; }
.latest-card .stat-label { display: block; font-size: 0.85rem; color: #666; }
.latest-card .stat-value { display: block; font-size: 1.3rem; font-weight: 700; }

.admin-actions { margin: 1rem 0; }
.preset-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.pagination { display: flex; gap: 1rem; align-items: center; justify-content: center; margin: 1.5rem 0; }

pre { background: #f1f5f9; padding: 0.75rem; border-radius: 4px; overflow-x: auto; font-size: 0.8rem; }
details summary { cursor: pointer; color: #0066cc; }
