:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --panel: #ffffff;
  --panel-soft: #f0f5f3;
  --panel-tint: #f7fbff;
  --text: #18212f;
  --muted: #667085;
  --line: #dfe4ea;
  --brand: #116a5c;
  --brand-strong: #0b4d43;
  --blue: #2563eb;
  --violet: #6d5bd0;
  --accent: #b35c00;
  --danger: #b42318;
  --ok: #168252;
  --shadow: 0 16px 44px rgba(24, 33, 47, 0.08);
}

* {
  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;
  letter-spacing: 0;
}

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

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 16px;
  background: #101820;
  color: #eef4f2;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, #41b883, #f3b35b);
  display: grid;
  place-items: center;
  color: #102018;
  font-weight: 900;
}

.brand-title {
  font-size: 17px;
  font-weight: 800;
}

.brand-subtitle {
  font-size: 12px;
  color: #a8b6b2;
  margin-top: 2px;
}

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

.nav button {
  height: 40px;
  border-radius: 8px;
  background: transparent;
  color: #cdd8d5;
  text-align: left;
  padding: 0 12px;
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.11);
  color: #ffffff;
}

.sidebar-foot {
  margin-top: auto;
  display: grid;
  gap: 10px;
  font-size: 12px;
  color: #9dafaa;
}

.content {
  min-width: 0;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(247, 248, 251, 0) 260px),
    var(--bg);
}

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

.topbar h1 {
  margin: 0;
  font-size: 24px;
}

.topbar p {
  margin: 5px 0 0;
  color: var(--muted);
}

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

.button {
  min-height: 38px;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--brand);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.button.secondary {
  background: #e8eeec;
  color: var(--brand-strong);
}

.button.ghost {
  background: transparent;
  color: var(--muted);
}

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

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

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

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

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

.panel.pad {
  padding: 18px;
}

.metric {
  min-height: 118px;
  border-top: 3px solid rgba(17, 106, 92, 0.32);
}

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

.metric-value {
  font-size: 28px;
  font-weight: 800;
  margin-top: 12px;
}

.metric-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.hero {
  min-height: 320px;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 78% 18%, rgba(243, 179, 91, 0.22), transparent 28%),
    radial-gradient(circle at 12% 85%, rgba(17, 106, 92, 0.16), transparent 30%);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  padding: 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-copy h2 {
  margin: 0;
  max-width: 680px;
  font-size: 42px;
  line-height: 1.08;
}

.hero-copy p {
  max-width: 620px;
  color: var(--muted);
  line-height: 1.7;
  margin: 16px 0 0;
}

.network-art {
  position: relative;
  min-height: 280px;
  margin: 22px;
  border-radius: 8px;
  background: #132019;
  overflow: hidden;
}

.network-art canvas {
  width: 100%;
  height: 100%;
  display: block;
}

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

.auth-panel {
  max-width: 460px;
}

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

.auth-head h2 {
  margin: 0;
}

.segment {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  min-width: 156px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
}

.segment button {
  min-height: 32px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.segment button.active {
  background: var(--panel);
  color: var(--brand-strong);
  box-shadow: 0 1px 4px rgba(24, 33, 47, 0.12);
}

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

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

.field input,
.field select,
.field textarea,
.search {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 0 12px;
  color: var(--text);
  outline: none;
}

.search {
  min-width: min(360px, 100%);
}

.field textarea {
  min-height: 96px;
  padding-top: 10px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(17, 106, 92, 0.12);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

.table-wrap {
  overflow: auto;
}

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

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

th {
  color: var(--muted);
  font-weight: 600;
  background: #fbfcfd;
}

.pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  background: var(--panel-soft);
  color: var(--brand-strong);
  font-size: 12px;
  white-space: nowrap;
}

.pill.warn {
  background: #fff4e5;
  color: var(--accent);
}

.pill.ok {
  background: #e8f7ef;
  color: var(--ok);
}

.pill.neutral {
  background: #eef2f7;
  color: #475467;
}

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

.model-browser {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.filter-panel {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.filter-summary {
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 4px 2px 10px;
  border-bottom: 1px solid var(--line);
}

.filter-summary strong {
  font-size: 26px;
}

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

.filter-summary em {
  margin-left: auto;
  color: var(--blue);
  font-size: 12px;
  font-style: normal;
}

.filter-group {
  display: grid;
  gap: 8px;
}

.filter-group h3 {
  margin: 0;
  color: #344054;
  font-size: 13px;
  font-weight: 750;
}

.filter-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.filter-options button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f9fbfc;
  color: #344054;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-options button:hover,
.filter-options button.active {
  border-color: rgba(37, 99, 235, 0.34);
  background: #eef5ff;
  color: var(--blue);
}

.model-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.model-card {
  padding: 16px;
  min-height: 132px;
  box-shadow: 0 10px 28px rgba(24, 33, 47, 0.06);
}

.model-card:hover {
  border-color: rgba(37, 99, 235, 0.3);
  background: var(--panel-tint);
}

.model-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.model-name {
  font-weight: 760;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.model-family {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.model-badge {
  flex: 0 0 auto;
  min-width: 34px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #eef2ff;
  color: var(--violet);
  font-size: 12px;
  font-weight: 800;
}

.model-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: 420px;
  z-index: 10;
  background: #101820;
  color: #ffffff;
  padding: 14px 16px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

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

.mobile-nav {
  display: none;
}

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

  .sidebar {
    position: static;
    height: auto;
    padding: 14px;
  }

  .nav {
    display: none;
  }

  .mobile-nav {
    display: block;
  }

  .hero,
  .split,
  .model-browser,
  .grid.cols-2,
  .grid.cols-3 {
    grid-template-columns: 1fr;
  }

  .filter-panel {
    position: static;
  }

  .hero-copy {
    padding: 24px;
  }

  .hero-copy h2 {
    font-size: 32px;
  }

  .content {
    padding: 16px;
  }
}

@media (max-width: 520px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .actions {
    width: 100%;
  }

  .button {
    flex: 1;
  }

  .filter-options {
    grid-template-columns: 1fr 1fr;
  }

  .model-list {
    grid-template-columns: 1fr;
  }
}
