:root {
  --bg-1: #f6f2eb;
  --bg-2: #e6f2ff;
  --surface: #ffffff;
  --ink: #1c1e24;
  --muted: #6b7280;
  --accent: #0f766e;
  --accent-strong: #0b4a46;
  --accent-2: #f97316;
  --border: #e6e3de;
  --shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Work Sans", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, var(--bg-2), transparent 50%),
    linear-gradient(130deg, var(--bg-1), #fff4e6 70%);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--accent);
}

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.topbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.brand--link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.brand--link:hover {
  color: inherit;
}

.brand--stack {
  flex-direction: column;
  align-items: flex-start;
}

.brand__mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  font-weight: 700;
}

.brand__title {
  font-size: 1.1rem;
  font-weight: 700;
}

.brand__subtitle {
  font-family: "Spectral", serif;
  font-size: 0.85rem;
  color: var(--muted);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-weight: 500;
}

.nav__form {
  margin: 0;
}

.nav__button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.nav__quiet {
  color: var(--muted);
}

.content {
  padding: 2.5rem 0 4rem;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 520px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1.2rem;
  box-shadow: var(--shadow);
}

.stat__label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
}

.stat__value {
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 0.2rem;
}

.stat__hint {
  color: var(--muted);
  font-size: 0.8rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.8rem;
  box-shadow: var(--shadow);
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.panel__header h2 {
  margin: 0;
}

.muted {
  color: var(--muted);
}

.table {
  display: grid;
  gap: 0.4rem;
}

.table__row {
  display: grid;
  grid-template-columns: 1.6fr 1fr 0.8fr 1fr;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: #fbfbfb;
  border: 1px solid transparent;
}

.table--admin .table__row {
  grid-template-columns: 1.6fr 1fr 0.8fr 1fr 0.9fr;
}

.table__row--head {
  background: #f1f5f9;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.7rem;
}

.table__row:hover {
  border-color: var(--border);
}

.table__title {
  font-weight: 600;
}

.table__meta {
  color: var(--muted);
  font-size: 0.75rem;
}

.table__actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.form {
  display: grid;
  gap: 1rem;
}

.form__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 500;
}

input,
select,
textarea {
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 0.95rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(15, 118, 110, 0.2);
  border-color: var(--accent);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 12px 20px rgba(15, 118, 110, 0.2);
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 24px rgba(15, 118, 110, 0.25);
  color: #ffffff;
}

.button--ghost {
  background: transparent;
  color: var(--accent-strong);
  border: 1px solid var(--border);
  box-shadow: none;
}

.button--ghost:hover {
  color: var(--accent-strong);
  border-color: var(--accent);
}

.button--small {
  padding: 0.45rem 0.8rem;
  font-size: 0.85rem;
}

.form__actions {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.messages {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}

.errorlist {
  list-style: none;
  margin: 0;
  padding: 0;
  color: #b91c1c;
  font-size: 0.85rem;
}

.errorlist li + li {
  margin-top: 0.2rem;
}

.message {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: #ecfdf3;
  border: 1px solid #bbf7d0;
  color: #065f46;
}

.message--warning {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.empty {
  padding: 1.5rem;
  border-radius: 16px;
  border: 1px dashed var(--border);
  text-align: center;
}

.auth {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.auth__panel {
  width: min(420px, 90vw);
  display: grid;
  gap: 1.2rem;
}

.card {
  display: grid;
  gap: 0.8rem;
  padding: 2rem;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.card h1 {
  margin: 0 0 0.6rem;
}

.link {
  color: var(--accent-2);
  font-weight: 600;
}

.link--danger {
  color: #dc2626;
}

.link--danger:hover {
  color: #b91c1c;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.status--up {
  background: #dcfce7;
  color: #166534;
}

.status--down {
  background: #fee2e2;
  color: #991b1b;
}

.status--unknown {
  background: #e2e8f0;
  color: #475569;
}

code {
  background: #f8fafc;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  font-size: 0.85rem;
}

@media (max-width: 720px) {
  .topbar__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .nav {
    flex-wrap: wrap;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .table--admin .table__row {
    grid-template-columns: 1fr;
  }

  .panel__header {
    flex-direction: column;
    align-items: flex-start;
  }
}
