
:root {
  color-scheme: dark;
  --bg: #101213;
  --panel: #1f2222;
  --panel-2: #262929;
  --line: #343838;
  --text: #ecefed;
  --muted: #a7adaf;
  --muted-2: #757d80;
  --green: #35c96f;
  --amber: #ffb229;
  --red: #ef5b57;
  --blue: #61b8ff;
  --cyan: #2bc4d9;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at top left, rgba(43, 196, 217, 0.08), transparent 30%), var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body { min-width: 320px; }

button, input {
  font: inherit;
}

.shell {
  width: min(1440px, calc(100vw - 40px));
  margin: 28px auto 44px;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(97, 184, 255, 0.24), rgba(53, 201, 111, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 750;
}

.subtitle {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.panel {
  background: color-mix(in srgb, var(--panel), black 3%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-wrap {
  min-height: calc(100vh - 72px);
  display: grid;
  place-items: center;
  padding: 36px 20px;
}

.login-card {
  width: min(420px, 100%);
  padding: 28px;
}

.login-card h1 {
  font-size: 24px;
  margin-bottom: 18px;
}

.field {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.field span {
  color: var(--muted);
  font-size: 13px;
}

input {
  width: 100%;
  height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #151818;
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

input:focus {
  border-color: rgba(97, 184, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(97, 184, 255, 0.13);
}

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

.button {
  height: 38px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #2a2e2f;
  color: var(--text);
  padding: 0 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.2);
}

.button.primary {
  background: linear-gradient(135deg, #1f8e58, #217aa2);
  border-color: rgba(255, 255, 255, 0.16);
}

.button.icon {
  width: 38px;
  padding: 0;
  justify-content: center;
}

.error {
  min-height: 20px;
  color: #ff8782;
  font-size: 13px;
  margin-top: 12px;
}

.status-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

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

.card-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 720;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  padding-bottom: 13px;
  margin-bottom: 15px;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--muted-2);
  box-shadow: 0 0 16px currentColor;
}

.dot.ok { background: var(--green); color: var(--green); }
.dot.warn { background: var(--amber); color: var(--amber); }
.dot.bad { background: var(--red); color: var(--red); }
.dot.info { background: var(--blue); color: var(--blue); }

.metric {
  font-size: 28px;
  line-height: 1.1;
  color: var(--blue);
  font-weight: 760;
  word-break: break-word;
}

.metric.small {
  font-size: 20px;
  color: var(--text);
}

.hint {
  color: var(--muted);
  font-size: 13px;
  margin-top: 13px;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.75fr);
  gap: 16px;
  align-items: start;
}

.main-grid > *,
.section,
.panel {
  min-width: 0;
}

.section {
  padding: 18px;
  margin-bottom: 16px;
}

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

h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}

.tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 100%;
  max-width: 100%;
}

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

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

th {
  color: #c8cdcf;
  background: #252929;
  font-weight: 680;
  position: sticky;
  top: 0;
  z-index: 1;
}

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

.node-name {
  font-weight: 680;
  color: var(--text);
  max-width: 340px;
  white-space: normal;
}

.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  color: #dfe4e2;
  background: rgba(255, 255, 255, 0.04);
}

.pill.ok { color: #bff5d0; border-color: rgba(53, 201, 111, 0.28); }
.pill.warn { color: #ffd68a; border-color: rgba(255, 178, 41, 0.32); }
.pill.bad { color: #ffb0aa; border-color: rgba(239, 91, 87, 0.32); }

.region-list {
  display: grid;
  gap: 10px;
}

.region-item {
  display: grid;
  gap: 7px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.region-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.recommend {
  color: var(--green);
  font-weight: 700;
  word-break: break-word;
}

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

.secret-line {
  display: flex;
  gap: 8px;
}

.secret-line input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.banner {
  padding: 11px 13px;
  border-radius: 8px;
  border: 1px solid rgba(255, 178, 41, 0.28);
  color: #ffd98f;
  background: rgba(255, 178, 41, 0.08);
  font-size: 13px;
  margin-bottom: 14px;
}

.hidden { display: none !important; }

@media (max-width: 1120px) {
  .status-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .shell { width: min(100% - 24px, 1440px); margin-top: 16px; }
  .topbar { align-items: flex-start; }
  .status-row { grid-template-columns: 1fr; }
  h1 { font-size: 23px; }
  .metric { font-size: 24px; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .tools { justify-content: flex-start; }
}
