:root {
  color-scheme: dark;
  --bg: #050814;
  --panel: rgba(9, 16, 32, 0.86);
  --panel-2: rgba(13, 24, 46, 0.92);
  --line: rgba(148, 163, 184, 0.18);
  --line-strong: rgba(96, 165, 250, 0.32);
  --text: #edf4ff;
  --muted: #91a0b8;
  --soft: #cbd5e1;
  --blue: #2f80ff;
  --cyan: #22d3ee;
  --green: #2de38f;
  --purple: #9f7aea;
  --amber: #f7b731;
  --red: #fb5c6c;
  --radius: 8px;
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 12%, rgba(47, 128, 255, 0.24), transparent 28%),
    radial-gradient(circle at 84% 6%, rgba(45, 227, 143, 0.12), transparent 24%),
    linear-gradient(135deg, #03050d 0%, #07101e 52%, #02040a 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button, input, textarea {
  font: inherit;
}

button {
  color: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  background: rgba(3, 8, 20, 0.82);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  padding: 4px 6px 18px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #0b63ff, #17d28b);
  box-shadow: 0 0 32px rgba(47, 128, 255, 0.34);
  font-weight: 800;
}

.brand h1 {
  margin: 12px 0 2px;
  font-size: 22px;
  line-height: 1.05;
}

.brand p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

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

.nav-group-label {
  grid-column: 1 / -1;
  margin: 12px 0 2px;
  padding: 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
}

.nav .nav-group-label:first-child {
  margin-top: 0;
}

.nav button,
.pill-button,
.ghost-button,
.primary-button {
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 80ms ease, background 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.nav button:active,
.pill-button:active,
.ghost-button:active,
.primary-button:active {
  transform: translateY(1px) scale(0.985);
}

.primary-button:disabled,
.ghost-button:disabled {
  cursor: default;
}

.nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  background: transparent;
  color: var(--soft);
  text-align: left;
}

.nav button.active {
  background: linear-gradient(135deg, rgba(47, 128, 255, 0.95), rgba(42, 108, 230, 0.8));
  border-color: rgba(147, 197, 253, 0.32);
  color: white;
  box-shadow: 0 10px 36px rgba(47, 128, 255, 0.28);
}

.nav button:hover {
  background: rgba(59, 130, 246, 0.14);
  border-color: var(--line);
}

.nav-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: rgba(148, 163, 184, 0.12);
  font-size: 13px;
}

.operator {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.68);
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #eff6ff, #94a3b8);
  color: #0f172a;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.main {
  min-width: 0;
  padding: 24px;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.eyebrow {
  color: var(--cyan);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h2 {
  margin: 6px 0 0;
  font-size: 34px;
  letter-spacing: 0;
  line-height: 1.12;
}

h3 {
  margin: 0;
  font-size: 17px;
}

p {
  color: var(--muted);
  line-height: 1.7;
}

.subcopy {
  max-width: 760px;
  margin: 10px 0 0;
  font-size: 15px;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  max-width: 560px;
}

.grid {
  display: grid;
  gap: 14px;
  align-items: start;
}

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

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

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

.dashboard-grid {
  grid-template-columns: 1.35fr 0.9fr;
  align-items: start;
}

.admin-grid {
  grid-template-columns: 1.12fr 0.88fr;
  align-items: start;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(17, 27, 48, 0.9), rgba(7, 12, 24, 0.86));
  box-shadow: var(--shadow);
}

.card.pad {
  padding: 18px;
}

.tight {
  padding: 14px;
}

.metric {
  position: relative;
  overflow: hidden;
  padding: 16px;
  min-height: 118px;
}

.metric:after {
  content: "";
  position: absolute;
  inset: auto -30px -54px auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--glow, rgba(47, 128, 255, 0.16));
  filter: blur(18px);
}

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

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

.metric-foot {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  overflow: hidden;
  margin-top: 12px;
}

.progress span {
  display: block;
  height: 100%;
  width: var(--w);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--c, var(--blue)), rgba(255, 255, 255, 0.78));
}

.hero {
  min-height: calc(100vh - 48px);
  display: grid;
  align-content: space-between;
  gap: 26px;
}

.hero-band {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
  align-items: stretch;
}

.hero-title {
  font-size: 72px;
  line-height: 0.98;
  margin: 16px 0;
}

.hero-title span {
  color: var(--green);
}

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

.sheet-tile {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  display: flex;
  gap: 12px;
  align-items: center;
}

.sheet-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(34, 197, 94, 0.16);
  color: var(--green);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.mess {
  display: grid;
  place-items: center;
  min-height: 280px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
}

.mess-lines {
  position: relative;
  width: 220px;
  height: 160px;
}

.mess-lines i {
  position: absolute;
  width: 140px;
  height: 2px;
  background: rgba(148, 163, 184, 0.42);
  transform-origin: left center;
}

.mess-lines i:nth-child(1) { transform: rotate(16deg); top: 30px; left: 20px; }
.mess-lines i:nth-child(2) { transform: rotate(-23deg); top: 92px; left: 18px; }
.mess-lines i:nth-child(3) { transform: rotate(44deg); top: 44px; left: 70px; }
.mess-lines i:nth-child(4) { transform: rotate(-8deg); top: 116px; left: 58px; }
.mess-lines i:nth-child(5) { transform: rotate(82deg); top: 18px; left: 118px; }

.ai-core {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.95), rgba(47, 128, 255, 0.36) 54%, transparent 70%);
  display: grid;
  place-items: center;
  margin: auto;
  box-shadow: 0 0 50px rgba(34, 211, 238, 0.4);
  font-weight: 900;
}

.flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: center;
}

.flow-arrow {
  width: 54px;
  height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--green));
}

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

.row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.row.slim {
  padding: 9px 10px;
}

.row.clickable {
  cursor: pointer;
}

.row.clickable:hover {
  border-color: var(--line-strong);
  background: rgba(47, 128, 255, 0.09);
}

.rank {
  color: var(--amber);
  font-weight: 900;
  font-size: 20px;
  width: 28px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--soft);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.tag.green { color: var(--green); border-color: rgba(45, 227, 143, 0.26); background: rgba(45, 227, 143, 0.08); }
.tag.amber { color: var(--amber); border-color: rgba(247, 183, 49, 0.28); background: rgba(247, 183, 49, 0.08); }
.tag.red { color: var(--red); border-color: rgba(251, 92, 108, 0.28); background: rgba(251, 92, 108, 0.08); }
.tag.blue { color: #8ec5ff; border-color: rgba(96, 165, 250, 0.28); background: rgba(47, 128, 255, 0.08); }

.chart {
  height: 220px;
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
  background-size: 100% 44px, 70px 100%;
  overflow: hidden;
}

.chart svg {
  width: 100%;
  height: 100%;
}

.chart path {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
}

.comment-box {
  display: grid;
  gap: 10px;
}

.comment-input {
  width: 100%;
  min-height: 44px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(2, 6, 23, 0.72);
  padding: 12px;
  outline: none;
}

.reviewer-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(2, 6, 23, 0.72);
  padding: 10px 12px;
  outline: none;
}

.reviewer-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 128, 255, 0.16);
}

.comment-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 128, 255, 0.16);
}

.review-panel {
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: 220px minmax(220px, 0.75fr) minmax(360px, 1fr);
  gap: 16px;
  align-items: start;
  border-color: rgba(96, 165, 250, 0.34);
  background:
    linear-gradient(135deg, rgba(47, 128, 255, 0.12), rgba(45, 227, 143, 0.06)),
    rgba(8, 15, 29, 0.9);
}

.review-head,
.review-copy,
.review-form {
  display: grid;
  gap: 8px;
}

.review-actions,
.review-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.review-actions {
  justify-content: flex-start;
}

.review-actions button.selected {
  border-color: rgba(45, 227, 143, 0.7);
  background: rgba(45, 227, 143, 0.14);
  color: var(--green);
}

.review-comment {
  min-height: 72px;
}

.review-save {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.review-save-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.primary-button {
  background: linear-gradient(135deg, #0b63ff, #16b77a);
  padding: 10px 14px;
  font-weight: 800;
  border-color: rgba(147, 197, 253, 0.26);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
  padding: 10px 14px;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pill-button {
  background: rgba(47, 128, 255, 0.12);
  border-color: rgba(96, 165, 250, 0.28);
  padding: 8px 12px;
  color: #bfdbfe;
}

.task {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.task:last-child {
  border-bottom: none;
}

.task.kpi {
  grid-template-columns: 92px minmax(0, 1fr) 70px;
}

.check {
  width: 19px;
  height: 19px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  border-radius: 5px;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.03);
}

.check.done {
  background: var(--green);
  border-color: var(--green);
  color: #03130c;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 14px;
  align-items: start;
}

.next-action {
  border-color: rgba(247, 183, 49, 0.48);
  background: linear-gradient(135deg, rgba(247, 183, 49, 0.16), rgba(47, 128, 255, 0.08));
}

.timeline {
  position: relative;
  display: grid;
  gap: 12px;
}

.event {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.roadmap {
  display: grid;
  grid-template-columns: repeat(6, minmax(170px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.phase {
  min-height: 280px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.phase strong {
  display: block;
  color: var(--green);
  margin: 10px 0;
}

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

.mini-list li {
  color: var(--soft);
  font-size: 13px;
  line-height: 1.45;
}

.mini-list li:before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--blue);
  vertical-align: middle;
}

.vision-map {
  min-height: 520px;
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  align-items: center;
  gap: 18px;
}

.vision-core {
  min-height: 360px;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background:
    radial-gradient(circle, rgba(47, 128, 255, 0.22), transparent 58%),
    rgba(255, 255, 255, 0.035);
}

.vision-core h2 {
  font-size: 54px;
}

.small {
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  padding: 12px 14px;
  border: 1px solid rgba(45, 227, 143, 0.36);
  border-radius: var(--radius);
  background: rgba(7, 19, 30, 0.94);
  color: var(--text);
  box-shadow: var(--shadow);
}

.split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stack {
  display: grid;
  gap: 14px;
}

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

@media (max-width: 1100px) {
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: relative;
    height: auto;
    min-width: 0;
  }
  .nav {
    grid-template-columns: repeat(2, 1fr);
  }
  .nav button {
    min-width: 0;
  }
  .nav button span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .dashboard-grid,
  .admin-grid,
  .review-panel,
  .detail-layout,
  .hero-band,
  .vision-map,
  .cols-2,
  .cols-3,
  .cols-4 {
    grid-template-columns: 1fr;
  }
  .hero-title {
    font-size: 46px;
  }
}
