:root {
  --bg: #f3f6fb;
  --panel: rgba(255,255,255,0.86);
  --panel-solid: #ffffff;
  --text: #182033;
  --muted: #6d7483;
  --line: rgba(24,32,51,0.10);
  --primary: #4f46e5;
  --primary-2: #06b6d4;
  --accent: #f59e0b;
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.10);
  --sidebar: rgba(255,255,255,0.82);
  --hero: linear-gradient(135deg, #111827 0%, #312e81 48%, #0891b2 100%);
}

html[data-theme="dark"] {
  --bg: #08111f;
  --panel: rgba(15,23,42,0.74);
  --panel-solid: #0f172a;
  --text: #e8eefc;
  --muted: #9aa8c7;
  --line: rgba(226,232,240,0.10);
  --primary: #7c3aed;
  --primary-2: #22d3ee;
  --accent: #fbbf24;
  --shadow: 0 24px 80px rgba(0,0,0,0.28);
  --sidebar: rgba(15,23,42,0.82);
  --hero: linear-gradient(135deg, #020617 0%, #312e81 48%, #0e7490 100%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 10%, rgba(79,70,229,0.18), transparent 32%),
    radial-gradient(circle at 85% 18%, rgba(6,182,212,0.16), transparent 32%),
    var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tg-shell {
  display: flex;
  min-height: 100vh;
}

.tg-sidebar {
  width: 292px;
  min-height: 100vh;
  padding: 24px 18px;
  position: fixed;
  left: 0;
  top: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(22px);
  z-index: 10;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 10px 8px 26px;
}

.brand-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
  font-size: 24px;
  box-shadow: 0 14px 35px rgba(79,70,229,0.32);
}

.brand-title {
  font-size: 21px;
  font-weight: 850;
  letter-spacing: -0.04em;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.tg-nav {
  display: grid;
  gap: 7px;
}

.tg-nav a {
  text-decoration: none;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.tg-nav a i {
  font-size: 17px;
}

.tg-nav a:hover,
.tg-nav a.active {
  color: var(--text);
  background: rgba(124,58,237,0.13);
}

.sidebar-footer {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 22px;
}

.security-pill {
  padding: 13px 14px;
  border-radius: 16px;
  background: rgba(16,185,129,0.12);
  color: #10b981;
  font-weight: 800;
  font-size: 13px;
  border: 1px solid rgba(16,185,129,0.22);
}

.tg-main {
  flex: 1;
  margin-left: 292px;
  padding: 28px;
}

.tg-topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.eyebrow {
  color: var(--primary-2);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.tg-topbar h1 {
  font-size: clamp(30px, 4vw, 48px);
  margin: 6px 0 6px;
  font-weight: 900;
  letter-spacing: -0.06em;
}

.topline {
  color: var(--muted);
  font-size: 16px;
  margin: 0;
}

.top-actions {
  display: flex;
  gap: 12px;
  white-space: nowrap;
}

.btn {
  border-radius: 15px;
  font-weight: 800;
  padding: 11px 16px;
}

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

.btn-primary-gradient {
  border: 0;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 14px 32px rgba(79,70,229,0.25);
}

.btn-light-strong {
  background: white;
  color: #111827;
  border: 0;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  min-height: 330px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) 0.75fr;
  gap: 24px;
  padding: 34px;
  border-radius: 34px;
  background: var(--hero);
  color: white;
  box-shadow: var(--shadow);
}

.hero-panel:before {
  content: "";
  position: absolute;
  inset: -120px -80px auto auto;
  width: 420px;
  height: 420px;
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(255,255,255,0.13);
  border: 1px solid rgba(255,255,255,0.16);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 18px;
}

.pulse {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 7px rgba(34,197,94,0.15);
}

.hero-panel h2 {
  font-size: clamp(32px, 5vw, 58px);
  line-height: 0.96;
  font-weight: 950;
  letter-spacing: -0.07em;
  max-width: 760px;
  margin-bottom: 18px;
}

.hero-panel p {
  color: rgba(255,255,255,0.78);
  font-size: 17px;
  max-width: 690px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.hero-orbit {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 250px;
}

.orbit-core {
  width: 138px;
  height: 138px;
  display: grid;
  place-items: center;
  border-radius: 44px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.18);
  font-size: 58px;
  backdrop-filter: blur(10px);
}

.orbit-node {
  position: absolute;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.2);
  font-weight: 900;
  font-size: 13px;
}

.node-a { top: 18px; left: 28%; }
.node-b { top: 42%; right: 6%; }
.node-c { bottom: 18px; left: 22%; }
.node-d { top: 44%; left: 3%; }

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

.metric-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.metric-card {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.metric-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  font-size: 23px;
}

.metric-icon.blue { background: rgba(59,130,246,0.14); color: #3b82f6; }
.metric-icon.green { background: rgba(16,185,129,0.14); color: #10b981; }
.metric-icon.orange { background: rgba(245,158,11,0.16); color: #f59e0b; }
.metric-icon.purple { background: rgba(124,58,237,0.15); color: #7c3aed; }

.metric-value {
  font-size: 25px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

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

.panel {
  padding: 24px;
}

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

.panel-head.compact {
  margin-bottom: 16px;
}

.panel-head h3 {
  font-size: 22px;
  font-weight: 950;
  letter-spacing: -0.04em;
  margin: 0 0 4px;
}

.panel-head p {
  color: var(--muted);
  margin: 0;
  font-weight: 600;
}

.module-count {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(79,70,229,0.13);
  color: var(--primary);
  font-weight: 900;
  font-size: 13px;
}

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

.module-card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.045);
  min-height: 174px;
  transition: all 0.2s ease;
}

html[data-theme="light"] .module-card {
  background: rgba(255,255,255,0.72);
}

.module-card:hover {
  transform: translateY(-4px);
  border-color: rgba(79,70,229,0.28);
}

.module-card i {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(79,70,229,0.18), rgba(6,182,212,0.15));
  color: var(--primary);
  font-size: 21px;
  margin-bottom: 14px;
}

.module-card h4 {
  font-size: 15px;
  font-weight: 950;
  margin-bottom: 8px;
}

.module-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

.ai-panel .panel-head > i,
.panel-head.compact > i {
  font-size: 28px;
  color: var(--primary-2);
}

.ai-box {
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(124,58,237,0.14), rgba(34,211,238,0.10));
  border: 1px solid var(--line);
}

.ai-line span {
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

.ai-line strong {
  display: block;
  margin-top: 6px;
  font-size: 17px;
  line-height: 1.35;
}

.ai-steps {
  display: grid;
  gap: 10px;
  margin-top: 17px;
  color: var(--muted);
  font-weight: 750;
  font-size: 14px;
}

.ai-steps i {
  color: #10b981;
  margin-right: 7px;
}

.principle-card {
  margin-top: 16px;
  padding: 17px;
  border-radius: 22px;
  background: rgba(245,158,11,0.13);
  border: 1px solid rgba(245,158,11,0.20);
}

.principle-card div {
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 5px;
}

.principle-card strong {
  display: block;
  font-size: 16px;
  line-height: 1.35;
}

.chain-list {
  list-style: none;
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
}

.chain-list li {
  color: var(--muted);
  font-weight: 750;
  font-size: 14px;
}

.chain-list i {
  color: var(--primary-2);
  margin-right: 9px;
}

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

.roadmap-item {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 17px;
  background: rgba(255,255,255,0.04);
}

html[data-theme="light"] .roadmap-item {
  background: rgba(255,255,255,0.72);
}

.roadmap-item.active {
  border-color: rgba(16,185,129,0.28);
  background: rgba(16,185,129,0.10);
}

.roadmap-item span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(79,70,229,0.14);
  color: var(--primary);
  font-weight: 950;
  margin-bottom: 14px;
}

.roadmap-item h4 {
  font-size: 15px;
  font-weight: 950;
  margin: 0 0 7px;
}

.roadmap-item p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
  line-height: 1.45;
}

.tg-footer {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-weight: 750;
  font-size: 13px;
  padding: 22px 4px 4px;
}

@media (max-width: 1200px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .hero-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .tg-sidebar {
    position: relative;
    width: 100%;
    min-height: auto;
  }

  .tg-shell {
    display: block;
  }

  .tg-main {
    margin-left: 0;
    padding: 18px;
  }

  .tg-topbar {
    flex-direction: column;
  }

  .metric-grid,
  .module-grid,
  .roadmap {
    grid-template-columns: 1fr;
  }

  .sidebar-footer {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    margin-top: 18px;
  }
}
