:root {
  --bg: #f0f2f5;
  --sidebar-bg: #1a1f2e;
  --sidebar-text: #8892a4;
  --sidebar-hover: #252d40;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --sidebar-w: 220px;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  font-size: 14px;
}

/* ── Sidebar ───────────────────────────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.sidebar-logo .wordmark {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 3px;
  color: #fff;
}

.sidebar-logo .tenant {
  font-size: 11px;
  color: rgba(255,255,255,0.38);
  margin-top: 3px;
}

.sidebar-member {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 13px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.sidebar-member-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.sidebar-member-name {
  font-size: 12px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.sidebar-member-email {
  font-size: 10px; color: rgba(255,255,255,0.35);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.sidebar nav {
  flex: 1;
  padding: 10px 0;
  overflow-y: auto;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  margin: 1px 8px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-radius: 7px;
  transition: background 0.15s, color 0.15s;
}

.sidebar nav a:hover { background: rgba(255,255,255,0.07); color: #cdd5e0; }

.sidebar nav a.active {
  color: #fff;
  background: rgba(79,70,229,0.28);
}

.sidebar nav a .nav-icon {
  width: 16px; height: 16px; flex-shrink: 0;
  opacity: 0.55;
  display: flex; align-items: center; justify-content: center;
}

.sidebar nav a:hover .nav-icon,
.sidebar nav a.active .nav-icon { opacity: 1; }

.sidebar-footer {
  padding: 12px 18px 16px;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.sidebar-footer a {
  font-size: 11px;
  color: var(--sidebar-text);
  text-decoration: none;
}
.sidebar-footer a:hover { color: #d4dbe8; }

/* ── Main content ──────────────────────────────────────────────────────────── */

.content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 28px 32px;
  min-width: 0;
  max-width: 780px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-header h1 { font-size: 20px; font-weight: 600; }
.page-header .sub { font-size: 13px; color: var(--text-muted); margin-top: 3px; }

/* ── Cards ─────────────────────────────────────────────────────────────────── */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 18px;
}

.card-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ── Hero / current step ───────────────────────────────────────────────────── */

.hero {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 18px;
}

.hero h1 { font-size: 18px; font-weight: 700; margin-bottom: 2px; }
.hero .sub { font-size: 13px; color: var(--text-muted); margin-bottom: 18px; }

.current-step {
  display: inline-flex; align-items: center; gap: 9px;
  background: #eef2ff; color: var(--primary);
  border-radius: 8px; padding: 10px 16px;
  font-size: 13px; font-weight: 600;
}

.current-step .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary);
  animation: pulse 1.8s infinite;
  flex-shrink: 0;
}

@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(1.4)} }

.current-step.done { background: #f0fdf4; color: #16a34a; }
.current-step.done .dot { background: #16a34a; animation: none; }

.cohort-banner {
  background: #fffbeb; border: 1px solid #fde68a;
  border-radius: 7px; padding: 11px 14px;
  font-size: 12.5px; color: #92400e; margin-top: 14px;
  line-height: 1.5;
}

/* ── Journey timeline ──────────────────────────────────────────────────────── */

.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: ''; position: absolute; left: 6px; top: 4px; bottom: 4px;
  width: 2px; background: var(--border);
}

.tl-item { position: relative; padding-bottom: 18px; }
.tl-item:last-child { padding-bottom: 0; }

.tl-dot {
  position: absolute; left: -19px; top: 3px;
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid var(--border); background: var(--card);
}

.tl-item.done .tl-dot { background: var(--primary); border-color: var(--primary); }
.tl-item.now .tl-dot { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 3px #eef2ff; }

.tl-name { font-size: 13px; font-weight: 500; }
.tl-item.done .tl-name { color: var(--text-muted); }
.tl-item.now .tl-name { color: var(--primary); font-weight: 600; }
.tl-date { font-size: 11.5px; color: #9ca3af; margin-top: 2px; }

/* ── Checklist ─────────────────────────────────────────────────────────────── */

.cl-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
}

.cl-item:last-child { border-bottom: none; }

.cl-item input[type="checkbox"] {
  width: 17px; height: 17px;
  accent-color: var(--primary);
  cursor: pointer; flex-shrink: 0;
}

.cl-label { font-size: 13px; flex: 1; }
.cl-item.done .cl-label { text-decoration: line-through; color: #9ca3af; }
.cl-date { font-size: 11px; color: #9ca3af; white-space: nowrap; }

.progress-bar-wrap {
  background: #f3f4f6; border-radius: 99px;
  height: 6px; margin-bottom: 14px; overflow: hidden;
}

.progress-bar {
  height: 100%; border-radius: 99px;
  background: var(--primary);
  transition: width 0.3s ease;
}

/* ── Messages / chat ───────────────────────────────────────────────────────── */

.chat-thread {
  display: flex; flex-direction: column; gap: 14px;
  margin-bottom: 20px;
  max-height: 480px; overflow-y: auto;
  padding-right: 2px;
}

.msg { display: flex; flex-direction: column; max-width: 80%; }
.msg.out { align-self: flex-start; }
.msg.in  { align-self: flex-end; }

.msg-meta { font-size: 11px; color: #9ca3af; margin-bottom: 3px; }
.msg.in .msg-meta { text-align: right; }

.msg-bubble {
  padding: 9px 13px; border-radius: 12px;
  font-size: 13px; line-height: 1.55; white-space: pre-wrap; word-break: break-word;
}

.msg.out .msg-bubble { background: #f3f4f6; color: #1f2937; border-bottom-left-radius: 3px; }
.msg.in  .msg-bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 3px; }

.reply-area { border-top: 1px solid var(--border); padding-top: 16px; }

.reply-area textarea {
  width: 100%; padding: 10px 12px;
  border: 1.5px solid var(--border); border-radius: 7px;
  font-size: 13px; line-height: 1.5; resize: none; min-height: 76px;
  font-family: inherit; transition: border-color 0.15s;
}

.reply-area textarea:focus { outline: none; border-color: var(--primary); }

.reply-footer {
  display: flex; justify-content: space-between;
  align-items: center; margin-top: 8px;
}

.reply-hint { font-size: 11px; color: #9ca3af; }

/* ── Cohort ────────────────────────────────────────────────────────────────── */

.member-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.member-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px 5px 5px;
  background: #f3f4f6; border-radius: 20px;
  font-size: 13px; color: #374151;
}

.chip-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ── Shared utilities ──────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 18px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: none; transition: background 0.15s;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { opacity: .5; cursor: default; }

.empty-state {
  text-align: center; padding: 40px 20px;
  color: var(--text-muted); font-size: 13px;
}

.empty-state p { margin-top: 6px; font-size: 12px; }

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