/* Client dashboard (/client/dashboard/). Loaded after /advisor/onboarding/style.css, whose tokens (--ink,
   --accent, --rule…) it uses; the shared sheet fixes the body to the viewport for the wizard, so it's reset here. */

body.cd-body {
  overflow: auto;
  height: auto;
  min-height: 100vh;
  display: block;
  background: var(--bg);
}

.cd-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; padding: 0 24px;
  background: rgba(250, 250, 248, 0.94);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.cd-logo { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 18px; }
.cd-logo svg { width: 20px; height: 20px; color: var(--accent); }
.cd-logo-dot { color: var(--accent); }

.cd-account { position: relative; }
.cd-account-btn {
  display: flex; align-items: center; gap: 6px; padding: 8px 12px;
  border: 1px solid var(--rule); border-radius: var(--radius-full);
  background: var(--paper-white); color: var(--ink); font: 600 14px var(--sans); cursor: pointer;
}
.cd-account-btn svg { width: 14px; height: 14px; }
.cd-account-menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; padding: 6px;
  background: var(--paper-white); border: 1px solid var(--rule); border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
}
.cd-account-menu a, .cd-account-menu button {
  display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: var(--radius-md);
  color: var(--ink); font: 500 14px var(--sans); text-decoration: none; background: none; border: 0; cursor: pointer;
}
.cd-account-menu a:hover, .cd-account-menu button:hover { background: var(--bg-warm); }

.cd-tabs {
  position: sticky; top: 64px; z-index: 40;
  display: flex; gap: 4px; justify-content: center; overflow-x: auto;
  padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--rule-soft);
  scrollbar-width: none;
}
.cd-tabs::-webkit-scrollbar { display: none; }
.cd-tab {
  flex: 0 0 auto; padding: 8px 16px; border: 0; border-radius: var(--radius-full);
  background: none; color: var(--muted); font: 600 14px var(--sans); cursor: pointer;
}
.cd-tab:hover { color: var(--ink); background: var(--bg-warm); }
.cd-tab[aria-selected="true"] { background: var(--ink); color: #fff; }

.cd-main { max-width: 760px; margin: 0 auto; padding: 28px 16px 40px; }
.cd-loading { padding: 40px 0; text-align: center; color: var(--muted); }

.cd-welcome h1 { font-size: clamp(26px, 4vw, 32px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.cd-welcome p { margin-top: 4px; font-size: 14px; }

/* Journey */
.cd-steps { list-style: none; display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 24px 0 18px; }
.cd-step { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.cd-step:not(:last-child)::after {
  content: ''; position: absolute; top: 14px; left: calc(50% + 18px); right: calc(-50% + 18px);
  height: 2px; background: var(--rule);
}
.cd-step-done:not(:last-child)::after { background: var(--ink); }
.cd-step-dot {
  width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font: 700 12px var(--sans); border: 2px solid var(--rule); color: var(--muted); background: var(--paper-white);
}
.cd-step-done .cd-step-dot { background: var(--ink); border-color: var(--ink); color: #fff; }
.cd-step-current .cd-step-dot { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.cd-step-label { font-size: 12px; font-weight: 600; color: var(--muted); line-height: 1.25; }
.cd-step-done .cd-step-label, .cd-step-current .cd-step-label { color: var(--ink); }

/* Cards */
.cd-card {
  background: var(--paper-white); border: 1px solid var(--rule); border-radius: 16px;
  padding: 22px; box-shadow: var(--shadow-sm);
}
.cd-card + .cd-card, .cd-grid + .cd-card { margin-top: 16px; }
.cd-card-title { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.cd-muted { color: var(--muted); }
.cd-small { font-size: 13px; }
.cd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.cd-grid > .cd-card { margin-top: 0; }
#cd-overview-sheet { margin-top: 16px; }

.cd-next { border-color: rgba(184, 84, 26, 0.25); background: linear-gradient(180deg, #FFFBF7 0%, var(--paper-white) 100%); }
.cd-eyebrow { font: 700 12px var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.cd-next-title { margin-top: 6px; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.25; color: var(--ink); }
.cd-next-sub { margin-top: 6px; color: var(--ink-soft); font-size: 15px; }
.cd-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 16px; }
.cd-btn {
  display: inline-flex; align-items: center; justify-content: center; padding: 11px 20px;
  border-radius: var(--radius-full); border: 1px solid var(--ink); background: var(--ink); color: #fff;
  font: 600 14px var(--sans); text-decoration: none; cursor: pointer; transition: var(--transition);
}
.cd-btn:hover { background: var(--accent); border-color: var(--accent); }
.cd-btn-ghost { background: var(--paper-white); color: var(--ink); border-color: var(--rule); }
.cd-btn-ghost:hover { background: var(--bg-warm); color: var(--ink); border-color: var(--rule); }
.cd-link { color: var(--accent); font-weight: 600; font-size: 14px; text-decoration: none; }
.cd-link:hover { text-decoration: underline; }

/* Risk */
.cd-risk-name { font-size: 24px; font-weight: 800; color: var(--ink); line-height: 1.2; }
.cd-risk-scale { display: flex; gap: 4px; margin: 10px 0 6px; }
.cd-risk-scale span { flex: 1; height: 6px; border-radius: 3px; background: var(--rule); }
.cd-risk-scale span.on { background: var(--accent); }
.cd-risk-copy { margin: 10px 0 6px; font-size: 15px; color: var(--ink-soft); }

/* Team */
.cd-director { display: flex; align-items: center; gap: 12px; }
.cd-director img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.cd-director-name { font-weight: 700; color: var(--ink); }
.cd-roles { list-style: none; margin-top: 14px; display: grid; gap: 10px; }
.cd-roles li { display: flex; flex-direction: column; font-size: 14px; }
.cd-roles strong { color: var(--ink); font-weight: 700; }
.cd-roles span { color: var(--muted); font-size: 13px; }

.cd-empty p { margin-top: 2px; }

.cd-imp {
  display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 16px;
  background: #FEF3C7; color: #78350F; font: 600 13px var(--sans);
}
.cd-imp button { padding: 4px 12px; border-radius: var(--radius-full); border: 1px solid #B45309; background: #fff; color: #78350F; font-weight: 700; cursor: pointer; }

.cd-footer { max-width: 760px; margin: 0 auto; padding: 20px 16px 40px; font-size: 12px; color: var(--muted); text-align: center; border-top: 1px solid var(--rule-soft); }

@media (max-width: 640px) {
  .cd-header { padding: 0 16px; }
  .cd-tabs { justify-content: flex-start; }
  .cd-grid { grid-template-columns: 1fr; }
  .cd-steps { grid-template-columns: repeat(6, minmax(52px, 1fr)); overflow-x: auto; }
  .cd-step-label { font-size: 11px; }
  .cd-card { padding: 18px; }
  .cd-next-title { font-size: 20px; }
}

/* Reschedule */
.cd-link-btn { background: none; border: 0; padding: 0; cursor: pointer; font-family: var(--sans); }
#cd-resched { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--rule-soft); }
.cd-resched-title { font-weight: 700; color: var(--ink); margin-bottom: 10px; }
.cd-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cd-chips + .cd-chips { margin-top: 10px; }
.cd-chip {
  padding: 8px 14px; border-radius: var(--radius-full); border: 1px solid var(--rule); background: var(--paper-white);
  color: var(--ink); font: 600 13px var(--sans); cursor: pointer;
}
.cd-chip:hover { border-color: var(--ink); }
.cd-chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.cd-times .cd-chip { font-weight: 500; }
.cd-input {
  display: block; width: 100%; margin-top: 12px; padding: 11px 14px; border: 1px solid var(--rule); border-radius: var(--radius-md);
  font: 500 15px var(--sans); color: var(--ink); background: var(--paper-white);
}
.cd-btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.cd-btn[disabled]:hover { background: var(--ink); border-color: var(--ink); }
.cd-error { margin-top: 10px; color: #B91C1C; font-size: 14px; font-weight: 500; }
.cd-note { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--mint-100); color: var(--mint-600); font-size: 14px; font-weight: 600; }
