/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.205 0 0);
  --card-foreground: oklch(0.985 0 0);
  --border: oklch(0.269 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --destructive: oklch(0.704 0.191 22.216);
  --radius: 12px;

  /* Точечный фон */
  --dot-bg: oklch(0.185 0 0);
  --dot-color: #454545;
  --dot-size: 1px;
  --dot-space: 12px;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--foreground);
  background-color: var(--dot-color);
  background-image:
    linear-gradient(90deg, var(--dot-bg) calc(var(--dot-space) - var(--dot-size)), transparent 1%),
    linear-gradient(var(--dot-bg) calc(var(--dot-space) - var(--dot-size)), transparent 1%);
  background-size: var(--dot-space) var(--dot-space);
  background-position: center center;
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px;
}

/* ── Header ── */
.header {
  text-align: center;
  margin-bottom: 32px;
}

.header-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--foreground);
}

.header-subtitle {
  font-size: 14px;
  color: var(--muted-foreground);
  margin-top: 4px;
}

/* ── Overall Status Banner ── */
.overall-status {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.06);
}

.overall-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted-foreground);
  flex-shrink: 0;
}

.overall-indicator.operational {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

.overall-indicator.degraded {
  background: #eab308;
  box-shadow: 0 0 8px rgba(234, 179, 8, 0.4);
}

.overall-indicator.down {
  background: oklch(0.704 0.191 22.216);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.overall-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.overall-label {
  font-size: 16px;
  font-weight: 600;
}

.overall-updated {
  font-size: 12px;
  color: var(--muted-foreground);
}

/* ── Services Grid ── */
.services-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Service Card ── */
.service-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.06);
  transition: border-color 0.15s ease;
}

.service-card:hover {
  border-color: oklch(0.35 0 0);
}

.service-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.service-status-dot.operational {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.35);
}

.service-status-dot.degraded {
  background: #eab308;
  box-shadow: 0 0 6px rgba(234, 179, 8, 0.35);
}

.service-status-dot.down {
  background: oklch(0.704 0.191 22.216);
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.35);
}

.service-info {
  flex: 1;
  min-width: 0;
}

.service-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--card-foreground);
}

.service-category {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-top: 2px;
}

.service-metrics {
  display: flex;
  gap: 24px;
  flex-shrink: 0;
}

.metric {
  text-align: right;
}

.metric-value {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--card-foreground);
}

.metric-label {
  font-size: 11px;
  color: var(--muted-foreground);
  margin-top: 1px;
}

/* ── Footer ── */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted-foreground);
}

/* ── Loading pulse animation ── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.loading .service-card {
  animation: pulse 1.5s ease-in-out infinite;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .container { padding: 24px 16px; }
  .service-card { flex-wrap: wrap; padding: 16px; }
  .service-metrics {
    width: 100%;
    justify-content: space-between;
    margin-top: 8px;
    padding-left: 26px;
  }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.25); }
