/* Zen-inspired prototype tokens (light only) */
:root {
  --exp: #0082c6;
  --exp-hover: #006fa8;
  --zen: #5b616c;
  --zen-dark: #282d39;
  --zen-lite: #747884;
  --bg: #f5f7f9;
  --shaded: #f6f8fa;
  --white: #ffffff;
  --border: #e4e5e7;
  --border-strong: #dfe4ec;
  --green: #1f8a5b;
  --green-bg: #e8f6ef;
  --amber: #b56a00;
  --amber-bg: #fff4e5;
  --font: "Rubik", system-ui, sans-serif;
  --shadow: 0 1px 2px rgba(40, 45, 57, 0.06);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--zen);
  background: var(--bg);
  min-height: 100%;
}

a {
  color: var(--exp);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
.btn {
  font-family: inherit;
  cursor: pointer;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  line-height: 1.2;
}

.btn-exp {
  background: var(--exp);
  color: #fff;
  text-transform: uppercase;
}

.btn-exp:hover {
  background: var(--exp-hover);
  text-decoration: none;
  color: #fff;
}

.btn-secondary {
  background: var(--white);
  color: var(--zen-dark);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--exp);
  color: var(--exp);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--exp);
  padding: 8px 10px;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 56px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--exp);
  font-weight: 500;
  font-size: 16px;
}

.brand .mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, #0082c6, #4db3e8);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.topbar-title {
  color: var(--exp);
  font-size: 16px;
  margin-left: 18px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--zen);
  font-size: 14px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #d9eef9;
  color: var(--exp);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
}

.apps-icon {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: var(--zen-lite);
  font-size: 12px;
}

.page {
  padding: 32px 40px 56px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.page-wide {
  max-width: 1280px;
}

.h1 {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 500;
  color: var(--zen-dark);
}

.h2 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 500;
  color: var(--zen);
}

.h3 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 500;
  color: var(--zen-dark);
}

.muted {
  color: var(--zen-lite);
  font-size: 14px;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-pad {
  padding: 20px 22px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 24px;
}

.chip {
  border: 1px solid var(--exp);
  color: var(--exp);
  background: #f3f9fd;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
}

.chip.locked {
  border-color: var(--border);
  color: var(--zen-lite);
  background: var(--shaded);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.metric {
  padding: 18px 18px 16px;
}

.metric .label {
  font-size: 14px;
  margin-bottom: 10px;
}

.metric .value {
  font-size: 34px;
  font-weight: 500;
  color: var(--zen-dark);
  line-height: 1;
}

.metric .sub {
  margin-top: 8px;
  font-size: 12px;
  color: var(--zen-lite);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.list-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.list-row:first-child {
  padding-top: 0;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--exp);
  display: inline-block;
  margin-right: 10px;
}

.module-card {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.module-card:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.expiry-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.expiry-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.expiry-row:first-child {
  padding-top: 0;
}

.dot.warn {
  background: var(--amber);
}

.grid-3 {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.bar {
  height: 6px;
  background: var(--shaded);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 8px;
}

.bar > span {
  display: block;
  height: 100%;
  background: var(--exp);
}

.people-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}

.people-avatars {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.person-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.person-mini .av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #dceaf5;
  display: grid;
  place-items: center;
  color: var(--exp);
  font-size: 11px;
  font-weight: 600;
}

/* Checklist */
.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.progress-track {
  height: 8px;
  background: var(--shaded);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 18px;
}

.progress-track > span {
  display: block;
  height: 100%;
  background: var(--exp);
}

.check-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

.check-row:first-of-type {
  border-top: none;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--zen-lite);
  background: var(--white);
}

.step-num.done {
  background: var(--green-bg);
  border-color: #b7e0cb;
  color: var(--green);
}

.step-num.current {
  background: var(--exp);
  border-color: var(--exp);
  color: #fff;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--shaded);
  color: var(--zen-lite);
}

.badge.ok {
  background: var(--green-bg);
  color: var(--green);
}

.badge.warn {
  background: var(--amber-bg);
  color: var(--amber);
}

.badge.info {
  background: #e8f3fb;
  color: var(--exp);
}

/* Wizard */
.wizard-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 14px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wizard-steps {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.wizard-step {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--zen-lite);
  background: var(--white);
}

.wizard-step.active {
  border-color: var(--exp);
  color: var(--exp);
  background: #f3f9fd;
}

.wizard-step.done {
  border-color: #b7e0cb;
  color: var(--green);
  background: var(--green-bg);
}

.wizard-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  padding: 24px 40px 100px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.wizard-nav .nav-item {
  display: block;
  padding: 12px 14px;
  border-radius: 6px;
  color: var(--zen);
  margin-bottom: 4px;
}

.wizard-nav .nav-item:hover {
  background: var(--shaded);
  text-decoration: none;
}

.wizard-nav .nav-item.active {
  background: #e8f3fb;
  color: var(--exp);
  font-weight: 500;
}

.wizard-nav .nav-item.done {
  color: var(--green);
}

.wizard-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 14px 40px;
  display: flex;
  justify-content: space-between;
  z-index: 30;
}

.template-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0 20px;
}

.template-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--white);
  cursor: pointer;
}

.template-card.selected {
  border-color: var(--exp);
  box-shadow: inset 0 0 0 1px var(--exp);
}

.group-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.group-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
}

.group-row:last-child {
  border-bottom: none;
}

.tree-preview {
  background: var(--shaded);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.7;
}

.criteria-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.tag {
  display: inline-block;
  background: var(--shaded);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  margin: 0 6px 6px 0;
}

.callout {
  background: #e8f3fb;
  border: 1px solid #c5e1f4;
  color: var(--zen-dark);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 13px;
  margin-top: 16px;
}

/* Org chart */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.segment {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--white);
}

.segment a,
.segment span {
  padding: 8px 14px;
  font-size: 13px;
  color: var(--zen);
}

.segment .active {
  background: var(--exp);
  color: #fff;
}

.chart-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 14px;
  min-height: 560px;
}

.chart-canvas {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.org-level {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
}

.org-node {
  width: 160px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  box-shadow: var(--shadow);
}

.org-node.selected {
  border-color: var(--exp);
  box-shadow: 0 0 0 2px rgba(0, 130, 198, 0.2);
}

.org-node .av {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin: 0 auto 8px;
  background: #dceaf5;
  display: grid;
  place-items: center;
  color: var(--exp);
  font-size: 12px;
  font-weight: 600;
}

.org-node .name {
  font-size: 13px;
  color: var(--zen-dark);
  font-weight: 500;
}

.org-node .role {
  font-size: 11px;
  color: var(--zen-lite);
  margin-top: 2px;
}

.connector {
  width: 2px;
  height: 18px;
  background: var(--border-strong);
}

.side-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.side-panel h3 {
  margin: 0;
  color: var(--zen-dark);
  font-size: 18px;
  font-weight: 500;
}

.field {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.field .k {
  color: var(--zen-lite);
}

.field .v {
  color: var(--zen-dark);
}

.panel-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.panel-actions .btn {
  justify-content: center;
  width: 100%;
}

.hint {
  font-size: 12px;
  color: var(--zen-lite);
  background: var(--shaded);
  border-radius: 6px;
  padding: 10px 12px;
}

/* Prefill wizard */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-field label {
  display: block;
  font-size: 12px;
  color: var(--zen-lite);
  margin-bottom: 6px;
}

.form-field input,
.form-field select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 12px;
  font: inherit;
  color: var(--zen-dark);
  background: var(--white);
}

.form-field input[readonly] {
  background: var(--shaded);
}

.proto-index {
  max-width: 800px;
  margin: 40px auto;
  padding: 0 20px 60px;
}

.proto-index ol {
  padding-left: 18px;
}

.proto-index li {
  margin: 10px 0;
  line-height: 1.5;
}

.note {
  font-size: 12px;
  color: var(--zen-lite);
  margin-top: 8px;
}

@media (max-width: 960px) {
  .metrics,
  .grid-2,
  .grid-3,
  .criteria-grid,
  .chart-layout,
  .wizard-layout,
  .form-grid,
  .template-grid {
    grid-template-columns: 1fr;
  }
}
