:root {
  --bg: #0e1116;
  --surface: #161b22;
  --surface-2: #1c222b;
  --border: #232a33;
  --text: #e6edf3;
  --text-muted: #7d8590;
  --ok: #2ea043;
  --ok-soft: #1a4429;
  --minor: #d4a72c;
  --degraded: #db6d28;
  --down: #f85149;
  --unknown: #484f58;
  --accent: #58a6ff;
  --radius: 10px;
  --max-w: 920px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 48px 24px 64px;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.brand {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
}
.pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}
.pill--ok {
  background: rgba(46, 160, 67, 0.12);
  color: var(--ok);
  border-color: rgba(46, 160, 67, 0.35);
}
.pill--degraded {
  background: rgba(219, 109, 40, 0.12);
  color: var(--degraded);
  border-color: rgba(219, 109, 40, 0.35);
}
.pill--down {
  background: rgba(248, 81, 73, 0.12);
  color: var(--down);
  border-color: rgba(248, 81, 73, 0.35);
}
.pill--unknown {
  background: rgba(125, 133, 144, 0.12);
  color: var(--text-muted);
  border-color: rgba(125, 133, 144, 0.35);
}

.grid {
  display: grid;
  gap: 16px;
}

.row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px 16px;
}

.row__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.row__title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  transform: translateY(1px);
}
.dot--ok {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(46, 160, 67, 0.18);
}
.dot--degraded {
  background: var(--degraded);
  box-shadow: 0 0 0 3px rgba(219, 109, 40, 0.18);
}
.dot--down {
  background: var(--down);
  box-shadow: 0 0 0 3px rgba(248, 81, 73, 0.18);
}
.dot--unknown {
  background: var(--unknown);
}

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

.row__desc {
  color: var(--text-muted);
  font-size: 13px;
}

.row__metrics {
  display: flex;
  gap: 18px;
}

.metric {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
}

.metric__num {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 14px;
}

.metric__label {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.strip {
  display: grid;
  grid-template-columns: repeat(90, 1fr);
  gap: 2px;
  align-items: stretch;
  height: 36px;
  margin-top: 4px;
}

.cell {
  border-radius: 2px;
  background: var(--ok);
  transition: transform 0.08s ease;
}
.cell:hover {
  transform: scaleY(1.08);
}
.cell--ok {
  background: var(--ok);
}
.cell--minor {
  background: var(--minor);
}
.cell--degraded {
  background: var(--degraded);
}
.cell--down {
  background: var(--down);
}
.cell--empty {
  background: var(--surface-2);
}

.strip__legend {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}

.incidents {
  margin-top: 40px;
}

.incidents h2 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 12px;
  font-weight: 600;
}

.muted {
  color: var(--text-muted);
  font-size: 14px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 0;
}

.incident-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.incident {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--unknown);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.incident--investigating {
  border-left-color: var(--down);
}
.incident--identified {
  border-left-color: var(--degraded);
}
.incident--monitoring {
  border-left-color: var(--minor);
}
.incident--resolved {
  border-left-color: var(--ok);
}

.incident__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.incident__title {
  font-weight: 600;
}

.tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
}
.tag--investigating {
  background: rgba(248, 81, 73, 0.14);
  color: var(--down);
}
.tag--identified {
  background: rgba(219, 109, 40, 0.14);
  color: var(--degraded);
}
.tag--monitoring {
  background: rgba(212, 167, 44, 0.14);
  color: var(--minor);
}
.tag--resolved {
  background: rgba(46, 160, 67, 0.14);
  color: var(--ok);
}

.incident__meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.incident__body {
  margin: 6px 0 0;
  font-size: 14px;
  white-space: pre-wrap;
}

.foot {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 600px) {
  .wrap {
    padding: 24px 16px 48px;
  }
  .row__metrics {
    width: 100%;
    justify-content: space-between;
  }
  .metric {
    align-items: flex-start;
  }
}

/* ---------- Admin ---------- */

.wrap--narrow {
  max-width: 480px;
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
}
.admin-nav a {
  color: var(--text-muted);
}
.admin-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

.muted-link {
  color: var(--text-muted);
  font-size: 13px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 16px;
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.card__title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.muted-inline {
  color: var(--text-muted);
  font-size: 12px;
}

.error {
  background: rgba(248, 81, 73, 0.12);
  border: 1px solid rgba(248, 81, 73, 0.35);
  color: var(--down);
  padding: 10px 12px;
  border-radius: 8px;
  margin: 0 0 14px;
  font-size: 14px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form--danger {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 0;
  margin: 0;
  padding: 0;
}

.field__label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

.checks {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid var(--border);
}

.check input {
  margin: 0;
}

input[type="text"],
input[type="password"],
input[type="datetime-local"],
select,
textarea {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

textarea {
  resize: vertical;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  line-height: 1.45;
}

.form__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}
.btn:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.btn--primary {
  background: var(--accent);
  color: #0d1117;
  border-color: var(--accent);
}
.btn--primary:hover {
  filter: brightness(1.05);
}

.btn--ok {
  background: rgba(46, 160, 67, 0.18);
  color: var(--ok);
  border-color: rgba(46, 160, 67, 0.45);
}

.btn--danger {
  background: rgba(248, 81, 73, 0.16);
  color: var(--down);
  border-color: rgba(248, 81, 73, 0.45);
}

.btn--ghost {
  background: transparent;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th,
.table td {
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
}

.cell-right {
  text-align: right;
}

@media (max-width: 600px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}
