/* Shared product shell. This file owns the current customer and internal-workspace hierarchy. */
:root {
  --passport-navy: #101828;
  --global-teal: #00a6a6;
  --sunrise-coral: #ff6b4a;
  --cloud-white: #f8fafc;
  --pure-white: #ffffff;
  --charcoal: #111827;
  --slate: #475569;
  --mist-gray: #e2e8f0;
  --bg: var(--cloud-white);
  --panel: var(--pure-white);
  --panel-strong: var(--pure-white);
  --ink: var(--charcoal);
  --muted: var(--slate);
  --line: var(--mist-gray);
  --field: #f8fafc;
  --field-hover: #f1f5f9;
  --green: var(--global-teal);
  --blue: var(--passport-navy);
  --teal-soft: #e8f8f8;
  --blue-soft: #eef2f7;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
  --shadow-lg: 0 8px 20px rgba(16, 24, 40, 0.05);
  --radius: 8px;
  --surface-blue: #f3f6fa;
  --surface-blue-strong: #edf2f7;
  --surface-mint: #eefafa;
  --surface-amber: #fff6f2;
  --surface-neutral: #fbfcfd;
  --blue-line: #d8e0ea;
  --mint-line: #bde7e7;
  --amber-line: #ffd7cd;
}

/* Customer journey workspace ------------------------------------------------
   A task-first hierarchy for applicants: next action, applications, context. */
body[data-view="dashboard"][data-role="customer"] .task-panel__header {
  display: none;
}

body[data-view="dashboard"][data-role="customer"] .task-content {
  padding-top: 30px;
}

.customer-dashboard {
  display: grid;
  gap: 22px;
}

.customer-dashboard__intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 0 2px 8px;
}

.customer-dashboard__intro-copy {
  max-width: 720px;
}

.customer-dashboard__intro h2 {
  margin: 0;
  color: var(--passport-navy);
  font-size: clamp(1.75rem, 3vw, 2.3rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.customer-dashboard__intro .customer-dashboard__summary {
  max-width: 650px;
  margin-top: 10px;
  font-size: 0.94rem;
  line-height: 1.55;
}

.customer-dashboard__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 330px);
  align-items: start;
  gap: 22px;
}

.customer-dashboard__main,
.customer-dashboard__sidebar {
  display: grid;
  min-width: 0;
  gap: 18px;
}

.customer-dashboard__sidebar {
  position: sticky;
  top: 18px;
}

.customer-next-action {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border: 1px solid #c9d9ef;
  border-radius: 16px;
  padding: 20px;
  background: linear-gradient(135deg, #f3f7fc 0%, #fff 72%);
  box-shadow: 0 10px 28px rgba(25, 43, 68, 0.05);
}

.customer-next-action--complete {
  border-color: #b9e0d7;
  background: linear-gradient(135deg, #eefaf7 0%, #fff 72%);
}

.customer-next-action__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--passport-navy);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
}

.customer-next-action--complete .customer-next-action__icon {
  background: var(--global-teal);
}

.customer-next-action__copy h3,
.customer-next-action__copy p,
.customer-side-card h3,
.customer-side-card p,
.customer-save-note p {
  margin: 0;
}

.customer-next-action__copy h3 {
  margin: 2px 0 5px;
  color: var(--passport-navy);
  font-size: 1.08rem;
}

.customer-next-action__copy > p:last-child {
  color: var(--quiet-text);
  font-size: 0.82rem;
  line-height: 1.45;
}

.customer-next-action__label {
  color: var(--global-teal);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.customer-next-action__button {
  white-space: nowrap;
}

.customer-applications {
  display: grid;
  gap: 16px;
  border: 1px solid var(--quiet-line);
  border-radius: 16px;
  padding: 20px;
  background: #fff;
}

.customer-applications > .customer-dashboard-section__head {
  border-bottom: 1px solid var(--quiet-line);
  padding: 0 0 14px;
}

.customer-application-block {
  display: grid;
  gap: 9px;
}

.customer-application-block + .customer-application-block {
  border-top: 1px solid var(--quiet-line);
  padding-top: 16px;
}

.customer-application-block__title {
  margin: 0;
  color: var(--quiet-text);
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.customer-applications .application-group-card {
  border: 0;
  padding: 0;
}

.customer-applications .application-group-card__head {
  padding: 4px 2px 10px;
}

.customer-applications .application-group-members {
  border-radius: 12px;
}

.customer-applications .member-card,
.customer-applications .individual-application-card {
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.customer-applications .member-card:hover,
.customer-applications .individual-application-card:hover {
  border-color: #d5dee8;
  background: #fbfcfd;
}

.individual-application-card__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
}

.individual-application-card__avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--soft-navy);
  color: var(--passport-navy);
  font-size: 0.86rem;
  font-weight: 800;
}

.individual-application-card__identity {
  min-width: 0;
}

.individual-application-card__identity strong,
.individual-application-card__identity small {
  display: block;
  overflow-wrap: anywhere;
}

.individual-application-card__identity small {
  margin-top: 4px;
  color: var(--quiet-text);
  font-size: 0.76rem;
  line-height: 1.4;
}

.customer-side-card {
  display: grid;
  gap: 16px;
  border: 1px solid var(--quiet-line);
  border-radius: 16px;
  padding: 18px;
  background: #fff;
}

.customer-side-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.customer-side-card__head .kicker {
  margin-bottom: 4px;
}

.customer-side-card h3 {
  color: var(--passport-navy);
  font-size: 1rem;
}

.customer-progress-card__percent {
  color: var(--global-teal);
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
}

.customer-progress-card__track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9eef3;
}

.customer-progress-card__track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--global-teal);
  transition: width 220ms ease;
}

.customer-progress-card__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--quiet-line);
  padding-top: 14px;
}

.customer-progress-card__facts > div {
  display: flex;
  flex-direction: column-reverse;
  gap: 3px;
}

.customer-progress-card__facts > div + div {
  border-left: 1px solid var(--quiet-line);
  padding-left: 16px;
}

.customer-progress-card__facts dt {
  color: var(--quiet-text);
  font-size: 0.7rem;
}

.customer-progress-card__facts dd {
  margin: 0;
  color: var(--passport-navy);
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
}

.customer-case-summary {
  align-items: stretch;
  border: 1px solid var(--quiet-line);
  border-radius: 16px;
  padding: 18px;
  background: #fff;
}

.customer-case-summary__message {
  color: var(--quiet-text);
  font-size: 0.78rem;
  line-height: 1.5;
}

.customer-case-summary .customer-case-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  border-top: 1px solid var(--quiet-line);
  padding-top: 13px;
}

.customer-save-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  padding: 3px 4px;
  color: var(--quiet-text);
}

.customer-save-note__icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--global-teal);
  font-size: 0.7rem;
  font-weight: 900;
}

.customer-save-note strong {
  color: var(--passport-navy);
  font-size: 0.77rem;
}

.customer-save-note p {
  margin-top: 2px;
  font-size: 0.7rem;
  line-height: 1.45;
}

.customer-dashboard-empty {
  display: flex;
  min-height: 260px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border-radius: 16px;
  padding: 38px;
}

@media (max-width: 960px) {
  .customer-dashboard__layout {
    grid-template-columns: 1fr;
  }

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

  .customer-save-note {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  body[data-view="dashboard"][data-role="customer"] .task-content {
    padding-top: 22px;
  }

  .customer-dashboard__intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }

  .customer-dashboard__intro h2 {
    font-size: 1.75rem;
  }

  .customer-next-action {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .customer-next-action__button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .customer-dashboard__sidebar {
    grid-template-columns: 1fr;
  }

  .customer-save-note {
    grid-column: auto;
  }

  .customer-applications,
  .customer-side-card {
    padding: 16px;
  }

  .individual-application-card {
    grid-template-columns: 1fr;
  }

  .individual-application-card__actions {
    padding: 0 14px 14px;
  }

  .customer-dashboard-empty {
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
    padding: 26px;
  }
}

@media (max-width: 480px) {
  .customer-dashboard__actions,
  .customer-dashboard__actions button,
  .member-card__actions,
  .member-card__actions button,
  .individual-application-card__actions,
  .individual-application-card__actions button {
    width: 100%;
  }

  .customer-dashboard__actions,
  .member-card__actions,
  .individual-application-card__actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .customer-next-action {
    align-items: start;
    padding: 16px;
  }

  .individual-application-card__head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .individual-application-card__head .status-pill {
    grid-column: 2;
    justify-self: start;
  }
}

body {
  background: var(--bg);
}

.app-shell {
  width: min(1320px, calc(100% - 32px));
  padding: 18px 0 36px;
}

.brand-strip {
  display: block;
  height: clamp(170px, 17vw, 220px);
  border-color: #d8e1ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.brand-strip__banner {
  object-position: 50% 29%;
}

body[data-view="form"] .brand-strip,
body[data-role="admin"] .brand-strip {
  display: none;
}

.topbar {
  min-height: 76px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.topbar__logo {
  width: 46px;
  height: 46px;
  padding: 4px;
  border-radius: 8px;
  box-shadow: none;
}

.topbar h1 {
  font-size: 1.55rem;
}

.eyebrow,
.kicker {
  margin-bottom: 3px;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
}

.account-bar {
  gap: 10px;
}

.account-bar__details strong {
  font-size: 0.86rem;
}

.topbar__status {
  min-width: 64px;
  height: 36px;
  border-radius: 8px;
  box-shadow: none;
}

.workspace {
  display: block;
}

.task-panel,
.task-panel--wide,
.task-panel--single,
.task-panel--dashboard {
  width: 100%;
  min-height: 0;
  max-height: none;
  overflow: visible;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
}

body[data-view="form"] .task-panel {
  max-width: 1080px;
  margin: 0 auto;
}

body[data-view="dashboard"] .task-panel {
  max-width: 1240px;
  margin: 0 auto;
}

body[data-view="single"] .task-panel {
  max-width: 560px;
}

.task-panel__header {
  padding: 22px 28px 18px;
  border-top: 3px solid #b7d7fb;
  background: var(--surface-blue);
}

body[data-role="admin"] .task-panel__header {
  border-top-color: #a8ddcf;
  background: #f4fbf8;
}

.task-panel__header h2 {
  font-size: 1.42rem;
}

.task-content {
  padding: 28px;
}

.progress-strip {
  top: 0;
  margin: 0 0 16px;
  padding: 10px 0 12px;
  background: rgba(246, 248, 251, 0.96);
}

.progress-strip__track {
  height: 6px;
  border-radius: 999px;
  background: #e7edf4;
}

.progress-strip__track span {
  background: var(--blue);
}

.section-pill {
  border-radius: 999px;
  padding: 7px 11px;
  background: #fff;
}

.section-pill.is-complete {
  background: var(--blue-soft);
}

.question-copy {
  max-width: 760px;
  margin: 0 0 22px;
  font-size: 0.96rem;
}

.form-field input,
.form-field select,
.form-field textarea {
  border-radius: 8px;
  background: var(--field);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--blue);
}

.primary-button,
.secondary-button,
.ghost-button,
.add-button,
.inline-detail-button {
  min-height: 40px;
  border-radius: 8px;
  box-shadow: none;
}

.primary-button:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
  background: #183153;
}

.action-row {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.applicant-section {
  max-width: 980px;
  margin: 0 auto;
}

.applicant-section__title {
  margin: 0 0 18px;
  color: var(--blue);
}

.group-applicant-nav {
  border-radius: 8px;
  background: #fff;
}

/* Customer dashboard */
.customer-dashboard {
  display: grid;
  gap: 24px;
}

.customer-case-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid #cfe8df;
  border-radius: 8px;
  background: #f5fbf8;
  box-shadow: none;
}

.customer-case-summary__copy {
  display: grid;
  gap: 2px;
}

.customer-case-summary__label {
  color: var(--green);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.customer-case-summary__copy small {
  color: var(--muted);
}

.customer-dashboard__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding: 18px;
  border: 1px solid var(--blue-line);
  border-radius: 8px;
  background: var(--surface-blue);
}

.customer-dashboard__title h3,
.customer-dashboard-section__head h3 {
  margin: 0;
}

.customer-dashboard__summary {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.customer-dashboard__actions,
.member-card__actions,
.individual-application-card__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.customer-dashboard__metrics {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.customer-metric:nth-child(1) {
  background: var(--surface-blue);
}

.customer-metric:nth-child(2) {
  background: var(--surface-amber);
}

.customer-metric:nth-child(3) {
  background: var(--surface-mint);
}

.customer-metric {
  display: grid;
  gap: 3px;
  min-height: 72px;
  padding: 13px 16px;
  border-right: 1px solid var(--line);
}

.customer-metric:last-child {
  border-right: 0;
}

.customer-metric strong {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
}

.customer-metric span,
.customer-dashboard-section__head > span {
  color: var(--muted);
  font-size: 0.8rem;
}

.customer-dashboard-section {
  display: grid;
  gap: 10px;
}

.customer-dashboard-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.application-group-list,
.application-list--individual {
  display: grid;
  gap: 12px;
}

.application-group-card,
.individual-application-card,
.customer-dashboard-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.application-group-card {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.application-group-card__head,
.individual-application-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
}

.application-group-card__head {
  padding: 0 0 6px;
}

.individual-application-card {
  border-color: var(--mint-line);
}

.individual-application-card__head {
  background: var(--surface-mint);
}

.application-group-card__head strong,
.individual-application-card__head strong {
  display: block;
}

.application-group-card__head small,
.individual-application-card__head small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.application-group-members {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 12px;
}

.member-card {
  display: flex;
  min-width: 0;
  min-height: 154px;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.member-card--submitted {
  border-color: var(--mint-line);
  background: #fbfefd;
}

.member-card--in-progress {
  border-color: var(--blue-line);
  background: #fcfdff;
}

.member-card:hover {
  border-color: #aabedc;
}

.member-card__head,
.member-card__identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 11px;
}

.member-card__head {
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.member-card__identity > div {
  min-width: 0;
}

.member-card__identity strong,
.member-card__identity small {
  display: block;
  overflow-wrap: anywhere;
}

.member-card__identity small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
}

.member-card__number {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: #1f5fae;
  font-size: 0.78rem;
  font-weight: 800;
}

.member-card__action {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.8rem;
}

.member-card__share {
  color: var(--green);
}

.individual-application-card__actions {
  padding: 0 16px 16px;
}

.customer-dashboard-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
}

.customer-dashboard-empty h3,
.customer-dashboard-empty p {
  margin: 0;
}

.customer-dashboard-empty p:not(.kicker) {
  margin-top: 6px;
  color: var(--muted);
}

/* Internal workspace */
.crm-admin,
.crm-stack {
  gap: 20px;
}

.crm-toolbar {
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--blue-line);
  border-radius: 8px;
  background: var(--surface-blue);
}

.crm-tabs {
  gap: 4px;
}

.crm-tab {
  min-height: 36px;
  border-radius: 999px;
  padding: 7px 13px;
}

.admin-stats {
  gap: 10px;
}

.metric-tile {
  min-height: 78px;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

.admin-stats .metric-tile:nth-child(1) {
  border-color: var(--blue-line);
  background: var(--surface-blue);
}

.admin-stats .metric-tile:nth-child(2) {
  border-color: var(--amber-line);
  background: var(--surface-amber);
}

.admin-stats .metric-tile:nth-child(3) {
  border-color: var(--mint-line);
  background: var(--surface-mint);
}

.admin-stats .metric-tile:nth-child(4) {
  border-color: #d9e2ec;
  background: var(--surface-neutral);
}

.crm-section-head {
  align-items: center;
}

.crm-section-head h3 {
  font-size: 1.15rem;
}

.crm-split {
  grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
  gap: 18px;
}

.admin-inbox,
.crm-detail {
  border-radius: 8px;
  box-shadow: none;
}

.admin-inbox {
  top: 16px;
  border-color: var(--blue-line);
  background: var(--surface-neutral);
}

.admin-inbox__header {
  padding: 15px;
  background: var(--surface-blue);
}

.admin-inbox-item {
  padding: 13px 15px;
}

.admin-inbox-item:nth-child(even) {
  background: #fbfcfe;
}

.admin-inbox-item--active {
  background: var(--surface-mint);
  box-shadow: none;
}

.crm-inbox-item--active {
  box-shadow: none;
}

.crm-detail {
  gap: 18px;
  padding: 20px;
  border-color: var(--blue-line);
  background: #fbfdff;
}

.crm-detail > .crm-card,
.crm-detail > .crm-invite-box {
  gap: 10px;
  padding: 18px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.crm-form {
  gap: 14px;
}

.crm-form-actions {
  margin-top: 4px;
}

.crm-mini-row,
.crm-timeline-item {
  border-radius: 8px;
}

.operations-review-screen {
  max-width: 1220px;
  margin: 0 auto;
  background: #f9fcff;
}

.operations-review-workspace {
  grid-template-columns: minmax(172px, 220px) minmax(0, 1fr);
  gap: 20px;
}

.operations-applicant-rail {
  top: 16px;
  border-radius: 8px;
  border-color: var(--blue-line);
  background: var(--surface-blue);
  box-shadow: none;
}

.operations-review-main {
  max-width: 920px;
}

.operations-review-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--blue-line);
  border-radius: 8px;
  background: var(--surface-blue-strong);
}

.operations-review-context > div {
  display: grid;
  gap: 3px;
}

.operations-review-context__label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.operations-detail-panel .submitted-review-card {
  border-radius: 8px;
  border-color: var(--blue-line);
  background: #fff;
}

.operations-detail-panel .submitted-review-card__header {
  margin: -16px -16px 0;
  padding: 16px;
  border-bottom-color: var(--blue-line);
  border-radius: 7px 7px 0 0;
  background: #f7fbff;
}

.submitted-review-section {
  --review-surface: var(--surface-neutral);
  --review-line: #dce5ef;
  --review-title: #405a78;
  display: grid;
  gap: 8px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line);
}

.submitted-review-section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.submitted-review-section h4 {
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--review-surface);
  color: var(--review-title);
}

.submitted-review-section--identity {
  --review-surface: #f4f7fb;
  --review-line: #dce5ef;
  --review-title: #405a78;
}

.submitted-review-section--history,
.submitted-review-section--travel {
  --review-surface: #edf5ff;
  --review-line: #cbdff7;
  --review-title: #245f9f;
}

.submitted-review-section--contact,
.submitted-review-section--family,
.submitted-review-section--appointment {
  --review-surface: #eef9f5;
  --review-line: #c8e7dc;
  --review-title: #087358;
}

.submitted-review-section--work {
  --review-surface: #fff8ec;
  --review-line: #f0dfba;
  --review-title: #86570f;
}

.submitted-review-row {
  gap: 0;
  overflow: hidden;
  padding: 0;
  border-color: var(--review-line);
  background: #fff;
}

.submitted-review-row dt,
.submitted-review-row dd {
  display: flex;
  align-items: center;
  min-height: 50px;
  padding: 10px 12px;
}

.submitted-review-row dt {
  border-right: 1px solid var(--review-line);
  background: var(--review-surface);
  color: var(--review-title);
}

.submitted-review-row dd {
  background: #fff;
}

.admin-attention {
  --review-surface: transparent;
  --review-title: #7a3f0e;
  padding: 12px;
  border-bottom: 1px solid rgba(196, 92, 25, 0.24);
}

.admin-attention h4 {
  padding: 0;
  background: transparent;
}

.operations-document-panel--centered {
  max-width: 920px;
  border-radius: 8px;
}

.operations-document-panel--centered .upload-preview {
  min-height: 500px;
}

.upload-preview--pdf-rendered {
  display: block;
  min-height: 500px;
  padding: 0;
  background: #eef2f6;
}

.upload-preview__pdf-frame {
  display: block;
  width: 100%;
  height: clamp(500px, 68vh, 760px);
  border: 0;
  border-radius: inherit;
  background: #fff;
}

.action-progress {
  position: sticky;
  top: 10px;
  z-index: 4;
}

/* Status colours are intentionally semantic, not decorative. */
.status-pill--new,
.status-pill--data-collection-sent {
  border-color: #c8dcf8;
  background: #eef5ff;
  color: #285f9f;
}

.status-pill--discussion,
.status-pill--form-filling,
.status-pill--customer-review {
  border-color: #c8dcf8;
  background: var(--surface-blue);
  color: #285f9f;
}

.status-pill--follow-up,
.status-pill--data-in-progress,
.status-pill--form-review {
  border-color: var(--amber-line);
  background: var(--surface-amber);
  color: #8a5a10;
}

.status-pill--won,
.status-pill--data-submitted,
.status-pill--form-submitted,
.status-pill--fee-paid,
.status-pill--appointment-booked {
  border-color: var(--mint-line);
  background: var(--surface-mint);
  color: #087358;
}

.status-pill--lost,
.status-pill--closed {
  border-color: #d9e2ec;
  background: #f4f6f8;
  color: #637386;
}

/* Centered document reviewer */
.document-review-dialog {
  width: min(1180px, calc(100vw - 32px));
  max-width: none;
  max-height: min(900px, calc(100vh - 32px));
  margin: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0;
  background: #fff;
  box-shadow: 0 24px 72px rgba(16, 33, 58, 0.28);
}

.document-review-dialog::backdrop {
  background: rgba(15, 30, 50, 0.48);
}

.document-review-dialog__body {
  display: grid;
  gap: 16px;
  max-height: min(900px, calc(100vh - 32px));
  overflow: auto;
  padding: 20px;
}

.document-review-dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.document-review-dialog__head h3,
.document-review-dialog__head p {
  margin: 0;
}

.document-review-dialog__head p {
  margin-top: 5px;
  color: var(--muted);
}

.document-review-dialog .review-upload-list {
  gap: 18px;
}

.document-review-dialog .review-upload-card {
  border-radius: 8px;
}

.document-review-dialog .upload-preview {
  min-height: 520px;
  background: #f6f8fb;
}

@media (min-width: 920px) {
  .workspace,
  .task-panel,
  .profile-panel {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 1320px);
    padding-top: 10px;
  }

  .brand-strip {
    height: 132px;
  }

  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .account-bar {
    flex: 1 0 100%;
  }

  .task-panel__header,
  .task-content {
    padding: 18px;
  }

  .customer-dashboard__header,
  .customer-dashboard-empty,
  .customer-case-summary,
  .application-group-card__head,
  .individual-application-card__head,
  .member-card__head,
  .document-review-dialog__head {
    grid-template-columns: 1fr;
    align-items: stretch;
    flex-direction: column;
  }

  .customer-dashboard__actions,
  .member-card__actions,
  .individual-application-card__actions {
    justify-content: stretch;
  }

  .customer-dashboard__actions > button,
  .member-card__actions > button,
  .individual-application-card__actions > button {
    flex: 1 1 auto;
  }

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

  .customer-metric {
    min-height: 62px;
    padding: 12px 10px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .customer-metric:last-child {
    border-right: 0;
  }

  .customer-metric strong {
    font-size: 1.16rem;
  }

  .customer-metric span {
    font-size: 0.72rem;
  }

  .member-card__head .status-pill {
    align-self: flex-start;
  }

  .application-group-card__head .status-pill {
    align-self: flex-start;
  }

  .crm-split,
  .operations-review-workspace,
  .crm-form {
    grid-template-columns: 1fr;
  }

  .crm-detail,
  .operations-review-screen {
    padding: 16px;
  }

  .operations-review-context {
    align-items: stretch;
    flex-direction: column;
  }

  .document-review-dialog {
    width: min(100vw - 16px, 1180px);
    max-height: calc(100vh - 16px);
  }

  .document-review-dialog__body {
    max-height: calc(100vh - 16px);
    padding: 16px;
  }

  .document-review-dialog .upload-preview {
    min-height: 280px;
  }

  .upload-preview--pdf-rendered {
    min-height: 360px;
  }

  .upload-preview__pdf-frame {
    height: 60vh;
    min-height: 360px;
  }

  .submitted-review-row dt,
  .submitted-review-row dd {
    min-height: 44px;
    padding: 9px 10px;
  }

  .submitted-review-row dt {
    border-right: 0;
    border-bottom: 1px solid var(--review-line);
  }
}

/* Four-stage admin case workflow ------------------------------------------ */
body[data-role="admin"] {
  background:
    radial-gradient(circle at 8% 0%, rgba(29, 78, 216, 0.06), transparent 27rem),
    #f4f7fb;
}

body[data-role="admin"] .task-panel {
  max-width: 1380px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body[data-role="admin"] .task-panel__header {
  padding: 18px 24px;
  border: 1px solid #e5eaf1;
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  background: rgba(255, 255, 255, 0.88);
}

body[data-role="admin"] .task-content {
  padding: 0 24px 32px;
  border: 1px solid #e5eaf1;
  border-top: 0;
  border-radius: 0 0 18px 18px;
  background: rgba(255, 255, 255, 0.72);
}

.crm-admin {
  display: grid;
  gap: 18px;
}

.crm-workflow-header {
  display: grid;
  gap: 22px;
  padding: 22px 0 0;
}

.crm-workflow-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 0 4px;
}

.crm-workflow-title h2,
.crm-workflow-title p {
  margin: 0;
}

.crm-workflow-title h2 {
  color: #101828;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  letter-spacing: -0.025em;
}

.crm-workflow-title p:not(.kicker) {
  margin-top: 4px;
  color: #667085;
  font-size: 0.82rem;
}

.crm-stage-nav {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 6px;
  border: 1px solid #dfe5ee;
  border-radius: 18px;
  background: #edf1f6;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
}

.crm-stage-tab {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  border: 0;
  border-radius: 13px;
  padding: 9px 12px;
  background: transparent;
  color: #667085;
  text-align: left;
  transition: background 160ms ease, box-shadow 160ms ease, color 160ms ease, transform 160ms ease;
}

.crm-stage-tab:hover {
  background: rgba(255, 255, 255, 0.6);
  color: #344054;
}

.crm-stage-tab--active,
.crm-stage-tab[aria-selected="true"] {
  background: #fff;
  color: #101828;
  box-shadow: 0 3px 12px rgba(16, 24, 40, 0.11);
}

.crm-stage-tab--active::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: -7px;
  left: 14px;
  height: 3px;
  border-radius: 999px;
  background: #0f766e;
}

.crm-stage-tab__step {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid #d0d5dd;
  border-radius: 9px;
  background: #f8fafc;
  color: #667085;
  font-size: 0.68rem;
  font-weight: 800;
}

.crm-stage-tab--active .crm-stage-tab__step {
  border-color: #99f6e4;
  background: #ecfdf5;
  color: #0f766e;
}

.crm-stage-tab__copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.crm-stage-tab__copy strong {
  overflow: hidden;
  font-size: 0.8rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-stage-tab__copy small {
  overflow: hidden;
  color: #98a2b3;
  font-size: 0.67rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-stage-tab__count {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  padding: 0 6px;
  background: #e4e7ec;
  color: #475467;
  font-size: 0.68rem;
  font-weight: 850;
}

.crm-stage-tab--active .crm-stage-tab__count {
  background: #101828;
  color: #fff;
}

.crm-admin .admin-stats {
  gap: 10px;
  overflow: visible;
  border: 0;
  background: transparent;
}

.crm-admin .admin-stats .metric-tile,
.crm-admin .admin-stats .metric-tile:nth-child(n) {
  min-height: 76px;
  border: 1px solid #e4e9f0;
  border-radius: 13px;
  padding: 14px 16px;
  background: #fff;
  box-shadow: 0 2px 7px rgba(16, 24, 40, 0.035);
}

.crm-admin .admin-stats .metric-tile strong {
  color: #101828;
  font-size: 1.45rem;
}

.crm-admin .crm-split {
  grid-template-columns: minmax(280px, 330px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.crm-admin .admin-inbox,
.crm-admin .crm-detail {
  overflow: hidden;
  border: 1px solid #e1e7ef;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(16, 24, 40, 0.05);
}

.crm-admin .admin-inbox {
  position: sticky;
  top: 14px;
  max-height: calc(100vh - 30px);
}

.crm-admin .admin-inbox__header {
  padding: 16px;
  border-bottom: 1px solid #eaecf0;
  background: #fbfcfe;
}

.crm-admin .admin-inbox__header > strong {
  color: #344054;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.045em;
}

.crm-admin .admin-search {
  min-height: 40px;
  border-color: #dfe4eb;
  border-radius: 10px;
  background: #fff;
}

.crm-admin .admin-inbox-list {
  overflow-y: auto;
}

.crm-admin .crm-inbox-item {
  min-height: 86px;
  padding: 14px 16px;
  border-bottom: 1px solid #edf0f4;
  background: #fff;
}

.crm-admin .crm-inbox-item:hover {
  background: #f8fafc;
}

.crm-admin .crm-inbox-item--active {
  background: #f0fdfa;
  box-shadow: inset 4px 0 0 #0f766e;
}

.workflow-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  padding: 3px 8px;
  background: #f9fafb;
  color: #475467;
  font-size: 0.65rem;
  font-weight: 800;
  white-space: nowrap;
}

.workflow-pill--operations {
  border-color: #99f6e4;
  background: #f0fdfa;
  color: #0f766e;
}

.workflow-pill--form_filled {
  border-color: #c7d7fe;
  background: #eef4ff;
  color: #3538cd;
}

.workflow-pill--scheduled {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.crm-admin .crm-detail {
  gap: 18px;
  min-height: 540px;
  padding: 22px;
}

.crm-detail--empty {
  display: grid;
  place-items: center;
}

.crm-empty-illustration {
  display: grid;
  place-items: center;
  max-width: 330px;
  gap: 7px;
  padding: 40px;
  color: #667085;
  text-align: center;
}

.crm-empty-illustration > span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 5px;
  border-radius: 14px;
  background: #eef2f6;
  color: #344054;
  font-size: 1.3rem;
}

.crm-empty-illustration strong,
.crm-empty-illustration p {
  margin: 0;
}

.crm-empty-illustration strong {
  color: #344054;
}

.crm-empty-illustration p {
  font-size: 0.8rem;
  line-height: 1.5;
}

.crm-detail-head--workspace {
  align-items: flex-start;
  padding-bottom: 17px;
}

.crm-detail-head--workspace h3,
.crm-detail-head--workspace p {
  margin: 0;
}

.crm-detail-head--workspace h3 {
  margin-top: 5px;
  font-size: 1.38rem;
  letter-spacing: -0.02em;
}

.crm-detail-head--workspace p {
  margin-top: 4px;
  color: #667085;
  font-size: 0.8rem;
}

.crm-stage-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #0f766e;
  font-size: 0.67rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.crm-guidance-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  border: 1px solid #d6e4ff;
  border-radius: 13px;
  padding: 15px;
  background: #f5f8ff;
}

.crm-guidance-note--ready {
  border-color: #b7e4d7;
  background: #f1fbf7;
}

.crm-guidance-note--warning {
  border-color: #fedf89;
  background: #fffaeb;
}

.crm-guidance-note__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #dbe7ff;
  color: #1d4ed8;
  font-size: 0.82rem;
  font-weight: 900;
}

.crm-guidance-note--ready .crm-guidance-note__icon {
  background: #d1fae5;
  color: #047857;
}

.crm-guidance-note--warning .crm-guidance-note__icon {
  background: #fef0c7;
  color: #b54708;
}

.crm-guidance-note strong,
.crm-guidance-note p {
  margin: 0;
}

.crm-guidance-note strong {
  color: #344054;
  font-size: 0.84rem;
}

.crm-guidance-note p {
  margin-top: 3px;
  color: #667085;
  font-size: 0.76rem;
  line-height: 1.45;
}

.crm-guidance-note__actions,
.crm-primary-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.crm-primary-actions {
  padding-bottom: 2px;
}

.crm-primary-actions .danger-button {
  margin-left: auto;
}

.crm-admin .danger-button {
  min-height: 40px;
  border: 1px solid #fecdca;
  border-radius: 8px;
  padding: 9px 12px;
  background: #fff;
  color: #b42318;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 750;
  cursor: pointer;
}

.crm-admin .danger-button:hover:not(:disabled) {
  background: #fff5f4;
}

.crm-card-head {
  align-items: flex-start;
}

.crm-card-head p {
  margin: 4px 0 0;
  color: #667085;
  font-size: 0.76rem;
  line-height: 1.45;
}

.crm-card-meta {
  color: #667085;
  font-size: 0.72rem;
  font-weight: 750;
}

.crm-checklist {
  display: grid;
  gap: 0;
  margin-top: 8px;
}

.crm-checklist__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid #edf0f4;
}

.crm-checklist__item:last-child {
  border-bottom: 0;
}

.crm-checklist__mark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid #d0d5dd;
  border-radius: 7px;
  color: #fff;
  font-size: 0.7rem;
}

.crm-checklist__item.is-complete .crm-checklist__mark {
  border-color: #0f766e;
  background: #0f766e;
}

.crm-checklist__item > span:last-child {
  display: grid;
  gap: 2px;
}

.crm-checklist__item strong {
  color: #344054;
  font-size: 0.78rem;
}

.crm-checklist__item small {
  color: #98a2b3;
  font-size: 0.7rem;
}

.crm-admin .crm-promotion-form {
  padding: 18px;
  border: 1px solid #bfd5ff;
  border-radius: 14px;
  background: #f6f9ff;
}

.crm-admin .crm-promotion-form__fields {
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  margin-top: 15px;
}

.crm-admin .crm-promotion-form__fields > .primary-button {
  grid-column: 1 / -1;
  justify-self: end;
}

.crm-booking-form {
  overflow: hidden;
  min-height: max-content;
  padding: 0 !important;
  border: 1px solid #c7d7fe !important;
  border-radius: 14px;
  background: #fff;
}

.crm-booking-form > .crm-card-head {
  padding: 18px;
  border-bottom: 1px solid #dbe5ff;
  background: #f5f8ff;
}

.crm-booking-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.crm-booking-form__grid .crm-field-wide {
  grid-column: 1 / -1;
}

.crm-booking-form__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  border-top: 1px solid #eaecf0;
  background: #fbfcfe;
}

.crm-booking-form__footer small {
  max-width: 470px;
  color: #667085;
  font-size: 0.72rem;
  line-height: 1.4;
}

.crm-date-windows,
.crm-scheduled-hero {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.crm-date-window {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e4e7ec;
  border-radius: 11px;
  background: #f9fafb;
}

.crm-date-window__icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #e8efff;
  color: #3538cd;
  font-size: 0.75rem;
  font-weight: 900;
}

.crm-date-window > span:last-child {
  display: grid;
  gap: 3px;
}

.crm-date-window small {
  color: #667085;
  font-size: 0.68rem;
}

.crm-date-window strong {
  color: #344054;
  font-size: 0.78rem;
}

.crm-appointment-date {
  display: grid;
  gap: 6px;
  min-height: 130px;
  align-content: center;
  padding: 20px;
  border: 1px solid #b7e4d7;
  border-radius: 14px;
  background: linear-gradient(145deg, #f1fbf7, #fff);
}

.crm-appointment-date small {
  color: #047857;
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.crm-appointment-date strong {
  color: #101828;
  font-size: 1.05rem;
}

.crm-appointment-date span {
  color: #667085;
  font-size: 0.78rem;
}

.crm-dialog--wide {
  width: min(760px, 100%);
}

.crm-dialog--wide > .crm-form {
  padding: 22px;
}

.crm-confirm-visual {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  padding: 16px;
  border: 1px solid #dfe5ee;
  border-radius: 12px;
  background: #f8fafc;
}

.crm-confirm-visual__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: #d1fae5;
  color: #047857;
  font-size: 1.1rem;
  font-weight: 900;
}

.crm-confirm-visual strong,
.crm-confirm-visual p {
  margin: 0;
}

.crm-confirm-visual strong {
  color: #344054;
  font-size: 0.86rem;
}

.crm-confirm-visual p {
  margin-top: 3px;
  color: #667085;
  font-size: 0.75rem;
  line-height: 1.45;
}

.crm-toggle-field.is-disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

@media (max-width: 980px) {
  .crm-stage-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .crm-stage-tab--active::after {
    display: none;
  }

  .crm-admin .crm-split {
    grid-template-columns: minmax(240px, 290px) minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  body[data-role="admin"] .task-panel__header {
    border-radius: 14px 14px 0 0;
  }

  body[data-role="admin"] .task-content {
    padding: 0 14px 24px;
    border-radius: 0 0 14px 14px;
  }

  .crm-workflow-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .crm-workflow-title .crm-toolbar__actions {
    align-self: stretch;
    justify-content: flex-end;
  }

  .crm-admin .crm-split {
    grid-template-columns: 1fr;
  }

  .crm-admin .admin-inbox {
    position: static;
    max-height: 430px;
  }

  .crm-admin .crm-detail {
    min-height: 0;
  }

  .crm-guidance-note {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .crm-guidance-note__actions,
  .crm-guidance-note > .primary-button {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .crm-admin .crm-promotion-form__fields,
  .crm-booking-form__grid,
  .crm-date-windows,
  .crm-scheduled-hero {
    grid-template-columns: 1fr;
  }

  .crm-booking-form__footer {
    align-items: stretch;
    flex-direction: column;
  }

  .crm-booking-form__footer .primary-button {
    width: 100%;
  }
}

@media (max-width: 500px) {
  .crm-stage-nav {
    gap: 4px;
    padding: 4px;
  }

  .crm-stage-tab {
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 58px;
    gap: 7px;
    padding: 7px;
  }

  .crm-stage-tab__step {
    width: 26px;
    height: 26px;
  }

  .crm-stage-tab__count,
  .crm-stage-tab__copy small {
    display: none;
  }

  .crm-stage-tab__copy strong {
    font-size: 0.7rem;
    white-space: normal;
  }

  .crm-admin .crm-detail {
    padding: 16px;
  }

  .crm-primary-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .crm-primary-actions > button,
  .crm-primary-actions .danger-button {
    width: 100%;
    margin-left: 0;
  }
}

/* Deliberately quiet product theme: structure first, colour only for state. */
.task-panel,
.task-panel--wide,
.task-panel--single,
.task-panel--dashboard {
  box-shadow: var(--shadow);
}

.task-panel__header,
body[data-role="admin"] .task-panel__header {
  border-top: 0;
  border-bottom: 1px solid var(--line);
  background: var(--pure-white);
}

.primary-button {
  background: var(--passport-navy);
}

.primary-button:hover:not(:disabled) {
  background: #273449;
}

.secondary-button,
.ghost-button {
  border-color: var(--mist-gray);
}

.secondary-button:hover:not(:disabled),
.ghost-button:hover:not(:disabled) {
  border-color: #b9c6d5;
  background: var(--cloud-white);
}

.customer-dashboard {
  gap: 20px;
}

.customer-case-summary {
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.customer-case-summary__label,
.kicker {
  color: var(--global-teal);
}

.customer-dashboard__header {
  gap: 14px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.customer-dashboard__metrics {
  border-color: var(--mist-gray);
}

.customer-metric,
.customer-metric:nth-child(1),
.customer-metric:nth-child(2),
.customer-metric:nth-child(3) {
  min-height: 64px;
  background: var(--pure-white);
}

.customer-metric:nth-child(2) strong {
  color: var(--sunrise-coral);
}

.customer-metric:nth-child(3) strong {
  color: var(--global-teal);
}

.customer-dashboard-section {
  gap: 12px;
}

.application-group-list {
  gap: 20px;
}

.application-group-list + * {
  margin-top: 0;
}

.application-group-card__head strong {
  color: var(--passport-navy);
}

.member-card {
  min-height: 144px;
  background: var(--pure-white);
}

.member-card--submitted,
.member-card--in-progress {
  background: var(--pure-white);
}

.member-card--submitted {
  border-color: var(--mint-line);
}

.member-card--in-progress {
  border-color: var(--mist-gray);
}

.member-card__number {
  background: var(--surface-blue);
  color: var(--passport-navy);
}

.member-card__share {
  color: var(--global-teal);
}

/* Desktop workspaces behave like a two-pane internal tool: the queue and
   the case detail have separate, contained scrolling regions. */
body[data-role="admin"] {
  scrollbar-color: #b8c4d2 var(--cloud-white);
}

@media (min-width: 920px) {
  body[data-role="admin"] .crm-split {
    height: clamp(520px, 70dvh, 760px);
    align-items: stretch;
  }

  body[data-role="admin"] .admin-inbox,
  body[data-role="admin"] .crm-detail {
    position: relative;
    align-self: stretch;
    min-height: 0;
    max-height: none;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
  }

  body[data-role="admin"] .admin-inbox {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  body[data-role="admin"] .admin-inbox-list {
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
  }

  body[data-role="admin"] .crm-detail {
    align-content: start;
    grid-auto-rows: max-content;
    overflow-y: auto;
  }
}

.crm-toolbar {
  padding: 0 0 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.crm-tab {
  border-radius: 6px;
}

.crm-tab.is-active,
.crm-tab[aria-selected="true"] {
  border-color: var(--passport-navy);
  background: var(--passport-navy);
  color: var(--pure-white);
}

.admin-stats .metric-tile,
.admin-stats .metric-tile:nth-child(n) {
  border-color: var(--mist-gray);
  background: var(--pure-white);
}

.admin-stats .metric-tile strong {
  color: var(--passport-navy);
}

.admin-inbox,
.crm-detail,
.operations-review-screen,
.operations-applicant-rail,
.operations-review-context {
  border-color: var(--mist-gray);
  background: var(--pure-white);
}

.admin-inbox__header,
.admin-inbox-item--active,
.operations-detail-panel .submitted-review-card__header {
  background: var(--cloud-white);
}

.operations-applicant-card--active {
  border-color: var(--global-teal);
  background: var(--teal-soft);
  color: var(--passport-navy);
}

.operations-applicant-card--active small {
  color: var(--slate);
}

.status-pill--submitted,
.status-pill--updated,
.status-pill--won,
.status-pill--data-submitted,
.status-pill--form-submitted,
.status-pill--fee-paid,
.status-pill--appointment-booked {
  border-color: var(--mint-line);
  background: var(--teal-soft);
  color: #087a7a;
}

.status-pill--follow-up,
.status-pill--data-in-progress,
.status-pill--form-review,
.admin-attention {
  border-color: var(--amber-line);
  background: var(--surface-amber);
  color: #a63b25;
}

/* Minimal workspace refresh -------------------------------------------------
   One quiet surface, one clear action, and colour reserved for state. */
:root {
  --workspace-bg: #f6f8fa;
  --quiet-line: #e8edf2;
  --quiet-text: #667085;
  --soft-navy: #f2f5f8;
}

body {
  background: var(--workspace-bg);
}

body[data-view="dashboard"] .brand-strip {
  display: none;
}

.app-shell {
  width: min(1280px, calc(100% - 32px));
  padding-top: 8px;
}

.topbar {
  min-height: 68px;
  padding: 10px 0;
}

.topbar__identity {
  gap: 10px;
}

.topbar__logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
}

.topbar h1 {
  font-size: 1.35rem;
}

.eyebrow {
  margin-bottom: 2px;
  font-size: 0.64rem;
}

.account-button {
  min-height: 36px;
  border-color: var(--quiet-line);
}

body[data-view="dashboard"] .task-panel {
  border: 0;
  background: transparent;
  box-shadow: none;
}

body[data-view="dashboard"] .task-panel__header,
body[data-role="admin"] .task-panel__header {
  padding: 20px 0 14px;
  border: 0;
  background: transparent;
}

body[data-view="dashboard"] .task-panel__header h2 {
  font-size: 1.55rem;
  letter-spacing: -0.025em;
}

body[data-view="dashboard"] .task-content {
  padding: 12px 0 28px;
}

/* The long intake form remains structured but loses the boxed-in feeling. */
body[data-view="form"] .task-panel {
  border-color: var(--quiet-line);
  border-radius: 14px;
}

body[data-view="form"] .task-panel__header {
  padding: 20px 24px 16px;
}

body[data-view="form"] .task-content {
  padding: 24px;
}

.progress-strip {
  padding-block: 8px 10px;
  background: rgba(246, 248, 250, 0.94);
}

.progress-strip__track {
  height: 4px;
}

.section-pills {
  gap: 2px;
  margin-top: 7px;
}

.section-pill {
  border: 0;
  padding: 6px 9px;
  background: transparent;
  box-shadow: none;
  font-size: 0.72rem;
}

.section-pill.is-complete {
  background: var(--soft-navy);
  color: var(--passport-navy);
}

.form-field input,
.form-field select,
.form-field textarea,
.admin-search {
  border-color: var(--quiet-line);
  background: #fff;
}

.form-field input:hover,
.form-field select:hover,
.form-field textarea:hover,
.admin-search:hover {
  border-color: #cbd5df;
}

/* Customer workspace */
.customer-dashboard {
  gap: 16px;
}

.customer-case-summary {
  padding: 10px 0 14px;
  border-bottom-color: var(--quiet-line);
}

.customer-dashboard__header {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--quiet-line);
  border-radius: 14px;
  background: #fff;
}

.customer-dashboard__title h3 {
  font-size: 1.22rem;
  letter-spacing: -0.015em;
}

.customer-dashboard__summary {
  margin-top: 4px;
  color: var(--quiet-text);
  font-size: 0.84rem;
}

.customer-dashboard__metrics {
  display: flex;
  grid-column: 1 / -1;
  gap: 0;
  border: 0;
  border-top: 1px solid var(--quiet-line);
  border-radius: 0;
  padding-top: 14px;
}

.customer-metric,
.customer-metric:nth-child(n) {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-height: 0;
  border: 0;
  border-right: 1px solid var(--quiet-line);
  padding: 0 20px;
  background: transparent;
}

.customer-metric:first-child {
  padding-left: 0;
}

.customer-metric:last-child {
  border-right: 0;
}

.customer-metric strong {
  color: var(--passport-navy) !important;
  font-size: 1rem;
}

.customer-metric span {
  font-size: 0.76rem;
}

.customer-dashboard-empty {
  min-height: 220px;
  padding: 34px;
  border-color: var(--quiet-line);
  border-radius: 14px;
  background: #fff;
}

.customer-dashboard-empty__content {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 620px;
}

.customer-dashboard-empty__mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--teal-soft);
  color: var(--global-teal);
  font-size: 1.65rem;
  font-weight: 400;
  line-height: 1;
}

.customer-dashboard-empty h3 {
  font-size: 1.25rem;
}

.customer-dashboard-empty p:not(.kicker) {
  max-width: 520px;
  line-height: 1.5;
}

.applicant-count-panel--compact {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
  border-color: var(--quiet-line);
  border-radius: 14px;
  padding: 20px;
  background: #fff;
}

.applicant-count-panel--compact .applicant-count-copy {
  align-self: center;
}

.applicant-count-panel--compact .applicant-count-options {
  justify-content: flex-end;
}

.applicant-count-panel--compact .count-option {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

.applicant-count-panel--compact .count-option.is-selected {
  border-color: var(--passport-navy);
  background: var(--passport-navy);
  color: #fff;
  box-shadow: none;
}

.applicant-count-panel--compact .applicant-count-field,
.applicant-count-panel--compact .applicant-name-grid,
.applicant-count-panel--compact .application-empty__actions {
  grid-column: 1 / -1;
}

.applicant-count-panel--compact .applicant-count-field {
  width: min(180px, 100%);
}

.applicant-count-panel--compact .application-empty__actions {
  padding-top: 4px;
}

.customer-dashboard-section {
  gap: 10px;
}

.customer-dashboard-section__head {
  padding: 0 2px;
}

.application-group-card {
  padding: 18px;
  border: 1px solid var(--quiet-line);
  border-radius: 14px;
  background: #fff;
}

.application-group-card__head {
  padding-bottom: 14px;
}

.application-group-members {
  grid-template-columns: 1fr;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--quiet-line);
  border-radius: 11px;
}

.member-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 0;
  align-items: center;
  gap: 14px;
  border: 0;
  border-bottom: 1px solid var(--quiet-line);
  border-radius: 0;
  padding: 14px;
}

.member-card:last-child {
  border-bottom: 0;
}

.member-card:hover {
  border-color: var(--quiet-line);
  background: #fafbfc;
}

.individual-application-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border-color: var(--quiet-line);
  border-radius: 12px;
  background: #fff;
}

.individual-application-card__head {
  align-items: center;
  padding: 14px 16px;
  background: transparent;
}

.individual-application-card__actions {
  padding: 10px 14px;
}

/* Admin workspace */
body[data-role="admin"] .task-panel {
  max-width: 1280px;
}

.crm-admin,
.crm-stack {
  gap: 14px;
}

.crm-toolbar {
  min-height: 48px;
  padding: 4px;
  border: 1px solid var(--quiet-line);
  border-radius: 12px;
  background: #fff;
}

.crm-tabs {
  gap: 2px;
}

.crm-tab {
  min-height: 36px;
  border: 0;
  border-radius: 9px;
  padding: 7px 14px;
  background: transparent;
  color: var(--quiet-text);
  font-weight: 700;
}

.crm-tab--active,
.crm-tab[aria-selected="true"] {
  border: 0;
  background: var(--passport-navy);
  color: #fff;
}

.crm-toolbar > .ghost-button {
  min-height: 34px;
  border: 0;
  color: var(--quiet-text);
}

.crm-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.crm-toolbar__actions .ghost-button {
  min-height: 34px;
  border: 0;
  color: var(--quiet-text);
}

.reminder-settings-button {
  position: relative;
  padding-left: 28px;
}

.reminder-settings-button::before {
  content: "";
  position: absolute;
  left: 13px;
  width: 7px;
  height: 7px;
  border: 1px solid #98a2b3;
  border-radius: 50%;
  background: #fff;
}

.reminder-settings-button.is-enabled::before {
  border-color: var(--global-teal);
  background: var(--global-teal);
  box-shadow: 0 0 0 3px var(--teal-soft);
}

.email-history-button {
  position: relative;
  padding-left: 29px;
}

.email-history-button::before {
  content: "↺";
  position: absolute;
  left: 12px;
  color: #667085;
  font-size: 0.82rem;
  font-weight: 800;
}

.admin-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--quiet-line);
  border-radius: 12px;
  background: #fff;
}

.admin-stats .metric-tile,
.admin-stats .metric-tile:nth-child(n) {
  display: flex;
  min-height: 62px;
  align-items: center;
  gap: 10px;
  border: 0;
  border-right: 1px solid var(--quiet-line);
  border-radius: 0;
  padding: 12px 16px;
  background: #fff;
}

.admin-stats .metric-tile:last-child {
  border-right: 0;
}

.admin-stats .metric-tile strong {
  font-size: 1.2rem;
}

.admin-stats .metric-tile span {
  color: var(--quiet-text);
  font-size: 0.74rem;
  font-weight: 650;
}

.crm-section-head {
  min-height: 42px;
  padding: 0 2px;
}

.crm-section-head h3 {
  font-size: 1.08rem;
}

.crm-section-head p {
  font-size: 0.82rem;
}

.crm-split {
  grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
  gap: 12px;
}

.admin-inbox,
.crm-detail,
.operations-review-screen {
  border-color: var(--quiet-line);
  border-radius: 12px;
  background: #fff;
}

.admin-inbox__header {
  gap: 9px;
  padding: 14px;
  background: #fff;
}

.admin-inbox-list {
  align-content: start;
  grid-auto-rows: max-content;
  background: #fff;
}

.crm-inbox-item,
.admin-inbox-item {
  gap: 5px;
  padding: 12px 14px;
  border-bottom-color: var(--quiet-line);
}

.admin-inbox-item:nth-child(even) {
  background: transparent;
}

.crm-inbox-item:hover,
.admin-inbox-item:hover {
  background: #f8fafb;
}

.crm-inbox-item--active,
.admin-inbox-item--active {
  background: var(--teal-soft);
  box-shadow: inset 3px 0 0 var(--global-teal);
}

.crm-inbox-entry {
  display: grid;
  border-bottom: 1px solid var(--quiet-line);
  background: #fff;
}

.crm-inbox-entry > .crm-inbox-item {
  border-bottom: 0;
}

.crm-inbox-entry--active {
  background: var(--teal-soft);
  box-shadow: inset 3px 0 0 var(--global-teal);
}

.crm-inbox-entry--active > .crm-inbox-item {
  box-shadow: none;
}

.crm-inbox-entry__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin: 0 14px 12px;
  padding: 7px 10px;
  text-decoration: none;
}

.crm-detail {
  gap: 16px;
  padding: 18px;
}

.crm-detail-head {
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--quiet-line);
}

.crm-detail-head h3 {
  font-size: 1.22rem;
}

.crm-action-row {
  justify-content: flex-start;
  padding: 0;
}

.crm-detail > .crm-card,
.crm-detail > .crm-invite-box {
  padding-top: 16px;
  border-top-color: var(--quiet-line);
}

.crm-invite-box {
  gap: 14px;
  border-color: #a7e3d0;
  background: #f2fbf7;
}

.crm-invite-box__head,
.crm-invite-box__link-actions,
.crm-invite-box__message-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.crm-invite-box__head {
  justify-content: space-between;
}

.crm-invite-box__head strong,
.crm-invite-box__head p {
  display: block;
  margin: 0;
}

.crm-invite-box__head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.crm-invite-box__status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 9px;
  background: #d9f5e9;
  color: #047857;
  font-size: 0.7rem;
  font-weight: 800;
}

.crm-invite-box__open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  text-decoration: none;
}

.crm-invite-box__message {
  min-height: 148px;
  resize: vertical;
  background: #fff;
  line-height: 1.5;
}

.crm-invite-box__message-actions {
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .crm-invite-box__head,
  .crm-invite-box__link-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .crm-invite-box__status {
    align-self: flex-start;
  }

  .crm-invite-box__link-actions > *,
  .crm-invite-box__message-actions > * {
    width: 100%;
  }
}

.crm-card h4,
.crm-card-head h4 {
  margin: 0;
  font-size: 0.88rem;
  color: var(--passport-navy);
}

.crm-detail .submitted-review-details {
  display: grid;
  gap: 0;
}

.crm-detail .submitted-review-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.35fr) minmax(0, 1fr);
  gap: 16px;
  border: 0;
  border-bottom: 1px solid var(--quiet-line);
  border-radius: 0;
  background: transparent;
}

.crm-detail .submitted-review-row:last-child {
  border-bottom: 0;
}

.crm-detail .submitted-review-row dt,
.crm-detail .submitted-review-row dd {
  min-height: 0;
  border: 0;
  padding: 9px 0;
  background: transparent;
}

.crm-detail .submitted-review-row dt {
  color: var(--quiet-text);
  font-size: 0.76rem;
  font-weight: 650;
}

.crm-detail .submitted-review-row dd {
  color: var(--passport-navy);
  font-size: 0.82rem;
}

.crm-form {
  gap: 12px;
}

.crm-form .field-label {
  font-size: 0.72rem;
}

.crm-form textarea {
  min-height: 78px;
}

.crm-note-form textarea {
  min-height: 68px;
}

.crm-disclosure {
  overflow: hidden;
  border: 1px solid var(--quiet-line);
  border-radius: 10px;
  background: #fff;
}

.crm-disclosure summary {
  position: relative;
  padding: 13px 40px 13px 14px;
  color: var(--passport-navy);
  font-size: 0.84rem;
  font-weight: 750;
  cursor: pointer;
  list-style: none;
}

.crm-disclosure summary::-webkit-details-marker {
  display: none;
}

.crm-disclosure summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 15px;
  color: var(--quiet-text);
  font-size: 1.1rem;
  font-weight: 400;
  transform: translateY(-50%);
}

.crm-disclosure[open] summary {
  border-bottom: 1px solid var(--quiet-line);
}

.crm-disclosure[open] summary::after {
  content: "−";
}

.crm-disclosure > .crm-form {
  padding: 16px;
}

.crm-dialog-backdrop {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16, 24, 40, 0.48);
  backdrop-filter: blur(3px);
}

.crm-dialog {
  display: grid;
  width: min(560px, 100%);
  max-height: min(760px, calc(100dvh - 40px));
  overflow-y: auto;
  border: 1px solid var(--quiet-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(16, 24, 40, 0.24);
}

.crm-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 22px 18px;
  border-bottom: 1px solid var(--quiet-line);
}

.crm-dialog__header h3,
.crm-dialog__header p {
  margin: 0;
}

.crm-dialog__header h3 {
  font-size: 1.24rem;
}

.crm-dialog__header p:not(.kicker) {
  max-width: 430px;
  margin-top: 5px;
  color: var(--quiet-text);
  font-size: 0.84rem;
  line-height: 1.45;
}

.crm-dialog__close {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.78rem;
}

.crm-dialog__form {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.crm-field-help {
  display: block;
  margin-top: 6px;
  color: var(--quiet-text);
  font-size: 0.73rem;
  line-height: 1.4;
}

.crm-toggle-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 11px;
  cursor: pointer;
}

.crm-toggle-field > input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.crm-toggle {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #d0d5dd;
  transition: background 160ms ease;
}

.crm-toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.24);
  transition: transform 160ms ease;
}

.crm-toggle-field > input:checked + .crm-toggle {
  background: var(--global-teal);
}

.crm-toggle-field > input:checked + .crm-toggle::after {
  transform: translateX(18px);
}

.crm-toggle-field > input:focus-visible + .crm-toggle {
  outline: 3px solid rgba(0, 166, 166, 0.2);
  outline-offset: 2px;
}

.crm-toggle-field__copy {
  display: grid;
  gap: 2px;
}

.crm-toggle-field__copy strong {
  font-size: 0.84rem;
}

.crm-toggle-field__copy small {
  color: var(--quiet-text);
  font-size: 0.73rem;
}

.crm-reminder-status {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--quiet-line);
  border-radius: 10px;
  background: #f8fafb;
}

.crm-reminder-status strong {
  color: var(--passport-navy);
  font-size: 0.8rem;
}

.crm-reminder-status span,
.crm-reminder-status small {
  color: var(--quiet-text);
  font-size: 0.74rem;
  line-height: 1.45;
}

.crm-reminder-status small {
  color: #b42318;
}

.crm-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 2px;
}

.crm-mini-row,
.crm-timeline-item {
  border: 0;
  border-bottom: 1px solid var(--quiet-line);
  border-radius: 0;
  padding: 10px 0;
  background: transparent;
}

.crm-timeline-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.crm-timeline-card > .crm-card-head {
  align-items: center;
}

.crm-timeline-card .crm-timeline {
  gap: 0;
}

.crm-timeline-item__marker {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid #bde7e7;
  border-radius: 9px;
  background: var(--teal-soft);
  color: #087a7a;
  font-size: 0.66rem;
  font-weight: 800;
}

.crm-timeline-item__copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.crm-timeline-item__copy strong {
  color: var(--passport-navy);
  font-size: 0.82rem;
}

.crm-timeline-item__duration {
  justify-self: end;
  border: 1px solid var(--quiet-line);
  border-radius: 999px;
  padding: 5px 9px;
  background: #f8fafb;
  color: var(--quiet-text);
  font-size: 0.68rem;
  font-weight: 750;
  white-space: nowrap;
}

.crm-timeline-empty {
  margin: 0;
  color: var(--quiet-text);
  font-size: 0.78rem;
}

.crm-mini-row:last-child,
.crm-timeline-item:last-child {
  border-bottom: 0;
}

@media (max-width: 560px) {
  .crm-timeline-item {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 8px 10px;
  }

  .crm-timeline-item__duration {
    grid-column: 2;
    justify-self: start;
  }
}

.status-pill {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.67rem;
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 1280px);
  }

  .topbar {
    align-items: center;
  }

  .account-bar {
    flex: 0 1 auto;
  }

  .account-bar__details small {
    display: none;
  }

  body[data-view="dashboard"] .task-panel__header {
    padding-top: 14px;
  }

  .customer-dashboard__header,
  .customer-dashboard-empty,
  .customer-dashboard-empty__content {
    align-items: flex-start;
    flex-direction: column;
  }

  .customer-dashboard__header {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .customer-dashboard__actions {
    width: 100%;
    justify-content: stretch;
  }

  .customer-dashboard__actions button {
    flex: 1 1 140px;
  }

  .customer-dashboard__metrics {
    grid-column: 1;
    width: 100%;
  }

  .customer-metric,
  .customer-metric:nth-child(n) {
    flex: 1 1 0;
    padding-inline: 10px;
  }

  .customer-metric:first-child {
    padding-left: 0;
  }

  .customer-dashboard-empty {
    min-height: 0;
    padding: 24px;
  }

  .customer-dashboard-empty__mark {
    width: 42px;
    height: 42px;
  }

  .applicant-count-panel--compact {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .applicant-count-panel--compact .applicant-count-options,
  .applicant-count-panel--compact .applicant-count-copy,
  .applicant-count-panel--compact .applicant-count-field,
  .applicant-count-panel--compact .applicant-name-grid,
  .applicant-count-panel--compact .application-empty__actions {
    grid-column: 1;
  }

  .applicant-count-panel--compact .applicant-count-options {
    justify-content: flex-start;
  }

  .member-card,
  .individual-application-card {
    grid-template-columns: 1fr;
  }

  .member-card__actions,
  .individual-application-card__actions {
    justify-content: flex-start;
  }

  .individual-application-card__actions {
    padding-top: 0;
  }

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

  .admin-stats .metric-tile:nth-child(2) {
    border-right: 0;
  }

  .admin-stats .metric-tile:nth-child(-n + 2) {
    border-bottom: 1px solid var(--quiet-line);
  }

  .crm-split,
  .crm-form {
    grid-template-columns: 1fr;
  }

  .crm-toolbar {
    align-items: center;
    flex-direction: row;
  }

  .crm-tabs {
    flex: 1;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .crm-tab {
    flex: 0 0 auto;
  }

  .crm-toolbar > .ghost-button {
    width: auto;
    flex: 0 0 auto;
  }

  .crm-toolbar__actions {
    flex: 0 0 auto;
  }

  .crm-toolbar__actions .reminder-settings-button {
    width: 38px;
    overflow: hidden;
    padding-inline: 0;
    color: transparent;
    white-space: nowrap;
  }

  .crm-toolbar__actions .reminder-settings-button::before {
    left: 16px;
  }

  .crm-toolbar__actions .reminder-settings-button::after {
    content: "✉";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--quiet-text);
    font-size: 0.9rem;
  }

  .crm-toolbar__actions .reminder-settings-button::before {
    display: none;
  }

  .crm-toolbar__actions .reminder-settings-button.is-enabled::after {
    color: var(--global-teal);
  }

  .crm-toolbar__actions .email-history-button {
    width: 38px;
    overflow: hidden;
    padding-inline: 0;
    color: transparent;
    white-space: nowrap;
  }

  .crm-toolbar__actions .email-history-button::before {
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--quiet-text);
    font-size: 1rem;
  }

  .crm-action-row {
    align-items: stretch;
  }

  .crm-detail .submitted-review-row {
    grid-template-columns: minmax(90px, 0.4fr) minmax(0, 1fr);
  }
}

@media (max-width: 460px) {
  .topbar h1 {
    font-size: 1.12rem;
  }

  .account-bar__details {
    display: none;
  }

  .customer-dashboard__metrics {
    justify-content: space-between;
  }

  .customer-metric,
  .customer-metric:nth-child(n) {
    display: grid;
    gap: 2px;
  }

  .admin-stats .metric-tile {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .crm-section-head,
  .crm-detail-head,
  .crm-action-row {
    align-items: stretch;
    flex-direction: column;
  }

  .crm-dialog-backdrop {
    align-items: end;
    padding: 0;
  }

  .crm-dialog {
    width: 100%;
    max-height: calc(100dvh - 20px);
    border-radius: 16px 16px 0 0;
  }

  .crm-dialog__header,
  .crm-dialog__form {
    padding: 18px;
  }

  .crm-dialog__actions > button {
    flex: 1 1 0;
  }
}

/* Lead menu flares --------------------------------------------------------- */
.pill-group {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.flare-pill {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.flare-pill--sales {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.flare-pill--operations {
  border-color: #99f6e4;
  background: #f0fdfa;
  color: #0f766e;
}

.flare-pill--appointment {
  border-color: #ddd6fe;
  background: #f5f3ff;
  color: #6d28d9;
}

.crm-promotion-form {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.crm-promotion-form .crm-card-head p {
  margin: 4px 0 0;
  color: var(--quiet-text);
  line-height: 1.4;
}

.crm-promotion-form__fields {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.crm-promotion-form__fields .crm-field-wide {
  grid-column: 1 / -1;
}

.crm-action-row--danger {
  justify-content: flex-end;
}

.crm-action-row--danger .danger-button {
  border-color: #efb1aa;
  background: #fff5f4;
  color: #b42318;
}

@media (max-width: 760px) {
  .crm-promotion-form__fields {
    grid-template-columns: 1fr;
  }

  .crm-promotion-form .primary-button {
    width: 100%;
  }
}

/* Admin in-place applicant editor ----------------------------------------- */
.admin-applicant-edit-dialog {
  width: min(880px, calc(100vw - 24px));
  max-height: min(900px, calc(100dvh - 24px));
  border-color: #dfe5ee;
  border-radius: 18px;
  background: #fff;
}

.admin-applicant-edit-dialog form {
  max-height: min(900px, calc(100dvh - 24px));
}

.admin-applicant-edit-head {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px 17px;
  border-bottom: 1px solid #eaecf0;
  background: #fbfcfe;
}

.admin-applicant-edit-head h3,
.admin-applicant-edit-head p {
  margin: 0;
  padding: 0;
}

.admin-applicant-edit-head h3 {
  margin-top: 2px;
  color: #101828;
  font-size: 1.3rem;
}

.admin-applicant-edit-head p:not(.kicker) {
  margin-top: 5px;
  color: #667085;
  font-size: 0.78rem;
}

.admin-applicant-edit-body {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  gap: 14px;
  overflow-y: auto;
  padding: 18px 22px 24px;
  background: #f6f8fb;
}

.admin-applicant-edit-status {
  border: 1px solid #b7e4d7;
  border-radius: 10px;
  padding: 11px 13px;
  background: #f1fbf7;
  color: #047857;
  font-size: 0.74rem;
  line-height: 1.45;
}

.admin-applicant-edit-status--error {
  border-color: #fecdca;
  background: #fff5f4;
  color: #b42318;
}

.admin-applicant-edit-section {
  display: grid;
  gap: 14px;
  border: 1px solid #e1e7ef;
  border-radius: 13px;
  padding: 16px;
  background: #fff;
}

.admin-applicant-edit-section__head h4,
.admin-applicant-edit-section__head p {
  margin: 0;
}

.admin-applicant-edit-section__head h4 {
  color: #344054;
  font-size: 0.86rem;
}

.admin-applicant-edit-section__head p {
  margin-top: 3px;
  color: #667085;
  font-size: 0.7rem;
}

.admin-applicant-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}

.admin-applicant-edit-grid .form-field {
  gap: 6px;
  margin: 0;
}

.admin-applicant-edit-grid input,
.admin-applicant-edit-grid select,
.admin-applicant-edit-grid textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #dfe4eb;
  border-radius: 9px;
  padding: 9px 11px;
  background: #fff;
}

.admin-applicant-edit-grid textarea {
  min-height: 82px;
  resize: vertical;
}

.admin-applicant-edit-field--wide {
  grid-column: 1 / -1;
}

.admin-applicant-edit-actions {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 22px calc(13px + env(safe-area-inset-bottom));
  border-top: 1px solid #eaecf0;
  background: #fff;
}

.crm-application-picker {
  display: grid;
  gap: 0;
  padding: 10px 22px 22px;
}

.crm-application-picker__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #eaecf0;
}

.crm-application-picker__item:last-child {
  border-bottom: 0;
}

.crm-application-picker__index {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #eef4ff;
  color: #3538cd;
  font-size: 0.7rem;
  font-weight: 850;
}

.crm-application-picker__copy {
  display: grid;
  gap: 2px;
}

.crm-application-picker__copy strong {
  color: #344054;
  font-size: 0.8rem;
}

.crm-application-picker__copy small {
  color: #667085;
  font-size: 0.7rem;
}

@media (max-width: 620px) {
  .admin-applicant-edit-dialog {
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - 10px);
    margin: auto 0 0;
    border-radius: 16px 16px 0 0;
  }

  .admin-applicant-edit-dialog form {
    max-height: calc(100dvh - 10px);
  }

  .admin-applicant-edit-head,
  .admin-applicant-edit-body,
  .admin-applicant-edit-actions {
    padding-inline: 16px;
  }

  .admin-applicant-edit-grid {
    grid-template-columns: 1fr;
  }

  .admin-applicant-edit-field--wide {
    grid-column: 1;
  }

  .admin-applicant-edit-actions > button {
    flex: 1 1 0;
  }

  .crm-application-picker__item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .crm-application-picker__item > button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

/* Loading feedback -------------------------------------------------------- */
.crm-loader-spinner {
  display: inline-block;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border: 2px solid #cbd5e1;
  border-top-color: #0f766e;
  border-radius: 50%;
  animation: crm-loader-spin 700ms linear infinite;
}

.crm-loader-spinner--large {
  width: 34px;
  height: 34px;
  border-width: 3px;
}

@keyframes crm-loader-spin {
  to { transform: rotate(360deg); }
}

.crm-loading-state {
  display: flex;
  min-height: 150px;
  align-items: center;
  justify-content: center;
  gap: 13px;
  border: 1px solid #e1e7ef;
  border-radius: 14px;
  padding: 28px;
  background: #fff;
  color: #344054;
}

.crm-loading-state__copy {
  display: grid;
  gap: 3px;
}

.crm-loading-state__copy strong {
  font-size: 0.84rem;
}

.crm-loading-state__copy small {
  color: #667085;
  font-size: 0.72rem;
}

.crm-loading-overlay {
  position: fixed;
  z-index: 1200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(2px);
}

.crm-loading-overlay__panel {
  display: grid;
  place-items: center;
  min-width: min(280px, calc(100vw - 32px));
  gap: 9px;
  border: 1px solid #dfe5ee;
  border-radius: 15px;
  padding: 24px;
  background: #fff;
  color: #344054;
  text-align: center;
  box-shadow: 0 22px 60px rgba(16, 24, 40, 0.2);
}

.crm-loading-overlay__panel strong {
  margin-top: 4px;
  font-size: 0.86rem;
}

.crm-loading-overlay__panel small {
  color: #667085;
  font-size: 0.72rem;
}

.admin-applicant-edit-status--loading {
  display: flex;
  align-items: center;
  gap: 9px;
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.admin-applicant-edit-status--loading .crm-loader-spinner {
  width: 16px;
  height: 16px;
  border-color: #bfdbfe;
  border-top-color: #1d4ed8;
}

@media (prefers-reduced-motion: reduce) {
  .crm-loader-spinner {
    animation-duration: 1.4s;
  }
}

/* Two-worker notification settings --------------------------------------- */
.crm-reminder-dialog {
  width: min(780px, 100%);
}

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

.crm-reminder-worker {
  display: grid;
  align-content: start;
  gap: 13px;
  border: 1px solid #dfe5ee;
  border-radius: 13px;
  padding: 15px;
  background: #fbfcfe;
}

.crm-reminder-worker:first-child {
  border-color: #b7e4d7;
  background: #f4fbf8;
}

.crm-reminder-worker:last-child {
  border-color: #c7d7fe;
  background: #f5f8ff;
}

.crm-reminder-worker__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
}

.crm-reminder-worker__number {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #d1fae5;
  color: #047857;
  font-size: 0.7rem;
  font-weight: 900;
}

.crm-reminder-worker:last-child .crm-reminder-worker__number {
  background: #e0e7ff;
  color: #3730a3;
}

.crm-reminder-worker__head strong,
.crm-reminder-worker__head p {
  margin: 0;
}

.crm-reminder-worker__head strong {
  color: #344054;
  font-size: 0.8rem;
}

.crm-reminder-worker__head p {
  margin-top: 4px;
  color: #667085;
  font-size: 0.69rem;
  line-height: 1.4;
}

.crm-reminder-worker__stages {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.crm-reminder-worker__stages span {
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  padding: 4px 7px;
  background: #fff;
  color: #475467;
  font-size: 0.64rem;
  font-weight: 750;
}

.crm-reminder-worker .form-field {
  margin: 0;
}

.crm-reminder-schedule {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.65fr);
  align-items: center;
  gap: 18px;
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  padding: 14px;
  background: #fff;
}

.crm-reminder-schedule__head {
  display: grid;
  gap: 3px;
}

.crm-reminder-schedule__head strong {
  color: #344054;
  font-size: 0.78rem;
}

.crm-reminder-schedule__head small {
  color: #667085;
  font-size: 0.69rem;
}

.crm-reminder-schedule .form-field {
  margin: 0;
}

@media (max-width: 680px) {
  .crm-reminder-workers,
  .crm-reminder-schedule {
    grid-template-columns: 1fr;
  }
}

/* Brevo email history ----------------------------------------------------- */
.crm-email-history-dialog {
  width: min(920px, 100%);
}

.crm-email-history-body {
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 20px 22px 22px;
}

.crm-email-history-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.crm-email-history-metric {
  display: grid;
  gap: 3px;
  border: 1px solid #e1e7ef;
  border-radius: 12px;
  padding: 14px 15px;
  background: #fbfcfe;
}

.crm-email-history-metric:first-child {
  border-color: #b7e4d7;
  background: #f4fbf8;
}

.crm-email-history-metric strong {
  color: #101828;
  font-size: 1.45rem;
  line-height: 1;
}

.crm-email-history-metric span {
  color: #344054;
  font-size: 0.76rem;
  font-weight: 800;
}

.crm-email-history-metric small {
  color: #667085;
  font-size: 0.66rem;
}

.crm-email-history-table-wrap {
  min-width: 0;
  overflow-x: auto;
  border: 1px solid #e1e7ef;
  border-radius: 12px;
}

.crm-email-history-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.73rem;
}

.crm-email-history-table th {
  padding: 10px 12px;
  border-bottom: 1px solid #e1e7ef;
  background: #f8fafc;
  color: #667085;
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0.035em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.crm-email-history-table td {
  max-width: 280px;
  padding: 12px;
  border-bottom: 1px solid #edf0f4;
  color: #475467;
  line-height: 1.4;
  overflow-wrap: anywhere;
  vertical-align: top;
}

.crm-email-history-table tbody tr:last-child td {
  border-bottom: 0;
}

.crm-email-history-table tbody tr:hover td {
  background: #fbfcfe;
}

.crm-email-history-recipient {
  color: #101828;
  font-size: 0.74rem;
}

.crm-email-history-message-id {
  color: #667085;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.64rem;
}

.crm-email-history-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #667085;
  font-size: 0.7rem;
}

.crm-email-history-pagination {
  display: flex;
  flex: 0 0 auto;
  gap: 5px;
}

.crm-email-history-pagination .ghost-button {
  min-height: 34px;
  padding: 6px 10px;
}

.crm-email-history-pagination .ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.crm-email-history-empty {
  display: grid;
  place-items: center;
  min-height: 220px;
  gap: 5px;
  border: 1px dashed #d0d5dd;
  border-radius: 12px;
  padding: 30px;
  background: #fbfcfe;
  color: #667085;
  text-align: center;
}

.crm-email-history-empty span {
  font-size: 1.5rem;
}

.crm-email-history-empty strong,
.crm-email-history-empty p {
  margin: 0;
}

.crm-email-history-empty strong {
  color: #344054;
  font-size: 0.84rem;
}

.crm-email-history-empty p {
  font-size: 0.72rem;
}

.crm-email-history-error {
  display: grid;
  gap: 14px;
  padding: 22px;
}

@media (max-width: 680px) {
  .crm-email-history-summary {
    grid-template-columns: 1fr;
  }

  .crm-email-history-body {
    padding: 16px;
  }

  .crm-email-history-table-wrap {
    overflow: visible;
    border: 0;
  }

  .crm-email-history-table,
  .crm-email-history-table tbody,
  .crm-email-history-table tr,
  .crm-email-history-table td {
    display: block;
    width: 100%;
  }

  .crm-email-history-table thead {
    display: none;
  }

  .crm-email-history-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 12px;
    margin-bottom: 9px;
    border: 1px solid #e1e7ef;
    border-radius: 11px;
    padding: 12px;
    background: #fff;
  }

  .crm-email-history-table td {
    max-width: none;
    border: 0;
    padding: 0;
  }

  .crm-email-history-table td:first-child,
  .crm-email-history-table td:nth-child(2) {
    grid-column: 1 / -1;
  }

  .crm-email-history-table td:nth-child(3) {
    color: #667085;
    font-size: 0.66rem;
  }

  .crm-email-history-table__message {
    display: none !important;
  }

  .crm-email-history-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .crm-email-history-pagination {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Keep the customer workspace hierarchy authoritative over legacy dashboard rules. */
body[data-view="dashboard"][data-role="customer"] .task-panel__header {
  display: none;
}

body[data-view="dashboard"][data-role="customer"] .task-content {
  padding-top: 30px;
}

body[data-view="dashboard"][data-role="customer"] .customer-dashboard {
  gap: 22px;
}

body[data-view="dashboard"][data-role="customer"] .customer-case-summary {
  display: grid;
  align-items: stretch;
  gap: 16px;
  border: 1px solid var(--quiet-line);
  border-radius: 16px;
  padding: 18px;
  background: #fff;
}

body[data-view="dashboard"][data-role="customer"] .individual-application-card__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

@media (max-width: 760px) {
  body[data-view="dashboard"][data-role="customer"] .task-content {
    padding-top: 22px;
  }

  body[data-view="dashboard"][data-role="customer"] .customer-dashboard__intro {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
  }

  body[data-view="dashboard"][data-role="customer"] .customer-dashboard__sidebar {
    grid-template-columns: 1fr;
  }

  body[data-view="dashboard"][data-role="customer"] .individual-application-card__head {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
}

@media (max-width: 480px) {
  body[data-view="dashboard"][data-role="customer"] .individual-application-card__head {
    grid-template-columns: auto minmax(0, 1fr);
  }
}

.customer-submission-lock {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  border: 1px solid #f3c7bc;
  border-radius: 12px;
  padding: 15px 16px;
  background: #fff7f5;
  color: #713b31;
}

.customer-submission-lock__icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--sunrise-coral);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
}

.customer-submission-lock strong,
.customer-submission-lock p {
  margin: 0;
}

.customer-submission-lock strong {
  display: block;
  color: #8f2f20;
  font-size: 0.86rem;
}

.customer-submission-lock p {
  margin-top: 4px;
  font-size: 0.76rem;
  line-height: 1.5;
}

.application-group-card__delete {
  flex: 0 0 auto;
}

.delete-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.delete-action::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M8 6V4h8v2'/%3E%3Cpath d='M19 6l-1 14H6L5 6'/%3E%3Cpath d='M10 11v5M14 11v5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M8 6V4h8v2'/%3E%3Cpath d='M19 6l-1 14H6L5 6'/%3E%3Cpath d='M10 11v5M14 11v5'/%3E%3C/svg%3E") center / contain no-repeat;
}

@media (max-width: 560px) {
  .application-group-card__delete {
    width: 100%;
  }
}

/* Refined admin shell, shared notes, and document previews. */
body[data-role="admin"] .topbar {
  min-height: 94px;
  padding: 10px 4px 14px;
}

body[data-role="admin"] .topbar__logo {
  width: 72px;
  height: 72px;
  border-radius: 15px;
  padding: 5px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.08);
}

body[data-role="admin"] .topbar h1 {
  font-size: 1.35rem;
}

body[data-role="admin"] .task-panel__header {
  display: none;
}

body[data-role="admin"] .task-content {
  padding: 0 0 32px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.crm-workflow-header {
  gap: 14px;
  padding-top: 16px;
}

.crm-workflow-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 48px;
  border: 1px solid var(--quiet-line);
  border-radius: 13px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 3px 12px rgba(16, 24, 40, 0.04);
}

.crm-workflow-toolbar .crm-toolbar__actions {
  width: 100%;
  justify-content: flex-end;
}

.crm-workflow-navigation,
.crm-pdf-dialog__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.crm-detail-navigation > .crm-detail-nav-button:first-child::before {
  content: "←";
  margin-right: 7px;
}

.crm-detail-navigation > .crm-detail-nav-button:last-child::before {
  content: "⌂";
  margin-right: 7px;
}

.crm-stage-nav {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  max-width: none;
  margin: 0;
}

.crm-notes-card {
  gap: 14px;
  border-color: #d8e3ef;
  background: #f9fbfd;
}

.crm-notes-card .crm-card-head h4,
.crm-notes-card .crm-card-head p,
.crm-note-item p {
  margin: 0;
}

.crm-notes-card .crm-card-head p {
  margin-top: 4px;
  color: var(--quiet-text);
  font-size: 0.72rem;
}

.crm-notes-card .crm-note-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.crm-notes-card .crm-note-form .crm-form-actions {
  align-self: end;
  margin: 0;
}

.crm-note-list {
  display: grid;
  gap: 8px;
}

.crm-note-item {
  display: grid;
  gap: 6px;
  border-left: 3px solid var(--global-teal);
  border-radius: 0 9px 9px 0;
  padding: 10px 12px;
  background: #fff;
}

.crm-note-item__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.crm-note-item__meta strong,
.crm-note-item__meta small {
  font-size: 0.7rem;
}

.crm-note-item__meta small,
.crm-notes-empty {
  color: var(--quiet-text);
}

.crm-note-item p,
.crm-notes-empty {
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.crm-notes-card--compact .crm-note-form textarea {
  min-height: 54px;
}

.crm-pdf-card {
  border-color: #d7dff0;
  background: #fafbff;
}

.crm-pdf-card .crm-card-head p {
  margin: 4px 0 0;
  color: var(--quiet-text);
  font-size: 0.72rem;
}

.crm-pdf-card__summary {
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid #e1e6f0;
  border-radius: 10px;
  padding: 11px;
  background: #fff;
}

.crm-pdf-card__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 46px;
  border-radius: 8px;
  background: #fff0ed;
  color: #b42318;
  font-size: 0.64rem;
  font-weight: 900;
}

.crm-pdf-card__summary strong,
.crm-pdf-card__summary small {
  display: block;
}

.crm-pdf-card__summary strong {
  color: var(--passport-navy);
  font-size: 0.8rem;
}

.crm-pdf-card__summary small {
  margin-top: 3px;
  color: var(--quiet-text);
  font-size: 0.7rem;
}

.crm-pdf-dialog {
  width: min(1100px, calc(100vw - 32px));
  height: min(860px, calc(100vh - 32px));
  max-width: none;
  max-height: none;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  padding: 0;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
}

.crm-pdf-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
}

.crm-pdf-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  border-bottom: 1px solid var(--quiet-line);
  padding: 14px 18px;
}

.crm-pdf-dialog__head h3,
.crm-pdf-dialog__head p {
  margin: 0;
}

.crm-pdf-dialog__head p:not(.kicker) {
  margin-top: 3px;
  color: var(--quiet-text);
  font-size: 0.72rem;
}

.crm-pdf-dialog__frame {
  display: block;
  width: 100%;
  height: calc(100% - 76px);
  border: 0;
  background: #eef1f5;
}

@media (max-width: 760px) {
  body[data-role="admin"] .topbar {
    min-height: 82px;
  }

  body[data-role="admin"] .topbar__logo {
    width: 62px;
    height: 62px;
  }

  .crm-workflow-toolbar,
  .crm-pdf-dialog__head {
    align-items: stretch;
    flex-direction: column;
  }

  .crm-workflow-navigation,
  .crm-toolbar__actions,
  .crm-pdf-dialog__actions {
    justify-content: stretch;
  }

  .crm-workflow-navigation > *,
  .crm-pdf-dialog__actions > * {
    flex: 1 1 0;
  }

  .crm-notes-card .crm-note-form {
    grid-template-columns: 1fr;
  }

  .crm-notes-card .crm-note-form .secondary-button {
    width: 100%;
  }

  .crm-pdf-dialog {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
  }

  .crm-pdf-dialog__frame {
    height: calc(100% - 145px);
  }
}

/* Compact admin density: keep the customer workspace above the fold. */
body[data-role="admin"] .app-shell {
  padding-top: 6px;
}

body[data-role="admin"] .topbar {
  min-height: 62px;
  padding: 5px 4px 8px;
}

body[data-role="admin"] .topbar__identity {
  gap: 9px;
}

body[data-role="admin"] .topbar__logo {
  width: 50px;
  height: 50px;
  border-radius: 11px;
  padding: 3px;
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.07);
}

body[data-role="admin"] .topbar h1 {
  font-size: 1.12rem;
}

body[data-role="admin"] .topbar .eyebrow {
  font-size: 0.58rem;
}

body[data-role="admin"] .account-bar__details strong {
  font-size: 0.78rem;
}

body[data-role="admin"] .account-bar__details small {
  font-size: 0.66rem;
}

body[data-role="admin"] .account-button {
  min-height: 34px;
  padding: 7px 11px;
}

.admin-quick-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  min-width: 0;
  margin-left: auto;
}

.admin-quick-actions[hidden] {
  display: none;
}

.admin-quick-actions .primary-button,
.admin-quick-actions .ghost-button {
  min-height: 32px;
  border: 0;
  padding-block: 5px;
  font-size: 0.74rem;
  box-shadow: none;
}

body[data-role="admin"] .account-bar {
  flex: 0 0 auto;
  margin-left: 8px;
}

.crm-admin,
.crm-stack {
  gap: 10px;
}

.crm-workflow-header {
  gap: 7px;
  padding-top: 6px;
}

.crm-visa-dates {
  display: grid;
  grid-template-columns: minmax(210px, 0.7fr) minmax(0, 3fr);
  align-items: stretch;
  gap: 8px;
  padding: 8px;
  border: 1px solid #cfe3e2;
  border-radius: 12px;
  background: linear-gradient(100deg, #effbf9 0%, #fff 48%);
  box-shadow: 0 4px 16px rgba(15, 118, 110, 0.06);
}

.crm-visa-dates__intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 3px 5px;
}

.crm-visa-dates__intro > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.crm-visa-dates__intro strong {
  color: #0f766e;
  font-size: 0.82rem;
}

.crm-visa-dates__intro small {
  color: #667085;
  font-size: 0.66rem;
  line-height: 1.25;
}

.crm-visa-dates__edit {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 5px 9px;
  font-size: 0.7rem;
}

.crm-visa-dates__list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(175px, 1fr);
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
}

.crm-visa-date {
  display: grid;
  align-content: center;
  gap: 1px;
  min-height: 54px;
  padding: 7px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #fff;
}

.crm-visa-date__type {
  color: #0f766e;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.crm-visa-date strong {
  color: #172033;
  font-size: 0.82rem;
}

.crm-visa-date small,
.crm-visa-dates__empty {
  color: #667085;
  font-size: 0.67rem;
}

.crm-visa-dates__empty {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 8px 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.72);
}

.crm-visa-dates-dialog {
  width: min(1120px, calc(100vw - 32px));
}

.crm-visa-dates-form,
.crm-visa-dates-form__rows {
  display: grid;
  gap: 10px;
}

.crm-visa-dates-form__row {
  display: grid;
  grid-template-columns: minmax(130px, 0.75fr) minmax(145px, 0.65fr) minmax(170px, 1fr) minmax(200px, 1.4fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

@media (max-width: 900px) {
  .crm-visa-dates {
    grid-template-columns: 1fr;
  }

  .crm-visa-dates-form__row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .crm-visa-dates__intro {
    align-items: flex-start;
  }

  .crm-visa-dates-form__row {
    grid-template-columns: 1fr;
  }
}

.crm-workflow-toolbar {
  min-height: 40px;
  border-radius: 10px;
  padding: 3px 5px;
}

.crm-toolbar__actions .ghost-button {
  min-height: 32px;
  padding-block: 5px;
  font-size: 0.76rem;
}

.crm-detail-navigation {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}

.crm-detail-nav-button {
  min-height: 32px;
  border-color: var(--quiet-line);
  padding: 5px 10px;
  font-size: 0.72rem;
}

.crm-toolbar-add-user {
  min-height: 32px;
  padding: 5px 11px;
  font-size: 0.72rem;
}

.crm-stage-nav {
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  box-shadow: 0 3px 12px rgba(16, 24, 40, 0.04);
}

.crm-stage-tab {
  min-height: 46px;
  gap: 7px;
  border-radius: 9px;
  padding: 5px 8px;
}

.crm-stage-tab__step {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  font-size: 0.62rem;
}

.crm-stage-tab__copy {
  gap: 0;
}

.crm-stage-tab__copy strong {
  font-size: 0.75rem;
}

.crm-stage-tab__copy small {
  display: none;
}

.crm-stage-tab__count {
  min-width: 21px;
  height: 21px;
  padding-inline: 5px;
  font-size: 0.62rem;
}

.crm-stage-tab--active::after {
  right: 10px;
  bottom: -4px;
  left: 10px;
  height: 2px;
}

.crm-admin .admin-stats {
  gap: 7px;
}

.crm-admin .admin-stats .metric-tile,
.crm-admin .admin-stats .metric-tile:nth-child(n) {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 38px;
  border-radius: 9px;
  padding: 5px 11px;
}

.crm-admin .admin-stats .metric-tile strong,
.admin-stats .metric-tile strong {
  font-size: 1.08rem;
}

.crm-admin .admin-stats .metric-tile span,
.admin-stats .metric-tile span {
  font-size: 0.66rem;
}

.crm-section-head {
  min-height: 38px;
  padding-inline: 2px;
}

.crm-section-head h3 {
  font-size: 0.96rem;
}

.crm-section-head p {
  display: none;
}

.crm-section-head .primary-button {
  min-height: 34px;
  padding: 7px 12px;
  font-size: 0.75rem;
}

@media (max-width: 760px) {
  body[data-role="admin"] .topbar {
    min-height: 58px;
  }

  body[data-role="admin"] .topbar__logo {
    width: 46px;
    height: 46px;
  }

  .crm-workflow-toolbar {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
  }

  body[data-role="admin"] .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .admin-quick-actions {
    grid-column: 1 / -1;
    width: 100%;
    margin: 0;
    overflow-x: auto;
  }

  body[data-role="admin"] .account-bar {
    margin-left: 0;
  }

  .crm-workflow-navigation,
  .crm-toolbar__actions {
    flex: 1 1 auto;
  }

  .crm-toolbar__actions {
    overflow-x: auto;
  }

  .crm-stage-nav {
    grid-template-columns: repeat(4, minmax(145px, 1fr));
    overflow-x: auto;
  }

  .crm-detail-navigation {
    width: 100%;
  }

  .crm-detail-navigation > * {
    flex: 1 1 0;
  }

  .crm-admin .admin-stats {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    overflow-x: auto;
  }
}
