:root {
  --bg: #09121d;
  --bg-soft: #101b2b;
  --panel: rgba(12, 22, 35, 0.9);
  --panel-strong: #0e1a2a;
  --border: rgba(147, 176, 204, 0.14);
  --text: #ecf4fb;
  --muted: #8fa6bf;
  --accent: #39d0b4;
  --accent-strong: #16b190;
  --warm: #f9b15d;
  --danger: #ff6b6b;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top, rgba(57, 208, 180, 0.18), transparent 34%),
    linear-gradient(160deg, #08111b 0%, #0a1521 45%, #09131f 100%);
  color: var(--text);
  font-family: "Manrope", sans-serif;
}

body {
  min-height: 100vh;
}

.auth-body {
  display: grid;
  place-items: center;
  padding: 24px;
}

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

a {
  color: inherit;
  text-decoration: none;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(9, 18, 29, 0.98), rgba(7, 14, 24, 0.95));
}

.brand-block {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 34px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), #5af0d5);
  color: #04221e;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand-block h1,
.panel-head h3,
.hero-panel h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

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

.nav-button {
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transition: 0.2s ease;
}

.nav-button:hover,
.nav-button.active {
  color: var(--text);
  border-color: rgba(57, 208, 180, 0.22);
  background: rgba(57, 208, 180, 0.08);
}

.sidebar-card,
.panel-card,
.hero-panel {
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.sidebar-card {
  margin-top: 28px;
  padding: 18px;
  border-radius: 22px;
}

.micro-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.main-panel {
  padding: 30px;
}

.auth-shell {
  width: min(520px, 100%);
}

.auth-card h1 {
  margin: 0 0 12px;
  font-family: "Space Grotesk", sans-serif;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.8fr);
  gap: 26px;
  padding: 28px;
  border-radius: 30px;
}

.hero-copy {
  max-width: 70ch;
  color: var(--muted);
  line-height: 1.65;
}

.hero-actions {
  display: grid;
  gap: 14px;
}

.hero-mini-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.view-section {
  display: none;
  margin-top: 26px;
  gap: 22px;
}

.view-section.active {
  display: grid;
}

.stats-grid,
.site-card-grid {
  display: grid;
  gap: 18px;
}

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

.site-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stat-card,
.site-summary-card {
  padding: 20px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(13, 24, 38, 0.92), rgba(7, 13, 22, 0.92));
}

.stat-card strong,
.site-summary-card strong {
  display: block;
  margin-top: 14px;
  font-size: 1.75rem;
}

.stat-card span,
.site-summary-card p,
.meta-line,
.muted {
  color: var(--muted);
}

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.wide-right {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
}

.panel-card {
  padding: 22px;
  border-radius: 26px;
}

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

.stack-form,
.detail-stack,
.list-stack {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

input,
textarea,
select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(9, 18, 29, 0.9);
  color: var(--text);
}

textarea {
  resize: vertical;
}

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

.checkbox-row input {
  width: 18px;
  height: 18px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 18px;
  border-radius: 16px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: 0.2s ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #082019;
  font-weight: 700;
}

.secondary-button {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  color: var(--text);
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
}

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

.compact-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: end;
}

.discovery-check {
  padding-bottom: 12px;
  align-self: center;
}

.table-card {
  overflow: hidden;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(147, 176, 204, 0.1);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

tbody tr {
  cursor: pointer;
  transition: background 0.2s ease;
}

tbody tr:hover,
tbody tr.selected-row {
  background: rgba(57, 208, 180, 0.08);
}

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

.action-chip,
.badge,
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
}

.action-chip {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.badge {
  background: rgba(57, 208, 180, 0.14);
  color: var(--accent);
}

.badge.high {
  background: rgba(255, 107, 107, 0.12);
  color: #ff9e9e;
}

.badge.avg {
  background: rgba(249, 177, 93, 0.14);
  color: #ffd09a;
}

.badge.strong {
  background: rgba(57, 208, 180, 0.14);
  color: #90f1de;
}

.tag {
  border: 1px solid rgba(147, 176, 204, 0.18);
  color: var(--muted);
}

.detail-card {
  min-height: 100%;
}

.empty-state {
  place-items: center;
  min-height: 220px;
  padding: 28px;
  border: 1px dashed rgba(147, 176, 204, 0.22);
  border-radius: 20px;
  color: var(--muted);
  text-align: center;
}

.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(57, 208, 180, 0.08);
}

.detail-stack .cluster,
.cluster {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.reason-list,
.mini-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.bar-stack {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  gap: 8px;
}

.bar-track {
  overflow: hidden;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--warm), var(--accent));
}

.score-box {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: 380px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(57, 208, 180, 0.22);
  background: rgba(7, 14, 24, 0.96);
  color: var(--text);
  box-shadow: var(--shadow);
}

@media (max-width: 1220px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

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

  .hero-panel,
  .two-column,
  .wide-right {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .main-panel,
  .sidebar {
    padding: 18px;
  }

  .stats-grid,
  .filter-grid,
  .compact-grid {
    grid-template-columns: 1fr;
  }

  th,
  td {
    padding: 12px;
  }
}
