:root {
  --ink: #102a43;
  --ink-soft: #334e68;
  --muted: #627d98;
  --line: #d9e2ec;
  --paper: #ffffff;
  --page: #f5f7f2;
  --teal: #1f7a8c;
  --green: #2f9d7e;
  --coral: #d96f55;
  --gold: #f2b84b;
  --blue: #486581;
  --lavender: #7b6aa8;
  --danger: #b95050;
  --shadow: 0 18px 45px rgba(16, 42, 67, 0.11);
  --radius: 8px;
  --focus: 0 0 0 3px rgba(31, 122, 140, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(31, 122, 140, 0.09), transparent 340px),
    var(--page);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

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

button {
  border: 0;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 18px;
  align-items: center;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1rem;
}

.brand small,
small {
  color: var(--muted);
  font-size: 0.81rem;
}

.role-tabs,
.segmented-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 42px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.role-tab,
.segmented-control button {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 6px;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}

.role-tab.is-active,
.segmented-control button.is-active {
  color: var(--paper);
  background: var(--ink);
}

.topbar-actions {
  display: inline-flex;
  justify-content: flex-end;
  gap: 8px;
}

.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--paper);
  cursor: pointer;
}

.icon-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.icon-button[aria-pressed="true"] {
  color: var(--paper);
  background: var(--teal);
  border-color: var(--teal);
}

.app-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 24px;
  width: min(1500px, calc(100% - 32px));
  margin: 24px auto 48px;
}

.side-panel {
  position: sticky;
  top: 92px;
  height: fit-content;
  display: grid;
  gap: 18px;
}

.profile-block,
.progress-block,
.stage-list,
.contact-strip,
.metric,
.mission-visual,
.detail-panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.profile-block {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 18px;
}

.avatar-wrap {
  width: 74px;
  height: 74px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  color: var(--paper);
  background:
    linear-gradient(135deg, rgba(31, 122, 140, 0.95), rgba(242, 184, 75, 0.92)),
    var(--teal);
  font-weight: 800;
  font-size: 1.25rem;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 2px;
  font-size: 1.38rem;
  line-height: 1.1;
}

h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
  line-height: 1.15;
}

h3 {
  margin-bottom: 12px;
  font-size: 1.02rem;
}

.progress-block {
  padding: 18px;
}

.progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--ink-soft);
}

.progress-copy strong {
  color: var(--ink);
  font-size: 1.35rem;
}

.progress-track {
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7eef5;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--gold));
  transition: width 360ms ease;
}

.stage-list {
  display: grid;
  gap: 0;
  padding: 8px;
}

.stage-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  width: 100%;
  padding: 10px 8px;
  color: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 7px;
  background: transparent;
}

.stage-marker {
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
}

.stage-item.is-done .stage-marker {
  border-color: var(--green);
  background: var(--green);
}

.stage-item.is-current {
  background: rgba(31, 122, 140, 0.08);
}

.stage-item.is-current .stage-marker {
  border-color: var(--teal);
  box-shadow: inset 0 0 0 5px var(--paper);
  background: var(--teal);
}

.stage-item strong,
.stage-item small {
  display: block;
}

.contact-strip {
  padding: 18px;
}

.contact-strip h2 {
  margin-bottom: 14px;
}

.contact-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.contact-token {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: var(--paper);
  background: var(--blue);
  font-size: 0.8rem;
  font-weight: 800;
}

.workspace {
  min-width: 0;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) minmax(260px, 1.4fr);
  gap: 16px;
  margin-bottom: 20px;
}

.metric,
.mission-visual {
  min-height: 138px;
  padding: 18px;
}

.metric span,
.mission-visual span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.metric strong,
.mission-visual strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 2rem;
  line-height: 1;
}

.mission-visual {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  overflow: hidden;
}

.orbit-map {
  position: relative;
  width: 112px;
  height: 100px;
  background:
    radial-gradient(circle at center, rgba(31, 122, 140, 0.14) 0 32px, transparent 33px),
    linear-gradient(90deg, transparent 49%, rgba(16, 42, 67, 0.22) 50%, transparent 51%);
  border: 1px dashed rgba(16, 42, 67, 0.23);
  border-radius: var(--radius);
}

.orbit-node,
.orbit-avatar {
  position: absolute;
  display: block;
  border-radius: 50%;
}

.orbit-node {
  width: 18px;
  height: 18px;
  background: var(--gold);
  border: 3px solid var(--paper);
}

.node-a {
  left: 13px;
  top: 15px;
  background: var(--coral);
}

.node-b {
  right: 12px;
  top: 18px;
  background: var(--green);
}

.node-c {
  left: 22px;
  bottom: 12px;
  background: var(--lavender);
}

.node-d {
  right: 22px;
  bottom: 14px;
  background: var(--teal);
}

.orbit-avatar {
  left: 45px;
  top: 38px;
  width: 26px;
  height: 26px;
  background: var(--ink);
  border: 4px solid var(--paper);
  box-shadow: 0 8px 20px rgba(16, 42, 67, 0.22);
}

.view-panel {
  display: none;
}

.view-panel.is-active {
  display: block;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
}

.section-heading.compact {
  margin-bottom: 14px;
}

.employee-grid,
.manager-grid,
.hr-grid,
.blueprint-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.mission-map,
.detail-panel {
  min-width: 0;
}

.mission-map {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
}

.mission-node {
  position: relative;
  min-height: 160px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.mission-node:hover {
  transform: translateY(-2px);
  border-color: rgba(31, 122, 140, 0.55);
}

.mission-node.is-selected {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(31, 122, 140, 0.12), var(--shadow);
}

.mission-node.is-complete {
  border-color: rgba(47, 157, 126, 0.65);
}

.mission-node.is-locked {
  opacity: 0.72;
}

.mission-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.mission-icon,
.badge-symbol {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: var(--paper);
  background: var(--teal);
  font-weight: 900;
  font-size: 0.76rem;
}

.mission-node[data-tone="gold"] .mission-icon,
.badge-card[data-tone="gold"] .badge-symbol {
  background: var(--gold);
  color: var(--ink);
}

.mission-node[data-tone="coral"] .mission-icon,
.badge-card[data-tone="coral"] .badge-symbol {
  background: var(--coral);
}

.mission-node[data-tone="green"] .mission-icon,
.badge-card[data-tone="green"] .badge-symbol {
  background: var(--green);
}

.mission-node[data-tone="lavender"] .mission-icon,
.badge-card[data-tone="lavender"] .badge-symbol {
  background: var(--lavender);
}

.mission-node[data-tone="blue"] .mission-icon,
.badge-card[data-tone="blue"] .badge-symbol {
  background: var(--blue);
}

.mission-node h3 {
  margin-bottom: 6px;
}

.mission-node p {
  margin-bottom: 14px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.mini-progress {
  display: block;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7eef5;
}

.mini-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.detail-panel {
  padding: 18px;
}

.wide-panel {
  grid-column: 1 / -1;
}

.pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--ink-soft);
  background: #edf2f7;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.done {
  color: #165642;
  background: rgba(47, 157, 126, 0.16);
}

.status-pill.pending {
  color: #7a4a00;
  background: rgba(242, 184, 75, 0.22);
}

.status-pill.overdue {
  color: var(--danger);
  background: rgba(185, 80, 80, 0.12);
}

.mission-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

.step-list,
.checklist-list,
.approval-list,
.report-list,
.notification-list,
.plan-timeline {
  display: grid;
  gap: 10px;
}

.step-item,
.check-item,
.approval-item,
.report-item,
.notification-item,
.plan-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
}

.step-toggle,
.task-toggle {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: transparent;
  background: var(--paper);
  cursor: pointer;
}

.step-toggle.is-done,
.task-toggle.is-done {
  color: var(--paper);
  border-color: var(--green);
  background: var(--green);
}

.step-toggle svg,
.task-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.quiz-box {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(31, 122, 140, 0.28);
  border-radius: var(--radius);
  background: rgba(31, 122, 140, 0.07);
}

.quiz-options {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.quiz-option {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--paper);
  cursor: pointer;
  text-align: left;
}

.quiz-option.is-correct {
  color: #165642;
  border-color: rgba(47, 157, 126, 0.55);
  background: rgba(47, 157, 126, 0.13);
}

.quiz-option.is-wrong {
  color: var(--danger);
  border-color: rgba(185, 80, 80, 0.45);
  background: rgba(185, 80, 80, 0.08);
}

.primary-button,
.secondary-button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--radius);
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  color: var(--paper);
  background: var(--teal);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.secondary-button {
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--paper);
}

.full-width {
  width: 100%;
  margin-top: 12px;
}

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

.badge-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
}

.badge-card.is-locked {
  opacity: 0.48;
}

.badge-card strong,
.badge-card small {
  display: block;
}

.plan-item {
  grid-template-columns: 82px minmax(0, 1fr) 92px;
}

.plan-day {
  color: var(--teal);
  font-weight: 900;
}

.table-wrap {
  overflow-x: auto;
}

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

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

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

tr.is-selected {
  background: rgba(31, 122, 140, 0.08);
}

.row-button {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--paper);
  background: var(--blue);
  cursor: pointer;
}

.manager-action-card {
  display: grid;
  gap: 12px;
}

.manager-action-card label {
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-weight: 800;
  font-size: 0.86rem;
}

.note-box {
  min-height: 96px;
  resize: vertical;
}

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

.analytics-card {
  min-height: 122px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
}

.analytics-card strong {
  display: block;
  margin: 8px 0;
  font-size: 1.7rem;
  line-height: 1;
}

.bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7eef5;
}

.bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

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

.builder-form label {
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-weight: 800;
  font-size: 0.86rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--paper);
}

input,
select {
  min-height: 42px;
  padding: 0 11px;
}

textarea {
  padding: 10px 11px;
}

.file-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

.feature-list li {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  max-width: 360px;
  padding: 13px 15px;
  border-radius: var(--radius);
  color: var(--paper);
  background: var(--ink);
  box-shadow: var(--shadow);
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 35;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 18px;
  border-radius: 2px;
  animation: confettiFall 920ms ease-out forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0);
    opacity: 1;
  }

  100% {
    transform: translateY(82vh) rotate(230deg);
    opacity: 0;
  }
}

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

  .mission-visual {
    grid-column: 1 / -1;
  }
}

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

  .role-tabs {
    width: 100%;
    overflow-x: auto;
  }

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

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

  .side-panel {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stage-list,
  .contact-strip {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 15px;
  }

  .topbar {
    padding: 12px;
  }

  .app-layout {
    width: min(100% - 20px, 1500px);
    margin-top: 14px;
  }

  .side-panel,
  .employee-grid,
  .manager-grid,
  .hr-grid,
  .blueprint-grid,
  .status-grid,
  .analytics-board,
  .mission-map {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .segmented-control {
    width: 100%;
    overflow-x: auto;
  }

  .metric,
  .mission-visual {
    min-height: 112px;
  }

  .mission-summary,
  .step-item,
  .check-item,
  .approval-item,
  .report-item,
  .notification-item,
  .plan-item {
    grid-template-columns: 1fr;
  }

  .step-toggle,
  .task-toggle {
    justify-self: start;
  }

  .badge-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
