:root {
  --bg: #f8f6f1;
  --surface: #ffffff;
  --surface-soft: #f2eee4;
  --surface-strong: #efe8d9;
  --ink: #1e1a14;
  --muted: #7f7463;
  --line: rgba(155, 125, 58, 0.14);
  --line-strong: rgba(155, 125, 58, 0.28);
  --gold: #9b7d3a;
  --gold-deep: #87682d;
  --shadow: 0 28px 60px rgba(36, 28, 15, 0.12);
  --font-display: "Cormorant Garamond", serif;
  --font-sans: "Inter", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.portal-page {
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  background: #1a1812;
  color: #fafaf7;
  position: relative;
}

.portal-bg,
.portal-bg--secondary {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.portal-bg {
  opacity: 0.03;
  background-image: repeating-linear-gradient(45deg, #9b7d3a 0, #9b7d3a 1px, transparent 1px, transparent 18px);
}

.portal-bg--secondary {
  background: radial-gradient(circle at 28% 60%, rgba(155, 125, 58, 0.08), transparent 58%);
}

.portal-topbar,
.portal-footer {
  position: relative;
  z-index: 2;
}

.portal-topbar {
  height: 72px;
  padding: 0 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.portal-brand__logo {
  width: 46px;
  height: 46px;
  object-fit: cover;
}

.portal-brand__text {
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 0.03em;
}

.portal-brand__text span {
  color: var(--gold);
  font-style: italic;
}

.portal-backlink {
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(250, 250, 247, 0.46);
  transition: color 0.2s ease;
}

.portal-backlink:hover {
  color: rgba(250, 250, 247, 0.8);
}

.portal-main {
  position: relative;
  z-index: 2;
  min-height: calc(100vh - 124px);
  padding: 28px 22px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-panel {
  width: min(100%, 440px);
  padding: 24px 36px 26px;
}

.reveal-panel {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeRise 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.login-panel__lock {
  width: 50px;
  height: 50px;
  border: 1px solid rgba(155, 125, 58, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 28px;
}

.login-panel__lock svg {
  width: 18px;
  height: 18px;
  color: var(--gold);
}

.login-panel__heading {
  text-align: center;
  margin-bottom: 28px;
}

.login-panel__eyebrow {
  margin: 0 0 12px;
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
}

.login-panel__heading h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 48px;
  line-height: 1;
  font-weight: 300;
}

.login-panel__line {
  width: 32px;
  height: 1px;
  margin: 16px auto;
  background: var(--gold);
}

.login-panel__intro {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(250, 250, 247, 0.52);
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form__field label {
  display: block;
  margin-bottom: 6px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(250, 250, 247, 0.5);
}

.login-form__field input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.05);
  color: #fafaf7;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.login-form__field input::placeholder {
  color: rgba(250, 250, 247, 0.22);
}

.login-form__field input:-webkit-autofill,
.login-form__field input:-webkit-autofill:hover,
.login-form__field input:-webkit-autofill:focus,
.login-form__field input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.05) inset;
  -webkit-text-fill-color: #fafaf7;
  caret-color: #fafaf7;
  border-color: rgba(255, 255, 255, 0.11);
  transition: background-color 9999s ease-in-out 0s;
}

.login-form__field input:focus,
.search-field input:focus,
.tool-field input:focus,
.tool-field select:focus,
.tool-field textarea:focus,
.modal-field input:focus,
.drawer-note textarea:focus {
  outline: none;
  border-color: rgba(155, 125, 58, 0.68);
}

.login-form__password-wrap {
  position: relative;
}

.login-form__password-wrap input {
  padding-right: 54px;
}

.login-form__toggle {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(250, 250, 247, 0.36);
}

.login-form__toggle:hover,
.login-form__toggle.is-active {
  color: rgba(250, 250, 247, 0.7);
}

.icon-eye-off {
  display: none;
}

.login-form__toggle.is-active .icon-eye {
  display: none;
}

.login-form__toggle.is-active .icon-eye-off {
  display: block;
}

.login-form__error {
  display: none;
  align-items: center;
  gap: 10px;
  min-height: 16px;
  padding: 13px 14px;
  border: 1px solid rgba(239, 68, 68, 0.18);
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
  font-size: 12px;
}

.login-form__error.is-visible {
  display: flex;
}

.login-form__submit {
  height: 50px;
  padding: 0 18px;
  border: 0;
  background: var(--gold);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 11px;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.login-form__submit:hover {
  background: var(--gold-deep);
}

.login-form__submit:disabled {
  cursor: wait;
  opacity: 0.72;
}

.login-form__submit svg {
  width: 14px;
  height: 14px;
}

.login-form__submit-loading {
  display: none;
}

.login-form__submit.is-loading .login-form__submit-text,
.login-form__submit.is-loading svg {
  display: none;
}

.login-form__submit.is-loading .login-form__submit-loading {
  display: inline;
}

.portal-footer {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.portal-footer p {
  margin: 0;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(250, 250, 247, 0.22);
}

.advisor-shell {
  min-height: 100vh;
  background: radial-gradient(circle at 80% 8%, rgba(155, 125, 58, 0.08), transparent 28%), var(--bg);
}

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

.advisor-topbar {
  position: fixed;
  inset: 0 0 auto;
  height: 58px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.advisor-topbar__left,
.advisor-topbar__right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.advisor-menu-toggle,
.advisor-signout,
.modal-close {
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.advisor-menu-toggle {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.advisor-menu-toggle:hover,
.advisor-signout:hover,
.modal-close:hover {
  border-color: var(--line-strong);
  color: var(--gold);
}

.advisor-menu-toggle svg,
.advisor-signout svg {
  width: 16px;
  height: 16px;
}

.advisor-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.advisor-brand__logo {
  width: 26px;
  height: 26px;
  object-fit: cover;
}

.advisor-brand__text {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.02em;
}

.advisor-brand__text span {
  color: var(--gold);
  font-style: italic;
}

.advisor-divider {
  width: 1px;
  height: 16px;
  background: var(--line);
}

.advisor-centre-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.advisor-centre-label svg {
  width: 13px;
  height: 13px;
  color: var(--gold);
}

.advisor-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.advisor-profile__avatar {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(155, 125, 58, 0.22);
  background: rgba(155, 125, 58, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  color: var(--gold);
}

.advisor-profile__meta p,
.advisor-profile__meta span {
  margin: 0;
}

.advisor-profile__meta p {
  font-size: 12px;
  font-weight: 500;
}

.advisor-profile__meta span {
  display: block;
  margin-top: 2px;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(155, 125, 58, 0.72);
}

.advisor-signout {
  height: 34px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.advisor-layout {
  display: flex;
  padding-top: 58px;
}

.advisor-sidebar {
  position: fixed;
  top: 58px;
  bottom: 0;
  left: 0;
  width: 236px;
  z-index: 30;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transition: width 0.2s ease, transform 0.25s ease;
}

.advisor-sidebar.is-collapsed {
  width: 72px;
}

.advisor-nav {
  flex: 1;
  padding: 18px 10px;
  display: grid;
  align-content: start;
  gap: 4px;
}

.advisor-nav__item {
  position: relative;
  width: 100%;
  min-height: 46px;
  padding: 0 16px;
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  text-align: left;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.advisor-nav__item:hover,
.advisor-nav__item.is-active {
  background: rgba(155, 125, 58, 0.08);
  color: var(--ink);
}

.advisor-nav__item.is-active {
  border-left-color: var(--gold);
}

.advisor-nav__icon {
  width: 18px;
  height: 18px;
  color: rgba(155, 125, 58, 0.78);
  flex: 0 0 auto;
}

.advisor-nav__label {
  flex: 1;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.advisor-nav__badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #f59e0b;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.advisor-sidebar.is-collapsed .advisor-nav__label,
.advisor-sidebar.is-collapsed .advisor-nav__badge,
.advisor-sidebar.is-collapsed .advisor-sidebar__bottom {
  display: none;
}

.advisor-sidebar.is-collapsed .advisor-nav__item {
  justify-content: center;
  padding: 0;
}

.advisor-sidebar__bottom {
  padding: 16px 18px 20px;
  border-top: 1px solid var(--line);
}

.advisor-sidebar__bottom a {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(127, 116, 99, 0.72);
}

.advisor-sidebar__bottom a:hover {
  color: var(--gold);
}

.advisor-content {
  flex: 1;
  margin-left: 236px;
  padding: 28px 28px 32px;
  transition: margin-left 0.2s ease;
}

.advisor-content.is-collapsed {
  margin-left: 72px;
}

.advisor-tab-panel {
  display: none;
}

.advisor-tab-panel.is-active {
  display: block;
  animation: fadeRise 0.25s ease;
}

.page-stack {
  display: grid;
  gap: 28px;
}

.section-head {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.section-head__eyebrow {
  margin: 0 0 8px;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-head h1,
.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 300;
  color: var(--ink);
}

.section-head h1 {
  font-size: clamp(2.5rem, 4vw, 3.7rem);
  line-height: 0.95;
}

.section-head h2 {
  font-size: 2.2rem;
}

.section-head p {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.card,
.metric-card,
.surface-card,
.table-shell,
.empty-shell,
.notice-card,
.tool-result-card,
.modal-panel,
.drawer-panel,
.toast {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 28px 60px rgba(36, 28, 15, 0.12);
}

.metric-card {
  padding: 20px;
  min-height: 168px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.metric-card--accent {
  background: rgba(155, 125, 58, 0.06);
  border-color: rgba(155, 125, 58, 0.26);
}

.metric-card__top,
.quick-actions,
.pipeline-grid,
.split-grid,
.tool-tabs,
.drawer-actions,
.modal-actions,
.performance-chart,
.performance-grid {
  display: flex;
  gap: 12px;
}

.metric-card__top {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.metric-card__icon,
.mini-icon {
  width: 18px;
  height: 18px;
  color: var(--gold);
}

.metric-card__chevron {
  width: 14px;
  height: 14px;
  color: rgba(127, 116, 99, 0.3);
}

.metric-card__value {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 300;
}

.metric-card__label {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.metric-card__sub {
  margin: 5px 0 0;
  font-size: 10px;
  color: rgba(155, 125, 58, 0.8);
}

.pipeline-grid {
  align-items: stretch;
}

.pipeline-grid > *:first-child {
  flex: 3;
}

.pipeline-grid > *:last-child {
  flex: 2;
}

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

.panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel-head svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.table-shell {
  overflow: hidden;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: rgba(155, 125, 58, 0.08);
}

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

th {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

td {
  font-size: 14px;
  color: var(--ink);
}

tbody tr:hover {
  background: rgba(155, 125, 58, 0.05);
}

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

.tiny-copy {
  font-size: 10px;
  letter-spacing: 0.08em;
}

.status-badge,
.tag-badge,
.tab-badge,
.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-badge,
.tag-badge {
  padding: 5px 8px;
}

.status-active {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

.status-review-due {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}

.status-pending {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.status-lapsed {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.notice-card {
  padding: 16px 18px;
  min-height: 96px;
}

.notice-card--urgent {
  background: rgba(251, 191, 36, 0.13);
  border-color: rgba(245, 158, 11, 0.32);
}

.notice-card__eyebrow {
  margin: 0 0 6px;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #b45309;
}

.notice-card p,
.notice-card span {
  margin: 0;
}

.notice-card__title {
  font-size: 13px;
  line-height: 1.6;
}

.notice-card__date {
  display: block;
  margin-top: 8px;
  font-size: 10px;
  color: var(--muted);
}

.surface-card {
  padding: 22px;
}

.surface-card--soft {
  background: rgba(155, 125, 58, 0.05);
}

.quick-actions {
  flex-wrap: wrap;
}

.button,
.button-lite,
.button-chip,
.search-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.button:hover,
.button-lite:hover,
.button-chip:hover,
.search-chip:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.button svg,
.button-lite svg {
  width: 14px;
  height: 14px;
}

.button--primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}

.button--primary:hover {
  background: var(--gold-deep);
  border-color: var(--gold-deep);
  color: #fff;
}

.button--ghost {
  background: var(--surface);
}

.button--full {
  width: 100%;
}

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

.controls-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.search-field {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-field svg {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 15px;
  height: 15px;
  color: rgba(127, 116, 99, 0.45);
  transform: translateY(-50%);
}

.search-field input {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 38px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.search-chip,
.button-chip {
  min-height: 40px;
  padding: 0 14px;
}

.search-chip.is-active,
.button-chip.is-active {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}

.client-name {
  font-weight: 500;
}

.client-meta {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  color: var(--muted);
}

.action-chevron {
  width: 16px;
  height: 16px;
  color: rgba(127, 116, 99, 0.35);
}

.empty-shell {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.empty-shell p {
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
  font-style: italic;
  color: rgba(127, 116, 99, 0.38);
}

.tool-tabs {
  flex-wrap: wrap;
}

.tool-tab {
  flex: 1 1 160px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
}

.tool-tab.is-active {
  background: rgba(155, 125, 58, 0.06);
  border-color: rgba(155, 125, 58, 0.3);
}

.tool-tab svg {
  width: 18px;
  height: 18px;
  margin-bottom: 12px;
  color: var(--gold);
}

.tool-tab strong {
  display: block;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tool-tab span {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}

.tool-shell {
  display: grid;
  gap: 18px;
}

.step-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.step-tab {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  padding: 10px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  white-space: nowrap;
}

.step-tab.is-active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.step-number {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--surface-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.step-tab.is-done .step-number,
.step-tab.is-active .step-number {
  background: var(--gold);
  color: #fff;
}

.tool-grid {
  display: grid;
  gap: 16px;
}

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

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

.tool-field label {
  display: block;
  margin-bottom: 7px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.tool-field input,
.tool-field select,
.tool-field textarea {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.tool-field textarea,
.drawer-note textarea,
.modal-field textarea {
  min-height: 110px;
  padding: 12px 14px;
  resize: vertical;
}

.tool-note {
  padding: 16px;
  border: 1px solid rgba(155, 125, 58, 0.2);
  background: rgba(155, 125, 58, 0.06);
}

.tool-note p {
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}

.tool-note__eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.tool-note__eyebrow svg {
  width: 14px;
  height: 14px;
}

.tool-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.tool-results-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.tool-result-card {
  padding: 0;
  overflow: hidden;
}

.tool-result-card__head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(155, 125, 58, 0.06);
}

.tool-result-card__head p {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.result-list {
  display: grid;
}

.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.result-row:last-child {
  border-bottom: 0;
}

.result-row strong,
.result-row span {
  display: block;
}

.result-row strong {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.result-row span {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--ink);
  text-align: right;
}

.result-row.is-highlight {
  background: rgba(155, 125, 58, 0.06);
}

.result-row.is-highlight span {
  color: var(--gold);
}

.tool-side-stack {
  display: grid;
  gap: 16px;
}

.hero-figure {
  padding: 20px;
  border: 1px solid rgba(155, 125, 58, 0.3);
  background: rgba(155, 125, 58, 0.06);
}

.hero-figure__eyebrow {
  margin: 0 0 10px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.hero-figure__value {
  margin: 0;
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 300;
}

.hero-figure__divider {
  width: 28px;
  height: 1px;
  margin: 14px 0;
  background: var(--gold);
}

.hero-figure__copy {
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}

.training-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.training-progress {
  display: grid;
  gap: 8px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--surface-strong);
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  background: var(--gold);
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.webinar-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(155, 125, 58, 0.24);
  background: rgba(155, 125, 58, 0.06);
}

.webinar-card.is-registered {
  border-color: rgba(16, 185, 129, 0.28);
  background: rgba(16, 185, 129, 0.08);
}

.webinar-card__icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(155, 125, 58, 0.22);
  background: rgba(155, 125, 58, 0.1);
  color: var(--gold);
  flex: 0 0 auto;
}

.webinar-card.is-registered .webinar-card__icon {
  border-color: rgba(16, 185, 129, 0.28);
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.webinar-card__copy {
  flex: 1;
}

.webinar-card__copy p {
  margin: 0;
}

.webinar-card__eyebrow {
  margin-bottom: 6px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.webinar-card.is-registered .webinar-card__eyebrow {
  color: #059669;
}

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

.module-card {
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.module-card__row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.module-card__status {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.module-card__copy {
  flex: 1;
}

.module-card__copy h4 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 400;
}

.module-card__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.module-card__meta span {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.module-card__required {
  padding: 4px 7px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.module-card__progress {
  width: 160px;
  max-width: 100%;
  margin-top: 10px;
}

.module-card__progress .progress-bar {
  height: 4px;
}

.module-card__progress p {
  margin: 7px 0 0;
  font-size: 11px;
  color: var(--gold);
}

.doc-accordion {
  display: grid;
  gap: 12px;
}

.doc-group {
  overflow: hidden;
}

.doc-group__button {
  width: 100%;
  padding: 16px 18px;
  border: 0;
  background: rgba(155, 125, 58, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}

.doc-group__button-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.doc-group__button svg {
  width: 16px;
  height: 16px;
  color: var(--gold);
}

.count-pill {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--surface);
  color: var(--muted);
}

.doc-group__items {
  display: none;
  border-top: 1px solid var(--line);
}

.doc-group.is-open .doc-group__items {
  display: block;
}

.doc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.doc-item:last-child {
  border-bottom: 0;
}

.doc-item__left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.doc-item__left svg {
  width: 14px;
  height: 14px;
  color: rgba(127, 116, 99, 0.45);
}

.doc-item__name {
  min-width: 0;
}

.doc-item__name strong {
  display: block;
  font-size: 14px;
  font-weight: 400;
}

.doc-item__meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.doc-item__meta span {
  font-size: 10px;
  color: var(--muted);
}

.tag-life { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.tag-di { background: #f5f3ff; border-color: #ddd6fe; color: #6d28d9; }
.tag-seg { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.tag-ci { background: #fff7ed; border-color: #fed7aa; color: #c2410c; }
.tag-estate { background: #f0fdfa; border-color: #99f6e4; color: #0f766e; }
.tag-compliance { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.tag-planning { background: #eef2ff; border-color: #c7d2fe; color: #4338ca; }
.tag-insurance { background: #fdf2f8; border-color: #fbcfe8; color: #be185d; }
.tag-marketing { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.tag-education { background: #f0f9ff; border-color: #bae6fd; color: #0369a1; }

.performance-chart {
  align-items: end;
  gap: 14px;
  height: 240px;
}

.performance-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.performance-bar__value,
.performance-bar__label {
  font-size: 10px;
}

.performance-bar__value {
  font-family: var(--font-display);
  color: rgba(155, 125, 58, 0.84);
}

.performance-bar__track {
  position: relative;
  width: 100%;
  height: 100%;
  background: rgba(155, 125, 58, 0.12);
}

.performance-bar__fill {
  position: absolute;
  inset: auto 0 0;
  background: var(--gold);
}

.performance-bar__label {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.performance-grid > * {
  flex: 1;
}

.mix-row,
.rank-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.mix-row:last-child,
.rank-row:last-child {
  border-bottom: 0;
}

.mix-row__label,
.rank-row__label {
  flex: 1;
  font-size: 14px;
  color: var(--muted);
}

.mix-row__track {
  width: 110px;
  height: 6px;
  background: rgba(155, 125, 58, 0.14);
}

.mix-row__track span {
  display: block;
  height: 100%;
  background: rgba(155, 125, 58, 0.74);
}

.mix-row__value,
.rank-row__value {
  font-family: var(--font-display);
  font-size: 18px;
}

.rank-row__index {
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--muted);
}

.rank-row__meta {
  font-size: 10px;
  color: var(--muted);
}

.advisor-mobile-nav {
  display: none;
}

.advisor-overlay {
  display: none;
}

.advisor-overlay.is-visible {
  display: block;
  position: fixed;
  inset: 58px 0 0;
  background: rgba(26, 24, 18, 0.32);
  backdrop-filter: blur(4px);
  z-index: 20;
}

.modal-shell {
  display: none;
}

.modal-shell.is-open {
  display: block;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(26, 24, 18, 0.32);
  backdrop-filter: blur(5px);
}

.drawer-panel,
.modal-panel {
  position: fixed;
  z-index: 51;
  background: var(--surface);
}

.drawer-panel {
  top: 0;
  right: 0;
  bottom: 0;
  width: min(100%, 430px);
  display: flex;
  flex-direction: column;
}

.drawer-panel__header,
.modal-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.drawer-panel__eyebrow {
  margin: 0 0 5px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.drawer-panel__sub,
.modal-copy {
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}

.drawer-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
  display: grid;
  gap: 18px;
}

.drawer-block {
  display: grid;
  gap: 12px;
}

.drawer-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.drawer-head h3,
.modal-panel__header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 300;
}

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

.drawer-divider {
  height: 1px;
  background: var(--line);
}

.drawer-stat {
  display: flex;
  align-items: start;
  gap: 12px;
}

.drawer-stat__icon {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  flex: 0 0 auto;
}

.drawer-stat__copy p,
.drawer-stat__copy span {
  margin: 0;
}

.drawer-stat__copy p {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.drawer-stat__copy span {
  display: block;
  margin-top: 6px;
  font-size: 14px;
}

.drawer-note label,
.modal-field label {
  display: block;
  margin-bottom: 7px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.drawer-note textarea,
.modal-field input {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(155, 125, 58, 0.04);
  color: var(--ink);
}

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

.modal-panel {
  top: 50%;
  left: 50%;
  width: min(100%, 720px);
  transform: translate(-50%, -50%);
}

.modal-panel--small {
  width: min(100%, 360px);
}

.modal-panel__body {
  padding: 22px;
}

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

.modal-field--full {
  grid-column: 1 / -1;
}

.modal-field input {
  height: 44px;
  padding: 0 14px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.modal-close {
  position: relative;
  width: 34px;
  height: 34px;
  padding: 0;
  flex: 0 0 auto;
}

.modal-close span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 1px;
  background: currentColor;
}

.modal-close span:first-child {
  transform: translate(-50%, -50%) rotate(45deg);
}

.modal-close span:last-child {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.toast-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  display: grid;
  gap: 10px;
}

.toast {
  min-width: 260px;
  max-width: 360px;
  padding: 14px 16px;
  display: flex;
  align-items: start;
  gap: 12px;
}

.toast svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.toast p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
}

.toast--success {
  border-color: rgba(16, 185, 129, 0.3);
  color: #047857;
}

.toast--error {
  border-color: rgba(239, 68, 68, 0.3);
  color: #b91c1c;
}

.toast--info {
  border-color: rgba(155, 125, 58, 0.26);
  color: var(--ink);
}

.fade-in {
  animation: fadeRise 0.22s ease;
}

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

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

  .pipeline-grid,
  .tool-results-grid,
  .performance-grid {
    display: grid;
  }

  .tool-results-grid,
  .performance-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .advisor-sidebar {
    transform: translateX(-100%);
    width: min(86vw, 290px);
  }

  .advisor-sidebar.is-visible {
    transform: translateX(0);
  }

  .advisor-content,
  .advisor-content.is-collapsed {
    margin-left: 0;
    padding: 22px 18px 90px;
  }

  .advisor-profile__meta,
  .advisor-signout span,
  .advisor-divider,
  .advisor-centre-label {
    display: none;
  }

  .advisor-mobile-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 35;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
  }

  .advisor-mobile-nav button {
    position: relative;
    min-height: 64px;
    border: 0;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--muted);
  }

  .advisor-mobile-nav button.is-active {
    color: var(--gold);
  }

  .advisor-mobile-nav button svg {
    width: 18px;
    height: 18px;
  }

  .advisor-mobile-nav button span {
    font-size: 8px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  .tab-badge {
    position: absolute;
    top: 10px;
    right: calc(50% - 18px);
    width: 8px;
    height: 8px;
    padding: 0;
    border-radius: 999px;
    background: #f59e0b;
  }

  .training-summary,
  .tool-grid.cols-3,
  .tool-grid.cols-2,
  .modal-grid,
  .drawer-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .portal-topbar {
    padding: 0 18px;
    height: 68px;
  }

  .portal-brand__logo {
    width: 40px;
    height: 40px;
  }

  .portal-brand__text {
    font-size: 15px;
  }

  .portal-backlink {
    display: none;
  }

  .portal-main {
    padding: 18px 14px 14px;
  }

  .login-panel {
    padding: 16px 20px 18px;
  }

  .login-panel__heading h1 {
    font-size: 40px;
  }

  .advisor-topbar {
    padding: 0 12px;
  }

  .advisor-brand__text {
    font-size: 18px;
  }

  .advisor-content,
  .advisor-content.is-collapsed {
    padding: 18px 12px 92px;
  }

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

  th,
  td {
    padding: 12px;
  }

  .tool-footer,
  .modal-actions {
    flex-direction: column;
  }

  .button,
  .button-lite,
  .button-chip,
  .search-chip {
    width: 100%;
  }

  .drawer-panel {
    width: 100%;
  }

  .toast-stack {
    left: 12px;
    right: 12px;
    bottom: 78px;
  }

  .toast {
    min-width: 0;
    max-width: none;
  }
}
