:root {
  --bg: #f6f2e8;
  --bg-alt: #edf1f2;
  --text: #1b1f24;
  --muted: #5d6b7a;
  --primary: #f08b2d;
  --primary-dark: #c56a16;
  --secondary: #1f7a8c;
  --secondary-dark: #145966;
  --card: #ffffff;
  --border: rgba(27, 31, 36, 0.12);
  --shadow: 0 18px 40px rgba(20, 24, 28, 0.12);
  --ok: #2a9d8f;
  --bad: #e63946;
  --inactive: #8d99ae;
  --warning: #d58936;
  --body-font: "Spectral", serif;
  --heading-font: "Space Grotesk", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--body-font);
  color: var(--text);
  min-height: 100vh;
  background: linear-gradient(135deg, #f6f2e8 0%, #f0f7f5 40%, #f5efe4 100%);
  position: relative;
  overflow-x: hidden;
}

code {
  font-family: var(--heading-font);
  background: rgba(31, 122, 140, 0.12);
  padding: 0.15rem 0.3rem;
  border-radius: 6px;
}

body::before,
body::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(240, 139, 45, 0.18), transparent 65%);
  top: -120px;
  right: -120px;
  z-index: 0;
}

body::after {
  background: radial-gradient(circle at 30% 30%, rgba(31, 122, 140, 0.18), transparent 65%);
  top: auto;
  bottom: -160px;
  left: -120px;
}

.container {
  width: min(1200px, 92vw);
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
  position: relative;
  z-index: 1;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.75rem 1.5rem;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(140deg, var(--primary), #f7b267);
  color: #ffffff;
  font-family: var(--heading-font);
  font-weight: 700;
  display: grid;
  place-items: center;
  letter-spacing: 0.04em;
}

.brand-title {
  font-family: var(--heading-font);
  font-size: 1.1rem;
  font-weight: 700;
}

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

.nav-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.nav-link {
  font-family: var(--heading-font);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.nav-link:hover {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.8);
}

.nav-link.active {
  background: var(--primary);
  color: #ffffff;
  border-color: transparent;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  margin: 2.5rem 0 1.5rem;
  animation: float-in 0.7s ease-out both;
}

.page-header h1 {
  font-family: var(--heading-font);
  font-size: clamp(2rem, 3vw, 2.8rem);
  margin: 0.4rem 0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.75rem;
  color: var(--secondary);
  font-weight: 700;
  margin: 0;
}

.lead {
  margin: 0;
  color: var(--muted);
  max-width: 420px;
}

.header-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.card {
  background: var(--card);
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  animation: float-in 0.8s ease-out both;
}

.card h2 {
  font-family: var(--heading-font);
  margin-top: 0;
}

.search-row {
  display: flex;
  gap: 1.5rem;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
}

.field-label {
  display: block;
  font-family: var(--heading-font);
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.text-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-family: var(--body-font);
  font-size: 1rem;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.text-input:focus {
  outline: none;
  border-color: rgba(31, 122, 140, 0.6);
  box-shadow: 0 0 0 3px rgba(31, 122, 140, 0.12);
}

.field {
  margin-bottom: 1.2rem;
}

.field-help {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.4rem;
}

.field-error {
  color: var(--bad);
  font-size: 0.85rem;
  margin-top: 0.35rem;
  min-height: 1.1rem;
}

.meta-block {
  background: var(--bg-alt);
  border-radius: 14px;
  padding: 0.75rem 1rem;
  min-width: 120px;
}

.meta-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.meta-value {
  font-family: var(--heading-font);
  font-size: 1.4rem;
  font-weight: 700;
}

.table-card {
  padding: 1.2rem 1.5rem 1.5rem;
}

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

.table-title {
  font-family: var(--heading-font);
  font-weight: 700;
  font-size: 1.2rem;
}

.table-legend {
  display: flex;
  gap: 1rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 0.4rem;
}

.dot.healthy {
  background: var(--ok);
}

.dot.unhealthy {
  background: var(--bad);
}

.dot.inactive {
  background: var(--inactive);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  text-align: left;
  padding: 0.85rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  font-family: var(--heading-font);
  font-size: 0.9rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

tbody tr:hover {
  background: rgba(31, 122, 140, 0.05);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-family: var(--heading-font);
  font-weight: 600;
  background: rgba(31, 122, 140, 0.12);
  color: var(--secondary);
}

.pill.inactive {
  background: rgba(141, 153, 174, 0.2);
  color: var(--inactive);
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  background: var(--inactive);
}

.status-dot.healthy {
  background: var(--ok);
}

.status-dot.unhealthy,
.status-dot.unreachable {
  background: var(--bad);
}

.status-dot.unknown {
  background: var(--warning);
}

.button-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--heading-font);
  font-weight: 600;
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.3rem;
  cursor: pointer;
  background: var(--primary);
  color: #ffffff;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(240, 139, 45, 0.25);
}

.btn.secondary {
  background: var(--secondary);
}

.btn.secondary:hover {
  box-shadow: 0 8px 18px rgba(31, 122, 140, 0.25);
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn.ghost:hover {
  box-shadow: 0 8px 18px rgba(31, 122, 140, 0.12);
}

.btn.danger {
  background: var(--bad);
}

.btn.small {
  padding: 0.35rem 0.8rem;
  font-size: 0.85rem;
}

.inline-group {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.notice {
  margin-top: 0.8rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 0.95rem;
}

.notice.success {
  background: rgba(42, 157, 143, 0.15);
  border-color: rgba(42, 157, 143, 0.4);
  color: var(--secondary-dark);
}

.notice.error {
  background: rgba(230, 57, 70, 0.12);
  border-color: rgba(230, 57, 70, 0.4);
  color: #a22730;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--heading-font);
  font-weight: 600;
}

.toggle input {
  display: none;
}

.toggle-ui {
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: rgba(93, 107, 122, 0.3);
  position: relative;
  transition: background 0.2s ease;
}

.toggle-ui::after {
  content: "";
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: transform 0.2s ease;
}

.toggle input:checked + .toggle-ui {
  background: var(--secondary);
}

.toggle input:checked + .toggle-ui::after {
  transform: translateX(20px);
}

.empty-state {
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
  font-family: var(--heading-font);
}

.page-footer {
  font-size: 0.85rem;
  color: var(--muted);
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-header {
    flex-direction: column;
  }

  .inline-group {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
