:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-soft: #eef3f6;
  --text: #172026;
  --muted: #66727c;
  --line: #d8dee4;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --blue: #2563eb;
  --amber: #b45309;
  --red: #b91c1c;
  --shadow: 0 12px 30px rgba(23, 32, 38, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(23, 32, 38, 0.03), rgba(23, 32, 38, 0)),
    var(--bg);
}

.login-panel {
  width: min(430px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
  display: grid;
  gap: 22px;
}

.login-brand {
  color: var(--text);
  padding: 0;
}

.login-brand span {
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form p {
  color: var(--muted);
}

.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  animation: spin 800ms linear infinite;
  margin: 8px auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

button,
input,
select {
  font: inherit;
}

svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex: 0 0 auto;
}

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

.sidebar {
  background: #172026;
  color: #f8fafc;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px;
}

.brand span,
small,
.muted {
  color: var(--muted);
}

.brand span {
  display: block;
  color: #aab4bc;
  font-size: 12px;
}

.mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: #20a39e;
  color: #ffffff;
  font-weight: 800;
  border-radius: 7px;
}

nav {
  display: grid;
  gap: 4px;
}

.nav-item {
  appearance: none;
  border: 0;
  background: transparent;
  color: #cbd5df;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 10px;
  border-radius: 7px;
  cursor: pointer;
}

.nav-item.active,
.nav-item:hover {
  background: #24323b;
  color: #ffffff;
}

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

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

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.2;
}

h2 {
  font-size: 15px;
  line-height: 1.25;
}

.topbar p {
  color: var(--muted);
  margin-top: 3px;
}

.toolbar {
  display: flex;
  gap: 8px;
}

.icon-button,
.primary {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  height: 38px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

.icon-button {
  width: 38px;
}

.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  padding: 0 13px;
  font-weight: 700;
}

.primary:hover {
  background: var(--accent-strong);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metric,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  min-height: 104px;
  padding: 16px;
  display: grid;
  align-content: space-between;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.metric strong {
  font-size: 28px;
  line-height: 1.1;
}

.grid {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.grid.two {
  grid-template-columns: minmax(0, 1.45fr) minmax(330px, 0.9fr);
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stack {
  display: grid;
  gap: 14px;
  align-content: start;
}

.panel {
  min-width: 0;
  padding: 14px;
}

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

.badge,
.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
}

.badge {
  background: var(--panel-soft);
  color: #334155;
}

.status.active,
.status.ready {
  background: #dcfce7;
  color: #166534;
}

.status.suspended,
.status.pending,
.status.inactive {
  background: #fef3c7;
  color: var(--amber);
}

.status.failed {
  background: #fee2e2;
  color: var(--red);
}

.table-wrap {
  width: 100%;
  overflow: auto;
}

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

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

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: capitalize;
  white-space: nowrap;
}

td small {
  display: block;
  margin-top: 2px;
}

.domain {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  background: #fafbfc;
  border-radius: 999px;
  padding: 3px 7px;
  margin: 0 4px 4px 0;
  white-space: nowrap;
}

.inline-icon {
  width: 13px;
  height: 13px;
  color: var(--accent);
}

.form {
  display: grid;
  gap: 13px;
}

.fields,
.settings-grid {
  display: grid;
  gap: 10px;
}

.settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 5px;
}

label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--text);
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.checkbox input {
  width: 17px;
  height: 17px;
}

.cards {
  display: grid;
  gap: 10px;
}

.site-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
  display: grid;
  gap: 8px;
}

.site-card small {
  display: block;
}

.events {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.events li {
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.empty,
.alert {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  background: #fbfcfd;
}

.alert {
  border-style: solid;
  border-color: #fecaca;
  background: #fff1f2;
  color: var(--red);
  margin-bottom: 14px;
}

.alert.compact {
  margin: 0;
  padding: 10px 12px;
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 10px;
  }

  .brand {
    display: none;
  }

  nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .nav-item {
    justify-content: center;
  }

  .nav-item span {
    display: none;
  }

  .metrics,
  .grid.two,
  .grid.three,
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .main {
    padding: 14px;
  }

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

  .metrics {
    gap: 10px;
  }

  .metric {
    min-height: 88px;
  }

  table {
    min-width: 540px;
  }
}
