:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef3f8;
  --line: #d9e1ea;
  --text: #132033;
  --muted: #66758a;
  --primary: #0d6b5f;
  --primary-2: #0f8a73;
  --danger: #b42318;
  --warning: #a15c07;
  --ok: #14804a;
  --shadow: 0 18px 50px rgba(22, 39, 68, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}

button:hover {
  background: var(--primary-2);
}

button.secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--line);
}

button.secondary:hover {
  background: var(--surface-2);
}

button.danger {
  background: var(--danger);
}

button.icon {
  width: 38px;
  padding: 0;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
  outline: none;
}

textarea {
  min-height: 80px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 107, 95, 0.14);
}

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

.auth-panel {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.auth-panel h1,
.page-title h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

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

.form-grid {
  display: grid;
  gap: 12px;
}

.field label {
  display: block;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  background: #172231;
  color: #dce7f4;
  padding: 22px 16px;
}

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

.brand strong {
  color: #fff;
  font-size: 18px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav button {
  justify-content: flex-start;
  width: 100%;
  background: transparent;
  color: #dce7f4;
  border-color: transparent;
  text-align: left;
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.main {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.platform-select {
  width: 220px;
}

.page-title p {
  margin: 6px 0 0;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.section {
  margin-bottom: 20px;
}

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

.section-header h2 {
  margin: 0;
  font-size: 18px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
}

.status-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.status-card {
  min-height: 132px;
}

.status-card h3 {
  margin: 0 0 14px;
  font-size: 15px;
}

.metric {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.metric strong {
  font-size: 24px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--muted);
}

.badge.healthy {
  background: #e7f7ef;
  color: var(--ok);
}

.badge.degraded {
  background: #fff4df;
  color: var(--warning);
}

.badge.unhealthy {
  background: #ffe7e4;
  color: var(--danger);
}

.badge.unknown {
  background: var(--surface-2);
  color: var(--muted);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

th {
  background: #f8fafc;
  color: var(--muted);
  font-weight: 700;
}

tr:last-child td {
  border-bottom: 0;
}

.actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.message {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #eaf6ff;
  color: #14476b;
  border: 1px solid #cce7fa;
}

.message.error {
  background: #ffe7e4;
  color: var(--danger);
  border-color: #fac7c0;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.empty {
  padding: 26px;
  text-align: center;
  color: var(--muted);
}

.checkbox-list {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.checkbox-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.checkbox-item input {
  width: auto;
  min-height: auto;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .status-grid,
  .two-col,
  .three-col {
    grid-template-columns: 1fr;
  }

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

  .platform-select {
    width: 100%;
  }
}
