:root {
  --bg: #eef2fb;
  --panel: #ffffff;
  --panel-soft: #f8faff;
  --text: #1b2540;
  --text-soft: #6e7a97;
  --line: #dfe5f3;
  --accent: #3f69f5;
  --accent-2: #7a5cf5;
  --accent-dark: #182640;
  --ok: #41ba60;
  --warn: #e2a51a;
  --err: #e05252;
  --radius: 18px;
  --shadow: 0 12px 34px rgba(18, 36, 83, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #eef2fb 0%, #e8edf9 100%);
}

.surface-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(44rem 22rem at -5% -10%, rgba(64, 119, 248, 0.2), transparent),
    radial-gradient(38rem 24rem at 100% 0%, rgba(123, 93, 245, 0.18), transparent),
    radial-gradient(28rem 18rem at 45% 100%, rgba(93, 232, 162, 0.1), transparent);
}

.wrap {
  width: min(1440px, 96vw);
  margin: 0 auto;
  padding: 26px;
  position: relative;
  z-index: 1;
}

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

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

label {
  display: block;
  margin: 11px 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: #344466;
}

input,
select {
  width: 100%;
  border: 1px solid #d7deef;
  border-radius: 10px;
  background: #f9fbff;
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
}

input:focus,
select:focus {
  outline: none;
  border-color: #a8baf6;
  box-shadow: 0 0 0 3px rgba(84, 121, 247, 0.14);
}

button {
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), #476dff);
  color: #fff;
  font: inherit;
  font-weight: 700;
  padding: 10px 14px;
  cursor: pointer;
}

button.secondary {
  background: #e8edf9;
  color: #233256;
}

button.dark {
  background: #14213c;
}

button.ghost {
  background: #fff;
  border: 1px solid #d9e2f6;
  color: #26365e;
}

button.github {
  background: #fff;
  border: 1px solid #d9e2f6;
  color: #18202f;
}

button:hover {
  transform: translateY(-1px);
}

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

.mini {
  margin-top: 8px;
  font-size: 12px;
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stack-gap {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.stack-gap-sm {
  margin-top: 12px;
}

.brand-icon {
  width: 84px;
  height: 68px;
}

.brand-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-icon.small {
  width: 56px;
  height: 46px;
}

.auth-layout {
  display: grid;
  grid-template-columns: 1.04fr 1.36fr;
  gap: 20px;
}

.auth-brand {
  min-height: 760px;
  padding: 30px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(245, 249, 255, 0.94));
  border-color: #dbe2f3;
  position: relative;
  overflow: hidden;
}

.brand-lockup {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-wordmark {
  font-size: 53px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.9;
  color: #1f2b47;
}

.brand-wordmark span {
  color: #4a6df6;
}

.brand-subtitle {
  margin-top: 12px;
  font-size: 13px;
  letter-spacing: 0.28em;
  color: #7b8aa9;
  font-weight: 700;
}

.auth-brand h1 {
  margin-top: 34px;
  font-size: 56px;
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.auth-brand h1 span {
  color: #4e68f7;
}

.auth-brand .lead {
  margin-top: 18px;
  max-width: 62ch;
  font-size: 19px;
  line-height: 1.55;
  color: #586987;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 26px 0 0;
  display: grid;
  gap: 15px;
}

.feature-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
}

.feature-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #e9f1ff;
  color: #4668f6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.feature-list strong {
  display: block;
  font-size: 15px;
}

.feature-list p {
  margin-top: 3px;
  font-size: 13px;
  color: #7484a4;
}

.cube-stage {
  width: 174px;
  height: 174px;
  border-radius: 24px;
  margin-top: 34px;
  background:
    linear-gradient(130deg, #eff4ff, #e2ebff),
    radial-gradient(circle at 45% 32%, #9fff8d 0 30px, transparent 31px);
  position: relative;
  box-shadow: inset 0 0 0 1px #e0e8fa, 0 24px 30px rgba(58, 103, 246, 0.16);
}

.cube-stage::before {
  content: "";
  position: absolute;
  width: 82px;
  height: 82px;
  left: 46px;
  top: 44px;
  transform: rotate(45deg);
  border-radius: 14px;
  background: linear-gradient(145deg, #9ff55f, #44c94d);
  box-shadow: 0 18px 24px rgba(56, 184, 82, 0.28);
}

.auth-card {
  min-height: 760px;
  padding: 30px;
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 24px;
  align-items: start;
}

.auth-divider {
  background: #e3e8f5;
  width: 1px;
  height: 100%;
}

.auth-column h3 {
  font-size: 32px;
  letter-spacing: -0.02em;
  margin-top: 6px;
}

.auth-column .muted {
  margin-top: 7px;
  font-size: 14px;
}

.auth-badge {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: #e8efff;
  color: #486af6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
}

.app-layout {
  display: none;
  grid-template-columns: 286px 1fr;
  gap: 18px;
}

.app-sidebar {
  padding: 16px;
  background: linear-gradient(180deg, #f8fbff 0%, #f3f7ff 100%);
}

.sidebar-brand {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}

.sidebar-brand-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sidebar-brand-title span {
  color: #4b6ef5;
}

.sidebar-brand-subtitle {
  margin-top: 2px;
  color: #7f8faf;
  font-size: 12px;
  font-weight: 600;
}

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

.sidebar-nav a {
  padding: 9px 10px;
  border-radius: 9px;
  color: #49597a;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.sidebar-nav a.active,
.sidebar-nav a:hover {
  background: #e8efff;
  color: #2f4fd8;
}

.create-project-panel {
  margin-top: 8px;
  border-top: 1px solid #dde4f4;
  padding-top: 12px;
}

.create-project-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  cursor: pointer;
}

.create-project-title {
  font-size: 15px;
  font-weight: 700;
}

.create-project-chevron {
  font-size: 14px;
  color: #6c7ca0;
  transition: transform 160ms ease;
}

.create-project-toggle[aria-expanded="true"] .create-project-chevron {
  transform: rotate(180deg);
}

.create-project-body {
  margin-top: 10px;
}

.create-project-body.collapsed {
  display: none;
}

.github-repo-panel .row select {
  flex: 1;
}

.app-main {
  display: grid;
  gap: 14px;
}

.app-topbar {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.app-topbar h2 {
  font-size: 28px;
  letter-spacing: -0.02em;
}

.app-topbar p {
  margin-top: 4px;
  color: #7183a5;
  font-size: 14px;
}

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

.user-card {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #dce4f7;
  border-radius: 12px;
  background: #fff;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid #cfd8ec;
  object-fit: cover;
  display: none;
}

.user-meta {
  min-width: 130px;
}

.user-primary {
  font-size: 13px;
  font-weight: 700;
}

.user-secondary {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #7d8da9;
  font-size: 12px;
}

.github-mark {
  display: none;
  line-height: 0;
}

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

.metric-card {
  border: 1px solid #e0e6f4;
  border-radius: 14px;
  background: #fff;
  padding: 13px;
}

.metric-card p {
  color: #7083a4;
  font-size: 13px;
  font-weight: 600;
}

.metric-card strong {
  display: block;
  margin-top: 5px;
  font-size: 35px;
  line-height: 1;
  letter-spacing: -0.03em;
}

.metric-card span {
  display: block;
  margin-top: 3px;
  color: #8392ac;
  font-size: 12px;
}

.dashboard-grid {
  display: grid;
  gap: 12px;
}

.dashboard-grid.two-col {
  grid-template-columns: 1.2fr 1fr;
}

.panel {
  padding: 14px;
}

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

.panel-head h3 {
  font-size: 20px;
  letter-spacing: -0.02em;
}

.score-pill {
  color: #2f4fd8;
  background: #e8efff;
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 700;
}

.quality-sparkline {
  width: 100%;
  height: 150px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(87, 186, 105, 0.16), rgba(87, 186, 105, 0.03));
}

.quality-sparkline polyline {
  fill: none;
  stroke: #4ab463;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.spark-caption {
  margin-top: 8px;
  color: #8090ae;
  font-size: 12px;
}

.list-stack {
  display: grid;
  gap: 9px;
}

.scan-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  border: 1px solid #e4e9f5;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fafcff;
}

.scan-item strong {
  font-size: 14px;
}

.scan-item small {
  color: #7b8baa;
  font-size: 12px;
}

.status-chip {
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  text-transform: lowercase;
}

.status-chip.pass {
  background: rgba(65, 186, 96, 0.16);
  color: #24893f;
}

.status-chip.warning,
.status-chip.warn {
  background: rgba(226, 165, 26, 0.18);
  color: #9f7000;
}

.status-chip.error,
.status-chip.fail {
  background: rgba(224, 82, 82, 0.17);
  color: #b73838;
}

.status-chip.no-data {
  background: rgba(128, 145, 176, 0.18);
  color: #5e6d8b;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid #e6ebf7;
}

th {
  color: #7383a4;
  font-size: 12px;
  font-weight: 700;
}

td button[data-slug] {
  border-radius: 8px;
  background: #e9f0ff;
  color: #2f4fd8;
  padding: 6px 10px;
  font-size: 12px;
}

.badges img {
  margin-right: 7px;
  vertical-align: middle;
}

.badges.clickable img {
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 8px;
}

.badges.clickable img.active {
  border-color: #3f69f5;
}

.issue-rule {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 9px;
}

.issue-rule .bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #edf2fb;
  overflow: hidden;
  margin-top: 4px;
}

.issue-rule .bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #58bc65, #f0ad25, #e05252);
}

.integration-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.integration-card h4 {
  font-size: 16px;
}

.integration-card p {
  margin-top: 6px;
  color: #7384a5;
  font-size: 13px;
  line-height: 1.45;
}

pre {
  background: #111a2f;
  color: #e6ecff;
  border-radius: 11px;
  padding: 12px;
  font-size: 12px;
  overflow-x: auto;
  margin: 8px 0 0;
}

.status {
  margin-top: 12px;
  min-height: 22px;
  font-size: 14px;
  font-weight: 600;
}

.status.ok {
  color: #229946;
}

.status.err {
  color: #c13d3d;
}

#authPanel {
  display: grid;
}

#appPanel {
  display: none;
}

#githubRepoPanel {
  display: none;
}

@media (max-width: 1250px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-brand,
  .auth-card {
    min-height: auto;
  }

  .auth-brand h1 {
    font-size: 44px;
  }

  .app-layout {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    order: 2;
  }
}

@media (max-width: 920px) {
  .wrap {
    width: min(1280px, 98vw);
    padding: 12px;
  }

  .auth-card {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .auth-divider {
    width: 100%;
    height: 1px;
  }

  .metric-grid,
  .dashboard-grid.two-col,
  .integration-row {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .user-card {
    width: 100%;
    justify-content: space-between;
  }

  .row {
    flex-wrap: wrap;
  }

  .row > button,
  .row > select {
    width: 100%;
  }
}
