:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #d8dee8;
  --primary: #0f766e;
  --primary-2: #155e75;
  --danger: #b42318;
  --warning: #b54708;
  --ok: #067647;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

a {
  color: var(--primary-2);
  text-decoration: none;
}

.portal {
  min-height: 100vh;
}

.top-nav {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 760;
  font-size: 18px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
}

.workspace {
  width: min(1180px, calc(100vw - 32px));
  margin: 28px auto 48px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 420px;
  gap: 22px;
  align-items: start;
}

.intro-band {
  min-height: 420px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, .08), rgba(180, 35, 24, .05)),
    #fff;
}

.intro-band h1 {
  margin: 0 0 18px;
  font-size: 34px;
  line-height: 1.18;
}

.intro-band p {
  color: var(--muted);
  line-height: 1.8;
  margin: 0 0 24px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 28px;
}

.metric-box {
  min-height: 96px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .78);
}

.metric-box strong {
  display: block;
  font-size: 25px;
  margin-bottom: 8px;
}

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

.login-panel,
.plain-panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.login-panel h2,
.plain-panel h2 {
  margin: 0 0 18px;
  font-size: 22px;
}

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

.sidebar {
  background: #101828;
  color: #fff;
  padding: 22px 16px;
}

.sidebar .brand {
  margin-bottom: 26px;
}

.side-link {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 9px 12px;
  margin-bottom: 6px;
  border-radius: 8px;
  color: #d0d5dd;
  cursor: pointer;
}

.side-link.active,
.side-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, .10);
}

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

.page-head {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

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

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

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat {
  padding: 18px;
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.stat strong {
  display: block;
  font-size: 25px;
  margin-bottom: 6px;
}

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

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

.section {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  margin-bottom: 16px;
}

.inline-panel {
  padding: 14px 0 4px;
  margin-bottom: 12px;
}

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

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

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}

.form-grid .wide {
  grid-column: span 2;
}

.generated-keys {
  width: 100%;
  min-height: 130px;
  font-family: "Cascadia Mono", Consolas, monospace;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
}

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

.status-dot.bad::before {
  background: var(--danger);
}

.mono {
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
}

.empty-state {
  min-height: 120px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
  }

  .stats,
  .metric-row,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .wide {
    grid-column: auto;
  }

  .top-nav {
    padding: 0 16px;
  }
}
