:root {
  --bg: #111317;
  --panel: #1b1e24;
  --panel-2: #232731;
  --line: #333846;
  --text: #f6f7fb;
  --muted: #8c93a3;
  --primary: #1df1b3;
  --danger: #ff3d63;
  --warning: #f4c46f;
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

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

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.login-card {
  width: min(420px, 100%);
  padding: 32px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.brand {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 800;
}

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

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

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

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #12151b;
  color: var(--text);
  border-radius: 8px;
  padding: 11px 12px;
  outline: none;
}

.textarea {
  min-height: 84px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--primary);
}

.btn {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  color: #07110e;
  background: var(--primary);
  font-weight: 700;
  cursor: pointer;
}

.btn.secondary {
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.btn.danger {
  color: #fff;
  background: var(--danger);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

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

.sidebar {
  border-right: 1px solid var(--line);
  background: #151820;
  padding: 20px 14px;
}

.sidebar-title {
  padding: 0 10px 18px;
  font-size: 18px;
  font-weight: 800;
}

.menu-group {
  margin-bottom: 14px;
}

.menu-label {
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.menu-item {
  width: 100%;
  display: block;
  margin: 4px 0;
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.menu-item.active,
.menu-item:hover {
  color: #06120f;
  background: var(--primary);
}

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

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

.page-title {
  margin: 0;
  font-size: 24px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.cards {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: end;
}

.card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
}

.stat-value {
  display: block;
  margin-top: 10px;
  font-size: 30px;
  font-weight: 800;
  color: var(--primary);
}

.toolbar {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.toolbar .field {
  min-width: 180px;
  margin: 0;
}

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

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

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

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

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

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 10px;
  background: #263029;
  color: var(--primary);
  font-size: 12px;
}

.badge.off {
  background: #30262b;
  color: var(--danger);
}

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

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

.notice {
  margin: 12px 0 0;
  color: var(--warning);
  font-size: 13px;
}

.danger-text {
  color: var(--danger);
}

.detail-host {
  margin-top: 18px;
}

.detail-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  background: #171a21;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.detail-title {
  margin: 0 0 6px;
  font-size: 18px;
}

.detail-panel .card {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.detail-panel strong {
  color: var(--text);
  word-break: break-all;
}

.detail-json-grid {
  margin-top: 16px;
}

.detail-section {
  margin-top: 18px;
}

.detail-section h3 {
  margin: 0 0 12px;
  font-size: 15px;
}

.json-block {
  min-height: 180px;
  max-height: 360px;
  margin: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #101319;
  color: var(--text);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

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

  .sidebar {
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .main {
    padding: 18px;
  }
}
